← Back
Editing: App.e74becde.js
import{n as Jn,x,o as v,c as L,C as m,m as S,y as B,t as D,a as A,l as E,b as O,G as Re,E as Dt,K as om,L as lm,g as Ze,k as rh,N as am,Y as yM,h as bM,H as hm,u as _,F as xt,J as _i,q as qi,T as Aa,f as xe,D as q7,v as bt,a7 as bh,X as SM,Q as wM,w as Z7,b4 as vM,M as kM,z as xM}from"./runtime-dom.esm-bundler.647fa2bb.js";/* empty css */import{d as j7,e as Te,b as Lt,h as qd,l as be,n as pi,u as je,C as yd,A as Y7,Y as Er,_ as oh,$ as MM,m as os,j as AM,t as J7,G as DM,k as X7,f as TM,M as _M,v as OM,p as Q7,z as lh,K as e9}from"./index.44a18132.js";import{u as VM}from"./ScrollAndHighlight.beaaf011.js";import{a as cn}from"./allowed.180ff3d9.js";import{g as Da,r as xf}from"./params.af7ed354.js";import{C as wt,a as bd,S as Sd,f as _r,c as wd,e as EM,b as ca,d as Zd,h as PM}from"./Caret.c1ae0fd1.js";import{G as St,P as LM,F as RM,e as ah,S as BM,C as fi,g as HM,h as NM,i as FM,j as IM,k as WM,l as zM,m as UM,E as U2,n as $2,J as K2,o as G2,p as q2,q as Mf,r as Af,s as Df,W as Z2}from"./constants.a9947cd8.js";import{C as Ce}from"./SettingsRow.74286c2c.js";import{B as $M}from"./Checkbox.92023e1b.js";import{G as KM,a as GM}from"./Row.eec044b7.js";import"./translations.d159963e.js";import{_ as Z}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as C,s as j,a as qM}from"./default-i18n.20001971.js";import{u as ZM}from"./Url.d567dae5.js";import{a as jM,C as YM}from"./LicenseKeyBar.1e135846.js";import{C as Qi}from"./Tabs.f8a7d298.js";import{C as Qt}from"./Index.739df96e.js";import{u as cm}from"./MaxCounts.7c38e980.js";import{u as dm}from"./Tags.caf4c1df.js";import{f as t9,t as i9}from"./html.77ffc6e8.js";import{e as Tf}from"./regex.8a6101c0.js";import{q as s9,r as jd,v as JM,w as XM,T as n9,e as QM,x as eA,t as Yd,y as gt,u as Ie}from"./helpers.53d1d1a3.js";import{C as qe}from"./Tooltip.e09c91a9.js";import{S as um}from"./Ellipse.7c785d7f.js";import{S as pl}from"./Eye.1c95bcc3.js";import{d as Jd}from"./debounce.16bfcf66.js";import{Y as tA,j as fm,N as iA}from"./helpers.a876ae70.js";import{t as j2,s as Y2}from"./stripHTMLTags.ba73cb0e.js";import{u as pm}from"./TruSeoScore.77e0bf96.js";import{S as sA}from"./Statistics.a51925f5.js";import{S as gm,a as yr,g as Xd,h as nA,j as rA,k as oA,m as lA,n as aA,o as hA,p as cA,q as dA,r as uA,s as fA,t as pA,u as gA,v as mA,w as CA,x as yA,y as bA,z as SA,A as wA,C as vA,D as kA,c as xA,E as MA,e as r9,F as o9,G as l9}from"./index.6b623118.js";import{S as Or}from"./Plus.718d11aa.js";import{B as br}from"./RadioToggle.dcd0987c.js";import{C as AA}from"./GoogleSearchPreview.43e7d5c7.js";import{C as vt}from"./HtmlTagsEditor.114346ac.js";import{T as DA}from"./Slide.44995a8e.js";import{C as TA}from"./ProBadge.80b96f47.js";import{u as _A,p as J2}from"./popup.357d85f7.js";import{D as X2}from"./datetime.f197aeae.js";import{l as rr}from"./license.9147c6fd.js";import{S as OA,a as VA}from"./Mobile.af0a1c21.js";import{u as EA,S as a9}from"./Settings.8f551982.js";import{G as Ac,S as PA,a as LA}from"./Graph.e9ad047b.js";import{u as RA}from"./WpTable.7b5ee4fa.js";import{C as BA}from"./Table.bda6cb9a.js";import{u as HA}from"./Cta.b746630c.js";import{_ as NA}from"./ConnectCta.7edfed0b.js";import{C as eo}from"./Blur.3966b67d.js";import{C as vd}from"./Index.437acb26.js";import{R as h9}from"./RequiredPlans.c0eaccf5.js";import{a as Ho}from"./addons.95e96e7e.js";import{u as FA,b as Dc,_ as Q2,c as e4,d as t4,e as i4,g as IA}from"./Index.72c0c67e.js";import{a as mm,b as Cm,S as ym}from"./Affiliate.bfa1b695.js";import{S as bm}from"./External.3cb8d983.js";import{S as kd}from"./Suggestion.fa878fb0.js";import{u as c9,g as xd}from"./Image.d3a41717.js";import{u as d9,S as WA}from"./Upsell.fe038a25.js";import{t as u9}from"./Editor.438f3063.js";import{C as zA}from"./FacebookPreview.7437371e.js";import{C as Gt}from"./ImageUploader.75f8a7aa.js";import{C as UA}from"./TwitterPreview.cb4caa57.js";import{a as f9,S as $A}from"./Build.ede55de2.js";import{C as KA}from"./Index.74087a03.js";import{R as GA,C as qA,L as ZA}from"./Redirects.ad9fc5bc.js";import{d as Ds,a as Ts}from"./date.b0ec3539.js";import{u as Sr}from"./JsonValues.3fcfec97.js";import{B as _s}from"./DatePicker.dc1f1cdd.js";import{B as hh}from"./Radio.90d92f68.js";import{B as to}from"./Textarea.33737614.js";import{S as jA}from"./CheckSolid.a71d9642.js";import{U as YA}from"./UserAvatar.6a464878.js";var JA=Math.floor,XA=Math.random;function QA(n,e){return n+JA(XA()*(e-n+1))}var eD=parseFloat,tD=Math.min,iD=Math.random;function sD(n,e,t){if(t&&typeof t!="boolean"&&tA(n,e,t)&&(e=t=void 0),t===void 0&&(typeof e=="boolean"?(t=e,e=void 0):typeof n=="boolean"&&(t=n,n=void 0)),n===void 0&&e===void 0?(n=0,e=1):(n=j2(n),e===void 0?(e=n,n=0):e=j2(e)),n>e){var i=n;n=e,e=i}if(t||n%1||e%1){var s=iD();return tD(n+s*(e-n+eD("1e-"+((s+"").length-1))),e)}return QA(n,e)}const Md=j7("TruSeoHighlighterStore",{state:()=>{var n,e;return{allowScrolling:!1,allowHighlighting:!0,dispatchAnnotations:((e=(n=window==null?void 0:window.wp)==null?void 0:n.data)==null?void 0:e.dispatch("core/annotations"))||null,enabled:!0,highlightAnalyzer:null,highlightMarks:[],highlightPopover:{},source:"aioseo-tru-seo-highlighter",wpBodyContentObserver:null}},getters:{highlightAnalysis(){var i,s;const e=((s=(i=Te().currentPost)==null?void 0:i.page_analysis)==null?void 0:s.analysis)||{};return(Object.values(e).flat().find(r=>!!r[this.highlightAnalyzer])||{})[this.highlightAnalyzer]||{}},highlightAnalyzerHasError(){var n;return!!((n=this.highlightAnalysis)!=null&&n.error)},highlightSentences(){var e;let n=[];return Array.isArray((e=this.highlightAnalysis)==null?void 0:e.highlightSentences)&&(n=this.highlightAnalysis.highlightSentences.flat().map(t=>(t=t.replace(/&[a-zA-Z0-9#]{2,};$/,""),t=t.replace(/<br[^>]*>/gi,` `),t=s9(t),t9(t))).filter(t=>!!t.trim())),n.length?n:null},activeMark(){return this.highlightMarks.length?this.highlightMarks.find(n=>n.active&&n.node):null}},actions:{clearHighlightPopover(){var n,e,t;(n=this.highlightPopover)!=null&&n.observer&&this.highlightPopover.observer.disconnect(),(e=this.highlightPopover)!=null&&e.node&&this.highlightPopover.node.remove(),(t=this.highlightPopover)!=null&&t.app&&this.highlightPopover.app.unmount(),this.highlightPopover={}},clearAnnotations(){var n,e;if(typeof((n=this.dispatchAnnotations)==null?void 0:n.__experimentalRemoveAnnotationsBySource)=="function"&&this.dispatchAnnotations.__experimentalRemoveAnnotationsBySource(this.source),typeof((e=window==null?void 0:window.tinymce)==null?void 0:e.editors)=="object")for(const t of window.tinymce.editors){const i=t.selection.win.getSelection(),s=Object.values(t.annotator.getAll(this.source)).flat();for(const r of Object.values(s))t.undoManager.ignore(()=>{i.selectAllChildren(r),i.setPosition(r,0),t.annotator.remove(this.source)})}this.highlightMarks=[]},clearAll(){this.clearHighlightPopover(),this.clearAnnotations()},sanitizeHighlightMarks(){this.highlightMarks=this.highlightMarks.filter(n=>!!n.node),this.highlightMarks.length&&!this.highlightMarks.find(n=>!!n.active)&&(this.highlightMarks[0].active=!0)},toggleHighlightAnalyzer(n){if(this.allowScrolling=!0,this.highlightAnalyzer===n)return this.highlightAnalyzer=null,!1;this.highlightAnalyzer=null,Jn().then(()=>{this.highlightAnalyzer=n})}}}),s4="all-in-one-seo-pack",nD=j7("SemrushStore",{state:()=>({results:[],error:null}),getters:{expired:()=>{const n=Lt();if(!n.internalOptions.integrations.semrush.expires)return!0;const e=X2.now(),t=X2.fromMillis(parseInt(n.internalOptions.integrations.semrush.expires*1e3,10));return e>=t},hasValidTokens:n=>{const e=Lt();return!n.expired&&!!e.internalOptions.integrations.semrush.accessToken&&!!e.internalOptions.integrations.semrush.refreshToken}},actions:{getKeyphrases(n){this.error=null;const e=Te();return qd.post(be.restUrl("integration/semrush/keyphrases")).send({keyphrase:e.currentPost.keyphrases.focus.keyphrase,database:n}).then(t=>{if(t.body.keyphrases.status===403){this.error=t.body.keyphrases.error;return}this.results=t.body.keyphrases.data.rows}).catch(t=>{var i,s;if(!((s=(i=t==null?void 0:t.response)==null?void 0:i.body)!=null&&s.message)){this.error=C("An unknown error occurred, please try again later.",s4);return}this.error=t.response.body.message})},authenticate(n){return this.error=null,qd.post(be.restUrl("integration/semrush/authenticate")).send({code:n}).then(e=>{const t=Lt();t.updateOption("internalOptions",{groups:["integrations"],key:"semrush",value:e.body.semrush},{root:!0}),t.internalOptions.integrations.semrush=e.body.semrush}).catch(e=>{var t,i;if(!((i=(t=e==null?void 0:e.response)==null?void 0:t.body)!=null&&i.message)){this.error=C("An unknown error occurred, please try again later.",s4);return}this.error=e.response.body.message})},refresh(){return qd.post(be.restUrl("integration/semrush/refresh")).then(n=>{const e=Lt();e.updateOption("internalOptions",{groups:["integrations"],key:"semrush",value:n.body.semrush},{root:!0}),e.internalOptions.integrations.semrush=n.body.semrush})}}}),ti="all-in-one-seo-pack",rD={setup(){return{postEditorStore:Te()}},components:{BaseCheckbox:$M,GridColumn:KM,GridRow:GM},data(){return{strings:{useDefaultSettings:C("Use Default Settings",ti),robotsMeta:C("Robots meta:",ti),maxSnippet:C("Max Snippet",ti),maxVideoPreview:C("Max Video Preview",ti),maxImagePreview:C("Max Image Preview",ti),standard:C("Standard",ti),none:C("None",ti),large:C("Large",ti),noindex:C("No Index",ti),nofollow:C("No Follow",ti),noarchive:C("No Archive",ti),notranslate:C("No Translate",ti),noimageindex:C("No Image Index",ti),nosnippet:C("No Snippet",ti),noodp:C("No ODP",ti)}}},computed:{imagePreviewOptions(){return[{label:this.strings.none,value:"none"},{label:this.strings.standard,value:"standard"},{label:this.strings.large,value:"large"}]}},methods:{getImagePreview(n){return this.imagePreviewOptions.find(e=>e.value===n)},saveImagePreview(n){this.postEditorStore.currentPost.maxImagePreview=n,this.postEditorStore.isDirty=!0}}},oD={class:"aioseo-robots-meta"},lD={key:0,class:"global-robots-settings aioseo-description"},aD={class:"robots-meta-title"},hD={class:"global-robots-settings-options"},cD={key:0,class:"aioseo-description max-snippet"},dD={class:"aioseo-description max-video-preview"},uD={key:1,class:"aioseo-description max-image-preview"};function fD(n,e,t,i,s,r){const o=x("base-toggle"),l=x("base-checkbox"),a=x("grid-column"),c=x("grid-row"),h=x("base-input"),d=x("base-select");return v(),L("div",oD,[m(o,{modelValue:i.postEditorStore.currentPost.default,"onUpdate:modelValue":[e[0]||(e[0]=u=>i.postEditorStore.currentPost.default=u),e[1]||(e[1]=u=>i.postEditorStore.isDirty=!0)]},{default:S(()=>[B(D(s.strings.useDefaultSettings),1)]),_:1},8,["modelValue"]),i.postEditorStore.currentPost.default?O("",!0):(v(),L("div",lD,[A("span",aD,D(s.strings.robotsMeta),1),m(c,{class:"settings"},{default:S(()=>[i.postEditorStore.currentPost.isHomePage?O("",!0):(v(),E(a,{key:0,xl:"3",md:"4",sm:"6"},{default:S(()=>[m(l,{size:"medium",modelValue:i.postEditorStore.currentPost.noindex,"onUpdate:modelValue":[e[2]||(e[2]=u=>i.postEditorStore.currentPost.noindex=u),e[3]||(e[3]=u=>i.postEditorStore.isDirty=!0)]},{default:S(()=>[B(D(s.strings.noindex),1)]),_:1},8,["modelValue"])]),_:1})),m(a,{xl:"3",md:"4",sm:"6"},{default:S(()=>[m(l,{size:"medium",modelValue:i.postEditorStore.currentPost.nofollow,"onUpdate:modelValue":[e[4]||(e[4]=u=>i.postEditorStore.currentPost.nofollow=u),e[5]||(e[5]=u=>i.postEditorStore.isDirty=!0)]},{default:S(()=>[B(D(s.strings.nofollow),1)]),_:1},8,["modelValue"])]),_:1}),m(a,{xl:"3",md:"4",sm:"6"},{default:S(()=>[m(l,{size:"medium",modelValue:i.postEditorStore.currentPost.noarchive,"onUpdate:modelValue":[e[6]||(e[6]=u=>i.postEditorStore.currentPost.noarchive=u),e[7]||(e[7]=u=>i.postEditorStore.isDirty=!0)]},{default:S(()=>[B(D(s.strings.noarchive),1)]),_:1},8,["modelValue"])]),_:1}),m(a,{xl:"3",md:"4",sm:"6"},{default:S(()=>[m(l,{size:"medium",modelValue:i.postEditorStore.currentPost.notranslate,"onUpdate:modelValue":[e[8]||(e[8]=u=>i.postEditorStore.currentPost.notranslate=u),e[9]||(e[9]=u=>i.postEditorStore.isDirty=!0)]},{default:S(()=>[B(D(s.strings.notranslate),1)]),_:1},8,["modelValue"])]),_:1}),m(a,{xl:"3",md:"4",sm:"6"},{default:S(()=>[m(l,{size:"medium",modelValue:i.postEditorStore.currentPost.noimageindex,"onUpdate:modelValue":[e[10]||(e[10]=u=>i.postEditorStore.currentPost.noimageindex=u),e[11]||(e[11]=u=>i.postEditorStore.isDirty=!0)]},{default:S(()=>[B(D(s.strings.noimageindex),1)]),_:1},8,["modelValue"])]),_:1}),m(a,{xl:"3",md:"4",sm:"6"},{default:S(()=>[m(l,{size:"medium",modelValue:i.postEditorStore.currentPost.nosnippet,"onUpdate:modelValue":[e[12]||(e[12]=u=>i.postEditorStore.currentPost.nosnippet=u),e[13]||(e[13]=u=>i.postEditorStore.isDirty=!0)]},{default:S(()=>[B(D(s.strings.nosnippet),1)]),_:1},8,["modelValue"])]),_:1}),m(a,{xl:"3",md:"4",sm:"6"},{default:S(()=>[m(l,{size:"medium",modelValue:i.postEditorStore.currentPost.noodp,"onUpdate:modelValue":[e[14]||(e[14]=u=>i.postEditorStore.currentPost.noodp=u),e[15]||(e[15]=u=>i.postEditorStore.isDirty=!0)]},{default:S(()=>[B(D(s.strings.noodp),1)]),_:1},8,["modelValue"])]),_:1})]),_:1}),A("div",hD,[i.postEditorStore.currentPost.nosnippet?O("",!0):(v(),L("div",cD,[A("span",null,D(s.strings.maxSnippet),1),m(h,{type:"number",size:"medium",modelValue:i.postEditorStore.currentPost.maxSnippet,"onUpdate:modelValue":[e[16]||(e[16]=u=>i.postEditorStore.currentPost.maxSnippet=u),e[17]||(e[17]=u=>i.postEditorStore.isDirty=!0)]},null,8,["modelValue"])])),A("div",dD,[A("span",null,D(s.strings.maxVideoPreview),1),m(h,{type:"number",size:"medium",modelValue:i.postEditorStore.currentPost.maxVideoPreview,"onUpdate:modelValue":[e[18]||(e[18]=u=>i.postEditorStore.currentPost.maxVideoPreview=u),e[19]||(e[19]=u=>i.postEditorStore.isDirty=!0)]},null,8,["modelValue"])]),i.postEditorStore.currentPost.noimageindex?O("",!0):(v(),L("div",uD,[A("span",null,D(s.strings.maxImagePreview),1),m(d,{size:"medium",options:r.imagePreviewOptions,modelValue:r.getImagePreview(i.postEditorStore.currentPost.maxImagePreview),"onUpdate:modelValue":e[20]||(e[20]=u=>r.saveImagePreview(u.value))},null,8,["options","modelValue"])]))])]))])}const pD=Z(rD,[["render",fD]]),mi="all-in-one-seo-pack",gD={setup(){const{decodeUrl:n}=ZM();return{licenseStore:pi(),optionsStore:Lt(),postEditorStore:Te(),rootStore:je(),decodeUrl:n}},components:{CoreAlert:wt,CoreSettingsRow:Ce,CoreSingleRobotsMeta:pD},props:{disabled:{type:Boolean,default(){return!1}},type:{type:String,required:!1},object:{type:Object,required:!1}},data(){return{strings:{pageName:C("Advanced",mi),robotsSetting:C("Robots Setting",mi),robotsToggle:C("Use Default Settings",mi),canonicalUrl:C("Canonical URL",mi),validUrl:C("Please enter a valid URL.",mi),placeholder:C("Enter a URL to change the default Canonical URL",mi),priorityScore:C("Priority Score",mi),priority:C("Priority",mi),frequency:C("Frequency",mi),priorityFrequencyUpsell:j(C("Priority Score is a %1$s feature. %2$s",mi),"PRO",be.getUpsellLink("post-advanced",St.learnMore,"priority-frequency",!0)),keywords:C("Keywords",mi),tagPlaceholder:C("Press enter to create a keyword",mi)},error:!1}},computed:{getPriorityOptions(){return[{label:C("default",mi),value:"default"}].concat(LM)},getFrequencyOptions(){return[{label:C("default",mi),value:"default"}].concat(RM)}},methods:{getPriority(n){return n=n!=="default"?parseFloat(n):n,this.getPriorityOptions.find(e=>e.value===n)},savePriority(n){this.postEditorStore.currentPost.priority=n,this.postEditorStore.isDirty=!0},getFrequency(n){return this.getFrequencyOptions.find(e=>e.value===n)},saveFrequency(n){this.postEditorStore.currentPost.frequency=n,this.postEditorStore.isDirty=!0},inputEventDecodeUrl(n){const e=n.target.value;this.postEditorStore.currentPost.canonicalUrl="",this.postEditorStore.currentPost.canonicalUrl=this.decodeUrl(e)}}},mD={class:"aioseo-tab-content aioseo-post-advanced"},CD={class:"selectbox-row"},yD={class:"select"},bD=A("div",{class:"separator"},[A("span"),B(" - ")],-1),SD={class:"select"},wD=["innerHTML"];function vD(n,e,t,i,s,r){const o=x("core-single-robots-meta"),l=x("core-settings-row"),a=x("base-input"),c=x("core-alert"),h=x("base-select");return v(),L("div",mD,[m(l,{id:"aioseo-post-robots-setting",name:s.strings.robotsSetting,align:""},{content:S(()=>[m(o)]),_:1},8,["name"]),m(l,{id:"aioseo-post-canonical-url",name:s.strings.canonicalUrl,align:""},{content:S(()=>[m(a,{ref:"canonicalUrlInput",type:"text",size:"medium",placeholder:s.strings.placeholder,modelValue:i.postEditorStore.currentPost.canonicalUrl,"onUpdate:modelValue":[e[0]||(e[0]=d=>i.postEditorStore.currentPost.canonicalUrl=d),e[1]||(e[1]=d=>i.postEditorStore.isDirty=!0)],onInput:r.inputEventDecodeUrl},null,8,["placeholder","modelValue","onInput"]),s.error?(v(),E(c,{key:0,class:"cannonical-url-error",type:"red",size:"small"},{default:S(()=>[B(D(s.strings.validUrl),1)]),_:1})):O("",!0)]),_:1},8,["name"]),m(l,{name:s.strings.priorityScore,align:""},{content:S(()=>[A("div",CD,[A("div",yD,[A("span",null,D(s.strings.priority),1),m(h,{disabled:i.licenseStore.isUnlicensed,size:"medium",options:r.getPriorityOptions,modelValue:i.licenseStore.isUnlicensed?r.getPriority("default"):r.getPriority(i.postEditorStore.currentPost.priority),"onUpdate:modelValue":e[2]||(e[2]=d=>i.licenseStore.isUnlicensed?null:r.savePriority(d.value))},null,8,["disabled","options","modelValue"])]),bD,A("div",SD,[A("span",null,D(s.strings.frequency),1),m(h,{disabled:i.licenseStore.isUnlicensed,size:"medium",options:r.getFrequencyOptions,modelValue:i.licenseStore.isUnlicensed?r.getFrequency("default"):r.getFrequency(i.postEditorStore.currentPost.frequency),"onUpdate:modelValue":e[3]||(e[3]=d=>i.licenseStore.isUnlicensed?null:r.saveFrequency(d.value))},null,8,["disabled","options","modelValue"])])]),i.licenseStore.isUnlicensed?(v(),E(c,{key:0,class:"inline-upsell",type:"blue"},{default:S(()=>[A("div",{innerHTML:s.strings.priorityFrequencyUpsell},null,8,wD)]),_:1})):O("",!0)]),_:1},8,["name"]),i.optionsStore.options.searchAppearance.advanced.useKeywords?(v(),E(l,{key:0,name:s.strings.keywords,align:""},{content:S(()=>[m(h,{multiple:"",taggable:"",options:i.postEditorStore.currentPost.keywords||[],modelValue:i.postEditorStore.currentPost.keywords||[],"onUpdate:modelValue":e[4]||(e[4]=d=>i.postEditorStore.currentPost.keywords=d),"tag-placeholder":s.strings.tagPlaceholder},null,8,["options","modelValue","tag-placeholder"])]),_:1},8,["name"])):O("",!0)])}const kD=Z(gD,[["render",vD]]),xD={setup(){return{licenseStore:pi(),rootStore:je()}},components:{CoreApiBar:jM,CoreLicenseKeyBar:YM}};function MD(n,e,t,i,s,r){const o=x("core-api-bar"),l=x("core-license-key-bar");return v(),L("div",null,[i.rootStore.pong?O("",!0):(v(),E(o,{key:0})),i.rootStore.isPro&&i.licenseStore.isUnlicensed&&i.rootStore.pong?(v(),E(l,{key:1})):O("",!0)])}const p9=Z(xD,[["render",MD]]),AD={emits:["next","previous"],setup(){return{truSeoHighlighterStore:Md()}},components:{CoreTooltip:qe,SvgCaret:bd,SvgClose:Sd,SvgEllipse:um,SvgEye:pl},computed:{total(){return this.truSeoHighlighterStore.highlightMarks.length},error(){return this.truSeoHighlighterStore.highlightAnalyzerHasError},order(){return this.truSeoHighlighterStore.highlightMarks.findIndex(n=>n.active)+1},showSentence(){var n;return((n=this.truSeoHighlighterStore.activeMark)==null?void 0:n.sentence.length)&&this.truSeoHighlighterStore.activeMark.annotatorSelector==="block"},sentences(){const n=[];let e=1;return this.truSeoHighlighterStore.highlightMarks.forEach(t=>{t.node.isSameNode(this.truSeoHighlighterStore.activeMark.node)&&(n.push(`<strong>(${e})</strong> ${t.sentence}`),e++)}),i9(n.join(" "),1e3," [...]")}},methods:{close(){this.truSeoHighlighterStore.toggleHighlightAnalyzer(null)}}},DD=n=>(om("data-v-aa3e0f58"),n=n(),lm(),n),TD={class:"tru-seo-highlight-popover","data-arrow-placement":"right"},_D={key:0,class:"tru-seo-highlight-popover__row tru-seo-highlight-popover__row--sentence"},OD={class:"tru-seo-highlight-popover__sentence"},VD=["innerHTML"],ED={class:"tru-seo-highlight-popover__row tru-seo-highlight-popover__row--main"},PD={class:"tru-seo-highlight-popover__count"},LD=DD(()=>A("div",{class:"tru-seo-highlight-popover__pipe"},null,-1)),RD={class:"tru-seo-highlight-popover__nav"},BD=["disabled"],HD=["disabled"],ND={class:"tru-seo-highlight-popover__close"};function FD(n,e,t,i,s,r){const o=x("svg-eye"),l=x("core-tooltip"),a=x("svg-ellipse"),c=x("svg-caret"),h=x("svg-close");return v(),L("div",TD,[r.showSentence?(v(),L("div",_D,[A("div",OD,[m(l,{offset:"120px,0"},{tooltip:S(()=>[A("span",{innerHTML:r.sentences},null,8,VD)]),default:S(()=>[m(o,{width:"16",height:"16"})]),_:1})])])):O("",!0),A("div",ED,[A("div",{class:Re(["tru-seo-highlight-popover__bullet",{"tru-seo-highlight-popover__bullet--error":r.error}])},[m(a,{width:"8"})],2),A("div",PD,[A("span",null,D(r.order)+"/"+D(r.total),1)]),LD,A("div",RD,[A("button",{type:"button",class:"caret-wrapper caret-wrapper--previous",tabindex:"0",disabled:r.order===1,onClick:e[0]||(e[0]=Dt(d=>n.$emit("previous"),["stop","exact"]))},[m(c,{width:"20"})],8,BD),A("button",{type:"button",class:"caret-wrapper",tabindex:"0",disabled:r.order===r.total,onClick:e[1]||(e[1]=Dt(d=>n.$emit("next"),["stop","exact"]))},[m(c,{width:"20"})],8,HD)]),A("div",ND,[A("button",{type:"button",class:"close-wrapper",tabindex:"0",onClickOnce:e[2]||(e[2]=Dt((...d)=>r.close&&r.close(...d),["stop","exact"]))},[m(h,{width:"10"})],32)])])])}const ID=Z(AD,[["render",FD],["__scopeId","data-v-aa3e0f58"]]),WD=()=>{var pe,Ee,_t,mt;const n=Ze(null),e=Ze({}),t=yd(),i=Y7(),s=(Ee=(pe=window==null?void 0:window.wp)==null?void 0:pe.data)==null?void 0:Ee.select("core/block-editor"),r=(mt=(_t=window==null?void 0:window.wp)==null?void 0:_t.data)==null?void 0:mt.select("core/edit-post"),o=Ze(null),l=Md(),a=async(F,U="range")=>{var X,ne,Me,Q,ye,Ye;let N="content";(ne=(X=F.block)==null?void 0:X.attributes)!=null&&ne.caption?N="caption":(Q=(Me=F.block)==null?void 0:Me.attributes)!=null&&Q.value?N="value":(Ye=(ye=F.block)==null?void 0:ye.attributes)!=null&&Ye.citation&&(N="citation"),F.annotatorSelector=U;const I=U==="block"?{selector:U,source:l.source,blockClientId:F.block.clientId}:{selector:U,id:F.id,range:F.range,source:l.source,blockClientId:F.block.clientId,richTextIdentifier:N};return l.dispatchAnnotations.__experimentalAddAnnotation(I)},c=(F,U)=>{if(!U)return!1;!U.hasFocus()&&t&&U.focus();let N=U.selection.win.getSelection();N.selectAllChildren(F.parent);const I=N.toString().length;if(F.range.end<I)for(let X=F.range.end;X<I;X++)N.modify("extend","backward","character");if(0<F.range.start){N=JM(N);for(let X=F.range.start;0<X;X--)N.modify("extend","forward","character")}U.undoManager.ignore(()=>{U.annotator.annotate(l.source,{uid:F.id})}),N.empty()},h=()=>{if(l.clearHighlightPopover(),l.sanitizeHighlightMarks(),!l.activeMark)return!1;const F=yM({name:"TruSeoHighlightPopover",render(){return bM(ID,{onNext(){b(1)},onPrevious(){b(-1)}})}}),U=XM(),N=new ResizeObserver(Jd(H,750)),I=f("wrapper");if(!I)return!1;I.parentElement.appendChild(U),F.mount(U),N.observe(f("wrapper"),{box:"border-box"}),l.highlightPopover.app=F,l.highlightPopover.node=U,l.highlightPopover.observer=N,H()},d=()=>{l.toggleHighlightAnalyzer(null),l.allowHighlighting=!1},u=({block:F,node:U})=>{var I,X,ne,Me;let N="";return U?N=U.outerText.replace(/\n\n/g,` `):F&&(N=((I=F==null?void 0:F.attributes)==null?void 0:I.content)||((X=F==null?void 0:F.attributes)==null?void 0:X.caption)||((ne=F==null?void 0:F.attributes)==null?void 0:ne.value)||((Me=F==null?void 0:F.attributes)==null?void 0:Me.citation)||"",F.name==="core/table"&&(N=(F==null?void 0:F.originalContent)||""),N=N.replace(/<br[^>]*>/gi,` `),N=t9(N)),s9(N)},f=F=>{var U;if(F==="closest-relative")return jd({element:f("wrapper").parentElement,property:"position",value:"relative"});if(F==="navigable")return jd({element:f("wrapper").parentElement,property:"overflow-y",value:"auto"});if(i){if(F==="wrapper")return document.getElementById("content_ifr");if(F==="first-block")return((U=o.value.getBody())==null?void 0:U.firstElementChild)||{}}if(t){if(F==="wrapper")return document.querySelector(".editor-styles-wrapper");if(F==="first-block"){const N=s.getBlocks()[0];return document.getElementById(`block-${N==null?void 0:N.clientId}`)||{}}}},p=()=>{var F;for(const U of s.getBlocks()||[]){if(U.name==="core/freeform"){const N=window.tinymce.get(`editor-${U.clientId}`),I=((F=N.getBody())==null?void 0:F.children)||[];if(!I.length)continue;R(N);for(const X of I)q({block:U,node:X});continue}q({block:U,node:null})}l.highlightMarks.forEach(async(U,N)=>{const I=N===l.highlightMarks.length-1;k(U.parent,I),U.block.name==="core/freeform"?c(U,window.tinymce.get(`editor-${U.block.clientId}`)):(await a(U),I&&setTimeout(()=>{var X;(X=l.highlightMarks.at(-1))==null||X.parent.classList.add("is-hovered")},100))})},g=()=>{var U;const F=((U=o.value.getBody())==null?void 0:U.children)||[];if(!F.length)return!1;R(o.value);for(const N of F)q({block:null,node:N});l.highlightMarks.forEach((N,I)=>{k(N.parent,I===l.highlightMarks.length-1),c(N,o.value)})},b=F=>{const U=l.highlightMarks.findIndex(N=>N.active);if(!l.highlightMarks[U+F])return!1;l.allowScrolling=!0,l.highlightMarks[U].active=!1,l.highlightMarks[U+F].active=!0,h()},y=F=>{var ne,Me;const U=()=>{F.preventDefault(),F.clipboardData.setData("text/html",window.getSelection().toString())},N=window.getSelection()||{};if(!(N!=null&&N.rangeCount))return!1;const I=((ne=F.clipboardData)==null?void 0:ne.getData("text/html"))||"";if(I&&I.indexOf(l.source)!==-1)return U(),!1;const X=N.getRangeAt(0)||{};for(const Q of Object.values(((Me=X==null?void 0:X.cloneContents())==null?void 0:Me.children)||[]))if(Object.values((Q==null?void 0:Q.classList)||[]).some(ye=>ye.endsWith(l.source)))return U(),!1},w=F=>{var ne,Me;const U=(Q,ye)=>{Q.collapse(ye.firstChild,ye.firstChild.length),Q.deleteFromDocument()};if(["Delete","Backspace"].indexOf(F.key)===-1)return!1;const N=window.getSelection()||null;if(!(N!=null&&N.toString()))return!1;const I=((ne=N==null?void 0:N.anchorNode)==null?void 0:ne.parentElement)||null,X=((Me=N==null?void 0:N.anchorNode)==null?void 0:Me.nextElementSibling)||null;Object.values((I==null?void 0:I.classList)||[]).some(Q=>Q.endsWith(l.source))?U(N,I):Object.values((X==null?void 0:X.classList)||[]).some(Q=>Q.endsWith(l.source))&&U(N,X)},M=()=>{var U;n.value=new MutationObserver(N=>{let I=!1;for(const X of N)for(const ne of(X==null?void 0:X.removedNodes)||[])(l.highlightMarks.some(Me=>ne.isEqualNode(Me.parent))||Object.values((ne==null?void 0:ne.classList)||[]).some(Me=>Me.endsWith(l.source)))&&(I=!0);I&&W()});const F=(U=f("first-block"))==null?void 0:U.parentElement;if(typeof F!="object")return!1;n.value.observe(F,{attributes:!1,childList:!0,subtree:!0})},k=(F,U=!1)=>{const N=(X,ne)=>{var Me,Q;ne.disconnect();for(const ye of X){if((Me=ye==null?void 0:ye.target)!=null&&Me.classList.contains("is-hovered"))break;if(Object.values(((Q=ye==null?void 0:ye.target)==null?void 0:Q.classList)||[]).some(Ye=>Ye.endsWith(l.source))){z(ye.target);continue}for(const Ye of(ye==null?void 0:ye.addedNodes)||[])if(Object.values((Ye==null?void 0:Ye.classList)||[]).some(Gd=>Gd.endsWith(l.source))){z(Ye);break}}U&&l.highlightMarks.forEach(async(ye,Ye)=>{ye.node||(k(ye.parent),await a(ye,"block")),Ye===l.highlightMarks.length-1&&(await Jn(),Jd(h,250)())})};if(typeof(F==null?void 0:F.parentElement)!="object")return!1;new MutationObserver(N).observe(F,{attributes:!0,childList:!0,subtree:!0})},V=()=>{const F=U=>{var N,I,X;for(const ne of U){if((ne==null?void 0:ne.type)!=="attributes")continue;if(!jd({element:(N=f("wrapper"))==null?void 0:N.parentElement,property:"display",value:"none"}).isEqualNode(document.documentElement)||t&&(r.getEditorMode()!=="visual"||s.getBlockMode((I=s.getSelectedBlock())==null?void 0:I.clientId)==="html")||i&&(ee(),((X=document.getElementById("content"))==null?void 0:X.nodeName)==="TEXTAREA"&&document.getElementById("content").style.display!=="none"))return d(),!1;l.allowHighlighting=!0}};l.wpBodyContentObserver=new MutationObserver(Jd(F,250)),l.wpBodyContentObserver.observe(document.getElementById("wpbody-content"),{attributes:!0,childList:!1,subtree:!0})},R=F=>{F.annotator.register(l.source,{persistent:!1,decorate:()=>({classes:["annotation-text",`annotation-text-${l.source}`]})})},H=(F=[])=>{var Ye;if(!l.activeMark||!l.highlightPopover.node)return!1;for(const Gd of F)if(JSON.stringify(Gd.contentRect)===JSON.stringify(e))return!1;F.length&&(e.value=((Ye=F[0])==null?void 0:Ye.contentRect)||e,l.allowScrolling=!1);const U=l.activeMark.node.getBoundingClientRect(),N=f("wrapper").getBoundingClientRect(),I=f("closest-relative").getBoundingClientRect(),X=f("first-block").getBoundingClientRect(),[ne,Me]=[140,32];let Q=U.top,ye=X.left-I.left;ne<ye?(l.highlightPopover.node.style.top=Q-I.top+"px",l.highlightPopover.node.style.transform="translate(-105%, 0)",l.highlightPopover.node.childNodes[0].dataset.arrowPlacement="right"):(Q=Q-Me-I.top,Q=i?Q+N.top:Q,ye=i?ye+N.left:ye,l.highlightPopover.node.style.top=Q+"px",l.highlightPopover.node.style.transform="translate(0, 0)",l.highlightPopover.node.childNodes[0].dataset.arrowPlacement="bottomleft"),l.highlightPopover.node.style.left=ye+"px",G()},W=()=>{var F;window.removeEventListener("copy",y),window.removeEventListener("keyup",w),(F=n.value)==null||F.disconnect(),l.clearAll(),Jn().then(()=>{if(!l.highlightSentences)return l.toggleHighlightAnalyzer(null),!1;t&&p(),i&&g(),M(),window.addEventListener("copy",y),window.addEventListener("keyup",w)})},G=()=>{Jn().then(()=>{var N,I,X,ne;if(!l.allowScrolling)return!1;l.activeMark.node.scrollIntoView();let F=f("navigable"),U=F.scrollTop-60;i&&(U-=((I=(N=document.querySelector("#wp-content-editor-tools"))==null?void 0:N.getBoundingClientRect())==null?void 0:I.height)||0,U-=((ne=(X=document.querySelector("#wp-content-editor-container .mce-toolbar-grp"))==null?void 0:X.getBoundingClientRect())==null?void 0:ne.height)||0),F.isEqualNode(document.documentElement)&&(F=window),F.scrollTo({top:U}),l.allowScrolling=!1})},z=F=>{const U=[];l.highlightMarks.forEach((N,I)=>{if(F.hasAttribute("data-mce-annotation-uid")&&F.dataset.mceAnnotationUid.indexOf(N.id)!==-1){U.push(I);return}if(F.classList.contains(`is-annotated-by-${l.source}`)&&N.block.clientId===F.dataset.block){U.push(I);return}F.id.indexOf(N.id)!==-1&&U.push(I)}),U.length&&U.forEach(N=>{l.highlightMarks[N].node=F})},q=({block:F,node:U})=>{const N=u({block:F,node:U});if(N)for(const[I,X]of Object.entries(l.highlightSentences||{})){const ne=new RegExp(Tf(X),"g");let Me;for(;(Me=ne.exec(N))!==null&&!l.highlightMarks.find(Ye=>Ye.sentenceIndex===I);){const Q={start:Me.index,end:Me.index+Me[0].length||1};l.highlightMarks.find(Ye=>U?(Ye.range.start===Q.start||Ye.range.end===Q.end)&&Ye.parent.isSameNode(U):(Ye.range.start===Q.start||Ye.range.end===Q.end)&&Ye.block.clientId===F.clientId)||l.highlightMarks.push({id:sD(1,999999999),range:Q,block:F,parent:U||document.getElementById(`block-${F.clientId}`),active:l.highlightMarks.length===0,sentenceIndex:I,sentence:X,node:null,annotatorSelector:null})}}if(F)for(const I of(F==null?void 0:F.innerBlocks)||[])q({block:I,node:null})},ee=()=>{if(o.value)return!1;const F=window.setInterval(()=>{var U;if(o.value=((U=window==null?void 0:window.tinymce)==null?void 0:U.get("content"))||null,!o.value)return!1;window.clearInterval(F),o.value.dom.addStyle(` span.annotation-text.annotation-text-${l.source} { background-color: #CCE0FF; color: inherit; display: inline; font-size: inherit; font-weight: inherit; letter-spacing: inherit; line-height: inherit; position: static; } `.trim())},500)},he=(F,U)=>{const N=JSON.stringify(F),I=JSON.stringify(U);N!==I&&W()};return rh(()=>{var U;l.wpBodyContentObserver&&((U=l.wpBodyContentObserver)==null||U.disconnect());const F=window.setInterval(()=>{typeof f("wrapper")=="object"&&(window.clearInterval(F),V())},1e3)}),am(()=>{(Er()||!t&&!i)&&(l.enabled=!1),t&&(!l.dispatchAnnotations||!s||!r)&&(l.enabled=!1)}),{watchHighlightSentences:he}},zD="all-in-one-seo-pack",UD={emits:["selectedKeyphrase","deleted","saved"],setup(){return{keywordRankTrackerStore:oh()}},components:{CoreTooltip:qe,SvgPencil:_r,SvgStatistics:sA,SvgTrash:gm},props:{index:{type:Number},keyphrase:{type:String},score:{type:Number}},data(){return{edit:!1,strings:{delete:C("Delete",zD)}}},computed:{scoreClass(){return 79<this.score?"score-green":49<this.score?"score-orange":0<this.score?"score-red":"score-none"}},methods:{editKeyphraseEv(n){this.edit=!0,this.$emit("selectedKeyphrase",n)},deleteKeyphraseEv(n){this.edit=!1,this.$emit("deleted",n)},toggleKeyphrasesPanel(n){this.$emit("selectedKeyphrase",n)},closeEdit(n){var i;const e=(i=n.target)==null?void 0:i.value.trim(),t=this.index;e?(this.edit=!1,this.$emit("saved",{index:t,value:e})):this.deleteKeyphraseEv(t)},pressEnter(n){n.preventDefault(),n.target.blur(),this.edit=!1}}},$D={class:"aioseo-keyphrase-tag"},KD={key:0,class:"aioseo-edit-keyphrase-tag"},GD=["value"];function qD(n,e,t,i,s,r){const o=x("svg-pencil"),l=x("svg-statistics"),a=x("svg-trash"),c=x("core-tooltip");return v(),L("div",$D,[A("span",{class:Re(["aioseo-add-keyphrase-tag",s.edit?"hidden":""])},[A("span",{class:"keyphrase-name",onClick:e[0]||(e[0]=h=>r.toggleKeyphrasesPanel(t.index))},D(t.keyphrase),1),A("span",{class:"keyphrase-edit",onClick:e[1]||(e[1]=h=>r.editKeyphraseEv(t.index))},[m(o)]),A("a",{href:"#",onClick:e[2]||(e[2]=Dt(h=>i.keywordRankTrackerStore.toggleModal({modal:"modalOpenPostEdit",open:!0}),["prevent","exact"])),class:"btn-keyword-rank-tracker"},[m(l,{width:"20"})]),A("span",{class:Re(["keyphrase-score",r.scoreClass]),onClick:e[3]||(e[3]=h=>r.toggleKeyphrasesPanel(t.index))},D(t.score)+"/100",3)],2),s.edit?(v(),L("span",KD,[A("input",{value:t.keyphrase,onBlur:e[4]||(e[4]=(...h)=>r.closeEdit&&r.closeEdit(...h)),onKeydown:e[5]||(e[5]=hm((...h)=>r.pressEnter&&r.pressEnter(...h),["enter"]))},null,40,GD),A("span",{class:"keyphrase-delete",onClick:e[6]||(e[6]=h=>r.deleteKeyphraseEv(t.index))},[m(c,{type:"action"},{tooltip:S(()=>[B(D(s.strings.delete),1)]),default:S(()=>[m(a)]),_:1})])])):O("",!0)])}const g9=Z(UD,[["render",qD]]),ZD={},jD={width:"16",height:"11",viewBox:"0 0 16 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-eye-filled"},YD=A("path",{d:"M8.0018 8.57162C8.78938 8.57162 9.45817 8.29596 10.0082 7.74465C10.5582 7.19335 10.8332 6.5239 10.8332 5.73632C10.8332 4.94874 10.5575 4.27995 10.0062 3.72995C9.4549 3.17995 8.78546 2.90495 7.99787 2.90495C7.21029 2.90495 6.5415 3.1806 5.9915 3.73191C5.4415 4.28322 5.1665 4.95266 5.1665 5.74025C5.1665 6.52783 5.44216 7.19661 5.99347 7.74661C6.54477 8.29662 7.21422 8.57162 8.0018 8.57162ZM7.99592 7.60495C7.47631 7.60495 7.03595 7.42309 6.67484 7.05937C6.31373 6.69563 6.13317 6.25396 6.13317 5.73436C6.13317 5.21475 6.31503 4.77439 6.67875 4.41328C7.04249 4.05217 7.48415 3.87161 8.00375 3.87161C8.52337 3.87161 8.96373 4.05348 9.32484 4.4172C9.68595 4.78093 9.8665 5.2226 9.8665 5.7422C9.8665 6.26181 9.68464 6.70217 9.32092 7.06328C8.95719 7.42439 8.51552 7.60495 7.99592 7.60495ZM7.99984 10.7383C6.37762 10.7383 4.91095 10.2772 3.59984 9.35495C2.28873 8.43273 1.31095 7.22717 0.666504 5.73828C1.31095 4.24939 2.28873 3.04384 3.59984 2.12161C4.91095 1.19939 6.37762 0.738281 7.99984 0.738281C9.62206 0.738281 11.0887 1.19939 12.3998 2.12161C13.7109 3.04384 14.6887 4.24939 15.3332 5.73828C14.6887 7.22717 13.7109 8.43273 12.3998 9.35495C11.0887 10.2772 9.62206 10.7383 7.99984 10.7383Z",fill:"currentColor"},null,-1),JD=[YD];function XD(n,e){return v(),L("svg",jD,JD)}const QD=Z(ZD,[["render",XD]]),n4="all-in-one-seo-pack",eT={setup(){return{truSeoHighlighterStore:Md()}},components:{CoreTooltip:qe,SvgEye:pl,SvgEyeFilled:QD},props:{analyzer:String},data(){return{strings:{highlightSections:C("Highlight sections in the Editor",n4),highlightingIsDisabled:C("Highlighting is disabled for current view",n4)}}},methods:{onClickBtnToggleHighlighter(){this.truSeoHighlighterStore.toggleHighlightAnalyzer(this.analyzer)}}},tT=["disabled"];function iT(n,e,t,i,s,r){const o=x("svg-eye"),l=x("core-tooltip"),a=x("svg-eye-filled");return i.truSeoHighlighterStore.enabled?(v(),L("button",{key:0,type:"button",class:"tru-seo-toggle-highlighter",disabled:!i.truSeoHighlighterStore.allowHighlighting,onClick:e[0]||(e[0]=Dt(c=>r.onClickBtnToggleHighlighter(),["stop","exact"]))},[i.truSeoHighlighterStore.highlightAnalyzer!==t.analyzer?(v(),E(l,{key:0,offset:n.$root.$data.screenContext==="sidebar"?"-200px,0":"",type:"action"},{tooltip:S(()=>[B(D(i.truSeoHighlighterStore.allowHighlighting?s.strings.highlightSections:s.strings.highlightingIsDisabled),1)]),default:S(()=>[m(o,{width:"16",height:"16"})]),_:1},8,["offset"])):(v(),E(a,{key:1,width:"16",height:"16"}))],8,tT)):O("",!0)}const sT=Z(eT,[["render",iT]]),nT={class:"aioseo-analysis-detail"},rT={key:0,class:"detail detail--pl-0"},oT={key:0,class:"detail"},lT={class:"title__text"},aT={class:"description"},Ad={__name:"MetaboxAnalysisDetail",props:{analysisItems:{type:Object}},setup(n){const t={switchToVisualEditor:C("TruSEO cannot analyze the post while you are using the Code Editor. Please switch back to the Visual Editor to view your results.","all-in-one-seo-pack")},i=s=>{s.target.parentElement.classList.toggle("toggled")};return(s,r)=>(v(),L("ul",nT,[_(MM)()?(v(),L("li",rT,[m(_(wt),{type:"yellow"},{default:S(()=>[B(D(t.switchToVisualEditor),1)]),_:1})])):(v(!0),L(xt,{key:1},_i(n.analysisItems,(o,l)=>{var a;return v(),L(xt,{key:l},[o.title?(v(),L("li",oT,[A("p",{class:Re(["title",o.error===0?"toggled":""])},[o.error===0?(v(),E(_(wd),{key:0,width:"16"})):O("",!0),o.error===1?(v(),E(_(EM),{key:1,width:"16"})):O("",!0),A("span",lT,D(o.title),1),(a=o==null?void 0:o.highlightSentences)!=null&&a.length?(v(),E(_(sT),{key:2,analyzer:l},null,8,["analyzer"])):O("",!0),m(_(bd),{width:"16",role:"button",onClick:Dt(i,["stop"])})],2),A("p",aT,D(o.description),1)])):O("",!0)],64)}),128))]))}},bl="all-in-one-seo-pack",hT={setup(){return{licenseStore:pi(),postEditorStore:Te(),rootStore:je(),optionsStore:Lt(),truSeo:new n9}},components:{CoreAlert:wt,CoreKeyphrase:g9,CoreLoader:ca,CoreTooltip:qe,SvgCirclePlus:Or,metaboxAnalysisDetail:Ad},data(){return{selectedKeyphrase:0,strings:{additional:C("Additional Keyphrases",bl),addKeyphrase:C("Add Additional Keyphrases",bl),keyphraseDocumentation:C("Improve your SEO rankings with additional keyphrases.",bl),upsell:j(C("Additional Keyphrases are a %1$s feature. %2$s",bl),"PRO",be.getUpsellLink("post-settings",St.learnMore,"additional-keywords",!0)),maxAmountReached:j(C("You have reached the maximum of %1$s additional keyphrases.",bl),this.optionsStore.maxAdditionalKeyphrases)}}},watch:{"postEditorStore.currentPost.keyphrases.additional"(){this.postEditorStore.currentPost.keyphrases.additional&&!this.postEditorStore.currentPost.keyphrases.additional[this.selectedKeyphrase]&&(this.selectedKeyphrase=0)}},methods:{onSelectedKeyphrase(n){this.selectedKeyphrase=n},onSaved(n){const{index:e,value:t}=n;this.postEditorStore.currentPost.keyphrases.additional[e].keyphrase=t,this.postEditorStore.currentPost.keyphrases.additional[e].score=0,this.postEditorStore.currentPost.loading.additional[e]=!0,this.postEditorStore.isDirty=!0,this.truSeo.runAnalysis({postId:this.postEditorStore.currentPost.id,postData:this.postEditorStore.currentPost}),this.selectedKeyphrase=e},onDeleted(n){const e=[...this.postEditorStore.currentPost.keyphrases.additional];e.splice(n,1),this.postEditorStore.currentPost.keyphrases.additional=null,setTimeout(()=>{this.postEditorStore.currentPost.keyphrases.additional=e,this.postEditorStore.isDirty=!0,this.truSeo.runAnalysis({postId:this.postEditorStore.currentPost.id,postData:this.postEditorStore.currentPost})},300)},addKeyphraseEv(){var i,s,r;if(this.optionsStore.maxAdditionalKeyphrases<=((s=(i=this.postEditorStore.currentPost.keyphrases)==null?void 0:i.additional)==null?void 0:s.length))return;const e=document.getElementsByClassName(`add-keyphrase-${this.$root.$data.screenContext}-input`)[0].querySelector(".medium"),t=e==null?void 0:e.value.trim();if(t){const o={keyphrase:t,score:0},l=this.postEditorStore.currentPost.keyphrases.additional.push(o),a=document.getElementsByClassName("keyphrase-name");this.postEditorStore.currentPost.loading.additional[0]=!0,e.value="",e.blur(),this.postEditorStore.isDirty=!0,(r=a[l])==null||r.click(),this.truSeo.runAnalysis({postId:this.postEditorStore.currentPost.id,postData:this.postEditorStore.currentPost})}},pressEnter(n){const e=document.getElementById("add-additional-keyphrase");n.preventDefault(),e.click()},created(){this.postEditorStore.currentPost.keyphrases.forEach((n,e)=>{this.postEditorStore.currentPost.loading.additional[e]=!1})}}},cT={class:"additional-keyphrases-panel"},dT={key:0},uT={class:"analysis-wrapper"},fT={class:"aioseo-description additional-keyphrases-description"},pT=["innerHTML"];function gT(n,e,t,i,s,r){var p,g,b,y,w,M;const o=x("core-keyphrase"),l=x("core-loader"),a=x("metaboxAnalysisDetail"),c=x("base-input"),h=x("svg-circle-plus"),d=x("base-button"),u=x("core-tooltip"),f=x("core-alert");return v(),L("div",cT,[i.postEditorStore.currentPost.keyphrases.additional&&((g=(p=i.postEditorStore.currentPost.keyphrases)==null?void 0:p.additional)!=null&&g.length)&&i.rootStore.isPro&&i.licenseStore.license.isActive?(v(),L("div",dT,[(v(!0),L(xt,null,_i(i.postEditorStore.currentPost.keyphrases.additional,(k,V)=>(v(),E(o,{key:V,index:V,keyphrase:k.keyphrase,score:k.score,onSaved:r.onSaved,onDeleted:r.onDeleted,onSelectedKeyphrase:r.onSelectedKeyphrase,class:Re(["aioseo-keyphrase-tag additional-keyphrase",s.selectedKeyphrase===V?"selected":null])},null,8,["index","keyphrase","score","onSaved","onDeleted","onSelectedKeyphrase","class"]))),128)),A("div",uT,[i.postEditorStore.currentPost.loading.additional[s.selectedKeyphrase]&&i.postEditorStore.currentPost.keyphrases.additional[s.selectedKeyphrase]&&i.postEditorStore.currentPost.keyphrases.additional[s.selectedKeyphrase].keyphrase?(v(),E(l,{key:0,class:"analysis-loading",dark:""})):O("",!0),!i.postEditorStore.currentPost.loading.additional[s.selectedKeyphrase]&&i.postEditorStore.currentPost.keyphrases.additional[s.selectedKeyphrase]&&i.postEditorStore.currentPost.keyphrases.additional[s.selectedKeyphrase].keyphrase?(v(),E(a,{key:1,analysisItems:i.postEditorStore.currentPost.keyphrases.additional[s.selectedKeyphrase].analysis},null,8,["analysisItems"])):O("",!0)])])):O("",!0),i.rootStore.isPro&&i.licenseStore.license.isActive?(v(),E(c,{key:1,size:"medium",class:Re(`add-keyphrase-${n.$root.$data.screenContext}-input`),onKeydown:hm(r.pressEnter,["enter"])},null,8,["class","onKeydown"])):O("",!0),i.rootStore.isPro&&i.licenseStore.license.isActive&&i.optionsStore.maxAdditionalKeyphrases>((y=(b=i.postEditorStore.currentPost.keyphrases)==null?void 0:b.additional)==null?void 0:y.length)?(v(),E(d,{key:2,id:"add-additional-keyphrase",class:"add-keyphrase gray medium",onClick:r.addKeyphraseEv},{default:S(()=>[m(h,{width:"14",height:"14"}),B(" "+D(s.strings.addKeyphrase),1)]),_:1},8,["onClick"])):O("",!0),i.rootStore.isPro&&i.licenseStore.license.isActive&&i.optionsStore.maxAdditionalKeyphrases<=((M=(w=i.postEditorStore.currentPost.keyphrases)==null?void 0:w.additional)==null?void 0:M.length)?(v(),E(u,{key:3},{tooltip:S(()=>[A("span",null,D(s.strings.maxAmountReached),1)]),default:S(()=>[m(d,{id:"add-additional-keyphrase",class:"add-keyphrase gray medium",disabled:!0,onClick:r.addKeyphraseEv},{default:S(()=>[m(h,{width:"14",height:"14"}),B(" "+D(s.strings.addKeyphrase),1)]),_:1},8,["onClick"])]),_:1})):O("",!0),!i.rootStore.isPro||!i.licenseStore.license.isActive?(v(),L(xt,{key:4},[A("div",fT,D(s.strings.keyphraseDocumentation),1),m(f,{class:"inline-upsell",type:"blue"},{default:S(()=>[A("div",{innerHTML:s.strings.upsell},null,8,pT)]),_:1})],64)):O("",!0)])}const mT=Z(hT,[["render",gT],["__scopeId","data-v-e4d52c4e"]]),CT=""+window.__aioseoDynamicImportPreload__("images/api-key.bdfc313e.png"),Mn="aioseo-pro",yT={setup(){return{optionsStore:Lt(),postEditorStore:Te()}},components:{CoreAlert:wt},props:{type:{type:String,required:!1}},data(){return{ApiKeyImage:CT,apiKey:"",apiKeyInvalid:!1,loading:!1,strings:{connect:C("Connect",Mn),pasteYourApiKey:C("Paste your API key here",Mn),learnMoreLink:j('<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a> %3$s',be.getDocUrl("openAi"),C("Learn more about using OpenAI with AIOSEO",Mn),be.getDocLink("","openAi",!0)),apiKeyInvalid:C("The API key you have entered is invalid. Please check your API key and try again.",Mn)}}},computed:{apiKeyRequired(){return this.type==="title"?j(C("An OpenAI API Key is Required to Generate SEO %1$s",Mn),C("Titles",Mn)):j(C("An OpenAI API Key is Required to Generate SEO %1$s",Mn),C("Descriptions",Mn))}},methods:{getAssetUrl:fm,saveApiKey(){this.loading=!0,this.postEditorStore.saveOpenAiApiKey(this.apiKey).then(()=>{this.optionsStore.options.advanced.openAiKey=this.apiKey}).finally(()=>{this.loading=!1})},validateApiKey(){this.apiKey&&!this.apiKey.match(/^sk-.*/)?this.apiKeyInvalid=!0:this.apiKeyInvalid=!1}}},bT={class:"no-key"},ST=["src"],wT={class:"title"},vT={class:"api-key-input"},kT=["innerHTML"];function xT(n,e,t,i,s,r){const o=x("base-input"),l=x("base-button"),a=x("core-alert");return v(),L("div",bT,[A("div",null,[A("img",{src:r.getAssetUrl(s.ApiKeyImage),alt:"open-ai-api-key"},null,8,ST)]),A("p",wT,D(r.apiKeyRequired),1),A("div",vT,[A("div",null,[m(o,{placeholder:s.strings.pasteYourApiKey,modelValue:s.apiKey,"onUpdate:modelValue":e[0]||(e[0]=c=>s.apiKey=c),onBlur:r.validateApiKey},null,8,["placeholder","modelValue","onBlur"]),m(l,{type:"green",loading:s.loading,disabled:!s.apiKey||s.apiKeyInvalid,onClick:r.saveApiKey},{default:S(()=>[B(D(s.strings.connect),1)]),_:1},8,["loading","disabled","onClick"])]),s.apiKey&&s.apiKeyInvalid?(v(),E(a,{key:0,class:"inline-upsell",type:"red"},{default:S(()=>[A("div",null,D(s.strings.apiKeyInvalid),1)]),_:1})):O("",!0),A("p",{innerHTML:s.strings.learnMoreLink},null,8,kT)])])}const MT=Z(yT,[["render",xT]]),m9=""+window.__aioseoDynamicImportPreload__("images/open-ai.eed9a73c.png"),jt="all-in-one-seo-pack",AT={setup(){return{getAssetUrl:fm,settingsStore:os(),links:be}},components:{CoreModal:Qt},props:{type:{type:String,required:!0}},data(){return{OpenAiImage:m9,strings:{upgradeToPro:C("Unlock AI Generator",jt),learnMoreLink:j('<a class="feature-link" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a> %3$s',be.getUpsellUrl("post-settings","general","open-ai"),C("Learn more about all the features",jt),be.getUpsellLink("post-settings","","general",!0))}}},computed:{headerTitle(){return this.type==="title"?j(C("Generate New SEO %1$s",jt),C("Title",jt)):j(C("Generate New SEO %1$s",jt),C("Description",jt))},ctaHeaderTitle(){return this.type==="title"?j(C("Generating SEO %1$s is a Pro Feature",jt),C("Titles",jt)):j(C("Generating SEO %1$s is a Pro Feature",jt),C("Descriptions",jt))},ctaDescription(){return this.type==="title"?j(C("With our Pro version, you now have access to the powerful feature that generates SEO optimized %1$s with just a click of a button. Say goodbye to manual %2$s creation and hello to increased online visibility.",jt),C("titles",jt),C("title",jt)):j(C("With our Pro version, you now have access to the powerful feature that generates SEO optimized %1$s with just a click of a button. Say goodbye to manual %2$s creation and hello to increased online visibility.",jt),C("meta descriptions",jt),C("description",jt))}}},DT={class:"cta"},TT=["src"],_T={class:"bottom"},OT={class:"title"},VT=["innerHTML"];function ET(n,e,t,i,s,r){const o=x("base-button"),l=x("core-modal");return v(),E(l,{classes:["aioseo-ai-generator-modal"],onClose:e[0]||(e[0]=a=>i.settingsStore.setModalState({modalName:"aiGenerator",value:!1}))},{headerTitle:S(()=>[B(D(r.headerTitle),1)]),body:S(()=>[A("div",DT,[A("img",{src:i.getAssetUrl(s.OpenAiImage),alt:"open-ai-upsell"},null,8,TT),A("div",_T,[A("div",null,[A("p",OT,D(r.ctaHeaderTitle),1),A("p",null,D(r.ctaDescription),1)]),A("div",null,[m(o,{type:"green",size:"medium",tag:"a",href:i.links.getPricingUrl("post-settings","general","open-ai"),target:"_blank"},{default:S(()=>[B(D(s.strings.upgradeToPro),1)]),_:1},8,["href"]),A("span",{innerHTML:s.strings.learnMoreLink},null,8,VT)])])])]),_:1})}const PT=Z(AT,[["render",ET]]),Ot="aioseo-pro",LT={setup(){return{getAssetUrl:fm,postEditorStore:Te(),rootStore:je(),settingsStore:os()}},components:{CoreAlert:wt,SvgCirclePlus:Or},props:{type:{type:String,required:!0}},data(){return{OpenAiImage:m9,loading:!1,triedFetchingResults:!1,postContent:null,suggestionsKey:0,strings:{noPostContent:C("Please add post content or an excerpt before generating new suggestions.",Ot),noSuggestionsMessage:j(C("It looks like OpenAI did not return any suggestions. Please check if your content complies with %1$sOpenAI's Usage Policy%2$s and then try again.",Ot),'<a href="https://openai.com/policies/usage-policies" target="_blank" rel="noopener noreferrer">',"</a>")}}},computed:{generateTitle(){return this.type==="title"?j(C("Generate %1$s Suggestions Using OpenAI",Ot),C("SEO Title",Ot)):j(C("Generate %1$s Suggestions Using OpenAI",Ot),C("Meta Description",Ot))},generateDescription(){return this.type==="title"?j(C("Get 5 AI-powered %1$s suggestions with just one click.%2$sNote: This action will count towards your API usage limit.",Ot),C("title",Ot),"<br />"):j(C("Get 5 AI-powered %1$s suggestions with just one click.%2$sNote: This action will count towards your API usage limit.",Ot),C("meta description",Ot),"<br />")},generateButtonLabel(){return this.type==="title"?j(C("Generate %1$s",Ot),C("Titles",Ot)):j(C("Generate %1$s",Ot),C("Descriptions",Ot))},generateNewButtonLabel(){return this.type==="title"?j(C("Generate New %1$s",Ot),C("Titles",Ot)):j(C("Generate New %1$s",Ot),C("Descriptions",Ot))},apiErrorMessage(){if(this.postEditorStore.openAiError.code)switch(this.postEditorStore.openAiError.code){case"insufficient_quota":return j(C("You exceeded your current API quota. Please %1$scheck your OpenAI plan and billing details%2$s.",Ot),'<a href="https://platform.openai.com/account/usage" target="_blank" ref="noopener noreferrer">',"</a>");default:return this.postEditorStore.openAiError.message}},suggestions(){var n;return(n=this.postEditorStore.currentPost.open_ai[this.type])!=null&&n.suggestions?this.postEditorStore.currentPost.open_ai[this.type].suggestions:this.postEditorStore.currentPost.open_ai[this.type]}},methods:{generate(){var n,e,t;this.loading=!0,this.postEditorStore.generateTitlesDescriptions({type:this.type,postId:this.postEditorStore.currentPost.id,postContent:this.postContent,focusKw:(t=(e=(n=this.postEditorStore.currentPost)==null?void 0:n.keyphrases)==null?void 0:e.focus)==null?void 0:t.keyphrase}).finally(()=>{this.loading=!1,this.triedFetchingResults=!0,this.suggestionsKey++})},setSuggestion(n){if(this.type==="title"){this.postEditorStore.updateTitle(n),this.closeModal();return}this.postEditorStore.updateDescription(n),this.closeModal()},closeModal(){this.settingsStore.setModalState({modalName:"aiGenerator",value:!1})}},beforeMount(){this.postContent=Y2(QM()).trim()||Y2(eA()).trim()}},RT={class:"titles-descriptions"},BT={key:0,class:"list"},HT=["innerHTML"],NT=["innerHTML"],FT=["classes"],IT=["onClick"],WT={class:"footer"},zT={key:1,class:"generate"},UT=["src"],$T={class:"bottom"},KT={class:"title"},GT=["innerHTML"],qT=["innerHTML"],ZT=["innerHTML"];function jT(n,e,t,i,s,r){const o=x("core-alert"),l=x("svg-circle-plus"),a=x("base-button");return v(),L("div",RT,[r.suggestions.length?(v(),L("div",BT,[i.postEditorStore.openAiError?(v(),E(o,{key:0,class:"inline-upsell",type:"red"},{default:S(()=>[A("div",{innerHTML:r.apiErrorMessage},null,8,HT)]),_:1})):O("",!0),r.suggestions.length?O("",!0):(v(),E(o,{key:1,class:"inline-upsell",type:"red"},{default:S(()=>[A("div",{innerHTML:s.strings.noSuggestionsMessage},null,8,NT)]),_:1})),s.postContent?O("",!0):(v(),E(o,{key:2,class:"inline-upsell",type:"yellow"},{default:S(()=>[A("div",null,D(s.strings.noPostContent),1)]),_:1})),(v(),L("div",{class:"suggestions",key:s.suggestionsKey},[(v(!0),L(xt,null,_i(r.suggestions,(c,h)=>(v(),L("div",{class:"suggestion",classes:[{single:t.type==="title"}],key:h},[A("p",null,D(c),1),A("button",{onClick:d=>r.setSuggestion(c),type:"button"},[m(l,{onClick:d=>r.setSuggestion(c)},null,8,["onClick"])],8,IT)],8,FT))),128))])),A("div",WT,[A("div",null,[m(a,{type:"blue",size:"medium",loading:s.loading,disabled:!s.postContent,onClick:r.generate},{default:S(()=>[B(D(r.generateNewButtonLabel),1)]),_:1},8,["loading","disabled","onClick"])])])])):O("",!0),r.suggestions.length?O("",!0):(v(),L("div",zT,[A("img",{src:i.getAssetUrl(s.OpenAiImage),alt:"open-ai-upsell"},null,8,UT),A("div",$T,[A("p",KT,D(r.generateTitle),1),A("p",{innerHTML:r.generateDescription},null,8,GT),s.postContent?O("",!0):(v(),E(o,{key:0,class:"inline-upsell",type:"yellow"},{default:S(()=>[A("div",null,D(s.strings.noPostContent),1)]),_:1})),m(a,{type:"green",size:"large",loading:s.loading,disabled:!s.postContent,onClick:r.generate},{default:S(()=>[B(D(r.generateButtonLabel),1)]),_:1},8,["loading","disabled","onClick"]),s.triedFetchingResults&&!r.suggestions.length?(v(),E(o,{key:1,class:"inline-upsell",type:"red"},{default:S(()=>[A("div",{innerHTML:s.strings.noSuggestionsMessage},null,8,qT)]),_:1})):O("",!0),i.postEditorStore.openAiError?(v(),E(o,{key:2,class:"inline-upsell",type:"red"},{default:S(()=>[A("div",{innerHTML:r.apiErrorMessage},null,8,ZT)]),_:1})):O("",!0)])]))])}const YT=Z(LT,[["render",jT]]),Sh="aioseo-pro",JT={setup(){return{licenseStore:pi(),optionsStore:Lt(),rootStore:je(),settingsStore:os()}},components:{ApiKey:MT,CoreModal:Qt,CoreTooltip:qe,LiteModal:PT,TitlesDescriptions:YT,SvgCircleQuestionMark:yr},props:{type:{type:String,required:!0},show:Boolean},data(){return{strings:{tooltip:j(C("Would you like to change your OpenAI API key? You can edit it under %1$s.",Sh),j('<a href="%1$s" rel="noopener noreferrer" target="_blank">%2$s</a>',this.rootStore.aioseo.urls.home+"/wp-admin/admin.php?aioseo-scroll=aioseo-open-ai-api-key&aioseo-highlight=aioseo-open-ai-api-key&page=aioseo-settings/#advanced",C("General Settings > Advanced",Sh)))}}},computed:{headerTitle(){return this.type==="title"?C("Generate New SEO Title",Sh):C("Generate New Meta Description",Sh)}}},XT=["innerHTML"];function QT(n,e,t,i,s,r){const o=x("svg-circle-question-mark"),l=x("core-tooltip"),a=x("titles-descriptions"),c=x("api-key"),h=x("core-modal"),d=x("lite-modal");return v(),L("div",null,[m(h,{show:!i.licenseStore.isUnlicensed&&t.show,classes:["aioseo-ai-generator-modal"],onClose:e[0]||(e[0]=u=>i.settingsStore.setModalState({modalName:"aiGenerator",value:!1})),"modal-name":"generate-ai-modal"},{headerTitle:S(()=>[A("span",null,D(r.headerTitle),1),m(l,null,{tooltip:S(()=>[A("span",{innerHTML:s.strings.tooltip},null,8,XT)]),default:S(()=>[m(o)]),_:1})]),body:S(()=>[i.optionsStore.options.advanced.openAiKey?(v(),E(a,{key:0,type:t.type},null,8,["type"])):O("",!0),i.optionsStore.options.advanced.openAiKey?O("",!0):(v(),E(c,{key:1,type:t.type},null,8,["type"]))]),_:1},8,["show"]),m(d,{show:i.licenseStore.isUnlicensed&&t.show,type:t.type},null,8,["show","type"])])}const e_=Z(JT,[["render",QT]]),t_={},i_={class:"aioseo-ai-robot",viewBox:"0 0 16 14",xmlns:"http://www.w3.org/2000/svg"},s_=A("path",{d:"M2.23351 8.73334C1.73351 8.73334 1.31129 8.55996 0.966845 8.2132C0.622412 7.86644 0.450195 7.44537 0.450195 6.95C0.450195 6.45464 0.623579 6.03357 0.970345 5.6868C1.31709 5.34005 1.73815 5.16667 2.23351 5.16667V2.89999C2.23351 2.63332 2.33351 2.39999 2.53351 2.19999C2.73351 1.99999 2.96685 1.89999 3.23351 1.89999H6.21686C6.21686 1.39999 6.39024 0.977765 6.737 0.63332C7.08376 0.288876 7.50483 0.116653 8.0002 0.116653C8.49556 0.116653 8.91663 0.290037 9.2634 0.636803C9.61015 0.983559 9.78353 1.40462 9.78353 1.89999H12.7669C13.0335 1.89999 13.2669 1.99999 13.4669 2.19999C13.6669 2.39999 13.7669 2.63332 13.7669 2.89999V5.16667C14.2669 5.16667 14.6891 5.34005 15.0335 5.6868C15.378 6.03357 15.5502 6.45464 15.5502 6.95C15.5502 7.44537 15.3768 7.86644 15.0301 8.2132C14.6833 8.55996 14.2622 8.73334 13.7669 8.73334V12.2167C13.7669 12.4834 13.6669 12.7167 13.4669 12.9167C13.2669 13.1167 13.0335 13.2167 12.7669 13.2167H3.23351C2.96685 13.2167 2.73351 13.1167 2.53351 12.9167C2.33351 12.7167 2.23351 12.4834 2.23351 12.2167V8.73334ZM5.77731 7.01015C5.97615 7.01015 6.14416 6.94024 6.28136 6.80042C6.41856 6.66061 6.48716 6.48971 6.48716 6.28774C6.48716 6.08577 6.41726 5.91619 6.27745 5.77899C6.13762 5.64179 5.9683 5.57319 5.76946 5.57319C5.57063 5.57319 5.40104 5.64283 5.2607 5.78212C5.12036 5.92141 5.0502 6.09414 5.0502 6.3003C5.0502 6.49914 5.12167 6.66715 5.26463 6.80435C5.40758 6.94155 5.57848 7.01015 5.77731 7.01015ZM10.2309 7.01015C10.4298 7.01015 10.5994 6.94024 10.7397 6.80042C10.88 6.66061 10.9502 6.48971 10.9502 6.28774C10.9502 6.08577 10.8787 5.91619 10.7358 5.77899C10.5928 5.64179 10.4219 5.57319 10.2231 5.57319C10.0242 5.57319 9.85623 5.64283 9.71903 5.78212C9.58183 5.92141 9.51323 6.09414 9.51323 6.3003C9.51323 6.49914 9.58313 6.66715 9.72295 6.80435C9.86277 6.94155 10.0321 7.01015 10.2309 7.01015ZM5.30383 10.25H10.6966V9.14637H5.30383V10.25ZM3.55383 11.8964H12.4466V3.2203H3.55383V11.8964Z",fill:"currentColor"},null,-1),n_=[s_];function r_(n,e){return v(),L("svg",i_,n_)}const o_=Z(t_,[["render",r_]]),l_="all-in-one-seo-pack",a_={setup(){return{settingsStore:os()}},components:{AiModal:e_,CoreTooltip:qe,SvgAiRobot:o_},props:{type:{type:String,required:!0}},data(){return{strings:{useAiGenerator:C("Use AI Generator",l_)}}}},h_={class:"aioseo-ai-generator"};function c_(n,e,t,i,s,r){const o=x("svg-ai-robot"),l=x("core-tooltip"),a=x("ai-modal");return v(),L("div",h_,[m(l,{type:"action",offset:"-30px,0"},{tooltip:S(()=>[B(D(s.strings.useAiGenerator),1)]),default:S(()=>[A("button",{type:"button",onClick:e[1]||(e[1]=c=>i.settingsStore.setModalState({modalName:"aiGenerator",value:t.type}))},[m(o,{onClick:e[0]||(e[0]=c=>i.settingsStore.setModalState({modalName:"aiGenerator",value:t.type}))})])]),_:1}),m(a,{show:i.settingsStore.modals.aiGenerator===t.type,type:t.type},null,8,["show","type"])])}const d_=Z(a_,[["render",c_]]),u_={setup(){const{getErrorClass:n,getErrorDisplay:e,getScoreClass:t,strings:i}=pm();return{getErrorClass:n,getErrorDisplay:e,getScoreClass:t,settingsStore:os(),strings:i}},components:{CoreTooltip:qe,SvgCaret:bd,SvgCircleCheck:wd,SvgCircleQuestionMark:yr,SvgEllipse:um,TransitionSlide:DA},props:{slug:{type:String,required:!0},headerText:String,focusScore:Number,trueSeoScore:Number,toggles:{type:Boolean,default(){return!0}},hideHeader:Boolean,noSlide:Boolean,saveToggleStatus:{type:Boolean,default(){return!0}}},watch:{"settingsStore.metaBoxTabs.mainSidebar":{deep:!0,handler(n){this.$root.$data.screenContext==="sidebar"&&this.openCard(n.card)}}},methods:{openCard(n){for(const e in this.settingsStore.settings.toggledCards)this.settingsStore.settings.toggledCards[e]&&this.settingsStore.toggleCard({slug:e});this.settingsStore.toggleCard({slug:n})}},created(){this.openCard(this.settingsStore.metaBoxTabs.mainSidebar.card)}},f_={class:"aioseo-card aioseo-sidebar-card"},p_={class:"text"},g_={key:0,class:"content"},m_={key:1,class:"content"};function C_(n,e,t,i,s,r){const o=x("svg-ellipse"),l=x("svg-circle-check"),a=x("svg-circle-question-mark"),c=x("core-tooltip"),h=x("svg-caret"),d=x("transition-slide");return v(),L("div",f_,[t.hideHeader?O("",!0):(v(),L("div",{key:0,class:"header",onClick:e[0]||(e[0]=u=>i.settingsStore.toggleCard({slug:t.slug,shouldSave:t.saveToggleStatus}))},[A("div",p_,[qi(n.$slots,"header",{},()=>[B(D(t.headerText),1)]),t.focusScore>=0?qi(n.$slots,"alt",{key:0},()=>[t.focusScore!==null?(v(),L("span",{key:0,class:Re(["card-score",i.getScoreClass(t.focusScore)])},D(t.focusScore)+"/100 ",3)):O("",!0)]):O("",!0),t.trueSeoScore>=0?qi(n.$slots,"alt",{key:1},()=>[A("span",{class:Re(["card-score",i.getErrorClass(t.trueSeoScore)])},[0<t.trueSeoScore?(v(),E(o,{key:0,width:"6"})):O("",!0),t.trueSeoScore===0?(v(),E(l,{key:1,width:"12"})):O("",!0),B(" "+D(i.getErrorDisplay(t.trueSeoScore)),1)],2)]):O("",!0),n.$slots.tooltip?(v(),E(c,{key:2},{tooltip:S(()=>[qi(n.$slots,"tooltip")]),default:S(()=>[m(a)]),_:3})):O("",!0)]),t.toggles&&i.settingsStore.settings.toggledCards?(v(),E(h,{key:0,class:Re({rotated:!i.settingsStore.settings.toggledCards[t.slug]})},null,8,["class"])):O("",!0)])),i.settingsStore.settings.toggledCards||t.noSlide?(v(),E(d,{key:1,active:i.settingsStore.settings.toggledCards[t.slug]&&t.toggles||t.noSlide},{default:S(()=>[n.$slots["before-tabs"]?(v(),L("div",g_,[qi(n.$slots,"before-tabs")])):O("",!0),qi(n.$slots,"tabs"),n.$slots.default?(v(),L("div",m_,[qi(n.$slots,"default")])):O("",!0)]),_:3},8,["active"])):O("",!0)])}const y_=Z(u_,[["render",C_]]),b_={props:{width:Number,height:Number,fillColor:String,strokeColor:String,strokeWidth:Number,data:Array},computed:{getViewBox(){return"0 0 "+this.width+" "+this.height},polylinePoints(){const n=Math.max(...this.data.map(s=>s.x)),e=Math.max(...this.data.map(s=>s.y)),t=this.height-this.strokeWidth,i=this.data.map(s=>{const r=s.x===0?0:s.x/n,o=s.y===0?0:s.y/e,l=r*this.width,a=t-o*t+this.strokeWidth;return`${l},${a}`}).join(" ");return`0,${t+this.strokeWidth} `+i+` ${this.width},${t+this.strokeWidth}`}}},S_=["width","height","viewBox"],w_=["fill","points"],v_=["stroke","strokeWidth","points"];function k_(n,e,t,i,s,r){return v(),L("svg",{width:t.width,height:t.height,viewBox:r.getViewBox,role:"img","aria-hidden":"true",focusable:"false"},[A("polygon",{fill:t.fillColor,points:r.polylinePoints},null,8,w_),A("polyline",{fill:"none",stroke:t.strokeColor,strokeWidth:t.strokeWidth,strokeLinejoin:"round",strokeLinecap:"round",points:r.polylinePoints},null,8,v_)],8,S_)}const x_=Z(b_,[["render",k_]]),M_={},A_={viewBox:"0 0 158 21",class:"aioseo-logo-semrush"},D_=A("path",{d:"M108.808 8.212c0-2.579-1.586-4.456-4.628-4.456h-9.826v13.37h3.227v-4.563h3.822l3.742 4.562h3.637v-.29l-3.637-4.351c2.288-.463 3.663-2.13 3.663-4.272zm-4.985 1.653h-6.229V6.533h6.229c1.15 0 1.891.608 1.891 1.666 0 1.084-.714 1.666-1.891 1.666zM157.593 3.756h-3.029v5.078h-8.133V3.756h-3.266v13.383h3.266v-5.277h8.133v5.277h3.029V3.756zM85.72 3.756l-3.598 11.253h-.198l-3.61-11.253H72.56v13.383h3.081V6.149h.185l3.597 10.99h4.96l3.61-10.99h.185v10.99h3.174V3.756h-5.634zM50.57 9.23c-1.138-.118-3.267-.317-4.404-.436-1.124-.119-1.772-.45-1.772-1.19 0-.714.687-1.31 3.464-1.31 2.46 0 4.721.53 6.692 1.482V4.787c-1.97-.939-4.153-1.402-6.864-1.402-3.808 0-6.44 1.587-6.44 4.285 0 2.275 1.547 3.518 4.642 3.861 1.124.12 3.028.291 4.364.397 1.454.12 1.878.569 1.878 1.23 0 .913-1.019 1.468-3.597 1.468-2.619 0-5.277-.86-7.168-2.063v3.081c1.521 1.019 4.14 1.878 7.062 1.878 4.152 0 6.824-1.6 6.824-4.47.026-2.168-1.402-3.478-4.682-3.821zM57.393 3.756v13.383h12.47V14.4h-9.389v-2.71h9.23V8.978h-9.23V6.493h9.39V3.756H57.392zM136.487 9.23c-1.138-.118-3.267-.317-4.404-.436-1.124-.119-1.772-.45-1.772-1.19 0-.714.688-1.31 3.465-1.31 2.459 0 4.721.53 6.691 1.482V4.787c-1.97-.939-4.152-1.402-6.863-1.402-3.809 0-6.44 1.587-6.44 4.285 0 2.275 1.547 3.518 4.641 3.861 1.124.12 3.029.291 4.364.397 1.455.12 1.878.569 1.878 1.23 0 .913-1.018 1.468-3.597 1.468-2.618 0-5.276-.86-7.167-2.063v3.081c1.52 1.019 4.139 1.878 7.061 1.878 4.153 0 6.824-1.6 6.824-4.47.027-2.168-1.402-3.478-4.681-3.821zM121.742 3.756v6.85c0 2.592-1.574 4.02-3.941 4.02-2.38 0-3.941-1.402-3.941-4.06v-6.81h-3.213v6.506c0 4.853 3.028 7.26 7.207 7.26 4.007 0 7.115-2.301 7.115-7.101V3.756h-3.227z",fill:"#020202"},null,-1),T_=A("path",{d:"M30.19 10.368c0 .648-.33.753-1.15.753-.872 0-1.031-.145-1.124-.806-.172-1.68-1.309-3.108-3.213-3.267-.608-.052-.754-.277-.754-1.031 0-.7.106-1.031.648-1.031 3.306.013 5.594 2.67 5.594 5.382zm4.814 0C35.004 5.329 31.593 0 23.711 0H8.054c-.318 0-.516.159-.516.45 0 .158.119.304.225.383.568.45 1.415.952 2.525 1.508 1.085.542 1.931.899 2.777 1.243.357.145.49.304.49.502 0 .278-.199.45-.582.45H.543c-.371 0-.543.238-.543.476 0 .198.066.37.238.542 1.005 1.058 2.618 2.328 4.96 3.796a71.557 71.557 0 006.611 3.636c.344.159.45.344.45.542-.013.225-.185.41-.582.41h-5.7c-.317 0-.502.172-.502.437 0 .145.119.33.278.476 1.295 1.177 3.372 2.46 6.136 3.636C15.579 20.061 19.32 21 23.526 21c7.974 0 11.478-5.964 11.478-10.632zm-10.407 7.445c-4.073 0-7.485-3.32-7.485-7.458 0-4.074 3.399-7.353 7.485-7.353 4.179 0 7.458 3.266 7.458 7.353-.013 4.139-3.28 7.458-7.458 7.458z",fill:"#FF642D"},null,-1),__=[D_,T_];function O_(n,e){return v(),L("svg",A_,__)}const V_=Z(M_,[["render",O_]]),yt="all-in-one-seo-pack",E_={setup(){return{connectStore:_A(),licenseStore:pi(),optionsStore:Lt(),postEditorStore:Te(),rootStore:je(),semrushStore:nD(),truSeo:new n9}},components:{CoreAlert:wt,CoreKeyphrase:g9,CoreLoader:ca,CoreModal:Qt,CoreTooltip:qe,SvgAreaChart:x_,SvgCircleCheck:wd,SvgCirclePlus:Or,SvgLogoSemrush:V_,SvgTrash:gm,metaboxAnalysisDetail:Ad},data(){return{showSemrushTooltip:!1,loadingResults:!1,semrushShowModal:!1,addingAdditionalKeyphrase:!1,removingAdditionalKeyphrase:!1,semrushCountry:null,settingsStore:os(),strings:{modalTitle:j(C("Additional Keyphrases by %1$s",yt),"Semrush"),addKeyphrase:C("Add Focus Keyphrase",yt),getAdditionalKeyphrases:C("Get Additional Keyphrases",yt),showResultsFor:C("Show Results For:",yt),keyphrase:C("Keyphrase",yt),volume:C("Volume",yt),trend:C("Trend",yt),addAdditionalKeyphrase:C("Add Keyphrase",yt),removeAdditionalKeyphrase:C("Remove Keyphrase",yt),noResults:C("No results",yt),upsell:j(C("Analyzing your content with %1$s keywords is only available to licensed %2$s users. %3$s",yt),"Semrush","<strong>AIOSEO Pro</strong>",be.getUpsellLink("semrush-keywords",St.learnMore,null,!0)),semrushGetAdditionalKeyphrases:j(C("%1$s integrates directly with %2$s to provide you with actionable keyphrases to help you write better content.",yt),"AIOSEO","Semrush"),pleaseAddFocusKeyphrase:C("To use this feature, first add a focus keyphrase.",yt),focusKeyphrase:C("Focus Keyphrase",yt),delete:C("Delete",yt),semrushTooltip:j(C("Get Additional Keyphrases with %1$s!",yt),"Semrush"),semrushTooltipLicenseKey:j(C("%1$sA valid license key is required%2$s in order to connect with %3$s.",yt),'<a href="'+this.rootStore.aioseo.urls.aio.settings+'">',"</a>","Semrush"),youHaveExceededSemrush:j(C("You have exceeded the number of requests allowed by your %1$s plan.",yt),"Semrush"),inOrderToUpgradeSemrush:j(C("In order to continue searching for additional keyphrases, you'll need to upgrade. %1$s",yt),be.getUpsellLink("semrush-pricing",St.learnMore,"semrushPricing",!0)),maxAmountReached:j(C("You have reached the maximum of %1$s additional keyphrases.",yt),this.optionsStore.maxAdditionalKeyphrases)}}},watch:{semrushCountry:{deep:!0,handler(){this.settingsStore.changeSemrushCountry(this.semrushCountry),this.getKeyphrases()}}},computed:{semrushError(){return this.semrushStore.error.includes("TOTAL LIMIT EXCEEDED")?C("You have exceeded the limit for requests. Please try again later.",yt):C("An error occurred while fetching keyphrases. Please try again later.",yt)}},methods:{semrushDatabase(){return JSON.parse(JSON.stringify(ah)).map(e=>(e.value==="GB"&&(e.value="UK",e.label="United Kingdom"),e.value==="KR"&&(e.label="South Korea"),e)).filter(e=>BM.includes(e.value.toLowerCase())).map(e=>(e.label=e.label+" - "+e.value.toUpperCase(),e))},getAdditionalKeyphrases(){if(this.showSemrushTooltip=!1,!this.connectStore.isConnected){this.openConnectPopup(this.rootStore.aioseo.urls.connect+"&semrush=true");return}if(!this.semrushStore.hasValidTokens){this.openPopup("https://oauth.semrush.com/auth/login?client_id=aioseo&redirect_uri=https%3A%2F%2Foauth.semrush.com%2Foauth2%2Faioseo%2Fsuccess&ref=2190331110&response_type=code&scope=user.id");return}this.openModal()},transformTrendDataToChartPoints(n){return n.split(",").map((t,i)=>({x:i,y:parseFloat(t)}))},openConnectPopup(n){J2(n,this.connectWithAioseo,600,630,!0,["token"],this.completedConnectCallback,this.closedConnectCallback)},openPopup(n){J2(n,"Semrush Oauth",450,570,!0,["code"],this.completedCallback,this.closedCallback,this.postMessageCallback)},async completedCallback(n){return this.semrushStore.authenticate(n.code)},completedConnectCallback(n){return this.connectStore.saveConnectToken(n.token)},openModal(){this.semrushShowModal=!0,!this.semrushStore.error&&this.getKeyphrases()},getKeyphrases(){var n,e,t;(t=(e=(n=this.postEditorStore.currentPost)==null?void 0:n.keyphrases)==null?void 0:e.focus)!=null&&t.keyphrase&&(this.loadingResults=!0,this.semrushStore.getKeyphrases(this.semrushCountry.value).then(()=>{this.loadingResults=!1}).catch(i=>{this.semrushShowModal=!1,this.loadingResults=!1,console.error(i.message)}))},closedCallback(n){n&&this.openModal()},closedConnectCallback(n){if(n){if(this.semrushStore.hasValidTokens){this.$nextTick(this.getAdditionalKeyphrases);return}this.showSemrushTooltip=!0}},async postMessageCallback(n,e,t){const{data:i,source:s,origin:r}=n;if(!(r!=="https://oauth.semrush.com"||e!==s)){if(i.type==="semrush:oauth:success"){window.removeEventListener("message",t,!1);let o={};try{const l=new URL(i.url);o=Da(l.search)}catch{}this.completedCallback(o).then(()=>{e.close(),e=null,this.closedCallback(!0)})}i.type==="semrush:oauth:denied"&&(e.close(),window.removeEventListener("message",t,!1),e=null,this.closedCallback())}},onSaved(n){const{value:e}=n;this.postEditorStore.currentPost.keyphrases.focus.keyphrase=e,this.postEditorStore.currentPost.loading.focus=!0,this.postEditorStore.isDirty=!0,this.truSeo.runAnalysis({postId:this.postEditorStore.currentPost.id,postData:this.postEditorStore.currentPost})},onDeleted(){this.postEditorStore.currentPost.keyphrases.focus.keyphrase="",this.postEditorStore.isDirty=!0,this.truSeo.runAnalysis({postId:this.postEditorStore.currentPost.id,postData:this.postEditorStore.currentPost})},addKeyphraseEv(){const e=document.getElementsByClassName(`add-focus-keyphrase-${this.$root.$data.screenContext}-input`)[0].querySelector(".medium"),t=e==null?void 0:e.value.trim();t&&(this.postEditorStore.currentPost.keyphrases.focus={keyphrase:t,score:0,analysis:{}},this.postEditorStore.currentPost.loading.focus=!0,e.value="",e.blur(),this.postEditorStore.isDirty=!0,this.truSeo.runAnalysis({postId:this.postEditorStore.currentPost.id,postData:this.postEditorStore.currentPost}))},hasAdditionalKeyphrase(n){const{additional:e}=this.postEditorStore.currentPost.keyphrases;return e.filter(t=>t.keyphrase.toLowerCase()===n).length},getAdditionalKeyphrase(n){const{additional:e}=this.postEditorStore.currentPost.keyphrases;return e.find(t=>t.keyphrase.toLowerCase()===n)},scoreClass(n){return 79<n?"score-green":49<n?"score-orange":0<n?"score-red":"score-none"},async addAdditionalKeyphrase(n,e){var r,o;if(this.optionsStore.maxAdditionalKeyphrases<=((o=(r=this.postEditorStore.currentPost.keyphrases)==null?void 0:r.additional)==null?void 0:o.length))return;this.addingAdditionalKeyphrase=e;const{additional:t}=this.postEditorStore.currentPost.keyphrases,i=t.push({keyphrase:n,score:0}),s=document.getElementsByClassName("keyphrase-name");this.postEditorStore.currentPost.keyphrases.additional=t,this.postEditorStore.isDirty=!0,await this.truSeo.runAnalysis({postId:this.postEditorStore.currentPost.id,postData:this.postEditorStore.currentPost}),await this.$nextTick(),s[i]&&s[i].click(),this.addingAdditionalKeyphrase=!1},goToAdditionalKeyphrase(n){const{additional:e}=this.postEditorStore.currentPost.keyphrases,t=e.findIndex(i=>i.keyphrase.toLowerCase()===n);if(t!==-1){const i=document.getElementsByClassName("keyphrase-name");i[t+1]&&i[t+1].click(),this.semrushShowModal=!1}},removeAdditionalKeyphrase(n,e){this.removingAdditionalKeyphrase=e;const{additional:t}=this.postEditorStore.currentPost.keyphrases,i=t.findIndex(s=>s.keyphrase.toLowerCase()===n);if(i!==-1){t.splice(i,1),this.postEditorStore.currentPost.keyphrases.additional=t;const s=document.getElementsByClassName("keyphrase-name");s[0]&&s[0].click()}this.$nextTick(()=>{this.removingAdditionalKeyphrase=!1})},toggleDescriptionEv(n){n.target.parentElement.classList.toggle("toggled")},pressEnter(n){const e=document.getElementById("add-focus-keyphrase");n.preventDefault(),e.click()}},mounted(){var e;const n=[];this.optionsStore.internalOptions.integrations.semrush.accessToken&&this.semrushStore.expired&&n.push(this.semrushStore.refresh()),this.semrushCountry={value:this.settingsStore.settings.semrushCountry,label:(e=this.semrushDatabase().find(t=>t.value===this.settingsStore.settings.semrushCountry))==null?void 0:e.label}}},P_={class:"aioseo-focus-keyphrase-panel"},L_={class:"disabled-button gray medium"},R_={class:"disabled-button gray"},B_=["innerHTML"],H_={class:"aioseo-modal-content has-padding"},N_={class:"aioseo-settings-row"},F_={class:"settings-name"},I_={class:"name"},W_={class:"results"},z_={"aria-label":"Additional Keyphrases",class:"additional-keyphrases-table",cellpadding:"0",cellspacing:"0"},U_={class:"keyphrases-header"},$_={class:"keyphrase"},K_={class:"keyphrase-volume"},G_={class:"keyphrase-trend"},q_={key:0,class:"keyphrase-actions"},Z_={class:"keyphrases-rows"},j_={class:"keyphrase"},Y_={class:"keyphrase-volume"},J_={class:"keyphrase-trend"},X_={key:0,class:"keyphrase-actions"},Q_={key:0,class:"focus-keyphrase"},eO={key:1},tO={key:2,class:"remove-keyphrase"},iO=["onClick"],sO={key:1,class:"keyphrase-row"},nO=["colspan"],rO={key:1},oO={class:"semrush-logo"},lO={class:"semrush-upsell"},aO=["innerHTML"],hO=["innerHTML"];function cO(n,e,t,i,s,r){const o=x("base-input"),l=x("svg-circle-plus"),a=x("base-button"),c=x("core-tooltip"),h=x("core-keyphrase"),d=x("core-loader"),u=x("metaboxAnalysisDetail"),f=x("core-alert"),p=x("base-select"),g=x("svg-area-chart"),b=x("svg-circle-check"),y=x("svg-trash"),w=x("svg-logo-semrush"),M=x("core-modal");return v(),L("div",P_,[!i.postEditorStore.currentPost.keyphrases.focus||!i.postEditorStore.currentPost.keyphrases.focus.keyphrase?(v(),E(o,{key:0,size:"medium",class:Re(`add-focus-keyphrase-${n.$root.$data.screenContext}-input`),onKeydown:hm(r.pressEnter,["enter"])},null,8,["class","onKeydown"])):O("",!0),A("div",{class:Re(`add-focus-keyphrase-${n.$root.$data.screenContext}-button`)},[!i.postEditorStore.currentPost.keyphrases.focus||!i.postEditorStore.currentPost.keyphrases.focus.keyphrase?(v(),E(a,{key:0,id:"add-focus-keyphrase",class:"add-keyphrase gray medium",onClick:r.addKeyphraseEv},{default:S(()=>[m(l,{width:"14",height:"14"}),B(" "+D(s.strings.addKeyphrase),1)]),_:1},8,["onClick"])):O("",!0),!i.postEditorStore.currentPost.keyphrases.focus||!i.postEditorStore.currentPost.keyphrases.focus.keyphrase?(v(),E(c,{key:1},{tooltip:S(()=>[A("span",null,D(s.strings.semrushGetAdditionalKeyphrases)+" "+D(s.strings.pleaseAddFocusKeyphrase),1)]),default:S(()=>[A("div",L_,[m(l,{width:"14",height:"14"}),B(" "+D(s.strings.getAdditionalKeyphrases),1)])]),_:1})):O("",!0)],2),i.postEditorStore.currentPost.keyphrases.focus&&i.postEditorStore.currentPost.keyphrases.focus.keyphrase?(v(),E(h,{key:1,index:0,keyphrase:i.postEditorStore.currentPost.keyphrases.focus.keyphrase,score:i.postEditorStore.currentPost.keyphrases.focus.score,onSaved:r.onSaved,onDeleted:r.onDeleted,class:"aioseo-keyphrase-tag"},null,8,["keyphrase","score","onSaved","onDeleted"])):O("",!0),i.postEditorStore.currentPost.loading.focus&&i.postEditorStore.currentPost.keyphrases.focus?(v(),E(d,{key:2,class:"analysis-loading",dark:""})):O("",!0),!i.postEditorStore.currentPost.loading.focus&&i.postEditorStore.currentPost.keyphrases.focus&&i.postEditorStore.currentPost.keyphrases.focus.keyphrase?(v(),E(u,{key:3,analysisItems:i.postEditorStore.currentPost.keyphrases.focus.analysis},null,8,["analysisItems"])):O("",!0),!i.postEditorStore.currentPost.loading.focus&&i.postEditorStore.currentPost.keyphrases.focus&&i.postEditorStore.currentPost.keyphrases.focus.keyphrase&&i.rootStore.isPro&&i.licenseStore.isUnlicensed?(v(),E(c,{key:4},{tooltip:S(()=>[A("span",{innerHTML:s.strings.semrushTooltipLicenseKey},null,8,B_)]),default:S(()=>[A("div",R_,[m(l,{width:"14",height:"14"}),B(" "+D(s.strings.getAdditionalKeyphrases),1)])]),_:1})):O("",!0),!i.postEditorStore.currentPost.loading.focus&&i.postEditorStore.currentPost.keyphrases.focus&&i.postEditorStore.currentPost.keyphrases.focus.keyphrase&&(!i.rootStore.isPro||!i.licenseStore.isUnlicensed)?(v(),E(c,{key:5,disabled:!s.showSemrushTooltip||i.rootStore.isPro,"force-show":s.showSemrushTooltip&&!i.rootStore.isPro},{tooltip:S(()=>[A("span",null,D(s.strings.semrushTooltip),1)]),default:S(()=>[m(a,{class:"add-keyphrase gray medium",onClick:r.getAdditionalKeyphrases},{default:S(()=>[m(l,{width:"14",height:"14"}),B(" "+D(s.strings.getAdditionalKeyphrases),1)]),_:1},8,["onClick"])]),_:1},8,["disabled","force-show"])):O("",!0),m(M,{show:s.semrushShowModal,onClose:e[1]||(e[1]=k=>s.semrushShowModal=!1),classes:["aioseo-focus-keyphrase-panel-modal"]},{headerTitle:S(()=>[B(D(s.strings.modalTitle),1)]),body:S(()=>[A("div",H_,[i.licenseStore.isUnlicensed?(v(),E(f,{key:0,type:"blue",innerHTML:s.strings.upsell},null,8,["innerHTML"])):O("",!0),A("div",N_,[A("div",F_,[A("div",I_,D(s.strings.showResultsFor),1)]),m(p,{class:"semrush-country-selector",size:"medium",options:r.semrushDatabase(),placeholder:s.strings.selectPriceIndicator,modelValue:s.semrushCountry,"onUpdate:modelValue":e[0]||(e[0]=k=>s.semrushCountry=k)},null,8,["options","placeholder","modelValue"])]),A("div",W_,[A("table",z_,[A("thead",null,[A("tr",U_,[A("th",$_,D(s.strings.keyphrase),1),A("th",K_,D(s.strings.volume),1),A("th",G_,D(s.strings.trend),1),i.licenseStore.isUnlicensed?O("",!0):(v(),L("th",q_))])]),A("tbody",Z_,[i.semrushStore.results.length&&!s.loadingResults?(v(!0),L(xt,{key:0},_i(i.semrushStore.results,(k,V)=>{var R,H,W,G;return v(),L("tr",{class:Re(["keyphrase-row",{even:V%2===0}]),key:V},[A("td",j_,D(k[0]),1),A("td",Y_,D(k[1]),1),A("td",J_,[m(g,{width:66,height:24,data:r.transformTrendDataToChartPoints(k[2]),strokeWidth:1.8,strokeColor:"#498afc",fillColor:"#ade3fc"},null,8,["data"])]),i.licenseStore.isUnlicensed?O("",!0):(v(),L("td",X_,[k[0]===i.postEditorStore.currentPost.keyphrases.focus.keyphrase.toLowerCase()?(v(),L("div",Q_,[m(b),B(" "+D(s.strings.focusKeyphrase),1)])):O("",!0),k[0]!==i.postEditorStore.currentPost.keyphrases.focus.keyphrase.toLowerCase()?(v(),L("div",eO,[V!==s.removingAdditionalKeyphrase&&(V===s.addingAdditionalKeyphrase||!r.hasAdditionalKeyphrase(k[0]))&&i.optionsStore.maxAdditionalKeyphrases>((H=(R=i.postEditorStore.currentPost.keyphrases)==null?void 0:R.additional)==null?void 0:H.length)?(v(),E(a,{key:0,type:"gray",size:"medium",onClick:z=>r.addAdditionalKeyphrase(k[0],V),loading:V===s.addingAdditionalKeyphrase},{default:S(()=>[B(D(s.strings.addAdditionalKeyphrase),1)]),_:2},1032,["onClick","loading"])):O("",!0),V!==s.removingAdditionalKeyphrase&&(V===s.addingAdditionalKeyphrase||!r.hasAdditionalKeyphrase(k[0]))&&i.optionsStore.maxAdditionalKeyphrases<=((G=(W=i.postEditorStore.currentPost.keyphrases)==null?void 0:W.additional)==null?void 0:G.length)?(v(),E(c,{key:1},{tooltip:S(()=>[A("span",null,D(s.strings.maxAmountReached),1)]),default:S(()=>[m(a,{type:"gray",size:"medium",disabled:!0,onClick:z=>r.addAdditionalKeyphrase(k[0],V),loading:V===s.addingAdditionalKeyphrase},{default:S(()=>[B(D(s.strings.addAdditionalKeyphrase),1)]),_:2},1032,["onClick","loading"])]),_:2},1024)):O("",!0),r.getAdditionalKeyphrase(k[0])&&V!==s.addingAdditionalKeyphrase&&(V===s.removingAdditionalKeyphrase||r.hasAdditionalKeyphrase(k[0]))?(v(),L("div",tO,[A("span",{class:Re(["keyphrase-score",r.scoreClass(r.getAdditionalKeyphrase(k[0]).score)]),onClick:z=>r.goToAdditionalKeyphrase(k[0])},D(r.getAdditionalKeyphrase(k[0]).score)+"/100",11,iO),m(c,{type:"action"},{tooltip:S(()=>[B(D(s.strings.delete),1)]),default:S(()=>[m(y,{onClick:z=>r.removeAdditionalKeyphrase(k[0],V)},null,8,["onClick"])]),_:2},1024)])):O("",!0)])):O("",!0)]))],2)}),128)):O("",!0),!i.semrushStore.results.length||s.loadingResults?(v(),L("tr",sO,[A("td",{colspan:i.licenseStore.isUnlicensed?3:4,class:"no-results"},[A("div",null,[s.loadingResults?(v(),E(d,{key:0,dark:""})):O("",!0),!s.loadingResults&&!i.semrushStore.error?(v(),L("span",rO,D(s.strings.noResults),1)):O("",!0),i.semrushStore.error&&!i.semrushStore.error.includes("TOTAL LIMIT EXCEEDED")?(v(),E(f,{key:2,type:"red"},{default:S(()=>[B(D(r.semrushError),1)]),_:1})):O("",!0),i.semrushStore.error&&i.semrushStore.error.includes("TOTAL LIMIT EXCEEDED")?(v(),L(xt,{key:3},[A("div",oO,[m(w)]),A("div",lO,[A("span",null,[A("strong",{innerHTML:s.strings.youHaveExceededSemrush},null,8,aO)]),B(" "+D(" ")+" "),A("span",{innerHTML:s.strings.inOrderToUpgradeSemrush},null,8,hO)])],64)):O("",!0)])],8,nO)])):O("",!0)])])])])]),_:1},8,["show"])])}const dO=Z(E_,[["render",cO]]),wh="all-in-one-seo-pack",uO={setup(){const{getErrorClass:n,getErrorDisplay:e,strings:t}=pm();return{postEditorStore:Te(),rootStore:je(),getErrorClass:n,getErrorDisplay:e,strings:t}},components:{CoreAlert:wt,CoreMainTabs:Qi,metaboxAnalysisDetail:Ad,SvgEllipse:um,SvgCircleCheck:wd},data(){return{initTab:"basic",tabs:[{slug:"basic",name:C("Basic SEO",wh)},{slug:"title",name:C("Title",wh)},{slug:"readability",name:C("Readability",wh)}]}},computed:{parseTabs(){return this.tabs.map(n=>(n.errorCount=this.postEditorStore.currentPost.page_analysis.analysis[n.slug].errors,n))},pageBuilderAlert(){if(!yd()||!["elementor","divi"].includes(this.rootStore.aioseo.integration))return!1;const n=this.rootStore.aioseo.integration.charAt(0).toUpperCase()+this.rootStore.aioseo.integration.slice(1);return j(C("We have detected that you are currently using the %1$s Page Builder. Please click %2$shere%3$s to use the %1$s editor for a most accurate result.",wh),n,'<a href="'+this.postEditorStore.currentPost.editlink+'">',"</a>")}},methods:{processChangeTab(n){this.initTab=n}}},fO={class:"page-analysis-panel"},pO=["innerHTML"];function gO(n,e,t,i,s,r){const o=x("core-alert"),l=x("svg-ellipse"),a=x("svg-circle-check"),c=x("core-main-tabs"),h=x("metaboxAnalysisDetail");return v(),L("div",fO,[r.pageBuilderAlert?(v(),E(o,{key:0,type:"yellow"},{default:S(()=>[A("span",{innerHTML:r.pageBuilderAlert},null,8,pO)]),_:1})):O("",!0),m(c,{tabs:r.parseTabs,showSaveButton:!1,active:s.initTab,internal:"",onChanged:e[0]||(e[0]=d=>r.processChangeTab(d))},{"after-label":S(({tab:d})=>[d.errorCount>=0?(v(),L("span",{key:0,class:Re(["tab-score",i.getErrorClass(i.postEditorStore.currentPost.page_analysis.analysis[d.slug].errors)])},[0<i.postEditorStore.currentPost.page_analysis.analysis[d.slug].errors?(v(),E(l,{key:0,width:"6"})):O("",!0),i.postEditorStore.currentPost.page_analysis.analysis[d.slug].errors===0?(v(),E(a,{key:1,width:"12"})):O("",!0),B(" "+D(i.getErrorDisplay(i.postEditorStore.currentPost.page_analysis.analysis[d.slug].errors)),1)],2)):O("",!0)]),_:1},8,["tabs","active"]),m(Aa,{mode:"out-in"},{default:S(()=>[i.postEditorStore.currentPost.page_analysis?(v(),E(h,{key:0,analysisItems:i.postEditorStore.currentPost.page_analysis.analysis[s.initTab]},null,8,["analysisItems"])):O("",!0)]),_:1})])}const mO=Z(uO,[["render",gO]]),vh="all-in-one-seo-pack",CO={emits:["changeTab"],setup(){return{licenseStore:pi(),postEditorStore:Te(),hasRequiredFeature:rr.hasCoreFeature("general","cornerstone-content"),GLOBAL_STRINGS:St,links:be}},components:{CoreAlert:wt},data(){return{license:rr,strings:{description:C("Cornerstone content refers to the most important and informative articles or pages on your website that serve as the foundation for your content strategy. AIOSEO uses cornerstone content for",vh),linkingRecommendations:C("internal linking recommendations in Link Assistant.",vh),upsell:j(C("Cornerstone Content is a %1$s feature. %2$s",vh),"PRO",be.getUpsellLink("post-settings-general",St.learnMore,"cornerstone-content",!0)),markAsCornerstone:C("Mark as Cornerstone",vh)}}}},yO={class:"cornerstone-content-panel"},bO={class:"cornerstone-content-text"},SO=["innerHTML"],wO=["innerHTML"];function vO(n,e,t,i,s,r){const o=x("base-toggle"),l=x("core-alert");return v(),L("div",yO,[A("p",bO,[A("span",null,D(s.strings.description),1),A("a",{href:"#",onClick:e[0]||(e[0]=Dt(a=>n.$emit("changeTab",{main:"linkAssistant",sub:"link-suggestions"}),["stop","prevent"]))},D(s.strings.linkingRecommendations),1),A("span",{innerHTML:i.links.getDocLink(i.GLOBAL_STRINGS.learnMore,"cornerstoneContent",!0)},null,8,SO)]),m(o,{modelValue:i.postEditorStore.currentPost.pillar_content,"onUpdate:modelValue":[e[1]||(e[1]=a=>i.postEditorStore.currentPost.pillar_content=a),e[2]||(e[2]=a=>i.postEditorStore.isDirty=!0)],disabled:!i.hasRequiredFeature},{default:S(()=>[B(D(s.strings.markAsCornerstone),1)]),_:1},8,["modelValue","disabled"]),i.licenseStore.isUnlicensed||!i.hasRequiredFeature?(v(),E(l,{key:0,class:"inline-upsell",type:"blue"},{default:S(()=>[A("div",{innerHTML:s.strings.upsell},null,8,wO)]),_:1})):O("",!0)])}const kO=Z(CO,[["render",vO]]),Mt="all-in-one-seo-pack",xO={emits:["changeTab"],setup(){const{parseTags:n}=dm({separator:void 0}),{maxRecommendedCount:e}=cm(),{watchHighlightSentences:t}=WD(),{runAnalysis:i,strings:s}=pm();return{composableStrings:s,licenseStore:pi(),maxRecommendedCount:e,optionsStore:Lt(),parseTags:n,postEditorStore:Te(),rootStore:je(),runAnalysis:i,seoPreviewStore:EA(),settingsStore:os(),tagsStore:AM(),truSeoHighlighterStore:Md(),watchHighlightSentences:t}},components:{AdditionalKeyphrases:mT,AiGenerator:d_,BaseRadioToggle:br,CoreAlert:wt,CoreGoogleSearchPreview:AA,CoreHtmlTagsEditor:vt,CoreSettingsRow:Ce,CoreSidebarCard:y_,CoreTooltip:qe,CoreProBadge:TA,FocusKeyphrase:dO,MetaboxAnalysisDetail:Ad,PageAnalysis:mO,CornerstoneContent:kO,SvgCircleQuestionMark:yr,SvgDesktop:OA,SvgMobile:VA,SvgPencil:_r},props:{disabled:{type:Boolean,default(){return!1}},parentComponentContext:String},data(){return{license:rr,allowed:cn,isPageBuilderEditor:Er,titleCount:0,descriptionCount:0,keywords:null,keyphrases:null,selectedKeyphrase:0,editSnippet:!1,truSeo:null,titleKey:"title0",descriptionKey:"description0",strings:J7(this.composableStrings,{pageName:C("General",Mt),serpPreview:C("SERP Preview",Mt),serpPreviewDocumentation:C("SERP: Search Engine Results Page preview. Your site's potential appearance in Google search results. Final display may vary, but this preview closely resembles it.",Mt),editSnippet:C("Edit Snippet",Mt),clickToAddTitle:C("Click on the tags below to insert variables into your title.",Mt),metaDescription:C("Meta Description",Mt),clickToAddDescription:C("Click on the tags below to insert variables into your meta description.",Mt),cornerstoneContent:C("Cornerstone Content",Mt),focusKeyphrase:C("Focus Keyphrase",Mt),additionalKeyphrases:C("Additional Keyphrases",Mt),pageAnalysis:C("Page Analysis",Mt),basicSeo:C("Basic SEO",Mt),title:C("Title",Mt),readability:C("Readability",Mt),lookingForMetaKeywords:C("Looking for meta keywords?",Mt),goToAdvancedTab:C("Go to the Advanced tab to add/edit meta keywords",Mt),autogenerateDescriptionsAlert:j(C("Warning: You have disabled Autogenerate Descriptions and are using the default description format. %1$s will not output a description unless you enter a custom one. You can enable Autogenerate Descriptions under %2$s.",Mt),"AIOSEO",be.getPlainLink(C("Search Appearance > Advanced",Mt),this.rootStore.aioseo.urls.aio.searchAppearance+"#/advanced")),keyphraseDocumentation:j(C("Not sure what keyphrases are used for? Check out our documentation for more information. %1$s",Mt),be.getDocLink(St.learnMore,"useKeyphrasesTooltip",!0))})}},watch:{"postEditorStore.currentPost.title"(){Zd(()=>this.runAnalysis({postId:this.postEditorStore.currentPost.id}),750)},"postEditorStore.currentPost.description"(){Zd(()=>this.runAnalysis({postId:this.postEditorStore.currentPost.id}),750)},"truSeoHighlighterStore.highlightSentences"(n,e){Zd(()=>this.watchHighlightSentences(n,e))}},computed:{title(){return j(C("%1$s Title",Mt),this.postEditorStore.currentPost.type)},toggled:function(){return this.postEditorStore.currentPost.pillar_content===1},displayTruSeoMetaboxCard(){return Yd()&&this.$root.$data.screenContext==="metabox"&&this.postEditorStore.currentPost.context==="post"&&this.parentComponentContext!=="modal"&&cn("aioseo_page_analysis")&&!this.isForum},displayTruSeoSidebarKeyphraseCard(){return Yd()&&this.$root.$data.screenContext==="sidebar"&&this.parentComponentContext!=="modal"&&cn("aioseo_page_analysis")&&!this.isForum},displayTruSeoSidebarAnalysisCard(){return Yd()&&this.$root.$data.screenContext==="sidebar"&&this.postEditorStore.currentPost.page_analysis&&this.parentComponentContext!=="modal"&&cn("aioseo_page_analysis")&&!this.isForum},isForum(){return this.rootStore.aioseo.data.isBBPressActive&&(this.postEditorStore.currentPost.postType==="forum"||this.postEditorStore.currentPost.postType==="topic"||this.postEditorStore.currentPost.postType==="reply")},focusKeyphraseScore(){return this.postEditorStore.currentPost.keyphrases.focus.keyphrase?this.postEditorStore.currentPost.keyphrases.focus.score:null},showAutogenerateDescriptionsAlert(){return this.optionsStore.internalOptions.internal.deprecatedOptions.includes("autogenerateDescriptions")?(this.postEditorStore.currentPost.context==="post"?this.optionsStore.dynamicOptions.searchAppearance.postTypes[this.postEditorStore.currentPost.postType].metaDescription:this.optionsStore.dynamicOptions.searchAppearance.taxonomies[this.postEditorStore.currentPost.termType].metaDescription)===this.postEditorStore.currentPost.description&&!this.optionsStore.options.deprecated.searchAppearance.advanced.autogenerateDescriptions:!1}},methods:{hideKeywordsLooking(){this.optionsStore.options.searchAppearance.advanced.keywordsLooking=!1,this.optionsStore.saveChanges()},isMobilePreviewEv(n){this.postEditorStore.changeGeneralPreview(n)},editSnippetEv(){this.editSnippet=!this.editSnippet,this.settingsStore.changeTabSettings({setting:"modal",value:"general"}),this.postEditorStore.currentPost.modalOpen=!0},getDefaultTags(n){switch(n){case"title":return this.postEditorStore.currentPost.context==="post"?["post_title","separator_sa","site_title"]:["taxonomy_title","separator_sa","site_title"];case"description":return this.postEditorStore.currentPost.context==="post"?this.postEditorStore.currentPost.postType==="attachment"?["attachment_caption","separator_sa","site_title"]:this.postEditorStore.currentPost.postType==="product"?["post_excerpt","post_content"]:["post_excerpt","post_content","separator_sa"]:["taxonomy_title","separator_sa","taxonomy_description"]}},getFocusKeyphraseTooltipOffset(){return DM()?"-15px,0":Er()?"35px,0":"0,0"}},mounted(){this.keyphrases=this.postEditorStore.currentPost.keyphrases,this.postEditorStore.currentPost.context==="post"&&!this.postEditorStore.currentPost.keyphrases.length&&(this.selectedKeyphrase=-1),window.aioseoBus.$on("updateTitleKey",()=>{this.titleKey="title"+Math.random(0,999)}),window.aioseoBus.$on("updateDescriptionKey",()=>{this.descriptionKey="description"+Math.random(0,999)})}},MO={class:"aioseo-tab-content aioseo-post-general"},AO=["innerHTML"],DO=["innerHTML"],TO=["innerHTML"],_O={key:0},OO=["innerHTML"],VO=["innerHTML"];function EO(n,e,t,i,s,r){const o=x("svg-circle-question-mark"),l=x("core-tooltip"),a=x("svg-desktop"),c=x("svg-mobile"),h=x("base-radio-toggle"),d=x("core-google-search-preview"),u=x("svg-pencil"),f=x("base-button"),p=x("core-settings-row"),g=x("ai-generator"),b=x("core-html-tags-editor"),y=x("core-alert"),w=x("core-pro-badge"),M=x("cornerstone-content"),k=x("focus-keyphrase"),V=x("additional-keyphrases"),R=x("page-analysis"),H=x("core-sidebar-card"),W=x("metabox-analysis-detail");return v(),L("div",MO,[s.allowed("aioseo_page_general_settings")?(v(),E(p,{key:0,class:"snippet-preview-row","no-right-max-width":""},{name:S(()=>[A("div",null,[A("span",null,D(s.strings.serpPreview),1),m(l,{offset:n.$root.$data.screenContext==="sidebar"&&t.parentComponentContext==="metabox"?"10px,0":"50px,0",placement:"bottom"},{tooltip:S(()=>[B(D(s.strings.serpPreviewDocumentation),1)]),default:S(()=>[m(o)]),_:1},8,["offset"])]),n.$root.$data.screenContext==="metabox"||t.parentComponentContext==="modal"?(v(),E(h,{key:0,modelValue:i.postEditorStore.currentPost.generalMobilePrev,"onUpdate:modelValue":r.isMobilePreviewEv,name:"previewGeneralIsMobile",class:"circle",options:[{label:"desktop",value:!1,activeClass:"dark",slot:"desktop"},{label:"mobile",value:!0,slot:"mobile"}]},{desktop:S(()=>[m(a)]),mobile:S(()=>[m(c)]),_:1},8,["modelValue","onUpdate:modelValue"])):O("",!0)]),content:S(()=>{var G,z,q;return[m(d,{"focus-keyphrase":((q=(z=(G=i.postEditorStore.currentPost)==null?void 0:G.keyphrases)==null?void 0:z.focus)==null?void 0:q.keyphrase)??"",device:n.$root.$data.screenContext==="sidebar"&&t.parentComponentContext==="metabox"||i.postEditorStore.currentPost.generalMobilePrev?"mobile":"desktop",url:i.tagsStore.liveTags.permalink,title:i.parseTags(i.postEditorStore.currentPost.title||i.postEditorStore.currentPost.tags.title||"#post_title #separator_sa #site_title"),description:i.parseTags(i.postEditorStore.currentPost.description||i.postEditorStore.currentPost.tags.description||"#post_content"),"rich-results":i.seoPreviewStore.richResults},null,8,["focus-keyphrase","device","url","title","description","rich-results"]),n.$root.$data.screenContext==="sidebar"&&t.parentComponentContext!=="modal"?(v(),E(f,{key:0,class:"edit-snippet gray small",onClick:r.editSnippetEv},{default:S(()=>[m(u),B(" "+D(s.strings.editSnippet),1)]),_:1},8,["onClick"])):O("",!0)]}),_:1})):O("",!0),(n.$root.$data.screenContext==="metabox"||t.parentComponentContext==="modal")&&s.allowed("aioseo_page_general_settings")?(v(),E(p,{id:"aioseo-post-settings-post-title-row",class:"snippet-title-row",name:r.title,key:s.titleKey},{content:S(()=>[m(b,{modelValue:i.postEditorStore.currentPost.title,"onUpdate:modelValue":[e[0]||(e[0]=G=>i.postEditorStore.currentPost.title=G),e[2]||(e[2]=G=>i.postEditorStore.isDirty=!0)],"line-numbers":!1,single:"",onCounter:e[1]||(e[1]=G=>s.titleCount=G.length),"tags-context":`${i.postEditorStore.currentPost.postType||i.postEditorStore.currentPost.termType}Title`,defaultMenuOrientation:t.parentComponentContext==="modal"?"top":"bottom","default-tags":r.getDefaultTags("title")},{"tags-description":S(()=>[B(D(s.strings.clickToAddTitle),1)]),"append-button":S(()=>[i.postEditorStore.currentPost.postType&&i.postEditorStore.currentPost.postType!=="web-story"&&!s.isPageBuilderEditor()?(v(),E(g,{key:0,type:"title"})):O("",!0)]),_:1},8,["modelValue","tags-context","defaultMenuOrientation","default-tags"]),A("div",{class:"max-recommended-count",innerHTML:i.maxRecommendedCount(s.titleCount,60)},null,8,AO)]),_:1},8,["name"])):O("",!0),(n.$root.$data.screenContext==="metabox"||t.parentComponentContext==="modal")&&s.allowed("aioseo_page_general_settings")?(v(),E(p,{id:"aioseo-post-settings-meta-description-row",class:"snippet-description-row",name:s.strings.metaDescription,key:s.descriptionKey},{content:S(()=>[r.showAutogenerateDescriptionsAlert?(v(),E(y,{key:0,type:"yellow"},{default:S(()=>[A("span",{innerHTML:s.strings.autogenerateDescriptionsAlert},null,8,DO)]),_:1})):O("",!0),m(b,{modelValue:i.postEditorStore.currentPost.description,"onUpdate:modelValue":[e[3]||(e[3]=G=>i.postEditorStore.currentPost.description=G),e[5]||(e[5]=G=>i.postEditorStore.isDirty=!0)],"line-numbers":!1,description:"",onCounter:e[4]||(e[4]=G=>s.descriptionCount=G.length),"tags-context":`${i.postEditorStore.currentPost.postType||i.postEditorStore.currentPost.termType}Description`,defaultMenuOrientation:t.parentComponentContext==="modal"?"top":"bottom","default-tags":r.getDefaultTags("description")},{"tags-description":S(()=>[B(D(s.strings.clickToAddDescription),1)]),"append-button":S(()=>[i.postEditorStore.currentPost.postType&&i.postEditorStore.currentPost.postType!=="web-story"&&!s.isPageBuilderEditor()?(v(),E(g,{key:0,type:"description"})):O("",!0)]),_:1},8,["modelValue","tags-context","defaultMenuOrientation","default-tags"]),A("div",{class:"max-recommended-count",innerHTML:i.maxRecommendedCount(s.descriptionCount,160)},null,8,TO)]),_:1},8,["name"])):O("",!0),n.$root.$data.screenContext==="metabox"&&i.postEditorStore.currentPost.context==="post"&&!["attachment","web-story"].includes(i.postEditorStore.currentPost.postType)&&!s.isPageBuilderEditor()?(v(),E(p,{key:3,id:"aioseo-post-settings-cornerstone-content-row",class:"cornerstone-content-row"},{name:S(()=>[B(D(s.strings.cornerstoneContent)+" ",1),i.licenseStore.isUnlicensed?(v(),E(w,{key:0})):O("",!0)]),content:S(()=>[m(M,{onChangeTab:e[6]||(e[6]=G=>n.$emit("changeTab",G))})]),_:1})):O("",!0),r.displayTruSeoMetaboxCard?(v(),L(xt,{key:4},[i.optionsStore.options.searchAppearance.advanced.useKeywords&&i.optionsStore.options.searchAppearance.advanced.keywordsLooking?(v(),L("div",_O,[m(y,{class:"meta-keywords-alert",type:"blue","show-close":"",onCloseAlert:r.hideKeywordsLooking},{default:S(()=>[B(D(s.strings.lookingForMetaKeywords)+" ",1),A("a",{href:"#",onClick:e[7]||(e[7]=Dt(G=>n.$emit("changeTab","advanced"),["prevent"]))},D(s.strings.goToAdvancedTab),1),A("a",{class:"no-underline",href:"#",onClick:e[8]||(e[8]=Dt(G=>n.$emit("changeTab","advanced"),["prevent"]))}," → ")]),_:1},8,["onCloseAlert"])])):O("",!0),m(p,{id:"aioseo-post-settings-snippet-focus-keyphrase-row",class:"snippet-focus-keyphrase-row",align:""},{name:S(()=>[A("span",null,D(s.strings.focusKeyphrase),1),m(l,{offset:"25px,0"},{tooltip:S(()=>[A("div",{innerHTML:s.strings.keyphraseDocumentation},null,8,OO)]),default:S(()=>[m(o)]),_:1})]),content:S(()=>[m(k)]),_:1}),m(p,{name:s.strings.additionalKeyphrases,class:"snippet-additional-keyphrases-row"},{content:S(()=>[m(V)]),_:1},8,["name"])],64)):O("",!0),r.displayTruSeoMetaboxCard&&i.postEditorStore.currentPost.page_analysis?(v(),E(p,{key:5,name:s.strings.pageAnalysis,class:"snippet-page-analysis-row",align:""},{content:S(()=>[m(R)]),_:1},8,["name"])):O("",!0),n.$root.$data.screenContext==="sidebar"&&!s.isPageBuilderEditor()&&t.parentComponentContext!=="modal"?(v(),E(H,{key:6,class:"card-cornerstone-content",slug:"cornerstoneContent","header-text":s.strings.cornerstoneContent},{default:S(()=>[m(M,{onChangeTab:e[9]||(e[9]=G=>n.$emit("changeTab",G))})]),_:1},8,["header-text"])):O("",!0),r.displayTruSeoSidebarKeyphraseCard?(v(),E(H,{key:7,slug:"focus",focusScore:r.focusKeyphraseScore,class:"card-focus-keyphrase"},{header:S(()=>[A("span",null,D(s.strings.focusKeyphrase),1),m(l,{offset:r.getFocusKeyphraseTooltipOffset()},{tooltip:S(()=>[A("div",{innerHTML:s.strings.keyphraseDocumentation},null,8,VO)]),default:S(()=>[m(o)]),_:1},8,["offset"])]),default:S(()=>[m(k)]),_:1},8,["focusScore"])):O("",!0),r.displayTruSeoSidebarKeyphraseCard?(v(),E(H,{key:8,slug:"additional","header-text":s.strings.additionalKeyphrases,class:"card-additional-keyphrase"},{default:S(()=>[m(V)]),_:1},8,["header-text"])):O("",!0),r.displayTruSeoSidebarAnalysisCard?(v(),E(H,{key:9,slug:"basicseo","header-text":s.strings.basicSeo,trueSeoScore:i.postEditorStore.currentPost.page_analysis.analysis.basic.errors,class:"card-basic-seo"},{default:S(()=>[m(W,{analysisItems:i.postEditorStore.currentPost.page_analysis.analysis.basic},null,8,["analysisItems"])]),_:1},8,["header-text","trueSeoScore"])):O("",!0),r.displayTruSeoSidebarAnalysisCard?(v(),E(H,{key:10,slug:"title","header-text":s.strings.title,trueSeoScore:i.postEditorStore.currentPost.page_analysis.analysis.title.errors,class:"card-title-seo"},{default:S(()=>[m(W,{analysisItems:i.postEditorStore.currentPost.page_analysis.analysis.title},null,8,["analysisItems"])]),_:1},8,["header-text","trueSeoScore"])):O("",!0),r.displayTruSeoSidebarAnalysisCard?(v(),E(H,{key:11,slug:"readability","header-text":s.strings.readability,trueSeoScore:i.postEditorStore.currentPost.page_analysis.analysis.readability.errors,class:"card-readability-seo"},{default:S(()=>[m(W,{analysisItems:i.postEditorStore.currentPost.page_analysis.analysis.readability},null,8,["analysisItems"])]),_:1},8,["header-text","trueSeoScore"])):O("",!0)])}const C9=Z(xO,[["render",EO]]),PO={class:"post-title"},LO={key:1},RO={key:1},BO={key:0,class:"btn-view"},HO=["href"],r4="keyword-rank-tracker-keywords-table",_f={__name:"KeywordsTable",props:{paginatedKeywords:Object,itemsPerPage:Number},setup(n){const e="all-in-one-seo-pack",t=oh(),i=je(),s={position:C("Position",e),openInKrt:C("Open in Keyword Rank Tracker",e)},r=[{label:St.delete,value:"delete"},{label:s.addToGroup,value:"assignGroup"}],o=n,l=Ze(null),a=Ze([]),{orderBy:c,orderDir:h,pageNumber:d,processAdditionalFilters:u,processChangeItemsPerPage:f,processFilterTable:p,processPagination:g,processSearch:b,processSort:y,searchTerm:w,wpTableKey:M,wpTableLoading:k}=RA({fetchData:t.fetchKeywords,tableId:r4,tableRef:l.value,resultsPerPage:o.itemsPerPage}),V=xe(()=>[{slug:"name",label:C("Keyword",e),sortable:1<o.paginatedKeywords.rows.length,sortDir:c.value==="name"?h.value:"asc",sorted:c.value==="name"},{slug:"position",label:C("Position",e),sortable:1<o.paginatedKeywords.rows.length,sortDir:c.value==="position"?h.value:"asc",sorted:c.value==="position",width:"100px"},{slug:"history",label:C("Position History",e),width:"150px"},{slug:"tracking",label:C("Tracking",e),width:"100px"},{slug:"view",label:"",width:"40px"}]),R=(z,q)=>{var he;let ee=((he=z.statistics)==null?void 0:he[q])??"";switch(q){case"position":ee=ee!==""?Math.round(ee).toFixed(0):ee;break}return ee},H=z=>{var q;return(q=z.statistics)!=null&&q.history?[{name:s.position,data:z.statistics.history.map(ee=>({x:ee.date,y:ee.position,label:ee.position}))}]:[]},W=z=>i.aioseo.urls.aio.searchStatistics+`&search=${encodeURIComponent(z.name)}&aioseo-scroll=keyword-rank-tracker-keywords-table#/keyword-rank-tracker`,G=async(z,q)=>{a.value[q]=!0;try{z.id?await t.deleteKeywords([z.id]):await t.insertKeywords({keywords:[z.name]}).then(()=>{z.tracking=!0}).catch(()=>{z.tracking=!1}),await t.fetchKeywords({rows:o.paginatedKeywords.rows}).then(()=>{t.maybeFetchStatistics({context:"keywords"})})}catch(ee){console.error(ee)}finally{a.value=[]}};return(z,q)=>{const ee=x("base-toggle");return v(),E(_(BA),{ref_key:"table",ref:l,id:r4,"additional-filters":[],"bulk-options":r,columns:V.value,filters:[],"initial-items-per-page":100,"initial-page-number":_(d),"initial-search-term":_(w),key:_(M),loading:_(k),rows:n.paginatedKeywords.rows,"selected-filters":{},"show-bulk-actions":!1,"show-header":!1,"show-table-footer":!1,totals:{},"show-items-per-page":!1,"show-pagination":!1,onFilterTable:_(p),onPaginate:_(g),onProcessAdditionalFilters:_(u),onProcessBulkAction:he=>({}),onProcessChangeItemsPerPage:_(f),onSearch:_(b),onSortColumn:_(y)},{name:S(({row:he})=>[A("div",PO,[A("b",null,D(he.name),1)])]),position:S(({row:he})=>[he.statistics===null?(v(),E(_(ca),{key:0,dark:""})):(v(),L("div",LO,D(R(he,"position")),1))]),history:S(({row:he})=>[he.statistics===null?(v(),E(_(ca),{key:0,dark:""})):(v(),L("div",RO,[H(he).length?(v(),E(_(Ac),{key:0,series:H(he),height:25,preset:"overview","chart-overrides":{tooltip:{y:{formatter:pe=>parseFloat(pe).toFixed(2)}}}},null,8,["series","chart-overrides"])):O("",!0)]))]),tracking:S(({row:he,index:pe})=>[a.value[pe]?(v(),E(_(ca),{key:0,dark:""})):O("",!0),m(ee,{modelValue:he.tracking,"onUpdate:modelValue":[Ee=>he.tracking=Ee,Ee=>G(he,pe,Ee)],disabled:!!a.value[pe]},null,8,["modelValue","onUpdate:modelValue","disabled"])]),view:S(({row:he})=>[he.id?(v(),L("div",BO,[A("a",{href:W(he),target:"_blank"},[m(_(qe),{type:"action",offset:"-80px,0"},{tooltip:S(()=>[B(D(s.openInKrt),1)]),default:S(()=>[m(_(pl))]),_:1})],8,HO)])):O("",!0)]),_:1},8,["columns","initial-page-number","initial-search-term","loading","rows","onFilterTable","onPaginate","onProcessAdditionalFilters","onProcessChangeItemsPerPage","onSearch","onSortColumn"])}}},NO={class:"keyword-rank-tracker-container"},FO=["innerHTML"],IO={class:"keyword-rank-tracker-container__card"},WO={class:"keyword-rank-tracker-container__card__header"},zO={class:"keyword-rank-tracker-container__card__body"},o4="320px",l4=100,UO={__name:"KeywordRankTracker",setup(n){q7(c=>({"39725e84":o4}));const e="aioseo-pro",t=oh(),i=Te(),s=xe(()=>t.isFetchingStatistics),r=xe(()=>{var f,p;const c=((f=i.currentPost)==null?void 0:f.keyphrases.focus.keyphrase.toLowerCase())||"",h=((p=i.currentPost)==null?void 0:p.keyphrases.additional.map(g=>g.keyphrase.toLowerCase()))||[],d=Array.from(new Set([c,...h])).filter(g=>!!g);return{rows:[...t.keywords.paginated.rows.filter(g=>{const b=d.findIndex(y=>y===g.name);return b!==-1?(d.splice(b,1),!0):!1}),...d.map(g=>({name:g,tracking:!1}))]}}),o=xe(()=>{var d;const c={};for(const u of r.value.rows)(d=u==null?void 0:u.statistics)!=null&&d.history&&(c[u.name]=u);const h=[];for(const u in c)h.push({name:u,data:c[u].statistics.history.map(f=>({x:f.date,y:f.position,label:f.position}))});return h}),l=be.getDocLink(C("Learn More",e),"keywordRankTracker",!0),a={withAioseo:C("Below you can track how your page is performing in search results based on your keyword(s).",e),keywordPositions:C("Keyword Positions",e)};return rh(()=>{try{t.maybeUpdateKeywords({limit:l4})}catch(c){console.error(c)}}),(c,h)=>(v(),L("div",NO,[A("div",null,[A("span",null,D(a.withAioseo),1),B(),A("span",{innerHTML:_(l)},null,8,FO)]),A("div",IO,[A("div",WO,D(a.keywordPositions),1),A("div",zO,[m(_(Ac),{height:parseInt(o4),series:o.value,loading:s.value,"legend-style":"simple","chart-overrides":{tooltip:{y:{formatter:d=>parseFloat(d).toFixed(2)}}}},null,8,["height","series","loading","chart-overrides"])])]),_(t).errors.crud?(v(),E(_(wt),{key:0,type:"red"},{default:S(()=>[B(D(_(t).errors.crud),1)]),_:1})):O("",!0),m(_(_f),{"paginated-keywords":r.value,"items-per-page":l4},null,8,["paginated-keywords"])]))}},$O=Z(UO,[["__scopeId","data-v-7b530c98"]]),KO={key:0,class:"keyword-rank-tracker-container"},GO=["innerHTML"],qO={class:"keyword-rank-tracker-container__card"},ZO={class:"keyword-rank-tracker-container__card__header"},jO={class:"keyword-rank-tracker-container__card__body"},YO=["innerHTML"],JO={class:"keyword-rank-tracker-container__card"},XO={class:"keyword-rank-tracker-container__card__header"},QO={class:"keyword-rank-tracker-container__card__body"},Qd="320px",eV={__name:"KeywordRankTracker",setup(n){q7(d=>({"580b842a":Qd}));const e="all-in-one-seo-pack",t=oh(),i=pi(),s=je(),r=X7(),o=be.getDocLink(C("Learn More",e),"keywordRankTracker",!0),l={...HA().strings,withAioseo:C("Below you can track how your page is performing in search results based on your keyword(s).",e),keywordPositions:C("Keyword Positions",e)},a=xe(()=>!i.isUnlicensed&&rr.hasCoreFeature("search-statistics")&&(!r.isConnected||r.unverifiedSite)),c=xe(()=>({rows:t.keywords.all.rows.slice(0,3).map(d=>({...d,tracking:!0}))})),h=xe(()=>{var f;const d={};for(const p of c.value.rows)(f=p==null?void 0:p.statistics)!=null&&f.history&&(d[p.name]=p);const u=[];for(const p in d)u.push({name:p,data:d[p].statistics.history.map(g=>({x:g.date,y:g.position}))});return u});return(d,u)=>(v(),L("div",null,[_(r).shouldShowSampleReports?(v(),L("div",KO,[A("div",null,[A("span",null,D(l.withAioseo),1),B(),A("span",{innerHTML:_(o)},null,8,GO)]),A("div",qO,[A("div",ZO,D(l.keywordPositions),1),A("div",jO,[m(_(Ac),{height:parseInt(Qd),series:h.value,loading:!1,"legend-style":"simple","chart-overrides":{tooltip:{y:{formatter:f=>parseFloat(f).toFixed(2)}}}},null,8,["height","series","chart-overrides"])])]),m(_(_f),{"paginated-keywords":c.value},null,8,["paginated-keywords"])])):(v(),L(xt,{key:1},[m(_(eo),{class:"keyword-rank-tracker-container"},{default:S(()=>[A("div",null,[A("span",null,D(l.withAioseo),1),B(),A("span",{innerHTML:_(o)},null,8,YO)]),A("div",JO,[A("div",XO,D(l.keywordPositions),1),A("div",QO,[m(_(Ac),{height:parseInt(Qd),series:h.value,loading:!1,"legend-style":"simple","chart-overrides":{tooltip:{y:{formatter:f=>parseFloat(f).toFixed(2)}}}},null,8,["height","series","chart-overrides"])])]),m(_(_f),{"paginated-keywords":c.value},null,8,["paginated-keywords"])]),_:1}),a.value?(v(),E(_(NA),{key:0})):(v(),E(_(vd),{key:1,"cta-second-button-action":"",onCtaSecondButtonClick:_(r).showSampleReports,"cta-link":_(be).getPricingUrl("search-statistics","search-statistics-upsell","keyword-rank-tracker"),"button-text":l.ctaButtonText,"second-button-text":l.ctaSecondButtonText,"cta-second-button-new-badge":"","cta-second-button-visible":"","learn-more-link":_(be).getUpsellUrl("search-statistics","keyword-rank-tracker",_(s).isPro?"pricing":"liteUpgrade"),"feature-list":[l.feature1,l.feature2,l.feature3,l.feature4],"align-top":"","hide-bonus":!_(i).isUnlicensed},{"header-text":S(()=>[B(D(l.ctaHeader),1)]),description:S(()=>[m(_(h9),{"core-feature":["search-statistics"]}),B(" "+D(l.ctaDescription),1)]),_:1},8,["onCtaSecondButtonClick","cta-link","button-text","second-button-text","learn-more-link","feature-list","hide-bonus"]))],64))]))}},tV=Z(eV,[["__scopeId","data-v-6bf4070c"]]),iV={__name:"KeywordRankTracker",props:{modalOpen:Boolean},emits:["update:modalOpen"],setup(n,{emit:e}){const t="all-in-one-seo-pack",i=pi(),s=X7(),r=e,o={headerTitle:C("Keyword Performance Tracking",t)},l=xe(()=>s.isConnected&&!s.unverifiedSite);return(a,c)=>(v(),E(_(Qt),{show:n.modalOpen,onClose:c[0]||(c[0]=h=>r("update:modalOpen",!1)),classes:["keyword-rank-tracker-main"]},{headerTitle:S(()=>[B(D(o.headerTitle),1)]),body:S(()=>[A("div",{class:Re(["keyword-rank-tracker-main__body",{"keyword-rank-tracker-main__body--disable-click":_(s).shouldShowSampleReports}])},[!_(i).isUnlicensed&&_(rr).hasCoreFeature("search-statistics","keyword-rank-tracker")&&l.value?(v(),E(_($O),{key:0})):(v(),E(_(tV),{key:1}))],2)]),_:1},8,["show"]))}},sV={},nV={viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-right-arrow-short"},rV=A("path",{d:"M8 0L6.59 1.41L12.17 7H0V9H12.17L6.59 14.59L8 16L16 8L8 0Z",fill:"currentColor"},null,-1),oV=[rV];function lV(n,e){return v(),L("svg",nV,oV)}const Sm=Z(sV,[["render",lV]]),eu="all-in-one-seo-pack",aV={setup(){return{postEditorStore:Te()}},components:{CoreSettingsRow:Ce,SvgRightArrowShort:Sm},data(){return{strings:{title:C("Link Assistant",eu),description:C("Here you can view an overview of your existing links as well as find suggestions for new internal links. Click on the button below to view the Link Assistant panel.",eu),button:C("Open Link Assistant",eu)}}}},hV={class:"aioseo-link-assistant-sidebar"},cV={class:"aioseo-sidebar-content-title"};function dV(n,e,t,i,s,r){const o=x("svg-right-arrow-short"),l=x("base-button"),a=x("core-settings-row");return v(),L("div",hV,[n.$root.$data.screenContext==="sidebar"?(v(),E(a,{key:0,class:"snippet-description-row open-link-assistant-copy"},{content:S(()=>[A("div",cV,D(s.strings.title),1),A("p",null,D(s.strings.description),1),m(l,{class:"open-link-assistant-modal gray small",onClick:e[0]||(e[0]=c=>i.postEditorStore.currentPost.linkAssistant.modalOpen=!0)},{default:S(()=>[m(o),B(" "+D(s.strings.button),1)]),_:1})]),_:1})):O("",!0)])}const wm=Z(aV,[["render",dV]]),uV={key:0,class:"aioseo-tab-content aioseo-link-assistant"},fV={key:0},pV={__name:"Links",props:{parentComponentContext:String},setup(n){const e="aioseo-pro",t=Te(),i=os();window.aioseoBus.$on("updatingLinks",u=>{t.currentPost.linkAssistant.updatingLinks=u});const s=Ze(0),r=Ze("inbound-internal"),o=Ze("suggestions-inbound"),l=xe(()=>i.metaBoxTabs.linkAssistant||"inbound-internal"),a=xe(()=>[{slug:"inbound-internal",icon:mm,name:j("%1$s %2$s",t.currentPost.linkAssistant.links.inboundInternal.totals.total,C("Inbound Internal",e))},{slug:"outbound-internal",icon:Cm,name:j("%1$s %2$s",t.currentPost.linkAssistant.links.outboundInternal.totals.total,C("Outbound Internal",e))},{slug:"affiliate",icon:ym,name:j("%1$s %2$s",t.currentPost.linkAssistant.links.affiliate.totals.total,C("Affiliate",e))},{slug:"external",icon:bm,name:j("%1$s %2$s",t.currentPost.linkAssistant.links.external.totals.total,C("External",e))},{slug:"link-suggestions",icon:kd,name:j("%1$s %2$s",d(t.currentPost.linkAssistant).length+t.currentPost.linkAssistant.links.suggestionsInbound.totals.total,C("Link Suggestions",e))}]),c=xe(()=>j(C('Links & Suggestions for "%1$s"',e),window.wp.data.select("core/editor").getEditedPostAttribute("title"))),h=(u,f)=>{r.value=u,i.changeTabSettings({setting:"linkAssistant",value:u}),f&&(o.value=f)},{filteredSuggestionsOutbound:d}=FA();return am(()=>{r.value=i.metaBoxTabs.linkAssistant||"inbound-internal"}),(u,f)=>(v(),L("div",null,[_(Ho).isActive("aioseo-link-assistant")?(v(),L("div",uV,[u.$root.$data.screenContext==="metabox"?(v(),L("div",fV,[(v(),E(_(Qi),{class:"link-tabs",internal:"",key:s.value,tabs:a.value,active:l.value,showSaveButton:!1,onChanged:f[0]||(f[0]=p=>h(p))},{"var-tab-icon":S(({tab:p})=>[(v(),E(bt(p.icon),{class:Re([{warning:p.warning}])},null,8,["class"]))]),_:1},8,["tabs","active"])),(v(),E(bh,null,[r.value==="inbound-internal"?(v(),E(_(Dc),{key:0,post:_(t).currentPost.linkAssistant,metabox:"",onOpenSuggestions:f[1]||(f[1]=p=>h("link-suggestions","suggestions-inbound")),onLinksUpdated:f[2]||(f[2]=p=>s.value++)},null,8,["post"])):O("",!0)],1024)),(v(),E(bh,null,[r.value==="outbound-internal"?(v(),E(_(Q2),{key:0,post:_(t).currentPost.linkAssistant,metabox:"",onOpenSuggestions:f[3]||(f[3]=p=>h("link-suggestions","suggestions-outbound")),onLinksUpdated:f[4]||(f[4]=p=>s.value++)},null,8,["post"])):O("",!0)],1024)),(v(),E(bh,null,[r.value==="affiliate"?(v(),E(_(e4),{key:0,post:_(t).currentPost.linkAssistant,onLinksUpdated:f[5]||(f[5]=p=>s.value++),metabox:""},null,8,["post"])):O("",!0)],1024)),(v(),E(bh,null,[r.value==="external"?(v(),E(_(t4),{key:0,post:_(t).currentPost.linkAssistant,onLinksUpdated:f[6]||(f[6]=p=>s.value++),metabox:""},null,8,["post"])):O("",!0)],1024)),r.value==="link-suggestions"?(v(),E(_(i4),{key:0,post:_(t).currentPost.linkAssistant,filteredSuggestionsOutbound:_(d)(_(t).currentPost.linkAssistant),initialTab:o.value,onSuggestionsTabChanged:f[7]||(f[7]=p=>o.value=p),onLinksUpdated:f[8]||(f[8]=p=>s.value++),metabox:""},null,8,["post","filteredSuggestionsOutbound","initialTab"])):O("",!0)])):O("",!0),m(_(Qt),{show:_(t).currentPost.linkAssistant.modalOpen&&u.$root.$data.screenContext==="sidebar",classes:["aioseo-link-assistant-modal"],onClose:f[18]||(f[18]=p=>_(t).currentPost.linkAssistant.modalOpen=!1)},{headerTitle:S(()=>[B(D(c.value),1)]),body:S(()=>[(v(),E(_(Qi),{class:"link-tabs",internal:"",key:s.value,tabs:a.value,active:l.value,showSaveButton:!1,onChanged:f[9]||(f[9]=p=>h(p))},{"var-tab-icon":S(({tab:p})=>[(v(),E(bt(p.icon),{class:Re([{warning:p.warning}])},null,8,["class"]))]),_:1},8,["tabs","active"])),r.value==="inbound-internal"?(v(),E(_(Dc),{key:0,post:_(t).currentPost.linkAssistant,metabox:"",onOpenSuggestions:f[10]||(f[10]=p=>h("link-suggestions","suggestions-inbound")),onLinksUpdated:f[11]||(f[11]=p=>s.value++)},null,8,["post"])):O("",!0),r.value==="outbound-internal"?(v(),E(_(Q2),{key:1,post:_(t).currentPost.linkAssistant,metabox:"",onOpenSuggestions:f[12]||(f[12]=p=>h("link-suggestions","suggestions-outbound")),onLinksUpdated:f[13]||(f[13]=p=>s.value++)},null,8,["post"])):O("",!0),r.value==="affiliate"?(v(),E(_(e4),{key:2,post:_(t).currentPost.linkAssistant,onLinksUpdated:f[14]||(f[14]=p=>s.value++),metabox:""},null,8,["post"])):O("",!0),r.value==="external"?(v(),E(_(t4),{key:3,post:_(t).currentPost.linkAssistant,onLinksUpdated:f[15]||(f[15]=p=>s.value++),metabox:""},null,8,["post"])):O("",!0),r.value==="link-suggestions"?(v(),E(_(i4),{key:4,post:_(t).currentPost.linkAssistant,filteredSuggestionsOutbound:_(d)(_(t).currentPost.linkAssistant),initialTab:o.value,onSuggestionsTabChanged:f[16]||(f[16]=p=>o.value=p),onLinksUpdated:f[17]||(f[17]=p=>s.value++),metabox:""},null,8,["post","filteredSuggestionsOutbound","initialTab"])):O("",!0)]),_:1},8,["show"]),n.parentComponentContext!=="modal"?(v(),E(_(wm),{key:1})):O("",!0)])):O("",!0)]))}},ii="aioseo-pro",gV={setup(){return{addonsStore:TM(),linkAssistantStore:_M(),pluginsStore:OM(),postEditorStore:Te(),rootStore:je(),links:be}},components:{CoreAlert:wt,CoreBlur:eo,CoreMainTabs:Qi,CoreModal:Qt,Cta:vd,LinkAssistantInboundInternal:Dc,LinksSideBar:wm,SvgLinkAffiliate:ym,SvgLinkExternal:bm,SvgLinkInternalInbound:mm,SvgLinkInternalOutbound:Cm,SvgLinkSuggestion:kd},props:{parentComponentContext:String},data(){return{addons:Ho,activeTab:"inbound-internal",activeSuggestionTab:"suggestions-inbound",mockedPostData:{links:{inboundInternal:{rows:[{phrase:"Are you looking for an easy way to do an SEO analysis for your website?",anchor:"SEO analysis",url:"#",context:{postTitle:"How to Perform an SEO Analysis on Your WordPress Website",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"AIOSEO also allows you to create video sitemaps and comes with tons of different SEO tools.",anchor:"video sitemaps",url:"#",context:{postTitle:"How to Create WordPress Image Sitemap",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"You may also want to check out how to name your image files for SEO in WordPress and write alt text for images.",anchor:"how to name your image files for SEO in WordPress",url:"#",context:{postTitle:"What’s the Best Image Format for Your Website?",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"Are you looking for an easy way to do an SEO analysis for your website?",anchor:"SEO analysis",url:"#",context:{postTitle:"How to Perform an SEO Analysis on Your WordPress Website",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"To learn more, please check out our post on image SEO: how to best optimize your images in WordPress. ",anchor:"image SEO",url:"#",context:{postTitle:"How to Write Alt Text for Images for SEO",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"So let’s now move on to showing you exactly how easy it is to import and export redirects using the best redirect plugin for WordPress.",anchor:"best redirect plugin for WordPress",url:"#",context:{postTitle:"How to Easily Import and Export Redirects in WordPress",permalink:"#",editLink:"#",postType:{singular:"Post"}}}],totals:{total:6}},outboundInternal:{totals:{total:12}},affiliate:{totals:{total:8}},external:{totals:{total:24}},suggestionsInbound:{totals:{total:9}},suggestionsOutbound:{totals:{total:9}}}},strings:{ctaButtonText:C("Activate Link Assistant",ii),ctaHeader:C("Enable Link Assistant on Your Site",ii),ctaDescription:C("Get relevant suggestions for adding internal links to all your content as well as finding any orphaned posts that have no internal links.",ii),linkOpportunities:C("Actionable Link Suggestions",ii),orphanedPosts:C("See Orphaned Posts",ii),affiliateLinks:C("See Affiliate Links",ii),domainReports:C("Top Domain Reports",ii),activateError:C("An error occurred while activating the addon. Please upload it manually or contact support for more information.",ii),permissionWarning:C("You currently don't have permission to activate this addon. Please ask a site administrator to activate first.",ii)},failed:!1,activationLoading:!1}},computed:{initialTab(){return"inbound-internal"},tabs(){return[{slug:"inbound-internal",icon:"svg-link-internal-inbound",name:j("%1$s %2$s",this.mockedPostData.links.inboundInternal.totals.total,C("Inbound Internal",ii))},{slug:"outbound-internal",icon:"svg-link-internal-outbound",name:j("%1$s %2$s",this.mockedPostData.links.outboundInternal.totals.total,C("Outbound Internal",ii))},{slug:"affiliate",icon:"svg-link-affiliate",name:j("%1$s %2$s",this.mockedPostData.links.affiliate.totals.total,C("Affiliate",ii))},{slug:"external",icon:"svg-link-external",name:j("%1$s %2$s",this.mockedPostData.links.external.totals.total,C("External",ii))},{slug:"link-suggestions",icon:"svg-link-suggestion",name:j("%1$s %2$s",this.mockedPostData.links.suggestionsOutbound.totals.total+this.mockedPostData.links.suggestionsInbound.totals.total,C("Link Suggestions",ii))}]},modalHeader(){return j(C('Links & Suggestions for "%1$s"',ii),window.wp.data.select("core/editor").getEditedPostAttribute("title"))}},methods:{activateAddon(){this.failed=!1,this.activationLoading=!0;const n=Ho.getAddon("aioseo-link-assistant");this.pluginsStore.installPlugins([{plugin:n.basename}]).then(e=>{if(e.body.failed.length){this.activationLoading=!1,this.failed=!0;return}const t=[this.linkAssistantStore.getPostData()];Promise.all(t).then(()=>{this.activationLoading=!1,n.hasMinimumVersion=!0,n.isActive=!0,this.addonsStore.updateAddon(n)})}).catch(()=>{this.activationLoading=!1})}}},mV={class:"aioseo-tab-content aioseo-link-assistant"},CV={key:0};function yV(n,e,t,i,s,r){const o=x("core-main-tabs"),l=x("link-assistant-inbound-internal"),a=x("core-blur"),c=x("core-alert"),h=x("cta"),d=x("core-modal"),u=x("links-side-bar");return v(),L("div",mV,[n.$root.$data.screenContext==="metabox"?(v(),L("div",CV,[m(a,null,{default:S(()=>[m(o,{class:"link-tabs",internal:"",tabs:r.tabs,active:r.initialTab,showSaveButton:!1},{"var-tab-icon":S(({tab:f})=>[(v(),E(bt(f.icon),{class:Re([{warning:f.warning}])},null,8,["class"]))]),_:1},8,["tabs","active"]),s.activeTab==="inbound-internal"?(v(),E(l,{key:0,post:s.mockedPostData,metabox:""},null,8,["post"])):O("",!0)]),_:1}),m(h,{"cta-button-visible":s.addons.userCanInstallOrActivate("aioseo-link-assistant"),"cta-button-visible-warning":s.strings.permissionWarning,"cta-link":i.rootStore.aioseo.urls.aio.featureManager+"&aioseo-activate=aioseo-link-assistant","cta-button-action":"","cta-button-loading":s.activationLoading,onCtaButtonClick:r.activateAddon,"same-tab":"","button-text":s.strings.ctaButtonText,"learn-more-link":i.links.getDocUrl("link-assistant"),"feature-list":[s.strings.linkOpportunities,s.strings.domainReports,s.strings.orphanedPosts,s.strings.affiliateLinks],hideBonus:""},{"header-text":S(()=>[B(D(s.strings.ctaHeader),1)]),description:S(()=>[s.failed?(v(),E(c,{key:0,type:"red"},{default:S(()=>[B(D(s.strings.activateError),1)]),_:1})):O("",!0),B(" "+D(s.strings.ctaDescription),1)]),"learn-more-text":S(()=>[B(D(s.strings.learnMoreText),1)]),_:1},8,["cta-button-visible","cta-button-visible-warning","cta-link","cta-button-loading","onCtaButtonClick","button-text","learn-more-link","feature-list"])])):O("",!0),m(d,{show:i.postEditorStore.currentPost.linkAssistant.modalOpen&&n.$root.$data.screenContext==="sidebar",classes:["aioseo-link-assistant-modal"],onClose:e[0]||(e[0]=f=>i.postEditorStore.currentPost.linkAssistant.modalOpen=!1)},{headerTitle:S(()=>[B(D(r.modalHeader),1)]),body:S(()=>[m(a,null,{default:S(()=>[m(o,{class:"link-tabs",internal:"",tabs:r.tabs,active:r.initialTab,showSaveButton:!1},{"var-tab-icon":S(({tab:f})=>[(v(),E(bt(f.icon),{class:Re([{warning:f.warning}])},null,8,["class"]))]),_:1},8,["tabs","active"]),s.activeTab==="inbound-internal"?(v(),E(l,{key:0,post:s.mockedPostData,metabox:""},null,8,["post"])):O("",!0)]),_:1}),m(h,{"cta-button-visible":s.addons.userCanInstallOrActivate("aioseo-link-assistant"),"cta-button-visible-warning":s.strings.permissionWarning,"cta-link":i.rootStore.aioseo.urls.aio.featureManager+"&aioseo-activate=aioseo-link-assistant","cta-button-action":"","cta-button-loading":s.activationLoading,onCtaButtonClick:r.activateAddon,"same-tab":"","button-text":s.strings.ctaButtonText,"learn-more-link":i.links.getDocUrl("link-assistant"),"feature-list":[s.strings.linkOpportunities,s.strings.domainReports,s.strings.orphanedPosts,s.strings.affiliateLinks],hideBonus:""},{"header-text":S(()=>[B(D(s.strings.ctaHeader),1)]),description:S(()=>[s.failed?(v(),E(c,{key:0,type:"red"},{default:S(()=>[B(D(s.strings.activateError),1)]),_:1})):O("",!0),B(" "+D(s.strings.ctaDescription),1)]),"learn-more-text":S(()=>[B(D(s.strings.learnMoreText),1)]),_:1},8,["cta-button-visible","cta-button-visible-warning","cta-link","cta-button-loading","onCtaButtonClick","button-text","learn-more-link","feature-list"])]),_:1},8,["show"]),t.parentComponentContext!=="modal"?(v(),E(u,{key:1})):O("",!0)])}const bV=Z(gV,[["render",yV]]),Ci="all-in-one-seo-pack",SV={setup(){return{licenseStore:pi(),postEditorStore:Te(),rootStore:je(),links:be}},components:{CoreAlert:wt,CoreBlur:eo,CoreMainTabs:Qi,CoreModal:Qt,Cta:vd,LinkAssistantInboundInternal:Dc,LinksSideBar:wm,SvgLinkAffiliate:ym,SvgLinkExternal:bm,SvgLinkInternalInbound:mm,SvgLinkInternalOutbound:Cm,SvgLinkSuggestion:kd,RequiredPlans:h9},props:{parentComponentContext:String},data(){return{activeTab:"inbound-internal",activeSuggestionTab:"suggestions-inbound",mockedPostData:{links:{inboundInternal:{rows:[{phrase:"Are you looking for an easy way to do an SEO analysis for your website?",anchor:"SEO analysis",url:"#",context:{postTitle:"How to Perform an SEO Analysis on Your WordPress Website",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"AIOSEO also allows you to create video sitemaps and comes with tons of different SEO tools.",anchor:"video sitemaps",url:"#",context:{postTitle:"How to Create WordPress Image Sitemap",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"You may also want to check out how to name your image files for SEO in WordPress and write alt text for images.",anchor:"how to name your image files for SEO in WordPress",url:"#",context:{postTitle:"What’s the Best Image Format for Your Website?",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"Are you looking for an easy way to do an SEO analysis for your website?",anchor:"SEO analysis",url:"#",context:{postTitle:"How to Perform an SEO Analysis on Your WordPress Website",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"To learn more, please check out our post on image SEO: how to best optimize your images in WordPress. ",anchor:"image SEO",url:"#",context:{postTitle:"How to Write Alt Text for Images for SEO",permalink:"#",editLink:"#",postType:{singular:"Post"}}},{phrase:"So let’s now move on to showing you exactly how easy it is to import and export redirects using the best redirect plugin for WordPress.",anchor:"best redirect plugin for WordPress",url:"#",context:{postTitle:"How to Easily Import and Export Redirects in WordPress",permalink:"#",editLink:"#",postType:{singular:"Post"}}}],totals:{total:6}},outboundInternal:{totals:{total:12}},affiliate:{totals:{total:8}},external:{totals:{total:24}},suggestionsInbound:{totals:{total:9}},suggestionsOutbound:{totals:{total:9}}}},strings:{ctaButtonText:C("Unlock Link Assistant",Ci),ctaHeader:j(C("Link Assistant is a %1$s Feature",Ci),"PRO"),linkAssistantDescription:C("Get relevant suggestions for adding internal links to all your content as well as finding any orphaned posts that have no internal links.",Ci),thisFeatureRequires:C("This feature requires one of the following plans:",Ci),linkOpportunities:C("Actionable Link Suggestions",Ci),orphanedPosts:C("See Orphaned Posts",Ci),affiliateLinks:C("See Affiliate Links",Ci),domainReports:C("Top Domain Reports",Ci)}}},computed:{initialTab(){return"inbound-internal"},tabs(){return[{slug:"inbound-internal",icon:"svg-link-internal-inbound",name:j("%1$s %2$s",this.mockedPostData.links.inboundInternal.totals.total,C("Inbound Internal",Ci))},{slug:"outbound-internal",icon:"svg-link-internal-outbound",name:j("%1$s %2$s",this.mockedPostData.links.outboundInternal.totals.total,C("Outbound Internal",Ci))},{slug:"affiliate",icon:"svg-link-affiliate",name:j("%1$s %2$s",this.mockedPostData.links.affiliate.totals.total,C("Affiliate",Ci))},{slug:"external",icon:"svg-link-external",name:j("%1$s %2$s",this.mockedPostData.links.external.totals.total,C("External",Ci))},{slug:"link-suggestions",icon:"svg-link-suggestion",name:j("%1$s %2$s",this.mockedPostData.links.suggestionsOutbound.totals.total+this.mockedPostData.links.suggestionsInbound.totals.total,C("Link Suggestions",Ci))}]},modalHeader(){return j(C('Links & Suggestions for "%1$s"',Ci),window.wp.data.select("core/editor").getEditedPostAttribute("title"))}}},wV={class:"aioseo-tab-content aioseo-link-assistant"},vV={key:0};function kV(n,e,t,i,s,r){const o=x("core-main-tabs"),l=x("link-assistant-inbound-internal"),a=x("core-blur"),c=x("required-plans"),h=x("cta"),d=x("core-modal"),u=x("links-side-bar");return v(),L("div",wV,[n.$root.$data.screenContext==="metabox"?(v(),L("div",vV,[m(a,null,{default:S(()=>[m(o,{class:"link-tabs",internal:"",tabs:r.tabs,active:r.initialTab,showSaveButton:!1},{"var-tab-icon":S(({tab:f})=>[(v(),E(bt(f.icon),{class:Re([{warning:f.warning}])},null,8,["class"]))]),_:1},8,["tabs","active"]),s.activeTab==="inbound-internal"?(v(),E(l,{key:0,post:s.mockedPostData,metabox:""},null,8,["post"])):O("",!0)]),_:1}),m(h,{"cta-link":i.links.getPricingUrl("link-assistant","link-assistant-upsell","metabox"),"button-text":s.strings.ctaButtonText,"learn-more-link":i.links.getUpsellUrl("link-assistant","metabox",i.rootStore.isPro?"pricing":"liteUpgrade"),"feature-list":[s.strings.linkOpportunities,s.strings.domainReports,s.strings.orphanedPosts,s.strings.affiliateLinks],"hide-bonus":!i.licenseStore.isUnlicensed},{"header-text":S(()=>[B(D(s.strings.ctaHeader),1)]),description:S(()=>[m(c,{addon:"aioseo-link-assistant"}),B(" "+D(s.strings.linkAssistantDescription),1)]),_:1},8,["cta-link","button-text","learn-more-link","feature-list","hide-bonus"])])):O("",!0),m(d,{show:i.postEditorStore.currentPost.linkAssistant.modalOpen&&n.$root.$data.screenContext==="sidebar",classes:["aioseo-link-assistant-modal"],onClose:e[0]||(e[0]=f=>i.postEditorStore.currentPost.linkAssistant.modalOpen=!1)},{headerTitle:S(()=>[B(D(r.modalHeader),1)]),body:S(()=>[m(a,null,{default:S(()=>[m(o,{class:"link-tabs",internal:"",tabs:r.tabs,active:r.initialTab,showSaveButton:!1},{"var-tab-icon":S(({tab:f})=>[(v(),E(bt(f.icon),{class:Re([{warning:f.warning}])},null,8,["class"]))]),_:1},8,["tabs","active"]),s.activeTab==="inbound-internal"?(v(),E(l,{key:0,post:s.mockedPostData,metabox:""},null,8,["post"])):O("",!0)]),_:1}),m(h,{"cta-link":i.links.getPricingUrl("link-assistant","link-assistant-upsell","metabox"),"button-text":s.strings.ctaButtonText,"learn-more-link":i.links.getUpsellUrl("link-assistant","metabox",i.rootStore.isPro?"pricing":"liteUpgrade"),"feature-list":[s.strings.linkOpportunities,s.strings.domainReports,s.strings.orphanedPosts,s.strings.affiliateLinks],"hide-bonus":!i.licenseStore.isUnlicensed},{"header-text":S(()=>[B(D(s.strings.ctaHeader),1)]),description:S(()=>[m(c,{addon:"aioseo-link-assistant"}),B(" "+D(s.strings.linkAssistantDescription),1)]),_:1},8,["cta-link","button-text","learn-more-link","feature-list","hide-bonus"])]),_:1},8,["show"]),t.parentComponentContext!=="modal"?(v(),E(u,{key:1})):O("",!0)])}const xV=Z(SV,[["render",kV]]),MV={setup(){return{addons:Ho,licenseStore:pi()}},components:{Links:pV,LinksActivate:bV,LinksLite:xV},props:{parentComponentContext:String}},AV={class:"aioseo-tab-content aioseo-link-assistant"};function DV(n,e,t,i,s,r){const o=x("Links",!0),l=x("LinksLite"),a=x("LinksActivate");return v(),L("div",AV,[!i.licenseStore.isUnlicensed&&i.addons.isActive("aioseo-link-assistant")&&!i.addons.requiresUpgrade("aioseo-link-assistant")?(v(),E(o,{key:0,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])):O("",!0),i.licenseStore.isUnlicensed||i.addons.requiresUpgrade("aioseo-link-assistant")?(v(),E(l,{key:1,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])):O("",!0),!i.licenseStore.isUnlicensed&&!i.addons.isActive("aioseo-link-assistant")&&i.addons.canActivate("aioseo-link-assistant")&&!i.addons.requiresUpgrade("aioseo-link-assistant")?(v(),E(a,{key:2,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])):O("",!0)])}const TV=Z(MV,[["render",DV]]),Vt="all-in-one-seo-pack",_V={setup(){const{getImageSourceOptionFiltered:n,getTermImageSourceOptions:e,imageSourceOptionsFiltered:t,imageUrl:i,loading:s,setImageUrl:r}=c9(),{maxRecommendedCount:o}=cm(),{objectTypeOptions:l}=d9(),{parseTags:a}=dm({separator:void 0});return{getImageSourceOptionFiltered:n,getTermImageSourceOptions:e,imageSourceOptionsFiltered:t,imageUrl:i,loading:s,maxRecommendedCount:o,objectTypeOptions:l,optionsStore:Lt(),parseTags:a,postEditorStore:Te(),rootStore:je(),setImageUrl:r}},components:{CoreAlert:wt,CoreFacebookPreview:zA,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce},props:{isMobilePreview:{type:Boolean,default(){return!1}}},data(){return{tags:u9,titleCount:0,descriptionCount:0,strings:{tabName:C("Facebook Preview",Vt),imageSource:C("Image Source",Vt),customFieldsName:C("Custom Field Name",Vt),video:C("Video URL",Vt),width:C("Width",Vt),height:C("Height",Vt),facebookObjectType:C("Object Type",Vt),facebookImage:C("Facebook Image",Vt),facebookTitle:C("Facebook Title",Vt),facebookDescription:C("Facebook Description",Vt),minimumSize:C("Minimum size: 200px x 200px, ideal ratio 1.91:1, 5MB max. (eg: 1640px x 856px or 3280px x 1712px for Retina screens). JPG, PNG, WEBP and GIF formats only.",Vt),clickToAddSiteName:C("Click on the tags below to insert variables into your site name.",Vt),clickToAddHomePageDescription:C("Click on the tags below to insert variables into your meta description.",Vt),articleSection:C("Article Section",Vt),articleTags:C("Article Tags",Vt),tagPlaceholder:C("Press enter to create an article tag",Vt),facebookDisabled:j(C("No %1$s markup will be output for your post because it is currently disabled. You can enable %1$s markup in the Social Networks settings. %2$s",Vt),C("Open Graph",Vt),j('<a href="%1$s" target="_blank">%2$s<span class="link-right-arrow"> →</span></a>',this.rootStore.aioseo.urls.aio.socialNetworks+"#facebook",C("Go to Social Networks",Vt)))}}},watch:{"postEditorStore.currentPost.og_image_type"(){this.handleImageUpdate()},"postEditorStore.currentPost.og_image_custom_url"(){this.handleImageUpdate()}},computed:{previewTitle(){return this.parseTags(this.postEditorStore.currentPost.og_title||this.postEditorStore.currentPost.title||this.postEditorStore.currentPost.tags.title||"#post_title #separator_sa #site_title")},previewDescription(){return this.parseTags(this.postEditorStore.currentPost.og_description||this.postEditorStore.currentPost.description||this.postEditorStore.currentPost.tags.description||"#post_content")},shouldShowArticleSection(){const n=this.postEditorStore.currentPost.context==="term"?"taxonomies":"postTypes";return this.postEditorStore.currentPost.og_object_type==="article"||this.postEditorStore.currentPost.og_object_type==="default"&&this.optionsStore.dynamicOptions.social.facebook.general[n][this.postEditorStore.currentPost.postType||this.postEditorStore.currentPost.termType].objectType==="article"}},methods:{scrollToElement(){const n=document.getElementsByClassName("component-wrapper")[0];setTimeout(()=>{n&&(n.firstChild.scrollTop=0)},10)},saveImageType(n){this.postEditorStore.currentPost.og_image_type=n,this.postEditorStore.isDirty=!0},getObjectTypeOptions(n){let e=null;return this.objectTypeOptions.forEach(t=>{const i=t.options.find(s=>s.value===n);i&&(e=i)}),e},setObjectType(n){this.postEditorStore.currentPost.og_object_type=n,this.postEditorStore.isDirty=!0},updateImage(n){this.postEditorStore.currentPost.og_image_custom_url=n,this.postEditorStore.savePostState()},handleImageUpdate(){this.setImageUrl("facebook")}},mounted(){this.scrollToElement(),this.setImageUrl("facebook"),window.aioseoBus.$on("updateFeaturedImage",this.handleImageUpdate)},beforeUnmount(){window.aioseoBus.$off("updateFeaturedImage",this.handleImageUpdate)}},OV={class:"tab-facebook"},VV={id:"aioseo-post-settings-facebook"},EV=["innerHTML"],PV=["innerHTML"];function LV(n,e,t,i,s,r){const o=x("core-alert"),l=x("core-facebook-preview"),a=x("core-settings-row"),c=x("core-html-tags-editor"),h=x("base-select"),d=x("base-input"),u=x("core-image-uploader");return v(),L("div",OV,[m(a,{class:"snippet-preview-row"},{name:S(()=>[A("span",null,D(s.strings.tabName),1)]),content:S(()=>[i.optionsStore.options.social.facebook.general.enable?O("",!0):(v(),E(o,{key:0,class:"facebook-disabled-warning",innerHTML:s.strings.facebookDisabled,type:"red"},null,8,["innerHTML"])),m(l,{description:r.previewDescription,image:i.imageUrl,loading:i.loading,title:r.previewTitle},null,8,["description","image","loading","title"])]),_:1}),A("div",VV,[m(a,{name:s.strings.facebookTitle,class:"facebook-title-settings",align:""},{content:S(()=>[m(c,{class:"facebook-meta-input",modelValue:i.postEditorStore.currentPost.og_title,"onUpdate:modelValue":[e[0]||(e[0]=f=>i.postEditorStore.currentPost.og_title=f),e[2]||(e[2]=f=>i.postEditorStore.isDirty=!0)],"line-numbers":!1,single:"",onCounter:e[1]||(e[1]=f=>s.titleCount=f.length),"tags-context":`${i.postEditorStore.currentPost.postType||i.postEditorStore.currentPost.termType}Title`,"default-tags":s.tags.getDefaultTags(i.postEditorStore.currentPost.context==="term"?"taxonomies":null,null,"title")},{"tags-description":S(()=>[B(D(s.strings.clickToAddSiteName),1)]),_:1},8,["modelValue","tags-context","default-tags"]),A("div",{class:"max-recommended-count",innerHTML:i.maxRecommendedCount(s.titleCount,95)},null,8,EV)]),_:1},8,["name"]),m(a,{name:s.strings.facebookDescription,class:"facebook-description-settings",align:""},{content:S(()=>[m(c,{class:"facebook-meta-input",modelValue:i.postEditorStore.currentPost.og_description,"onUpdate:modelValue":[e[3]||(e[3]=f=>i.postEditorStore.currentPost.og_description=f),e[5]||(e[5]=f=>i.postEditorStore.isDirty=!0)],"line-numbers":!1,description:"",onCounter:e[4]||(e[4]=f=>s.descriptionCount=f.length),"tags-context":`${i.postEditorStore.currentPost.postType||i.postEditorStore.currentPost.termType}Description`,"default-tags":s.tags.getDefaultTags(i.postEditorStore.currentPost.context==="term"?"taxonomies":null,null,"description")},{"tags-description":S(()=>[B(D(s.strings.clickToAddHomePageDescription),1)]),_:1},8,["modelValue","tags-context","default-tags"]),A("div",{class:"max-recommended-count",innerHTML:i.maxRecommendedCount(s.descriptionCount,200)},null,8,PV)]),_:1},8,["name"]),m(a,{class:"facebook-image-source",name:s.strings.imageSource,align:""},{content:S(()=>[m(h,{size:"medium",options:i.imageSourceOptionsFiltered,modelValue:i.getImageSourceOptionFiltered(i.postEditorStore.currentPost.og_image_type),"onUpdate:modelValue":e[6]||(e[6]=f=>r.saveImageType(f.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),i.postEditorStore.currentPost.og_image_type==="custom"?(v(),E(a,{key:0,name:s.strings.customFieldsName,align:""},{content:S(()=>[m(d,{type:"text",size:"medium",placeholder:s.strings.placeholder,modelValue:i.postEditorStore.currentPost.og_image_custom_fields,"onUpdate:modelValue":[e[7]||(e[7]=f=>i.postEditorStore.currentPost.og_image_custom_fields=f),e[8]||(e[8]=f=>i.postEditorStore.isDirty=!0)]},null,8,["placeholder","modelValue"])]),_:1},8,["name"])):O("",!0),i.postEditorStore.currentPost.og_image_type==="custom_image"?(v(),E(a,{key:1,class:"facebook-image",name:s.strings.facebookImage},{content:S(()=>[m(u,{description:s.strings.minimumSize,modelValue:i.postEditorStore.currentPost.og_image_custom_url,"onUpdate:modelValue":e[9]||(e[9]=f=>i.postEditorStore.currentPost.og_image_custom_url=f)},null,8,["description","modelValue"])]),_:1},8,["name"])):O("",!0),m(a,{class:"facebook-video",name:s.strings.video,align:""},{content:S(()=>[m(d,{type:"text",size:"medium",modelValue:i.postEditorStore.currentPost.og_video,"onUpdate:modelValue":e[10]||(e[10]=f=>i.postEditorStore.currentPost.og_video=f)},null,8,["modelValue"])]),_:1},8,["name"]),m(a,{class:"facebook-object-type",name:s.strings.facebookObjectType,align:""},{content:S(()=>[m(h,{size:"medium","open-direction":"top",options:i.objectTypeOptions,"group-label":"groupLabel","group-values":"options",modelValue:r.getObjectTypeOptions(i.postEditorStore.currentPost.og_object_type),"onUpdate:modelValue":e[11]||(e[11]=f=>r.setObjectType(f.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),r.shouldShowArticleSection?(v(),E(a,{key:2,name:s.strings.articleSection,align:""},{content:S(()=>[m(d,{type:"text",size:"medium",modelValue:i.postEditorStore.currentPost.og_article_section,"onUpdate:modelValue":e[12]||(e[12]=f=>i.postEditorStore.currentPost.og_article_section=f)},null,8,["modelValue"])]),_:1},8,["name"])):O("",!0),r.shouldShowArticleSection?(v(),E(a,{key:3,name:s.strings.articleTags,align:""},{content:S(()=>[m(h,{multiple:"",taggable:"",options:i.postEditorStore.currentPost.og_article_tags||[],modelValue:i.postEditorStore.currentPost.og_article_tags||[],"onUpdate:modelValue":e[13]||(e[13]=f=>i.postEditorStore.currentPost.og_article_tags=f),"tag-placeholder":s.strings.tagPlaceholder},null,8,["options","modelValue","tag-placeholder"])]),_:1},8,["name"])):O("",!0)])])}const RV=Z(_V,[["render",LV]]),yi="all-in-one-seo-pack",BV={setup(){const{getImageSourceOptionFiltered:n,imageSourceOptionsFiltered:e,imageUrl:t,loading:i,setImageUrl:s}=c9(),{maxRecommendedCount:r}=cm(),{twitterCardOptions:o}=d9(),{parseTags:l}=dm({separator:void 0});return{getImageSourceOptionFiltered:n,imageSourceOptionsFiltered:e,imageUrl:t,loading:i,maxRecommendedCount:r,optionsStore:Lt(),parseTags:l,postEditorStore:Te(),rootStore:je(),setImageUrl:s,twitterCardOptions:o}},components:{CoreAlert:wt,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,CoreTwitterPreview:UA},props:{isMobilePreview:{type:Boolean,default(){return!1}}},data(){return{tags:u9,titleCount:0,descriptionCount:0,facebookImageUrl:"",strings:{twitterPreview:C("X (Twitter) Preview",yi),twitterPreviewDescription:C("X cards by default will use the data defined below. If no data is set, X will instead pick up the data set on the Facebook tab.",yi),useFB:C("Use Data from Facebook Tab",yi),imageSource:C("Image Source",yi),customFieldsName:C("Custom Field Name",yi),twitterImage:C("X Image",yi),twitterTitle:C("X Title",yi),twitterDescription:C("X Description",yi),twitterCardType:C("X Card Type",yi),minimumSizeSummary:C("Minimum size: 144px x 144px, ideal ratio 1:1, 5MB max. JPG, PNG, WEBP and GIF formats only.",yi),minimumSizeSummaryWithLarge:C("Minimum size: 300px x 157px, ideal ratio 2:1, 5MB max. JPG, PNG, WEBP and GIF formats only.",yi),twitterDisabled:j(C("No %1$s markup will be output for your post because it is currently disabled. You can enable %1$s markup in the Social Networks settings. %2$s",yi),C("X (Twitter)",yi),j('<a href="%1$s" target="_blank">%2$s<span class="link-right-arrow"> →</span></a>',this.rootStore.aioseo.urls.aio.socialNetworks+"#twitter",C("Go to Social Networks",yi)))}}},watch:{"postEditorStore.currentPost.twitter_use_og"(){this.handleImageUpdate()},"postEditorStore.currentPost.twitter_image_type"(){this.handleImageUpdate()},"postEditorStore.currentPost.twitter_image_custom_url"(){this.handleImageUpdate()}},computed:{previewTitle(){const n=this.postEditorStore.currentPost.twitter_use_og||!this.postEditorStore.currentPost.twitter_title?this.postEditorStore.currentPost.og_title:this.postEditorStore.currentPost.twitter_title;return this.parseTags(n||this.postEditorStore.currentPost.title||this.postEditorStore.currentPost.tags.title||"#post_title #separator_sa #site_title")},previewDescription(){const n=this.postEditorStore.currentPost.twitter_use_og||!this.postEditorStore.currentPost.twitter_description?this.postEditorStore.currentPost.og_description:this.postEditorStore.currentPost.twitter_description;return this.parseTags(n||this.postEditorStore.currentPost.description||this.postEditorStore.currentPost.tags.description||"#post_content")},previewImage(){return this.postEditorStore.currentPost.twitter_use_og||!this.imageUrl?this.facebookImageUrl:this.imageUrl},twitterImageUploaderDescription(){return this.postEditorStore.currentPost.twitter_card==="summary"||this.postEditorStore.currentPost.twitter_card==="default"&&this.optionsStore.options.social.twitter.general.defaultCardType==="summary"?this.strings.minimumSizeSummary:this.postEditorStore.currentPost.twitter_card==="summary_large_image"||this.postEditorStore.currentPost.twitter_card==="default"&&this.optionsStore.options.social.twitter.general.defaultCardType==="summary_large_image"?this.strings.minimumSizeSummaryWithLarge:""}},methods:{getCardOptions(n){return this.twitterCardOptions.find(e=>e.value===n)},cardSelect(n){this.postEditorStore.currentPost.twitter_card=n,this.postEditorStore.isDirty=!0},scrollToElement(){const n=document.getElementsByClassName("component-wrapper")[0];setTimeout(()=>{n&&(n.firstChild.scrollTop=0)},10)},saveTwitterImageType(n){this.postEditorStore.currentPost.twitter_image_type=n,this.postEditorStore.isDirty=!0},updateImage(n){this.postEditorStore.currentPost.twitter_image_custom_url=n,this.postEditorStore.savePostState()},handleImageUpdate(){this.setImageUrl("twitter")},updateImagePreview(n){n.social==="facebook"&&(this.facebookImageUrl=n.image)}},mounted(){window.aioseoBus.$on("updateSocialImagePreview",this.updateImagePreview),window.aioseoBus.$on("updateFeaturedImage",this.handleImageUpdate),this.scrollToElement(),this.setImageUrl("facebook").then(()=>{this.setImageUrl("twitter")})},beforeUnmount(){window.aioseoBus.$off("updateFeaturedImage",this.handleImageUpdate),window.aioseoBus.$off("updateSocialImagePreview",this.updateImagePreview)}},HV={class:"tab-twitter"},NV={id:"aioseo-post-settings-twitter"},FV=["innerHTML"],IV=["innerHTML"];function WV(n,e,t,i,s,r){const o=x("core-alert"),l=x("core-twitter-preview"),a=x("core-settings-row"),c=x("base-toggle"),h=x("core-html-tags-editor"),d=x("base-select"),u=x("base-input"),f=x("core-image-uploader");return v(),L("div",HV,[m(a,{class:"snippet-preview-row"},{name:S(()=>[A("span",null,D(s.strings.twitterPreview),1)]),description:S(()=>[A("i",null,D(s.strings.twitterPreviewDescription),1)]),content:S(()=>[i.optionsStore.options.social.twitter.general.enable?O("",!0):(v(),E(o,{key:0,class:"twitter-disabled-warning",innerHTML:s.strings.twitterDisabled,type:"red"},null,8,["innerHTML"])),m(l,{card:i.postEditorStore.currentPost.twitter_card,description:r.previewDescription,image:r.previewImage,loading:i.loading,title:r.previewTitle},null,8,["card","description","image","loading","title"])]),_:1}),A("div",NV,[m(a,{name:s.strings.useFB,class:"use-facebook"},{content:S(()=>[m(c,{modelValue:i.postEditorStore.currentPost.twitter_use_og,"onUpdate:modelValue":[e[0]||(e[0]=p=>i.postEditorStore.currentPost.twitter_use_og=p),e[1]||(e[1]=p=>i.postEditorStore.isDirty=!0)]},null,8,["modelValue"])]),_:1},8,["name"]),i.postEditorStore.currentPost.twitter_use_og?O("",!0):(v(),E(a,{key:0,name:s.strings.twitterTitle,class:"twitter-title-settings",align:""},{content:S(()=>[m(h,{class:"twitter-meta-input",modelValue:i.postEditorStore.currentPost.twitter_title,"onUpdate:modelValue":[e[2]||(e[2]=p=>i.postEditorStore.currentPost.twitter_title=p),e[4]||(e[4]=p=>i.postEditorStore.isDirty=!0)],"line-numbers":!1,single:"",onCounter:e[3]||(e[3]=p=>s.titleCount=p.length),"tags-context":`${i.postEditorStore.currentPost.postType||i.postEditorStore.currentPost.termType}Title`,"default-tags":s.tags.getDefaultTags(i.postEditorStore.currentPost.context==="term"?"taxonomies":null,null,"title")},null,8,["modelValue","tags-context","default-tags"]),A("div",{class:"max-recommended-count",innerHTML:i.maxRecommendedCount(s.titleCount,70)},null,8,FV)]),_:1},8,["name"])),i.postEditorStore.currentPost.twitter_use_og?O("",!0):(v(),E(a,{key:1,name:s.strings.twitterDescription,class:"twitter-description-settings",align:""},{content:S(()=>[m(h,{class:"twitter-meta-input",modelValue:i.postEditorStore.currentPost.twitter_description,"onUpdate:modelValue":[e[5]||(e[5]=p=>i.postEditorStore.currentPost.twitter_description=p),e[7]||(e[7]=p=>i.postEditorStore.isDirty=!0)],"line-numbers":!1,description:"",onCounter:e[6]||(e[6]=p=>s.descriptionCount=p.length),"tags-context":`${i.postEditorStore.currentPost.postType||i.postEditorStore.currentPost.termType}Description`,"default-tags":s.tags.getDefaultTags(i.postEditorStore.currentPost.context==="term"?"taxonomies":null,null,"description")},{"tags-description":S(()=>[B(D(s.strings.clickToAddHomePageDescription),1)]),_:1},8,["modelValue","tags-context","default-tags"]),A("div",{class:"max-recommended-count",innerHTML:i.maxRecommendedCount(s.descriptionCount,200)},null,8,IV)]),_:1},8,["name"])),i.postEditorStore.currentPost.twitter_use_og?O("",!0):(v(),E(a,{key:2,class:"twitter-image-source",name:s.strings.imageSource,align:""},{content:S(()=>[m(d,{size:"medium",options:i.imageSourceOptionsFiltered,modelValue:i.getImageSourceOptionFiltered(i.postEditorStore.currentPost.twitter_image_type),"onUpdate:modelValue":e[8]||(e[8]=p=>r.saveTwitterImageType(p.value))},null,8,["options","modelValue"])]),_:1},8,["name"])),!i.postEditorStore.currentPost.twitter_use_og&&i.postEditorStore.currentPost.twitter_image_type==="custom"?(v(),E(a,{key:3,class:"twitter-custom-field",name:s.strings.customFieldsName,align:""},{content:S(()=>[m(u,{type:"text",size:"medium",placeholder:s.strings.placeholder,modelValue:i.postEditorStore.currentPost.twitter_image_custom_fields,"onUpdate:modelValue":[e[9]||(e[9]=p=>i.postEditorStore.currentPost.twitter_image_custom_fields=p),e[10]||(e[10]=p=>i.postEditorStore.isDirty=!0)]},null,8,["placeholder","modelValue"])]),_:1},8,["name"])):O("",!0),!i.postEditorStore.currentPost.twitter_use_og&&i.postEditorStore.currentPost.twitter_image_type==="custom_image"?(v(),E(a,{key:4,class:"twitter-image",name:s.strings.twitterImage},{content:S(()=>[m(f,{description:r.twitterImageUploaderDescription,modelValue:i.postEditorStore.currentPost.twitter_image_custom_url,"onUpdate:modelValue":e[11]||(e[11]=p=>i.postEditorStore.currentPost.twitter_image_custom_url=p)},null,8,["description","modelValue"])]),_:1},8,["name"])):O("",!0),m(a,{class:"twitter-card-type",name:s.strings.twitterCardType,align:""},{content:S(()=>[m(d,{size:"medium","open-direction":"top",options:i.twitterCardOptions,modelValue:r.getCardOptions(i.postEditorStore.currentPost.twitter_card),"onUpdate:modelValue":e[12]||(e[12]=p=>r.cardSelect(p.value))},null,8,["options","modelValue"])]),_:1},8,["name"])])])}const zV=Z(BV,[["render",WV]]),tu="all-in-one-seo-pack",UV={setup(){return{postEditorStore:Te(),settingsStore:os()}},components:{CoreSettingsRow:Ce,SvgPencil:_r},data(){return{strings:{title:C("Social Media",tu),sidebarCopy:C("Here you can view and edit the thumbnail, title and description that will be displayed when your site is shared on social media. Click on the button below to view and edit the preview.",tu),editSnippet:C("Preview & Edit",tu)}}},methods:{openModalEv(){this.settingsStore.changeTabSettings({setting:"modal",value:"social"}),this.postEditorStore.currentPost.modalOpen=!0}}},$V={class:"aioseo-sidebar-content-title"};function KV(n,e,t,i,s,r){const o=x("svg-pencil"),l=x("base-button"),a=x("core-settings-row");return n.$root.$data.screenContext==="sidebar"?(v(),E(a,{key:0,name:s.strings.metaDescription,class:"snippet-description-row open-social-copy"},{content:S(()=>[A("div",$V,D(s.strings.title),1),A("p",null,D(s.strings.sidebarCopy),1),m(l,{class:"open-social-modal gray small",onClick:r.openModalEv},{default:S(()=>[m(o),B(" "+D(s.strings.editSnippet),1)]),_:1},8,["onClick"])]),_:1},8,["name"])):O("",!0)}const GV=Z(UV,[["render",KV]]),iu="all-in-one-seo-pack",qV={setup(){return{postEditorStore:Te(),settingsStore:os()}},components:{BaseRadioToggle:br,CoreMainTabs:Qi,CoreSettingsRow:Ce,Facebook:RV,Twitter:zV,SocialSideBar:GV},props:{parentComponentContext:String},data(){return{strings:{pageName:C("Social",iu)},tabs:[{slug:"facebook",name:C("Facebook",iu)},{slug:"twitter",name:C("X (Twitter)",iu)}]}},computed:{initTab:function(){let n=this.settingsStore.metaBoxTabs.social;return this.parentComponentContext==="modal"&&(n=this.settingsStore.metaBoxTabs.socialModal),n}},methods:{processChangeTab(n){this.parentComponentContext==="modal"?this.settingsStore.changeTabSettings({setting:"socialModal",value:n}):this.settingsStore.changeTabSettings({setting:"social",value:n})}},mounted(){Da()["social-tab"]&&(this.processChangeTab(Da()["social-tab"]),setTimeout(()=>{xf("social-tab")},500))}},ZV={class:"aioseo-tab-content aioseo-post-social"};function jV(n,e,t,i,s,r){const o=x("core-main-tabs"),l=x("core-settings-row"),a=x("social-side-bar");return v(),L("div",ZV,[n.$root.$data.screenContext==="metabox"||t.parentComponentContext==="modal"?(v(),E(l,{key:0,"no-border":""},{content:S(()=>[m(o,{tabs:s.tabs,showSaveButton:!1,active:r.initTab,internal:"",onChanged:e[0]||(e[0]=c=>r.processChangeTab(c)),disableMobile:""},null,8,["tabs","active"])]),_:1})):O("",!0),n.$root.$data.screenContext==="metabox"||t.parentComponentContext==="modal"?(v(),E(Aa,{key:1,name:"route-fade",mode:"out-in"},{default:S(()=>[(v(),E(bt(r.initTab)))]),_:1})):O("",!0),t.parentComponentContext!=="modal"?(v(),E(a,{key:2})):O("",!0)])}const y9=Z(qV,[["render",jV]]),su="all-in-one-seo-pack",YV={setup(){return{settingsStore:os()}},components:{CoreMainTabs:Qi,CoreSettingsRow:Ce,General:C9,Social:y9,SvgSettings:a9,SvgShare:f9},data(){return{strings:{pageName:C("Modal Content",su)},tabs:[{slug:"general",icon:"svg-settings",name:C("General",su)},{slug:"social",icon:"svg-share",name:C("Social",su)}]}},computed:{getTabs(){return this.tabs.filter(n=>cn(`aioseo_page_${n.slug}_settings`))}},methods:{processChangeTab(n){this.settingsStore.changeTabSettings({setting:"modal",value:n})}}},JV={class:"aioseo-modal-content"},XV={class:"mobile-radio-buttons"},QV={class:"component-wrapper"};function eE(n,e,t,i,s,r){const o=x("core-main-tabs");return v(),L("div",JV,[A("div",XV,[m(o,{tabs:r.getTabs,showSaveButton:!1,active:i.settingsStore.metaBoxTabs.modal||"general",internal:"",onChanged:e[0]||(e[0]=l=>r.processChangeTab(l))},null,8,["tabs","active"])]),A("div",QV,[m(Aa,{name:"route-fade",mode:"out-in"},{default:S(()=>[(v(),E(bt(i.settingsStore.metaBoxTabs.modal||"general"),{parentComponentContext:"modal"}))]),_:1})])])}const tE=Z(YV,[["render",eE]]),nu="all-in-one-seo-pack",iE={setup(){return{postEditorStore:Te()}},components:{CoreSettingsRow:Ce,SvgRightArrowShort:Sm},data(){return{strings:{title:C("Redirects",nu),description:C("Here you can add a redirect or view your existing redirects from this page. Click on the button below to view the Redirects panel.",nu),button:C("Open Redirects",nu)}}}},sE={class:"aioseo-redirects-sidebar"},nE={class:"aioseo-sidebar-content-title"};function rE(n,e,t,i,s,r){const o=x("svg-right-arrow-short"),l=x("base-button"),a=x("core-settings-row");return v(),L("div",sE,[n.$root.$data.screenContext==="sidebar"?(v(),E(a,{key:0,class:"snippet-description-row open-redirects-copy"},{content:S(()=>[A("div",nE,D(s.strings.title),1),A("p",null,D(s.strings.description),1),m(l,{class:"open-redirects-modal gray small",onClick:e[0]||(e[0]=c=>i.postEditorStore.currentPost.redirects.modalOpen=!0)},{default:S(()=>[m(o),B(" "+D(s.strings.button),1)]),_:1})]),_:1})):O("",!0)])}const vm=Z(iE,[["render",rE],["__scopeId","data-v-1754537e"]]),oE="aioseo-pro",lE={setup(){return{postEditorStore:Te(),redirectsStore:Q7()}},components:{CoreAddRedirection:KA,CoreModal:Qt,RedirectsSideBar:vm,RedirectsTable:GA},props:{parentComponentContext:String},data(){return{addons:Ho,strings:{modalHeader:C("Redirects",oE)}}},computed:{getUrl(){return{url:this.postEditorStore.currentPost.permalinkPath,showOptions:!0}},hasRedirects(){return this.redirectsStore.rows.length},postId(){return this.postEditorStore.currentPost.context==="post"?parseInt(this.postEditorStore.currentPost.id):0}},methods:{reload(){this.redirectsStore.getPostRedirects()}}},aE={key:0},hE={key:0,class:"aioseo-tab-content aioseo-redirects metabox"},cE={key:1},dE={class:"bd"},uE={key:1};function fE(n,e,t,i,s,r){const o=x("core-add-redirection"),l=x("redirects-table"),a=x("core-modal"),c=x("redirects-side-bar");return v(),L("div",null,[s.addons.isActive("aioseo-redirects")?(v(),L("div",aE,[n.$root.$data.screenContext==="metabox"?(v(),L("div",hE,[r.hasRedirects?O("",!0):(v(),E(o,{key:i.postEditorStore.currentPost.permalinkPath,"disable-source":!0,"post-id":r.postId,"post-status":i.postEditorStore.currentPost.postStatus,url:r.getUrl,onAddedRedirect:r.reload},null,8,["post-id","post-status","url","onAddedRedirect"])),r.hasRedirects?(v(),L("div",cE,[m(l,{"disable-source":!0,"exclude-columns":["group"],"show-bulk-actions":!1,"show-header":!1,"show-table-footer":!1})])):O("",!0)])):O("",!0),m(a,{show:i.postEditorStore.currentPost.redirects.modalOpen&&n.$root.$data.screenContext==="sidebar",classes:["aioseo-redirects"],onClose:e[0]||(e[0]=h=>i.postEditorStore.currentPost.redirects.modalOpen=!1),"allow-overflow":""},{headerTitle:S(()=>[B(D(s.strings.modalHeader),1)]),body:S(()=>[A("div",dE,[r.hasRedirects?O("",!0):(v(),E(o,{key:i.postEditorStore.currentPost.permalinkPath,"disable-source":!0,"post-id":r.postId,"post-status":i.postEditorStore.currentPost.postStatus,url:r.getUrl,onAddedRedirect:r.reload},null,8,["post-id","post-status","url","onAddedRedirect"])),r.hasRedirects?(v(),L("div",uE,[m(l,{"disable-source":!0,"exclude-columns":["group"],"show-bulk-actions":!1,"show-header":!1,"show-table-footer":!1})])):O("",!0)])]),_:1},8,["show"]),t.parentComponentContext!=="modal"?(v(),E(c,{key:1})):O("",!0)])):O("",!0)])}const pE=Z(lE,[["render",fE]]),gE="aioseo-pro",mE={setup(){return{postEditorStore:Te()}},components:{CoreModal:Qt,RedirectsActivate:qA,RedirectsSideBar:vm},props:{parentComponentContext:String},data(){return{strings:{modalHeader:C("Redirects",gE)}}}},CE={class:"aioseo-tab-content aioseo-redirects"},yE={key:0},bE={class:"bd"};function SE(n,e,t,i,s,r){const o=x("redirects-activate",!0),l=x("core-modal"),a=x("redirects-side-bar");return v(),L("div",CE,[n.$root.$data.screenContext==="metabox"?(v(),L("div",yE,[m(o,{noCoreCard:!0,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])])):O("",!0),m(l,{show:i.postEditorStore.currentPost.redirects.modalOpen&&n.$root.$data.screenContext==="sidebar",classes:["aioseo-redirects"],onClose:e[0]||(e[0]=c=>i.postEditorStore.currentPost.redirects.modalOpen=!1)},{headerTitle:S(()=>[B(D(s.strings.modalHeader),1)]),body:S(()=>[A("div",bE,[m(o,{noCoreCard:!0,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])])]),_:1},8,["show"]),t.parentComponentContext!=="modal"?(v(),E(a,{key:1})):O("",!0)])}const wE=Z(mE,[["render",SE]]),vE="all-in-one-seo-pack",kE={setup(){return{postEditorStore:Te()}},components:{CoreModal:Qt,RedirectsSideBar:vm,RedirectsLite:ZA},props:{parentComponentContext:String},data(){return{strings:{modalHeader:C("Redirects",vE)}}}},xE={class:"bd"};function ME(n,e,t,i,s,r){const o=x("redirects-lite"),l=x("core-modal"),a=x("redirects-side-bar");return v(),L("div",null,[n.$root.$data.screenContext==="metabox"?(v(),E(o,{key:0,noCoreCard:!0,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])):O("",!0),m(l,{show:i.postEditorStore.currentPost.redirects.modalOpen&&n.$root.$data.screenContext==="sidebar",classes:["aioseo-redirects"],onClose:e[0]||(e[0]=c=>i.postEditorStore.currentPost.redirects.modalOpen=!1)},{headerTitle:S(()=>[B(D(s.strings.modalHeader),1)]),body:S(()=>[A("div",xE,[m(o,{noCoreCard:!0,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])])]),_:1},8,["show"]),t.parentComponentContext!=="modal"?(v(),E(a,{key:1})):O("",!0)])}const AE=Z(kE,[["render",ME]]),DE={setup(){return{addons:Ho,licenseStore:pi()}},components:{Redirects:pE,RedirectsActivate:wE,RedirectsLite:AE},props:{parentComponentContext:String}},TE={class:"aioseo-tab-content"};function _E(n,e,t,i,s,r){const o=x("Redirects",!0),l=x("RedirectsLite"),a=x("RedirectsActivate");return v(),L("div",TE,[!i.licenseStore.isUnlicensed&&i.addons.isActive("aioseo-redirects")&&!i.addons.requiresUpgrade("aioseo-redirects")?(v(),E(o,{key:0,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])):O("",!0),i.licenseStore.isUnlicensed||i.addons.requiresUpgrade("aioseo-redirects")?(v(),E(l,{key:1,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])):O("",!0),!i.licenseStore.isUnlicensed&&!i.addons.isActive("aioseo-redirects")&&i.addons.canActivate("aioseo-redirects")&&!i.addons.requiresUpgrade("aioseo-redirects")?(v(),E(a,{key:2,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])):O("",!0)])}const OE=Z(DE,[["render",_E]]),VE={emits:["closeModal","doAction","openModal"],components:{CoreModal:Qt,SvgClose:Sd},props:{strings:{type:Object,required:!0},show:Boolean},watch:{show(n){n&&this.$emit("openModal",!0)}}},EE={class:"aioseo-modal-body"},PE=["innerHTML"];function LE(n,e,t,i,s,r){const o=x("svg-close"),l=x("base-button"),a=x("core-modal");return v(),E(a,{show:t.show,classes:["aioseo-post-schema-confirmation-modal"],"no-header":"",onClose:e[4]||(e[4]=c=>n.$emit("closeModal",!0))},{body:S(()=>[A("div",EE,[A("button",{class:"close",onClick:e[1]||(e[1]=Dt(c=>n.$emit("closeModal",!0),["stop"]))},[m(o,{onClick:e[0]||(e[0]=c=>n.$emit("closeModal",!0))})]),A("h3",null,D(t.strings.areYouSure),1),A("div",{class:"reset-description",innerHTML:t.strings.actionCannotBeUndone},null,8,PE),m(l,{type:"blue",size:"medium",onClick:e[2]||(e[2]=c=>n.$emit("doAction",c))},{default:S(()=>[B(D(t.strings.confirmation),1)]),_:1}),m(l,{type:"gray",size:"medium",onClick:e[3]||(e[3]=c=>n.$emit("closeModal",!0))},{default:S(()=>[B(D(t.strings.noChangedMind),1)]),_:1})])]),_:1},8,["show"])}const km=Z(VE,[["render",LE]]),RE={class:"graph-container"},BE={class:"graph"},HE={class:"left"},NE=["title"],FE={class:"right action-buttons"},dn={__name:"GraphCard",props:{graph:Object,customGraph:Boolean,defaultGraph:String},setup(n){const e="all-in-one-seo-pack",t=n,{childGraphs:i,graphs:s}=gt(),r=xe(()=>{var u,f,p,g;if(t.customGraph)return C("Custom Schema",e)+" - "+t.graph.graphName;if(t.defaultGraph)return a(t.defaultGraph);if((u=t.graph)!=null&&u.label)return t.graph.label;const h=(p=(f=t.graph)==null?void 0:f.slug)==null?void 0:p.toLowerCase();return((g=s.find(b=>b.slug===h))==null?void 0:g.label)||C("Parsing Block Data...",e)}),o=xe(()=>{if(t.customGraph)return Xd;if(t.defaultGraph){const h=l(t.defaultGraph);return h?c(h):Xd}return c(t.graph.slug)}),l=h=>{Object.entries(i).forEach(u=>{const f=u[0];u[1].forEach(p=>{h===p.childGraphName&&(h=f)})});let d="";return s.forEach(u=>{u.graphName===h&&(d=u.slug)}),d},a=h=>{let d="",u=h;return Object.entries(i).forEach(f=>{const p=f[0];f[1].forEach(g=>{d||h===g.childGraphName&&(d=p,u=g.label,s.forEach(b=>{b.graphName===p&&(d=b.label)}))})}),d?d+" - "+u+" "+C("(Default)",e):h+" "+C("(Default)",e)},c=h=>{switch(h){case"article":return kA;case"book":return vA;case"car":return wA;case"course":return SA;case"dataset":return bA;case"event":return yA;case"faq-page":return CA;case"fact-check":return mA;case"how-to":return gA;case"job-posting":return pA;case"movie":return fA;case"music":return uA;case"person":return dA;case"product":return cA;case"product-review":return hA;case"recipe":return aA;case"service":return lA;case"software-application":return oA;case"video":return rA;case"web-page":return nA;default:return Xd}};return(h,d)=>(v(),L("div",RE,[A("div",BE,[A("div",HE,[(v(),E(bt(o.value))),A("span",{title:r.value},D(r.value),9,NE)]),A("div",FE,[qi(h.$slots,"buttons")])])]))}},a4="all-in-one-seo-pack",ch=()=>{const n=Ie(),e=xe(()=>{if(n.isEditingDefaultGraph)return!0;switch(n.graph.graphName){case"Event":case"JobPosting":break;default:return!0}const s=n.graph.graphName.replace(new RegExp("(?<!^)([A-Z][a-z]|(?<=[a-z])[A-Z])"),"-$1").toLowerCase();return rr.hasCoreFeature("schema",s)}),t=xe(()=>{const s=be.getPricingUrl("graph-"+n.graph.graphName.toLowerCase(),"schema-generator","graph-"+n.graph.graphName.toLowerCase(),"pricing");return C("This feature is not available in your current plan.",a4)+" "+j('<a href="%1$s" target="_blank">%2$s</a>',s,j(C("Upgrade your plan and unlock %1$s schema",a4),n.graph.graphName.replace(/([A-Z].*?)([A-Z])(?![A-Z])/,"$1 $2")))}),i=xe(()=>n.isEditingCustomGraph||n.isEditingCustomTemplate||n.isEditingDefaultGraph||n.isEditingGraph||n.isEditingTemplate);return{hasFeature:e,graphNotIncluded:t,isEditing:i}};class ${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]=No(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),Gs.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]=No(this,e,t);let i=[];return this.decompose(e,t,i,0),Gs.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 da(this),r=new da(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new da(this,e)}iterRange(e,t=this.length){return new b9(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 S9(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]?$.empty:e.length<=32?new kt(e):Gs.from(kt.split(e,[]))}}class kt extends ${constructor(e,t=IE(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 r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new WE(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new kt(h4(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=N1(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new kt(l,o.length+r.length));else{let a=l.length>>1;i.push(new kt(l.slice(0,a)),new kt(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof kt))return super.replace(e,t,i);[e,t]=No(this,e,t);let s=N1(this.text,N1(i.text,h4(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new kt(s,r):Gs.from(kt.split(s,[]),r)}sliceString(e,t=this.length,i=` `){[e,t]=No(this,e,t);let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+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 r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new kt(i,s)),i=[],s=-1);return s>-1&&t.push(new kt(i,s)),t}}class Gs extends ${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 r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let c=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!c?i.push(l):l.decompose(e-o,t-o,i,c)}o=a+1}}replace(e,t,i){if([e,t]=No(this,e,t),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let h=this.children.slice();return h[s]=a,new Gs(h,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` `){[e,t]=No(this,e,t);let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Gs))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],c=e.children[r];if(a!=c)return i+a.scanIdentical(c,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let f of e)i+=f.lines;if(i<32){let f=[];for(let p of e)p.flatten(f);return new kt(f,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,c=-1,h=[];function d(f){let p;if(f.lines>r&&f instanceof Gs)for(let g of f.children)d(g);else f.lines>o&&(a>o||!a)?(u(),l.push(f)):f instanceof kt&&a&&(p=h[h.length-1])instanceof kt&&f.lines+p.lines<=32?(a+=f.lines,c+=f.length+1,h[h.length-1]=new kt(p.text.concat(f.text),p.length+1+f.length)):(a+f.lines>s&&u(),a+=f.lines,c+=f.length+1,h.push(f))}function u(){a!=0&&(l.push(h.length==1?h[0]:Gs.from(h,c)),c=-1,a=h.length=0)}for(let f of e)d(f);return u(),l.length==1?l[0]:new Gs(l,t)}}$.empty=new kt([""],0);function IE(n){let e=-1;for(let t of n)e+=t.length+1;return e}function N1(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function h4(n,e,t){return N1(n,[""],e,t)}class da{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 kt?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],r=this.offsets[i],o=r>>1,l=s instanceof kt?s.text.length:s.children.length;if(o==(t>0?l: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((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(s instanceof kt){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof kt?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class b9{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new da(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 S9{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"&&($.prototype[Symbol.iterator]=function(){return this.iter()},da.prototype[Symbol.iterator]=b9.prototype[Symbol.iterator]=S9.prototype[Symbol.iterator]=function(){return this});class WE{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 No(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}let bo="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(n=>n?parseInt(n,36):1);for(let n=1;n<bo.length;n++)bo[n]+=bo[n-1];function zE(n){for(let e=1;e<bo.length;e+=2)if(bo[e]>n)return bo[e-1]<=n;return!1}function c4(n){return n>=127462&&n<=127487}const d4=8205;function de(n,e,t=!0,i=!0){return(t?w9:UE)(n,e,i)}function w9(n,e,t){if(e==n.length)return e;e&&v9(n.charCodeAt(e))&&k9(n.charCodeAt(e-1))&&e--;let i=Pt(n,e);for(e+=Di(i);e<n.length;){let s=Pt(n,e);if(i==d4||s==d4||t&&zE(s))e+=Di(s),i=s;else if(c4(s)){let r=0,o=e-2;for(;o>=0&&c4(Pt(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function UE(n,e,t){for(;e>0;){let i=w9(n,e-2,t);if(i<e)return i;e--}return 0}function v9(n){return n>=56320&&n<57344}function k9(n){return n>=55296&&n<56320}function Pt(n,e){let t=n.charCodeAt(e);if(!k9(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return v9(i)?(t-55296<<10)+(i-56320)+65536:t}function xm(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Di(n){return n<65536?1:2}const Of=/\r\n?|\n/;var fe=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(fe||(fe={}));class Xs{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 r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){Vf(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 Xs(e)}composeDesc(e){return this.empty?e:e.empty?this:x9(this,e)}mapDesc(e,t=!1){return e.empty?this:Ef(this,e,t)}mapPos(e,t=-1,i=fe.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=s+l;if(a<0){if(c>e)return r+(e-s);r+=l}else{if(i!=fe.Simple&&c>=e&&(i==fe.TrackDel&&s<e&&c>e||i==fe.TrackBefore&&s<e||i==fe.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=c}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}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 Xs(e)}static create(e){return new Xs(e)}}class Be extends Xs{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 Vf(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Ef(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push($.empty);i.push(o?e.slice(r,r+o):$.empty)}r+=o}return new Be(t,i)}compose(e){return this.empty?e:e.empty?this:x9(this,e,!0)}map(e,t=!1){return e.empty?this:Ef(this,e,t,!0)}iterChanges(e,t=!1){Vf(this,e,t)}get desc(){return Xs.create(this.sections)}filter(e){let t=[],i=[],s=[],r=new Ta(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let h=Math.min(r.len,a-l);Yt(s,h,-1);let d=r.ins==-1?-1:r.off==0?r.ins:0;Yt(t,h,d),d>0&&Un(i,t,r.text),r.forward(h),l+=h}let c=e[o++];for(;l<c;){if(r.done)break e;let h=Math.min(r.len,c-l);Yt(t,h,-1),Yt(s,h,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(h),l+=h}}return{changes:new Be(t,i),filtered:Xs.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=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!s.length)return;o<t&&Yt(s,t-o,-1);let d=new Be(s,r);l=l?l.compose(d.map(l)):d,s=[],r=[],o=0}function c(h){if(Array.isArray(h))for(let d of h)c(d);else if(h instanceof Be){if(h.length!=t)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:d,to:u=d,insert:f}=h;if(d>u||d<0||u>t)throw new RangeError(`Invalid change range ${d} to ${u} (in doc of length ${t})`);let p=f?typeof f=="string"?$.of(f.split(i||Of)):f:$.empty,g=p.length;if(d==u&&g==0)return;d<o&&a(),d>o&&Yt(s,d-o,-1),Yt(s,u-d,g),Un(r,s,p),o=u}}return c(e),a(!l),l}static empty(e){return new Be(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 r=e[s];if(typeof r=="number")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length<s;)i.push($.empty);i[s]=$.of(r.slice(1)),t.push(r[0],i[s].length)}}}return new Be(t,i)}static createSet(e,t){return new Be(e,t)}}function Yt(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:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function Un(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($.empty);n.push(t)}}function Vf(n,e,t){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let c=s,h=r,d=$.empty;for(;c+=l,h+=a,a&&i&&(d=d.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,c,r,h,d),s=c,r=h}}}function Ef(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Ta(n),l=new Ta(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);Yt(s,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let c=l.len;for(Yt(s,l.ins,-1);c;){let h=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=h&&(Yt(s,0,o.ins),r&&Un(r,s,o.text),a=o.i),o.forward(h),c-=h}l.next()}else if(o.ins>=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let d=Math.min(h,l.len);c+=d,h-=d,l.forward(d)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;Yt(s,c,a<o.i?o.ins:0),r&&a<o.i&&Un(r,s,o.text),a=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return r?Be.createSet(s,r):Xs.create(s);throw new Error("Mismatched change set lengths")}}function x9(n,e,t=!1){let i=[],s=t?[]:null,r=new Ta(n),o=new Ta(e);for(let l=!1;;){if(r.done&&o.done)return s?Be.createSet(i,s):Xs.create(i);if(r.ins==0)Yt(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)Yt(i,0,o.ins,l),s&&Un(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),c=i.length;if(r.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;Yt(i,a,h,l),s&&h&&Un(s,i,o.text)}else o.ins==-1?(Yt(i,r.off?0:r.len,a,l),s&&Un(s,i,r.textBit(a))):(Yt(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&Un(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),r.forward2(a),o.forward(a)}}}}class Ta{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?$.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?$.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 Dr{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 Dr(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return T.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return T.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 T.range(e.anchor,e.head)}static create(e,t,i){return new Dr(e,t,i)}}class T{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:T.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 T([this.main],0)}addRange(e,t=!0){return T.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,T.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 T(e.ranges.map(t=>Dr.fromJSON(t)),e.main)}static single(e,t=e){return new T([T.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 r=e[s];if(r.empty?r.from<=i:r.from<i)return T.normalized(e.slice(),t);i=r.to}return new T(e,t)}static cursor(e,t=0,i,s){return Dr.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 r=(i??16777215)<<6|(s==null?7:Math.min(6,s));return t<e?Dr.create(t,e,48|r):Dr.create(e,t,(t>e?8:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=t&&t--,e.splice(--s,2,r.anchor>r.head?T.range(a,l):T.range(l,a))}}return new T(e,t)}}function M9(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Mm=0;class P{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Mm++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new P(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Am),!!e.static,e.enables)}of(e){return new F1([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new F1(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new F1(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Am(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class F1{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Mm++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let d of this.dependencies)d=="doc"?a=!0:d=="selection"?c=!0:((t=e[d.id])!==null&&t!==void 0?t:1)&1||h.push(e[d.id]);return{create(d){return d.values[o]=i(d),1},update(d,u){if(a&&u.docChanged||c&&(u.docChanged||u.selection)||Pf(d,h)){let f=i(d);if(l?!u4(f,d.values[o],s):!s(f,d.values[o]))return d.values[o]=f,1}return 0},reconfigure:(d,u)=>{let f,p=u.config.address[r];if(p!=null){let g=_c(u,p);if(this.dependencies.every(b=>b instanceof P?u.facet(b)===d.facet(b):b instanceof qt?u.field(b,!1)==d.field(b,!1):!0)||(l?u4(f=i(d),g,s):s(f=i(d),g)))return d.values[o]=g,0}else f=i(d);return d.values[o]=f,1}}}}function u4(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 Pf(n,e){let t=!1;for(let i of e)ua(n,i)&1&&(t=!0);return t}function $E(n,e,t){let i=t.map(a=>n[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let c=[];for(let h=0;h<i.length;h++){let d=_c(a,i[h]);if(s[h]==2)for(let u of d)c.push(u);else c.push(d)}return e.combine(c)}return{create(a){for(let c of i)ua(a,c);return a.values[o]=l(a),1},update(a,c){if(!Pf(a,r))return 0;let h=l(a);return e.compare(h,a.values[o])?0:(a.values[o]=h,1)},reconfigure(a,c){let h=Pf(a,i),d=c.config.facets[e.id],u=c.facet(e);if(d&&!h&&Am(t,d))return a.values[o]=u,0;let f=l(a);return e.compare(f,u)?(a.values[o]=u,0):(a.values[o]=f,1)}}}const f4=P.define({static:!0});class qt{constructor(e,t,i,s,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let t=new qt(Mm++,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(f4).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 r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,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,f4.of({field:this,create:e})]}get extension(){return this}}const Mr={lowest:4,low:3,default:2,high:1,highest:0};function Sl(n){return e=>new A9(e,n)}const Vi={highest:Sl(Mr.highest),high:Sl(Mr.high),default:Sl(Mr.default),low:Sl(Mr.low),lowest:Sl(Mr.lowest)};class A9{constructor(e,t){this.inner=e,this.prec=t}}class Dd{of(e){return new Lf(this,e)}reconfigure(e){return Dd.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Lf{constructor(e,t){this.compartment=e,this.inner=t}}class Tc{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,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=[],r=Object.create(null),o=new Map;for(let u of KE(e,t,o))u instanceof qt?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],c=[];for(let u of s)l[u.id]=c.length<<1,c.push(f=>u.slot(f));let h=i==null?void 0:i.config.facets;for(let u in r){let f=r[u],p=f[0].facet,g=h&&h[u]||[];if(f.every(b=>b.type==0))if(l[p.id]=a.length<<1|1,Am(g,f))a.push(i.facet(p));else{let b=p.combine(f.map(y=>y.value));a.push(i&&p.compare(b,i.facet(p))?i.facet(p):b)}else{for(let b of f)b.type==0?(l[b.id]=a.length<<1|1,a.push(b.value)):(l[b.id]=c.length<<1,c.push(y=>b.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(b=>$E(b,p,f))}}let d=c.map(u=>u(l));return new Tc(e,o,d,l,a,r)}}function KE(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof Lf&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let c of o)r(c,l);else if(o instanceof Lf){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),r(c,l)}else if(o instanceof A9)r(o.inner,o.prec);else if(o instanceof qt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof F1)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Mr.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(c,l)}}return r(n,Mr.default),i.reduce((o,l)=>o.concat(l))}function ua(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 _c(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const D9=P.define(),Rf=P.define({combine:n=>n.some(e=>e),static:!0}),T9=P.define({combine:n=>n.length?n[0]:void 0,static:!0}),_9=P.define(),O9=P.define(),V9=P.define(),E9=P.define({combine:n=>n.length?n[0]:!1});class gi{constructor(e,t){this.type=e,this.value=t}static define(){return new GE}}class GE{of(e){return new gi(this,e)}}class qE{constructor(e){this.map=e}of(e){return new ce(this,e)}}class ce{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 ce(this.type,t)}is(e){return this.type==e}static define(e={}){return new qE(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}ce.reconfigure=ce.define();ce.appendConfig=ce.define();class pt{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&M9(i,t.newLength),r.some(l=>l.type==pt.time)||(this.annotations=r.concat(pt.time.of(Date.now())))}static create(e,t,i,s,r,o){return new pt(e,t,i,s,r,o)}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(pt.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}pt.time=gi.define();pt.userEvent=gi.define();pt.addToHistory=gi.define();pt.remote=gi.define();function ZE(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==e.length||e[s]>=n[i]))r=n[i++],o=n[i++];else if(s<e.length)r=e[s++],o=e[s++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function P9(n,e,t){var i;let s,r,o;return t?(s=e.changes,r=Be.empty(e.changes.length),o=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),r=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:ce.mapEffects(n.effects,s).concat(ce.mapEffects(e.effects,r)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function Bf(n,e,t){let i=e.selection,s=So(e.annotations);return e.userEvent&&(s=s.concat(pt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Be?e.changes:Be.of(e.changes||[],t,n.facet(T9)),selection:i&&(i instanceof T?i:T.single(i.anchor,i.head)),effects:So(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function L9(n,e,t){let i=Bf(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;i=P9(i,Bf(n,e[r],o?i.changes.newLength:n.doc.length),o)}let s=pt.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return YE(t?jE(s):s)}function jE(n){let e=n.startState,t=!0;for(let s of e.facet(_9)){let r=s(n);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:ZE(t,r))}if(t!==!0){let s,r;if(t===!1)r=n.changes.invertedDesc,s=Be.empty(e.doc.length);else{let o=n.changes.filter(t);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=pt.create(e,s,n.selection&&n.selection.map(r),ce.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=e.facet(O9);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof pt?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof pt?n=r[0]:n=L9(e,So(r),!1)}return n}function YE(n){let e=n.startState,t=e.facet(V9),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=P9(i,Bf(e,r,n.changes.newLength),!0))}return i==n?n:pt.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const JE=[];function So(n){return n==null?JE:Array.isArray(n)?n:[n]}var He=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(He||(He={}));const XE=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Hf;try{Hf=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function QE(n){if(Hf)return Hf.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||XE.test(t)))return!0}return!1}function eP(n){return e=>{if(!/\S/.test(e))return He.Space;if(QE(e))return He.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return He.Word;return He.Other}}class ae{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)ua(this,l<<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 ua(this,i),_c(this,i)}update(...e){return L9(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:s}=t;for(let l of e.effects)l.is(Dd.reconfigure)?(t&&(s=new Map,t.compartments.forEach((a,c)=>s.set(c,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is(ce.reconfigure)?(t=null,i=l.value):l.is(ce.appendConfig)&&(t=null,i=So(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=Tc.resolve(i,s,this),r=new ae(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(Rf)?e.newSelection:e.newSelection.asSingle();new ae(t,e.newDoc,o,r,(l,a)=>a.update(l,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:T.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=So(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),c=this.changes(a.changes),h=c.map(s);for(let u=0;u<l;u++)r[u]=r[u].map(h);let d=s.mapDesc(c,!0);r.push(a.range.map(d)),s=s.compose(h),o=ce.mapEffects(o,h).concat(ce.mapEffects(So(a.effects),d))}return{changes:s,selection:T.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Be?e:Be.of(e,this.doc.length,this.facet(ae.lineSeparator))}toText(e){return $.of(e.split(this.facet(ae.lineSeparator)||Of))}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:(ua(this,t),_c(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 qt&&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 r in i)if(Object.prototype.hasOwnProperty.call(e,r)){let o=i[r],l=e[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return ae.create({doc:e.doc,selection:T.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Tc.resolve(e.extensions||[],new Map),i=e.doc instanceof $?e.doc:$.of((e.doc||"").split(t.staticFacet(ae.lineSeparator)||Of)),s=e.selection?e.selection instanceof T?e.selection:T.single(e.selection.anchor,e.selection.head):T.single(0);return M9(s,i.length),t.staticFacet(Rf)||(s=s.asSingle()),new ae(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(ae.tabSize)}get lineBreak(){return this.facet(ae.lineSeparator)||` `}get readOnly(){return this.facet(E9)}phrase(e,...t){for(let i of this.facet(ae.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 r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(D9))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return eP(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=de(t,o,!1);if(r(t.slice(a,o))!=He.Word)break;o=a}for(;l<s;){let a=de(t,l);if(r(t.slice(l,a))!=He.Word)break;l=a}return o==l?null:T.range(o+i,l+i)}}ae.allowMultipleSelections=Rf;ae.tabSize=P.define({combine:n=>n.length?n[0]:4});ae.lineSeparator=T9;ae.readOnly=E9;ae.phrases=P.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])}});ae.languageData=D9;ae.changeFilter=_9;ae.transactionFilter=O9;ae.transactionExtender=V9;Dd.reconfigure=ce.define();function on(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class Bt{eq(e){return this==e}range(e,t=e){return Nf.create(e,t,this)}}Bt.prototype.startSide=Bt.prototype.endSide=0;Bt.prototype.point=!1;Bt.prototype.mapMode=fe.TrackDel;let Nf=class R9{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new R9(e,t,i)}};function Ff(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Dm{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 r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,c=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],h=this.from[a]+e,d=this.to[a]+e,u,f;if(h==d){let p=t.mapPos(h,c.startSide,c.mapMode);if(p==null||(u=f=p,c.startSide!=c.endSide&&(f=t.mapPos(h,c.endSide),f<u)))continue}else if(u=t.mapPos(h,c.startSide),f=t.mapPos(d,c.endSide),u>f||u==f&&c.startSide>0&&c.endSide<=0)continue;(f-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(l=Math.max(l,f-u)),i.push(c),s.push(u-o),r.push(f-o))}return{mapped:i.length?new Dm(s,r,i,l):null,pos:o}}}class K{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 K(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:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Ff)),this.isEmpty)return t.length?K.of(t):this;let l=new B9(this,null,-1).goto(0),a=0,c=[],h=new or;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let d=t[a++];h.addInner(d.from,d.to,d.value)||c.push(d)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||c.push(Nf.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!c.length?K.empty:this.nextLayer.update({add:c,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)s=Math.max(s,a.maxPoint),t.push(a),i.push(e.mapPos(l));else if(c===!0){let{mapped:h,pos:d}=a.map(l,e);h&&(s=Math.max(s,h.maxPoint),t.push(h),i.push(d))}}let r=this.nextLayer.map(e);return t.length==0?r:new K(i,t,r||K.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return _a.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return _a.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=r),l=t.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=r),a=p4(o,l,i),c=new wl(o,a,r),h=new wl(l,a,r);i.iterGaps((d,u,f)=>g4(c,d,h,u,f,s)),i.empty&&i.length==0&&g4(c,0,h,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=999999999);let r=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=p4(r,o),a=new wl(r,l,0).goto(i),c=new wl(o,l,0).goto(i);for(;;){if(a.to!=c.to||!If(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>s)return!0;a.next(),c.next()}}static spans(e,t,i,s,r=-1){let o=new wl(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let h=o.activeForPoint(o.to),d=o.pointFrom<t?h.length+1:o.point.startSide<0?h.length:Math.min(h.length,a);s.point(l,c,o.point,h,d,o.pointRank),a=Math.min(o.openEnd(c),h.length)}else c>l&&(s.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new or;for(let s of e instanceof Nf?[e]:t?tP(e):e)i.add(s.from,s.to,s.value);return i.finish()}static join(e){if(!e.length)return K.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let s=e[i];s!=K.empty;s=s.nextLayer)t=new K(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}}K.empty=new K([],[],null,-1);function tP(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(Ff(e,i)>0)return n.slice().sort(Ff);e=i}return n}K.empty.nextLayer=K.empty;class or{finishChunk(e){this.chunks.push(new Dm(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 or)).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(K.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function p4(n,e,t){let i=new Map;for(let r of n)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&i.set(r.chunk[o],r.chunkPos[o]);let s=new Set;for(let r of e)for(let o=0;o<r.chunk.length;o++){let l=i.get(r.chunk[o]);l!=null&&(t?t.mapPos(l):l)==r.chunkPos[o]&&!(t!=null&&t.touchesRange(l,l+r.chunk[o].length))&&s.add(r.chunk[o])}return s}class B9{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 _a{constructor(e){this.heap=e}static from(e,t=null,i=-1){let s=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&s.push(new B9(o,t,i,r));return s.length==1?s[0]:new _a(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--)ru(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--)ru(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(),ru(this.heap,0)}}}function ru(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 wl{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=_a.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){kh(this.active,e),kh(this.activeTo,e),kh(this.activeRank,e),this.minActive=m4(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||s-this.activeTo[t])>0;)t++;xh(this.active,t,i),xh(this.activeTo,t,s),xh(this.activeRank,t,r),e&&xh(e,t,this.cursor.from),this.minActive=m4(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&&kh(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 r=this.cursor.value;if(!r.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=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.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 g4(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let c=n.to+a-t.to||n.endSide-t.endSide,h=c<0?n.to+a:t.to,d=Math.min(h,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&If(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,d,n.point,t.point):d>l&&!If(n.active,t.active)&&r.compareRange(l,d,n.active,t.active),h>o)break;l=h,c<=0&&n.next(),c>=0&&t.next()}}function If(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 kh(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function xh(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function m4(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 gl(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=de(n,s));return i}function lr(n,e,t,i){for(let s=0,r=0;;){if(r>=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=de(n,s)}return i===!0?-1:n.length}const Wf="ͼ",C4=typeof Symbol>"u"?"__"+Wf:Symbol.for(Wf),zf=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),y4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class we{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,c){let h=[],d=/^@(\w+)\b/.exec(o[0]),u=d&&d[1]=="keyframes";if(d&&l==null)return a.push(o[0]+";");for(let f in l){let p=l[f];if(/&/.test(f))r(f.split(/,\s*/).map(g=>o.map(b=>g.replace(/&/,b))).reduce((g,b)=>g.concat(b)),p,a);else if(p&&typeof p=="object"){if(!d)throw new RangeError("The value of a property ("+f+") should be a primitive value.");r(s(f),p,h,u)}else p!=null&&h.push(f.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(h.length||u)&&a.push((i&&!d&&!c?o.map(i):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=y4[C4]||1;return y4[C4]=e+1,Wf+e.toString(36)}static mount(e,t,i){let s=e[zf],r=i&&i.nonce;s?r&&s.setNonce(r):s=new iP(e,r),s.mount(Array.isArray(t)?t:[t],e)}}let b4=new Map;class iP{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=b4.get(i);if(r)return e[zf]=r;this.sheet=new s.CSSStyleSheet,b4.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[zf]=this}mount(e,t){let i=this.sheet,s=0,r=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let c=0;c<l.rules.length;c++)i.insertRule(l.rules[c],s++)}else{for(;r<a;)s+=this.modules[r++].rules.length;s+=l.rules.length,r++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+` `;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var nn={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:"'"},Pr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sP=typeof navigator<"u"&&/Mac/.test(navigator.platform),nP=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var zt=0;zt<10;zt++)nn[48+zt]=nn[96+zt]=String(zt);for(var zt=1;zt<=24;zt++)nn[zt+111]="F"+zt;for(var zt=65;zt<=90;zt++)nn[zt]=String.fromCharCode(zt+32),Pr[zt]=String.fromCharCode(zt);for(var ou in nn)Pr.hasOwnProperty(ou)||(Pr[ou]=nn[ou]);function Tm(n){var e=sP&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||nP&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Pr:nn)[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 Oa(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Uf(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function rP(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function I1(n,e){if(!e.anchorNode)return!1;try{return Uf(n,e.anchorNode)}catch{return!1}}function Va(n){return n.nodeType==3?Rr(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function fa(n,e,t,i){return t?S4(n,e,t,i,-1)||S4(n,e,t,i,1):!1}function Lr(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Oc(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function S4(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:Cn(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Lr(n)+(s<0?0:1),n=r}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?Cn(n):0}else return!1}}function Cn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function _m(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function oP(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 H9(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 lP(n,e,t,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,d=!1;h&&!d;)if(h.nodeType==1){let u,f=h==a.body,p=1,g=1;if(f)u=oP(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(d=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let w=h.getBoundingClientRect();({scaleX:p,scaleY:g}=H9(h,w)),u={left:w.left,right:w.left+h.clientWidth*p,top:w.top,bottom:w.top+h.clientHeight*g}}let b=0,y=0;if(s=="nearest")e.top<u.top?(y=-(u.top-e.top+o),t>0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y<u.top&&(y=-(u.top+y-e.top+o)));else{let w=e.bottom-e.top,M=u.bottom-u.top;y=(s=="center"&&w<=M?e.top+w/2-M/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-M+o)-u.top}if(i=="nearest"?e.left<u.left?(b=-(u.left-e.left+r),t>0&&e.right>u.right+b&&(b=e.right-u.right+b+r)):e.right>u.right&&(b=e.right-u.right+r,t<0&&e.left<u.left+b&&(b=-(u.left+b-e.left+r))):b=(i=="center"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:i=="start"==l?e.left-r:e.right-(u.right-u.left)+r)-u.left,b||y)if(f)c.scrollBy(b,y);else{let w=0,M=0;if(y){let k=h.scrollTop;h.scrollTop+=y/g,M=(h.scrollTop-k)*g}if(b){let k=h.scrollLeft;h.scrollLeft+=b/p,w=(h.scrollLeft-k)*p}e={left:e.left-w,top:e.top-M,right:e.right-w,bottom:e.bottom-M},w&&Math.abs(w-b)<1&&(i="nearest"),M&&Math.abs(M-y)<1&&(s="nearest")}if(f)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function aP(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}}let hP=class{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?Cn(t):0),i,Math.min(e.focusOffset,i?Cn(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}},io=null;function N9(n){if(n.setActive)return n.setActive();if(io)return n.focus(io);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(io==null?{get preventScroll(){return io={preventScroll:!0},!0}}:void 0),!io){io=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let w4;function Rr(n,e,t=e){let i=w4||(w4=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function wo(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 r=new KeyboardEvent("keydown",s);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function cP(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function F9(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function dP(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,Cn(t));;)if(i){if(t.nodeType!=1)return!1;let s=t.childNodes[i-1];s.contentEditable=="false"?i--:(t=s,i=Cn(t))}else{if(t==n)return!0;i=Lr(t),t=t.parentNode}}function I9(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function W9(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=Cn(t)}else if(t.parentNode&&!Oc(t))i=Lr(t),t=t.parentNode;else return null}}function z9(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&&!Oc(t))i=Lr(t)+1,t=t.parentNode;else return null}}let Ri=class $f{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new $f(e.parentNode,Lr(e),t)}static after(e,t){return new $f(e.parentNode,Lr(e)+1,t)}};const Om=[];let at=class Kf{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,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=Kf.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=v4(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=v4(r)}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=Cn(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!Kf.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,h=i;a<this.children.length;a++){let d=this.children[a],u=c+d.length;if(c<e&&u>t)return d.domBoundsAround(e,t,c);if(u>=e&&s==-1&&(s=a,r=c),c>t&&d.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+d.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].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=Om){this.markDirty();for(let s=e;s<t;s++){let r=this.children[s];r.parent==this&&i.indexOf(r)<0&&r.destroy()}this.children.splice(e,t-e,...i);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 U9(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,r,o){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}};at.prototype.breakAfter=0;function v4(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}let U9=class{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 $9(n,e,t,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[e]:null,d=r.length?r[r.length-1]:null,u=d?d.breakAfter:o;if(!(e==i&&h&&!o&&!u&&r.length<2&&h.merge(t,s,r.length?d:null,t==0,l,a))){if(i<c.length){let f=c[i];f&&(s<f.length||f.breakAfter&&(d!=null&&d.breakAfter))?(e==i&&(f=f.split(s),s=0),!u&&d&&f.merge(0,s,d,!0,0,a)?r[r.length-1]=f:((s||f.children.length&&!f.children[0].length)&&f.merge(0,s,null,!1,0,a),r.push(f))):f!=null&&f.breakAfter&&(d?d.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,t>0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[e].become(r[0]))e++,r.shift(),l=r.length?0:a;else break;!r.length&&e&&i<c.length&&!c[e-1].breakAfter&&c[i].merge(0,0,c[e-1],!1,l,a)&&e--,(e<i||r.length)&&n.replaceChildren(e,i,r)}}function K9(n,e,t,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),d=e-t;for(let u of i)d+=u.length;n.length+=d,$9(n,c,h,l,a,i,0,s,r)}let Si=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Gf=typeof document<"u"?document:{documentElement:{style:{}}};const qf=/Edge\/(\d+)/.exec(Si.userAgent),G9=/MSIE \d/.test(Si.userAgent),Zf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Si.userAgent),Td=!!(G9||Zf||qf),k4=!Td&&/gecko\/(\d+)/i.test(Si.userAgent),lu=!Td&&/Chrome\/(\d+)/.exec(Si.userAgent),x4="webkitFontSmoothing"in Gf.documentElement.style,q9=!Td&&/Apple Computer/.test(Si.vendor),M4=q9&&(/Mobile\/\w+/.test(Si.userAgent)||Si.maxTouchPoints>2);var ie={mac:M4||/Mac/.test(Si.platform),windows:/Win/.test(Si.platform),linux:/Linux|X11/.test(Si.platform),ie:Td,ie_version:G9?Gf.documentMode||6:Zf?+Zf[1]:qf?+qf[1]:0,gecko:k4,gecko_version:k4?+(/Firefox\/(\d+)/.exec(Si.userAgent)||[0,0])[1]:0,chrome:!!lu,chrome_version:lu?+lu[1]:0,ios:M4,android:/Android\b/.test(Si.userAgent),webkit:x4,safari:q9,webkit_version:x4?+(/\bAppleWebKit\/(\d+)/.exec(Si.userAgent)||[0,0])[1]:0,tabSize:Gf.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const uP=256;let ar=class jf extends at{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 jf)||this.length-(t-e)+i.length>uP||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 jf(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 Ri(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 fP(this.dom,e,t)}},Fo=class Yf extends at{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(F9(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,r,o){return i&&(!(i instanceof Yf&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(K9(this,e,t,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>e&&t.push(i<e?l.split(e-i):l),s<0&&i>=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Yf(this.mark,t,o)}domAtPos(e){return j9(this,e)}coordsAt(e,t){return J9(this,e,t)}};function fP(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?ie.chrome||ie.gecko||(e?(s--,o=1):r<i&&(r++,o=-1)):t<0?s--:r<i&&r++;let l=Rr(n,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return ie.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?_m(a,o<0):a||null}let Z9=class Dl extends at{static create(e,t,i){return new Dl(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=Dl.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,r,o){return i&&(!(i instanceof Dl)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof Dl&&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 $.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):$.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Ri.before(this.dom):Ri.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(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top<r.bottom);l+=o?-1:1);return _m(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}},Jf=class Xf extends at{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Xf&&e.side==this.side}split(){return new Xf(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?Ri.before(this.dom):Ri.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return $.empty}get isHidden(){return!0}};ar.prototype.children=Z9.prototype.children=Jf.prototype.children=Om;function j9(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Ri(t,0)}function Y9(n,e,t){let i,{children:s}=n;t>0&&e instanceof Fo&&s.length&&(i=s[s.length-1])instanceof Fo&&i.mark.eq(e.mark)?Y9(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function J9(n,e,t){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let d=0,u=0;d<c.children.length&&u<=h;d++){let f=c.children[d],p=u+f.length;p>=h&&(f.children.length?l(f,h-u):(!r||r.isHidden&&t>0)&&(p>h||u==p&&f.getSide()>0)?(r=f,o=h-u):(u<h||u==p&&f.getSide()<0&&!f.isHidden)&&(i=f,s=h-u)),u=p}}l(n,e);let a=(t<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?s:o),t):pP(n)}function pP(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Va(e);return t[t.length-1]||null}function Qf(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 A4=Object.create(null);function Vc(n,e,t){if(n==e)return!0;n||(n=A4),e||(e=A4);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 r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function ep(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 gP(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}let ni=class Tl extends at{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof Tl))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),K9(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new Tl;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 r=i;r<this.children.length;r++)t.append(this.children[r],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){Vc(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Y9(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=Qf(t,this.attrs||{})),i&&(this.attrs=Qf({class:i},this.attrs||{}))}domAtPos(e){return j9(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(F9(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&&(ep(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&&at.get(s)instanceof Fo;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=at.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!ie.ios||!this.children.some(r=>r instanceof ar))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof ar)||/[^ -~]/.test(i.text))return null;let s=Va(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=J9(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight<r){let o=(r-s.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(e){return e instanceof Tl&&this.children.length==0&&e.children.length==0&&Vc(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 r=e.children[i],o=s+r.length;if(o>=t){if(r instanceof Tl)return r;if(o>t)break}s=o+r.breakAfter}return null}},pa=class W1 extends at{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,r,o){return i&&(!(i instanceof W1)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Ri.before(this.dom):Ri.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new W1(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return Om}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):$.empty}domBoundsAround(){return null}become(e){return e instanceof W1&&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){return this.widget.coordsAt(this.dom,e,t)}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}},dh=class{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 di=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(di||(di={}));let It=class extends Bt{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 Vm(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 Io(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:r,end:o}=tC(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new Io(e,i,s,t,e.widget||null,!0)}static line(e){return new Em(e)}static set(e,t=!1){return K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};It.none=K.empty;let Vm=class X9 extends It{constructor(e){let{start:t,end:i}=tC(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 X9&&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))&&Vc(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)}};Vm.prototype.point=!1;let Em=class Q9 extends It{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Q9&&this.spec.class==e.spec.class&&Vc(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)}};Em.prototype.mapMode=fe.TrackBefore;Em.prototype.point=!0;let Io=class eC extends It{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?fe.TrackBefore:fe.TrackAfter:fe.TrackDel}get type(){return this.startSide!=this.endSide?di.WidgetRange:this.startSide<=0?di.WidgetBefore:di.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof eC&&mP(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)}};Io.prototype.point=!0;function tC(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 mP(n,e){return n==e||!!(n&&e&&n.compare(e))}function tp(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)}let au=class iC{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 pa&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ni),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Mh(new Jf(-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 pa)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){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=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Mh(new ar(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,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof Io){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 l=t-e;if(i instanceof Io)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new pa(i.widget||Wo.block,l,i));else{let a=Z9.create(i.widget||Wo.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e<t||i.startSide>0),h=!a.isEditable&&(e<t||r>s.length||i.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(d.append(Mh(new Jf(1),s),r),r=s.length+Math.max(0,r-s.length)),d.append(Mh(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?e<t||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new iC(e,t,i,r);return o.openEnd=K.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function Mh(n,e){for(let t of e)n=new Fo(t,[n],n.length);return n}let Wo=class extends dh{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}};Wo.inline=new Wo("span");Wo.block=new Wo("div");var Rt=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Rt||(Rt={}));const Br=Rt.LTR,Pm=Rt.RTL;function sC(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const CP=sC("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),yP=sC("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),ip=Object.create(null),Vs=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);ip[e]=t,ip[t]=-e}function nC(n){return n<=247?CP[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?yP[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const bP=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;let $n=class{get dir(){return this.level%2?Pm:Br}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 r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}};function rC(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||!rC(i.inner,s.inner))return!1}return!0}const We=[];function SP(n,e,t,i,s){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:e,l=r<i.length?i[r].from:t,a=r?256:s;for(let c=o,h=a,d=a;c<l;c++){let u=nC(n.charCodeAt(c));u==512?u=h:u==8&&d==4&&(u=16),We[c]=u==4?2:u,u&7&&(d=u),h=u}for(let c=o,h=a,d=a;c<l;c++){let u=We[c];if(u==128)c<l-1&&h==We[c+1]&&h&24?u=We[c]=h:We[c]=256;else if(u==64){let f=c+1;for(;f<l&&We[f]==64;)f++;let p=c&&h==8||f<t&&We[f]==8?d==1?1:8:256;for(let g=c;g<f;g++)We[g]=p;c=f-1}else u==8&&d==1&&(We[c]=1);h=u,u&7&&(d=u)}}}function wP(n,e,t,i,s){let r=s==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,h=o<i.length?i[o].from:t;for(let d=c,u,f,p;d<h;d++)if(f=ip[u=n.charCodeAt(d)])if(f<0){for(let g=l-3;g>=0;g-=3)if(Vs[g+1]==-f){let b=Vs[g+2],y=b&2?s:b&4?b&1?r:s:0;y&&(We[d]=We[Vs[g]]=y),l=g;break}}else{if(Vs.length==189)break;Vs[l++]=d,Vs[l++]=u,Vs[l++]=a}else if((p=We[d])==2||p==1){let g=p==s;a=g?0:1;for(let b=l-3;b>=0;b-=3){let y=Vs[b+2];if(y&2)break;if(g)Vs[b+2]|=2;else{if(y&4)break;Vs[b+2]|=4}}}}}function vP(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=s<t.length?t[s].from:e;for(let a=o;a<l;){let c=We[a];if(c==256){let h=a+1;for(;;)if(h==l){if(s==t.length)break;h=t[s++].to,l=s<t.length?t[s].from:e}else if(We[h]==256)h++;else break;let d=r==1,u=(h<e?We[h]:i)==1,f=d==u?d?1:2:i;for(let p=h,g=s,b=g?t[g-1].to:n;p>a;)p==b&&(p=t[--g].from,b=g?t[g-1].to:n),We[--p]=f;a=h}else r=c,a++}}}function sp(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,c=0;a<t;){let h=!0,d=!1;if(c==r.length||a<r[c].from){let g=We[a];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c<r.length&&p==r[c].from){if(d)break e;let g=r[c];if(!h)for(let b=g.to,y=c+1;;){if(b==t)break e;if(y<r.length&&r[y].from==b)b=r[y++].to;else{if(We[b]==l)break e;break}}if(c++,u)u.push(g);else{g.from>a&&o.push(new $n(a,g.from,f));let b=g.direction==Br!=!(f%2);np(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(h?We[p]!=l:We[p]==l))break;p++}u?sp(n,a,p,i+1,s,u,o):a<p&&o.push(new $n(a,p,f)),a=p}else for(let a=t,c=r.length;a>e;){let h=!0,d=!1;if(!c||a>r[c-1].to){let g=We[a-1];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c&&p==r[c-1].to){if(d)break e;let g=r[--c];if(!h)for(let b=g.from,y=c;;){if(b==e)break e;if(y&&r[y-1].to==b)b=r[--y].from;else{if(We[b-1]==l)break e;break}}if(u)u.push(g);else{g.to<a&&o.push(new $n(g.to,a,f));let b=g.direction==Br!=!(f%2);np(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==e||(h?We[p-1]!=l:We[p-1]==l))break;p--}u?sp(n,p,a,i+1,s,u,o):p<a&&o.push(new $n(p,a,f)),a=p}}function np(n,e,t,i,s,r,o){let l=e%2?2:1;SP(n,s,r,i,l),wP(n,s,r,i,l),vP(s,r,i,l),sp(n,s,r,e,t,i,o)}function kP(n,e,t){if(!n)return[new $n(0,0,e==Pm?1:0)];if(e==Br&&!t.length&&!bP.test(n))return oC(n.length);if(t.length)for(;n.length>We.length;)We[We.length]=256;let i=[],s=e==Br?0:1;return np(n,s,s,t,0,n.length,i),i}function oC(n){return[new $n(0,n,0)]}let lC="";function xP(n,e,t,i,s){var r;let o=i.head-n.from,l=$n.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],c=a.side(s,t);if(o==c){let u=l+=s?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!s,t),c=a.side(s,t)}let h=de(n.text,o,a.forward(s,t));(h<a.from||h>a.to)&&(h=c),lC=n.text.slice(Math.min(o,h),Math.max(o,h));let d=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return d&&h==c&&d.level+(s?0:1)<a.level?T.cursor(d.side(!s,t)+n.from,d.forward(s,t)?1:-1,d.level):T.cursor(h+n.from,a.forward(s,t)?-1:1,a.level)}function MP(n,e,t){for(let i=e;i<t;i++){let s=nC(n.charCodeAt(i));if(s==1)return Br;if(s==2||s==4)return Pm}return Br}const aC=P.define(),hC=P.define(),cC=P.define(),dC=P.define(),rp=P.define(),uC=P.define(),fC=P.define(),pC=P.define({combine:n=>n.some(e=>e)}),gC=P.define({combine:n=>n.some(e=>e)}),mC=P.define();let hu=class op{constructor(e,t="nearest",i="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new op(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 op(T.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}};const Ah=ce.define({map:(n,e)=>n.map(e)}),CC=ce.define();function un(n,e,t){let i=n.facet(dC);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 _n=P.define({combine:n=>n.length?n[0]:!0});let AP=0;const _l=P.define();let hr=class lp{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new lp(AP++,e,i,s,l=>{let a=[_l.of(l)];return o&&a.push(Ea.of(c=>{let h=c.plugin(l);return h?o(h):It.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return lp.define(i=>new e(i),t)}},cu=class{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(un(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){un(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){un(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}};const yC=P.define(),Lm=P.define(),Ea=P.define(),bC=P.define(),Rm=P.define(),SC=P.define();function D4(n,e){let t=n.state.facet(SC);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(n):r),s=[];return K.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let c=r-e.from,h=o-e.from,d=s;for(let u=l.length-1;u>=0;u--,a--){let f=l[u].spec.bidiIsolate,p;if(f==null&&(f=MP(e.text,c,h)),a>0&&d.length&&(p=d[d.length-1]).to==c&&p.direction==f)p.to=h,d=p.inner;else{let g={from:c,to:h,direction:f,inner:[]};d.push(g),d=g.inner}}}}),s}const wC=P.define();function vC(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(wC)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const Ol=P.define();let Xn=class z1{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new z1(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,r=0,o=0,l=0;;s++){let a=s==e.length?null:e[s],c=o-l,h=a?a.fromB:1e9;for(;r<t.length&&t[r]<h;){let d=t[r],u=t[r+1],f=Math.max(l,d),p=Math.min(h,u);if(f<=p&&new z1(f+c,p+c,f,p).addToSet(i),u>h)break;r+=2}if(!a)return i;new z1(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}},T4=class kC{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Be.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Xn(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new kC(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}},_4=class extends at{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=It.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 ni],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Xn(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:c,toA:h})=>h<this.minWidthFrom||c>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:!PP(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?TP(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Xn(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(ie.ie||ie.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=VP(o,l,e.changes);return i=Xn.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),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 o=ie.chrome||ie.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof pa&&o.widget instanceof O4&&r.push(o.dom);s.updateGaps(r)}updateChildren(e,t,i){let s=i?i.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let o=s.length-1;;o--){let l=o>=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:d}=l,u,f,p,g;if(i&&i.range.fromB<d&&i.range.toB>h){let k=au.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),V=au.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);f=k.breakAtStart,p=k.openStart,g=V.openEnd;let R=this.compositionView(i);V.breakAtStart?R.breakAfter=1:V.content.length&&R.merge(R.length,R.length,V.content[0],!1,V.openStart,0)&&(R.breakAfter=V.content[0].breakAfter,V.content.shift()),k.content.length&&R.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(R).concat(V.content)}else({content:u,breakAtStart:f,openStart:p,openEnd:g}=au.build(this.view.state.doc,h,d,this.decorations,this.dynamicDecorationMap));let{i:b,off:y}=r.findPos(c,1),{i:w,off:M}=r.findPos(a,-1);$9(this,w,M,b,y,u,f,p,g)}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(CC)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new ar(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new Fo(s,[t],t.length);let i=new ni;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=at.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].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,r=!s&&I1(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(ie.gecko&&l.empty&&!this.hasComposition&&DP(a)){let d=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(d,a.node.childNodes[a.offset]||null)),a=c=new Ri(d,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!fa(a.node,a.offset,h.anchorNode,h.anchorOffset)||!fa(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{ie.android&&ie.chrome&&this.dom.contains(h.focusNode)&&EP(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=Oa(this.view.root);if(d)if(l.empty){if(ie.gecko){let u=_P(a.node,a.offset);if(u&&u!=3){let f=(u==1?W9:z9)(a.node,a.offset);f&&(a=new Ri(f.node,f.offset))}}d.collapse(a.node,a.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(a.node,a.offset);try{d.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Ri(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Ri(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&fa(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=Oa(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=ni.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=t.from&&i.collapse(s,r)}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 r=at.get(t.childNodes[s]);r instanceof ni&&(i=r.domAtPos(0))}for(let s=e.offset-1;!i&&s>=0;s--){let r=at.get(t.childNodes[s]);r instanceof ni&&(i=r.domAtPos(r.length))}return i?new Ri(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=at.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 ni)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,s=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(a<e)break;if(c<=e&&(c<e||l.covers(-1))&&(a>e||l.covers(1))&&(!i||l instanceof ni&&!(i instanceof ni&&t>=0)))i=l,s=c;else if(i&&c==e&&a==e&&l instanceof pa&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}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 ni))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof ar))return null;let r=de(s.text,i);if(r==i)return null;let o=Rr(s.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Rt.LTR;for(let c=0,h=0;h<this.children.length;h++){let d=this.children[h],u=c+d.length;if(u>s)break;if(c>=i){let f=d.dom.getBoundingClientRect();if(t.push(f.height),o){let p=d.dom.lastChild,g=p?Va(p):[];if(g.length){let b=g[g.length-1],y=a?b.right-f.left:f.right-b.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+d.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Rt.RTL:Rt.LTR}measureTextSize(){for(let r of this.children)if(r instanceof ni){let o=r.measureTextSize();if(o)return o}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 r=Va(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.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 U9(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(It.replace({widget:new O4(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return It.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Ea).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(bC).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(K.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 c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(mC))try{if(c(this.view,e.range,e))return!0}catch(h){un(this.view.state,h,"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 r=vC(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;lP(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Rt.LTR)}};function DP(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")}let O4=class extends dh{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}};function xC(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=W9(t.focusNode,t.focusOffset),s=z9(t.focusNode,t.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=at.get(s.node);if(!l||l instanceof ar&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=at.get(i.node);!a||a instanceof ar&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function TP(n,e,t){let i=xC(n,t);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc,c=new Xn(a.mapPos(r),a.mapPos(o),r,o),h=[];for(let d=s.parentNode;;d=d.parentNode){let u=at.get(d);if(u instanceof Fo)h.push({node:d,deco:u.mark});else{if(u instanceof ni||d.nodeName=="DIV"&&d.parentNode==n.contentDOM)return{range:c,text:s,marks:h,line:d};if(d!=n.contentDOM)h.push({node:d,deco:new Vm({inclusive:!0,attributes:gP(d),tagName:d.tagName.toLowerCase()})});else return null}}}function _P(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 OP=class{constructor(){this.changes=[]}compareRange(e,t){tp(e,t,this.changes)}comparePoint(e,t){tp(e,t,this.changes)}};function VP(n,e,t){let i=new OP;return K.compare(n,e,t,i),i.changes}function EP(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 PP(n,e){let t=!1;return e&&n.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(t=!0)}),t}function LP(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return T.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=de(s.text,r,!1):l=de(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=de(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=de(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return T.range(o+s.from,l+s.from)}function RP(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function BP(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function du(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function V4(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function E4(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function ap(n,e,t){let i,s,r,o,l=!1,a,c,h,d;for(let p=n.firstChild;p;p=p.nextSibling){let g=Va(p);for(let b=0;b<g.length;b++){let y=g[b];s&&du(s,y)&&(y=V4(E4(y,s.bottom),s.top));let w=RP(e,y),M=BP(t,y);if(w==0&&M==0)return p.nodeType==3?P4(p,e,t):ap(p,e,t);if(!i||o>M||o==M&&r>w){i=p,s=y,r=w,o=M;let k=M?t<y.top?-1:1:w?e<y.left?-1:1:0;l=!k||(k>0?b<g.length-1:b>0)}w==0?t>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):t<y.top&&(!d||d.top>y.top)&&(c=p,d=y):h&&du(h,y)?h=E4(h,y.bottom):d&&du(d,y)&&(d=V4(d,y.top))}}if(h&&h.bottom>=t?(i=a,s=h):d&&d.top<=t&&(i=c,s=d),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return P4(i,u,t);if(l&&i.contentEditable!="false")return ap(i,u,t);let f=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:f}}function P4(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=Rr(n,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let d=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&d<r){let u=e>=(h.left+h.right)/2,f=u;if((ie.chrome||ie.gecko)&&Rr(n,l).getBoundingClientRect().left==h.right&&(f=!u),d<=0)return{node:n,offset:l+(f?1:0)};s=l+(f?1:0),r=d}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function MC(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:d}=e,u=d-l;if(u<0)return 0;if(u>c)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,V=!1;a=n.elementAtHeight(u),a.type!=di.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(V)return t?null:0;V=!0,i=-i}d=l+u;let f=a.from;if(f<n.viewport.from)return n.viewport.from==0?0:t?null:L4(n,o,a,h,d);if(f>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:L4(n,o,a,h,d);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,b=g.elementFromPoint(h,d);b&&!n.contentDOM.contains(b)&&(b=null),b||(h=Math.max(o.left+1,Math.min(o.right-1,h)),b=g.elementFromPoint(h,d),b&&!n.contentDOM.contains(b)&&(b=null));let y,w=-1;if(b&&((s=n.docView.nearest(b))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,d);k&&({offsetNode:y,offset:w}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,d);k&&({startContainer:y,startOffset:w}=k,(!n.contentDOM.contains(y)||ie.safari&&HP(y,w,h)||ie.chrome&&NP(y,w,h))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let k=ni.find(n.docView,f);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:w}=ap(k.dom,h,d))}let M=n.docView.nearest(y);if(!M)return null;if(M.isWidget&&((r=M.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=M.dom.getBoundingClientRect();return e.y<k.top||e.y<=k.bottom&&e.x<=(k.left+k.right)/2?M.posAtStart:M.posAtEnd}else return M.localPosFromDOM(y,w)+M.posAtStart}function L4(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+lr(o,r,n.state.tabSize)}function HP(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 Rr(n,i-1,i).getBoundingClientRect().left>t}function NP(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Rr(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function hp(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==di.Text))return i}return t}function FP(n,e,t,i){let s=hp(n,e.head),r=!i||s.type!=di.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==Rt.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return T.cursor(a,t?-1:1)}return T.cursor(t?s.to:s.from,t?-1:1)}function R4(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let c=xP(s,r,o,l,t),h=lC;if(!c){if(s.number==(t?n.state.doc.lines:1))return l;h=` `,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),c=n.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function IP(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==He.Space&&(s=o),s==o}}function WP(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return T.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,e.assoc||-1),h=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let f=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-f.from))),l=(r<0?f.top:f.bottom)+h}let d=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let f=0;;f+=10){let p=l+(u+f)*r,g=MC(n,{x:d,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let b=n.docView.coordsForChar(g),y=!b||p<b.top?-1:1;return T.cursor(g,y,void 0,o)}}}function U1(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function uu(n,e,t){let i=U1(n.state.facet(Rm).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:T.cursor(i,i<t.from?1:-1)}let zP=class{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,ie.safari&&e.contentDOM.addEventListener("input",()=>null),ie.gecko&&nL(e.contentDOM.ownerDocument)}handleEvent(e){!YP(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=UP(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,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&&DC.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ie.android&&ie.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return ie.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=AC.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||$P.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,wo(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:ie.safari&&!ie.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 B4(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){un(t.state,s)}}}function UP(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 r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(B4(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(B4(i.value,o))}}for(let i in ws)t(i).handlers.push(ws[i]);for(let i in es)t(i).observers.push(es[i]);return e}const AC=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$P="dthko",DC=[16,17,18,20,91,92,224,225],Dh=6;function Th(n){return Math.max(0,n)*.7+8}function KP(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}let GP=class{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=aP(e.contentDOM),this.atoms=e.state.facet(Rm).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ae.allowMultipleSelections)&&qP(e,t),this.dragging=jP(e,t)&&OC(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&&KP(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=vC(this.view);e.clientX-a.left<=s+Dh?t=-Th(s-e.clientX):e.clientX+a.right>=o-Dh&&(t=Th(e.clientX-o)),e.clientY-a.top<=r+Dh?i=-Th(r-e.clientY):e.clientY+a.bottom>=l-Dh&&(i=Th(e.clientY-l)),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],r=null;if(s.empty){let o=U1(this.atoms,s.from,0);o!=s.from&&(r=T.cursor(o,-1))}else{let o=U1(this.atoms,s.from,-1),l=U1(this.atoms,s.to,1);(o!=s.from||l!=s.to)&&(r=T.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?T.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 qP(n,e){let t=n.state.facet(aC);return t.length?t[0](e):ie.mac?e.metaKey:e.ctrlKey}function ZP(n,e){let t=n.state.facet(hC);return t.length?t[0](e):ie.mac?!e.altKey:!e.ctrlKey}function jP(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Oa(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function YP(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=at.get(t))&&i.ignoreEvent(e))return!1;return!0}const ws=Object.create(null),es=Object.create(null),TC=ie.ie&&ie.ie_version<15||ie.ios&&ie.webkit_version<604;function JP(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(),_C(n,t.value)},50)}function _C(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(cp!=null&&t.selection.ranges.every(a=>a.empty)&&cp==r.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let d=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:d},range:T.cursor(c.from+d.length)}})}else o?i=t.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:T.cursor(a.from+c.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}es.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};ws.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);es.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};es.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};ws.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(cC))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=eL(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new GP(n,e,t,i)),i&&n.observer.ignore(()=>{N9(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function H4(n,e,t,i){if(i==1)return T.cursor(e,t);if(i==2)return LP(n.state,e,t);{let s=ni.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,T.range(o,l)}}let N4=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function XP(n,e,t,i){let s=ni.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&N4(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&N4(t,i,l)?1:o&&o.bottom>=i?-1:1}function F4(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:XP(n,t,e.clientX,e.clientY)}}const QP=ie.ie&&ie.ie_version<=11;let I4=null,W4=0,z4=0;function OC(n){if(!QP)return n.detail;let e=I4,t=z4;return I4=n,z4=Date.now(),W4=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(W4+1)%3:1}function eL(n,e){let t=F4(n,e),i=OC(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=F4(n,r),c,h=H4(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let d=H4(n,t.pos,t.bias,i),u=Math.min(d.from,h.from),f=Math.max(d.to,h.to);h=u<h.from?T.range(u,f):T.range(f,u)}return o?s.replaceRange(s.main.extend(h.from,h.to)):l&&i==1&&s.ranges.length>1&&(c=tL(s,a.pos))?c:l?s.addRange(h):T.create([h])}}}function tL(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 T.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}ws.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 r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=T.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};ws.dragend=n=>(n.inputState.draggedContent=null,!1);function U4(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&ZP(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}ws.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,r=()=>{++s==t.length&&U4(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return U4(n,e,i,!0),!0}return!1};ws.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=TC?null:e.clipboardData;return t?(_C(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(JP(n),!1)};function iL(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 sL(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:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let cp=null;ws.copy=ws.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=sL(n.state);if(!t&&!s)return!1;cp=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=TC?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(iL(n,t),!1)};const VC=gi.define();function EC(n,e){let t=[];for(let i of n.facet(fC)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:VC.of(!0)}):null}function PC(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=EC(n.state,e);t?n.dispatch(t):n.update([])}},10)}es.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),PC(n)};es.blur=n=>{n.observer.clearSelectionRange(),PC(n)};es.compositionstart=es.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};es.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,ie.chrome&&ie.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};es.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};ws.beforeinput=(n,e)=>{var t;let i;if(ie.chrome&&ie.android&&(i=AC.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return ie.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),ie.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>es.compositionend(n,e),20),!1};const $4=new Set;function nL(n){$4.has(n)||($4.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const K4=["pre-wrap","normal","pre-line","break-spaces"];let rL=class{constructor(e){this.lineWrapping=e,this.doc=$.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}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 K4.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,r,o){let l=K4.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}},oL=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},On=class LC{constructor(e,t,i,s,r){this.from=e,this.length=t,this.top=i,this.height=s,this._content=r}get type(){return typeof this._content=="number"?di.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 Io?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 LC(this.from,this.length+e.length,this.top,this.height+e.height,t)}};var it=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(it||(it={}));const $1=.001;let gs=class K1{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,t){this.height!=t&&(Math.abs(this.height-t)>$1&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return K1.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:d}=s[l],u=r.lineAt(a,it.ByPosNoHeight,i.setDoc(t),0,0),f=u.to>=c?u:r.lineAt(c,it.ByPosNoHeight,i,0,0);for(d+=f.to-c,c=f.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,it.ByPosNoHeight,i,0,0));h+=u.from-a,a=u.from;let p=hL.build(i.setDoc(o),e,h,d);r=r.replace(a,c,p)}return r.updateHeight(i,0)}static empty(){return new Is(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,s=0,r=0;for(;;)if(t==i)if(s>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[t++];l&&(s+=l.size)}else{let l=e[--i];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new lL(K1.of(e.slice(0,t)),o,K1.of(e.slice(i)))}};gs.prototype.size=1;let RC=class extends gs{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,s){return new On(s,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,s,r){return this.blockAt(0,i,s,r)}forEachLine(e,t,i,s,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},Is=class dp extends RC{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new On(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof dp||s instanceof vo&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof vo?s=new dp(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):gs.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,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:""})`}},vo=class hs extends gs{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let c=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=t.doc.lineAt(c),d=l+h.length*a,u=Math.max(i,e-d/2);return new On(h.from,h.length,u,d,0)}else{let c=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:h,length:d}=t.doc.line(r+c);return new On(h,d,i+l*c,l,0)}}lineAt(e,t,i,s,r){if(t==it.ByHeight)return this.blockAt(e,i,s,r);if(t==it.ByPosNoHeight){let{from:f,to:p}=i.doc.lineAt(e);return new On(f,p-f,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),c=i.doc.lineAt(e),h=l+c.length*a,d=c.number-o,u=s+l*d+a*(c.from-r-d);return new On(c.from,c.length,Math.max(s,Math.min(u,s+this.height-h)),h,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,r);for(let h=e,d=s;h<=t;){let u=i.doc.lineAt(h);if(h==e){let p=u.number-l;d+=a*p+c*(e-r-p)}let f=a+c*u.length;o(new On(u.from,u.length,d,f,0)),d+=f,h=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof hs?i[i.length-1]=new hs(r.length+s):i.push(null,new hs(s-1))}if(e>0){let r=i[0];r instanceof hs?i[0]=new hs(e+r.length):i.unshift(new hs(e-1),null)}return gs.of(i)}decomposeLeft(e,t){t.push(new hs(e-1),null)}decomposeRight(e,t){t.push(null,new hs(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new hs(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let d=s.heights[s.index++];a==-1?a=d:Math.abs(d-a)>=$1&&(a=-2);let u=new Is(h,d);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new hs(r-l).updateHeight(e,l));let c=gs.of(o);return(a<0||Math.abs(c.height-this.height)>=$1||Math.abs(a-this.heightMetrics(e,t).perLine)>=$1)&&(e.heightChanged=!0),c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},lL=class extends gs{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 r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,s):this.right.blockAt(e,t,r,s+this.left.length+this.break)}lineAt(e,t,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=t==it.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,i,s,r):this.right.lineAt(e,t,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=t==it.ByPosNoHeight?it.ByPosNoHeight:it.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,s,r).join(c)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,s,r,o),t>=a&&this.right.forEachLine(e,t,i,l,a,o);else{let c=this.lineAt(a,it.ByPos,i,s,r);e<c.from&&this.left.forEachLine(e,c.from-1,i,s,r,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,l,a,o)}}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 r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&G4(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),G4(r,l)}return gs.of(r)}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?gs.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function G4(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof vo&&(i=n[e+1])instanceof vo&&n.splice(e-1,3,new vo(t.length+1+i.length))}const aL=5;let hL=class BC{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 Is?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Is(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,r=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new RC(o,s,i)):(o||r||s>=aL)&&this.addLineDeco(s,r,o)}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 Is(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new vo(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 Is)return e;let t=new Is(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 Is)&&!this.isCovered?this.nodes.push(new Is(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 Is&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,t,i,s){let r=new BC(i,e);return K.spans(t,i,s,r,0),r.finish(i)}};function cL(n,e,t){let i=new dL;return K.compare(n,e,t,i,0),i.changes}let dL=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,s){(e<t||i&&i.heightRelevant||s&&s.heightRelevant)&&tp(e,t,this.changes,5)}};function uL(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,r=Math.max(0,t.left),o=Math.min(s.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(s.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=i.body;)if(c.nodeType==1){let h=c,d=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=c==n.parentNode?u.bottom:Math.min(a,u.bottom)}c=d.position=="absolute"||d.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function fL(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}let fu=class{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],r=t[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e,t){return It.replace({widget:new pL(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},pL=class extends dh{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}},q4=class{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=Z4,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Rt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Lm).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new rL(t),this.stateDeco=e.facet(Ea).filter(i=>typeof i!="function"),this.heightMap=gs.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle.setDoc(e.doc),[new Xn(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=It.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:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new _h(r,o))}}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?Z4:new CL(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(Vl(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ea).filter(h=>typeof h!="function");let s=e.changedRanges,r=Xn.extendWithRanges(s,cL(i,this.stateDeco,e?e.changes:Be.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(gC)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Rt.RTL:Rt.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:V}=H9(t,l);(k>.005&&Math.abs(this.scaleX-k)>.005||V>.005&&Math.abs(this.scaleY-V)>.005)&&(this.scaleX=k,this.scaleY=V,c|=8,o=a=!0)}let d=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=u)&&(this.paddingTop=d,this.paddingBottom=u,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=I9(e.scrollDOM);let p=(this.printing?fL:uL)(t,this.paddingTop),g=p.top-this.pixelViewport.top,b=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(k)&&(o=!0),o||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:V,charWidth:R,textHeight:H}=e.docView.measureTextSize();o=V>0&&s.refresh(r,V,R,H,w/R,k),o&&(e.docView.minWidth=0,c|=8)}g>0&&b>0?h=Math.max(g,b):g<0&&b<0&&(h=Math.min(g,b)),s.heightChanged=!1;for(let V of this.viewports){let R=V.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(V);this.heightMap=(o?gs.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle,[new Xn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new oL(V.from,R))}s.heightChanged&&(c|=2)}let M=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||M)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}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,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new _h(s.lineAt(o-i*1e3,it.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,it.ByHeight,r,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=s.lineAt(c,it.ByPos,r,0,0),u;t.y=="center"?u=(d.top+d.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c<a.from?u=d.top:u=d.bottom-h,a=new _h(s.lineAt(u-1e3/2,it.ByHeight,r,0,0).from,s.lineAt(u+h+1e3/2,it.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new _h(this.heightMap.lineAt(i,it.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,it.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,it.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,it.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r<l+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 fu(t.mapPos(s.from),t.mapPos(s.to),s.size));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=Rt.LTR&&!i)return[];let l=[],a=(h,d,u,f)=>{if(d-h<r)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let y of g)if(y>h&&y<d){a(h,y-10,u,f),a(y+10,d,u,f);return}let b=mL(e,y=>y.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)<r&&Math.abs(y.to-d)<r&&!g.some(w=>y.from<w&&y.to>w));if(!b){if(d<u.to&&t&&i&&t.visibleRanges.some(y=>y.from<=d&&y.to>=d)){let y=t.moveToLineBoundary(T.cursor(d),!1,!0).head;y>h&&(d=y)}b=new fu(h,d,this.gapSize(u,h,d,f))}l.push(b)},c=h=>{if(h.length<o||h.type!=di.Text)return;let d=gL(h.from,h.to,this.stateDeco);if(d.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,f,p;if(i){let g=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,y;if(u!=null){let w=Vh(d,u),M=((this.visibleBottom-this.visibleTop)/2+g)/h.height;b=w-M,y=w+M}else b=(this.visibleTop-h.top-g)/h.height,y=(this.visibleBottom-h.top+g)/h.height;f=Oh(d,b),p=Oh(d,y)}else{let g=d.total*this.heightOracle.charWidth,b=s*this.heightOracle.charWidth,y,w;if(u!=null){let M=Vh(d,u),k=((this.pixelViewport.right-this.pixelViewport.left)/2+b)/g;y=M-k,w=M+k}else y=(this.pixelViewport.left-b)/g,w=(this.pixelViewport.right+b)/g;f=Oh(d,y),p=Oh(d,w)}f>h.from&&a(h.from,f,h,d),p<h.to&&a(p,h.to,h,d)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(e,t,i,s){let r=Vh(s,i)-Vh(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){fu.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=It.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];K.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Vl(this.heightMap.lineAt(e,it.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)||Vl(this.heightMap.lineAt(this.scaler.fromDOM(e),it.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 Vl(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}},_h=class{constructor(e,t){this.from=e,this.to=t}};function gL(n,e,t){let i=[],s=n,r=0;return K.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(i.push({from:s,to:e}),r+=e-s),{total:r,ranges:i}}function Oh({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:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Vh(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 mL(n,e){for(let t of n)if(e(t))return t}const Z4={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};let CL=class HC{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=t.lineAt(l,it.ByPos,e,0,0).top,h=t.lineAt(a,it.ByPos,e,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return s+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,s=r.domBottom}}fromDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,s=r.domBottom}}eq(e){return e instanceof HC?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 Vl(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new On(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(s=>Vl(s,e)):n._content)}const Eh=P.define({combine:n=>n.join(" ")}),up=P.define({combine:n=>n.indexOf(!0)>-1}),fp=we.newName(),NC=we.newName(),FC=we.newName(),IC={"&light":"."+NC,"&dark":"."+FC};function pp(n,e,t){return new we(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 yL=pp("."+fp,{"&":{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},".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:"#444"},".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},"&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:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".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"}},IC),El="";let bL=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ae.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=El}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=at.get(s),a=at.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:Oc(s))||Oc(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}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 r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=at.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+(SL(e,i.node,i.offset)?t:0))}};function SL(n,e,t){for(;;){if(!e||t<Cn(e))return!1;if(e==n)return!0;t=Lr(e)+1,e=e.parentNode}}let j4=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},wL=class{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:xL(e),a=new bL(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=ML(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Uf(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Uf(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((ie.ios||ie.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.to<e.state.doc.length)){let d=Math.min(a,c),u=Math.max(a,c),f=h.from-d,p=h.to-u;(f==0||f==1||d==0)&&(p==0||p==-1||u==e.state.doc.length)&&(a=0,c=e.state.doc.length)}this.newSel=T.single(c,a)}}};function WC(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,c=null;(r===8||ie.android&&e.text.length<l-o)&&(a=s.to,c="end");let h=kL(n.state.doc.sliceString(o,l,El),e.text,a-o,c);h&&(ie.chrome&&r==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==El+El&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:$.of(e.text.slice(h.from,h.toB).split(El))})}else i&&(!n.hasFocus&&n.state.facet(_n)||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))}:(ie.mac||ie.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=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}):ie.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` `&&n.lineWrapping&&(i&&(i=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}),t)return zC(n,t,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function zC(n,e,t,i=-1){if(ie.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(ie.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&&wo(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)&&wo(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&wo(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=vL(n,e,t));return n.state.facet(uC).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function vL(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.from<e.from?s.sliceDoc(r.from,e.from):"",a=r.to>e.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let c=n.state.sliceDoc(e.from,e.to),h,d=t&&xC(n,t.main.head);if(d){let p=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-e.to,f=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,b=g-c.length;if(p.to-p.from!=f||n.state.sliceDoc(b,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:b,to:g,insert:e.insert}),w=p.to-r.to;return{changes:y,range:a?T.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function kL(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function xL(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new j4(t,i)),(s!=t||r!=i)&&e.push(new j4(s,r))),e}function ML(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?T.single(t+e,i+e):null}const AL={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},pu=ie.ie&&ie.ie_version<=11;let DL=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new hP,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);(ie.ie&&ie.ie_version<=11||ie.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&&!(ie.chrome&&ie.chrome_version<126)&&(this.editContext=new _L(e),e.state.facet(_n)&&(e.contentDOM.editContext=this.editContext.editContext)),pu&&(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.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(_n)?i.root.activeElement!=this.dom:!I1(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(ie.ie&&ie.ie_version<=11||ie.android&&ie.chrome)&&!i.state.selection.main.empty&&s.focusNode&&fa(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Oa(e.root);if(!t)return!1;let i=ie.safari&&e.root.nodeType==11&&rP(this.dom.ownerDocument)==this.dom&&TL(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let s=I1(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&dP(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,AL),pu&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),pu&&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 r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&wo(this.dom,r.key,r.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 r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&I1(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 r=new wL(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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=WC(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=Y4(t,e.previousSibling||e.target.previousSibling,-1),s=Y4(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("change",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("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(_n)!=e.state.facet(_n)&&(e.view.contentDOM.editContext=e.state.facet(_n)?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 Y4(n,e,t){for(;e;){let i=at.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 J4(n,e){let t=e.startContainer,i=e.startOffset,s=e.endContainer,r=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return fa(o.node,o.offset,s,r)&&([t,i,s,r]=[s,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}}function TL(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return J4(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?J4(n,t):null}let _L=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(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,r={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:$.of(i.text.split(` `))};r.from==this.from&&s<this.from?r.from=s:r.to==this.to&&s>this.to&&(r.to=s),!(r.from==r.to&&!r.insert.length)&&(this.pendingContextChange=r,e.state.readOnly||zC(e,r,T.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(It.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}e.dispatch({effects:CC.of(It.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=Oa(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((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(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)}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){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},Pe=class gp{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={}){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:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||cP(e.parent)||document,this.viewState=new q4(e.state||ae.create(e)),e.scrollTo&&e.scrollTo.is(Ah)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(_l).map(i=>new cu(i));for(let i of this.plugins)i.update(this);this.observer=new DL(this),this.inputState=new zP(this),this.inputState.ensureHandlers(this.plugins),this.docView=new _4(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof pt?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,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(VC))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=EC(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(ae.phrases)!=this.state.facet(ae.phrases))return this.setState(r);s=T4.create(this,r,e),s.flags|=l;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(d&&(d=d.map(u.changes)),u.scrollIntoView){let{main:f}=u.state.selection;d=new hu(f.empty?f:T.cursor(f.head,f.head>f.anchor?-1:1))}for(let f of u.effects)f.is(Ah)&&(d=f.value.clip(this.state))}this.viewState.update(s,d),this.bidiCache=Q4.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Ol)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Eh)!=s.state.facet(Eh)&&(this.viewState.mustMeasureContent=!0),(t||i||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(rp))try{u(s)}catch(f){un(this.state,f,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!WC(this,h)&&c.force&&wo(this.contentDOM,c.key,c.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 q4(e),this.plugins=e.facet(_l).map(i=>new cu(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new _4(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(_l),i=e.state.facet(_l);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new cu(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.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){un(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:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(I9(i))r=-1,o=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(s);r=f.from,o=f.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(f=>{try{return f.read(this)}catch(p){return un(this.state,p),X4}}),d=T4.create(this,this.state,[]),u=!1;d.flags|=a,t?t.flags|=a:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),u=this.docView.update(d),u&&this.docViewUpdate());for(let f=0;f<c.length;f++)if(h[f]!=X4)try{let p=c[f];p.write&&p.write(h[f],this)}catch(p){un(this.state,p)}if(u&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(rp))l(t)}get themeClasses(){return fp+" "+(this.state.facet(up)?FC:NC)+" "+this.state.facet(Eh)}updateAttrs(){let e=e5(this,yC,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(_n)?"true":"false",class:"cm-content",style:`${ie.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),e5(this,Lm,t);let i=this.observer.ignore(()=>{let s=ep(this.contentDOM,this.contentAttrs,t),r=ep(this.dom,this.editorAttrs,e);return s||r});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(gp.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Ol);let e=this.state.facet(gp.cspNonce);we.mount(this.root,this.styleModules.concat(yL).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 uu(this,e,R4(this,e,t,i))}moveByGroup(e,t){return uu(this,e,R4(this,e,t,i=>IP(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return T.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return FP(this,e,t,i)}moveVertically(e,t,i){return uu(this,e,WP(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(),MC(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),r=this.bidiSpans(s),o=r[$n.find(r,e-s.from,-1,t)];return _m(i,o.dir==Rt.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(pC)||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>OL)return oC(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||rC(r.isolates,i=D4(this,e))))return r.order;i||(i=D4(this,e));let s=kP(e.text,t,i);return this.bidiCache.push(new Q4(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ie.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{N9(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 Ah.of(new hu(typeof e=="number"?T.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 Ah.of(new hu(T.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 hr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return hr.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=we.newName(),s=[Eh.of(i),Ol.of(pp(`.${i}`,e))];return t&&t.dark&&s.push(up.of(!0)),s}static baseTheme(e){return Vi.lowest(Ol.of(pp("."+fp,e,IC)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&at.get(i)||at.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}};Pe.styleModule=Ol;Pe.inputHandler=uC;Pe.scrollHandler=mC;Pe.focusChangeEffect=fC;Pe.perLineTextDirection=pC;Pe.exceptionSink=dC;Pe.updateListener=rp;Pe.editable=_n;Pe.mouseSelectionStyle=cC;Pe.dragMovesSelection=hC;Pe.clickAddsSelectionRange=aC;Pe.decorations=Ea;Pe.outerDecorations=bC;Pe.atomicRanges=Rm;Pe.bidiIsolatedRanges=SC;Pe.scrollMargins=wC;Pe.darkTheme=up;Pe.cspNonce=P.define({combine:n=>n.length?n[0]:""});Pe.contentAttributes=Lm;Pe.editorAttributes=yC;Pe.lineWrapping=Pe.contentAttributes.of({class:"cm-lineWrapping"});Pe.announce=ce.define();const OL=4096,X4={};let Q4=class UC{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:Rt.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!t.touchesRange(o.from,o.to)&&i.push(new UC(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function e5(n,e,t){for(let i=n.state.facet(e),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&Qf(o,t)}return t}const VL=ie.mac?"mac":ie.windows?"win":ie.linux?"linux":"key";function EL(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;a<t.length-1;++a){const c=t[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))s=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return s&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function Ph(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 PL=Vi.default(Pe.domEventHandlers({keydown(n,e){return HL(LL(e.state),n,e,"editor")}})),$C=P.define({enables:PL}),t5=new WeakMap;function LL(n){let e=n.facet($C),t=t5.get(e);return t||t5.set(e,t=BL(e.reduce((i,s)=>i.concat(s),[]))),t}let Vn=null;const RL=4e3;function BL(n,e=VL){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c,h)=>{var d,u;let f=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>EL(y,e));for(let y=1;y<p.length;y++){let w=p.slice(0,y).join(" ");s(w,!0),f[w]||(f[w]={preventDefault:!0,stopPropagation:!1,run:[M=>{let k=Vn={view:M,prefix:w,scope:o};return setTimeout(()=>{Vn==k&&(Vn=null)},RL),!0}]})}let g=p.join(" ");s(g,!1);let b=f[g]||(f[g]={preventDefault:!1,stopPropagation:!1,run:((u=(d=f._any)===null||d===void 0?void 0:d.run)===null||u===void 0?void 0:u.slice())||[]});a&&b.run.push(a),c&&(b.preventDefault=!0),h&&(b.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=t[c]||(t[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=o;for(let u in h)h[u].run.push(f=>d(f,mp))}let a=o[e]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let mp=null;function HL(n,e,t,i){mp=e;let s=Tm(e),r=Pt(s,0),o=Di(r)==s.length&&s!=" ",l="",a=!1,c=!1,h=!1;Vn&&Vn.view==t&&Vn.scope==i&&(l=Vn.prefix+" ",DC.indexOf(e.keyCode)<0&&(c=!0,Vn=null));let d=new Set,u=b=>{if(b){for(let y of b.run)if(!d.has(y)&&(d.add(y),y(t)))return b.stopPropagation&&(h=!0),!0;b.preventDefault&&(b.stopPropagation&&(h=!0),c=!0)}return!1},f=n[i],p,g;return f&&(u(f[l+Ph(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ie.windows&&e.ctrlKey&&e.altKey)&&(p=nn[e.keyCode])&&p!=s?(u(f[l+Ph(p,e,!0)])||e.shiftKey&&(g=Pr[e.keyCode])!=s&&g!=p&&u(f[l+Ph(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(f[l+Ph(s,e,!0)])&&(a=!0),!a&&u(f._any)&&(a=!0)),c&&(a=!0),a&&h&&e.stopPropagation(),mp=null,a}class uh{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}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 r=KC(e);return[new uh(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return NL(e,t,i)}}function KC(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Rt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function i5(n,e,t,i){let s=n.coordsAtPos(e,t*2);if(!s)return i;let r=n.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=n.posAtCoords({x:r.left+1,y:o}),a=n.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function NL(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),r=n.textDirection==Rt.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=KC(n),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),d=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=l.right-(h?parseInt(h.paddingRight):0),f=hp(n,i),p=hp(n,s),g=f.type==di.Text?f:null,b=p.type==di.Text?p:null;if(g&&(n.lineWrapping||f.widgetLineBreaks)&&(g=i5(n,i,1,g)),b&&(n.lineWrapping||p.widgetLineBreaks)&&(b=i5(n,s,-1,b)),g&&b&&g.from==b.from&&g.to==b.to)return w(M(t.from,t.to,g));{let V=g?M(t.from,null,g):k(f,!1),R=b?M(null,t.to,b):k(p,!0),H=[];return(g||f).to<(b||p).from-(g&&b?1:0)||f.widgetLineBreaks>1&&V.bottom+n.defaultLineHeight/2<R.top?H.push(y(d,V.bottom,u,R.top)):V.bottom<R.top&&n.elementAtHeight((V.bottom+R.top)/2).type==di.Text&&(V.bottom=R.top=(V.bottom+R.top)/2),w(V).concat(H).concat(w(R))}function y(V,R,H,W){return new uh(e,V-a.left,R-a.top-.01,H-V,W-R+.01)}function w({top:V,bottom:R,horizontal:H}){let W=[];for(let G=0;G<H.length;G+=2)W.push(y(H[G],V,H[G+1],R));return W}function M(V,R,H){let W=1e9,G=-1e9,z=[];function q(pe,Ee,_t,mt,F){let U=n.coordsAtPos(pe,pe==H.to?-2:2),N=n.coordsAtPos(_t,_t==H.from?2:-2);!U||!N||(W=Math.min(U.top,N.top,W),G=Math.max(U.bottom,N.bottom,G),F==Rt.LTR?z.push(r&&Ee?d:U.left,r&&mt?u:N.right):z.push(!r&&mt?d:N.left,!r&&Ee?u:U.right))}let ee=V??H.from,he=R??H.to;for(let pe of n.visibleRanges)if(pe.to>ee&&pe.from<he)for(let Ee=Math.max(pe.from,ee),_t=Math.min(pe.to,he);;){let mt=n.state.doc.lineAt(Ee);for(let F of n.bidiSpans(mt)){let U=F.from+mt.from,N=F.to+mt.from;if(U>=_t)break;N>Ee&&q(Math.max(U,Ee),V==null&&U<=ee,Math.min(N,_t),R==null&&N>=he,F.dir)}if(Ee=mt.to+1,Ee>=_t)break}return z.length==0&&q(ee,V==null,he,R==null,n.textDirection),{top:W,bottom:G,horizontal:z}}function k(V,R){let H=l.top+(R?V.top:V.bottom);return{top:H,bottom:H,horizontal:[]}}}function FL(n,e){return n.constructor==e.constructor&&n.eq(e)}class IL{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(G1)!=e.state.facet(G1)&&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(G1);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)=>!FL(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 G1=P.define();function GC(n){return[hr.define(e=>new IL(e,n)),G1.of(n)]}const qC=!ie.ios,Pa=P.define({combine(n){return on(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function WL(n={}){return[Pa.of(n),zL,UL,$L,gC.of(!0)]}function ZC(n){return n.startState.facet(Pa)!=n.state.facet(Pa)}const zL=GC({above:!0,markers(n){let{state:e}=n,t=e.facet(Pa),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||qC:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:T.cursor(s.head,s.head>s.anchor?-1:1);for(let a of uh.forRange(n,o,l))i.push(a)}}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=ZC(n);return t&&s5(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){s5(e.state,n)},class:"cm-cursorLayer"});function s5(n,e){e.style.animationDuration=n.facet(Pa).cursorBlinkRate+"ms"}const UL=GC({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:uh.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||ZC(n)},class:"cm-selectionLayer"}),Cp={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};qC&&(Cp[".cm-line"].caretColor=Cp[".cm-content"].caretColor="transparent !important");const $L=Vi.highest(Pe.theme(Cp)),jC=ce.define({map(n,e){return n==null?null:e.mapPos(n)}}),Pl=qt.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(jC)?i.value:t,n)}}),KL=hr.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(Pl);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(Pl)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(Pl),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(Pl)!=n&&this.view.dispatch({effects:jC.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 GL(){return[Pl,KL]}function n5(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function qL(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:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class ZL{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=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=(l,a,c,h)=>s(h,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,h)=>{let d=i(l,a,c);d&&h(c,c+l[0].length,d)};else if(i)this.addMatch=(l,a,c,h)=>h(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new or,i=t.add.bind(t);for(let{from:s,to:r}of qL(e,this.maxLength))n5(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l<e.view.viewport.to&&(i=Math.min(l,i),s=Math.max(a,s))}),e.viewportChanged||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 r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),c=a.to<l?e.state.doc.lineAt(l):a,h=Math.max(r.from,a.from),d=Math.min(r.to,c.to);if(this.boundary){for(;o>a.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;l<c.to;l++)if(this.boundary.test(c.text[l-c.from])){d=l;break}}let u=[],f,p=(g,b,y)=>u.push(y.range(g,b));if(a==c)for(this.regexp.lastIndex=h-a.from;(f=this.regexp.exec(a.text))&&f.index<d-a.from;)this.addMatch(f,e,f.index+a.from,p);else n5(e.state.doc,this.regexp,h,d,(g,b)=>this.addMatch(b,e,g,p));t=t.update({filterFrom:h,filterTo:d,filter:(g,b)=>g<h||b>d,add:u})}}return t}}const yp=/x/.unicode!=null?"gu":"g",jL=new RegExp(`[\0-\b --\u2028\u2029\uFEFF-]`,yp),YL={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 gu=null;function JL(){var n;if(gu==null&&typeof document<"u"&&document.body){let e=document.body.style;gu=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return gu||!1}const q1=P.define({combine(n){let e=on(n,{render:null,specialChars:jL,addSpecialChars:null});return(e.replaceTabs=!JL())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,yp)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,yp)),e}});function XL(n={}){return[q1.of(n),QL()]}let r5=null;function QL(){return r5||(r5=hr.fromClass(class{constructor(n){this.view=n,this.decorations=It.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(q1)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new ZL({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=Pt(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=gl(o.text,l,i-o.from);return It.replace({widget:new sR((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=It.replace({widget:new iR(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(q1);n.startState.facet(q1)!=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 eR="•";function tR(n){return n>=32?eR:n==10?"":String.fromCharCode(9216+n)}class iR extends dh{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=tR(this.code),i=e.state.phrase("Control character")+" "+(YL[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class sR extends dh{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 nR(){return oR}const rR=It.line({class:"cm-activeLine"}),oR=hr.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(rR.range(s.from)),e=s.from)}return It.set(t)}},{decorations:n=>n.decorations}),bp=2e3;function lR(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>bp||t.off>bp||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let c=n.doc.line(a);c.length<=l&&r.push(T.range(c.from+o,c.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let c=n.doc.line(a),h=lr(c.text,o,n.tabSize,!0);if(h<0)r.push(T.cursor(c.to));else{let d=lr(c.text,l,n.tabSize);r.push(T.range(c.from+h,c.from+d))}}}return r}function aR(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function o5(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>bp?-1:s==i.length?aR(n,e.clientX):gl(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function hR(n,e){let t=o5(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=o5(n,s);if(!l)return i;let a=lR(n.state,t,l);return a.length?o?T.create(a.concat(i.ranges)):T.create(a):i}}:null}function cR(n){let e=t=>t.altKey&&t.button==0;return Pe.mouseSelectionStyle.of((t,i)=>e(i)?hR(t,i):null)}const dR={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},uR={style:"cursor: crosshair"};function fR(n={}){let[e,t]=dR[n.key||"Alt"],i=hr.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,Pe.contentAttributes.of(s=>{var r;return!((r=s.plugin(i))===null||r===void 0)&&r.isDown?uR:null})]}let cr=class extends Bt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};cr.prototype.elementClass="";cr.prototype.toDOM=void 0;cr.prototype.mapMode=fe.TrackBefore;cr.prototype.startSide=cr.prototype.endSide=-1;cr.prototype.point=!0;const Z1=P.define(),j1=P.define(),l5=P.define({combine:n=>n.some(e=>e)});function pR(n){return[gR]}const gR=hr.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(j1).map(e=>new h5(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(l5),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(l5)!=!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=K.iter(this.view.state.facet(Z1),this.view.viewport.from),i=[],s=this.gutters.map(r=>new mR(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==di.Text&&o){Sp(t,i,l.from);for(let a of s)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==di.Text){Sp(t,i,r.from);for(let o of s)o.line(this.view,r,i)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(j1),t=n.state.facet(j1),i=n.docChanged||n.heightChanged||n.viewportChanged||!K.eq(n.startState.facet(Z1),n.state.facet(Z1),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 r of t){let o=e.indexOf(r);o<0?s.push(new h5(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>Pe.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Rt.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function a5(n){return Array.isArray(n)?n:[n]}function Sp(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}let mR=class{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=K.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new YC(e,o,r,i);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];Sp(this.cursor,s,t.from),i.length&&(s=s.concat(i));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t);i&&this.addElement(e,t,[i])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},h5=class{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 r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,s)&&s.preventDefault()});this.markers=a5(t.markers(e)),t.initialSpacer&&(this.spacer=new YC(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=a5(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!K.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()}},YC=class{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":""),CR(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=r<t.length?t[r++]:null,c=!1;if(a){let h=a.elementClass;h&&(i+=" "+h);for(let d=o;d<this.markers.length;d++)if(this.markers[d].compare(a)){l=d,c=!0;break}}else l=this.markers.length;for(;o<l;){let h=this.markers[o++];if(h.toDOM){h.destroy(s);let d=s.nextSibling;s.remove(),s=d}}if(!a)break;a.toDOM&&(c?s=s.nextSibling:this.dom.insertBefore(a.toDOM(e),s)),c&&o++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}};function CR(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 yR=P.define(),go=P.define({combine(n){return on(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let s in t){let r=i[s],o=t[s];i[s]=r?(l,a,c)=>r(l,a,c)||o(l,a,c):o}return i}})}});class mu extends cr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Cu(n,e){return n.state.facet(go).formatNumber(e,n.state)}const bR=j1.compute([go],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(yR)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new mu(Cu(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(go)!=e.state.facet(go),initialSpacer(e){return new mu(Cu(e,c5(e.state.doc.lines)))},updateSpacer(e,t){let i=Cu(t.view,c5(t.view.state.doc.lines));return i==e.number?e:new mu(i)},domEventHandlers:n.facet(go).domEventHandlers}));function SR(n={}){return[go.of(n),pR(),bR]}function c5(n){let e=9;for(;e<n;)e=e*10+9;return e}const wR=new class extends cr{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},vR=Z1.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(wR.range(s)))}return K.of(e)});function kR(){return vR}const JC=1024;let xR=0;class yu{constructor(e,t){this.from=e,this.to=t}}class Se{constructor(e={}){this.id=xR++,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=Oi.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}Se.closedBy=new Se({deserialize:n=>n.split(" ")});Se.openedBy=new Se({deserialize:n=>n.split(" ")});Se.group=new Se({deserialize:n=>n.split(" ")});Se.isolate=new Se({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});Se.contextHash=new Se({perNode:!0});Se.lookAhead=new Se({perNode:!0});Se.mounted=new Se({perNode:!0});class Ec{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[Se.mounted.id]}}const MR=Object.create(null);class Oi{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):MR,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new Oi(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[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(Se.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(Se.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}Oi.none=new Oi("",Object.create(null),0,8);class Bm{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let s=null;for(let r of e){let o=r(i);o&&(s||(s=Object.assign({},i.props)),s[o[0].id]=o[1])}t.push(s?new Oi(i.name,s,i.id,i.flags):i)}return new Bm(t)}}const Lh=new WeakMap,d5=new WeakMap;var Ht;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(Ht||(Ht={}));class At{constructor(e,t,i,s,r){if(this.type=e,this.children=t,this.positions=i,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=Ec.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 vp(this.topNode,e)}cursorAt(e,t=0,i=0){let s=Lh.get(this)||this.topNode,r=new vp(s);return r.moveTo(e,t),Lh.set(this,r._tree),r}get topNode(){return new Yi(this,0,0,null)}resolve(e,t=0){let i=La(Lh.get(this)||this.topNode,e,t,!1);return Lh.set(this,i),i}resolveInner(e,t=0){let i=La(d5.get(this)||this.topNode,e,t,!0);return d5.set(this,i),i}resolveStack(e,t=0){return TR(this,e,t)}iterate(e){let{enter:t,leave:i,from:s=0,to:r=this.length}=e,o=e.mode||0,l=(o&Ht.IncludeAnonymous)>0;for(let a=this.cursor(o|Ht.IncludeAnonymous);;){let c=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!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:Fm(Oi.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new At(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new At(Oi.none,t,i,s)))}static build(e){return _R(e)}}At.empty=new At(Oi.none,[],[],0);class Hm{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 Hm(this.buffer,this.index)}}class dr{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Oi.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],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),e+=4,i==e)return r;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,i,s,r){let{buffer:o}=this,l=-1;for(let a=e;a!=t&&!(XC(r,s,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l<t;){r[a++]=s[l++],r[a++]=s[l++]-i;let c=r[a++]=s[l++]-i;r[a++]=s[l++]-e,o=Math.max(o,c)}return new dr(r,o,this.set)}}function XC(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 La(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 o=!i&&n instanceof Yi&&n.index<0?null:n.parent;if(!o)return n;n=o}let r=i?0:Ht.IgnoreOverlays;if(i)for(let o=n,l=o.parent;l;o=l,l=o.parent)o instanceof Yi&&o.index<0&&((s=l.enter(e,t,r))===null||s===void 0?void 0:s.from)!=o.from&&(n=l);for(;;){let o=n.enter(e,t,r);if(!o)return n;n=o}}class QC{cursor(e=0){return new vp(this,e)}getChild(e,t=null,i=null){let s=u5(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return u5(this,e,t,i)}resolve(e,t=0){return La(this,e,t,!1)}resolveInner(e,t=0){return La(this,e,t,!0)}matchContext(e){return wp(this,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}}class Yi extends QC{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,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=t>0?l.length:-1;e!=c;e+=t){let h=l[e],d=a[e]+o.from;if(XC(s,i,d,d+h.length)){if(h instanceof dr){if(r&Ht.ExcludeBuffers)continue;let u=h.findChild(0,h.buffer.length,t,i-d,s);if(u>-1)return new Kn(new AR(o,h,e,d),null,u)}else if(r&Ht.IncludeAnonymous||!h.type.isAnonymous||Nm(h)){let u;if(!(r&Ht.IgnoreMounts)&&(u=Ec.get(h))&&!u.overlay)return new Yi(u.tree,d,e,o);let f=new Yi(h,d,e,o);return r&Ht.IncludeAnonymous||!f.type.isAnonymous?f:f.nextChild(t<0?h.children.length-1:0,t,i,s)}}}if(r&Ht.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))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&Ht.IgnoreOverlays)&&(s=Ec.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o<r)&&(t<0?l>=r:l>r))return new Yi(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 u5(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=s.type.is(t),!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function wp(n,e,t=e.length-1){for(let i=n.parent;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 AR{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class Kn extends QC{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,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Kn(this.context,this,r)}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&Ht.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Kn(this.context,this,r)}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 Kn(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 Kn(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,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new At(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ey(n){if(!n.length)return null;let e=0,t=n[0];for(let r=1;r<n.length;r++){let o=n[r];(o.from>t.from||o.to<t.to)&&(t=o,e=r)}let i=t instanceof Yi&&t.index<0?null:t.parent,s=n.slice();return i?s[e]=i:s.splice(e,1),new DR(s,t)}class DR{constructor(e,t){this.heads=e,this.node=t}get next(){return ey(this.heads)}}function TR(n,e,t){let i=n.resolveInner(e,t),s=null;for(let r=i instanceof Yi?i:i.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(s||(s=[i])).push(o.resolve(e,t)),r=o}else{let o=Ec.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new Yi(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[i])).push(La(l,e,t,!1))}}return s?ey(s):i}class vp{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 Yi)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 Yi?(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,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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&Ht.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ht.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ht.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 r=0;r<this.index;r++)if(s.buffer.buffer[r+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 r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&Ht.IncludeAnonymous||l instanceof dr||!l.type.isAnonymous||Nm(l))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,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s<this.stack.length;s++)t=new Kn(this.buffer,t,this.stack[s]);return this.bufferNode=new Kn(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(;s&&t&&t(this),s=this.type.isAnonymous,!this.nextSibling();){if(!i)return;this.parent(),i--,s=!0}}}matchContext(e){if(!this.buffer)return wp(this.node,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let s=e.length-1,r=this.stack.length-1;s>=0;r--){if(r<0)return wp(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function Nm(n){return n.children.some(e=>e instanceof dr||!e.type.isAnonymous||Nm(e))}function _R(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=JC,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Hm(t,t.length):t,a=i.types,c=0,h=0;function d(V,R,H,W,G,z){let{id:q,start:ee,end:he,size:pe}=l,Ee=h;for(;pe<0;)if(l.next(),pe==-1){let N=r[q];H.push(N),W.push(ee-V);return}else if(pe==-3){c=q;return}else if(pe==-4){h=q;return}else throw new RangeError(`Unrecognized record size: ${pe}`);let _t=a[q],mt,F,U=ee-V;if(he-ee<=s&&(F=b(l.pos-R,G))){let N=new Uint16Array(F.size-F.skip),I=l.pos-F.size,X=N.length;for(;l.pos>I;)X=y(F.start,N,X);mt=new dr(N,he-F.start,i),U=F.start-V}else{let N=l.pos-pe;l.next();let I=[],X=[],ne=q>=o?q:-1,Me=0,Q=he;for(;l.pos>N;)ne>=0&&l.id==ne&&l.size>=0?(l.end<=Q-s&&(p(I,X,ee,Me,l.end,Q,ne,Ee),Me=I.length,Q=l.end),l.next()):z>2500?u(ee,N,I,X):d(ee,N,I,X,ne,z+1);if(ne>=0&&Me>0&&Me<I.length&&p(I,X,ee,Me,ee,Q,ne,Ee),I.reverse(),X.reverse(),ne>-1&&Me>0){let ye=f(_t);mt=Fm(_t,I,X,0,I.length,0,he-ee,ye,ye)}else mt=g(_t,I,X,he-ee,Ee-he)}H.push(mt),W.push(U)}function u(V,R,H,W){let G=[],z=0,q=-1;for(;l.pos>R;){let{id:ee,start:he,end:pe,size:Ee}=l;if(Ee>4)l.next();else{if(q>-1&&he<q)break;q<0&&(q=pe-s),G.push(ee,he,pe),z++,l.next()}}if(z){let ee=new Uint16Array(z*4),he=G[G.length-2];for(let pe=G.length-3,Ee=0;pe>=0;pe-=3)ee[Ee++]=G[pe],ee[Ee++]=G[pe+1]-he,ee[Ee++]=G[pe+2]-he,ee[Ee++]=Ee;H.push(new dr(ee,G[2]-he,i)),W.push(he-V)}}function f(V){return(R,H,W)=>{let G=0,z=R.length-1,q,ee;if(z>=0&&(q=R[z])instanceof At){if(!z&&q.type==V&&q.length==W)return q;(ee=q.prop(Se.lookAhead))&&(G=H[z]+q.length+ee)}return g(V,R,H,W,G)}}function p(V,R,H,W,G,z,q,ee){let he=[],pe=[];for(;V.length>W;)he.push(V.pop()),pe.push(R.pop()+H-G);V.push(g(i.types[q],he,pe,z-G,ee-z)),R.push(G-H)}function g(V,R,H,W,G=0,z){if(c){let q=[Se.contextHash,c];z=z?[q].concat(z):[q]}if(G>25){let q=[Se.lookAhead,G];z=z?[q].concat(z):[q]}return new At(V,R,H,W,z)}function b(V,R){let H=l.fork(),W=0,G=0,z=0,q=H.end-s,ee={size:0,start:0,skip:0};e:for(let he=H.pos-V;H.pos>he;){let pe=H.size;if(H.id==R&&pe>=0){ee.size=W,ee.start=G,ee.skip=z,z+=4,W+=4,H.next();continue}let Ee=H.pos-pe;if(pe<0||Ee<he||H.start<q)break;let _t=H.id>=o?4:0,mt=H.start;for(H.next();H.pos>Ee;){if(H.size<0)if(H.size==-3)_t+=4;else break e;else H.id>=o&&(_t+=4);H.next()}G=mt,W+=pe,z+=_t}return(R<0||W==V)&&(ee.size=W,ee.start=G,ee.skip=z),ee.size>4?ee:void 0}function y(V,R,H){let{id:W,start:G,end:z,size:q}=l;if(l.next(),q>=0&&W<o){let ee=H;if(q>4){let he=l.pos-(q-4);for(;l.pos>he;)H=y(V,R,H)}R[--H]=ee,R[--H]=z-V,R[--H]=G-V,R[--H]=W}else q==-3?c=W:q==-4&&(h=W);return H}let w=[],M=[];for(;l.pos>0;)d(n.start||0,n.bufferStart||0,w,M,-1,0);let k=(e=n.length)!==null&&e!==void 0?e:w.length?M[0]+w[0].length:0;return new At(a[n.topID],w.reverse(),M.reverse(),k)}const f5=new WeakMap;function Y1(n,e){if(!n.isAnonymous||e instanceof dr||e.type!=n)return 1;let t=f5.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof At)){t=1;break}t+=Y1(n,i)}f5.set(e,t)}return t}function Fm(n,e,t,i,s,r,o,l,a){let c=0;for(let p=i;p<s;p++)c+=Y1(n,e[p]);let h=Math.ceil(c*1.5/8),d=[],u=[];function f(p,g,b,y,w){for(let M=b;M<y;){let k=M,V=g[M],R=Y1(n,p[M]);for(M++;M<y;M++){let H=Y1(n,p[M]);if(R+H>=h)break;R+=H}if(M==k+1){if(R>h){let H=p[k];f(H.children,H.positions,0,H.children.length,g[k]+w);continue}d.push(p[k])}else{let H=g[M-1]+p[M-1].length-V;d.push(Fm(n,p,g,k,M,V,H,null,a))}u.push(V+w-r)}}return f(e,t,i,s,0),(l||a)(d,u,o)}class Vr{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?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 Vr(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let h=l<t.length?t[l]:null,d=h?h.fromA:1e9;if(d-a>=i)for(;o&&o.from<d;){let u=o;if(a>=u.from||d<=u.to||c){let f=Math.max(u.from,a)-c,p=Math.min(u.to,d)-c;u=f>=p?null:new Vr(f,p,u.tree,u.offset+c,l>0,!!h)}if(u&&s.push(u),o.to>d)break;o=r<e.length?e[r++]:null}if(!h)break;a=h.toA,c=h.toA-h.toB}return s}}class ty{startParse(e,t,i){return typeof e=="string"&&(e=new OR(e)),i=i?i.length?i.map(s=>new yu(s.from,s.to)):[new yu(0,0)]:[new yu(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class OR{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 Se({perNode:!0});function Ra(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function kp(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function VR(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function J1(n,e){if(!e.anchorNode)return!1;try{return kp(n,e.anchorNode)}catch{return!1}}function Ba(n){return n.nodeType==3?Nr(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function ga(n,e,t,i){return t?p5(n,e,t,i,-1)||p5(n,e,t,i,1):!1}function Hr(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Pc(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function p5(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:yn(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Hr(n)+(s<0?0:1),n=r}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?yn(n):0}else return!1}}function yn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Im(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function ER(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 iy(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 PR(n,e,t,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,d=!1;h&&!d;)if(h.nodeType==1){let u,f=h==a.body,p=1,g=1;if(f)u=ER(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(d=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let w=h.getBoundingClientRect();({scaleX:p,scaleY:g}=iy(h,w)),u={left:w.left,right:w.left+h.clientWidth*p,top:w.top,bottom:w.top+h.clientHeight*g}}let b=0,y=0;if(s=="nearest")e.top<u.top?(y=-(u.top-e.top+o),t>0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y<u.top&&(y=-(u.top+y-e.top+o)));else{let w=e.bottom-e.top,M=u.bottom-u.top;y=(s=="center"&&w<=M?e.top+w/2-M/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-M+o)-u.top}if(i=="nearest"?e.left<u.left?(b=-(u.left-e.left+r),t>0&&e.right>u.right+b&&(b=e.right-u.right+b+r)):e.right>u.right&&(b=e.right-u.right+r,t<0&&e.left<u.left+b&&(b=-(u.left+b-e.left+r))):b=(i=="center"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:i=="start"==l?e.left-r:e.right-(u.right-u.left)+r)-u.left,b||y)if(f)c.scrollBy(b,y);else{let w=0,M=0;if(y){let k=h.scrollTop;h.scrollTop+=y/g,M=(h.scrollTop-k)*g}if(b){let k=h.scrollLeft;h.scrollLeft+=b/p,w=(h.scrollLeft-k)*p}e={left:e.left-w,top:e.top-M,right:e.right-w,bottom:e.bottom-M},w&&Math.abs(w-b)<1&&(i="nearest"),M&&Math.abs(M-y)<1&&(s="nearest")}if(f)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function LR(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}}let RR=class{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?yn(t):0),i,Math.min(e.focusOffset,i?yn(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}},so=null;function sy(n){if(n.setActive)return n.setActive();if(so)return n.focus(so);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(so==null?{get preventScroll(){return so={preventScroll:!0},!0}}:void 0),!so){so=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let g5;function Nr(n,e,t=e){let i=g5||(g5=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function ko(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 r=new KeyboardEvent("keydown",s);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function BR(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function ny(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function HR(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,yn(t));;)if(i){if(t.nodeType!=1)return!1;let s=t.childNodes[i-1];s.contentEditable=="false"?i--:(t=s,i=yn(t))}else{if(t==n)return!0;i=Hr(t),t=t.parentNode}}function ry(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function oy(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=yn(t)}else if(t.parentNode&&!Pc(t))i=Hr(t),t=t.parentNode;else return null}}function ly(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&&!Pc(t))i=Hr(t)+1,t=t.parentNode;else return null}}let Bi=class xp{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new xp(e.parentNode,Hr(e),t)}static after(e,t){return new xp(e.parentNode,Hr(e)+1,t)}};const Wm=[];let ht=class Mp{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,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=Mp.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=m5(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=m5(r)}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=yn(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!Mp.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,h=i;a<this.children.length;a++){let d=this.children[a],u=c+d.length;if(c<e&&u>t)return d.domBoundsAround(e,t,c);if(u>=e&&s==-1&&(s=a,r=c),c>t&&d.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+d.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].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=Wm){this.markDirty();for(let s=e;s<t;s++){let r=this.children[s];r.parent==this&&i.indexOf(r)<0&&r.destroy()}this.children.splice(e,t-e,...i);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 ay(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,r,o){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}};ht.prototype.breakAfter=0;function m5(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}let ay=class{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 hy(n,e,t,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[e]:null,d=r.length?r[r.length-1]:null,u=d?d.breakAfter:o;if(!(e==i&&h&&!o&&!u&&r.length<2&&h.merge(t,s,r.length?d:null,t==0,l,a))){if(i<c.length){let f=c[i];f&&(s<f.length||f.breakAfter&&(d!=null&&d.breakAfter))?(e==i&&(f=f.split(s),s=0),!u&&d&&f.merge(0,s,d,!0,0,a)?r[r.length-1]=f:((s||f.children.length&&!f.children[0].length)&&f.merge(0,s,null,!1,0,a),r.push(f))):f!=null&&f.breakAfter&&(d?d.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,t>0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[e].become(r[0]))e++,r.shift(),l=r.length?0:a;else break;!r.length&&e&&i<c.length&&!c[e-1].breakAfter&&c[i].merge(0,0,c[e-1],!1,l,a)&&e--,(e<i||r.length)&&n.replaceChildren(e,i,r)}}function cy(n,e,t,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),d=e-t;for(let u of i)d+=u.length;n.length+=d,hy(n,c,h,l,a,i,0,s,r)}let wi=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ap=typeof document<"u"?document:{documentElement:{style:{}}};const Dp=/Edge\/(\d+)/.exec(wi.userAgent),dy=/MSIE \d/.test(wi.userAgent),Tp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wi.userAgent),_d=!!(dy||Tp||Dp),C5=!_d&&/gecko\/(\d+)/i.test(wi.userAgent),bu=!_d&&/Chrome\/(\d+)/.exec(wi.userAgent),y5="webkitFontSmoothing"in Ap.documentElement.style,uy=!_d&&/Apple Computer/.test(wi.vendor),b5=uy&&(/Mobile\/\w+/.test(wi.userAgent)||wi.maxTouchPoints>2);var oe={mac:b5||/Mac/.test(wi.platform),windows:/Win/.test(wi.platform),linux:/Linux|X11/.test(wi.platform),ie:_d,ie_version:dy?Ap.documentMode||6:Tp?+Tp[1]:Dp?+Dp[1]:0,gecko:C5,gecko_version:C5?+(/Firefox\/(\d+)/.exec(wi.userAgent)||[0,0])[1]:0,chrome:!!bu,chrome_version:bu?+bu[1]:0,ios:b5,android:/Android\b/.test(wi.userAgent),webkit:y5,safari:uy,webkit_version:y5?+(/\bAppleWebKit\/(\d+)/.exec(wi.userAgent)||[0,0])[1]:0,tabSize:Ap.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const NR=256;let ur=class _p extends ht{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 _p)||this.length-(t-e)+i.length>NR||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 _p(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 Bi(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 FR(this.dom,e,t)}},zo=class Op extends ht{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(ny(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,r,o){return i&&(!(i instanceof Op&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(cy(this,e,t,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>e&&t.push(i<e?l.split(e-i):l),s<0&&i>=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Op(this.mark,t,o)}domAtPos(e){return py(this,e)}coordsAt(e,t){return my(this,e,t)}};function FR(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?oe.chrome||oe.gecko||(e?(s--,o=1):r<i&&(r++,o=-1)):t<0?s--:r<i&&r++;let l=Nr(n,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return oe.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?Im(a,o<0):a||null}let fy=class Ll extends ht{static create(e,t,i){return new Ll(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=Ll.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,r,o){return i&&(!(i instanceof Ll)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof Ll&&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 $.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):$.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Bi.before(this.dom):Bi.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(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top<r.bottom);l+=o?-1:1);return Im(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}},Vp=class Ep extends ht{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Ep&&e.side==this.side}split(){return new Ep(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?Bi.before(this.dom):Bi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return $.empty}get isHidden(){return!0}};ur.prototype.children=fy.prototype.children=Vp.prototype.children=Wm;function py(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Bi(t,0)}function gy(n,e,t){let i,{children:s}=n;t>0&&e instanceof zo&&s.length&&(i=s[s.length-1])instanceof zo&&i.mark.eq(e.mark)?gy(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function my(n,e,t){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let d=0,u=0;d<c.children.length&&u<=h;d++){let f=c.children[d],p=u+f.length;p>=h&&(f.children.length?l(f,h-u):(!r||r.isHidden&&t>0)&&(p>h||u==p&&f.getSide()>0)?(r=f,o=h-u):(u<h||u==p&&f.getSide()<0&&!f.isHidden)&&(i=f,s=h-u)),u=p}}l(n,e);let a=(t<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?s:o),t):IR(n)}function IR(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Ba(e);return t[t.length-1]||null}function Pp(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 S5=Object.create(null);function Lc(n,e,t){if(n==e)return!0;n||(n=S5),e||(e=S5);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 r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function Lp(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 WR(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}let ri=class Rl extends ht{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof Rl))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),cy(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new Rl;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 r=i;r<this.children.length;r++)t.append(this.children[r],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){Lc(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){gy(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=Pp(t,this.attrs||{})),i&&(this.attrs=Pp({class:i},this.attrs||{}))}domAtPos(e){return py(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(ny(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&&(Lp(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&&ht.get(s)instanceof zo;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=ht.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!oe.ios||!this.children.some(r=>r instanceof ur))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof ur)||/[^ -~]/.test(i.text))return null;let s=Ba(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=my(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight<r){let o=(r-s.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(e){return e instanceof Rl&&this.children.length==0&&e.children.length==0&&Lc(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 r=e.children[i],o=s+r.length;if(o>=t){if(r instanceof Rl)return r;if(o>t)break}s=o+r.breakAfter}return null}},ma=class X1 extends ht{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,r,o){return i&&(!(i instanceof X1)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Bi.before(this.dom):Bi.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new X1(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return Wm}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):$.empty}domBoundsAround(){return null}become(e){return e instanceof X1&&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){return this.widget.coordsAt(this.dom,e,t)}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}},fh=class{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 Ji=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Ji||(Ji={}));let et=class extends Bt{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 zm(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 Uo(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:r,end:o}=Sy(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new Uo(e,i,s,t,e.widget||null,!0)}static line(e){return new Um(e)}static set(e,t=!1){return K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};et.none=K.empty;let zm=class Cy extends et{constructor(e){let{start:t,end:i}=Sy(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 Cy&&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))&&Lc(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)}};zm.prototype.point=!1;let Um=class yy extends et{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof yy&&this.spec.class==e.spec.class&&Lc(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)}};Um.prototype.mapMode=fe.TrackBefore;Um.prototype.point=!0;let Uo=class by extends et{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?fe.TrackBefore:fe.TrackAfter:fe.TrackDel}get type(){return this.startSide!=this.endSide?Ji.WidgetRange:this.startSide<=0?Ji.WidgetBefore:Ji.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof by&&zR(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)}};Uo.prototype.point=!0;function Sy(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 zR(n,e){return n==e||!!(n&&e&&n.compare(e))}function Rp(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)}let Su=class wy{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 ma&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ri),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Rh(new Vp(-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 ma)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){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=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Rh(new ur(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,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof Uo){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 l=t-e;if(i instanceof Uo)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ma(i.widget||$o.block,l,i));else{let a=fy.create(i.widget||$o.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e<t||i.startSide>0),h=!a.isEditable&&(e<t||r>s.length||i.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(d.append(Rh(new Vp(1),s),r),r=s.length+Math.max(0,r-s.length)),d.append(Rh(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?e<t||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new wy(e,t,i,r);return o.openEnd=K.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function Rh(n,e){for(let t of e)n=new zo(t,[n],n.length);return n}let $o=class extends fh{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}};$o.inline=new $o("span");$o.block=new $o("div");var Nt=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Nt||(Nt={}));const Fr=Nt.LTR,$m=Nt.RTL;function vy(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const UR=vy("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),$R=vy("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Bp=Object.create(null),Es=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Bp[e]=t,Bp[t]=-e}function ky(n){return n<=247?UR[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?$R[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const KR=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;let Gn=class{get dir(){return this.level%2?$m:Fr}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 r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}};function xy(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||!xy(i.inner,s.inner))return!1}return!0}const ze=[];function GR(n,e,t,i,s){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:e,l=r<i.length?i[r].from:t,a=r?256:s;for(let c=o,h=a,d=a;c<l;c++){let u=ky(n.charCodeAt(c));u==512?u=h:u==8&&d==4&&(u=16),ze[c]=u==4?2:u,u&7&&(d=u),h=u}for(let c=o,h=a,d=a;c<l;c++){let u=ze[c];if(u==128)c<l-1&&h==ze[c+1]&&h&24?u=ze[c]=h:ze[c]=256;else if(u==64){let f=c+1;for(;f<l&&ze[f]==64;)f++;let p=c&&h==8||f<t&&ze[f]==8?d==1?1:8:256;for(let g=c;g<f;g++)ze[g]=p;c=f-1}else u==8&&d==1&&(ze[c]=1);h=u,u&7&&(d=u)}}}function qR(n,e,t,i,s){let r=s==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,h=o<i.length?i[o].from:t;for(let d=c,u,f,p;d<h;d++)if(f=Bp[u=n.charCodeAt(d)])if(f<0){for(let g=l-3;g>=0;g-=3)if(Es[g+1]==-f){let b=Es[g+2],y=b&2?s:b&4?b&1?r:s:0;y&&(ze[d]=ze[Es[g]]=y),l=g;break}}else{if(Es.length==189)break;Es[l++]=d,Es[l++]=u,Es[l++]=a}else if((p=ze[d])==2||p==1){let g=p==s;a=g?0:1;for(let b=l-3;b>=0;b-=3){let y=Es[b+2];if(y&2)break;if(g)Es[b+2]|=2;else{if(y&4)break;Es[b+2]|=4}}}}}function ZR(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=s<t.length?t[s].from:e;for(let a=o;a<l;){let c=ze[a];if(c==256){let h=a+1;for(;;)if(h==l){if(s==t.length)break;h=t[s++].to,l=s<t.length?t[s].from:e}else if(ze[h]==256)h++;else break;let d=r==1,u=(h<e?ze[h]:i)==1,f=d==u?d?1:2:i;for(let p=h,g=s,b=g?t[g-1].to:n;p>a;)p==b&&(p=t[--g].from,b=g?t[g-1].to:n),ze[--p]=f;a=h}else r=c,a++}}}function Hp(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,c=0;a<t;){let h=!0,d=!1;if(c==r.length||a<r[c].from){let g=ze[a];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c<r.length&&p==r[c].from){if(d)break e;let g=r[c];if(!h)for(let b=g.to,y=c+1;;){if(b==t)break e;if(y<r.length&&r[y].from==b)b=r[y++].to;else{if(ze[b]==l)break e;break}}if(c++,u)u.push(g);else{g.from>a&&o.push(new Gn(a,g.from,f));let b=g.direction==Fr!=!(f%2);Np(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(h?ze[p]!=l:ze[p]==l))break;p++}u?Hp(n,a,p,i+1,s,u,o):a<p&&o.push(new Gn(a,p,f)),a=p}else for(let a=t,c=r.length;a>e;){let h=!0,d=!1;if(!c||a>r[c-1].to){let g=ze[a-1];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c&&p==r[c-1].to){if(d)break e;let g=r[--c];if(!h)for(let b=g.from,y=c;;){if(b==e)break e;if(y&&r[y-1].to==b)b=r[--y].from;else{if(ze[b-1]==l)break e;break}}if(u)u.push(g);else{g.to<a&&o.push(new Gn(g.to,a,f));let b=g.direction==Fr!=!(f%2);Np(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==e||(h?ze[p-1]!=l:ze[p-1]==l))break;p--}u?Hp(n,p,a,i+1,s,u,o):p<a&&o.push(new Gn(p,a,f)),a=p}}function Np(n,e,t,i,s,r,o){let l=e%2?2:1;GR(n,s,r,i,l),qR(n,s,r,i,l),ZR(s,r,i,l),Hp(n,s,r,e,t,i,o)}function jR(n,e,t){if(!n)return[new Gn(0,0,e==$m?1:0)];if(e==Fr&&!t.length&&!KR.test(n))return My(n.length);if(t.length)for(;n.length>ze.length;)ze[ze.length]=256;let i=[],s=e==Fr?0:1;return Np(n,s,s,t,0,n.length,i),i}function My(n){return[new Gn(0,n,0)]}let Ay="";function YR(n,e,t,i,s){var r;let o=i.head-n.from,l=Gn.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],c=a.side(s,t);if(o==c){let u=l+=s?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!s,t),c=a.side(s,t)}let h=de(n.text,o,a.forward(s,t));(h<a.from||h>a.to)&&(h=c),Ay=n.text.slice(Math.min(o,h),Math.max(o,h));let d=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return d&&h==c&&d.level+(s?0:1)<a.level?T.cursor(d.side(!s,t)+n.from,d.forward(s,t)?1:-1,d.level):T.cursor(h+n.from,a.forward(s,t)?-1:1,a.level)}function JR(n,e,t){for(let i=e;i<t;i++){let s=ky(n.charCodeAt(i));if(s==1)return Fr;if(s==2||s==4)return $m}return Fr}const Dy=P.define(),Ty=P.define(),_y=P.define(),Oy=P.define(),Fp=P.define(),Vy=P.define(),Ey=P.define(),Py=P.define({combine:n=>n.some(e=>e)}),XR=P.define({combine:n=>n.some(e=>e)}),Ly=P.define();let wu=class Ip{constructor(e,t="nearest",i="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new Ip(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 Ip(T.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}};const Bh=ce.define({map:(n,e)=>n.map(e)}),Ry=ce.define();function Zs(n,e,t){let i=n.facet(Oy);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 En=P.define({combine:n=>n.length?n[0]:!0});let QR=0;const Bl=P.define();let Ko=class Wp{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new Wp(QR++,e,i,s,l=>{let a=[Bl.of(l)];return o&&a.push(Ha.of(c=>{let h=c.plugin(l);return h?o(h):et.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return Wp.define(i=>new e(i),t)}},vu=class{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(Zs(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){Zs(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){Zs(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}};const By=P.define(),Km=P.define(),Ha=P.define(),Hy=P.define(),Gm=P.define(),Ny=P.define();function w5(n,e){let t=n.state.facet(Ny);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(n):r),s=[];return K.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let c=r-e.from,h=o-e.from,d=s;for(let u=l.length-1;u>=0;u--,a--){let f=l[u].spec.bidiIsolate,p;if(f==null&&(f=JR(e.text,c,h)),a>0&&d.length&&(p=d[d.length-1]).to==c&&p.direction==f)p.to=h,d=p.inner;else{let g={from:c,to:h,direction:f,inner:[]};d.push(g),d=g.inner}}}}),s}const Fy=P.define();function Iy(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(Fy)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const Hl=P.define();let Qn=class Q1{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Q1(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,r=0,o=0,l=0;;s++){let a=s==e.length?null:e[s],c=o-l,h=a?a.fromB:1e9;for(;r<t.length&&t[r]<h;){let d=t[r],u=t[r+1],f=Math.max(l,d),p=Math.min(h,u);if(f<=p&&new Q1(f+c,p+c,f,p).addToSet(i),u>h)break;r+=2}if(!a)return i;new Q1(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}},v5=class Wy{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Be.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Qn(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new Wy(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}},k5=class extends ht{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=et.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 ri],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Qn(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:c,toA:h})=>h<this.minWidthFrom||c>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:!oB(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?tB(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Qn(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(oe.ie||oe.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=nB(o,l,e.changes);return i=Qn.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),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 o=oe.chrome||oe.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof ma&&o.widget instanceof x5&&r.push(o.dom);s.updateGaps(r)}updateChildren(e,t,i){let s=i?i.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let o=s.length-1;;o--){let l=o>=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:d}=l,u,f,p,g;if(i&&i.range.fromB<d&&i.range.toB>h){let k=Su.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),V=Su.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);f=k.breakAtStart,p=k.openStart,g=V.openEnd;let R=this.compositionView(i);V.breakAtStart?R.breakAfter=1:V.content.length&&R.merge(R.length,R.length,V.content[0],!1,V.openStart,0)&&(R.breakAfter=V.content[0].breakAfter,V.content.shift()),k.content.length&&R.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(R).concat(V.content)}else({content:u,breakAtStart:f,openStart:p,openEnd:g}=Su.build(this.view.state.doc,h,d,this.decorations,this.dynamicDecorationMap));let{i:b,off:y}=r.findPos(c,1),{i:w,off:M}=r.findPos(a,-1);hy(this,w,M,b,y,u,f,p,g)}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(Ry)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new ur(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new zo(s,[t],t.length);let i=new ri;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=ht.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].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,r=!s&&J1(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(oe.gecko&&l.empty&&!this.hasComposition&&eB(a)){let d=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(d,a.node.childNodes[a.offset]||null)),a=c=new Bi(d,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!ga(a.node,a.offset,h.anchorNode,h.anchorOffset)||!ga(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{oe.android&&oe.chrome&&this.dom.contains(h.focusNode)&&rB(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=Ra(this.view.root);if(d)if(l.empty){if(oe.gecko){let u=iB(a.node,a.offset);if(u&&u!=3){let f=(u==1?oy:ly)(a.node,a.offset);f&&(a=new Bi(f.node,f.offset))}}d.collapse(a.node,a.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(a.node,a.offset);try{d.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Bi(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Bi(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ga(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=Ra(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=ri.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=t.from&&i.collapse(s,r)}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 r=ht.get(t.childNodes[s]);r instanceof ri&&(i=r.domAtPos(0))}for(let s=e.offset-1;!i&&s>=0;s--){let r=ht.get(t.childNodes[s]);r instanceof ri&&(i=r.domAtPos(r.length))}return i?new Bi(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=ht.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 ri)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,s=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(a<e)break;if(c<=e&&(c<e||l.covers(-1))&&(a>e||l.covers(1))&&(!i||l instanceof ri&&!(i instanceof ri&&t>=0)))i=l,s=c;else if(i&&c==e&&a==e&&l instanceof ma&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}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 ri))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof ur))return null;let r=de(s.text,i);if(r==i)return null;let o=Nr(s.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Nt.LTR;for(let c=0,h=0;h<this.children.length;h++){let d=this.children[h],u=c+d.length;if(u>s)break;if(c>=i){let f=d.dom.getBoundingClientRect();if(t.push(f.height),o){let p=d.dom.lastChild,g=p?Ba(p):[];if(g.length){let b=g[g.length-1],y=a?b.right-f.left:f.right-b.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+d.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Nt.RTL:Nt.LTR}measureTextSize(){for(let r of this.children)if(r instanceof ri){let o=r.measureTextSize();if(o)return o}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 r=Ba(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.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 ay(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(et.replace({widget:new x5(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return et.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Ha).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(Hy).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(K.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 c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(Ly))try{if(c(this.view,e.range,e))return!0}catch(h){Zs(this.view.state,h,"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 r=Iy(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;PR(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Nt.LTR)}};function eB(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")}let x5=class extends fh{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}};function zy(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=oy(t.focusNode,t.focusOffset),s=ly(t.focusNode,t.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=ht.get(s.node);if(!l||l instanceof ur&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=ht.get(i.node);!a||a instanceof ur&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function tB(n,e,t){let i=zy(n,t);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc,c=new Qn(a.mapPos(r),a.mapPos(o),r,o),h=[];for(let d=s.parentNode;;d=d.parentNode){let u=ht.get(d);if(u instanceof zo)h.push({node:d,deco:u.mark});else{if(u instanceof ri||d.nodeName=="DIV"&&d.parentNode==n.contentDOM)return{range:c,text:s,marks:h,line:d};if(d!=n.contentDOM)h.push({node:d,deco:new zm({inclusive:!0,attributes:WR(d),tagName:d.tagName.toLowerCase()})});else return null}}}function iB(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 sB=class{constructor(){this.changes=[]}compareRange(e,t){Rp(e,t,this.changes)}comparePoint(e,t){Rp(e,t,this.changes)}};function nB(n,e,t){let i=new sB;return K.compare(n,e,t,i),i.changes}function rB(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 oB(n,e){let t=!1;return e&&n.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(t=!0)}),t}function lB(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return T.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=de(s.text,r,!1):l=de(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=de(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=de(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return T.range(o+s.from,l+s.from)}function aB(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function hB(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function ku(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function M5(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function A5(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function zp(n,e,t){let i,s,r,o,l=!1,a,c,h,d;for(let p=n.firstChild;p;p=p.nextSibling){let g=Ba(p);for(let b=0;b<g.length;b++){let y=g[b];s&&ku(s,y)&&(y=M5(A5(y,s.bottom),s.top));let w=aB(e,y),M=hB(t,y);if(w==0&&M==0)return p.nodeType==3?D5(p,e,t):zp(p,e,t);if(!i||o>M||o==M&&r>w){i=p,s=y,r=w,o=M;let k=M?t<y.top?-1:1:w?e<y.left?-1:1:0;l=!k||(k>0?b<g.length-1:b>0)}w==0?t>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):t<y.top&&(!d||d.top>y.top)&&(c=p,d=y):h&&ku(h,y)?h=A5(h,y.bottom):d&&ku(d,y)&&(d=M5(d,y.top))}}if(h&&h.bottom>=t?(i=a,s=h):d&&d.top<=t&&(i=c,s=d),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return D5(i,u,t);if(l&&i.contentEditable!="false")return zp(i,u,t);let f=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:f}}function D5(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=Nr(n,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let d=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&d<r){let u=e>=(h.left+h.right)/2,f=u;if((oe.chrome||oe.gecko)&&Nr(n,l).getBoundingClientRect().left==h.right&&(f=!u),d<=0)return{node:n,offset:l+(f?1:0)};s=l+(f?1:0),r=d}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Uy(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:d}=e,u=d-l;if(u<0)return 0;if(u>c)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,V=!1;a=n.elementAtHeight(u),a.type!=Ji.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(V)return t?null:0;V=!0,i=-i}d=l+u;let f=a.from;if(f<n.viewport.from)return n.viewport.from==0?0:t?null:T5(n,o,a,h,d);if(f>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:T5(n,o,a,h,d);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,b=g.elementFromPoint(h,d);b&&!n.contentDOM.contains(b)&&(b=null),b||(h=Math.max(o.left+1,Math.min(o.right-1,h)),b=g.elementFromPoint(h,d),b&&!n.contentDOM.contains(b)&&(b=null));let y,w=-1;if(b&&((s=n.docView.nearest(b))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,d);k&&({offsetNode:y,offset:w}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,d);k&&({startContainer:y,startOffset:w}=k,(!n.contentDOM.contains(y)||oe.safari&&cB(y,w,h)||oe.chrome&&dB(y,w,h))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let k=ri.find(n.docView,f);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:w}=zp(k.dom,h,d))}let M=n.docView.nearest(y);if(!M)return null;if(M.isWidget&&((r=M.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=M.dom.getBoundingClientRect();return e.y<k.top||e.y<=k.bottom&&e.x<=(k.left+k.right)/2?M.posAtStart:M.posAtEnd}else return M.localPosFromDOM(y,w)+M.posAtStart}function T5(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+lr(o,r,n.state.tabSize)}function cB(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 Nr(n,i-1,i).getBoundingClientRect().left>t}function dB(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Nr(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function uB(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==Ji.Text))return i}return t}function fB(n,e,t,i){let s=uB(n,e.head),r=!i||s.type!=Ji.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==Nt.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return T.cursor(a,t?-1:1)}return T.cursor(t?s.to:s.from,t?-1:1)}function _5(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let c=YR(s,r,o,l,t),h=Ay;if(!c){if(s.number==(t?n.state.doc.lines:1))return l;h=` `,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),c=n.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function pB(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==He.Space&&(s=o),s==o}}function gB(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return T.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,e.assoc||-1),h=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let f=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-f.from))),l=(r<0?f.top:f.bottom)+h}let d=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let f=0;;f+=10){let p=l+(u+f)*r,g=Uy(n,{x:d,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let b=n.docView.coordsForChar(g),y=!b||p<b.top?-1:1;return T.cursor(g,y,void 0,o)}}}function ec(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function xu(n,e,t){let i=ec(n.state.facet(Gm).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:T.cursor(i,i<t.from?1:-1)}let mB=class{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,oe.safari&&e.contentDOM.addEventListener("input",()=>null),oe.gecko&&PB(e.contentDOM.ownerDocument)}handleEvent(e){!MB(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=CB(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,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&&bB.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),oe.android&&oe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return oe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=$y.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||yB.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,ko(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:oe.safari&&!oe.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 O5(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){Zs(t.state,s)}}}function CB(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 r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(O5(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(O5(i.value,o))}}for(let i in vs)t(i).handlers.push(vs[i]);for(let i in ts)t(i).observers.push(ts[i]);return e}const $y=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],yB="dthko",bB=[16,17,18,20,91,92,224,225],Hh=6;function Nh(n){return Math.max(0,n)*.7+8}function SB(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}let wB=class{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=LR(e.contentDOM),this.atoms=e.state.facet(Gm).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ae.allowMultipleSelections)&&vB(e,t),this.dragging=xB(e,t)&&qy(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&&SB(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Iy(this.view);e.clientX-a.left<=s+Hh?t=-Nh(s-e.clientX):e.clientX+a.right>=o-Hh&&(t=Nh(e.clientX-o)),e.clientY-a.top<=r+Hh?i=-Nh(r-e.clientY):e.clientY+a.bottom>=l-Hh&&(i=Nh(e.clientY-l)),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],r=null;if(s.empty){let o=ec(this.atoms,s.from,0);o!=s.from&&(r=T.cursor(o,-1))}else{let o=ec(this.atoms,s.from,-1),l=ec(this.atoms,s.to,1);(o!=s.from||l!=s.to)&&(r=T.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?T.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 vB(n,e){let t=n.state.facet(Dy);return t.length?t[0](e):oe.mac?e.metaKey:e.ctrlKey}function kB(n,e){let t=n.state.facet(Ty);return t.length?t[0](e):oe.mac?!e.altKey:!e.ctrlKey}function xB(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Ra(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function MB(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=ht.get(t))&&i.ignoreEvent(e))return!1;return!0}const vs=Object.create(null),ts=Object.create(null),Ky=oe.ie&&oe.ie_version<15||oe.ios&&oe.webkit_version<604;function AB(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(),Gy(n,t.value)},50)}function Gy(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Up!=null&&t.selection.ranges.every(a=>a.empty)&&Up==r.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let d=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:d},range:T.cursor(c.from+d.length)}})}else o?i=t.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:T.cursor(a.from+c.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ts.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};vs.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ts.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};ts.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};vs.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(_y))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=_B(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new wB(n,e,t,i)),i&&n.observer.ignore(()=>{sy(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function V5(n,e,t,i){if(i==1)return T.cursor(e,t);if(i==2)return lB(n.state,e,t);{let s=ri.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,T.range(o,l)}}let E5=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function DB(n,e,t,i){let s=ri.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&E5(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&E5(t,i,l)?1:o&&o.bottom>=i?-1:1}function P5(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:DB(n,t,e.clientX,e.clientY)}}const TB=oe.ie&&oe.ie_version<=11;let L5=null,R5=0,B5=0;function qy(n){if(!TB)return n.detail;let e=L5,t=B5;return L5=n,B5=Date.now(),R5=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(R5+1)%3:1}function _B(n,e){let t=P5(n,e),i=qy(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=P5(n,r),c,h=V5(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let d=V5(n,t.pos,t.bias,i),u=Math.min(d.from,h.from),f=Math.max(d.to,h.to);h=u<h.from?T.range(u,f):T.range(f,u)}return o?s.replaceRange(s.main.extend(h.from,h.to)):l&&i==1&&s.ranges.length>1&&(c=OB(s,a.pos))?c:l?s.addRange(h):T.create([h])}}}function OB(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 T.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}vs.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 r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=T.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};vs.dragend=n=>(n.inputState.draggedContent=null,!1);function H5(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&kB(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}vs.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,r=()=>{++s==t.length&&H5(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return H5(n,e,i,!0),!0}return!1};vs.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Ky?null:e.clipboardData;return t?(Gy(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(AB(n),!1)};function VB(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 EB(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:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Up=null;vs.copy=vs.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=EB(n.state);if(!t&&!s)return!1;Up=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Ky?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(VB(n,t),!1)};const Zy=gi.define();function jy(n,e){let t=[];for(let i of n.facet(Ey)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:Zy.of(!0)}):null}function Yy(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=jy(n.state,e);t?n.dispatch(t):n.update([])}},10)}ts.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),Yy(n)};ts.blur=n=>{n.observer.clearSelectionRange(),Yy(n)};ts.compositionstart=ts.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ts.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,oe.chrome&&oe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ts.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};vs.beforeinput=(n,e)=>{var t;let i;if(oe.chrome&&oe.android&&(i=$y.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return oe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),oe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ts.compositionend(n,e),20),!1};const N5=new Set;function PB(n){N5.has(n)||(N5.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const F5=["pre-wrap","normal","pre-line","break-spaces"];let LB=class{constructor(e){this.lineWrapping=e,this.doc=$.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}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 F5.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,r,o){let l=F5.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}},RB=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},Pn=class Jy{constructor(e,t,i,s,r){this.from=e,this.length=t,this.top=i,this.height=s,this._content=r}get type(){return typeof this._content=="number"?Ji.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 Uo?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 Jy(this.from,this.length+e.length,this.top,this.height+e.height,t)}};var st=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(st||(st={}));const tc=.001;let ms=class ic{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,t){this.height!=t&&(Math.abs(this.height-t)>tc&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return ic.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:d}=s[l],u=r.lineAt(a,st.ByPosNoHeight,i.setDoc(t),0,0),f=u.to>=c?u:r.lineAt(c,st.ByPosNoHeight,i,0,0);for(d+=f.to-c,c=f.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,st.ByPosNoHeight,i,0,0));h+=u.from-a,a=u.from;let p=NB.build(i.setDoc(o),e,h,d);r=r.replace(a,c,p)}return r.updateHeight(i,0)}static empty(){return new Ws(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,s=0,r=0;for(;;)if(t==i)if(s>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[t++];l&&(s+=l.size)}else{let l=e[--i];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new BB(ic.of(e.slice(0,t)),o,ic.of(e.slice(i)))}};ms.prototype.size=1;let Xy=class extends ms{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,s){return new Pn(s,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,s,r){return this.blockAt(0,i,s,r)}forEachLine(e,t,i,s,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},Ws=class $p extends Xy{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new Pn(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof $p||s instanceof xo&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof xo?s=new $p(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ms.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,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:""})`}},xo=class cs extends ms{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let c=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=t.doc.lineAt(c),d=l+h.length*a,u=Math.max(i,e-d/2);return new Pn(h.from,h.length,u,d,0)}else{let c=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:h,length:d}=t.doc.line(r+c);return new Pn(h,d,i+l*c,l,0)}}lineAt(e,t,i,s,r){if(t==st.ByHeight)return this.blockAt(e,i,s,r);if(t==st.ByPosNoHeight){let{from:f,to:p}=i.doc.lineAt(e);return new Pn(f,p-f,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),c=i.doc.lineAt(e),h=l+c.length*a,d=c.number-o,u=s+l*d+a*(c.from-r-d);return new Pn(c.from,c.length,Math.max(s,Math.min(u,s+this.height-h)),h,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,r);for(let h=e,d=s;h<=t;){let u=i.doc.lineAt(h);if(h==e){let p=u.number-l;d+=a*p+c*(e-r-p)}let f=a+c*u.length;o(new Pn(u.from,u.length,d,f,0)),d+=f,h=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof cs?i[i.length-1]=new cs(r.length+s):i.push(null,new cs(s-1))}if(e>0){let r=i[0];r instanceof cs?i[0]=new cs(e+r.length):i.unshift(new cs(e-1),null)}return ms.of(i)}decomposeLeft(e,t){t.push(new cs(e-1),null)}decomposeRight(e,t){t.push(null,new cs(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new cs(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let d=s.heights[s.index++];a==-1?a=d:Math.abs(d-a)>=tc&&(a=-2);let u=new Ws(h,d);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new cs(r-l).updateHeight(e,l));let c=ms.of(o);return(a<0||Math.abs(c.height-this.height)>=tc||Math.abs(a-this.heightMetrics(e,t).perLine)>=tc)&&(e.heightChanged=!0),c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},BB=class extends ms{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 r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,s):this.right.blockAt(e,t,r,s+this.left.length+this.break)}lineAt(e,t,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=t==st.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,i,s,r):this.right.lineAt(e,t,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=t==st.ByPosNoHeight?st.ByPosNoHeight:st.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,s,r).join(c)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,s,r,o),t>=a&&this.right.forEachLine(e,t,i,l,a,o);else{let c=this.lineAt(a,st.ByPos,i,s,r);e<c.from&&this.left.forEachLine(e,c.from-1,i,s,r,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,l,a,o)}}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 r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&I5(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),I5(r,l)}return ms.of(r)}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?ms.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function I5(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof xo&&(i=n[e+1])instanceof xo&&n.splice(e-1,3,new xo(t.length+1+i.length))}const HB=5;let NB=class Qy{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 Ws?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ws(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,r=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new Xy(o,s,i)):(o||r||s>=HB)&&this.addLineDeco(s,r,o)}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 Ws(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new xo(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 Ws)return e;let t=new Ws(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 Ws)&&!this.isCovered?this.nodes.push(new Ws(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 Ws&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,t,i,s){let r=new Qy(i,e);return K.spans(t,i,s,r,0),r.finish(i)}};function FB(n,e,t){let i=new IB;return K.compare(n,e,t,i,0),i.changes}let IB=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,s){(e<t||i&&i.heightRelevant||s&&s.heightRelevant)&&Rp(e,t,this.changes,5)}};function WB(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,r=Math.max(0,t.left),o=Math.min(s.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(s.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=i.body;)if(c.nodeType==1){let h=c,d=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=c==n.parentNode?u.bottom:Math.min(a,u.bottom)}c=d.position=="absolute"||d.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function zB(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}let Mu=class{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],r=t[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e,t){return et.replace({widget:new UB(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},UB=class extends fh{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}},W5=class{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=z5,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Nt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Km).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new LB(t),this.stateDeco=e.facet(Ha).filter(i=>typeof i!="function"),this.heightMap=ms.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle.setDoc(e.doc),[new Qn(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=et.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:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Fh(r,o))}}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?z5:new GB(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(Nl(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ha).filter(h=>typeof h!="function");let s=e.changedRanges,r=Qn.extendWithRanges(s,FB(i,this.stateDeco,e?e.changes:Be.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(XR)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Nt.RTL:Nt.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:V}=iy(t,l);(k>.005&&Math.abs(this.scaleX-k)>.005||V>.005&&Math.abs(this.scaleY-V)>.005)&&(this.scaleX=k,this.scaleY=V,c|=8,o=a=!0)}let d=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=u)&&(this.paddingTop=d,this.paddingBottom=u,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=ry(e.scrollDOM);let p=(this.printing?zB:WB)(t,this.paddingTop),g=p.top-this.pixelViewport.top,b=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(k)&&(o=!0),o||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:V,charWidth:R,textHeight:H}=e.docView.measureTextSize();o=V>0&&s.refresh(r,V,R,H,w/R,k),o&&(e.docView.minWidth=0,c|=8)}g>0&&b>0?h=Math.max(g,b):g<0&&b<0&&(h=Math.min(g,b)),s.heightChanged=!1;for(let V of this.viewports){let R=V.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(V);this.heightMap=(o?ms.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle,[new Qn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new RB(V.from,R))}s.heightChanged&&(c|=2)}let M=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||M)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}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,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Fh(s.lineAt(o-i*1e3,st.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,st.ByHeight,r,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=s.lineAt(c,st.ByPos,r,0,0),u;t.y=="center"?u=(d.top+d.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c<a.from?u=d.top:u=d.bottom-h,a=new Fh(s.lineAt(u-1e3/2,st.ByHeight,r,0,0).from,s.lineAt(u+h+1e3/2,st.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new Fh(this.heightMap.lineAt(i,st.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,st.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,st.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,st.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r<l+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 Mu(t.mapPos(s.from),t.mapPos(s.to),s.size));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=Nt.LTR&&!i)return[];let l=[],a=(h,d,u,f)=>{if(d-h<r)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let y of g)if(y>h&&y<d){a(h,y-10,u,f),a(y+10,d,u,f);return}let b=KB(e,y=>y.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)<r&&Math.abs(y.to-d)<r&&!g.some(w=>y.from<w&&y.to>w));if(!b){if(d<u.to&&t&&i&&t.visibleRanges.some(y=>y.from<=d&&y.to>=d)){let y=t.moveToLineBoundary(T.cursor(d),!1,!0).head;y>h&&(d=y)}b=new Mu(h,d,this.gapSize(u,h,d,f))}l.push(b)},c=h=>{if(h.length<o||h.type!=Ji.Text)return;let d=$B(h.from,h.to,this.stateDeco);if(d.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,f,p;if(i){let g=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,y;if(u!=null){let w=Wh(d,u),M=((this.visibleBottom-this.visibleTop)/2+g)/h.height;b=w-M,y=w+M}else b=(this.visibleTop-h.top-g)/h.height,y=(this.visibleBottom-h.top+g)/h.height;f=Ih(d,b),p=Ih(d,y)}else{let g=d.total*this.heightOracle.charWidth,b=s*this.heightOracle.charWidth,y,w;if(u!=null){let M=Wh(d,u),k=((this.pixelViewport.right-this.pixelViewport.left)/2+b)/g;y=M-k,w=M+k}else y=(this.pixelViewport.left-b)/g,w=(this.pixelViewport.right+b)/g;f=Ih(d,y),p=Ih(d,w)}f>h.from&&a(h.from,f,h,d),p<h.to&&a(p,h.to,h,d)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(e,t,i,s){let r=Wh(s,i)-Wh(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){Mu.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=et.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];K.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Nl(this.heightMap.lineAt(e,st.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)||Nl(this.heightMap.lineAt(this.scaler.fromDOM(e),st.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 Nl(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}},Fh=class{constructor(e,t){this.from=e,this.to=t}};function $B(n,e,t){let i=[],s=n,r=0;return K.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(i.push({from:s,to:e}),r+=e-s),{total:r,ranges:i}}function Ih({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:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Wh(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 KB(n,e){for(let t of n)if(e(t))return t}const z5={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};let GB=class eb{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=t.lineAt(l,st.ByPos,e,0,0).top,h=t.lineAt(a,st.ByPos,e,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return s+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,s=r.domBottom}}fromDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,s=r.domBottom}}eq(e){return e instanceof eb?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 Nl(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new Pn(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(s=>Nl(s,e)):n._content)}const zh=P.define({combine:n=>n.join(" ")}),Kp=P.define({combine:n=>n.indexOf(!0)>-1}),Gp=we.newName(),tb=we.newName(),ib=we.newName(),sb={"&light":"."+tb,"&dark":"."+ib};function qp(n,e,t){return new we(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 qB=qp("."+Gp,{"&":{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},".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:"#444"},".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},"&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:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".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"}},sb),Fl="";let ZB=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ae.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Fl}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=ht.get(s),a=ht.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:Pc(s))||Pc(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}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 r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=ht.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+(jB(e,i.node,i.offset)?t:0))}};function jB(n,e,t){for(;;){if(!e||t<yn(e))return!1;if(e==n)return!0;t=Hr(e)+1,e=e.parentNode}}let U5=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},YB=class{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:QB(e),a=new ZB(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=eH(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!kp(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!kp(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((oe.ios||oe.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.to<e.state.doc.length)){let d=Math.min(a,c),u=Math.max(a,c),f=h.from-d,p=h.to-u;(f==0||f==1||d==0)&&(p==0||p==-1||u==e.state.doc.length)&&(a=0,c=e.state.doc.length)}this.newSel=T.single(c,a)}}};function nb(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,c=null;(r===8||oe.android&&e.text.length<l-o)&&(a=s.to,c="end");let h=XB(n.state.doc.sliceString(o,l,Fl),e.text,a-o,c);h&&(oe.chrome&&r==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==Fl+Fl&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:$.of(e.text.slice(h.from,h.toB).split(Fl))})}else i&&(!n.hasFocus&&n.state.facet(En)||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))}:(oe.mac||oe.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=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}):oe.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` `&&n.lineWrapping&&(i&&(i=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}),t)return rb(n,t,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function rb(n,e,t,i=-1){if(oe.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(oe.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&&ko(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)&&ko(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&ko(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=JB(n,e,t));return n.state.facet(Vy).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function JB(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.from<e.from?s.sliceDoc(r.from,e.from):"",a=r.to>e.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let c=n.state.sliceDoc(e.from,e.to),h,d=t&&zy(n,t.main.head);if(d){let p=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-e.to,f=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,b=g-c.length;if(p.to-p.from!=f||n.state.sliceDoc(b,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:b,to:g,insert:e.insert}),w=p.to-r.to;return{changes:y,range:a?T.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function XB(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function QB(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new U5(t,i)),(s!=t||r!=i)&&e.push(new U5(s,r))),e}function eH(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?T.single(t+e,i+e):null}const tH={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Au=oe.ie&&oe.ie_version<=11;let iH=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new RR,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);(oe.ie&&oe.ie_version<=11||oe.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&&!(oe.chrome&&oe.chrome_version<126)&&(this.editContext=new nH(e),e.state.facet(En)&&(e.contentDOM.editContext=this.editContext.editContext)),Au&&(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.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(En)?i.root.activeElement!=this.dom:!J1(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(oe.ie&&oe.ie_version<=11||oe.android&&oe.chrome)&&!i.state.selection.main.empty&&s.focusNode&&ga(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Ra(e.root);if(!t)return!1;let i=oe.safari&&e.root.nodeType==11&&VR(this.dom.ownerDocument)==this.dom&&sH(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let s=J1(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&HR(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,tH),Au&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Au&&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 r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&ko(this.dom,r.key,r.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 r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&J1(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 r=new YB(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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=nb(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=$5(t,e.previousSibling||e.target.previousSibling,-1),s=$5(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("change",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("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(En)!=e.state.facet(En)&&(e.view.contentDOM.editContext=e.state.facet(En)?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 $5(n,e,t){for(;e;){let i=ht.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 K5(n,e){let t=e.startContainer,i=e.startOffset,s=e.endContainer,r=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return ga(o.node,o.offset,s,r)&&([t,i,s,r]=[s,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}}function sH(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return K5(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?K5(n,t):null}let nH=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(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,r={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:$.of(i.text.split(` `))};r.from==this.from&&s<this.from?r.from=s:r.to==this.to&&s>this.to&&(r.to=s),!(r.from==r.to&&!r.insert.length)&&(this.pendingContextChange=r,e.state.readOnly||rb(e,r,T.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(et.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}e.dispatch({effects:Ry.of(et.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=Ra(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((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(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)}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){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},Ve=class Zp{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={}){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:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||BR(e.parent)||document,this.viewState=new W5(e.state||ae.create(e)),e.scrollTo&&e.scrollTo.is(Bh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Bl).map(i=>new vu(i));for(let i of this.plugins)i.update(this);this.observer=new iH(this),this.inputState=new mB(this),this.inputState.ensureHandlers(this.plugins),this.docView=new k5(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof pt?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,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Zy))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=jy(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(ae.phrases)!=this.state.facet(ae.phrases))return this.setState(r);s=v5.create(this,r,e),s.flags|=l;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(d&&(d=d.map(u.changes)),u.scrollIntoView){let{main:f}=u.state.selection;d=new wu(f.empty?f:T.cursor(f.head,f.head>f.anchor?-1:1))}for(let f of u.effects)f.is(Bh)&&(d=f.value.clip(this.state))}this.viewState.update(s,d),this.bidiCache=q5.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Hl)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(zh)!=s.state.facet(zh)&&(this.viewState.mustMeasureContent=!0),(t||i||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(Fp))try{u(s)}catch(f){Zs(this.state,f,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!nb(this,h)&&c.force&&ko(this.contentDOM,c.key,c.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 W5(e),this.plugins=e.facet(Bl).map(i=>new vu(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new k5(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(Bl),i=e.state.facet(Bl);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new vu(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.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){Zs(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:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(ry(i))r=-1,o=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(s);r=f.from,o=f.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(f=>{try{return f.read(this)}catch(p){return Zs(this.state,p),G5}}),d=v5.create(this,this.state,[]),u=!1;d.flags|=a,t?t.flags|=a:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),u=this.docView.update(d),u&&this.docViewUpdate());for(let f=0;f<c.length;f++)if(h[f]!=G5)try{let p=c[f];p.write&&p.write(h[f],this)}catch(p){Zs(this.state,p)}if(u&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Fp))l(t)}get themeClasses(){return Gp+" "+(this.state.facet(Kp)?ib:tb)+" "+this.state.facet(zh)}updateAttrs(){let e=Z5(this,By,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(En)?"true":"false",class:"cm-content",style:`${oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Z5(this,Km,t);let i=this.observer.ignore(()=>{let s=Lp(this.contentDOM,this.contentAttrs,t),r=Lp(this.dom,this.editorAttrs,e);return s||r});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(Zp.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Hl);let e=this.state.facet(Zp.cspNonce);we.mount(this.root,this.styleModules.concat(qB).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 xu(this,e,_5(this,e,t,i))}moveByGroup(e,t){return xu(this,e,_5(this,e,t,i=>pB(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return T.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return fB(this,e,t,i)}moveVertically(e,t,i){return xu(this,e,gB(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(),Uy(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),r=this.bidiSpans(s),o=r[Gn.find(r,e-s.from,-1,t)];return Im(i,o.dir==Nt.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(Py)||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>rH)return My(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||xy(r.isolates,i=w5(this,e))))return r.order;i||(i=w5(this,e));let s=jR(e.text,t,i);return this.bidiCache.push(new q5(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||oe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{sy(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 Bh.of(new wu(typeof e=="number"?T.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 Bh.of(new wu(T.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 Ko.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ko.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=we.newName(),s=[zh.of(i),Hl.of(qp(`.${i}`,e))];return t&&t.dark&&s.push(Kp.of(!0)),s}static baseTheme(e){return Vi.lowest(Hl.of(qp("."+Gp,e,sb)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&ht.get(i)||ht.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}};Ve.styleModule=Hl;Ve.inputHandler=Vy;Ve.scrollHandler=Ly;Ve.focusChangeEffect=Ey;Ve.perLineTextDirection=Py;Ve.exceptionSink=Oy;Ve.updateListener=Fp;Ve.editable=En;Ve.mouseSelectionStyle=_y;Ve.dragMovesSelection=Ty;Ve.clickAddsSelectionRange=Dy;Ve.decorations=Ha;Ve.outerDecorations=Hy;Ve.atomicRanges=Gm;Ve.bidiIsolatedRanges=Ny;Ve.scrollMargins=Fy;Ve.darkTheme=Kp;Ve.cspNonce=P.define({combine:n=>n.length?n[0]:""});Ve.contentAttributes=Km;Ve.editorAttributes=By;Ve.lineWrapping=Ve.contentAttributes.of({class:"cm-lineWrapping"});Ve.announce=ce.define();const rH=4096,G5={};let q5=class ob{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:Nt.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!t.touchesRange(o.from,o.to)&&i.push(new ob(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function Z5(n,e,t){for(let i=n.state.facet(e),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&Pp(o,t)}return t}const oH=!oe.ios,j5={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};oH&&(j5[".cm-line"].caretColor=j5[".cm-content"].caretColor="transparent !important");let Ir=class extends Bt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Ir.prototype.elementClass="";Ir.prototype.toDOM=void 0;Ir.prototype.mapMode=fe.TrackBefore;Ir.prototype.startSide=Ir.prototype.endSide=-1;Ir.prototype.point=!0;const Du=P.define(),lH={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>K.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},sc=P.define();function aH(n){return[hH(),sc.of(Object.assign(Object.assign({},lH),n))]}const Y5=P.define({combine:n=>n.some(e=>e)});function hH(n){return[cH]}const cH=Ko.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(sc).map(e=>new X5(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(Y5),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(Y5)!=!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=K.iter(this.view.state.facet(Du),this.view.viewport.from),i=[],s=this.gutters.map(r=>new dH(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Ji.Text&&o){jp(t,i,l.from);for(let a of s)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==Ji.Text){jp(t,i,r.from);for(let o of s)o.line(this.view,r,i)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(sc),t=n.state.facet(sc),i=n.docChanged||n.heightChanged||n.viewportChanged||!K.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 r of t){let o=e.indexOf(r);o<0?s.push(new X5(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>Ve.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Nt.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function J5(n){return Array.isArray(n)?n:[n]}function jp(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class dH{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=K.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new lb(e,o,r,i);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];jp(this.cursor,s,t.from),i.length&&(s=s.concat(i));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t);i&&this.addElement(e,t,[i])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class X5{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 r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,s)&&s.preventDefault()});this.markers=J5(t.markers(e)),t.initialSpacer&&(this.spacer=new lb(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=J5(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!K.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 lb{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":""),uH(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=r<t.length?t[r++]:null,c=!1;if(a){let h=a.elementClass;h&&(i+=" "+h);for(let d=o;d<this.markers.length;d++)if(this.markers[d].compare(a)){l=d,c=!0;break}}else l=this.markers.length;for(;o<l;){let h=this.markers[o++];if(h.toDOM){h.destroy(s);let d=s.nextSibling;s.remove(),s=d}}if(!a)break;a.toDOM&&(c?s=s.nextSibling:this.dom.insertBefore(a.toDOM(e),s)),c&&o++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function uH(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}let fH=0;class Ks{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=fH++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new Ks([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new Rc;return t=>t.modified.indexOf(e)>-1?t:Rc.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let pH=0;class Rc{constructor(){this.instances=[],this.id=pH++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&gH(t,l.modified));if(i)return i;let s=[],r=new Ks(s,e,t);for(let l of t)l.instances.push(r);let o=mH(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(Rc.get(l,a));return r}}function gH(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function mH(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 ab(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 r=[],o=2,l=s;for(let d=0;;){if(l=="..."&&d>0&&d+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),d+=u[0].length,d==s.length)break;let f=s[d++];if(d==s.length&&f=="!"){o=0;break}if(f!="/")throw new RangeError("Invalid path: "+s);l=s.slice(d)}let a=r.length-1,c=r[a];if(!c)throw new RangeError("Invalid path: "+s);let h=new Bc(i,o,a>0?r.slice(0,a):null);e[c]=h.sort(e[c])}}return hb.add(e)}const hb=new Se;class Bc{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}}Bc.empty=new Bc([],2,null);function cb(n,e){let t=Object.create(null);for(let r of n)if(!Array.isArray(r.tag))t[r.tag.id]=r.class;else for(let o of r.tag)t[o.id]=r.class;let{scope:i,all:s=null}=e||{};return{style:r=>{let o=s;for(let l of r)for(let a of l.set){let c=t[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function CH(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function yH(n,e,t,i=0,s=n.length){let r=new bH(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class bH{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,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(f=>!f.scope||f.scope(o)));let c=s,h=SH(e)||Bc.empty,d=CH(r,h.tags);if(d&&(c&&(c+=" "),c+=d,h.mode==1&&(s+=(s?" ":"")+d)),this.startSpan(Math.max(t,l),c),h.opaque)return;let u=e.tree&&e.tree.prop(Se.mounted);if(u&&u.overlay){let f=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(b=>!b.scope||b.scope(u.tree.type)),g=e.firstChild();for(let b=0,y=l;;b++){let w=b<u.overlay.length?u.overlay[b]:null,M=w?w.from+l:a,k=Math.max(t,y),V=Math.min(i,M);if(k<V&&g)for(;e.from<V&&(this.highlightRange(e,k,V,s,r),this.startSpan(Math.min(V,e.to),c),!(e.to>=M||!e.nextSibling())););if(!w||M>i)break;y=w.to+l,y>t&&(this.highlightRange(f.cursor(),Math.max(t,w.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}g&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}}function SH(n){let e=n.type.prop(hb);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const J=Ks.define,Uh=J(),Dn=J(),Q5=J(Dn),e3=J(Dn),Tn=J(),$h=J(Tn),Tu=J(Tn),Fs=J(),kr=J(Fs),Ps=J(),Ls=J(),Yp=J(),vl=J(Yp),Kh=J(),Y={comment:Uh,lineComment:J(Uh),blockComment:J(Uh),docComment:J(Uh),name:Dn,variableName:J(Dn),typeName:Q5,tagName:J(Q5),propertyName:e3,attributeName:J(e3),className:J(Dn),labelName:J(Dn),namespace:J(Dn),macroName:J(Dn),literal:Tn,string:$h,docString:J($h),character:J($h),attributeValue:J($h),number:Tu,integer:J(Tu),float:J(Tu),bool:J(Tn),regexp:J(Tn),escape:J(Tn),color:J(Tn),url:J(Tn),keyword:Ps,self:J(Ps),null:J(Ps),atom:J(Ps),unit:J(Ps),modifier:J(Ps),operatorKeyword:J(Ps),controlKeyword:J(Ps),definitionKeyword:J(Ps),moduleKeyword:J(Ps),operator:Ls,derefOperator:J(Ls),arithmeticOperator:J(Ls),logicOperator:J(Ls),bitwiseOperator:J(Ls),compareOperator:J(Ls),updateOperator:J(Ls),definitionOperator:J(Ls),typeOperator:J(Ls),controlOperator:J(Ls),punctuation:Yp,separator:J(Yp),bracket:vl,angleBracket:J(vl),squareBracket:J(vl),paren:J(vl),brace:J(vl),content:Fs,heading:kr,heading1:J(kr),heading2:J(kr),heading3:J(kr),heading4:J(kr),heading5:J(kr),heading6:J(kr),contentSeparator:J(Fs),list:J(Fs),quote:J(Fs),emphasis:J(Fs),strong:J(Fs),link:J(Fs),monospace:J(Fs),strikethrough:J(Fs),inserted:J(),deleted:J(),changed:J(),invalid:J(),meta:Kh,documentMeta:J(Kh),annotation:J(Kh),processingInstruction:J(Kh),definition:Ks.defineModifier(),constant:Ks.defineModifier(),function:Ks.defineModifier(),standard:Ks.defineModifier(),local:Ks.defineModifier(),special:Ks.defineModifier()};cb([{tag:Y.link,class:"tok-link"},{tag:Y.heading,class:"tok-heading"},{tag:Y.emphasis,class:"tok-emphasis"},{tag:Y.strong,class:"tok-strong"},{tag:Y.keyword,class:"tok-keyword"},{tag:Y.atom,class:"tok-atom"},{tag:Y.bool,class:"tok-bool"},{tag:Y.url,class:"tok-url"},{tag:Y.labelName,class:"tok-labelName"},{tag:Y.inserted,class:"tok-inserted"},{tag:Y.deleted,class:"tok-deleted"},{tag:Y.literal,class:"tok-literal"},{tag:Y.string,class:"tok-string"},{tag:Y.number,class:"tok-number"},{tag:[Y.regexp,Y.escape,Y.special(Y.string)],class:"tok-string2"},{tag:Y.variableName,class:"tok-variableName"},{tag:Y.local(Y.variableName),class:"tok-variableName tok-local"},{tag:Y.definition(Y.variableName),class:"tok-variableName tok-definition"},{tag:Y.special(Y.variableName),class:"tok-variableName2"},{tag:Y.definition(Y.propertyName),class:"tok-propertyName tok-definition"},{tag:Y.typeName,class:"tok-typeName"},{tag:Y.namespace,class:"tok-namespace"},{tag:Y.className,class:"tok-className"},{tag:Y.macroName,class:"tok-macroName"},{tag:Y.propertyName,class:"tok-propertyName"},{tag:Y.operator,class:"tok-operator"},{tag:Y.comment,class:"tok-comment"},{tag:Y.meta,class:"tok-meta"},{tag:Y.invalid,class:"tok-invalid"},{tag:Y.punctuation,class:"tok-punctuation"}]);var _u;const mo=new Se;function wH(n){return P.define({combine:n?e=>e.concat(n):void 0})}const vH=new Se;class ps{constructor(e,t,i=[],s=""){this.data=e,this.name=s,ae.prototype.hasOwnProperty("tree")||Object.defineProperty(ae.prototype,"tree",{get(){return Xt(this)}}),this.parser=t,this.extension=[fr.of(this),ae.languageData.of((r,o,l)=>{let a=t3(r,o,l),c=a.type.prop(mo);if(!c)return[];let h=r.facet(c),d=a.type.prop(vH);if(d){let u=a.resolve(o-a.from,l);for(let f of d)if(f.test(u,r)){let p=r.facet(f.facet);return f.type=="replace"?p:p.concat(h)}}return h})].concat(i)}isActiveAt(e,t,i=-1){return t3(e,t,i).type.prop(mo)==this.data}findRegions(e){let t=e.facet(fr);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(mo)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(Se.mounted);if(l){if(l.tree.prop(mo)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<r.children.length;a++){let c=r.children[a];c instanceof At&&s(c,r.positions[a]+o)}};return s(Xt(e),0),i}get allowsNesting(){return!0}}ps.setState=ce.define();function t3(n,e,t){let i=n.facet(fr),s=Xt(n).topNode;if(!i||i.allowsNesting)for(let r=s;r;r=r.enter(e,t,Ht.ExcludeBuffers))r.type.isTop&&(s=r);return s}class Hc extends ps{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=wH(e.languageData);return new Hc(t,e.parser.configure({props:[mo.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new Hc(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Xt(n){let e=n.field(ps.state,!1);return e?e.tree:At.empty}class kH{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 kl=null;class Nc{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Nc(e,t,[],At.empty,0,i,[],null)}startParse(){return this.parser.startParse(new kH(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=At.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(Vr.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(Vr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=kl;kl=this;try{return e()}finally{kl=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=i3(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,h,d,u)=>a.push({fromA:c,toA:h,fromB:d,toB:u})),i=Vr.applyChanges(i,a),s=At.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let h=e.mapPos(c.from,1),d=e.mapPos(c.to,-1);h<d&&l.push({from:h,to:d})}}}return new Nc(this.parser,t,i,s,r,o,l,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:r}=this.skipped[i];s<e.to&&r>e.from&&(this.fragments=i3(this.fragments,s,r),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 ty{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=kl;if(a){for(let c of s)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new At(Oi.none,[],[],o-r)},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 kl}}function i3(n,e,t){return Vr.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Go{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 Go(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Nc.create(e.facet(fr).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Go(i)}}ps.state=qt.define({create:Go.init,update(n,e){for(let t of e.effects)if(t.is(ps.setState))return t.value;return e.startState.facet(fr)!=e.state.facet(fr)?Go.init(e.state):n.apply(e)}});let db=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(db=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Ou=typeof navigator<"u"&&(!((_u=navigator.scheduling)===null||_u===void 0)&&_u.isInputPending)?()=>navigator.scheduling.isInputPending():null,xH=Ko.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(ps.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(ps.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=db(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,r=i.field(ps.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Ou?Math.max(25,e.timeRemaining()-5):1e9),l=r.context.treeLen<s&&i.doc.length>s+1e3,a=r.context.work(()=>Ou&&Ou()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:ps.setState.of(new Go(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Zs(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()}}}),fr=P.define({combine(n){return n.length?n[0]:null},enables:n=>[ps.state,xH,Ve.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class MH{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const AH=P.define(),qm=P.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 Fc(n){let e=n.facet(qm);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Na(n,e){let t="",i=n.tabSize,s=n.facet(qm)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r<e;r++)t+=s;return t}function Zm(n,e){n instanceof ae&&(n=new Od(n));for(let i of n.state.facet(AH)){let s=i(n,e);if(s!==void 0)return s}let t=Xt(n.state);return t.length>=e?DH(n,t,e):null}class Od{constructor(e,t={}){this.state=e,this.options=t,this.unit=Fc(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&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),r=this.countColumn(i,e-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return gl(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ub=new Se;function DH(n,e,t){let i=e.resolveStack(t),s=i.node.enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return fb(i,n,t)}function fb(n,e,t){for(let i=n;i;i=i.next){let s=_H(i.node);if(s)return s(jm.create(e,t,i))}return 0}function TH(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function _H(n){let e=n.type.prop(ub);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(Se.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>PH(o,!0,1,void 0,r&&!TH(o)?s.from:void 0)}return n.parent==null?OH:null}function OH(){return 0}class jm extends Od{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 jm(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(VH(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return fb(this.context.next,this.base,this.pos)}}function VH(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function EH(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.from<o?t:null;l=a.to}}function PH(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=s==n.pos+o,a=EH(n);return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}function s3({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const LH=200;function RH(){return ae.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+LH)return n;let r=t.sliceString(s.from,i);if(!e.some(c=>c.test(r)))return n;let{state:o}=n,l=-1,a=[];for(let{head:c}of o.selection.ranges){let h=o.doc.lineAt(c);if(h.from==l)continue;l=h.from;let d=Zm(o,h.from);if(d==null)continue;let u=/^\s*/.exec(h.text)[0],f=Na(o,d);u!=f&&a.push({from:h.from,to:h.from+u.length,insert:f})}return a.length?[n,{changes:a,sequential:!0}]:n})}const BH=P.define(),pb=new Se;function HH(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function NH(n,e,t){let i=Xt(n);if(i.length<t)return null;let s=i.resolveStack(t,1),r=null;for(let o=s;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(r&&l.from<e)break;let a=l.type.prop(pb);if(a&&(l.to<i.length-50||i.length==n.doc.length||!FH(l))){let c=a(l,n);c&&c.from<=t&&c.from>=e&&c.to>t&&(r=c)}}return r}function FH(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Ic(n,e,t){for(let i of n.facet(BH)){let s=i(n,e,t);if(s)return s}return NH(n,e,t)}function gb(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 Vd=ce.define({map:gb}),ph=ce.define({map:gb});function mb(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 Wr=qt.define({create(){return et.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(Vd)&&!IH(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(bb),s=i?et.replace({widget:new qH(i(e.state,t.value))}):n3;n=n.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(ph)&&(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,r)=>{s<i&&r>i&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(s,r)=>r<=i||s>=i}))}return n},provide:n=>Ve.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(n3.range(i,s))}return et.set(e,!0)}});function Wc(n,e,t){var i;let s=null;return(i=n.field(Wr,!1))===null||i===void 0||i.between(e,t,(r,o)=>{(!s||s.from>r)&&(s={from:r,to:o})}),s}function IH(n,e,t){let i=!1;return n.between(e,e,(s,r)=>{s==e&&r==t&&(i=!0)}),i}function Cb(n,e){return n.field(Wr,!1)?e:e.concat(ce.appendConfig.of(Sb()))}const WH=n=>{for(let e of mb(n)){let t=Ic(n.state,e.from,e.to);if(t)return n.dispatch({effects:Cb(n.state,[Vd.of(t),yb(n,t)])}),!0}return!1},zH=n=>{if(!n.state.field(Wr,!1))return!1;let e=[];for(let t of mb(n)){let i=Wc(n.state,t.from,t.to);i&&e.push(ph.of(i),yb(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function yb(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return Ve.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${s}.`)}const UH=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let s=n.lineBlockAt(i),r=Ic(e,s.from,s.to);r&&t.push(Vd.of(r)),i=(r?n.lineBlockAt(r.to):s).to+1}return t.length&&n.dispatch({effects:Cb(n.state,t)}),!!t.length},$H=n=>{let e=n.state.field(Wr,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(ph.of({from:i,to:s}))}),n.dispatch({effects:t}),!0},KH=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:WH},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:zH},{key:"Ctrl-Alt-[",run:UH},{key:"Ctrl-Alt-]",run:$H}],GH={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},bb=P.define({combine(n){return on(n,GH)}});function Sb(n){return[Wr,YH]}function wb(n,e){let{state:t}=n,i=t.facet(bb),s=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=Wc(n.state,l.from,l.to);a&&n.dispatch({effects:ph.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,s,e);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const n3=et.replace({widget:new class extends fh{toDOM(n){return wb(n,null)}}});class qH extends fh{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return wb(e,this.value)}}const ZH={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Vu extends Ir{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 jH(n={}){let e=Object.assign(Object.assign({},ZH),n),t=new Vu(e,!0),i=new Vu(e,!1),s=Ko.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(fr)!=o.state.facet(fr)||o.startState.field(Wr,!1)!=o.state.field(Wr,!1)||Xt(o.startState)!=Xt(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new or;for(let a of o.viewportLineBlocks){let c=Wc(o.state,a.from,a.to)?i:Ic(o.state,a.from,a.to)?t:null;c&&l.add(a.from,a.from,c)}return l.finish()}}),{domEventHandlers:r}=e;return[s,aH({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||K.empty},initialSpacer(){return new Vu(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let c=Wc(o.state,l.from,l.to);if(c)return o.dispatch({effects:ph.of(c)}),!0;let h=Ic(o.state,l.from,l.to);return h?(o.dispatch({effects:Vd.of(h)}),!0):!1}})}),Sb()]}const YH=Ve.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 Ed{constructor(e,t){this.specs=e;let i;function s(l){let a=we.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof ps?l=>l.prop(mo)==o.data:o?l=>l==o:void 0,this.style=cb(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new we(i):null,this.themeType=t.themeType}static define(e,t){return new Ed(e,t||{})}}const Jp=P.define(),vb=P.define({combine(n){return n.length?[n[0]]:null}});function Eu(n){let e=n.facet(Jp);return e.length?e:n.facet(vb)}function JH(n,e){let t=[QH],i;return n instanceof Ed&&(n.module&&t.push(Ve.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(vb.of(n)):i?t.push(Jp.computeN([Ve.darkTheme],s=>s.facet(Ve.darkTheme)==(i=="dark")?[n]:[])):t.push(Jp.of(n)),t}class XH{constructor(e){this.markCache=Object.create(null),this.tree=Xt(e.state),this.decorations=this.buildDeco(e,Eu(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Xt(e.state),i=Eu(e.state),s=i!=Eu(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!s&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return et.none;let i=new or;for(let{from:s,to:r}of e.visibleRanges)yH(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=et.mark({class:a})))},s,r);return i.finish()}}const QH=Vi.high(Ko.fromClass(XH,{decorations:n=>n.decorations})),eN=Ed.define([{tag:Y.meta,color:"#404740"},{tag:Y.link,textDecoration:"underline"},{tag:Y.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Y.emphasis,fontStyle:"italic"},{tag:Y.strong,fontWeight:"bold"},{tag:Y.strikethrough,textDecoration:"line-through"},{tag:Y.keyword,color:"#708"},{tag:[Y.atom,Y.bool,Y.url,Y.contentSeparator,Y.labelName],color:"#219"},{tag:[Y.literal,Y.inserted],color:"#164"},{tag:[Y.string,Y.deleted],color:"#a11"},{tag:[Y.regexp,Y.escape,Y.special(Y.string)],color:"#e40"},{tag:Y.definition(Y.variableName),color:"#00f"},{tag:Y.local(Y.variableName),color:"#30a"},{tag:[Y.typeName,Y.namespace],color:"#085"},{tag:Y.className,color:"#167"},{tag:[Y.special(Y.variableName),Y.macroName],color:"#256"},{tag:Y.definition(Y.propertyName),color:"#00c"},{tag:Y.comment,color:"#940"},{tag:Y.invalid,color:"#f00"}]),tN=Ve.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),kb=1e4,xb="()[]{}",Mb=P.define({combine(n){return on(n,{afterCursor:!0,brackets:xb,maxScanDistance:kb,renderMatch:nN})}}),iN=et.mark({class:"cm-matchingBracket"}),sN=et.mark({class:"cm-nonmatchingBracket"});function nN(n){let e=[],t=n.matched?iN:sN;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 rN=qt.define({create(){return et.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Mb);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=js(e.state,s.head,-1,i)||s.head>0&&js(e.state,s.head-1,1,i)||i.afterCursor&&(js(e.state,s.head,1,i)||s.head<e.state.doc.length&&js(e.state,s.head+1,-1,i));r&&(t=t.concat(i.renderMatch(r,e.state)))}return et.set(t,!0)},provide:n=>Ve.decorations.from(n)}),oN=[rN,tN];function lN(n={}){return[Mb.of(n),oN]}const aN=new Se;function Xp(n,e,t){let i=n.prop(e<0?Se.openedBy:Se.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 Qp(n){let e=n.type.prop(aN);return e?e(n.node):n}function js(n,e,t,i={}){let s=i.maxScanDistance||kb,r=i.brackets||xb,o=Xt(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let c=Xp(a.type,t,r);if(c&&a.from<a.to){let h=Qp(a);if(h&&(t>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return hN(n,e,t,a,h,c,r)}}return cN(n,e,t,o,l.type,s,r)}function hN(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},c=0,h=l==null?void 0:l.cursor();if(h&&(t<0?h.childBefore(i.from):h.childAfter(i.to)))do if(t<0?h.to<=i.from:h.from>=i.to){if(c==0&&r.indexOf(h.type.name)>-1&&h.from<h.to){let d=Qp(h);return{start:a,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(Xp(h.type,t,o))c++;else if(Xp(h.type,-t,o)){if(c==0){let d=Qp(h);return{start:a,end:d&&d.from<d.to?{from:d.from,to:d.to}:void 0,matched:!1}}c--}}while(t<0?h.prevSibling():h.nextSibling());return{start:a,matched:!1}}function cN(n,e,t,i,s,r,o){let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},h=n.doc.iterRange(e,t>0?n.doc.length:0),d=0;for(let u=0;!h.next().done&&u<=r;){let f=h.value;t<0&&(u+=f.length);let p=e+u*t;for(let g=t>0?0:f.length-1,b=t>0?f.length:-1;g!=b;g+=t){let y=o.indexOf(f[g]);if(!(y<0||i.resolveInner(p+g,1).type!=s))if(y%2==0==t>0)d++;else{if(d==1)return{start:c,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};d--}}t>0&&(u+=f.length)}return h.done?{start:c,matched:!1}:null}const dN=Object.create(null),r3=[Oi.none],o3=[],l3=Object.create(null),uN=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"]])uN[n]=fN(dN,e);function Pu(n,e){o3.indexOf(n)>-1||(o3.push(n),console.warn(e))}function fN(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let h=n[c]||Y[c];h?typeof h=="function"?a.length?a=a.map(h):Pu(c,`Modifier ${c} used at start of tag`):a.length?Pu(c,`Tag ${c} used as modifier`):a=Array.isArray(h)?h:[h]:Pu(c,`Unknown highlighting tag ${c}`)}for(let c of a)t.push(c)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+t.map(l=>l.id),r=l3[s];if(r)return r.id;let o=l3[s]=Oi.define({id:r3.length,name:i,props:[ab({[i]:t})]});return r3.push(o),o.id}Nt.RTL,Nt.LTR;function Fa(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function e0(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function pN(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function nc(n,e){if(!e.anchorNode)return!1;try{return e0(n,e.anchorNode)}catch{return!1}}function Ia(n){return n.nodeType==3?Ur(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Ca(n,e,t,i){return t?a3(n,e,t,i,-1)||a3(n,e,t,i,1):!1}function zr(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function zc(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function a3(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:bn(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=zr(n)+(s<0?0:1),n=r}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?bn(n):0}else return!1}}function bn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ym(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function gN(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 Ab(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 mN(n,e,t,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,d=!1;h&&!d;)if(h.nodeType==1){let u,f=h==a.body,p=1,g=1;if(f)u=gN(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(d=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let w=h.getBoundingClientRect();({scaleX:p,scaleY:g}=Ab(h,w)),u={left:w.left,right:w.left+h.clientWidth*p,top:w.top,bottom:w.top+h.clientHeight*g}}let b=0,y=0;if(s=="nearest")e.top<u.top?(y=-(u.top-e.top+o),t>0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y<u.top&&(y=-(u.top+y-e.top+o)));else{let w=e.bottom-e.top,M=u.bottom-u.top;y=(s=="center"&&w<=M?e.top+w/2-M/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-M+o)-u.top}if(i=="nearest"?e.left<u.left?(b=-(u.left-e.left+r),t>0&&e.right>u.right+b&&(b=e.right-u.right+b+r)):e.right>u.right&&(b=e.right-u.right+r,t<0&&e.left<u.left+b&&(b=-(u.left+b-e.left+r))):b=(i=="center"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:i=="start"==l?e.left-r:e.right-(u.right-u.left)+r)-u.left,b||y)if(f)c.scrollBy(b,y);else{let w=0,M=0;if(y){let k=h.scrollTop;h.scrollTop+=y/g,M=(h.scrollTop-k)*g}if(b){let k=h.scrollLeft;h.scrollLeft+=b/p,w=(h.scrollLeft-k)*p}e={left:e.left-w,top:e.top-M,right:e.right-w,bottom:e.bottom-M},w&&Math.abs(w-b)<1&&(i="nearest"),M&&Math.abs(M-y)<1&&(s="nearest")}if(f)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function CN(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}}let yN=class{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?bn(t):0),i,Math.min(e.focusOffset,i?bn(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}},no=null;function Db(n){if(n.setActive)return n.setActive();if(no)return n.focus(no);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(no==null?{get preventScroll(){return no={preventScroll:!0},!0}}:void 0),!no){no=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let h3;function Ur(n,e,t=e){let i=h3||(h3=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Mo(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 r=new KeyboardEvent("keydown",s);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function bN(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function Tb(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function SN(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,bn(t));;)if(i){if(t.nodeType!=1)return!1;let s=t.childNodes[i-1];s.contentEditable=="false"?i--:(t=s,i=bn(t))}else{if(t==n)return!0;i=zr(t),t=t.parentNode}}function _b(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function Ob(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=bn(t)}else if(t.parentNode&&!zc(t))i=zr(t),t=t.parentNode;else return null}}function Vb(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&&!zc(t))i=zr(t)+1,t=t.parentNode;else return null}}let Hi=class t0{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new t0(e.parentNode,zr(e),t)}static after(e,t){return new t0(e.parentNode,zr(e)+1,t)}};const Jm=[];let ct=class i0{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,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=i0.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=c3(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=c3(r)}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=bn(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!i0.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,h=i;a<this.children.length;a++){let d=this.children[a],u=c+d.length;if(c<e&&u>t)return d.domBoundsAround(e,t,c);if(u>=e&&s==-1&&(s=a,r=c),c>t&&d.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+d.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].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=Jm){this.markDirty();for(let s=e;s<t;s++){let r=this.children[s];r.parent==this&&i.indexOf(r)<0&&r.destroy()}this.children.splice(e,t-e,...i);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 Eb(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,r,o){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}};ct.prototype.breakAfter=0;function c3(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}let Eb=class{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 Pb(n,e,t,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[e]:null,d=r.length?r[r.length-1]:null,u=d?d.breakAfter:o;if(!(e==i&&h&&!o&&!u&&r.length<2&&h.merge(t,s,r.length?d:null,t==0,l,a))){if(i<c.length){let f=c[i];f&&(s<f.length||f.breakAfter&&(d!=null&&d.breakAfter))?(e==i&&(f=f.split(s),s=0),!u&&d&&f.merge(0,s,d,!0,0,a)?r[r.length-1]=f:((s||f.children.length&&!f.children[0].length)&&f.merge(0,s,null,!1,0,a),r.push(f))):f!=null&&f.breakAfter&&(d?d.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,t>0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[e].become(r[0]))e++,r.shift(),l=r.length?0:a;else break;!r.length&&e&&i<c.length&&!c[e-1].breakAfter&&c[i].merge(0,0,c[e-1],!1,l,a)&&e--,(e<i||r.length)&&n.replaceChildren(e,i,r)}}function Lb(n,e,t,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),d=e-t;for(let u of i)d+=u.length;n.length+=d,Pb(n,c,h,l,a,i,0,s,r)}let vi=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},s0=typeof document<"u"?document:{documentElement:{style:{}}};const n0=/Edge\/(\d+)/.exec(vi.userAgent),Rb=/MSIE \d/.test(vi.userAgent),r0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vi.userAgent),Pd=!!(Rb||r0||n0),d3=!Pd&&/gecko\/(\d+)/i.test(vi.userAgent),Lu=!Pd&&/Chrome\/(\d+)/.exec(vi.userAgent),u3="webkitFontSmoothing"in s0.documentElement.style,Bb=!Pd&&/Apple Computer/.test(vi.vendor),f3=Bb&&(/Mobile\/\w+/.test(vi.userAgent)||vi.maxTouchPoints>2);var le={mac:f3||/Mac/.test(vi.platform),windows:/Win/.test(vi.platform),linux:/Linux|X11/.test(vi.platform),ie:Pd,ie_version:Rb?s0.documentMode||6:r0?+r0[1]:n0?+n0[1]:0,gecko:d3,gecko_version:d3?+(/Firefox\/(\d+)/.exec(vi.userAgent)||[0,0])[1]:0,chrome:!!Lu,chrome_version:Lu?+Lu[1]:0,ios:f3,android:/Android\b/.test(vi.userAgent),webkit:u3,safari:Bb,webkit_version:u3?+(/\bAppleWebKit\/(\d+)/.exec(vi.userAgent)||[0,0])[1]:0,tabSize:s0.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const wN=256;let pr=class o0 extends ct{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 o0)||this.length-(t-e)+i.length>wN||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 o0(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 Hi(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 vN(this.dom,e,t)}},qo=class l0 extends ct{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(Tb(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,r,o){return i&&(!(i instanceof l0&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(Lb(this,e,t,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>e&&t.push(i<e?l.split(e-i):l),s<0&&i>=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new l0(this.mark,t,o)}domAtPos(e){return Nb(this,e)}coordsAt(e,t){return Ib(this,e,t)}};function vN(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?le.chrome||le.gecko||(e?(s--,o=1):r<i&&(r++,o=-1)):t<0?s--:r<i&&r++;let l=Ur(n,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return le.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?Ym(a,o<0):a||null}let Hb=class Il extends ct{static create(e,t,i){return new Il(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=Il.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,r,o){return i&&(!(i instanceof Il)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof Il&&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 $.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):$.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Hi.before(this.dom):Hi.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(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top<r.bottom);l+=o?-1:1);return Ym(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}},a0=class h0 extends ct{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof h0&&e.side==this.side}split(){return new h0(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?Hi.before(this.dom):Hi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return $.empty}get isHidden(){return!0}};pr.prototype.children=Hb.prototype.children=a0.prototype.children=Jm;function Nb(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Hi(t,0)}function Fb(n,e,t){let i,{children:s}=n;t>0&&e instanceof qo&&s.length&&(i=s[s.length-1])instanceof qo&&i.mark.eq(e.mark)?Fb(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Ib(n,e,t){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let d=0,u=0;d<c.children.length&&u<=h;d++){let f=c.children[d],p=u+f.length;p>=h&&(f.children.length?l(f,h-u):(!r||r.isHidden&&t>0)&&(p>h||u==p&&f.getSide()>0)?(r=f,o=h-u):(u<h||u==p&&f.getSide()<0&&!f.isHidden)&&(i=f,s=h-u)),u=p}}l(n,e);let a=(t<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?s:o),t):kN(n)}function kN(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Ia(e);return t[t.length-1]||null}function c0(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 p3=Object.create(null);function Uc(n,e,t){if(n==e)return!0;n||(n=p3),e||(e=p3);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 r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function d0(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 xN(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}let oi=class Wl extends ct{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof Wl))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),Lb(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new Wl;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 r=i;r<this.children.length;r++)t.append(this.children[r],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){Uc(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Fb(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=c0(t,this.attrs||{})),i&&(this.attrs=c0({class:i},this.attrs||{}))}domAtPos(e){return Nb(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Tb(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&&(d0(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&&ct.get(s)instanceof qo;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=ct.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!le.ios||!this.children.some(r=>r instanceof pr))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof pr)||/[^ -~]/.test(i.text))return null;let s=Ia(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=Ib(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight<r){let o=(r-s.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(e){return e instanceof Wl&&this.children.length==0&&e.children.length==0&&Uc(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 r=e.children[i],o=s+r.length;if(o>=t){if(r instanceof Wl)return r;if(o>t)break}s=o+r.breakAfter}return null}},ya=class rc extends ct{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,r,o){return i&&(!(i instanceof rc)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Hi.before(this.dom):Hi.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new rc(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return Jm}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):$.empty}domBoundsAround(){return null}become(e){return e instanceof rc&&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){return this.widget.coordsAt(this.dom,e,t)}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}},Xm=class{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 Qs=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Qs||(Qs={}));let $i=class extends Bt{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 Qm(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 Zo(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:r,end:o}=$b(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new Zo(e,i,s,t,e.widget||null,!0)}static line(e){return new e2(e)}static set(e,t=!1){return K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};$i.none=K.empty;let Qm=class Wb extends $i{constructor(e){let{start:t,end:i}=$b(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 Wb&&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))&&Uc(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)}};Qm.prototype.point=!1;let e2=class zb extends $i{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof zb&&this.spec.class==e.spec.class&&Uc(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)}};e2.prototype.mapMode=fe.TrackBefore;e2.prototype.point=!0;let Zo=class Ub extends $i{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?fe.TrackBefore:fe.TrackAfter:fe.TrackDel}get type(){return this.startSide!=this.endSide?Qs.WidgetRange:this.startSide<=0?Qs.WidgetBefore:Qs.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Ub&&MN(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)}};Zo.prototype.point=!0;function $b(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 MN(n,e){return n==e||!!(n&&e&&n.compare(e))}function u0(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)}let Ru=class Kb{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 ya&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new oi),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Gh(new a0(-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 ya)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){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=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Gh(new pr(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,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof Zo){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 l=t-e;if(i instanceof Zo)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ya(i.widget||jo.block,l,i));else{let a=Hb.create(i.widget||jo.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e<t||i.startSide>0),h=!a.isEditable&&(e<t||r>s.length||i.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(d.append(Gh(new a0(1),s),r),r=s.length+Math.max(0,r-s.length)),d.append(Gh(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?e<t||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new Kb(e,t,i,r);return o.openEnd=K.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function Gh(n,e){for(let t of e)n=new qo(t,[n],n.length);return n}let jo=class extends Xm{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}};jo.inline=new jo("span");jo.block=new jo("div");var Jt=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Jt||(Jt={}));const $r=Jt.LTR,t2=Jt.RTL;function Gb(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const AN=Gb("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),DN=Gb("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),f0=Object.create(null),Rs=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);f0[e]=t,f0[t]=-e}function qb(n){return n<=247?AN[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?DN[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const TN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;let qn=class{get dir(){return this.level%2?t2:$r}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 r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}};function Zb(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||!Zb(i.inner,s.inner))return!1}return!0}const Ue=[];function _N(n,e,t,i,s){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:e,l=r<i.length?i[r].from:t,a=r?256:s;for(let c=o,h=a,d=a;c<l;c++){let u=qb(n.charCodeAt(c));u==512?u=h:u==8&&d==4&&(u=16),Ue[c]=u==4?2:u,u&7&&(d=u),h=u}for(let c=o,h=a,d=a;c<l;c++){let u=Ue[c];if(u==128)c<l-1&&h==Ue[c+1]&&h&24?u=Ue[c]=h:Ue[c]=256;else if(u==64){let f=c+1;for(;f<l&&Ue[f]==64;)f++;let p=c&&h==8||f<t&&Ue[f]==8?d==1?1:8:256;for(let g=c;g<f;g++)Ue[g]=p;c=f-1}else u==8&&d==1&&(Ue[c]=1);h=u,u&7&&(d=u)}}}function ON(n,e,t,i,s){let r=s==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,h=o<i.length?i[o].from:t;for(let d=c,u,f,p;d<h;d++)if(f=f0[u=n.charCodeAt(d)])if(f<0){for(let g=l-3;g>=0;g-=3)if(Rs[g+1]==-f){let b=Rs[g+2],y=b&2?s:b&4?b&1?r:s:0;y&&(Ue[d]=Ue[Rs[g]]=y),l=g;break}}else{if(Rs.length==189)break;Rs[l++]=d,Rs[l++]=u,Rs[l++]=a}else if((p=Ue[d])==2||p==1){let g=p==s;a=g?0:1;for(let b=l-3;b>=0;b-=3){let y=Rs[b+2];if(y&2)break;if(g)Rs[b+2]|=2;else{if(y&4)break;Rs[b+2]|=4}}}}}function VN(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=s<t.length?t[s].from:e;for(let a=o;a<l;){let c=Ue[a];if(c==256){let h=a+1;for(;;)if(h==l){if(s==t.length)break;h=t[s++].to,l=s<t.length?t[s].from:e}else if(Ue[h]==256)h++;else break;let d=r==1,u=(h<e?Ue[h]:i)==1,f=d==u?d?1:2:i;for(let p=h,g=s,b=g?t[g-1].to:n;p>a;)p==b&&(p=t[--g].from,b=g?t[g-1].to:n),Ue[--p]=f;a=h}else r=c,a++}}}function p0(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,c=0;a<t;){let h=!0,d=!1;if(c==r.length||a<r[c].from){let g=Ue[a];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c<r.length&&p==r[c].from){if(d)break e;let g=r[c];if(!h)for(let b=g.to,y=c+1;;){if(b==t)break e;if(y<r.length&&r[y].from==b)b=r[y++].to;else{if(Ue[b]==l)break e;break}}if(c++,u)u.push(g);else{g.from>a&&o.push(new qn(a,g.from,f));let b=g.direction==$r!=!(f%2);g0(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(h?Ue[p]!=l:Ue[p]==l))break;p++}u?p0(n,a,p,i+1,s,u,o):a<p&&o.push(new qn(a,p,f)),a=p}else for(let a=t,c=r.length;a>e;){let h=!0,d=!1;if(!c||a>r[c-1].to){let g=Ue[a-1];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c&&p==r[c-1].to){if(d)break e;let g=r[--c];if(!h)for(let b=g.from,y=c;;){if(b==e)break e;if(y&&r[y-1].to==b)b=r[--y].from;else{if(Ue[b-1]==l)break e;break}}if(u)u.push(g);else{g.to<a&&o.push(new qn(g.to,a,f));let b=g.direction==$r!=!(f%2);g0(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==e||(h?Ue[p-1]!=l:Ue[p-1]==l))break;p--}u?p0(n,p,a,i+1,s,u,o):p<a&&o.push(new qn(p,a,f)),a=p}}function g0(n,e,t,i,s,r,o){let l=e%2?2:1;_N(n,s,r,i,l),ON(n,s,r,i,l),VN(s,r,i,l),p0(n,s,r,e,t,i,o)}function EN(n,e,t){if(!n)return[new qn(0,0,e==t2?1:0)];if(e==$r&&!t.length&&!TN.test(n))return jb(n.length);if(t.length)for(;n.length>Ue.length;)Ue[Ue.length]=256;let i=[],s=e==$r?0:1;return g0(n,s,s,t,0,n.length,i),i}function jb(n){return[new qn(0,n,0)]}let Yb="";function PN(n,e,t,i,s){var r;let o=i.head-n.from,l=qn.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],c=a.side(s,t);if(o==c){let u=l+=s?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!s,t),c=a.side(s,t)}let h=de(n.text,o,a.forward(s,t));(h<a.from||h>a.to)&&(h=c),Yb=n.text.slice(Math.min(o,h),Math.max(o,h));let d=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return d&&h==c&&d.level+(s?0:1)<a.level?T.cursor(d.side(!s,t)+n.from,d.forward(s,t)?1:-1,d.level):T.cursor(h+n.from,a.forward(s,t)?-1:1,a.level)}function LN(n,e,t){for(let i=e;i<t;i++){let s=qb(n.charCodeAt(i));if(s==1)return $r;if(s==2||s==4)return t2}return $r}const Jb=P.define(),Xb=P.define(),Qb=P.define(),eS=P.define(),m0=P.define(),tS=P.define(),iS=P.define(),sS=P.define({combine:n=>n.some(e=>e)}),RN=P.define({combine:n=>n.some(e=>e)}),nS=P.define();let Bu=class C0{constructor(e,t="nearest",i="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new C0(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 C0(T.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}};const qh=ce.define({map:(n,e)=>n.map(e)}),rS=ce.define();function fn(n,e,t){let i=n.facet(eS);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 Ln=P.define({combine:n=>n.length?n[0]:!0});let BN=0;const zl=P.define();let g3=class y0{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new y0(BN++,e,i,s,l=>{let a=[zl.of(l)];return o&&a.push(Wa.of(c=>{let h=c.plugin(l);return h?o(h):$i.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return y0.define(i=>new e(i),t)}},Hu=class{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(fn(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){fn(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){fn(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}};const oS=P.define(),i2=P.define(),Wa=P.define(),lS=P.define(),s2=P.define(),aS=P.define();function m3(n,e){let t=n.state.facet(aS);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(n):r),s=[];return K.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let c=r-e.from,h=o-e.from,d=s;for(let u=l.length-1;u>=0;u--,a--){let f=l[u].spec.bidiIsolate,p;if(f==null&&(f=LN(e.text,c,h)),a>0&&d.length&&(p=d[d.length-1]).to==c&&p.direction==f)p.to=h,d=p.inner;else{let g={from:c,to:h,direction:f,inner:[]};d.push(g),d=g.inner}}}}),s}const hS=P.define();function cS(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(hS)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const Ul=P.define();let er=class oc{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new oc(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,r=0,o=0,l=0;;s++){let a=s==e.length?null:e[s],c=o-l,h=a?a.fromB:1e9;for(;r<t.length&&t[r]<h;){let d=t[r],u=t[r+1],f=Math.max(l,d),p=Math.min(h,u);if(f<=p&&new oc(f+c,p+c,f,p).addToSet(i),u>h)break;r+=2}if(!a)return i;new oc(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}},C3=class dS{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Be.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new er(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new dS(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}},y3=class extends ct{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=$i.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 oi],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new er(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:c,toA:h})=>h<this.minWidthFrom||c>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:!UN(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?NN(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new er(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(le.ie||le.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=WN(o,l,e.changes);return i=er.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),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 o=le.chrome||le.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof ya&&o.widget instanceof b3&&r.push(o.dom);s.updateGaps(r)}updateChildren(e,t,i){let s=i?i.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let o=s.length-1;;o--){let l=o>=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:d}=l,u,f,p,g;if(i&&i.range.fromB<d&&i.range.toB>h){let k=Ru.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),V=Ru.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);f=k.breakAtStart,p=k.openStart,g=V.openEnd;let R=this.compositionView(i);V.breakAtStart?R.breakAfter=1:V.content.length&&R.merge(R.length,R.length,V.content[0],!1,V.openStart,0)&&(R.breakAfter=V.content[0].breakAfter,V.content.shift()),k.content.length&&R.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(R).concat(V.content)}else({content:u,breakAtStart:f,openStart:p,openEnd:g}=Ru.build(this.view.state.doc,h,d,this.decorations,this.dynamicDecorationMap));let{i:b,off:y}=r.findPos(c,1),{i:w,off:M}=r.findPos(a,-1);Pb(this,w,M,b,y,u,f,p,g)}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(rS)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new pr(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new qo(s,[t],t.length);let i=new oi;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=ct.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].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,r=!s&&nc(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(le.gecko&&l.empty&&!this.hasComposition&&HN(a)){let d=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(d,a.node.childNodes[a.offset]||null)),a=c=new Hi(d,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!Ca(a.node,a.offset,h.anchorNode,h.anchorOffset)||!Ca(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{le.android&&le.chrome&&this.dom.contains(h.focusNode)&&zN(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=Fa(this.view.root);if(d)if(l.empty){if(le.gecko){let u=FN(a.node,a.offset);if(u&&u!=3){let f=(u==1?Ob:Vb)(a.node,a.offset);f&&(a=new Hi(f.node,f.offset))}}d.collapse(a.node,a.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(a.node,a.offset);try{d.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Hi(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Hi(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ca(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=Fa(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=oi.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=t.from&&i.collapse(s,r)}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 r=ct.get(t.childNodes[s]);r instanceof oi&&(i=r.domAtPos(0))}for(let s=e.offset-1;!i&&s>=0;s--){let r=ct.get(t.childNodes[s]);r instanceof oi&&(i=r.domAtPos(r.length))}return i?new Hi(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=ct.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 oi)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,s=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(a<e)break;if(c<=e&&(c<e||l.covers(-1))&&(a>e||l.covers(1))&&(!i||l instanceof oi&&!(i instanceof oi&&t>=0)))i=l,s=c;else if(i&&c==e&&a==e&&l instanceof ya&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}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 oi))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof pr))return null;let r=de(s.text,i);if(r==i)return null;let o=Ur(s.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Jt.LTR;for(let c=0,h=0;h<this.children.length;h++){let d=this.children[h],u=c+d.length;if(u>s)break;if(c>=i){let f=d.dom.getBoundingClientRect();if(t.push(f.height),o){let p=d.dom.lastChild,g=p?Ia(p):[];if(g.length){let b=g[g.length-1],y=a?b.right-f.left:f.right-b.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+d.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Jt.RTL:Jt.LTR}measureTextSize(){for(let r of this.children)if(r instanceof oi){let o=r.measureTextSize();if(o)return o}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 r=Ia(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.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 Eb(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push($i.replace({widget:new b3(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return $i.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Wa).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(lS).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(K.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 c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(nS))try{if(c(this.view,e.range,e))return!0}catch(h){fn(this.view.state,h,"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 r=cS(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;mN(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Jt.LTR)}};function HN(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")}let b3=class extends Xm{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}};function uS(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=Ob(t.focusNode,t.focusOffset),s=Vb(t.focusNode,t.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=ct.get(s.node);if(!l||l instanceof pr&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=ct.get(i.node);!a||a instanceof pr&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function NN(n,e,t){let i=uS(n,t);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc,c=new er(a.mapPos(r),a.mapPos(o),r,o),h=[];for(let d=s.parentNode;;d=d.parentNode){let u=ct.get(d);if(u instanceof qo)h.push({node:d,deco:u.mark});else{if(u instanceof oi||d.nodeName=="DIV"&&d.parentNode==n.contentDOM)return{range:c,text:s,marks:h,line:d};if(d!=n.contentDOM)h.push({node:d,deco:new Qm({inclusive:!0,attributes:xN(d),tagName:d.tagName.toLowerCase()})});else return null}}}function FN(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 IN=class{constructor(){this.changes=[]}compareRange(e,t){u0(e,t,this.changes)}comparePoint(e,t){u0(e,t,this.changes)}};function WN(n,e,t){let i=new IN;return K.compare(n,e,t,i),i.changes}function zN(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 UN(n,e){let t=!1;return e&&n.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(t=!0)}),t}function $N(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return T.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=de(s.text,r,!1):l=de(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=de(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=de(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return T.range(o+s.from,l+s.from)}function KN(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function GN(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Nu(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function S3(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function w3(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function b0(n,e,t){let i,s,r,o,l=!1,a,c,h,d;for(let p=n.firstChild;p;p=p.nextSibling){let g=Ia(p);for(let b=0;b<g.length;b++){let y=g[b];s&&Nu(s,y)&&(y=S3(w3(y,s.bottom),s.top));let w=KN(e,y),M=GN(t,y);if(w==0&&M==0)return p.nodeType==3?v3(p,e,t):b0(p,e,t);if(!i||o>M||o==M&&r>w){i=p,s=y,r=w,o=M;let k=M?t<y.top?-1:1:w?e<y.left?-1:1:0;l=!k||(k>0?b<g.length-1:b>0)}w==0?t>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):t<y.top&&(!d||d.top>y.top)&&(c=p,d=y):h&&Nu(h,y)?h=w3(h,y.bottom):d&&Nu(d,y)&&(d=S3(d,y.top))}}if(h&&h.bottom>=t?(i=a,s=h):d&&d.top<=t&&(i=c,s=d),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return v3(i,u,t);if(l&&i.contentEditable!="false")return b0(i,u,t);let f=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:f}}function v3(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=Ur(n,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let d=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&d<r){let u=e>=(h.left+h.right)/2,f=u;if((le.chrome||le.gecko)&&Ur(n,l).getBoundingClientRect().left==h.right&&(f=!u),d<=0)return{node:n,offset:l+(f?1:0)};s=l+(f?1:0),r=d}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function fS(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:d}=e,u=d-l;if(u<0)return 0;if(u>c)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,V=!1;a=n.elementAtHeight(u),a.type!=Qs.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(V)return t?null:0;V=!0,i=-i}d=l+u;let f=a.from;if(f<n.viewport.from)return n.viewport.from==0?0:t?null:k3(n,o,a,h,d);if(f>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:k3(n,o,a,h,d);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,b=g.elementFromPoint(h,d);b&&!n.contentDOM.contains(b)&&(b=null),b||(h=Math.max(o.left+1,Math.min(o.right-1,h)),b=g.elementFromPoint(h,d),b&&!n.contentDOM.contains(b)&&(b=null));let y,w=-1;if(b&&((s=n.docView.nearest(b))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,d);k&&({offsetNode:y,offset:w}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,d);k&&({startContainer:y,startOffset:w}=k,(!n.contentDOM.contains(y)||le.safari&&qN(y,w,h)||le.chrome&&ZN(y,w,h))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let k=oi.find(n.docView,f);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:w}=b0(k.dom,h,d))}let M=n.docView.nearest(y);if(!M)return null;if(M.isWidget&&((r=M.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=M.dom.getBoundingClientRect();return e.y<k.top||e.y<=k.bottom&&e.x<=(k.left+k.right)/2?M.posAtStart:M.posAtEnd}else return M.localPosFromDOM(y,w)+M.posAtStart}function k3(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+lr(o,r,n.state.tabSize)}function qN(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 Ur(n,i-1,i).getBoundingClientRect().left>t}function ZN(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Ur(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function jN(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==Qs.Text))return i}return t}function YN(n,e,t,i){let s=jN(n,e.head),r=!i||s.type!=Qs.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==Jt.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return T.cursor(a,t?-1:1)}return T.cursor(t?s.to:s.from,t?-1:1)}function x3(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let c=PN(s,r,o,l,t),h=Yb;if(!c){if(s.number==(t?n.state.doc.lines:1))return l;h=` `,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),c=n.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function JN(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==He.Space&&(s=o),s==o}}function XN(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return T.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,e.assoc||-1),h=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let f=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-f.from))),l=(r<0?f.top:f.bottom)+h}let d=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let f=0;;f+=10){let p=l+(u+f)*r,g=fS(n,{x:d,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let b=n.docView.coordsForChar(g),y=!b||p<b.top?-1:1;return T.cursor(g,y,void 0,o)}}}function lc(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function Fu(n,e,t){let i=lc(n.state.facet(s2).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:T.cursor(i,i<t.from?1:-1)}let QN=class{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,le.safari&&e.contentDOM.addEventListener("input",()=>null),le.gecko&&mF(e.contentDOM.ownerDocument)}handleEvent(e){!aF(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=eF(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,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&&iF.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),le.android&&le.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return le.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=pS.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||tF.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,Mo(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:le.safari&&!le.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 M3(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){fn(t.state,s)}}}function eF(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 r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(M3(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(M3(i.value,o))}}for(let i in ks)t(i).handlers.push(ks[i]);for(let i in is)t(i).observers.push(is[i]);return e}const pS=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],tF="dthko",iF=[16,17,18,20,91,92,224,225],Zh=6;function jh(n){return Math.max(0,n)*.7+8}function sF(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}let nF=class{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=CN(e.contentDOM),this.atoms=e.state.facet(s2).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ae.allowMultipleSelections)&&rF(e,t),this.dragging=lF(e,t)&&CS(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&&sF(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=cS(this.view);e.clientX-a.left<=s+Zh?t=-jh(s-e.clientX):e.clientX+a.right>=o-Zh&&(t=jh(e.clientX-o)),e.clientY-a.top<=r+Zh?i=-jh(r-e.clientY):e.clientY+a.bottom>=l-Zh&&(i=jh(e.clientY-l)),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],r=null;if(s.empty){let o=lc(this.atoms,s.from,0);o!=s.from&&(r=T.cursor(o,-1))}else{let o=lc(this.atoms,s.from,-1),l=lc(this.atoms,s.to,1);(o!=s.from||l!=s.to)&&(r=T.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?T.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 rF(n,e){let t=n.state.facet(Jb);return t.length?t[0](e):le.mac?e.metaKey:e.ctrlKey}function oF(n,e){let t=n.state.facet(Xb);return t.length?t[0](e):le.mac?!e.altKey:!e.ctrlKey}function lF(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Fa(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function aF(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=ct.get(t))&&i.ignoreEvent(e))return!1;return!0}const ks=Object.create(null),is=Object.create(null),gS=le.ie&&le.ie_version<15||le.ios&&le.webkit_version<604;function hF(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(),mS(n,t.value)},50)}function mS(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(S0!=null&&t.selection.ranges.every(a=>a.empty)&&S0==r.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let d=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:d},range:T.cursor(c.from+d.length)}})}else o?i=t.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:T.cursor(a.from+c.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}is.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};ks.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);is.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};is.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};ks.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(Qb))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=uF(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new nF(n,e,t,i)),i&&n.observer.ignore(()=>{Db(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function A3(n,e,t,i){if(i==1)return T.cursor(e,t);if(i==2)return $N(n.state,e,t);{let s=oi.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,T.range(o,l)}}let D3=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function cF(n,e,t,i){let s=oi.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&D3(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&D3(t,i,l)?1:o&&o.bottom>=i?-1:1}function T3(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:cF(n,t,e.clientX,e.clientY)}}const dF=le.ie&&le.ie_version<=11;let _3=null,O3=0,V3=0;function CS(n){if(!dF)return n.detail;let e=_3,t=V3;return _3=n,V3=Date.now(),O3=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(O3+1)%3:1}function uF(n,e){let t=T3(n,e),i=CS(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=T3(n,r),c,h=A3(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let d=A3(n,t.pos,t.bias,i),u=Math.min(d.from,h.from),f=Math.max(d.to,h.to);h=u<h.from?T.range(u,f):T.range(f,u)}return o?s.replaceRange(s.main.extend(h.from,h.to)):l&&i==1&&s.ranges.length>1&&(c=fF(s,a.pos))?c:l?s.addRange(h):T.create([h])}}}function fF(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 T.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}ks.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 r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=T.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};ks.dragend=n=>(n.inputState.draggedContent=null,!1);function E3(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&oF(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}ks.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,r=()=>{++s==t.length&&E3(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return E3(n,e,i,!0),!0}return!1};ks.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=gS?null:e.clipboardData;return t?(mS(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(hF(n),!1)};function pF(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 gF(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:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let S0=null;ks.copy=ks.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=gF(n.state);if(!t&&!s)return!1;S0=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=gS?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(pF(n,t),!1)};const yS=gi.define();function bS(n,e){let t=[];for(let i of n.facet(iS)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:yS.of(!0)}):null}function SS(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=bS(n.state,e);t?n.dispatch(t):n.update([])}},10)}is.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),SS(n)};is.blur=n=>{n.observer.clearSelectionRange(),SS(n)};is.compositionstart=is.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};is.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,le.chrome&&le.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};is.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};ks.beforeinput=(n,e)=>{var t;let i;if(le.chrome&&le.android&&(i=pS.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return le.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),le.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>is.compositionend(n,e),20),!1};const P3=new Set;function mF(n){P3.has(n)||(P3.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const L3=["pre-wrap","normal","pre-line","break-spaces"];let CF=class{constructor(e){this.lineWrapping=e,this.doc=$.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}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 L3.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,r,o){let l=L3.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}},yF=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},Rn=class wS{constructor(e,t,i,s,r){this.from=e,this.length=t,this.top=i,this.height=s,this._content=r}get type(){return typeof this._content=="number"?Qs.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 Zo?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 wS(this.from,this.length+e.length,this.top,this.height+e.height,t)}};var nt=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(nt||(nt={}));const ac=.001;let Cs=class hc{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,t){this.height!=t&&(Math.abs(this.height-t)>ac&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return hc.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:d}=s[l],u=r.lineAt(a,nt.ByPosNoHeight,i.setDoc(t),0,0),f=u.to>=c?u:r.lineAt(c,nt.ByPosNoHeight,i,0,0);for(d+=f.to-c,c=f.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,nt.ByPosNoHeight,i,0,0));h+=u.from-a,a=u.from;let p=wF.build(i.setDoc(o),e,h,d);r=r.replace(a,c,p)}return r.updateHeight(i,0)}static empty(){return new zs(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,s=0,r=0;for(;;)if(t==i)if(s>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[t++];l&&(s+=l.size)}else{let l=e[--i];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new bF(hc.of(e.slice(0,t)),o,hc.of(e.slice(i)))}};Cs.prototype.size=1;let vS=class extends Cs{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,s){return new Rn(s,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,s,r){return this.blockAt(0,i,s,r)}forEachLine(e,t,i,s,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},zs=class w0 extends vS{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new Rn(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof w0||s instanceof Ao&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Ao?s=new w0(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):Cs.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,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:""})`}},Ao=class ds extends Cs{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let c=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=t.doc.lineAt(c),d=l+h.length*a,u=Math.max(i,e-d/2);return new Rn(h.from,h.length,u,d,0)}else{let c=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:h,length:d}=t.doc.line(r+c);return new Rn(h,d,i+l*c,l,0)}}lineAt(e,t,i,s,r){if(t==nt.ByHeight)return this.blockAt(e,i,s,r);if(t==nt.ByPosNoHeight){let{from:f,to:p}=i.doc.lineAt(e);return new Rn(f,p-f,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),c=i.doc.lineAt(e),h=l+c.length*a,d=c.number-o,u=s+l*d+a*(c.from-r-d);return new Rn(c.from,c.length,Math.max(s,Math.min(u,s+this.height-h)),h,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,r);for(let h=e,d=s;h<=t;){let u=i.doc.lineAt(h);if(h==e){let p=u.number-l;d+=a*p+c*(e-r-p)}let f=a+c*u.length;o(new Rn(u.from,u.length,d,f,0)),d+=f,h=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ds?i[i.length-1]=new ds(r.length+s):i.push(null,new ds(s-1))}if(e>0){let r=i[0];r instanceof ds?i[0]=new ds(e+r.length):i.unshift(new ds(e-1),null)}return Cs.of(i)}decomposeLeft(e,t){t.push(new ds(e-1),null)}decomposeRight(e,t){t.push(null,new ds(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new ds(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let d=s.heights[s.index++];a==-1?a=d:Math.abs(d-a)>=ac&&(a=-2);let u=new zs(h,d);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new ds(r-l).updateHeight(e,l));let c=Cs.of(o);return(a<0||Math.abs(c.height-this.height)>=ac||Math.abs(a-this.heightMetrics(e,t).perLine)>=ac)&&(e.heightChanged=!0),c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},bF=class extends Cs{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 r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,s):this.right.blockAt(e,t,r,s+this.left.length+this.break)}lineAt(e,t,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=t==nt.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,i,s,r):this.right.lineAt(e,t,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=t==nt.ByPosNoHeight?nt.ByPosNoHeight:nt.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,s,r).join(c)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,s,r,o),t>=a&&this.right.forEachLine(e,t,i,l,a,o);else{let c=this.lineAt(a,nt.ByPos,i,s,r);e<c.from&&this.left.forEachLine(e,c.from-1,i,s,r,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,l,a,o)}}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 r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&R3(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),R3(r,l)}return Cs.of(r)}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?Cs.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function R3(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof Ao&&(i=n[e+1])instanceof Ao&&n.splice(e-1,3,new Ao(t.length+1+i.length))}const SF=5;let wF=class kS{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 zs?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new zs(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,r=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new vS(o,s,i)):(o||r||s>=SF)&&this.addLineDeco(s,r,o)}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 zs(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new Ao(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 zs)return e;let t=new zs(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 zs)&&!this.isCovered?this.nodes.push(new zs(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 zs&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,t,i,s){let r=new kS(i,e);return K.spans(t,i,s,r,0),r.finish(i)}};function vF(n,e,t){let i=new kF;return K.compare(n,e,t,i,0),i.changes}let kF=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,s){(e<t||i&&i.heightRelevant||s&&s.heightRelevant)&&u0(e,t,this.changes,5)}};function xF(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,r=Math.max(0,t.left),o=Math.min(s.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(s.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=i.body;)if(c.nodeType==1){let h=c,d=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=c==n.parentNode?u.bottom:Math.min(a,u.bottom)}c=d.position=="absolute"||d.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function MF(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}let Iu=class{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],r=t[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e,t){return $i.replace({widget:new AF(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},AF=class extends Xm{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}},B3=class{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=H3,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Jt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(i2).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new CF(t),this.stateDeco=e.facet(Wa).filter(i=>typeof i!="function"),this.heightMap=Cs.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle.setDoc(e.doc),[new er(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=$i.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:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Yh(r,o))}}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?H3:new _F(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($l(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Wa).filter(h=>typeof h!="function");let s=e.changedRanges,r=er.extendWithRanges(s,vF(i,this.stateDeco,e?e.changes:Be.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(RN)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Jt.RTL:Jt.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:V}=Ab(t,l);(k>.005&&Math.abs(this.scaleX-k)>.005||V>.005&&Math.abs(this.scaleY-V)>.005)&&(this.scaleX=k,this.scaleY=V,c|=8,o=a=!0)}let d=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=u)&&(this.paddingTop=d,this.paddingBottom=u,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=_b(e.scrollDOM);let p=(this.printing?MF:xF)(t,this.paddingTop),g=p.top-this.pixelViewport.top,b=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(k)&&(o=!0),o||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:V,charWidth:R,textHeight:H}=e.docView.measureTextSize();o=V>0&&s.refresh(r,V,R,H,w/R,k),o&&(e.docView.minWidth=0,c|=8)}g>0&&b>0?h=Math.max(g,b):g<0&&b<0&&(h=Math.min(g,b)),s.heightChanged=!1;for(let V of this.viewports){let R=V.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(V);this.heightMap=(o?Cs.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle,[new er(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new yF(V.from,R))}s.heightChanged&&(c|=2)}let M=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||M)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}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,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Yh(s.lineAt(o-i*1e3,nt.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,nt.ByHeight,r,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=s.lineAt(c,nt.ByPos,r,0,0),u;t.y=="center"?u=(d.top+d.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c<a.from?u=d.top:u=d.bottom-h,a=new Yh(s.lineAt(u-1e3/2,nt.ByHeight,r,0,0).from,s.lineAt(u+h+1e3/2,nt.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new Yh(this.heightMap.lineAt(i,nt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,nt.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,nt.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,nt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r<l+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 Iu(t.mapPos(s.from),t.mapPos(s.to),s.size));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=Jt.LTR&&!i)return[];let l=[],a=(h,d,u,f)=>{if(d-h<r)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let y of g)if(y>h&&y<d){a(h,y-10,u,f),a(y+10,d,u,f);return}let b=TF(e,y=>y.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)<r&&Math.abs(y.to-d)<r&&!g.some(w=>y.from<w&&y.to>w));if(!b){if(d<u.to&&t&&i&&t.visibleRanges.some(y=>y.from<=d&&y.to>=d)){let y=t.moveToLineBoundary(T.cursor(d),!1,!0).head;y>h&&(d=y)}b=new Iu(h,d,this.gapSize(u,h,d,f))}l.push(b)},c=h=>{if(h.length<o||h.type!=Qs.Text)return;let d=DF(h.from,h.to,this.stateDeco);if(d.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,f,p;if(i){let g=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,y;if(u!=null){let w=Xh(d,u),M=((this.visibleBottom-this.visibleTop)/2+g)/h.height;b=w-M,y=w+M}else b=(this.visibleTop-h.top-g)/h.height,y=(this.visibleBottom-h.top+g)/h.height;f=Jh(d,b),p=Jh(d,y)}else{let g=d.total*this.heightOracle.charWidth,b=s*this.heightOracle.charWidth,y,w;if(u!=null){let M=Xh(d,u),k=((this.pixelViewport.right-this.pixelViewport.left)/2+b)/g;y=M-k,w=M+k}else y=(this.pixelViewport.left-b)/g,w=(this.pixelViewport.right+b)/g;f=Jh(d,y),p=Jh(d,w)}f>h.from&&a(h.from,f,h,d),p<h.to&&a(p,h.to,h,d)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(e,t,i,s){let r=Xh(s,i)-Xh(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){Iu.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=$i.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];K.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||$l(this.heightMap.lineAt(e,nt.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)||$l(this.heightMap.lineAt(this.scaler.fromDOM(e),nt.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 $l(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}},Yh=class{constructor(e,t){this.from=e,this.to=t}};function DF(n,e,t){let i=[],s=n,r=0;return K.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(i.push({from:s,to:e}),r+=e-s),{total:r,ranges:i}}function Jh({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:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Xh(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 TF(n,e){for(let t of n)if(e(t))return t}const H3={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};let _F=class xS{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=t.lineAt(l,nt.ByPos,e,0,0).top,h=t.lineAt(a,nt.ByPos,e,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return s+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,s=r.domBottom}}fromDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,s=r.domBottom}}eq(e){return e instanceof xS?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 $l(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new Rn(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(s=>$l(s,e)):n._content)}const Qh=P.define({combine:n=>n.join(" ")}),v0=P.define({combine:n=>n.indexOf(!0)>-1}),k0=we.newName(),MS=we.newName(),AS=we.newName(),DS={"&light":"."+MS,"&dark":"."+AS};function x0(n,e,t){return new we(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 OF=x0("."+k0,{"&":{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},".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:"#444"},".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},"&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:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".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"}},DS),Kl="";let VF=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ae.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Kl}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=ct.get(s),a=ct.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:zc(s))||zc(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}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 r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=ct.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+(EF(e,i.node,i.offset)?t:0))}};function EF(n,e,t){for(;;){if(!e||t<bn(e))return!1;if(e==n)return!0;t=zr(e)+1,e=e.parentNode}}let N3=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},PF=class{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:BF(e),a=new VF(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=HF(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!e0(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!e0(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((le.ios||le.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.to<e.state.doc.length)){let d=Math.min(a,c),u=Math.max(a,c),f=h.from-d,p=h.to-u;(f==0||f==1||d==0)&&(p==0||p==-1||u==e.state.doc.length)&&(a=0,c=e.state.doc.length)}this.newSel=T.single(c,a)}}};function TS(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,c=null;(r===8||le.android&&e.text.length<l-o)&&(a=s.to,c="end");let h=RF(n.state.doc.sliceString(o,l,Kl),e.text,a-o,c);h&&(le.chrome&&r==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==Kl+Kl&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:$.of(e.text.slice(h.from,h.toB).split(Kl))})}else i&&(!n.hasFocus&&n.state.facet(Ln)||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))}:(le.mac||le.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=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}):le.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` `&&n.lineWrapping&&(i&&(i=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}),t)return _S(n,t,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function _S(n,e,t,i=-1){if(le.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(le.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&&Mo(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)&&Mo(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Mo(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=LF(n,e,t));return n.state.facet(tS).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function LF(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.from<e.from?s.sliceDoc(r.from,e.from):"",a=r.to>e.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let c=n.state.sliceDoc(e.from,e.to),h,d=t&&uS(n,t.main.head);if(d){let p=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-e.to,f=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,b=g-c.length;if(p.to-p.from!=f||n.state.sliceDoc(b,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:b,to:g,insert:e.insert}),w=p.to-r.to;return{changes:y,range:a?T.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function RF(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function BF(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new N3(t,i)),(s!=t||r!=i)&&e.push(new N3(s,r))),e}function HF(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?T.single(t+e,i+e):null}const NF={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Wu=le.ie&&le.ie_version<=11;let FF=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new yN,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);(le.ie&&le.ie_version<=11||le.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&&!(le.chrome&&le.chrome_version<126)&&(this.editContext=new WF(e),e.state.facet(Ln)&&(e.contentDOM.editContext=this.editContext.editContext)),Wu&&(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.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(Ln)?i.root.activeElement!=this.dom:!nc(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(le.ie&&le.ie_version<=11||le.android&&le.chrome)&&!i.state.selection.main.empty&&s.focusNode&&Ca(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Fa(e.root);if(!t)return!1;let i=le.safari&&e.root.nodeType==11&&pN(this.dom.ownerDocument)==this.dom&&IF(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let s=nc(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&SN(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,NF),Wu&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Wu&&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 r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Mo(this.dom,r.key,r.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 r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&nc(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 r=new PF(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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=TS(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=F3(t,e.previousSibling||e.target.previousSibling,-1),s=F3(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("change",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("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ln)!=e.state.facet(Ln)&&(e.view.contentDOM.editContext=e.state.facet(Ln)?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 F3(n,e,t){for(;e;){let i=ct.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 I3(n,e){let t=e.startContainer,i=e.startOffset,s=e.endContainer,r=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return Ca(o.node,o.offset,s,r)&&([t,i,s,r]=[s,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}}function IF(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return I3(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?I3(n,t):null}let WF=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(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,r={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:$.of(i.text.split(` `))};r.from==this.from&&s<this.from?r.from=s:r.to==this.to&&s>this.to&&(r.to=s),!(r.from==r.to&&!r.insert.length)&&(this.pendingContextChange=r,e.state.readOnly||_S(e,r,T.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push($i.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}e.dispatch({effects:rS.of($i.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=Fa(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((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(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)}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){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},Ne=class M0{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={}){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:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||bN(e.parent)||document,this.viewState=new B3(e.state||ae.create(e)),e.scrollTo&&e.scrollTo.is(qh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(zl).map(i=>new Hu(i));for(let i of this.plugins)i.update(this);this.observer=new FF(this),this.inputState=new QN(this),this.inputState.ensureHandlers(this.plugins),this.docView=new y3(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof pt?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,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(yS))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=bS(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(ae.phrases)!=this.state.facet(ae.phrases))return this.setState(r);s=C3.create(this,r,e),s.flags|=l;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(d&&(d=d.map(u.changes)),u.scrollIntoView){let{main:f}=u.state.selection;d=new Bu(f.empty?f:T.cursor(f.head,f.head>f.anchor?-1:1))}for(let f of u.effects)f.is(qh)&&(d=f.value.clip(this.state))}this.viewState.update(s,d),this.bidiCache=z3.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Ul)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Qh)!=s.state.facet(Qh)&&(this.viewState.mustMeasureContent=!0),(t||i||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(m0))try{u(s)}catch(f){fn(this.state,f,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!TS(this,h)&&c.force&&Mo(this.contentDOM,c.key,c.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 B3(e),this.plugins=e.facet(zl).map(i=>new Hu(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new y3(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(zl),i=e.state.facet(zl);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Hu(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.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){fn(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:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(_b(i))r=-1,o=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(s);r=f.from,o=f.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(f=>{try{return f.read(this)}catch(p){return fn(this.state,p),W3}}),d=C3.create(this,this.state,[]),u=!1;d.flags|=a,t?t.flags|=a:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),u=this.docView.update(d),u&&this.docViewUpdate());for(let f=0;f<c.length;f++)if(h[f]!=W3)try{let p=c[f];p.write&&p.write(h[f],this)}catch(p){fn(this.state,p)}if(u&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(m0))l(t)}get themeClasses(){return k0+" "+(this.state.facet(v0)?AS:MS)+" "+this.state.facet(Qh)}updateAttrs(){let e=U3(this,oS,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Ln)?"true":"false",class:"cm-content",style:`${le.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),U3(this,i2,t);let i=this.observer.ignore(()=>{let s=d0(this.contentDOM,this.contentAttrs,t),r=d0(this.dom,this.editorAttrs,e);return s||r});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(M0.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Ul);let e=this.state.facet(M0.cspNonce);we.mount(this.root,this.styleModules.concat(OF).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 Fu(this,e,x3(this,e,t,i))}moveByGroup(e,t){return Fu(this,e,x3(this,e,t,i=>JN(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return T.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return YN(this,e,t,i)}moveVertically(e,t,i){return Fu(this,e,XN(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(),fS(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),r=this.bidiSpans(s),o=r[qn.find(r,e-s.from,-1,t)];return Ym(i,o.dir==Jt.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(sS)||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>zF)return jb(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||Zb(r.isolates,i=m3(this,e))))return r.order;i||(i=m3(this,e));let s=EN(e.text,t,i);return this.bidiCache.push(new z3(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||le.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Db(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 qh.of(new Bu(typeof e=="number"?T.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 qh.of(new Bu(T.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 g3.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return g3.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=we.newName(),s=[Qh.of(i),Ul.of(x0(`.${i}`,e))];return t&&t.dark&&s.push(v0.of(!0)),s}static baseTheme(e){return Vi.lowest(Ul.of(x0("."+k0,e,DS)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&ct.get(i)||ct.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}};Ne.styleModule=Ul;Ne.inputHandler=tS;Ne.scrollHandler=nS;Ne.focusChangeEffect=iS;Ne.perLineTextDirection=sS;Ne.exceptionSink=eS;Ne.updateListener=m0;Ne.editable=Ln;Ne.mouseSelectionStyle=Qb;Ne.dragMovesSelection=Xb;Ne.clickAddsSelectionRange=Jb;Ne.decorations=Wa;Ne.outerDecorations=lS;Ne.atomicRanges=s2;Ne.bidiIsolatedRanges=aS;Ne.scrollMargins=hS;Ne.darkTheme=v0;Ne.cspNonce=P.define({combine:n=>n.length?n[0]:""});Ne.contentAttributes=i2;Ne.editorAttributes=oS;Ne.lineWrapping=Ne.contentAttributes.of({class:"cm-lineWrapping"});Ne.announce=ce.define();const zF=4096,W3={};let z3=class OS{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:Jt.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!t.touchesRange(o.from,o.to)&&i.push(new OS(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function U3(n,e,t){for(let i=n.state.facet(e),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&c0(o,t)}return t}const UF=!le.ios,$3={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};UF&&($3[".cm-line"].caretColor=$3[".cm-content"].caretColor="transparent !important");let Yo=class extends Bt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Yo.prototype.elementClass="";Yo.prototype.toDOM=void 0;Yo.prototype.mapMode=fe.TrackBefore;Yo.prototype.startSide=Yo.prototype.endSide=-1;Yo.prototype.point=!0;const $F=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=r2(n.state,t.from);return i.line?KF(n):i.block?qF(n):!1};function n2(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 KF=n2(YF,0),GF=n2(VS,0),qF=n2((n,e)=>VS(n,e,jF(e)),0);function r2(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const xl=50;function ZF(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-xl,i),o=n.sliceDoc(s,s+xl),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,c=r.length-l;if(r.slice(c-e.length,c)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let h,d;s-i<=2*xl?h=d=n.sliceDoc(i,s):(h=n.sliceDoc(i,i+xl),d=n.sliceDoc(s-xl,s));let u=/^\s*/.exec(h)[0].length,f=/\s*$/.exec(d)[0].length,p=d.length-f-t.length;return h.slice(u,u+e.length)==e&&d.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(h.charAt(u+e.length))?1:0},close:{pos:s-f-t.length,margin:/\s/.test(d.charAt(p-1))?1:0}}:null}function jF(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),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function VS(n,e,t=e.selection.ranges){let i=t.map(r=>r2(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>ZF(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let a=i[o],{open:c,close:h}=l;r.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:h.pos-h.margin,to:h.pos+a.close.length})}return{changes:r}}return null}function YF(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,a=1e9,c=r2(e,r).line;if(c){for(let h=r;h<=o;){let d=e.doc.lineAt(h);if(d.from>s&&(r==o||o>d.from)){s=d.from;let u=/^\s*/.exec(d.text)[0].length,f=u==d.length,p=d.text.slice(u,u+c.length)==c?u:-1;u<d.text.length&&u<a&&(a=u),i.push({line:d,comment:p,token:c,indent:u,empty:f,single:!1})}h=d.to+1}if(a<1e9)for(let h=l;h<i.length;h++)i[h].indent<i[h].line.text.length&&(i[h].indent=a);i.length==l+1&&(i[l].single=!0)}}if(n!=2&&i.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:c,empty:h,single:d}of i)(d||!h)&&r.push({from:l.from+c,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,h=c+a.length;o.text[h-o.from]==" "&&h++,r.push({from:c,to:h})}return{changes:r}}return null}const A0=gi.define(),JF=gi.define(),XF=P.define(),ES=P.define({combine(n){return on(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)})}}),PS=qt.define({create(){return Ys.empty},update(n,e){let t=e.state.facet(ES),i=e.annotation(A0);if(i){let a=Ti.fromTransaction(e,i.selection),c=i.side,h=c==0?n.undone:n.done;return a?h=$c(h,h.length,t.minDepth,a):h=BS(h,e.startState.selection),new Ys(c==0?i.rest:h,c==0?h:i.rest)}let s=e.annotation(JF);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(pt.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Ti.fromTransaction(e),o=e.annotation(pt.time),l=e.annotation(pt.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,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 Ys(n.done.map(Ti.fromJSON),n.undone.map(Ti.fromJSON))}});function QF(n={}){return[PS,ES.of(n),Ne.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?LS:e.inputType=="historyRedo"?D0:null;return i?(e.preventDefault(),i(t)):!1}})]}function Ld(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(PS,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const LS=Ld(0,!1),D0=Ld(1,!1),eI=Ld(0,!0),tI=Ld(1,!0);class Ti{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Ti(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 Ti(e.changes&&Be.fromJSON(e.changes),[],e.mapped&&Xs.fromJSON(e.mapped),e.startSelection&&T.fromJSON(e.startSelection),e.selectionsAfter.map(T.fromJSON))}static fromTransaction(e,t){let i=Zi;for(let s of e.startState.facet(XF)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Ti(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Zi)}static selection(e){return new Ti(void 0,Zi,void 0,void 0,e)}}function $c(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function iI(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a<t.length;){let c=t[a++],h=t[a++];l>=c&&o<=h&&(i=!0)}}),i}function sI(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function RS(n,e){return n.length?e.length?n.concat(e):n:e}const Zi=[],nI=200;function BS(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-nI));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),$c(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Ti.selection([e])]}function rI(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 zu(n,e){if(!n.length)return n;let t=n.length,i=Zi;for(;t;){let s=oI(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Ti.selection(i)]:Zi}function oI(n,e,t){let i=RS(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Zi,t);if(!n.changes)return Ti.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Ti(s,ce.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const lI=/^(input\.type|delete)($|\.)/;class Ys{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 Ys(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||lI.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,iI(l.changes,e.changes))||i=="input.type.compose")?o=$c(o,o.length-1,s.minDepth,new Ti(e.changes.compose(l.changes),RS(e.effects,l.effects),l.mapped,l.startSelection,Zi)):o=$c(o,o.length,s.minDepth,e),new Ys(o,Zi,t,i)}addSelection(e,t,i,s){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Zi;return r.length>0&&t-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&sI(r[r.length-1],e)?this:new Ys(BS(this.done,e),this.undone,t,i)}addMapping(e){return new Ys(zu(this.done,e),zu(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 r=s[s.length-1],o=r.selectionsAfter[0]||t.selection;if(i&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:A0.of({side:e,rest:rI(s),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let l=s.length==1?Zi:s.slice(0,s.length-1);return r.mapped&&(l=zu(l,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:A0.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ys.empty=new Ys(Zi,Zi);const aI=[{key:"Mod-z",run:LS,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:D0,preventDefault:!0},{linux:"Ctrl-Shift-z",run:D0,preventDefault:!0},{key:"Mod-u",run:eI,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:tI,preventDefault:!0}];function ml(n,e){return T.create(n.ranges.map(e),n.mainIndex)}function ln(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Os({state:n,dispatch:e},t){let i=ml(n.selection,t);return i.eq(n.selection,!0)?!1:(e(ln(n,i)),!0)}function Rd(n,e){return T.cursor(e?n.to:n.from)}function HS(n,e){return Os(n,t=>t.empty?n.moveByChar(t,e):Rd(t,e))}function ei(n){return n.textDirectionAt(n.state.selection.main.head)==Jt.LTR}const NS=n=>HS(n,!ei(n)),FS=n=>HS(n,ei(n));function IS(n,e){return Os(n,t=>t.empty?n.moveByGroup(t,e):Rd(t,e))}const hI=n=>IS(n,!ei(n)),cI=n=>IS(n,ei(n));function dI(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 Bd(n,e,t){let i=Xt(n).resolveInner(e.head),s=t?Se.closedBy:Se.openedBy;for(let a=e.head;;){let c=t?i.childAfter(a):i.childBefore(a);if(!c)break;dI(n,c,s)?i=c:a=t?c.to:c.from}let r=i.type.prop(s),o,l;return r&&(o=t?js(n,i.from,1):js(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,T.cursor(l,t?-1:1)}const uI=n=>Os(n,e=>Bd(n.state,e,!ei(n))),fI=n=>Os(n,e=>Bd(n.state,e,ei(n)));function WS(n,e){return Os(n,t=>{if(!t.empty)return Rd(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const zS=n=>WS(n,!1),US=n=>WS(n,!0);function $S(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,s;if(e){for(let r of n.state.facet(Ne.scrollMargins)){let o=r(n);o!=null&&o.top&&(t=Math.max(o==null?void 0:o.top,t)),o!=null&&o.bottom&&(i=Math.max(o==null?void 0:o.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 KS(n,e){let t=$S(n),{state:i}=n,s=ml(i.selection,o=>o.empty?n.moveVertically(o,e,t.height):Rd(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,c=l.bottom-t.marginBottom;o&&o.top>a&&o.bottom<c&&(r=Ne.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-a}))}return n.dispatch(ln(i,s),{effects:r}),!0}const K3=n=>KS(n,!1),T0=n=>KS(n,!0);function wr(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 r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=T.cursor(i.from+r))}return s}const pI=n=>Os(n,e=>wr(n,e,!0)),gI=n=>Os(n,e=>wr(n,e,!1)),mI=n=>Os(n,e=>wr(n,e,!ei(n))),CI=n=>Os(n,e=>wr(n,e,ei(n))),yI=n=>Os(n,e=>T.cursor(n.lineBlockAt(e.head).from,1)),bI=n=>Os(n,e=>T.cursor(n.lineBlockAt(e.head).to,-1));function SI(n,e,t){let i=!1,s=ml(n.selection,r=>{let o=js(n,r.head,-1)||js(n,r.head,1)||r.head>0&&js(n,r.head-1,1)||r.head<n.doc.length&&js(n,r.head+1,-1);if(!o||!o.end)return r;i=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return T.cursor(l)});return i?(e(ln(n,s)),!0):!1}const wI=({state:n,dispatch:e})=>SI(n,e);function ls(n,e){let t=ml(n.state.selection,i=>{let s=e(i);return T.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(ln(n.state,t)),!0)}function GS(n,e){return ls(n,t=>n.moveByChar(t,e))}const qS=n=>GS(n,!ei(n)),ZS=n=>GS(n,ei(n));function jS(n,e){return ls(n,t=>n.moveByGroup(t,e))}const vI=n=>jS(n,!ei(n)),kI=n=>jS(n,ei(n)),xI=n=>ls(n,e=>Bd(n.state,e,!ei(n))),MI=n=>ls(n,e=>Bd(n.state,e,ei(n)));function YS(n,e){return ls(n,t=>n.moveVertically(t,e))}const JS=n=>YS(n,!1),XS=n=>YS(n,!0);function QS(n,e){return ls(n,t=>n.moveVertically(t,e,$S(n).height))}const G3=n=>QS(n,!1),q3=n=>QS(n,!0),AI=n=>ls(n,e=>wr(n,e,!0)),DI=n=>ls(n,e=>wr(n,e,!1)),TI=n=>ls(n,e=>wr(n,e,!ei(n))),_I=n=>ls(n,e=>wr(n,e,ei(n))),OI=n=>ls(n,e=>T.cursor(n.lineBlockAt(e.head).from)),VI=n=>ls(n,e=>T.cursor(n.lineBlockAt(e.head).to)),Z3=({state:n,dispatch:e})=>(e(ln(n,{anchor:0})),!0),j3=({state:n,dispatch:e})=>(e(ln(n,{anchor:n.doc.length})),!0),Y3=({state:n,dispatch:e})=>(e(ln(n,{anchor:n.selection.main.anchor,head:0})),!0),J3=({state:n,dispatch:e})=>(e(ln(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),EI=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),PI=({state:n,dispatch:e})=>{let t=Hd(n).map(({from:i,to:s})=>T.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:T.create(t),userEvent:"select"})),!0},LI=({state:n,dispatch:e})=>{let t=ml(n.selection,i=>{var s;let r=Xt(n).resolveStack(i.from,1);for(let o=r;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&(!((s=l.parent)===null||s===void 0)&&s.parent))return T.range(l.to,l.from)}return i});return e(ln(n,t)),!0},RI=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=T.create([t.main]):t.main.empty||(i=T.create([T.cursor(t.main.head)])),i?(e(ln(n,i)),!0):!1};function gh(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);a<o?(t="delete.backward",a=e1(n,a,!1)):a>o&&(t="delete.forward",a=e1(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=e1(n,o,!1),l=e1(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:T.cursor(o,o<r.head?-1:1)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?Ne.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function e1(n,e,t){if(n instanceof Ne)for(let i of n.state.facet(Ne.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{s<e&&r>e&&(e=t?r:s)});return e}const ew=(n,e,t)=>gh(n,i=>{let s=i.from,{state:r}=n,o=r.doc.lineAt(s),l,a;if(t&&!e&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,s-o.from))){if(l[l.length-1]==" ")return s-1;let c=gl(l,r.tabSize),h=c%Fc(r)||Fc(r);for(let d=0;d<h&&l[l.length-1-d]==" ";d++)s--;a=s}else a=de(o.text,s-o.from,e,e)+o.from,a==s&&o.number!=(e?r.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,s-o.from))&&(a=de(o.text,a-o.from,!1,!1)+o.from);return a}),_0=n=>ew(n,!1,!0),tw=n=>ew(n,!0,!1),iw=(n,e)=>gh(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=de(r.text,i-r.from,e)+r.from,c=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),h=o(c);if(l!=null&&h!=l)break;(c!=" "||i!=t.head)&&(l=h),i=a}return i}),sw=n=>iw(n,!1),BI=n=>iw(n,!0),HI=n=>gh(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),NI=n=>gh(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),FI=n=>gh(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),II=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:$.of(["",""])},range:T.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},WI=({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,r=n.doc.lineAt(s),o=s==r.from?s-1:de(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:de(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:T.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Hd(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function nw(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Hd(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(T.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(T.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:T.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const zI=({state:n,dispatch:e})=>nw(n,e,!1),UI=({state:n,dispatch:e})=>nw(n,e,!0);function rw(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Hd(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 $I=({state:n,dispatch:e})=>rw(n,e,!1),KI=({state:n,dispatch:e})=>rw(n,e,!0),GI=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Hd(e).map(({from:s,to:r})=>(s>0?s--:r<e.doc.length&&r++,{from:s,to:r}))),i=ml(e.selection,s=>{let r;if(n.lineWrapping){let o=n.lineBlockAt(s.head),l=n.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,r)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function qI(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Xt(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(Se.closedBy))&&r.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 ZI=ow(!1),jI=ow(!0);function ow(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&qI(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new Od(e,{simulateBreak:r,simulateDoubleBreak:!!a}),h=Zm(c,r);for(h==null&&(h=gl(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:r,to:o}=a:r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let d=["",Na(e,h)];return a&&d.push(Na(e,c.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:$.of(d)},range:T.cursor(r+1+d[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function o2(n,e){let t=-1;return n.changeByRange(i=>{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:T.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const YI=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Od(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=o2(n,(r,o,l)=>{let a=Zm(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let c=/^\s*/.exec(r.text)[0],h=Na(n,a);(c!=h||l.from<r.from+c.length)&&(t[r.from]=a,o.push({from:r.from,to:r.from+c.length,insert:h}))});return s.changes.empty||e(n.update(s,{userEvent:"indent"})),!0},JI=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(o2(n,(t,i)=>{i.push({from:t.from,insert:n.facet(qm)})}),{userEvent:"input.indent"})),!0),XI=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(o2(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=gl(s,n.tabSize),o=0,l=Na(n,Math.max(0,r-Fc(n)));for(;o<s.length&&o<l.length&&s.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:t.from+o,to:t.from+s.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),QI=n=>(n.setTabFocusMode(),!0),eW=[{key:"Ctrl-b",run:NS,shift:qS,preventDefault:!0},{key:"Ctrl-f",run:FS,shift:ZS},{key:"Ctrl-p",run:zS,shift:JS},{key:"Ctrl-n",run:US,shift:XS},{key:"Ctrl-a",run:yI,shift:OI},{key:"Ctrl-e",run:bI,shift:VI},{key:"Ctrl-d",run:tw},{key:"Ctrl-h",run:_0},{key:"Ctrl-k",run:HI},{key:"Ctrl-Alt-h",run:sw},{key:"Ctrl-o",run:II},{key:"Ctrl-t",run:WI},{key:"Ctrl-v",run:T0}],tW=[{key:"ArrowLeft",run:NS,shift:qS,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:hI,shift:vI,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:mI,shift:TI,preventDefault:!0},{key:"ArrowRight",run:FS,shift:ZS,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cI,shift:kI,preventDefault:!0},{mac:"Cmd-ArrowRight",run:CI,shift:_I,preventDefault:!0},{key:"ArrowUp",run:zS,shift:JS,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Z3,shift:Y3},{mac:"Ctrl-ArrowUp",run:K3,shift:G3},{key:"ArrowDown",run:US,shift:XS,preventDefault:!0},{mac:"Cmd-ArrowDown",run:j3,shift:J3},{mac:"Ctrl-ArrowDown",run:T0,shift:q3},{key:"PageUp",run:K3,shift:G3},{key:"PageDown",run:T0,shift:q3},{key:"Home",run:gI,shift:DI,preventDefault:!0},{key:"Mod-Home",run:Z3,shift:Y3},{key:"End",run:pI,shift:AI,preventDefault:!0},{key:"Mod-End",run:j3,shift:J3},{key:"Enter",run:ZI},{key:"Mod-a",run:EI},{key:"Backspace",run:_0,shift:_0},{key:"Delete",run:tw},{key:"Mod-Backspace",mac:"Alt-Backspace",run:sw},{key:"Mod-Delete",mac:"Alt-Delete",run:BI},{mac:"Mod-Backspace",run:NI},{mac:"Mod-Delete",run:FI}].concat(eW.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),iW=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:uI,shift:xI},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:fI,shift:MI},{key:"Alt-ArrowUp",run:zI},{key:"Shift-Alt-ArrowUp",run:$I},{key:"Alt-ArrowDown",run:UI},{key:"Shift-Alt-ArrowDown",run:KI},{key:"Escape",run:RI},{key:"Mod-Enter",run:jI},{key:"Alt-l",mac:"Ctrl-l",run:PI},{key:"Mod-i",run:LI,preventDefault:!0},{key:"Mod-[",run:XI},{key:"Mod-]",run:JI},{key:"Mod-Alt-\\",run:YI},{key:"Shift-Mod-k",run:GI},{key:"Shift-Mod-\\",run:wI},{key:"Mod-/",run:$F},{key:"Alt-A",run:GF},{key:"Ctrl-m",mac:"Shift-Alt-m",run:QI}].concat(tW);function za(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function O0(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function sW(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function cc(n,e){if(!e.anchorNode)return!1;try{return O0(n,e.anchorNode)}catch{return!1}}function Ua(n){return n.nodeType==3?Gr(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function ba(n,e,t,i){return t?X3(n,e,t,i,-1)||X3(n,e,t,i,1):!1}function Kr(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Kc(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function X3(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:Sn(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Kr(n)+(s<0?0:1),n=r}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?Sn(n):0}else return!1}}function Sn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function l2(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function nW(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 lw(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 rW(n,e,t,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,d=!1;h&&!d;)if(h.nodeType==1){let u,f=h==a.body,p=1,g=1;if(f)u=nW(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(d=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let w=h.getBoundingClientRect();({scaleX:p,scaleY:g}=lw(h,w)),u={left:w.left,right:w.left+h.clientWidth*p,top:w.top,bottom:w.top+h.clientHeight*g}}let b=0,y=0;if(s=="nearest")e.top<u.top?(y=-(u.top-e.top+o),t>0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y<u.top&&(y=-(u.top+y-e.top+o)));else{let w=e.bottom-e.top,M=u.bottom-u.top;y=(s=="center"&&w<=M?e.top+w/2-M/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-M+o)-u.top}if(i=="nearest"?e.left<u.left?(b=-(u.left-e.left+r),t>0&&e.right>u.right+b&&(b=e.right-u.right+b+r)):e.right>u.right&&(b=e.right-u.right+r,t<0&&e.left<u.left+b&&(b=-(u.left+b-e.left+r))):b=(i=="center"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:i=="start"==l?e.left-r:e.right-(u.right-u.left)+r)-u.left,b||y)if(f)c.scrollBy(b,y);else{let w=0,M=0;if(y){let k=h.scrollTop;h.scrollTop+=y/g,M=(h.scrollTop-k)*g}if(b){let k=h.scrollLeft;h.scrollLeft+=b/p,w=(h.scrollLeft-k)*p}e={left:e.left-w,top:e.top-M,right:e.right-w,bottom:e.bottom-M},w&&Math.abs(w-b)<1&&(i="nearest"),M&&Math.abs(M-y)<1&&(s="nearest")}if(f)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function oW(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}}let lW=class{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?Sn(t):0),i,Math.min(e.focusOffset,i?Sn(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}},ro=null;function aw(n){if(n.setActive)return n.setActive();if(ro)return n.focus(ro);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(ro==null?{get preventScroll(){return ro={preventScroll:!0},!0}}:void 0),!ro){ro=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let Q3;function Gr(n,e,t=e){let i=Q3||(Q3=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Do(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 r=new KeyboardEvent("keydown",s);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function aW(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function hw(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function hW(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,Sn(t));;)if(i){if(t.nodeType!=1)return!1;let s=t.childNodes[i-1];s.contentEditable=="false"?i--:(t=s,i=Sn(t))}else{if(t==n)return!0;i=Kr(t),t=t.parentNode}}function cw(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function dw(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=Sn(t)}else if(t.parentNode&&!Kc(t))i=Kr(t),t=t.parentNode;else return null}}function uw(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&&!Kc(t))i=Kr(t)+1,t=t.parentNode;else return null}}let Ni=class V0{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new V0(e.parentNode,Kr(e),t)}static after(e,t){return new V0(e.parentNode,Kr(e)+1,t)}};const a2=[];let dt=class E0{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,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=E0.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=e8(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=e8(r)}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=Sn(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!E0.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,h=i;a<this.children.length;a++){let d=this.children[a],u=c+d.length;if(c<e&&u>t)return d.domBoundsAround(e,t,c);if(u>=e&&s==-1&&(s=a,r=c),c>t&&d.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+d.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].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=a2){this.markDirty();for(let s=e;s<t;s++){let r=this.children[s];r.parent==this&&i.indexOf(r)<0&&r.destroy()}this.children.splice(e,t-e,...i);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 fw(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,r,o){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}};dt.prototype.breakAfter=0;function e8(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}let fw=class{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 pw(n,e,t,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[e]:null,d=r.length?r[r.length-1]:null,u=d?d.breakAfter:o;if(!(e==i&&h&&!o&&!u&&r.length<2&&h.merge(t,s,r.length?d:null,t==0,l,a))){if(i<c.length){let f=c[i];f&&(s<f.length||f.breakAfter&&(d!=null&&d.breakAfter))?(e==i&&(f=f.split(s),s=0),!u&&d&&f.merge(0,s,d,!0,0,a)?r[r.length-1]=f:((s||f.children.length&&!f.children[0].length)&&f.merge(0,s,null,!1,0,a),r.push(f))):f!=null&&f.breakAfter&&(d?d.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,t>0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[e].become(r[0]))e++,r.shift(),l=r.length?0:a;else break;!r.length&&e&&i<c.length&&!c[e-1].breakAfter&&c[i].merge(0,0,c[e-1],!1,l,a)&&e--,(e<i||r.length)&&n.replaceChildren(e,i,r)}}function gw(n,e,t,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),d=e-t;for(let u of i)d+=u.length;n.length+=d,pw(n,c,h,l,a,i,0,s,r)}let ki=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},P0=typeof document<"u"?document:{documentElement:{style:{}}};const L0=/Edge\/(\d+)/.exec(ki.userAgent),mw=/MSIE \d/.test(ki.userAgent),R0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ki.userAgent),Nd=!!(mw||R0||L0),t8=!Nd&&/gecko\/(\d+)/i.test(ki.userAgent),Uu=!Nd&&/Chrome\/(\d+)/.exec(ki.userAgent),i8="webkitFontSmoothing"in P0.documentElement.style,Cw=!Nd&&/Apple Computer/.test(ki.vendor),s8=Cw&&(/Mobile\/\w+/.test(ki.userAgent)||ki.maxTouchPoints>2);var se={mac:s8||/Mac/.test(ki.platform),windows:/Win/.test(ki.platform),linux:/Linux|X11/.test(ki.platform),ie:Nd,ie_version:mw?P0.documentMode||6:R0?+R0[1]:L0?+L0[1]:0,gecko:t8,gecko_version:t8?+(/Firefox\/(\d+)/.exec(ki.userAgent)||[0,0])[1]:0,chrome:!!Uu,chrome_version:Uu?+Uu[1]:0,ios:s8,android:/Android\b/.test(ki.userAgent),webkit:i8,safari:Cw,webkit_version:i8?+(/\bAppleWebKit\/(\d+)/.exec(ki.userAgent)||[0,0])[1]:0,tabSize:P0.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const cW=256;let gr=class B0 extends dt{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 B0)||this.length-(t-e)+i.length>cW||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 B0(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 Ni(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 dW(this.dom,e,t)}},Jo=class H0 extends dt{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(hw(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,r,o){return i&&(!(i instanceof H0&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(gw(this,e,t,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>e&&t.push(i<e?l.split(e-i):l),s<0&&i>=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new H0(this.mark,t,o)}domAtPos(e){return bw(this,e)}coordsAt(e,t){return ww(this,e,t)}};function dW(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?se.chrome||se.gecko||(e?(s--,o=1):r<i&&(r++,o=-1)):t<0?s--:r<i&&r++;let l=Gr(n,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return se.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?l2(a,o<0):a||null}let yw=class Gl extends dt{static create(e,t,i){return new Gl(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=Gl.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,r,o){return i&&(!(i instanceof Gl)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof Gl&&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 $.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):$.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Ni.before(this.dom):Ni.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(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top<r.bottom);l+=o?-1:1);return l2(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}},N0=class F0 extends dt{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof F0&&e.side==this.side}split(){return new F0(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?Ni.before(this.dom):Ni.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return $.empty}get isHidden(){return!0}};gr.prototype.children=yw.prototype.children=N0.prototype.children=a2;function bw(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Ni(t,0)}function Sw(n,e,t){let i,{children:s}=n;t>0&&e instanceof Jo&&s.length&&(i=s[s.length-1])instanceof Jo&&i.mark.eq(e.mark)?Sw(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function ww(n,e,t){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let d=0,u=0;d<c.children.length&&u<=h;d++){let f=c.children[d],p=u+f.length;p>=h&&(f.children.length?l(f,h-u):(!r||r.isHidden&&t>0)&&(p>h||u==p&&f.getSide()>0)?(r=f,o=h-u):(u<h||u==p&&f.getSide()<0&&!f.isHidden)&&(i=f,s=h-u)),u=p}}l(n,e);let a=(t<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?s:o),t):uW(n)}function uW(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Ua(e);return t[t.length-1]||null}function I0(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 n8=Object.create(null);function Gc(n,e,t){if(n==e)return!0;n||(n=n8),e||(e=n8);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 r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function W0(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 fW(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}let li=class ql extends dt{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof ql))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),gw(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new ql;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 r=i;r<this.children.length;r++)t.append(this.children[r],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){Gc(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Sw(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=I0(t,this.attrs||{})),i&&(this.attrs=I0({class:i},this.attrs||{}))}domAtPos(e){return bw(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(hw(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&&(W0(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&&dt.get(s)instanceof Jo;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=dt.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!se.ios||!this.children.some(r=>r instanceof gr))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof gr)||/[^ -~]/.test(i.text))return null;let s=Ua(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=ww(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight<r){let o=(r-s.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(e){return e instanceof ql&&this.children.length==0&&e.children.length==0&&Gc(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 r=e.children[i],o=s+r.length;if(o>=t){if(r instanceof ql)return r;if(o>t)break}s=o+r.breakAfter}return null}},Sa=class dc extends dt{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,r,o){return i&&(!(i instanceof dc)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Ni.before(this.dom):Ni.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new dc(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return a2}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):$.empty}domBoundsAround(){return null}become(e){return e instanceof dc&&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){return this.widget.coordsAt(this.dom,e,t)}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}},h2=class{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 en=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(en||(en={}));let Qe=class extends Bt{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 c2(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 Xo(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:r,end:o}=Mw(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new Xo(e,i,s,t,e.widget||null,!0)}static line(e){return new d2(e)}static set(e,t=!1){return K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Qe.none=K.empty;let c2=class vw extends Qe{constructor(e){let{start:t,end:i}=Mw(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 vw&&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))&&Gc(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)}};c2.prototype.point=!1;let d2=class kw extends Qe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof kw&&this.spec.class==e.spec.class&&Gc(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)}};d2.prototype.mapMode=fe.TrackBefore;d2.prototype.point=!0;let Xo=class xw extends Qe{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?fe.TrackBefore:fe.TrackAfter:fe.TrackDel}get type(){return this.startSide!=this.endSide?en.WidgetRange:this.startSide<=0?en.WidgetBefore:en.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof xw&&pW(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)}};Xo.prototype.point=!0;function Mw(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 pW(n,e){return n==e||!!(n&&e&&n.compare(e))}function z0(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)}let $u=class Aw{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 Sa&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new li),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(t1(new N0(-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 Sa)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){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=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(t1(new gr(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,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof Xo){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 l=t-e;if(i instanceof Xo)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Sa(i.widget||Qo.block,l,i));else{let a=yw.create(i.widget||Qo.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e<t||i.startSide>0),h=!a.isEditable&&(e<t||r>s.length||i.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(d.append(t1(new N0(1),s),r),r=s.length+Math.max(0,r-s.length)),d.append(t1(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?e<t||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new Aw(e,t,i,r);return o.openEnd=K.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function t1(n,e){for(let t of e)n=new Jo(t,[n],n.length);return n}let Qo=class extends h2{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}};Qo.inline=new Qo("span");Qo.block=new Qo("div");var ci=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(ci||(ci={}));const qr=ci.LTR,u2=ci.RTL;function Dw(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const gW=Dw("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),mW=Dw("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),U0=Object.create(null),Bs=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);U0[e]=t,U0[t]=-e}function Tw(n){return n<=247?gW[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?mW[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const CW=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;let Zn=class{get dir(){return this.level%2?u2:qr}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 r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}};function _w(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||!_w(i.inner,s.inner))return!1}return!0}const $e=[];function yW(n,e,t,i,s){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:e,l=r<i.length?i[r].from:t,a=r?256:s;for(let c=o,h=a,d=a;c<l;c++){let u=Tw(n.charCodeAt(c));u==512?u=h:u==8&&d==4&&(u=16),$e[c]=u==4?2:u,u&7&&(d=u),h=u}for(let c=o,h=a,d=a;c<l;c++){let u=$e[c];if(u==128)c<l-1&&h==$e[c+1]&&h&24?u=$e[c]=h:$e[c]=256;else if(u==64){let f=c+1;for(;f<l&&$e[f]==64;)f++;let p=c&&h==8||f<t&&$e[f]==8?d==1?1:8:256;for(let g=c;g<f;g++)$e[g]=p;c=f-1}else u==8&&d==1&&($e[c]=1);h=u,u&7&&(d=u)}}}function bW(n,e,t,i,s){let r=s==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,h=o<i.length?i[o].from:t;for(let d=c,u,f,p;d<h;d++)if(f=U0[u=n.charCodeAt(d)])if(f<0){for(let g=l-3;g>=0;g-=3)if(Bs[g+1]==-f){let b=Bs[g+2],y=b&2?s:b&4?b&1?r:s:0;y&&($e[d]=$e[Bs[g]]=y),l=g;break}}else{if(Bs.length==189)break;Bs[l++]=d,Bs[l++]=u,Bs[l++]=a}else if((p=$e[d])==2||p==1){let g=p==s;a=g?0:1;for(let b=l-3;b>=0;b-=3){let y=Bs[b+2];if(y&2)break;if(g)Bs[b+2]|=2;else{if(y&4)break;Bs[b+2]|=4}}}}}function SW(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=s<t.length?t[s].from:e;for(let a=o;a<l;){let c=$e[a];if(c==256){let h=a+1;for(;;)if(h==l){if(s==t.length)break;h=t[s++].to,l=s<t.length?t[s].from:e}else if($e[h]==256)h++;else break;let d=r==1,u=(h<e?$e[h]:i)==1,f=d==u?d?1:2:i;for(let p=h,g=s,b=g?t[g-1].to:n;p>a;)p==b&&(p=t[--g].from,b=g?t[g-1].to:n),$e[--p]=f;a=h}else r=c,a++}}}function $0(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,c=0;a<t;){let h=!0,d=!1;if(c==r.length||a<r[c].from){let g=$e[a];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c<r.length&&p==r[c].from){if(d)break e;let g=r[c];if(!h)for(let b=g.to,y=c+1;;){if(b==t)break e;if(y<r.length&&r[y].from==b)b=r[y++].to;else{if($e[b]==l)break e;break}}if(c++,u)u.push(g);else{g.from>a&&o.push(new Zn(a,g.from,f));let b=g.direction==qr!=!(f%2);K0(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(h?$e[p]!=l:$e[p]==l))break;p++}u?$0(n,a,p,i+1,s,u,o):a<p&&o.push(new Zn(a,p,f)),a=p}else for(let a=t,c=r.length;a>e;){let h=!0,d=!1;if(!c||a>r[c-1].to){let g=$e[a-1];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c&&p==r[c-1].to){if(d)break e;let g=r[--c];if(!h)for(let b=g.from,y=c;;){if(b==e)break e;if(y&&r[y-1].to==b)b=r[--y].from;else{if($e[b-1]==l)break e;break}}if(u)u.push(g);else{g.to<a&&o.push(new Zn(g.to,a,f));let b=g.direction==qr!=!(f%2);K0(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==e||(h?$e[p-1]!=l:$e[p-1]==l))break;p--}u?$0(n,p,a,i+1,s,u,o):p<a&&o.push(new Zn(p,a,f)),a=p}}function K0(n,e,t,i,s,r,o){let l=e%2?2:1;yW(n,s,r,i,l),bW(n,s,r,i,l),SW(s,r,i,l),$0(n,s,r,e,t,i,o)}function wW(n,e,t){if(!n)return[new Zn(0,0,e==u2?1:0)];if(e==qr&&!t.length&&!CW.test(n))return Ow(n.length);if(t.length)for(;n.length>$e.length;)$e[$e.length]=256;let i=[],s=e==qr?0:1;return K0(n,s,s,t,0,n.length,i),i}function Ow(n){return[new Zn(0,n,0)]}let Vw="";function vW(n,e,t,i,s){var r;let o=i.head-n.from,l=Zn.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],c=a.side(s,t);if(o==c){let u=l+=s?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!s,t),c=a.side(s,t)}let h=de(n.text,o,a.forward(s,t));(h<a.from||h>a.to)&&(h=c),Vw=n.text.slice(Math.min(o,h),Math.max(o,h));let d=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return d&&h==c&&d.level+(s?0:1)<a.level?T.cursor(d.side(!s,t)+n.from,d.forward(s,t)?1:-1,d.level):T.cursor(h+n.from,a.forward(s,t)?-1:1,a.level)}function kW(n,e,t){for(let i=e;i<t;i++){let s=Tw(n.charCodeAt(i));if(s==1)return qr;if(s==2||s==4)return u2}return qr}const Ew=P.define(),Pw=P.define(),Lw=P.define(),Rw=P.define(),G0=P.define(),Bw=P.define(),Hw=P.define(),Nw=P.define({combine:n=>n.some(e=>e)}),xW=P.define({combine:n=>n.some(e=>e)}),Fw=P.define();let Ku=class q0{constructor(e,t="nearest",i="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new q0(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 q0(T.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}};const i1=ce.define({map:(n,e)=>n.map(e)}),Iw=ce.define();function pn(n,e,t){let i=n.facet(Rw);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 Bn=P.define({combine:n=>n.length?n[0]:!0});let MW=0;const Zl=P.define();let $a=class Z0{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new Z0(MW++,e,i,s,l=>{let a=[Zl.of(l)];return o&&a.push(Ka.of(c=>{let h=c.plugin(l);return h?o(h):Qe.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return Z0.define(i=>new e(i),t)}},Gu=class{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(pn(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){pn(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){pn(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}};const Ww=P.define(),f2=P.define(),Ka=P.define(),zw=P.define(),p2=P.define(),Uw=P.define();function r8(n,e){let t=n.state.facet(Uw);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(n):r),s=[];return K.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let c=r-e.from,h=o-e.from,d=s;for(let u=l.length-1;u>=0;u--,a--){let f=l[u].spec.bidiIsolate,p;if(f==null&&(f=kW(e.text,c,h)),a>0&&d.length&&(p=d[d.length-1]).to==c&&p.direction==f)p.to=h,d=p.inner;else{let g={from:c,to:h,direction:f,inner:[]};d.push(g),d=g.inner}}}}),s}const $w=P.define();function Kw(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet($w)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const jl=P.define();let tr=class uc{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new uc(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,r=0,o=0,l=0;;s++){let a=s==e.length?null:e[s],c=o-l,h=a?a.fromB:1e9;for(;r<t.length&&t[r]<h;){let d=t[r],u=t[r+1],f=Math.max(l,d),p=Math.min(h,u);if(f<=p&&new uc(f+c,p+c,f,p).addToSet(i),u>h)break;r+=2}if(!a)return i;new uc(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}},o8=class Gw{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Be.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new tr(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new Gw(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}},l8=class extends dt{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=Qe.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 li],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new tr(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:c,toA:h})=>h<this.minWidthFrom||c>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:!EW(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?DW(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new tr(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(se.ie||se.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=OW(o,l,e.changes);return i=tr.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),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 o=se.chrome||se.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof Sa&&o.widget instanceof a8&&r.push(o.dom);s.updateGaps(r)}updateChildren(e,t,i){let s=i?i.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let o=s.length-1;;o--){let l=o>=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:d}=l,u,f,p,g;if(i&&i.range.fromB<d&&i.range.toB>h){let k=$u.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),V=$u.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);f=k.breakAtStart,p=k.openStart,g=V.openEnd;let R=this.compositionView(i);V.breakAtStart?R.breakAfter=1:V.content.length&&R.merge(R.length,R.length,V.content[0],!1,V.openStart,0)&&(R.breakAfter=V.content[0].breakAfter,V.content.shift()),k.content.length&&R.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(R).concat(V.content)}else({content:u,breakAtStart:f,openStart:p,openEnd:g}=$u.build(this.view.state.doc,h,d,this.decorations,this.dynamicDecorationMap));let{i:b,off:y}=r.findPos(c,1),{i:w,off:M}=r.findPos(a,-1);pw(this,w,M,b,y,u,f,p,g)}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(Iw)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new gr(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new Jo(s,[t],t.length);let i=new li;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=dt.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].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,r=!s&&cc(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(se.gecko&&l.empty&&!this.hasComposition&&AW(a)){let d=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(d,a.node.childNodes[a.offset]||null)),a=c=new Ni(d,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!ba(a.node,a.offset,h.anchorNode,h.anchorOffset)||!ba(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{se.android&&se.chrome&&this.dom.contains(h.focusNode)&&VW(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=za(this.view.root);if(d)if(l.empty){if(se.gecko){let u=TW(a.node,a.offset);if(u&&u!=3){let f=(u==1?dw:uw)(a.node,a.offset);f&&(a=new Ni(f.node,f.offset))}}d.collapse(a.node,a.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(a.node,a.offset);try{d.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Ni(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Ni(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ba(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=za(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=li.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=t.from&&i.collapse(s,r)}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 r=dt.get(t.childNodes[s]);r instanceof li&&(i=r.domAtPos(0))}for(let s=e.offset-1;!i&&s>=0;s--){let r=dt.get(t.childNodes[s]);r instanceof li&&(i=r.domAtPos(r.length))}return i?new Ni(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=dt.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 li)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,s=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(a<e)break;if(c<=e&&(c<e||l.covers(-1))&&(a>e||l.covers(1))&&(!i||l instanceof li&&!(i instanceof li&&t>=0)))i=l,s=c;else if(i&&c==e&&a==e&&l instanceof Sa&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}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 li))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof gr))return null;let r=de(s.text,i);if(r==i)return null;let o=Gr(s.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==ci.LTR;for(let c=0,h=0;h<this.children.length;h++){let d=this.children[h],u=c+d.length;if(u>s)break;if(c>=i){let f=d.dom.getBoundingClientRect();if(t.push(f.height),o){let p=d.dom.lastChild,g=p?Ua(p):[];if(g.length){let b=g[g.length-1],y=a?b.right-f.left:f.right-b.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+d.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?ci.RTL:ci.LTR}measureTextSize(){for(let r of this.children)if(r instanceof li){let o=r.measureTextSize();if(o)return o}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 r=Ua(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.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 fw(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(Qe.replace({widget:new a8(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return Qe.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Ka).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(zw).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(K.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 c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(Fw))try{if(c(this.view,e.range,e))return!0}catch(h){pn(this.view.state,h,"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 r=Kw(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;rW(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==ci.LTR)}};function AW(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")}let a8=class extends h2{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}};function qw(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=dw(t.focusNode,t.focusOffset),s=uw(t.focusNode,t.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=dt.get(s.node);if(!l||l instanceof gr&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=dt.get(i.node);!a||a instanceof gr&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function DW(n,e,t){let i=qw(n,t);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc,c=new tr(a.mapPos(r),a.mapPos(o),r,o),h=[];for(let d=s.parentNode;;d=d.parentNode){let u=dt.get(d);if(u instanceof Jo)h.push({node:d,deco:u.mark});else{if(u instanceof li||d.nodeName=="DIV"&&d.parentNode==n.contentDOM)return{range:c,text:s,marks:h,line:d};if(d!=n.contentDOM)h.push({node:d,deco:new c2({inclusive:!0,attributes:fW(d),tagName:d.tagName.toLowerCase()})});else return null}}}function TW(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 _W=class{constructor(){this.changes=[]}compareRange(e,t){z0(e,t,this.changes)}comparePoint(e,t){z0(e,t,this.changes)}};function OW(n,e,t){let i=new _W;return K.compare(n,e,t,i),i.changes}function VW(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 EW(n,e){let t=!1;return e&&n.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(t=!0)}),t}function PW(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return T.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=de(s.text,r,!1):l=de(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=de(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=de(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return T.range(o+s.from,l+s.from)}function LW(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function RW(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function qu(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function h8(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function c8(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function j0(n,e,t){let i,s,r,o,l=!1,a,c,h,d;for(let p=n.firstChild;p;p=p.nextSibling){let g=Ua(p);for(let b=0;b<g.length;b++){let y=g[b];s&&qu(s,y)&&(y=h8(c8(y,s.bottom),s.top));let w=LW(e,y),M=RW(t,y);if(w==0&&M==0)return p.nodeType==3?d8(p,e,t):j0(p,e,t);if(!i||o>M||o==M&&r>w){i=p,s=y,r=w,o=M;let k=M?t<y.top?-1:1:w?e<y.left?-1:1:0;l=!k||(k>0?b<g.length-1:b>0)}w==0?t>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):t<y.top&&(!d||d.top>y.top)&&(c=p,d=y):h&&qu(h,y)?h=c8(h,y.bottom):d&&qu(d,y)&&(d=h8(d,y.top))}}if(h&&h.bottom>=t?(i=a,s=h):d&&d.top<=t&&(i=c,s=d),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return d8(i,u,t);if(l&&i.contentEditable!="false")return j0(i,u,t);let f=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:f}}function d8(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=Gr(n,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let d=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&d<r){let u=e>=(h.left+h.right)/2,f=u;if((se.chrome||se.gecko)&&Gr(n,l).getBoundingClientRect().left==h.right&&(f=!u),d<=0)return{node:n,offset:l+(f?1:0)};s=l+(f?1:0),r=d}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Zw(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:d}=e,u=d-l;if(u<0)return 0;if(u>c)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,V=!1;a=n.elementAtHeight(u),a.type!=en.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(V)return t?null:0;V=!0,i=-i}d=l+u;let f=a.from;if(f<n.viewport.from)return n.viewport.from==0?0:t?null:u8(n,o,a,h,d);if(f>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:u8(n,o,a,h,d);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,b=g.elementFromPoint(h,d);b&&!n.contentDOM.contains(b)&&(b=null),b||(h=Math.max(o.left+1,Math.min(o.right-1,h)),b=g.elementFromPoint(h,d),b&&!n.contentDOM.contains(b)&&(b=null));let y,w=-1;if(b&&((s=n.docView.nearest(b))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,d);k&&({offsetNode:y,offset:w}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,d);k&&({startContainer:y,startOffset:w}=k,(!n.contentDOM.contains(y)||se.safari&&BW(y,w,h)||se.chrome&&HW(y,w,h))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let k=li.find(n.docView,f);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:w}=j0(k.dom,h,d))}let M=n.docView.nearest(y);if(!M)return null;if(M.isWidget&&((r=M.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=M.dom.getBoundingClientRect();return e.y<k.top||e.y<=k.bottom&&e.x<=(k.left+k.right)/2?M.posAtStart:M.posAtEnd}else return M.localPosFromDOM(y,w)+M.posAtStart}function u8(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+lr(o,r,n.state.tabSize)}function BW(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 Gr(n,i-1,i).getBoundingClientRect().left>t}function HW(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Gr(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function NW(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==en.Text))return i}return t}function FW(n,e,t,i){let s=NW(n,e.head),r=!i||s.type!=en.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==ci.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return T.cursor(a,t?-1:1)}return T.cursor(t?s.to:s.from,t?-1:1)}function f8(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let c=vW(s,r,o,l,t),h=Vw;if(!c){if(s.number==(t?n.state.doc.lines:1))return l;h=` `,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),c=n.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function IW(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==He.Space&&(s=o),s==o}}function WW(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return T.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,e.assoc||-1),h=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let f=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-f.from))),l=(r<0?f.top:f.bottom)+h}let d=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let f=0;;f+=10){let p=l+(u+f)*r,g=Zw(n,{x:d,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let b=n.docView.coordsForChar(g),y=!b||p<b.top?-1:1;return T.cursor(g,y,void 0,o)}}}function fc(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function Zu(n,e,t){let i=fc(n.state.facet(p2).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:T.cursor(i,i<t.from?1:-1)}let zW=class{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,se.safari&&e.contentDOM.addEventListener("input",()=>null),se.gecko&&nz(e.contentDOM.ownerDocument)}handleEvent(e){!YW(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=UW(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,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&&Yw.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),se.android&&se.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return se.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=jw.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||$W.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,Do(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:se.safari&&!se.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 p8(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){pn(t.state,s)}}}function UW(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 r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(p8(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(p8(i.value,o))}}for(let i in xs)t(i).handlers.push(xs[i]);for(let i in ss)t(i).observers.push(ss[i]);return e}const jw=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$W="dthko",Yw=[16,17,18,20,91,92,224,225],s1=6;function n1(n){return Math.max(0,n)*.7+8}function KW(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}let GW=class{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=oW(e.contentDOM),this.atoms=e.state.facet(p2).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ae.allowMultipleSelections)&&qW(e,t),this.dragging=jW(e,t)&&Qw(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&&KW(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Kw(this.view);e.clientX-a.left<=s+s1?t=-n1(s-e.clientX):e.clientX+a.right>=o-s1&&(t=n1(e.clientX-o)),e.clientY-a.top<=r+s1?i=-n1(r-e.clientY):e.clientY+a.bottom>=l-s1&&(i=n1(e.clientY-l)),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],r=null;if(s.empty){let o=fc(this.atoms,s.from,0);o!=s.from&&(r=T.cursor(o,-1))}else{let o=fc(this.atoms,s.from,-1),l=fc(this.atoms,s.to,1);(o!=s.from||l!=s.to)&&(r=T.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?T.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 qW(n,e){let t=n.state.facet(Ew);return t.length?t[0](e):se.mac?e.metaKey:e.ctrlKey}function ZW(n,e){let t=n.state.facet(Pw);return t.length?t[0](e):se.mac?!e.altKey:!e.ctrlKey}function jW(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=za(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function YW(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=dt.get(t))&&i.ignoreEvent(e))return!1;return!0}const xs=Object.create(null),ss=Object.create(null),Jw=se.ie&&se.ie_version<15||se.ios&&se.webkit_version<604;function JW(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(),Xw(n,t.value)},50)}function Xw(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Y0!=null&&t.selection.ranges.every(a=>a.empty)&&Y0==r.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let d=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:d},range:T.cursor(c.from+d.length)}})}else o?i=t.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:T.cursor(a.from+c.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ss.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};xs.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ss.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};ss.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};xs.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(Lw))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=ez(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new GW(n,e,t,i)),i&&n.observer.ignore(()=>{aw(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function g8(n,e,t,i){if(i==1)return T.cursor(e,t);if(i==2)return PW(n.state,e,t);{let s=li.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,T.range(o,l)}}let m8=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function XW(n,e,t,i){let s=li.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&m8(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&m8(t,i,l)?1:o&&o.bottom>=i?-1:1}function C8(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:XW(n,t,e.clientX,e.clientY)}}const QW=se.ie&&se.ie_version<=11;let y8=null,b8=0,S8=0;function Qw(n){if(!QW)return n.detail;let e=y8,t=S8;return y8=n,S8=Date.now(),b8=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(b8+1)%3:1}function ez(n,e){let t=C8(n,e),i=Qw(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=C8(n,r),c,h=g8(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let d=g8(n,t.pos,t.bias,i),u=Math.min(d.from,h.from),f=Math.max(d.to,h.to);h=u<h.from?T.range(u,f):T.range(f,u)}return o?s.replaceRange(s.main.extend(h.from,h.to)):l&&i==1&&s.ranges.length>1&&(c=tz(s,a.pos))?c:l?s.addRange(h):T.create([h])}}}function tz(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 T.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}xs.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 r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=T.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};xs.dragend=n=>(n.inputState.draggedContent=null,!1);function w8(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&ZW(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}xs.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,r=()=>{++s==t.length&&w8(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return w8(n,e,i,!0),!0}return!1};xs.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Jw?null:e.clipboardData;return t?(Xw(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(JW(n),!1)};function iz(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 sz(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:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Y0=null;xs.copy=xs.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=sz(n.state);if(!t&&!s)return!1;Y0=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Jw?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(iz(n,t),!1)};const ev=gi.define();function tv(n,e){let t=[];for(let i of n.facet(Hw)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:ev.of(!0)}):null}function iv(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=tv(n.state,e);t?n.dispatch(t):n.update([])}},10)}ss.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),iv(n)};ss.blur=n=>{n.observer.clearSelectionRange(),iv(n)};ss.compositionstart=ss.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ss.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,se.chrome&&se.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ss.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};xs.beforeinput=(n,e)=>{var t;let i;if(se.chrome&&se.android&&(i=jw.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return se.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),se.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ss.compositionend(n,e),20),!1};const v8=new Set;function nz(n){v8.has(n)||(v8.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const k8=["pre-wrap","normal","pre-line","break-spaces"];let rz=class{constructor(e){this.lineWrapping=e,this.doc=$.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}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 k8.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,r,o){let l=k8.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}},oz=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},Hn=class sv{constructor(e,t,i,s,r){this.from=e,this.length=t,this.top=i,this.height=s,this._content=r}get type(){return typeof this._content=="number"?en.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 Xo?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 sv(this.from,this.length+e.length,this.top,this.height+e.height,t)}};var rt=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(rt||(rt={}));const pc=.001;let ys=class gc{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,t){this.height!=t&&(Math.abs(this.height-t)>pc&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return gc.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:d}=s[l],u=r.lineAt(a,rt.ByPosNoHeight,i.setDoc(t),0,0),f=u.to>=c?u:r.lineAt(c,rt.ByPosNoHeight,i,0,0);for(d+=f.to-c,c=f.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,rt.ByPosNoHeight,i,0,0));h+=u.from-a,a=u.from;let p=hz.build(i.setDoc(o),e,h,d);r=r.replace(a,c,p)}return r.updateHeight(i,0)}static empty(){return new Us(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,s=0,r=0;for(;;)if(t==i)if(s>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[t++];l&&(s+=l.size)}else{let l=e[--i];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new lz(gc.of(e.slice(0,t)),o,gc.of(e.slice(i)))}};ys.prototype.size=1;let nv=class extends ys{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,s){return new Hn(s,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,s,r){return this.blockAt(0,i,s,r)}forEachLine(e,t,i,s,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},Us=class J0 extends nv{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new Hn(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof J0||s instanceof To&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof To?s=new J0(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ys.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,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:""})`}},To=class us extends ys{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let c=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=t.doc.lineAt(c),d=l+h.length*a,u=Math.max(i,e-d/2);return new Hn(h.from,h.length,u,d,0)}else{let c=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:h,length:d}=t.doc.line(r+c);return new Hn(h,d,i+l*c,l,0)}}lineAt(e,t,i,s,r){if(t==rt.ByHeight)return this.blockAt(e,i,s,r);if(t==rt.ByPosNoHeight){let{from:f,to:p}=i.doc.lineAt(e);return new Hn(f,p-f,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),c=i.doc.lineAt(e),h=l+c.length*a,d=c.number-o,u=s+l*d+a*(c.from-r-d);return new Hn(c.from,c.length,Math.max(s,Math.min(u,s+this.height-h)),h,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,r);for(let h=e,d=s;h<=t;){let u=i.doc.lineAt(h);if(h==e){let p=u.number-l;d+=a*p+c*(e-r-p)}let f=a+c*u.length;o(new Hn(u.from,u.length,d,f,0)),d+=f,h=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof us?i[i.length-1]=new us(r.length+s):i.push(null,new us(s-1))}if(e>0){let r=i[0];r instanceof us?i[0]=new us(e+r.length):i.unshift(new us(e-1),null)}return ys.of(i)}decomposeLeft(e,t){t.push(new us(e-1),null)}decomposeRight(e,t){t.push(null,new us(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new us(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let d=s.heights[s.index++];a==-1?a=d:Math.abs(d-a)>=pc&&(a=-2);let u=new Us(h,d);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new us(r-l).updateHeight(e,l));let c=ys.of(o);return(a<0||Math.abs(c.height-this.height)>=pc||Math.abs(a-this.heightMetrics(e,t).perLine)>=pc)&&(e.heightChanged=!0),c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},lz=class extends ys{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 r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,s):this.right.blockAt(e,t,r,s+this.left.length+this.break)}lineAt(e,t,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=t==rt.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,i,s,r):this.right.lineAt(e,t,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=t==rt.ByPosNoHeight?rt.ByPosNoHeight:rt.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,s,r).join(c)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,s,r,o),t>=a&&this.right.forEachLine(e,t,i,l,a,o);else{let c=this.lineAt(a,rt.ByPos,i,s,r);e<c.from&&this.left.forEachLine(e,c.from-1,i,s,r,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,l,a,o)}}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 r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&x8(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),x8(r,l)}return ys.of(r)}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?ys.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function x8(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof To&&(i=n[e+1])instanceof To&&n.splice(e-1,3,new To(t.length+1+i.length))}const az=5;let hz=class rv{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 Us?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Us(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,r=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new nv(o,s,i)):(o||r||s>=az)&&this.addLineDeco(s,r,o)}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 Us(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new To(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 Us)return e;let t=new Us(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 Us)&&!this.isCovered?this.nodes.push(new Us(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 Us&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,t,i,s){let r=new rv(i,e);return K.spans(t,i,s,r,0),r.finish(i)}};function cz(n,e,t){let i=new dz;return K.compare(n,e,t,i,0),i.changes}let dz=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,s){(e<t||i&&i.heightRelevant||s&&s.heightRelevant)&&z0(e,t,this.changes,5)}};function uz(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,r=Math.max(0,t.left),o=Math.min(s.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(s.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=i.body;)if(c.nodeType==1){let h=c,d=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=c==n.parentNode?u.bottom:Math.min(a,u.bottom)}c=d.position=="absolute"||d.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function fz(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}let ju=class{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],r=t[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e,t){return Qe.replace({widget:new pz(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},pz=class extends h2{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}},M8=class{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=A8,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ci.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(f2).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new rz(t),this.stateDeco=e.facet(Ka).filter(i=>typeof i!="function"),this.heightMap=ys.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle.setDoc(e.doc),[new tr(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=Qe.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:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new r1(r,o))}}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?A8:new Cz(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(Yl(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ka).filter(h=>typeof h!="function");let s=e.changedRanges,r=tr.extendWithRanges(s,cz(i,this.stateDeco,e?e.changes:Be.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(xW)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?ci.RTL:ci.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:V}=lw(t,l);(k>.005&&Math.abs(this.scaleX-k)>.005||V>.005&&Math.abs(this.scaleY-V)>.005)&&(this.scaleX=k,this.scaleY=V,c|=8,o=a=!0)}let d=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=u)&&(this.paddingTop=d,this.paddingBottom=u,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=cw(e.scrollDOM);let p=(this.printing?fz:uz)(t,this.paddingTop),g=p.top-this.pixelViewport.top,b=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(k)&&(o=!0),o||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:V,charWidth:R,textHeight:H}=e.docView.measureTextSize();o=V>0&&s.refresh(r,V,R,H,w/R,k),o&&(e.docView.minWidth=0,c|=8)}g>0&&b>0?h=Math.max(g,b):g<0&&b<0&&(h=Math.min(g,b)),s.heightChanged=!1;for(let V of this.viewports){let R=V.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(V);this.heightMap=(o?ys.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle,[new tr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new oz(V.from,R))}s.heightChanged&&(c|=2)}let M=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||M)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}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,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new r1(s.lineAt(o-i*1e3,rt.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,rt.ByHeight,r,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=s.lineAt(c,rt.ByPos,r,0,0),u;t.y=="center"?u=(d.top+d.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c<a.from?u=d.top:u=d.bottom-h,a=new r1(s.lineAt(u-1e3/2,rt.ByHeight,r,0,0).from,s.lineAt(u+h+1e3/2,rt.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new r1(this.heightMap.lineAt(i,rt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,rt.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,rt.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,rt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r<l+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 ju(t.mapPos(s.from),t.mapPos(s.to),s.size));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=ci.LTR&&!i)return[];let l=[],a=(h,d,u,f)=>{if(d-h<r)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let y of g)if(y>h&&y<d){a(h,y-10,u,f),a(y+10,d,u,f);return}let b=mz(e,y=>y.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)<r&&Math.abs(y.to-d)<r&&!g.some(w=>y.from<w&&y.to>w));if(!b){if(d<u.to&&t&&i&&t.visibleRanges.some(y=>y.from<=d&&y.to>=d)){let y=t.moveToLineBoundary(T.cursor(d),!1,!0).head;y>h&&(d=y)}b=new ju(h,d,this.gapSize(u,h,d,f))}l.push(b)},c=h=>{if(h.length<o||h.type!=en.Text)return;let d=gz(h.from,h.to,this.stateDeco);if(d.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,f,p;if(i){let g=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,y;if(u!=null){let w=l1(d,u),M=((this.visibleBottom-this.visibleTop)/2+g)/h.height;b=w-M,y=w+M}else b=(this.visibleTop-h.top-g)/h.height,y=(this.visibleBottom-h.top+g)/h.height;f=o1(d,b),p=o1(d,y)}else{let g=d.total*this.heightOracle.charWidth,b=s*this.heightOracle.charWidth,y,w;if(u!=null){let M=l1(d,u),k=((this.pixelViewport.right-this.pixelViewport.left)/2+b)/g;y=M-k,w=M+k}else y=(this.pixelViewport.left-b)/g,w=(this.pixelViewport.right+b)/g;f=o1(d,y),p=o1(d,w)}f>h.from&&a(h.from,f,h,d),p<h.to&&a(p,h.to,h,d)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(e,t,i,s){let r=l1(s,i)-l1(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){ju.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Qe.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];K.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Yl(this.heightMap.lineAt(e,rt.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)||Yl(this.heightMap.lineAt(this.scaler.fromDOM(e),rt.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 Yl(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}},r1=class{constructor(e,t){this.from=e,this.to=t}};function gz(n,e,t){let i=[],s=n,r=0;return K.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(i.push({from:s,to:e}),r+=e-s),{total:r,ranges:i}}function o1({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:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function l1(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 mz(n,e){for(let t of n)if(e(t))return t}const A8={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};let Cz=class ov{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=t.lineAt(l,rt.ByPos,e,0,0).top,h=t.lineAt(a,rt.ByPos,e,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return s+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,s=r.domBottom}}fromDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,s=r.domBottom}}eq(e){return e instanceof ov?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 Yl(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new Hn(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(s=>Yl(s,e)):n._content)}const a1=P.define({combine:n=>n.join(" ")}),X0=P.define({combine:n=>n.indexOf(!0)>-1}),Q0=we.newName(),lv=we.newName(),av=we.newName(),hv={"&light":"."+lv,"&dark":"."+av};function eg(n,e,t){return new we(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 yz=eg("."+Q0,{"&":{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},".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:"#444"},".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},"&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:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".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"}},hv),Jl="";let bz=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ae.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Jl}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=dt.get(s),a=dt.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:Kc(s))||Kc(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}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 r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=dt.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+(Sz(e,i.node,i.offset)?t:0))}};function Sz(n,e,t){for(;;){if(!e||t<Sn(e))return!1;if(e==n)return!0;t=Kr(e)+1,e=e.parentNode}}let D8=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},wz=class{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:xz(e),a=new bz(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Mz(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!O0(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!O0(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((se.ios||se.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.to<e.state.doc.length)){let d=Math.min(a,c),u=Math.max(a,c),f=h.from-d,p=h.to-u;(f==0||f==1||d==0)&&(p==0||p==-1||u==e.state.doc.length)&&(a=0,c=e.state.doc.length)}this.newSel=T.single(c,a)}}};function cv(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,c=null;(r===8||se.android&&e.text.length<l-o)&&(a=s.to,c="end");let h=kz(n.state.doc.sliceString(o,l,Jl),e.text,a-o,c);h&&(se.chrome&&r==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==Jl+Jl&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:$.of(e.text.slice(h.from,h.toB).split(Jl))})}else i&&(!n.hasFocus&&n.state.facet(Bn)||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))}:(se.mac||se.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=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}):se.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` `&&n.lineWrapping&&(i&&(i=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}),t)return dv(n,t,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function dv(n,e,t,i=-1){if(se.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(se.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&&Do(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)&&Do(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Do(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=vz(n,e,t));return n.state.facet(Bw).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function vz(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.from<e.from?s.sliceDoc(r.from,e.from):"",a=r.to>e.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let c=n.state.sliceDoc(e.from,e.to),h,d=t&&qw(n,t.main.head);if(d){let p=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-e.to,f=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,b=g-c.length;if(p.to-p.from!=f||n.state.sliceDoc(b,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:b,to:g,insert:e.insert}),w=p.to-r.to;return{changes:y,range:a?T.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function kz(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function xz(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new D8(t,i)),(s!=t||r!=i)&&e.push(new D8(s,r))),e}function Mz(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?T.single(t+e,i+e):null}const Az={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Yu=se.ie&&se.ie_version<=11;let Dz=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new lW,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);(se.ie&&se.ie_version<=11||se.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&&!(se.chrome&&se.chrome_version<126)&&(this.editContext=new _z(e),e.state.facet(Bn)&&(e.contentDOM.editContext=this.editContext.editContext)),Yu&&(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.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(Bn)?i.root.activeElement!=this.dom:!cc(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(se.ie&&se.ie_version<=11||se.android&&se.chrome)&&!i.state.selection.main.empty&&s.focusNode&&ba(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=za(e.root);if(!t)return!1;let i=se.safari&&e.root.nodeType==11&&sW(this.dom.ownerDocument)==this.dom&&Tz(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let s=cc(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&hW(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,Az),Yu&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Yu&&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 r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Do(this.dom,r.key,r.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 r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&cc(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 r=new wz(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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=cv(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=T8(t,e.previousSibling||e.target.previousSibling,-1),s=T8(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("change",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("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Bn)!=e.state.facet(Bn)&&(e.view.contentDOM.editContext=e.state.facet(Bn)?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 T8(n,e,t){for(;e;){let i=dt.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 _8(n,e){let t=e.startContainer,i=e.startOffset,s=e.endContainer,r=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return ba(o.node,o.offset,s,r)&&([t,i,s,r]=[s,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}}function Tz(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return _8(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?_8(n,t):null}let _z=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(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,r={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:$.of(i.text.split(` `))};r.from==this.from&&s<this.from?r.from=s:r.to==this.to&&s>this.to&&(r.to=s),!(r.from==r.to&&!r.insert.length)&&(this.pendingContextChange=r,e.state.readOnly||dv(e,r,T.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(Qe.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}e.dispatch({effects:Iw.of(Qe.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=za(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((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(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)}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){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},_e=class tg{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={}){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:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||aW(e.parent)||document,this.viewState=new M8(e.state||ae.create(e)),e.scrollTo&&e.scrollTo.is(i1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Zl).map(i=>new Gu(i));for(let i of this.plugins)i.update(this);this.observer=new Dz(this),this.inputState=new zW(this),this.inputState.ensureHandlers(this.plugins),this.docView=new l8(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof pt?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,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(ev))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=tv(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(ae.phrases)!=this.state.facet(ae.phrases))return this.setState(r);s=o8.create(this,r,e),s.flags|=l;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(d&&(d=d.map(u.changes)),u.scrollIntoView){let{main:f}=u.state.selection;d=new Ku(f.empty?f:T.cursor(f.head,f.head>f.anchor?-1:1))}for(let f of u.effects)f.is(i1)&&(d=f.value.clip(this.state))}this.viewState.update(s,d),this.bidiCache=V8.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(jl)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(a1)!=s.state.facet(a1)&&(this.viewState.mustMeasureContent=!0),(t||i||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(G0))try{u(s)}catch(f){pn(this.state,f,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!cv(this,h)&&c.force&&Do(this.contentDOM,c.key,c.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 M8(e),this.plugins=e.facet(Zl).map(i=>new Gu(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new l8(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(Zl),i=e.state.facet(Zl);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Gu(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.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){pn(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:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(cw(i))r=-1,o=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(s);r=f.from,o=f.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(f=>{try{return f.read(this)}catch(p){return pn(this.state,p),O8}}),d=o8.create(this,this.state,[]),u=!1;d.flags|=a,t?t.flags|=a:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),u=this.docView.update(d),u&&this.docViewUpdate());for(let f=0;f<c.length;f++)if(h[f]!=O8)try{let p=c[f];p.write&&p.write(h[f],this)}catch(p){pn(this.state,p)}if(u&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(G0))l(t)}get themeClasses(){return Q0+" "+(this.state.facet(X0)?av:lv)+" "+this.state.facet(a1)}updateAttrs(){let e=E8(this,Ww,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Bn)?"true":"false",class:"cm-content",style:`${se.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),E8(this,f2,t);let i=this.observer.ignore(()=>{let s=W0(this.contentDOM,this.contentAttrs,t),r=W0(this.dom,this.editorAttrs,e);return s||r});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(tg.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(jl);let e=this.state.facet(tg.cspNonce);we.mount(this.root,this.styleModules.concat(yz).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 Zu(this,e,f8(this,e,t,i))}moveByGroup(e,t){return Zu(this,e,f8(this,e,t,i=>IW(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return T.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return FW(this,e,t,i)}moveVertically(e,t,i){return Zu(this,e,WW(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(),Zw(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),r=this.bidiSpans(s),o=r[Zn.find(r,e-s.from,-1,t)];return l2(i,o.dir==ci.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(Nw)||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>Oz)return Ow(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||_w(r.isolates,i=r8(this,e))))return r.order;i||(i=r8(this,e));let s=wW(e.text,t,i);return this.bidiCache.push(new V8(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||se.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{aw(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 i1.of(new Ku(typeof e=="number"?T.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 i1.of(new Ku(T.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 $a.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return $a.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=we.newName(),s=[a1.of(i),jl.of(eg(`.${i}`,e))];return t&&t.dark&&s.push(X0.of(!0)),s}static baseTheme(e){return Vi.lowest(jl.of(eg("."+Q0,e,hv)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&dt.get(i)||dt.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}};_e.styleModule=jl;_e.inputHandler=Bw;_e.scrollHandler=Fw;_e.focusChangeEffect=Hw;_e.perLineTextDirection=Nw;_e.exceptionSink=Rw;_e.updateListener=G0;_e.editable=Bn;_e.mouseSelectionStyle=Lw;_e.dragMovesSelection=Pw;_e.clickAddsSelectionRange=Ew;_e.decorations=Ka;_e.outerDecorations=zw;_e.atomicRanges=p2;_e.bidiIsolatedRanges=Uw;_e.scrollMargins=$w;_e.darkTheme=X0;_e.cspNonce=P.define({combine:n=>n.length?n[0]:""});_e.contentAttributes=f2;_e.editorAttributes=Ww;_e.lineWrapping=_e.contentAttributes.of({class:"cm-lineWrapping"});_e.announce=ce.define();const Oz=4096,O8={};let V8=class uv{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:ci.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!t.touchesRange(o.from,o.to)&&i.push(new uv(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function E8(n,e,t){for(let i=n.state.facet(e),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&I0(o,t)}return t}const Vz=se.mac?"mac":se.windows?"win":se.linux?"linux":"key";function Ez(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;a<t.length-1;++a){const c=t[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))s=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return s&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function h1(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 Pz=Vi.default(_e.domEventHandlers({keydown(n,e){return pv(fv(e.state),n,e,"editor")}})),Lz=P.define({enables:Pz}),P8=new WeakMap;function fv(n){let e=n.facet(Lz),t=P8.get(e);return t||P8.set(e,t=Hz(e.reduce((i,s)=>i.concat(s),[]))),t}function Rz(n,e,t){return pv(fv(n.state),e,n,t)}let Nn=null;const Bz=4e3;function Hz(n,e=Vz){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c,h)=>{var d,u;let f=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>Ez(y,e));for(let y=1;y<p.length;y++){let w=p.slice(0,y).join(" ");s(w,!0),f[w]||(f[w]={preventDefault:!0,stopPropagation:!1,run:[M=>{let k=Nn={view:M,prefix:w,scope:o};return setTimeout(()=>{Nn==k&&(Nn=null)},Bz),!0}]})}let g=p.join(" ");s(g,!1);let b=f[g]||(f[g]={preventDefault:!1,stopPropagation:!1,run:((u=(d=f._any)===null||d===void 0?void 0:d.run)===null||u===void 0?void 0:u.slice())||[]});a&&b.run.push(a),c&&(b.preventDefault=!0),h&&(b.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=t[c]||(t[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=o;for(let u in h)h[u].run.push(f=>d(f,ig))}let a=o[e]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let ig=null;function pv(n,e,t,i){ig=e;let s=Tm(e),r=Pt(s,0),o=Di(r)==s.length&&s!=" ",l="",a=!1,c=!1,h=!1;Nn&&Nn.view==t&&Nn.scope==i&&(l=Nn.prefix+" ",Yw.indexOf(e.keyCode)<0&&(c=!0,Nn=null));let d=new Set,u=b=>{if(b){for(let y of b.run)if(!d.has(y)&&(d.add(y),y(t)))return b.stopPropagation&&(h=!0),!0;b.preventDefault&&(b.stopPropagation&&(h=!0),c=!0)}return!1},f=n[i],p,g;return f&&(u(f[l+h1(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(se.windows&&e.ctrlKey&&e.altKey)&&(p=nn[e.keyCode])&&p!=s?(u(f[l+h1(p,e,!0)])||e.shiftKey&&(g=Pr[e.keyCode])!=s&&g!=p&&u(f[l+h1(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(f[l+h1(s,e,!0)])&&(a=!0),!a&&u(f._any)&&(a=!0)),c&&(a=!0),a&&h&&e.stopPropagation(),ig=null,a}const Nz=!se.ios,L8={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Nz&&(L8[".cm-line"].caretColor=L8[".cm-content"].caretColor="transparent !important");const R8=P.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 qc(n,e){let t=n.plugin(gv),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const gv=$a.fromClass(class{constructor(n){this.input=n.state.facet(Zc),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(R8);this.top=new c1(n,!0,e.topContainer),this.bottom=new c1(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(R8);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new c1(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new c1(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Zc);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(n.view),l.push(h)):(h=this.panels[c],h.update&&h.update(n)),s.push(h),(h.top?r:o).push(h)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>_e.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});let c1=class{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=B8(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=B8(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 B8(n){let e=n.nextSibling;return n.remove(),e}const Zc=P.define({enables:gv});let el=class extends Bt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};el.prototype.elementClass="";el.prototype.toDOM=void 0;el.prototype.mapMode=fe.TrackBefore;el.prototype.startSide=el.prototype.endSide=-1;el.prototype.point=!0;function Xe(){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++)mv(n,arguments[e]);return n}function mv(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++)mv(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}const H8=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class tl{constructor(e,t,i=0,s=e.length,r,o){this.test=o,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=r?l=>r(H8(l)):H8,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 Pt(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=xm(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Di(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&r<t.length&&t.charCodeAt(r)==l&&o++}}}match(e,t,i){let s=null;for(let r=0;r<this.matches.length;r+=2){let o=this.matches[r],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?s={from:this.matches[r+1],to:i}:(this.matches[r]++,l=!0)),l||(this.matches.splice(r,2),r-=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"&&(tl.prototype[Symbol.iterator]=function(){return this});const Cv={from:-1,to:-1,match:/.*/.exec("")},g2="gm"+(/x/.unicode==null?"":"u");class yv{constructor(e,t,i,s=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=Cv,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new bv(e,t,i,s,r);this.re=new RegExp(t,g2+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.iter=e.iter();let o=e.lineAt(s);this.curLineStart=o.from,this.matchPos=jc(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=jc(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 Ju=new WeakMap;class _o{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let s=Ju.get(e);if(!s||s.from>=i||s.to<=t){let l=new _o(t,e.sliceString(t,i));return Ju.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to<i&&(r+=e.sliceString(s.to,i)),Ju.set(e,new _o(o,r)),new _o(t,r.slice(t-o,i-o))}}class bv{constructor(e,t,i,s,r){this.text=e,this.to=r,this.done=!1,this.value=Cv,this.matchPos=jc(e,s),this.re=new RegExp(t,g2+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.flat=_o.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=jc(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=_o.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(yv.prototype[Symbol.iterator]=bv.prototype[Symbol.iterator]=function(){return this});function Fz(n){try{return new RegExp(n,g2),!0}catch{return!1}}function jc(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 sg(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Xe("input",{class:"cm-textfield",name:"line",value:e}),i=Xe("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:Yc.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},Xe("label",n.state.phrase("Go to line"),": ",t)," ",Xe("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,c,h,d]=r,u=h?+h.slice(1):0,f=c?+c:l.number;if(c&&d){let b=f/100;a&&(b=b*(a=="-"?-1:1)+l.number/o.doc.lines),f=Math.round(o.doc.lines*b)}else c&&a&&(f=f*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,f))),g=T.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[Yc.of(!1),_e.scrollIntoView(g.from,{y:"center"})],selection:g}),n.focus()}return{dom:i}}const Yc=ce.define(),N8=qt.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Yc)&&(n=t.value);return n},provide:n=>Zc.from(n,e=>e?sg:null)}),Iz=n=>{let e=qc(n,sg);if(!e){let t=[Yc.of(!0)];n.state.field(N8,!1)==null&&t.push(ce.appendConfig.of([N8,Wz])),n.dispatch({effects:t}),e=qc(n,sg)}return e&&e.dom.querySelector("input").select(),!0},Wz=_e.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),zz={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Uz=P.define({combine(n){return on(n,zz,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function $z(n){return[jz,Zz]}const Kz=Qe.mark({class:"cm-selectionMatch"}),Gz=Qe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function F8(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=He.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=He.Word)}function qz(n,e,t,i){return n(e.sliceDoc(t,t+1))==He.Word&&n(e.sliceDoc(i-1,i))==He.Word}const Zz=$a.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(Uz),{state:t}=n,i=t.selection;if(i.ranges.length>1)return Qe.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return Qe.none;let a=t.wordAt(s.head);if(!a)return Qe.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a<e.minSelectionLength||a>200)return Qe.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(F8(o,t,s.from,s.to)&&qz(o,t,s.from,s.to)))return Qe.none}else if(r=t.sliceDoc(s.from,s.to),!r)return Qe.none}let l=[];for(let a of n.visibleRanges){let c=new tl(t.doc,r,a.from,a.to);for(;!c.next().done;){let{from:h,to:d}=c.value;if((!o||F8(o,t,h,d))&&(s.empty&&h<=s.from&&d>=s.to?l.push(Gz.range(h,d)):(h>=s.to||d<=s.from)&&l.push(Kz.range(h,d)),l.length>e.maxMatches))return Qe.none}}return Qe.set(l)}},{decorations:n=>n.decorations}),jz=_e.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Yz=({state:n,dispatch:e})=>{let{selection:t}=n,i=T.create(t.ranges.map(s=>n.wordAt(s.head)||T.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function Jz(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new tl(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new tl(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Xz=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return Yz({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=Jz(n,i);return s?(e(n.update({selection:n.selection.addRange(T.range(s.from,s.to),!1),effects:_e.scrollIntoView(s.to)})),!0):!1},Cl=P.define({combine(n){return on(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new cU(e),scrollToMatch:e=>_e.scrollIntoView(e)})}});class Sv{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||Fz(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 iU(this):new eU(this)}getCursor(e,t=0,i){let s=e.doc?e:ae.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?po(this,s,t,i):fo(this,s,t,i)}}let wv=class{constructor(e){this.spec=e}};function fo(n,e,t,i){return new tl(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Qz(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Qz(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(Jc(s,t-r))!=He.Word||e(Xc(s,t-r))!=He.Word)&&(e(Xc(s,i-r))!=He.Word||e(Jc(s,i-r))!=He.Word))}class eU extends wv{constructor(e){super(e)}nextMatch(e,t,i){let s=fo(this.spec,e,i,e.doc.length).nextOverlapping();return s.done&&(s=fo(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=fo(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}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)}matchAll(e,t){let i=fo(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 r=fo(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function po(n,e,t,i){return new yv(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?tU(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Jc(n,e){return n.slice(de(n,e,!1),e)}function Xc(n,e){return n.slice(e,de(n,e))}function tU(n){return(e,t,i)=>!i[0].length||(n(Jc(i.input,i.index))!=He.Word||n(Xc(i.input,i.index))!=He.Word)&&(n(Xc(i.input,i.index+i[0].length))!=He.Word||n(Jc(i.input,i.index+i[0].length))!=He.Word)}class iU extends wv{nextMatch(e,t,i){let s=po(this.spec,e,i,e.doc.length).next();return s.done&&(s=po(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=po(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==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=po(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 r=po(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Ga=ce.define(),m2=ce.define(),ir=qt.define({create(n){return new Xu(ng(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ga)?n=new Xu(t.value.create(),n.panel):t.is(m2)&&(n=new Xu(n.query,t.value?C2:null));return n},provide:n=>Zc.from(n,e=>e.panel)});class Xu{constructor(e,t){this.query=e,this.panel=t}}const sU=Qe.mark({class:"cm-searchMatch"}),nU=Qe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),rU=$a.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ir))}update(n){let e=n.state.field(ir);(e!=n.startState.field(ir)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Qe.none;let{view:t}=this,i=new or;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(c,h)=>{let d=t.state.selection.ranges.some(u=>u.from==c&&u.to==h);i.add(c,h,d?nU:sU)})}return i.finish()}},{decorations:n=>n.decorations});function mh(n){return e=>{let t=e.state.field(ir,!1);return t&&t.query.spec.valid?n(e,t):xv(e)}}const Qc=mh((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=T.single(i.from,i.to),r=n.state.facet(Cl);return n.dispatch({selection:s,effects:[y2(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),kv(n),!0}),ed=mh((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=T.single(s.from,s.to),o=n.state.facet(Cl);return n.dispatch({selection:r,effects:[y2(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),kv(n),!0}),oU=mh((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:T.create(t.map(i=>T.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),lU=({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,r=[],o=0;for(let l=new tl(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(T.range(l.value.from,l.value.to))}return e(n.update({selection:T.create(r,o),userEvent:"select.search.matches"})),!0},I8=mh((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,c=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),c.push(_e.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let h=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=T.single(r.from-h,r.to-h),c.push(y2(n,r)),c.push(t.facet(Cl).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:c,userEvent:"input.replace"}),!0}),aU=mh((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:_e.announce.of(i),userEvent:"input.replace.all"}),!0});function C2(n){return n.state.facet(Cl).createPanel(n)}function ng(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let c=n.facet(Cl);return new Sv({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:c.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function vv(n){let e=qc(n,C2);return e&&e.dom.querySelector("[main-field]")}function kv(n){let e=vv(n);e&&e==n.root.activeElement&&e.select()}const xv=n=>{let e=n.state.field(ir,!1);if(e&&e.panel){let t=vv(n);if(t&&t!=n.root.activeElement){let i=ng(n.state,e.query.spec);i.valid&&n.dispatch({effects:Ga.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[m2.of(!0),e?Ga.of(ng(n.state,e.query.spec)):ce.appendConfig.of(uU)]});return!0},Mv=n=>{let e=n.state.field(ir,!1);if(!e||!e.panel)return!1;let t=qc(n,C2);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:m2.of(!1)}),!0},hU=[{key:"Mod-f",run:xv,scope:"editor search-panel"},{key:"F3",run:Qc,shift:ed,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Qc,shift:ed,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Mv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:lU},{key:"Mod-Alt-g",run:Iz},{key:"Mod-d",run:Xz,preventDefault:!0}];class cU{constructor(e){this.view=e;let t=this.query=e.state.field(ir).query.spec;this.commit=this.commit.bind(this),this.searchField=Xe("input",{value:t.search,placeholder:Ei(e,"Find"),"aria-label":Ei(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Xe("input",{value:t.replace,placeholder:Ei(e,"Replace"),"aria-label":Ei(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Xe("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Xe("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Xe("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return Xe("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=Xe("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>Qc(e),[Ei(e,"next")]),i("prev",()=>ed(e),[Ei(e,"previous")]),i("select",()=>oU(e),[Ei(e,"all")]),Xe("label",null,[this.caseField,Ei(e,"match case")]),Xe("label",null,[this.reField,Ei(e,"regexp")]),Xe("label",null,[this.wordField,Ei(e,"by word")]),...e.state.readOnly?[]:[Xe("br"),this.replaceField,i("replace",()=>I8(e),[Ei(e,"replace")]),i("replaceAll",()=>aU(e),[Ei(e,"replace all")])],Xe("button",{name:"close",onclick:()=>Mv(e),"aria-label":Ei(e,"close"),type:"button"},["×"])])}commit(){let e=new Sv({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:Ga.of(e)}))}keydown(e){Rz(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ed:Qc)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),I8(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Ga)&&!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(Cl).top}}function Ei(n,e){return n.state.phrase(e)}const d1=30,u1=/[\s\.,:;?!]/;function y2(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-d1),o=Math.min(s,t+d1),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<d1;a++)if(!u1.test(l[a+1])&&u1.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-d1;a--)if(!u1.test(l[a-1])&&u1.test(l[a])){l=l.slice(0,a);break}}return _e.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const dU=_e.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"}}),uU=[ir,Vi.low(rU),dU];function qa(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function rg(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function fU(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function mc(n,e){if(!e.anchorNode)return!1;try{return rg(n,e.anchorNode)}catch{return!1}}function Za(n){return n.nodeType==3?jr(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function wa(n,e,t,i){return t?W8(n,e,t,i,-1)||W8(n,e,t,i,1):!1}function Zr(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function td(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function W8(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:wn(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Zr(n)+(s<0?0:1),n=r}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?wn(n):0}else return!1}}function wn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function b2(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function pU(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 Av(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 gU(n,e,t,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,d=!1;h&&!d;)if(h.nodeType==1){let u,f=h==a.body,p=1,g=1;if(f)u=pU(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(d=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let w=h.getBoundingClientRect();({scaleX:p,scaleY:g}=Av(h,w)),u={left:w.left,right:w.left+h.clientWidth*p,top:w.top,bottom:w.top+h.clientHeight*g}}let b=0,y=0;if(s=="nearest")e.top<u.top?(y=-(u.top-e.top+o),t>0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y<u.top&&(y=-(u.top+y-e.top+o)));else{let w=e.bottom-e.top,M=u.bottom-u.top;y=(s=="center"&&w<=M?e.top+w/2-M/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-M+o)-u.top}if(i=="nearest"?e.left<u.left?(b=-(u.left-e.left+r),t>0&&e.right>u.right+b&&(b=e.right-u.right+b+r)):e.right>u.right&&(b=e.right-u.right+r,t<0&&e.left<u.left+b&&(b=-(u.left+b-e.left+r))):b=(i=="center"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:i=="start"==l?e.left-r:e.right-(u.right-u.left)+r)-u.left,b||y)if(f)c.scrollBy(b,y);else{let w=0,M=0;if(y){let k=h.scrollTop;h.scrollTop+=y/g,M=(h.scrollTop-k)*g}if(b){let k=h.scrollLeft;h.scrollLeft+=b/p,w=(h.scrollLeft-k)*p}e={left:e.left-w,top:e.top-M,right:e.right-w,bottom:e.bottom-M},w&&Math.abs(w-b)<1&&(i="nearest"),M&&Math.abs(M-y)<1&&(s="nearest")}if(f)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function mU(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}}let CU=class{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?wn(t):0),i,Math.min(e.focusOffset,i?wn(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}},oo=null;function Dv(n){if(n.setActive)return n.setActive();if(oo)return n.focus(oo);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(oo==null?{get preventScroll(){return oo={preventScroll:!0},!0}}:void 0),!oo){oo=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let z8;function jr(n,e,t=e){let i=z8||(z8=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Oo(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 r=new KeyboardEvent("keydown",s);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function yU(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function Tv(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function bU(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,wn(t));;)if(i){if(t.nodeType!=1)return!1;let s=t.childNodes[i-1];s.contentEditable=="false"?i--:(t=s,i=wn(t))}else{if(t==n)return!0;i=Zr(t),t=t.parentNode}}function _v(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function Ov(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=wn(t)}else if(t.parentNode&&!td(t))i=Zr(t),t=t.parentNode;else return null}}function Vv(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&&!td(t))i=Zr(t)+1,t=t.parentNode;else return null}}let Fi=class og{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new og(e.parentNode,Zr(e),t)}static after(e,t){return new og(e.parentNode,Zr(e)+1,t)}};const S2=[];let ut=class lg{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,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=lg.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=U8(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=U8(r)}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=wn(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!lg.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,h=i;a<this.children.length;a++){let d=this.children[a],u=c+d.length;if(c<e&&u>t)return d.domBoundsAround(e,t,c);if(u>=e&&s==-1&&(s=a,r=c),c>t&&d.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+d.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].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=S2){this.markDirty();for(let s=e;s<t;s++){let r=this.children[s];r.parent==this&&i.indexOf(r)<0&&r.destroy()}this.children.splice(e,t-e,...i);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 Ev(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,r,o){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}};ut.prototype.breakAfter=0;function U8(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}let Ev=class{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 Pv(n,e,t,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[e]:null,d=r.length?r[r.length-1]:null,u=d?d.breakAfter:o;if(!(e==i&&h&&!o&&!u&&r.length<2&&h.merge(t,s,r.length?d:null,t==0,l,a))){if(i<c.length){let f=c[i];f&&(s<f.length||f.breakAfter&&(d!=null&&d.breakAfter))?(e==i&&(f=f.split(s),s=0),!u&&d&&f.merge(0,s,d,!0,0,a)?r[r.length-1]=f:((s||f.children.length&&!f.children[0].length)&&f.merge(0,s,null,!1,0,a),r.push(f))):f!=null&&f.breakAfter&&(d?d.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,t>0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[e].become(r[0]))e++,r.shift(),l=r.length?0:a;else break;!r.length&&e&&i<c.length&&!c[e-1].breakAfter&&c[i].merge(0,0,c[e-1],!1,l,a)&&e--,(e<i||r.length)&&n.replaceChildren(e,i,r)}}function Lv(n,e,t,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),d=e-t;for(let u of i)d+=u.length;n.length+=d,Pv(n,c,h,l,a,i,0,s,r)}let xi=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},ag=typeof document<"u"?document:{documentElement:{style:{}}};const hg=/Edge\/(\d+)/.exec(xi.userAgent),Rv=/MSIE \d/.test(xi.userAgent),cg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xi.userAgent),Fd=!!(Rv||cg||hg),$8=!Fd&&/gecko\/(\d+)/i.test(xi.userAgent),Qu=!Fd&&/Chrome\/(\d+)/.exec(xi.userAgent),K8="webkitFontSmoothing"in ag.documentElement.style,Bv=!Fd&&/Apple Computer/.test(xi.vendor),G8=Bv&&(/Mobile\/\w+/.test(xi.userAgent)||xi.maxTouchPoints>2);var te={mac:G8||/Mac/.test(xi.platform),windows:/Win/.test(xi.platform),linux:/Linux|X11/.test(xi.platform),ie:Fd,ie_version:Rv?ag.documentMode||6:cg?+cg[1]:hg?+hg[1]:0,gecko:$8,gecko_version:$8?+(/Firefox\/(\d+)/.exec(xi.userAgent)||[0,0])[1]:0,chrome:!!Qu,chrome_version:Qu?+Qu[1]:0,ios:G8,android:/Android\b/.test(xi.userAgent),webkit:K8,safari:Bv,webkit_version:K8?+(/\bAppleWebKit\/(\d+)/.exec(xi.userAgent)||[0,0])[1]:0,tabSize:ag.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const SU=256;let mr=class dg extends ut{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 dg)||this.length-(t-e)+i.length>SU||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 dg(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 Fi(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 wU(this.dom,e,t)}},il=class ug extends ut{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(Tv(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,r,o){return i&&(!(i instanceof ug&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(Lv(this,e,t,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>e&&t.push(i<e?l.split(e-i):l),s<0&&i>=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new ug(this.mark,t,o)}domAtPos(e){return Nv(this,e)}coordsAt(e,t){return Iv(this,e,t)}};function wU(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?te.chrome||te.gecko||(e?(s--,o=1):r<i&&(r++,o=-1)):t<0?s--:r<i&&r++;let l=jr(n,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return te.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?b2(a,o<0):a||null}let Hv=class Xl extends ut{static create(e,t,i){return new Xl(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=Xl.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,r,o){return i&&(!(i instanceof Xl)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof Xl&&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 $.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):$.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Fi.before(this.dom):Fi.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(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top<r.bottom);l+=o?-1:1);return b2(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}},fg=class pg extends ut{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof pg&&e.side==this.side}split(){return new pg(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?Fi.before(this.dom):Fi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return $.empty}get isHidden(){return!0}};mr.prototype.children=Hv.prototype.children=fg.prototype.children=S2;function Nv(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Fi(t,0)}function Fv(n,e,t){let i,{children:s}=n;t>0&&e instanceof il&&s.length&&(i=s[s.length-1])instanceof il&&i.mark.eq(e.mark)?Fv(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Iv(n,e,t){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let d=0,u=0;d<c.children.length&&u<=h;d++){let f=c.children[d],p=u+f.length;p>=h&&(f.children.length?l(f,h-u):(!r||r.isHidden&&t>0)&&(p>h||u==p&&f.getSide()>0)?(r=f,o=h-u):(u<h||u==p&&f.getSide()<0&&!f.isHidden)&&(i=f,s=h-u)),u=p}}l(n,e);let a=(t<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?s:o),t):vU(n)}function vU(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Za(e);return t[t.length-1]||null}function gg(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 q8=Object.create(null);function id(n,e,t){if(n==e)return!0;n||(n=q8),e||(e=q8);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 r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function mg(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 kU(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}let ai=class Ql extends ut{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof Ql))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),Lv(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new Ql;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 r=i;r<this.children.length;r++)t.append(this.children[r],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){id(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Fv(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=gg(t,this.attrs||{})),i&&(this.attrs=gg({class:i},this.attrs||{}))}domAtPos(e){return Nv(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Tv(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&&(mg(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&&ut.get(s)instanceof il;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=ut.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!te.ios||!this.children.some(r=>r instanceof mr))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof mr)||/[^ -~]/.test(i.text))return null;let s=Za(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=Iv(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight<r){let o=(r-s.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(e){return e instanceof Ql&&this.children.length==0&&e.children.length==0&&id(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 r=e.children[i],o=s+r.length;if(o>=t){if(r instanceof Ql)return r;if(o>t)break}s=o+r.breakAfter}return null}},va=class Cc extends ut{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,r,o){return i&&(!(i instanceof Cc)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Fi.before(this.dom):Fi.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new Cc(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return S2}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):$.empty}domBoundsAround(){return null}become(e){return e instanceof Cc&&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){return this.widget.coordsAt(this.dom,e,t)}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}},w2=class{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 tn=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(tn||(tn={}));let Ki=class extends Bt{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 v2(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 sl(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:r,end:o}=$v(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new sl(e,i,s,t,e.widget||null,!0)}static line(e){return new k2(e)}static set(e,t=!1){return K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Ki.none=K.empty;let v2=class Wv extends Ki{constructor(e){let{start:t,end:i}=$v(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 Wv&&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))&&id(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)}};v2.prototype.point=!1;let k2=class zv extends Ki{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof zv&&this.spec.class==e.spec.class&&id(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)}};k2.prototype.mapMode=fe.TrackBefore;k2.prototype.point=!0;let sl=class Uv extends Ki{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?fe.TrackBefore:fe.TrackAfter:fe.TrackDel}get type(){return this.startSide!=this.endSide?tn.WidgetRange:this.startSide<=0?tn.WidgetBefore:tn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Uv&&xU(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)}};sl.prototype.point=!0;function $v(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 xU(n,e){return n==e||!!(n&&e&&n.compare(e))}function Cg(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)}let ef=class Kv{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 va&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ai),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(f1(new fg(-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 va)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){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=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(f1(new mr(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,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof sl){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 l=t-e;if(i instanceof sl)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new va(i.widget||nl.block,l,i));else{let a=Hv.create(i.widget||nl.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e<t||i.startSide>0),h=!a.isEditable&&(e<t||r>s.length||i.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(d.append(f1(new fg(1),s),r),r=s.length+Math.max(0,r-s.length)),d.append(f1(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?e<t||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new Kv(e,t,i,r);return o.openEnd=K.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function f1(n,e){for(let t of e)n=new il(t,[n],n.length);return n}let nl=class extends w2{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}};nl.inline=new nl("span");nl.block=new nl("div");var $t=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}($t||($t={}));const Yr=$t.LTR,x2=$t.RTL;function Gv(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const MU=Gv("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),AU=Gv("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),yg=Object.create(null),Hs=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);yg[e]=t,yg[t]=-e}function qv(n){return n<=247?MU[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?AU[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const DU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;let jn=class{get dir(){return this.level%2?x2:Yr}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 r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}};function Zv(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||!Zv(i.inner,s.inner))return!1}return!0}const Ke=[];function TU(n,e,t,i,s){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:e,l=r<i.length?i[r].from:t,a=r?256:s;for(let c=o,h=a,d=a;c<l;c++){let u=qv(n.charCodeAt(c));u==512?u=h:u==8&&d==4&&(u=16),Ke[c]=u==4?2:u,u&7&&(d=u),h=u}for(let c=o,h=a,d=a;c<l;c++){let u=Ke[c];if(u==128)c<l-1&&h==Ke[c+1]&&h&24?u=Ke[c]=h:Ke[c]=256;else if(u==64){let f=c+1;for(;f<l&&Ke[f]==64;)f++;let p=c&&h==8||f<t&&Ke[f]==8?d==1?1:8:256;for(let g=c;g<f;g++)Ke[g]=p;c=f-1}else u==8&&d==1&&(Ke[c]=1);h=u,u&7&&(d=u)}}}function _U(n,e,t,i,s){let r=s==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,h=o<i.length?i[o].from:t;for(let d=c,u,f,p;d<h;d++)if(f=yg[u=n.charCodeAt(d)])if(f<0){for(let g=l-3;g>=0;g-=3)if(Hs[g+1]==-f){let b=Hs[g+2],y=b&2?s:b&4?b&1?r:s:0;y&&(Ke[d]=Ke[Hs[g]]=y),l=g;break}}else{if(Hs.length==189)break;Hs[l++]=d,Hs[l++]=u,Hs[l++]=a}else if((p=Ke[d])==2||p==1){let g=p==s;a=g?0:1;for(let b=l-3;b>=0;b-=3){let y=Hs[b+2];if(y&2)break;if(g)Hs[b+2]|=2;else{if(y&4)break;Hs[b+2]|=4}}}}}function OU(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=s<t.length?t[s].from:e;for(let a=o;a<l;){let c=Ke[a];if(c==256){let h=a+1;for(;;)if(h==l){if(s==t.length)break;h=t[s++].to,l=s<t.length?t[s].from:e}else if(Ke[h]==256)h++;else break;let d=r==1,u=(h<e?Ke[h]:i)==1,f=d==u?d?1:2:i;for(let p=h,g=s,b=g?t[g-1].to:n;p>a;)p==b&&(p=t[--g].from,b=g?t[g-1].to:n),Ke[--p]=f;a=h}else r=c,a++}}}function bg(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,c=0;a<t;){let h=!0,d=!1;if(c==r.length||a<r[c].from){let g=Ke[a];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c<r.length&&p==r[c].from){if(d)break e;let g=r[c];if(!h)for(let b=g.to,y=c+1;;){if(b==t)break e;if(y<r.length&&r[y].from==b)b=r[y++].to;else{if(Ke[b]==l)break e;break}}if(c++,u)u.push(g);else{g.from>a&&o.push(new jn(a,g.from,f));let b=g.direction==Yr!=!(f%2);Sg(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(h?Ke[p]!=l:Ke[p]==l))break;p++}u?bg(n,a,p,i+1,s,u,o):a<p&&o.push(new jn(a,p,f)),a=p}else for(let a=t,c=r.length;a>e;){let h=!0,d=!1;if(!c||a>r[c-1].to){let g=Ke[a-1];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c&&p==r[c-1].to){if(d)break e;let g=r[--c];if(!h)for(let b=g.from,y=c;;){if(b==e)break e;if(y&&r[y-1].to==b)b=r[--y].from;else{if(Ke[b-1]==l)break e;break}}if(u)u.push(g);else{g.to<a&&o.push(new jn(g.to,a,f));let b=g.direction==Yr!=!(f%2);Sg(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==e||(h?Ke[p-1]!=l:Ke[p-1]==l))break;p--}u?bg(n,p,a,i+1,s,u,o):p<a&&o.push(new jn(p,a,f)),a=p}}function Sg(n,e,t,i,s,r,o){let l=e%2?2:1;TU(n,s,r,i,l),_U(n,s,r,i,l),OU(s,r,i,l),bg(n,s,r,e,t,i,o)}function VU(n,e,t){if(!n)return[new jn(0,0,e==x2?1:0)];if(e==Yr&&!t.length&&!DU.test(n))return jv(n.length);if(t.length)for(;n.length>Ke.length;)Ke[Ke.length]=256;let i=[],s=e==Yr?0:1;return Sg(n,s,s,t,0,n.length,i),i}function jv(n){return[new jn(0,n,0)]}let Yv="";function EU(n,e,t,i,s){var r;let o=i.head-n.from,l=jn.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],c=a.side(s,t);if(o==c){let u=l+=s?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!s,t),c=a.side(s,t)}let h=de(n.text,o,a.forward(s,t));(h<a.from||h>a.to)&&(h=c),Yv=n.text.slice(Math.min(o,h),Math.max(o,h));let d=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return d&&h==c&&d.level+(s?0:1)<a.level?T.cursor(d.side(!s,t)+n.from,d.forward(s,t)?1:-1,d.level):T.cursor(h+n.from,a.forward(s,t)?-1:1,a.level)}function PU(n,e,t){for(let i=e;i<t;i++){let s=qv(n.charCodeAt(i));if(s==1)return Yr;if(s==2||s==4)return x2}return Yr}const Jv=P.define(),Xv=P.define(),Qv=P.define(),ek=P.define(),wg=P.define(),tk=P.define(),ik=P.define(),sk=P.define({combine:n=>n.some(e=>e)}),LU=P.define({combine:n=>n.some(e=>e)}),nk=P.define();let tf=class vg{constructor(e,t="nearest",i="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new vg(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 vg(T.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}};const p1=ce.define({map:(n,e)=>n.map(e)}),rk=ce.define();function ji(n,e,t){let i=n.facet(ek);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 Fn=P.define({combine:n=>n.length?n[0]:!0});let RU=0;const ea=P.define();let sd=class kg{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new kg(RU++,e,i,s,l=>{let a=[ea.of(l)];return o&&a.push(ja.of(c=>{let h=c.plugin(l);return h?o(h):Ki.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return kg.define(i=>new e(i),t)}},sf=class{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(ji(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){ji(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){ji(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}};const ok=P.define(),M2=P.define(),ja=P.define(),lk=P.define(),A2=P.define(),ak=P.define();function Z8(n,e){let t=n.state.facet(ak);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(n):r),s=[];return K.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let c=r-e.from,h=o-e.from,d=s;for(let u=l.length-1;u>=0;u--,a--){let f=l[u].spec.bidiIsolate,p;if(f==null&&(f=PU(e.text,c,h)),a>0&&d.length&&(p=d[d.length-1]).to==c&&p.direction==f)p.to=h,d=p.inner;else{let g={from:c,to:h,direction:f,inner:[]};d.push(g),d=g.inner}}}}),s}const hk=P.define();function ck(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(hk)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const ta=P.define();let sr=class yc{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new yc(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,r=0,o=0,l=0;;s++){let a=s==e.length?null:e[s],c=o-l,h=a?a.fromB:1e9;for(;r<t.length&&t[r]<h;){let d=t[r],u=t[r+1],f=Math.max(l,d),p=Math.min(h,u);if(f<=p&&new yc(f+c,p+c,f,p).addToSet(i),u>h)break;r+=2}if(!a)return i;new yc(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}},j8=class dk{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Be.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new sr(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new dk(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}},Y8=class extends ut{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=Ki.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 ai],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new sr(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:c,toA:h})=>h<this.minWidthFrom||c>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:!zU(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?HU(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new sr(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(te.ie||te.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=IU(o,l,e.changes);return i=sr.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),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 o=te.chrome||te.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof va&&o.widget instanceof J8&&r.push(o.dom);s.updateGaps(r)}updateChildren(e,t,i){let s=i?i.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let o=s.length-1;;o--){let l=o>=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:d}=l,u,f,p,g;if(i&&i.range.fromB<d&&i.range.toB>h){let k=ef.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),V=ef.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);f=k.breakAtStart,p=k.openStart,g=V.openEnd;let R=this.compositionView(i);V.breakAtStart?R.breakAfter=1:V.content.length&&R.merge(R.length,R.length,V.content[0],!1,V.openStart,0)&&(R.breakAfter=V.content[0].breakAfter,V.content.shift()),k.content.length&&R.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(R).concat(V.content)}else({content:u,breakAtStart:f,openStart:p,openEnd:g}=ef.build(this.view.state.doc,h,d,this.decorations,this.dynamicDecorationMap));let{i:b,off:y}=r.findPos(c,1),{i:w,off:M}=r.findPos(a,-1);Pv(this,w,M,b,y,u,f,p,g)}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(rk)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new mr(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new il(s,[t],t.length);let i=new ai;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=ut.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].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,r=!s&&mc(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(te.gecko&&l.empty&&!this.hasComposition&&BU(a)){let d=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(d,a.node.childNodes[a.offset]||null)),a=c=new Fi(d,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!wa(a.node,a.offset,h.anchorNode,h.anchorOffset)||!wa(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{te.android&&te.chrome&&this.dom.contains(h.focusNode)&&WU(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=qa(this.view.root);if(d)if(l.empty){if(te.gecko){let u=NU(a.node,a.offset);if(u&&u!=3){let f=(u==1?Ov:Vv)(a.node,a.offset);f&&(a=new Fi(f.node,f.offset))}}d.collapse(a.node,a.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(a.node,a.offset);try{d.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Fi(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Fi(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&wa(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=qa(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=ai.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=t.from&&i.collapse(s,r)}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 r=ut.get(t.childNodes[s]);r instanceof ai&&(i=r.domAtPos(0))}for(let s=e.offset-1;!i&&s>=0;s--){let r=ut.get(t.childNodes[s]);r instanceof ai&&(i=r.domAtPos(r.length))}return i?new Fi(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=ut.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 ai)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,s=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(a<e)break;if(c<=e&&(c<e||l.covers(-1))&&(a>e||l.covers(1))&&(!i||l instanceof ai&&!(i instanceof ai&&t>=0)))i=l,s=c;else if(i&&c==e&&a==e&&l instanceof va&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}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 ai))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof mr))return null;let r=de(s.text,i);if(r==i)return null;let o=jr(s.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==$t.LTR;for(let c=0,h=0;h<this.children.length;h++){let d=this.children[h],u=c+d.length;if(u>s)break;if(c>=i){let f=d.dom.getBoundingClientRect();if(t.push(f.height),o){let p=d.dom.lastChild,g=p?Za(p):[];if(g.length){let b=g[g.length-1],y=a?b.right-f.left:f.right-b.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+d.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?$t.RTL:$t.LTR}measureTextSize(){for(let r of this.children)if(r instanceof ai){let o=r.measureTextSize();if(o)return o}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 r=Za(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.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 Ev(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(Ki.replace({widget:new J8(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return Ki.set(e)}updateDeco(){let e=1,t=this.view.state.facet(ja).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(lk).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(K.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 c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(nk))try{if(c(this.view,e.range,e))return!0}catch(h){ji(this.view.state,h,"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 r=ck(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;gU(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==$t.LTR)}};function BU(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")}let J8=class extends w2{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}};function uk(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=Ov(t.focusNode,t.focusOffset),s=Vv(t.focusNode,t.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=ut.get(s.node);if(!l||l instanceof mr&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=ut.get(i.node);!a||a instanceof mr&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function HU(n,e,t){let i=uk(n,t);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc,c=new sr(a.mapPos(r),a.mapPos(o),r,o),h=[];for(let d=s.parentNode;;d=d.parentNode){let u=ut.get(d);if(u instanceof il)h.push({node:d,deco:u.mark});else{if(u instanceof ai||d.nodeName=="DIV"&&d.parentNode==n.contentDOM)return{range:c,text:s,marks:h,line:d};if(d!=n.contentDOM)h.push({node:d,deco:new v2({inclusive:!0,attributes:kU(d),tagName:d.tagName.toLowerCase()})});else return null}}}function NU(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 FU=class{constructor(){this.changes=[]}compareRange(e,t){Cg(e,t,this.changes)}comparePoint(e,t){Cg(e,t,this.changes)}};function IU(n,e,t){let i=new FU;return K.compare(n,e,t,i),i.changes}function WU(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 zU(n,e){let t=!1;return e&&n.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(t=!0)}),t}function UU(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return T.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=de(s.text,r,!1):l=de(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=de(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=de(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return T.range(o+s.from,l+s.from)}function $U(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function KU(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function nf(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function X8(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function Q8(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function xg(n,e,t){let i,s,r,o,l=!1,a,c,h,d;for(let p=n.firstChild;p;p=p.nextSibling){let g=Za(p);for(let b=0;b<g.length;b++){let y=g[b];s&&nf(s,y)&&(y=X8(Q8(y,s.bottom),s.top));let w=$U(e,y),M=KU(t,y);if(w==0&&M==0)return p.nodeType==3?e6(p,e,t):xg(p,e,t);if(!i||o>M||o==M&&r>w){i=p,s=y,r=w,o=M;let k=M?t<y.top?-1:1:w?e<y.left?-1:1:0;l=!k||(k>0?b<g.length-1:b>0)}w==0?t>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):t<y.top&&(!d||d.top>y.top)&&(c=p,d=y):h&&nf(h,y)?h=Q8(h,y.bottom):d&&nf(d,y)&&(d=X8(d,y.top))}}if(h&&h.bottom>=t?(i=a,s=h):d&&d.top<=t&&(i=c,s=d),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return e6(i,u,t);if(l&&i.contentEditable!="false")return xg(i,u,t);let f=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:f}}function e6(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=jr(n,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let d=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&d<r){let u=e>=(h.left+h.right)/2,f=u;if((te.chrome||te.gecko)&&jr(n,l).getBoundingClientRect().left==h.right&&(f=!u),d<=0)return{node:n,offset:l+(f?1:0)};s=l+(f?1:0),r=d}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function fk(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:d}=e,u=d-l;if(u<0)return 0;if(u>c)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,V=!1;a=n.elementAtHeight(u),a.type!=tn.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(V)return t?null:0;V=!0,i=-i}d=l+u;let f=a.from;if(f<n.viewport.from)return n.viewport.from==0?0:t?null:t6(n,o,a,h,d);if(f>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:t6(n,o,a,h,d);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,b=g.elementFromPoint(h,d);b&&!n.contentDOM.contains(b)&&(b=null),b||(h=Math.max(o.left+1,Math.min(o.right-1,h)),b=g.elementFromPoint(h,d),b&&!n.contentDOM.contains(b)&&(b=null));let y,w=-1;if(b&&((s=n.docView.nearest(b))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,d);k&&({offsetNode:y,offset:w}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,d);k&&({startContainer:y,startOffset:w}=k,(!n.contentDOM.contains(y)||te.safari&&GU(y,w,h)||te.chrome&&qU(y,w,h))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let k=ai.find(n.docView,f);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:w}=xg(k.dom,h,d))}let M=n.docView.nearest(y);if(!M)return null;if(M.isWidget&&((r=M.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=M.dom.getBoundingClientRect();return e.y<k.top||e.y<=k.bottom&&e.x<=(k.left+k.right)/2?M.posAtStart:M.posAtEnd}else return M.localPosFromDOM(y,w)+M.posAtStart}function t6(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+lr(o,r,n.state.tabSize)}function GU(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 jr(n,i-1,i).getBoundingClientRect().left>t}function qU(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():jr(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function ZU(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==tn.Text))return i}return t}function jU(n,e,t,i){let s=ZU(n,e.head),r=!i||s.type!=tn.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==$t.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return T.cursor(a,t?-1:1)}return T.cursor(t?s.to:s.from,t?-1:1)}function i6(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let c=EU(s,r,o,l,t),h=Yv;if(!c){if(s.number==(t?n.state.doc.lines:1))return l;h=` `,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),c=n.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function YU(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==He.Space&&(s=o),s==o}}function JU(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return T.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,e.assoc||-1),h=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let f=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-f.from))),l=(r<0?f.top:f.bottom)+h}let d=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let f=0;;f+=10){let p=l+(u+f)*r,g=fk(n,{x:d,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let b=n.docView.coordsForChar(g),y=!b||p<b.top?-1:1;return T.cursor(g,y,void 0,o)}}}function bc(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function rf(n,e,t){let i=bc(n.state.facet(A2).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:T.cursor(i,i<t.from?1:-1)}let XU=class{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,te.safari&&e.contentDOM.addEventListener("input",()=>null),te.gecko&&p$(e.contentDOM.ownerDocument)}handleEvent(e){!o$(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=QU(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,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&&gk.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),te.android&&te.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return te.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=pk.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||e$.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,Oo(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:te.safari&&!te.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 s6(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){ji(t.state,s)}}}function QU(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 r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(s6(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(s6(i.value,o))}}for(let i in Ms)t(i).handlers.push(Ms[i]);for(let i in ns)t(i).observers.push(ns[i]);return e}const pk=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],e$="dthko",gk=[16,17,18,20,91,92,224,225],g1=6;function m1(n){return Math.max(0,n)*.7+8}function t$(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}let i$=class{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=mU(e.contentDOM),this.atoms=e.state.facet(A2).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ae.allowMultipleSelections)&&s$(e,t),this.dragging=r$(e,t)&&yk(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&&t$(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=ck(this.view);e.clientX-a.left<=s+g1?t=-m1(s-e.clientX):e.clientX+a.right>=o-g1&&(t=m1(e.clientX-o)),e.clientY-a.top<=r+g1?i=-m1(r-e.clientY):e.clientY+a.bottom>=l-g1&&(i=m1(e.clientY-l)),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],r=null;if(s.empty){let o=bc(this.atoms,s.from,0);o!=s.from&&(r=T.cursor(o,-1))}else{let o=bc(this.atoms,s.from,-1),l=bc(this.atoms,s.to,1);(o!=s.from||l!=s.to)&&(r=T.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?T.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 s$(n,e){let t=n.state.facet(Jv);return t.length?t[0](e):te.mac?e.metaKey:e.ctrlKey}function n$(n,e){let t=n.state.facet(Xv);return t.length?t[0](e):te.mac?!e.altKey:!e.ctrlKey}function r$(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=qa(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function o$(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=ut.get(t))&&i.ignoreEvent(e))return!1;return!0}const Ms=Object.create(null),ns=Object.create(null),mk=te.ie&&te.ie_version<15||te.ios&&te.webkit_version<604;function l$(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(),Ck(n,t.value)},50)}function Ck(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Mg!=null&&t.selection.ranges.every(a=>a.empty)&&Mg==r.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let d=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:d},range:T.cursor(c.from+d.length)}})}else o?i=t.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:T.cursor(a.from+c.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ns.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Ms.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ns.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};ns.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ms.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(Qv))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=c$(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new i$(n,e,t,i)),i&&n.observer.ignore(()=>{Dv(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function n6(n,e,t,i){if(i==1)return T.cursor(e,t);if(i==2)return UU(n.state,e,t);{let s=ai.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,T.range(o,l)}}let r6=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function a$(n,e,t,i){let s=ai.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&r6(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&r6(t,i,l)?1:o&&o.bottom>=i?-1:1}function o6(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:a$(n,t,e.clientX,e.clientY)}}const h$=te.ie&&te.ie_version<=11;let l6=null,a6=0,h6=0;function yk(n){if(!h$)return n.detail;let e=l6,t=h6;return l6=n,h6=Date.now(),a6=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(a6+1)%3:1}function c$(n,e){let t=o6(n,e),i=yk(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=o6(n,r),c,h=n6(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let d=n6(n,t.pos,t.bias,i),u=Math.min(d.from,h.from),f=Math.max(d.to,h.to);h=u<h.from?T.range(u,f):T.range(f,u)}return o?s.replaceRange(s.main.extend(h.from,h.to)):l&&i==1&&s.ranges.length>1&&(c=d$(s,a.pos))?c:l?s.addRange(h):T.create([h])}}}function d$(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 T.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}Ms.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 r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=T.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Ms.dragend=n=>(n.inputState.draggedContent=null,!1);function c6(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&n$(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Ms.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,r=()=>{++s==t.length&&c6(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return c6(n,e,i,!0),!0}return!1};Ms.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=mk?null:e.clipboardData;return t?(Ck(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(l$(n),!1)};function u$(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 f$(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:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Mg=null;Ms.copy=Ms.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=f$(n.state);if(!t&&!s)return!1;Mg=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=mk?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(u$(n,t),!1)};const bk=gi.define();function Sk(n,e){let t=[];for(let i of n.facet(ik)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:bk.of(!0)}):null}function wk(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Sk(n.state,e);t?n.dispatch(t):n.update([])}},10)}ns.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),wk(n)};ns.blur=n=>{n.observer.clearSelectionRange(),wk(n)};ns.compositionstart=ns.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ns.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,te.chrome&&te.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ns.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Ms.beforeinput=(n,e)=>{var t;let i;if(te.chrome&&te.android&&(i=pk.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return te.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),te.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ns.compositionend(n,e),20),!1};const d6=new Set;function p$(n){d6.has(n)||(d6.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const u6=["pre-wrap","normal","pre-line","break-spaces"];let g$=class{constructor(e){this.lineWrapping=e,this.doc=$.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}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 u6.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,r,o){let l=u6.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}},m$=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},In=class vk{constructor(e,t,i,s,r){this.from=e,this.length=t,this.top=i,this.height=s,this._content=r}get type(){return typeof this._content=="number"?tn.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 sl?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 vk(this.from,this.length+e.length,this.top,this.height+e.height,t)}};var ot=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(ot||(ot={}));const Sc=.001;let bs=class wc{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,t){this.height!=t&&(Math.abs(this.height-t)>Sc&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return wc.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:d}=s[l],u=r.lineAt(a,ot.ByPosNoHeight,i.setDoc(t),0,0),f=u.to>=c?u:r.lineAt(c,ot.ByPosNoHeight,i,0,0);for(d+=f.to-c,c=f.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,ot.ByPosNoHeight,i,0,0));h+=u.from-a,a=u.from;let p=b$.build(i.setDoc(o),e,h,d);r=r.replace(a,c,p)}return r.updateHeight(i,0)}static empty(){return new $s(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,s=0,r=0;for(;;)if(t==i)if(s>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[t++];l&&(s+=l.size)}else{let l=e[--i];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new C$(wc.of(e.slice(0,t)),o,wc.of(e.slice(i)))}};bs.prototype.size=1;let kk=class extends bs{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,s){return new In(s,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,s,r){return this.blockAt(0,i,s,r)}forEachLine(e,t,i,s,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},$s=class Ag extends kk{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new In(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ag||s instanceof Vo&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Vo?s=new Ag(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):bs.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,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:""})`}},Vo=class fs extends bs{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let c=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=t.doc.lineAt(c),d=l+h.length*a,u=Math.max(i,e-d/2);return new In(h.from,h.length,u,d,0)}else{let c=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:h,length:d}=t.doc.line(r+c);return new In(h,d,i+l*c,l,0)}}lineAt(e,t,i,s,r){if(t==ot.ByHeight)return this.blockAt(e,i,s,r);if(t==ot.ByPosNoHeight){let{from:f,to:p}=i.doc.lineAt(e);return new In(f,p-f,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),c=i.doc.lineAt(e),h=l+c.length*a,d=c.number-o,u=s+l*d+a*(c.from-r-d);return new In(c.from,c.length,Math.max(s,Math.min(u,s+this.height-h)),h,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,r);for(let h=e,d=s;h<=t;){let u=i.doc.lineAt(h);if(h==e){let p=u.number-l;d+=a*p+c*(e-r-p)}let f=a+c*u.length;o(new In(u.from,u.length,d,f,0)),d+=f,h=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof fs?i[i.length-1]=new fs(r.length+s):i.push(null,new fs(s-1))}if(e>0){let r=i[0];r instanceof fs?i[0]=new fs(e+r.length):i.unshift(new fs(e-1),null)}return bs.of(i)}decomposeLeft(e,t){t.push(new fs(e-1),null)}decomposeRight(e,t){t.push(null,new fs(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new fs(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let d=s.heights[s.index++];a==-1?a=d:Math.abs(d-a)>=Sc&&(a=-2);let u=new $s(h,d);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new fs(r-l).updateHeight(e,l));let c=bs.of(o);return(a<0||Math.abs(c.height-this.height)>=Sc||Math.abs(a-this.heightMetrics(e,t).perLine)>=Sc)&&(e.heightChanged=!0),c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},C$=class extends bs{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 r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,s):this.right.blockAt(e,t,r,s+this.left.length+this.break)}lineAt(e,t,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=t==ot.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,i,s,r):this.right.lineAt(e,t,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=t==ot.ByPosNoHeight?ot.ByPosNoHeight:ot.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,s,r).join(c)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,s,r,o),t>=a&&this.right.forEachLine(e,t,i,l,a,o);else{let c=this.lineAt(a,ot.ByPos,i,s,r);e<c.from&&this.left.forEachLine(e,c.from-1,i,s,r,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,l,a,o)}}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 r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&f6(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),f6(r,l)}return bs.of(r)}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?bs.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function f6(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof Vo&&(i=n[e+1])instanceof Vo&&n.splice(e-1,3,new Vo(t.length+1+i.length))}const y$=5;let b$=class xk{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 $s?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new $s(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,r=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new kk(o,s,i)):(o||r||s>=y$)&&this.addLineDeco(s,r,o)}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 $s(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new Vo(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 $s)return e;let t=new $s(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 $s)&&!this.isCovered?this.nodes.push(new $s(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 $s&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,t,i,s){let r=new xk(i,e);return K.spans(t,i,s,r,0),r.finish(i)}};function S$(n,e,t){let i=new w$;return K.compare(n,e,t,i,0),i.changes}let w$=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,s){(e<t||i&&i.heightRelevant||s&&s.heightRelevant)&&Cg(e,t,this.changes,5)}};function v$(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,r=Math.max(0,t.left),o=Math.min(s.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(s.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=i.body;)if(c.nodeType==1){let h=c,d=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=c==n.parentNode?u.bottom:Math.min(a,u.bottom)}c=d.position=="absolute"||d.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function k$(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}let of=class{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],r=t[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e,t){return Ki.replace({widget:new x$(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},x$=class extends w2{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}},p6=class{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=g6,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=$t.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(M2).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new g$(t),this.stateDeco=e.facet(ja).filter(i=>typeof i!="function"),this.heightMap=bs.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle.setDoc(e.doc),[new sr(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=Ki.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:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new C1(r,o))}}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?g6:new D$(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(ia(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(ja).filter(h=>typeof h!="function");let s=e.changedRanges,r=sr.extendWithRanges(s,S$(i,this.stateDeco,e?e.changes:Be.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(LU)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?$t.RTL:$t.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:V}=Av(t,l);(k>.005&&Math.abs(this.scaleX-k)>.005||V>.005&&Math.abs(this.scaleY-V)>.005)&&(this.scaleX=k,this.scaleY=V,c|=8,o=a=!0)}let d=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=u)&&(this.paddingTop=d,this.paddingBottom=u,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=_v(e.scrollDOM);let p=(this.printing?k$:v$)(t,this.paddingTop),g=p.top-this.pixelViewport.top,b=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(k)&&(o=!0),o||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:V,charWidth:R,textHeight:H}=e.docView.measureTextSize();o=V>0&&s.refresh(r,V,R,H,w/R,k),o&&(e.docView.minWidth=0,c|=8)}g>0&&b>0?h=Math.max(g,b):g<0&&b<0&&(h=Math.min(g,b)),s.heightChanged=!1;for(let V of this.viewports){let R=V.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(V);this.heightMap=(o?bs.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle,[new sr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new m$(V.from,R))}s.heightChanged&&(c|=2)}let M=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||M)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}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,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new C1(s.lineAt(o-i*1e3,ot.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,ot.ByHeight,r,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=s.lineAt(c,ot.ByPos,r,0,0),u;t.y=="center"?u=(d.top+d.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c<a.from?u=d.top:u=d.bottom-h,a=new C1(s.lineAt(u-1e3/2,ot.ByHeight,r,0,0).from,s.lineAt(u+h+1e3/2,ot.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new C1(this.heightMap.lineAt(i,ot.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,ot.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,ot.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,ot.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r<l+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 of(t.mapPos(s.from),t.mapPos(s.to),s.size));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=$t.LTR&&!i)return[];let l=[],a=(h,d,u,f)=>{if(d-h<r)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let y of g)if(y>h&&y<d){a(h,y-10,u,f),a(y+10,d,u,f);return}let b=A$(e,y=>y.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)<r&&Math.abs(y.to-d)<r&&!g.some(w=>y.from<w&&y.to>w));if(!b){if(d<u.to&&t&&i&&t.visibleRanges.some(y=>y.from<=d&&y.to>=d)){let y=t.moveToLineBoundary(T.cursor(d),!1,!0).head;y>h&&(d=y)}b=new of(h,d,this.gapSize(u,h,d,f))}l.push(b)},c=h=>{if(h.length<o||h.type!=tn.Text)return;let d=M$(h.from,h.to,this.stateDeco);if(d.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,f,p;if(i){let g=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,y;if(u!=null){let w=b1(d,u),M=((this.visibleBottom-this.visibleTop)/2+g)/h.height;b=w-M,y=w+M}else b=(this.visibleTop-h.top-g)/h.height,y=(this.visibleBottom-h.top+g)/h.height;f=y1(d,b),p=y1(d,y)}else{let g=d.total*this.heightOracle.charWidth,b=s*this.heightOracle.charWidth,y,w;if(u!=null){let M=b1(d,u),k=((this.pixelViewport.right-this.pixelViewport.left)/2+b)/g;y=M-k,w=M+k}else y=(this.pixelViewport.left-b)/g,w=(this.pixelViewport.right+b)/g;f=y1(d,y),p=y1(d,w)}f>h.from&&a(h.from,f,h,d),p<h.to&&a(p,h.to,h,d)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(e,t,i,s){let r=b1(s,i)-b1(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){of.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ki.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];K.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ia(this.heightMap.lineAt(e,ot.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)||ia(this.heightMap.lineAt(this.scaler.fromDOM(e),ot.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 ia(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}},C1=class{constructor(e,t){this.from=e,this.to=t}};function M$(n,e,t){let i=[],s=n,r=0;return K.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(i.push({from:s,to:e}),r+=e-s),{total:r,ranges:i}}function y1({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:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function b1(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 A$(n,e){for(let t of n)if(e(t))return t}const g6={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};let D$=class Mk{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=t.lineAt(l,ot.ByPos,e,0,0).top,h=t.lineAt(a,ot.ByPos,e,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return s+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,s=r.domBottom}}fromDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,s=r.domBottom}}eq(e){return e instanceof Mk?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 ia(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new In(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(s=>ia(s,e)):n._content)}const S1=P.define({combine:n=>n.join(" ")}),Dg=P.define({combine:n=>n.indexOf(!0)>-1}),Tg=we.newName(),Ak=we.newName(),Dk=we.newName(),Tk={"&light":"."+Ak,"&dark":"."+Dk};function _g(n,e,t){return new we(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 T$=_g("."+Tg,{"&":{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},".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:"#444"},".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},"&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:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".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"}},Tk),sa="";let _$=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ae.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=sa}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=ut.get(s),a=ut.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:td(s))||td(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}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 r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=ut.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+(O$(e,i.node,i.offset)?t:0))}};function O$(n,e,t){for(;;){if(!e||t<wn(e))return!1;if(e==n)return!0;t=Zr(e)+1,e=e.parentNode}}let m6=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},V$=class{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:L$(e),a=new _$(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=R$(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!rg(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!rg(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((te.ios||te.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.to<e.state.doc.length)){let d=Math.min(a,c),u=Math.max(a,c),f=h.from-d,p=h.to-u;(f==0||f==1||d==0)&&(p==0||p==-1||u==e.state.doc.length)&&(a=0,c=e.state.doc.length)}this.newSel=T.single(c,a)}}};function _k(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,c=null;(r===8||te.android&&e.text.length<l-o)&&(a=s.to,c="end");let h=P$(n.state.doc.sliceString(o,l,sa),e.text,a-o,c);h&&(te.chrome&&r==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==sa+sa&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:$.of(e.text.slice(h.from,h.toB).split(sa))})}else i&&(!n.hasFocus&&n.state.facet(Fn)||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))}:(te.mac||te.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=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}):te.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` `&&n.lineWrapping&&(i&&(i=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}),t)return Ok(n,t,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Ok(n,e,t,i=-1){if(te.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(te.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&&Oo(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)&&Oo(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Oo(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=E$(n,e,t));return n.state.facet(tk).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function E$(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.from<e.from?s.sliceDoc(r.from,e.from):"",a=r.to>e.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let c=n.state.sliceDoc(e.from,e.to),h,d=t&&uk(n,t.main.head);if(d){let p=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-e.to,f=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,b=g-c.length;if(p.to-p.from!=f||n.state.sliceDoc(b,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:b,to:g,insert:e.insert}),w=p.to-r.to;return{changes:y,range:a?T.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function P$(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function L$(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new m6(t,i)),(s!=t||r!=i)&&e.push(new m6(s,r))),e}function R$(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?T.single(t+e,i+e):null}const B$={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},lf=te.ie&&te.ie_version<=11;let H$=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new CU,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);(te.ie&&te.ie_version<=11||te.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&&!(te.chrome&&te.chrome_version<126)&&(this.editContext=new F$(e),e.state.facet(Fn)&&(e.contentDOM.editContext=this.editContext.editContext)),lf&&(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.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(Fn)?i.root.activeElement!=this.dom:!mc(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(te.ie&&te.ie_version<=11||te.android&&te.chrome)&&!i.state.selection.main.empty&&s.focusNode&&wa(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=qa(e.root);if(!t)return!1;let i=te.safari&&e.root.nodeType==11&&fU(this.dom.ownerDocument)==this.dom&&N$(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let s=mc(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&bU(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,B$),lf&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),lf&&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 r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Oo(this.dom,r.key,r.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 r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&mc(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 r=new V$(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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=_k(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=C6(t,e.previousSibling||e.target.previousSibling,-1),s=C6(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("change",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("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Fn)!=e.state.facet(Fn)&&(e.view.contentDOM.editContext=e.state.facet(Fn)?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 C6(n,e,t){for(;e;){let i=ut.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 y6(n,e){let t=e.startContainer,i=e.startOffset,s=e.endContainer,r=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return wa(o.node,o.offset,s,r)&&([t,i,s,r]=[s,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}}function N$(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return y6(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?y6(n,t):null}let F$=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(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,r={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:$.of(i.text.split(` `))};r.from==this.from&&s<this.from?r.from=s:r.to==this.to&&s>this.to&&(r.to=s),!(r.from==r.to&&!r.insert.length)&&(this.pendingContextChange=r,e.state.readOnly||Ok(e,r,T.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(Ki.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}e.dispatch({effects:rk.of(Ki.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=qa(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((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(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)}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){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},Fe=class Og{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={}){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:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||yU(e.parent)||document,this.viewState=new p6(e.state||ae.create(e)),e.scrollTo&&e.scrollTo.is(p1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ea).map(i=>new sf(i));for(let i of this.plugins)i.update(this);this.observer=new H$(this),this.inputState=new XU(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Y8(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof pt?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,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(bk))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Sk(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(ae.phrases)!=this.state.facet(ae.phrases))return this.setState(r);s=j8.create(this,r,e),s.flags|=l;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(d&&(d=d.map(u.changes)),u.scrollIntoView){let{main:f}=u.state.selection;d=new tf(f.empty?f:T.cursor(f.head,f.head>f.anchor?-1:1))}for(let f of u.effects)f.is(p1)&&(d=f.value.clip(this.state))}this.viewState.update(s,d),this.bidiCache=S6.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ta)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(S1)!=s.state.facet(S1)&&(this.viewState.mustMeasureContent=!0),(t||i||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(wg))try{u(s)}catch(f){ji(this.state,f,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!_k(this,h)&&c.force&&Oo(this.contentDOM,c.key,c.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 p6(e),this.plugins=e.facet(ea).map(i=>new sf(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Y8(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(ea),i=e.state.facet(ea);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new sf(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.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){ji(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:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(_v(i))r=-1,o=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(s);r=f.from,o=f.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(f=>{try{return f.read(this)}catch(p){return ji(this.state,p),b6}}),d=j8.create(this,this.state,[]),u=!1;d.flags|=a,t?t.flags|=a:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),u=this.docView.update(d),u&&this.docViewUpdate());for(let f=0;f<c.length;f++)if(h[f]!=b6)try{let p=c[f];p.write&&p.write(h[f],this)}catch(p){ji(this.state,p)}if(u&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(wg))l(t)}get themeClasses(){return Tg+" "+(this.state.facet(Dg)?Dk:Ak)+" "+this.state.facet(S1)}updateAttrs(){let e=w6(this,ok,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Fn)?"true":"false",class:"cm-content",style:`${te.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),w6(this,M2,t);let i=this.observer.ignore(()=>{let s=mg(this.contentDOM,this.contentAttrs,t),r=mg(this.dom,this.editorAttrs,e);return s||r});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(Og.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ta);let e=this.state.facet(Og.cspNonce);we.mount(this.root,this.styleModules.concat(T$).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 rf(this,e,i6(this,e,t,i))}moveByGroup(e,t){return rf(this,e,i6(this,e,t,i=>YU(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return T.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return jU(this,e,t,i)}moveVertically(e,t,i){return rf(this,e,JU(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(),fk(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),r=this.bidiSpans(s),o=r[jn.find(r,e-s.from,-1,t)];return b2(i,o.dir==$t.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(sk)||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>I$)return jv(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||Zv(r.isolates,i=Z8(this,e))))return r.order;i||(i=Z8(this,e));let s=VU(e.text,t,i);return this.bidiCache.push(new S6(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||te.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Dv(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 p1.of(new tf(typeof e=="number"?T.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 p1.of(new tf(T.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 sd.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return sd.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=we.newName(),s=[S1.of(i),ta.of(_g(`.${i}`,e))];return t&&t.dark&&s.push(Dg.of(!0)),s}static baseTheme(e){return Vi.lowest(ta.of(_g("."+Tg,e,Tk)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&ut.get(i)||ut.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}};Fe.styleModule=ta;Fe.inputHandler=tk;Fe.scrollHandler=nk;Fe.focusChangeEffect=ik;Fe.perLineTextDirection=sk;Fe.exceptionSink=ek;Fe.updateListener=wg;Fe.editable=Fn;Fe.mouseSelectionStyle=Qv;Fe.dragMovesSelection=Xv;Fe.clickAddsSelectionRange=Jv;Fe.decorations=ja;Fe.outerDecorations=lk;Fe.atomicRanges=A2;Fe.bidiIsolatedRanges=ak;Fe.scrollMargins=hk;Fe.darkTheme=Dg;Fe.cspNonce=P.define({combine:n=>n.length?n[0]:""});Fe.contentAttributes=M2;Fe.editorAttributes=ok;Fe.lineWrapping=Fe.contentAttributes.of({class:"cm-lineWrapping"});Fe.announce=ce.define();const I$=4096,b6={};let S6=class Vk{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:$t.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!t.touchesRange(o.from,o.to)&&i.push(new Vk(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function w6(n,e,t){for(let i=n.state.facet(e),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&gg(o,t)}return t}const W$=te.mac?"mac":te.windows?"win":te.linux?"linux":"key";function z$(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;a<t.length-1;++a){const c=t[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))s=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return s&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function w1(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 U$=Vi.default(Fe.domEventHandlers({keydown(n,e){return q$($$(e.state),n,e,"editor")}})),Ek=P.define({enables:U$}),v6=new WeakMap;function $$(n){let e=n.facet(Ek),t=v6.get(e);return t||v6.set(e,t=G$(e.reduce((i,s)=>i.concat(s),[]))),t}let Wn=null;const K$=4e3;function G$(n,e=W$){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c,h)=>{var d,u;let f=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>z$(y,e));for(let y=1;y<p.length;y++){let w=p.slice(0,y).join(" ");s(w,!0),f[w]||(f[w]={preventDefault:!0,stopPropagation:!1,run:[M=>{let k=Wn={view:M,prefix:w,scope:o};return setTimeout(()=>{Wn==k&&(Wn=null)},K$),!0}]})}let g=p.join(" ");s(g,!1);let b=f[g]||(f[g]={preventDefault:!1,stopPropagation:!1,run:((u=(d=f._any)===null||d===void 0?void 0:d.run)===null||u===void 0?void 0:u.slice())||[]});a&&b.run.push(a),c&&(b.preventDefault=!0),h&&(b.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=t[c]||(t[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=o;for(let u in h)h[u].run.push(f=>d(f,Vg))}let a=o[e]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let Vg=null;function q$(n,e,t,i){Vg=e;let s=Tm(e),r=Pt(s,0),o=Di(r)==s.length&&s!=" ",l="",a=!1,c=!1,h=!1;Wn&&Wn.view==t&&Wn.scope==i&&(l=Wn.prefix+" ",gk.indexOf(e.keyCode)<0&&(c=!0,Wn=null));let d=new Set,u=b=>{if(b){for(let y of b.run)if(!d.has(y)&&(d.add(y),y(t)))return b.stopPropagation&&(h=!0),!0;b.preventDefault&&(b.stopPropagation&&(h=!0),c=!0)}return!1},f=n[i],p,g;return f&&(u(f[l+w1(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(te.windows&&e.ctrlKey&&e.altKey)&&(p=nn[e.keyCode])&&p!=s?(u(f[l+w1(p,e,!0)])||e.shiftKey&&(g=Pr[e.keyCode])!=s&&g!=p&&u(f[l+w1(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(f[l+w1(s,e,!0)])&&(a=!0),!a&&u(f._any)&&(a=!0)),c&&(a=!0),a&&h&&e.stopPropagation(),Vg=null,a}const Z$=!te.ios,k6={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Z$&&(k6[".cm-line"].caretColor=k6[".cm-content"].caretColor="transparent !important");const Ml="-10000px";let j$=class{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(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(e,t){var i;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;a<r.length;a++){let c=r[a],h=-1;if(c){for(let d=0;d<this.tooltips.length;d++){let u=this.tooltips[d];u&&u.create==c.create&&(h=d)}if(h<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let d=o[a]=this.tooltipViews[h];l&&(l[a]=t[h]),d.update&&d.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return t&&(l.forEach((a,c)=>t[c]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}};function Y$(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const af=P.define({combine:n=>{var e,t,i;return{position:te.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)||Y$}}}),x6=new WeakMap,Pk=sd.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(af);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 j$(n,Lk,(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(af);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=Ml,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=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(te.gecko)i=s.offsetParent!=this.container.ownerDocument.body;else if(s.style.top==Ml&&s.style.left=="0px"){let r=s.getBoundingClientRect();i=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((s,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(af).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:h}=c,d=n.pos[l],u=n.size[l];if(!d||d.bottom<=Math.max(t.top,i.top)||d.top>=Math.min(t.bottom,i.bottom)||d.right<Math.max(t.left,i.left)-.1||d.left>Math.min(t.right,i.right)+.1){h.style.top=Ml;continue}let f=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=f?7:0,g=u.right-u.left,b=(e=x6.get(c))!==null&&e!==void 0?e:u.bottom-u.top,y=c.offset||X$,w=this.view.textDirection==$t.LTR,M=u.width>i.right-i.left?w?i.left:i.right-u.width:w?Math.max(i.left,Math.min(d.left-(f?14:0)+y.x,i.right-g)):Math.min(Math.max(i.left,d.left-g+(f?14:0)-y.x),i.right-g),k=this.above[l];!a.strictSide&&(k?d.top-(u.bottom-u.top)-y.y<i.top:d.bottom+(u.bottom-u.top)+y.y>i.bottom)&&k==i.bottom-d.bottom>d.top-i.top&&(k=this.above[l]=!k);let V=(k?d.top-i.top:i.bottom-d.bottom)-p;if(V<b&&c.resize!==!1){if(V<this.view.defaultLineHeight){h.style.top=Ml;continue}x6.set(c,b),h.style.height=(b=V)/r+"px"}else h.style.height&&(h.style.height="");let R=k?d.top-b-p-y.y:d.bottom+p+y.y,H=M+g;if(c.overlap!==!0)for(let W of o)W.left<H&&W.right>M&&W.top<R+b&&W.bottom>R&&(R=k?W.top-b-2-p:W.bottom+p+2);if(this.position=="absolute"?(h.style.top=(R-n.parent.top)/r+"px",h.style.left=(M-n.parent.left)/s+"px"):(h.style.top=R/r+"px",h.style.left=M/s+"px"),f){let W=d.left+(w?y.x:-y.x)-(M+14-7);f.style.left=W/s+"px"}c.overlap!==!0&&o.push({left:M,top:R,right:H,bottom:R+b}),h.classList.toggle("cm-tooltip-above",k),h.classList.toggle("cm-tooltip-below",!k),c.positioned&&c.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=Ml}},{eventObservers:{scroll(){this.maybeMeasure()}}}),J$=Fe.baseTheme({".cm-tooltip":{zIndex:100,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"}}}),X$={x:0,y:0},Lk=P.define({enables:[Pk,J$]});function Rk(n,e){let t=n.plugin(Pk);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}let rl=class extends Bt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};rl.prototype.elementClass="";rl.prototype.toDOM=void 0;rl.prototype.mapMode=fe.TrackBefore;rl.prototype.startSide=rl.prototype.endSide=-1;rl.prototype.point=!0;class Bk{constructor(e,t,i,s){this.state=e,this.pos=t,this.explicit=i,this.view=s,this.abortListeners=[]}tokenBefore(e){let t=Xt(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),r=s.search(Hk(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function M6(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 Q$(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;r<s.length;r++)t[s[r]]=!0}let i=M6(e)+M6(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function eK(n){let e=n.map(s=>typeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Q$(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}class A6{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function nr(n){return n.selection.main.from}function Hk(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Nk=gi.define();function tK(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i)?{range:l}:{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:e},range:T.cursor(l.from+r+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const D6=new WeakMap;function iK(n){if(!Array.isArray(n))return n;let e=D6.get(n);return e||D6.set(n,e=eK(n)),e}const nd=ce.define(),Ya=ce.define();class sK{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=Pt(e,t),s=Di(i);this.chars.push(i);let r=e.slice(t,t+s),o=r.toUpperCase();this.folded.push(Pt(o==r?r.toLowerCase():o,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:r,byWord:o}=this;if(t.length==1){let w=Pt(e,0),M=Di(w),k=M==e.length?0:-100;if(w!=t[0])if(w==i[0])k+=-200;else return null;return this.ret(k,[0,M])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,c=0;if(l<0){for(let w=0,M=Math.min(e.length,200);w<M&&c<a;){let k=Pt(e,w);(k==t[c]||k==i[c])&&(s[c++]=w),w+=Di(k)}if(c<a)return null}let h=0,d=0,u=!1,f=0,p=-1,g=-1,b=/[a-z]/.test(e),y=!0;for(let w=0,M=Math.min(e.length,200),k=0;w<M&&d<a;){let V=Pt(e,w);l<0&&(h<a&&V==t[h]&&(r[h++]=w),f<a&&(V==t[f]||V==i[f]?(f==0&&(p=w),g=w+1,f++):f=0));let R,H=V<255?V>=48&&V<=57||V>=97&&V<=122?2:V>=65&&V<=90?1:0:(R=xm(V))!=R.toLowerCase()?1:R!=R.toUpperCase()?2:0;(!w||H==1&&b||k==0&&H!=0)&&(t[d]==V||i[d]==V&&(u=!0)?o[d++]=w:o.length&&(y=!1)),k=H,w+=Di(V)}return d==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):f==a&&p==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):f==a?this.ret(-900-e.length,[p,g]):d==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?Di(Pt(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}class nK{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 Ut=P.define({combine(n){return on(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:rK,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=>T6(e(i),t(i)),optionClass:(e,t)=>i=>T6(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function T6(n,e){return n?e?n+" "+e:n:e}function rK(n,e,t,i,s,r){let o=n.textDirection==$t.RTL,l=o,a=!1,c="top",h,d,u=e.left-s.left,f=s.right-e.right,p=i.right-i.left,g=i.bottom-i.top;if(l&&u<Math.min(p,f)?l=!1:!l&&f<Math.min(p,u)&&(l=!0),p<=(l?u:f))h=Math.max(s.top,Math.min(t.top,s.bottom-g))-e.top,d=Math.min(400,l?u:f);else{a=!0,d=Math.min(400,(o?e.right:s.right-e.left)-30);let w=s.bottom-e.bottom;w>=g||w>e.top?h=t.bottom-e.top:(c="bottom",h=e.bottom-t.top)}let b=(e.bottom-e.top)/r.offsetHeight,y=(e.right-e.left)/r.offsetWidth;return{style:`${c}: ${h/b}px; max-width: ${d/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function oK(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,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let c=0;c<r.length;){let h=r[c++],d=r[c++];h>a&&o.appendChild(document.createTextNode(l.slice(a,h)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(h,d))),u.className="cm-completionMatchedText",a=d}return a<l.length&&o.appendChild(document.createTextNode(l.slice(a))),o},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 hf(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 lK{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:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(Ut);this.optionContent=oK(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=hf(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=e.state.field(t).open;for(let h=a.target,d;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(d=/-(\d+)$/.exec(h.id))&&+d[1]<c.length){this.applyCompletion(e,c[+d[1]]),a.preventDefault();return}}),this.dom.addEventListener("focusout",a=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Ut).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Ya.of(null)})}),this.showOptions(r,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:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=hf(r.length,o,e.state.facet(Ut).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}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=hf(t.options.length,t.selected,this.view.state.facet(Ut).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 r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>ji(this.view.state,o,"completion info")):this.addInfoPane(r,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:r}=e;i.appendChild(s),this.infoDestroy=r||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&&hK(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(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(Ut).positionInfo(this.view,t,s,i,r,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 r=null;for(let o=i.from;o<i.to;o++){let{completion:l,match:a}=e[o],{section:c}=l;if(c){let u=typeof c=="string"?c:c.name;if(u!=r&&(o>i.from||i.from==0))if(r=u,typeof c!="string"&&c.header)s.appendChild(c.header(c));else{let f=s.appendChild(document.createElement("completion-section"));f.textContent=u}}const h=s.appendChild(document.createElement("li"));h.id=t+"-"+o,h.setAttribute("role","option");let d=this.optionClass(l);d&&(h.className=d);for(let u of this.optionContent){let f=u(l,this.view.state,this.view,a);f&&h.appendChild(f)}}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 aK(n,e){return t=>new lK(t,n,e)}function hK(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 _6(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function cK(n,e){let t=[],i=null,s=c=>{t.push(c);let{section:h}=c.completion;if(h){i||(i=[]);let d=typeof h=="string"?h:h.name;i.some(u=>u.name==d)||i.push(typeof h=="string"?{name:d}:h)}},r=e.facet(Ut);for(let c of n)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let d of c.result.options)s(new A6(d,c.source,h?h(d):[],1e9-t.length));else{let d=e.sliceDoc(c.from,c.to),u,f=r.filterStrict?new nK(d):new sK(d);for(let p of c.result.options)if(u=f.match(p.label)){let g=p.displayLabel?h?h(p,u.matched):[]:u.matched;s(new A6(p,c.source,g,u.score+(p.boost||0)))}}}if(i){let c=Object.create(null),h=0,d=(u,f)=>{var p,g;return((p=u.rank)!==null&&p!==void 0?p:1e9)-((g=f.rank)!==null&&g!==void 0?g:1e9)||(u.name<f.name?-1:1)};for(let u of i.sort(d))h-=1e5,c[u.name]=h;for(let u of t){let{section:f}=u.completion;f&&(u.score+=c[typeof f=="string"?f:f.name])}}let o=[],l=null,a=r.compareCompletions;for(let c of t.sort((h,d)=>d.score-h.score||a(h.completion,d.completion))){let h=c.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(c):_6(c.completion)>_6(l)&&(o[o.length-1]=c),l=c.completion}return o}class Co{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Co(this.options,O6(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=cK(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new Co(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(Ut).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let c=0;c<o.length;c++)if(o[c].completion==a){l=c;break}}return new Co(o,O6(i,l),{pos:e.reduce((a,c)=>c.hasResult()?Math.min(a,c.from):a,1e8),create:mK,above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Co(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class rd{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new rd(pK,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Ut),r=(i.override||t.languageDataAt("autocomplete",nr(t)).map(iK)).map(l=>(this.active.find(c=>c.source==l)||new Ii(l,this.active.some(c=>c.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!dK(r,this.active)?o=Co.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new Ii(l.source,0):l));for(let l of e.effects)l.is(Wk)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new rd(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?uK:fK}}function dK(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,r=i==e.length;if(s||r)return s==r;if(n[t++].result!=e[i++].result)return!1}}const uK={"aria-autocomplete":"list"},fK={};function O6(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const pK=[];function Fk(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(Nk);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 Ii{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Fk(e,t),s=this;(i&8||i&16&&this.touches(e))&&(s=new Ii(s.source,0)),i&4&&s.state==0&&(s=new Ii(this.source,1)),s=s.updateFor(e,i);for(let r of e.effects)if(r.is(nd))s=new Ii(s.source,1,r.value?nr(e.state):-1);else if(r.is(Ya))s=new Ii(s.source,0);else if(r.is(Ik))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Ii(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(nr(e.state))}}class Eo extends Ii{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,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 r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=nr(e.state);if((this.explicitPos<0?l<=r:l<this.from)||l>o||!s||t&2&&nr(e.startState)==this.from)return new Ii(this.source,t&4?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return gK(s.validFor,e.state,r,o)?new Eo(this.source,a,s,r,o):s.update&&(s=s.update(s,r,o,new Bk(e.state,l,a>=0)))?new Eo(this.source,a,s,s.from,(i=s.to)!==null&&i!==void 0?i:nr(e.state)):new Ii(this.source,1,a)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Eo(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ii(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function gK(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Hk(n,!0).test(s)}const Ik=ce.define({map(n,e){return n.map(t=>t.map(e))}}),Wk=ce.define(),Mi=qt.define({create(){return rd.start()},update(n,e){return n.update(e)},provide:n=>[Lk.from(n,e=>e.tooltip),Fe.contentAttributes.from(n,e=>e.attrs)]});function D2(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Mi).active.find(s=>s.source==e.source);return i instanceof Eo?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},tK(n.state,t,i.from,i.to)),{annotations:Nk.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}const mK=aK(Mi,D2);function v1(n,e="option"){return t=>{let i=t.state.field(Mi,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(Ut).interactionDelay)return!1;let s=1,r;e=="page"&&(r=Rk(t,i.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=i.open.options,l=i.open.selected>-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Wk.of(l)}),!0}}const CK=n=>{let e=n.state.field(Mi,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(Ut).interactionDelay?!1:D2(n,e.open.options[e.open.selected])},yK=n=>n.state.field(Mi,!1)?(n.dispatch({effects:nd.of(!0)}),!0):!1,bK=n=>{let e=n.state.field(Mi,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Ya.of(null)}),!0)};class SK{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const wK=50,vK=1e3,kK=sd.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(Mi).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Mi),t=n.state.facet(Ut);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Mi)==e)return;let i=n.transactions.some(r=>{let o=Fk(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;r<this.running.length;r++){let o=this.running[r];if(i||o.updates.length+n.transactions.length>wK&&Date.now()-o.time>vK){for(let l of o.context.abortListeners)try{l()}catch(a){ji(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(nd)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.state==1&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Mi);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=nr(e),i=new Bk(e,t,n.explicitPos==t,this.view),s=new SK(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Ya.of(null)}),ji(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ut).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ut);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let o=new Eo(s.active.source,s.active.explicitPos,s.done,s.done.from,(n=s.done.to)!==null&&n!==void 0?n:nr(s.updates.length?s.updates[0].startState:this.view.state));for(let l of s.updates)o=o.update(l,t);if(o.hasResult()){e.push(o);continue}}let r=this.view.state.field(Mi).active.find(o=>o.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new Ii(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Ik.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Mi,!1);if(e&&e.tooltip&&this.view.state.facet(Ut).closeOnBlur){let t=e.open&&Rk(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Ya.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:nd.of(!1)}),20),this.composing=0}}}),xK=typeof navigator=="object"&&/Win/.test(navigator.platform),MK=Vi.highest(Fe.domEventHandlers({keydown(n,e){let t=e.state.field(Mi,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(xK&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],s=t.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&D2(e,i),!1}})),AK=Fe.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"},".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"}}}),Ja={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Tr=ce.define({map(n,e){let t=e.mapPos(n,-1,fe.TrackAfter);return t??void 0}}),T2=new class extends Bt{};T2.startSide=1;T2.endSide=-1;const zk=qt.define({create(){return K.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(Tr)&&(n=n.update({add:[T2.range(t.value,t.value+1)]}));return n}});function DK(){return[_K,zk]}const cf="()[]{}<>";function Uk(n){for(let e=0;e<cf.length;e+=2)if(cf.charCodeAt(e)==n)return cf.charAt(e+1);return xm(n<128?n:n+1)}function $k(n,e){return n.languageDataAt("closeBrackets",e)[0]||Ja}const TK=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),_K=Fe.inputHandler.of((n,e,t,i)=>{if((TK?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Di(Pt(i,0))==1||e!=s.from||t!=s.to)return!1;let r=EK(n.state,i);return r?(n.dispatch(r),!0):!1}),OK=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=$k(n,n.selection.main.head).brackets||Ja.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=PK(n.doc,o.head);for(let a of i)if(a==l&&Id(n.doc,o.head)==Uk(Pt(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:T.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},VK=[{key:"Backspace",run:OK}];function EK(n,e){let t=$k(n,n.selection.main.head),i=t.brackets||Ja.brackets;for(let s of i){let r=Uk(Pt(s,0));if(e==s)return r==s?BK(n,s,i.indexOf(s+s+s)>-1,t):LK(n,s,r,t.before||Ja.before);if(e==r&&Kk(n,n.selection.main.from))return RK(n,s,r)}return null}function Kk(n,e){let t=!1;return n.field(zk).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Id(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Di(Pt(t,0)))}function PK(n,e){let t=n.sliceString(e-2,e);return Di(Pt(t,0))==t.length?t:t.slice(1)}function LK(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Tr.of(o.to+e.length),range:T.range(o.anchor+e.length,o.head+e.length)};let l=Id(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:Tr.of(o.head+e.length),range:T.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function RK(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Id(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:T.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function BK(n,e,t,i){let s=i.stringPrefixes||Ja.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Tr.of(l.to+e.length),range:T.range(l.anchor+e.length,l.head+e.length)};let a=l.head,c=Id(n.doc,a),h;if(c==e){if(V6(n,a))return{changes:{insert:e+e,from:a},effects:Tr.of(a+e.length),range:T.cursor(a+e.length)};if(Kk(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:T.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(h=E6(n,a-2*e.length,s))>-1&&V6(n,h))return{changes:{insert:e+e+e+e,from:a},effects:Tr.of(a+e.length),range:T.cursor(a+e.length)};if(n.charCategorizer(a)(c)!=He.Word&&E6(n,a,s)>-1&&!HK(n,a,e,s))return{changes:{insert:e+e,from:a},effects:Tr.of(a+e.length),range:T.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function V6(n,e){let t=Xt(n).resolveInner(e+1);return t.parent&&t.from==e}function HK(n,e,t,i){let s=Xt(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>t.length+a;){if(n.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let c=s.to==e&&s.parent;if(!c)break;s=c}return!1}function E6(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=He.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=He.Word)return r}return-1}function NK(n={}){return[MK,Mi,Ut.of(n),kK,FK,AK]}const Gk=[{key:"Ctrl-Space",run:yK},{key:"Escape",run:bK},{key:"ArrowDown",run:v1(!0)},{key:"ArrowUp",run:v1(!1)},{key:"PageDown",run:v1(!0,"page")},{key:"PageUp",run:v1(!1,"page")},{key:"Enter",run:CK}],FK=Vi.highest(Ek.computeN([Ut],n=>n.facet(Ut).defaultKeymap?[Gk]:[]));function Xa(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Eg(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function IK(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function vc(n,e){if(!e.anchorNode)return!1;try{return Eg(n,e.anchorNode)}catch{return!1}}function Qa(n){return n.nodeType==3?Xr(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function ka(n,e,t,i){return t?P6(n,e,t,i,-1)||P6(n,e,t,i,1):!1}function Jr(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function od(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function P6(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:vn(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Jr(n)+(s<0?0:1),n=r}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?vn(n):0}else return!1}}function vn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function _2(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function WK(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 qk(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 zK(n,e,t,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,d=!1;h&&!d;)if(h.nodeType==1){let u,f=h==a.body,p=1,g=1;if(f)u=WK(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(d=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let w=h.getBoundingClientRect();({scaleX:p,scaleY:g}=qk(h,w)),u={left:w.left,right:w.left+h.clientWidth*p,top:w.top,bottom:w.top+h.clientHeight*g}}let b=0,y=0;if(s=="nearest")e.top<u.top?(y=-(u.top-e.top+o),t>0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y<u.top&&(y=-(u.top+y-e.top+o)));else{let w=e.bottom-e.top,M=u.bottom-u.top;y=(s=="center"&&w<=M?e.top+w/2-M/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-M+o)-u.top}if(i=="nearest"?e.left<u.left?(b=-(u.left-e.left+r),t>0&&e.right>u.right+b&&(b=e.right-u.right+b+r)):e.right>u.right&&(b=e.right-u.right+r,t<0&&e.left<u.left+b&&(b=-(u.left+b-e.left+r))):b=(i=="center"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:i=="start"==l?e.left-r:e.right-(u.right-u.left)+r)-u.left,b||y)if(f)c.scrollBy(b,y);else{let w=0,M=0;if(y){let k=h.scrollTop;h.scrollTop+=y/g,M=(h.scrollTop-k)*g}if(b){let k=h.scrollLeft;h.scrollLeft+=b/p,w=(h.scrollLeft-k)*p}e={left:e.left-w,top:e.top-M,right:e.right-w,bottom:e.bottom-M},w&&Math.abs(w-b)<1&&(i="nearest"),M&&Math.abs(M-y)<1&&(s="nearest")}if(f)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function UK(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 $K{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?vn(t):0),i,Math.min(e.focusOffset,i?vn(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let lo=null;function Zk(n){if(n.setActive)return n.setActive();if(lo)return n.focus(lo);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(lo==null?{get preventScroll(){return lo={preventScroll:!0},!0}}:void 0),!lo){lo=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let L6;function Xr(n,e,t=e){let i=L6||(L6=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Po(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 r=new KeyboardEvent("keydown",s);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function KK(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function jk(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function GK(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,vn(t));;)if(i){if(t.nodeType!=1)return!1;let s=t.childNodes[i-1];s.contentEditable=="false"?i--:(t=s,i=vn(t))}else{if(t==n)return!0;i=Jr(t),t=t.parentNode}}function Yk(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function Jk(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=vn(t)}else if(t.parentNode&&!od(t))i=Jr(t),t=t.parentNode;else return null}}function Xk(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&&!od(t))i=Jr(t)+1,t=t.parentNode;else return null}}let Wi=class Pg{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new Pg(e.parentNode,Jr(e),t)}static after(e,t){return new Pg(e.parentNode,Jr(e)+1,t)}};const O2=[];let ft=class Lg{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,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=Lg.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=R6(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=R6(r)}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=vn(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!Lg.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,h=i;a<this.children.length;a++){let d=this.children[a],u=c+d.length;if(c<e&&u>t)return d.domBoundsAround(e,t,c);if(u>=e&&s==-1&&(s=a,r=c),c>t&&d.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+d.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].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=O2){this.markDirty();for(let s=e;s<t;s++){let r=this.children[s];r.parent==this&&i.indexOf(r)<0&&r.destroy()}this.children.splice(e,t-e,...i);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 Qk(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,r,o){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}};ft.prototype.breakAfter=0;function R6(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}let Qk=class{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 ex(n,e,t,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[e]:null,d=r.length?r[r.length-1]:null,u=d?d.breakAfter:o;if(!(e==i&&h&&!o&&!u&&r.length<2&&h.merge(t,s,r.length?d:null,t==0,l,a))){if(i<c.length){let f=c[i];f&&(s<f.length||f.breakAfter&&(d!=null&&d.breakAfter))?(e==i&&(f=f.split(s),s=0),!u&&d&&f.merge(0,s,d,!0,0,a)?r[r.length-1]=f:((s||f.children.length&&!f.children[0].length)&&f.merge(0,s,null,!1,0,a),r.push(f))):f!=null&&f.breakAfter&&(d?d.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,t>0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[e].become(r[0]))e++,r.shift(),l=r.length?0:a;else break;!r.length&&e&&i<c.length&&!c[e-1].breakAfter&&c[i].merge(0,0,c[e-1],!1,l,a)&&e--,(e<i||r.length)&&n.replaceChildren(e,i,r)}}function tx(n,e,t,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),d=e-t;for(let u of i)d+=u.length;n.length+=d,ex(n,c,h,l,a,i,0,s,r)}let Ai=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Rg=typeof document<"u"?document:{documentElement:{style:{}}};const Bg=/Edge\/(\d+)/.exec(Ai.userAgent),ix=/MSIE \d/.test(Ai.userAgent),Hg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ai.userAgent),Wd=!!(ix||Hg||Bg),B6=!Wd&&/gecko\/(\d+)/i.test(Ai.userAgent),df=!Wd&&/Chrome\/(\d+)/.exec(Ai.userAgent),H6="webkitFontSmoothing"in Rg.documentElement.style,sx=!Wd&&/Apple Computer/.test(Ai.vendor),N6=sx&&(/Mobile\/\w+/.test(Ai.userAgent)||Ai.maxTouchPoints>2);var re={mac:N6||/Mac/.test(Ai.platform),windows:/Win/.test(Ai.platform),linux:/Linux|X11/.test(Ai.platform),ie:Wd,ie_version:ix?Rg.documentMode||6:Hg?+Hg[1]:Bg?+Bg[1]:0,gecko:B6,gecko_version:B6?+(/Firefox\/(\d+)/.exec(Ai.userAgent)||[0,0])[1]:0,chrome:!!df,chrome_version:df?+df[1]:0,ios:N6,android:/Android\b/.test(Ai.userAgent),webkit:H6,safari:sx,webkit_version:H6?+(/\bAppleWebKit\/(\d+)/.exec(Ai.userAgent)||[0,0])[1]:0,tabSize:Rg.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const qK=256;let Cr=class Ng extends ft{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 Ng)||this.length-(t-e)+i.length>qK||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 Ng(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 Wi(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 ZK(this.dom,e,t)}},ol=class Fg extends ft{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(jk(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,r,o){return i&&(!(i instanceof Fg&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(tx(this,e,t,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>e&&t.push(i<e?l.split(e-i):l),s<0&&i>=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Fg(this.mark,t,o)}domAtPos(e){return nx(this,e)}coordsAt(e,t){return ox(this,e,t)}};function ZK(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?re.chrome||re.gecko||(e?(s--,o=1):r<i&&(r++,o=-1)):t<0?s--:r<i&&r++;let l=Xr(n,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return re.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?_2(a,o<0):a||null}let V2=class na extends ft{static create(e,t,i){return new na(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=na.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,r,o){return i&&(!(i instanceof na)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof na&&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 $.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):$.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Wi.before(this.dom):Wi.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(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top<r.bottom);l+=o?-1:1);return _2(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}},Ig=class Wg extends ft{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Wg&&e.side==this.side}split(){return new Wg(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?Wi.before(this.dom):Wi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return $.empty}get isHidden(){return!0}};Cr.prototype.children=V2.prototype.children=Ig.prototype.children=O2;function nx(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Wi(t,0)}function rx(n,e,t){let i,{children:s}=n;t>0&&e instanceof ol&&s.length&&(i=s[s.length-1])instanceof ol&&i.mark.eq(e.mark)?rx(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function ox(n,e,t){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let d=0,u=0;d<c.children.length&&u<=h;d++){let f=c.children[d],p=u+f.length;p>=h&&(f.children.length?l(f,h-u):(!r||r.isHidden&&t>0)&&(p>h||u==p&&f.getSide()>0)?(r=f,o=h-u):(u<h||u==p&&f.getSide()<0&&!f.isHidden)&&(i=f,s=h-u)),u=p}}l(n,e);let a=(t<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?s:o),t):jK(n)}function jK(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Qa(e);return t[t.length-1]||null}function zg(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 F6=Object.create(null);function ld(n,e,t){if(n==e)return!0;n||(n=F6),e||(e=F6);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 r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function Ug(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 YK(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}let hi=class ra extends ft{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof ra))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),tx(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new ra;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 r=i;r<this.children.length;r++)t.append(this.children[r],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){ld(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){rx(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=zg(t,this.attrs||{})),i&&(this.attrs=zg({class:i},this.attrs||{}))}domAtPos(e){return nx(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(jk(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&&(Ug(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&&ft.get(s)instanceof ol;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=ft.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!re.ios||!this.children.some(r=>r instanceof Cr))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Cr)||/[^ -~]/.test(i.text))return null;let s=Qa(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=ox(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight<r){let o=(r-s.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(e){return e instanceof ra&&this.children.length==0&&e.children.length==0&&ld(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 r=e.children[i],o=s+r.length;if(o>=t){if(r instanceof ra)return r;if(o>t)break}s=o+r.breakAfter}return null}};class mn extends ft{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,r,o){return i&&(!(i instanceof mn)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Wi.before(this.dom):Wi.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new mn(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return O2}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):$.empty}domBoundsAround(){return null}become(e){return e instanceof mn&&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){return this.widget.coordsAt(this.dom,e,t)}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}}let zd=class{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 sn=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(sn||(sn={}));let Tt=class extends Bt{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 E2(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 ll(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:r,end:o}=cx(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new ll(e,i,s,t,e.widget||null,!0)}static line(e){return new P2(e)}static set(e,t=!1){return K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Tt.none=K.empty;let E2=class lx extends Tt{constructor(e){let{start:t,end:i}=cx(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 lx&&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))&&ld(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)}};E2.prototype.point=!1;let P2=class ax extends Tt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ax&&this.spec.class==e.spec.class&&ld(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)}};P2.prototype.mapMode=fe.TrackBefore;P2.prototype.point=!0;let ll=class hx extends Tt{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?fe.TrackBefore:fe.TrackAfter:fe.TrackDel}get type(){return this.startSide!=this.endSide?sn.WidgetRange:this.startSide<=0?sn.WidgetBefore:sn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof hx&&JK(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)}};ll.prototype.point=!0;function cx(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 JK(n,e){return n==e||!!(n&&e&&n.compare(e))}function $g(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 xa{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 mn&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new hi),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(k1(new Ig(-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 mn)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){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=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(k1(new Cr(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,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ll){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 l=t-e;if(i instanceof ll)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new mn(i.widget||al.block,l,i));else{let a=V2.create(i.widget||al.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e<t||i.startSide>0),h=!a.isEditable&&(e<t||r>s.length||i.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(d.append(k1(new Ig(1),s),r),r=s.length+Math.max(0,r-s.length)),d.append(k1(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?e<t||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new xa(e,t,i,r);return o.openEnd=K.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function k1(n,e){for(let t of e)n=new ol(t,[n],n.length);return n}let al=class extends zd{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}};al.inline=new al("span");al.block=new al("div");var Kt=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Kt||(Kt={}));const Qr=Kt.LTR,L2=Kt.RTL;function dx(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const XK=dx("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),QK=dx("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Kg=Object.create(null),Ns=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Kg[e]=t,Kg[t]=-e}function ux(n){return n<=247?XK[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?QK[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const eG=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Yn{get dir(){return this.level%2?L2:Qr}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 r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function fx(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||!fx(i.inner,s.inner))return!1}return!0}const Ge=[];function tG(n,e,t,i,s){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:e,l=r<i.length?i[r].from:t,a=r?256:s;for(let c=o,h=a,d=a;c<l;c++){let u=ux(n.charCodeAt(c));u==512?u=h:u==8&&d==4&&(u=16),Ge[c]=u==4?2:u,u&7&&(d=u),h=u}for(let c=o,h=a,d=a;c<l;c++){let u=Ge[c];if(u==128)c<l-1&&h==Ge[c+1]&&h&24?u=Ge[c]=h:Ge[c]=256;else if(u==64){let f=c+1;for(;f<l&&Ge[f]==64;)f++;let p=c&&h==8||f<t&&Ge[f]==8?d==1?1:8:256;for(let g=c;g<f;g++)Ge[g]=p;c=f-1}else u==8&&d==1&&(Ge[c]=1);h=u,u&7&&(d=u)}}}function iG(n,e,t,i,s){let r=s==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,h=o<i.length?i[o].from:t;for(let d=c,u,f,p;d<h;d++)if(f=Kg[u=n.charCodeAt(d)])if(f<0){for(let g=l-3;g>=0;g-=3)if(Ns[g+1]==-f){let b=Ns[g+2],y=b&2?s:b&4?b&1?r:s:0;y&&(Ge[d]=Ge[Ns[g]]=y),l=g;break}}else{if(Ns.length==189)break;Ns[l++]=d,Ns[l++]=u,Ns[l++]=a}else if((p=Ge[d])==2||p==1){let g=p==s;a=g?0:1;for(let b=l-3;b>=0;b-=3){let y=Ns[b+2];if(y&2)break;if(g)Ns[b+2]|=2;else{if(y&4)break;Ns[b+2]|=4}}}}}function sG(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=s<t.length?t[s].from:e;for(let a=o;a<l;){let c=Ge[a];if(c==256){let h=a+1;for(;;)if(h==l){if(s==t.length)break;h=t[s++].to,l=s<t.length?t[s].from:e}else if(Ge[h]==256)h++;else break;let d=r==1,u=(h<e?Ge[h]:i)==1,f=d==u?d?1:2:i;for(let p=h,g=s,b=g?t[g-1].to:n;p>a;)p==b&&(p=t[--g].from,b=g?t[g-1].to:n),Ge[--p]=f;a=h}else r=c,a++}}}function Gg(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,c=0;a<t;){let h=!0,d=!1;if(c==r.length||a<r[c].from){let g=Ge[a];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c<r.length&&p==r[c].from){if(d)break e;let g=r[c];if(!h)for(let b=g.to,y=c+1;;){if(b==t)break e;if(y<r.length&&r[y].from==b)b=r[y++].to;else{if(Ge[b]==l)break e;break}}if(c++,u)u.push(g);else{g.from>a&&o.push(new Yn(a,g.from,f));let b=g.direction==Qr!=!(f%2);qg(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(h?Ge[p]!=l:Ge[p]==l))break;p++}u?Gg(n,a,p,i+1,s,u,o):a<p&&o.push(new Yn(a,p,f)),a=p}else for(let a=t,c=r.length;a>e;){let h=!0,d=!1;if(!c||a>r[c-1].to){let g=Ge[a-1];g!=l&&(h=!1,d=g==16)}let u=!h&&l==1?[]:null,f=h?i:i+1,p=a;e:for(;;)if(c&&p==r[c-1].to){if(d)break e;let g=r[--c];if(!h)for(let b=g.from,y=c;;){if(b==e)break e;if(y&&r[y-1].to==b)b=r[--y].from;else{if(Ge[b-1]==l)break e;break}}if(u)u.push(g);else{g.to<a&&o.push(new Yn(g.to,a,f));let b=g.direction==Qr!=!(f%2);qg(n,b?i+1:i,s,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==e||(h?Ge[p-1]!=l:Ge[p-1]==l))break;p--}u?Gg(n,p,a,i+1,s,u,o):p<a&&o.push(new Yn(p,a,f)),a=p}}function qg(n,e,t,i,s,r,o){let l=e%2?2:1;tG(n,s,r,i,l),iG(n,s,r,i,l),sG(s,r,i,l),Gg(n,s,r,e,t,i,o)}function nG(n,e,t){if(!n)return[new Yn(0,0,e==L2?1:0)];if(e==Qr&&!t.length&&!eG.test(n))return px(n.length);if(t.length)for(;n.length>Ge.length;)Ge[Ge.length]=256;let i=[],s=e==Qr?0:1;return qg(n,s,s,t,0,n.length,i),i}function px(n){return[new Yn(0,n,0)]}let gx="";function rG(n,e,t,i,s){var r;let o=i.head-n.from,l=Yn.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],c=a.side(s,t);if(o==c){let u=l+=s?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!s,t),c=a.side(s,t)}let h=de(n.text,o,a.forward(s,t));(h<a.from||h>a.to)&&(h=c),gx=n.text.slice(Math.min(o,h),Math.max(o,h));let d=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return d&&h==c&&d.level+(s?0:1)<a.level?T.cursor(d.side(!s,t)+n.from,d.forward(s,t)?1:-1,d.level):T.cursor(h+n.from,a.forward(s,t)?-1:1,a.level)}function oG(n,e,t){for(let i=e;i<t;i++){let s=ux(n.charCodeAt(i));if(s==1)return Qr;if(s==2||s==4)return L2}return Qr}const mx=P.define(),Cx=P.define(),yx=P.define(),bx=P.define(),Zg=P.define(),Sx=P.define(),wx=P.define(),vx=P.define({combine:n=>n.some(e=>e)}),lG=P.define({combine:n=>n.some(e=>e)}),kx=P.define();class Lo{constructor(e,t="nearest",i="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new Lo(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 Lo(T.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const x1=ce.define({map:(n,e)=>n.map(e)}),xx=ce.define();function Js(n,e,t){let i=n.facet(bx);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 zn=P.define({combine:n=>n.length?n[0]:!0});let aG=0;const oa=P.define();let eh=class jg{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new jg(aG++,e,i,s,l=>{let a=[oa.of(l)];return o&&a.push(th.of(c=>{let h=c.plugin(l);return h?o(h):Tt.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return jg.define(i=>new e(i),t)}};class uf{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(Js(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){Js(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){Js(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Mx=P.define(),R2=P.define(),th=P.define(),Ax=P.define(),B2=P.define(),Dx=P.define();function I6(n,e){let t=n.state.facet(Dx);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(n):r),s=[];return K.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let c=r-e.from,h=o-e.from,d=s;for(let u=l.length-1;u>=0;u--,a--){let f=l[u].spec.bidiIsolate,p;if(f==null&&(f=oG(e.text,c,h)),a>0&&d.length&&(p=d[d.length-1]).to==c&&p.direction==f)p.to=h,d=p.inner;else{let g={from:c,to:h,direction:f,inner:[]};d.push(g),d=g.inner}}}}),s}const Tx=P.define();function _x(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(Tx)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const la=P.define();class Xi{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Xi(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,r=0,o=0,l=0;;s++){let a=s==e.length?null:e[s],c=o-l,h=a?a.fromB:1e9;for(;r<t.length&&t[r]<h;){let d=t[r],u=t[r+1],f=Math.max(l,d),p=Math.min(h,u);if(f<=p&&new Xi(f+c,p+c,f,p).addToSet(i),u>h)break;r+=2}if(!a)return i;new Xi(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class ad{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Be.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Xi(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new ad(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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 W6 extends ft{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=Tt.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 hi],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Xi(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:c,toA:h})=>h<this.minWidthFrom||c>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:!gG(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?cG(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Xi(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(re.ie||re.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=fG(o,l,e.changes);return i=Xi.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),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 o=re.chrome||re.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof mn&&o.widget instanceof z6&&r.push(o.dom);s.updateGaps(r)}updateChildren(e,t,i){let s=i?i.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let o=s.length-1;;o--){let l=o>=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:d}=l,u,f,p,g;if(i&&i.range.fromB<d&&i.range.toB>h){let k=xa.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),V=xa.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);f=k.breakAtStart,p=k.openStart,g=V.openEnd;let R=this.compositionView(i);V.breakAtStart?R.breakAfter=1:V.content.length&&R.merge(R.length,R.length,V.content[0],!1,V.openStart,0)&&(R.breakAfter=V.content[0].breakAfter,V.content.shift()),k.content.length&&R.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(R).concat(V.content)}else({content:u,breakAtStart:f,openStart:p,openEnd:g}=xa.build(this.view.state.doc,h,d,this.decorations,this.dynamicDecorationMap));let{i:b,off:y}=r.findPos(c,1),{i:w,off:M}=r.findPos(a,-1);ex(this,w,M,b,y,u,f,p,g)}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(xx)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new Cr(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new ol(s,[t],t.length);let i=new hi;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=ft.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].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,r=!s&&vc(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(re.gecko&&l.empty&&!this.hasComposition&&hG(a)){let d=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(d,a.node.childNodes[a.offset]||null)),a=c=new Wi(d,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!ka(a.node,a.offset,h.anchorNode,h.anchorOffset)||!ka(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{re.android&&re.chrome&&this.dom.contains(h.focusNode)&&pG(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=Xa(this.view.root);if(d)if(l.empty){if(re.gecko){let u=dG(a.node,a.offset);if(u&&u!=3){let f=(u==1?Jk:Xk)(a.node,a.offset);f&&(a=new Wi(f.node,f.offset))}}d.collapse(a.node,a.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(a.node,a.offset);try{d.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Wi(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Wi(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ka(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=Xa(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=hi.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=t.from&&i.collapse(s,r)}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 r=ft.get(t.childNodes[s]);r instanceof hi&&(i=r.domAtPos(0))}for(let s=e.offset-1;!i&&s>=0;s--){let r=ft.get(t.childNodes[s]);r instanceof hi&&(i=r.domAtPos(r.length))}return i?new Wi(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=ft.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 hi)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,s=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(a<e)break;if(c<=e&&(c<e||l.covers(-1))&&(a>e||l.covers(1))&&(!i||l instanceof hi&&!(i instanceof hi&&t>=0)))i=l,s=c;else if(i&&c==e&&a==e&&l instanceof mn&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}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 hi))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof Cr))return null;let r=de(s.text,i);if(r==i)return null;let o=Xr(s.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Kt.LTR;for(let c=0,h=0;h<this.children.length;h++){let d=this.children[h],u=c+d.length;if(u>s)break;if(c>=i){let f=d.dom.getBoundingClientRect();if(t.push(f.height),o){let p=d.dom.lastChild,g=p?Qa(p):[];if(g.length){let b=g[g.length-1],y=a?b.right-f.left:f.right-b.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+d.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Kt.RTL:Kt.LTR}measureTextSize(){for(let r of this.children)if(r instanceof hi){let o=r.measureTextSize();if(o)return o}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 r=Qa(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.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 Qk(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(Tt.replace({widget:new z6(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return Tt.set(e)}updateDeco(){let e=1,t=this.view.state.facet(th).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(Ax).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(K.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 c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(kx))try{if(c(this.view,e.range,e))return!0}catch(h){Js(this.view.state,h,"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 r=_x(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;zK(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Kt.LTR)}}function hG(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")}class z6 extends zd{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}}function Ox(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=Jk(t.focusNode,t.focusOffset),s=Xk(t.focusNode,t.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=ft.get(s.node);if(!l||l instanceof Cr&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=ft.get(i.node);!a||a instanceof Cr&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function cG(n,e,t){let i=Ox(n,t);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc,c=new Xi(a.mapPos(r),a.mapPos(o),r,o),h=[];for(let d=s.parentNode;;d=d.parentNode){let u=ft.get(d);if(u instanceof ol)h.push({node:d,deco:u.mark});else{if(u instanceof hi||d.nodeName=="DIV"&&d.parentNode==n.contentDOM)return{range:c,text:s,marks:h,line:d};if(d!=n.contentDOM)h.push({node:d,deco:new E2({inclusive:!0,attributes:YK(d),tagName:d.tagName.toLowerCase()})});else return null}}}function dG(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 uG=class{constructor(){this.changes=[]}compareRange(e,t){$g(e,t,this.changes)}comparePoint(e,t){$g(e,t,this.changes)}};function fG(n,e,t){let i=new uG;return K.compare(n,e,t,i),i.changes}function pG(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 gG(n,e){let t=!1;return e&&n.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(t=!0)}),t}function mG(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return T.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=de(s.text,r,!1):l=de(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=de(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=de(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return T.range(o+s.from,l+s.from)}function CG(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function yG(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function ff(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function U6(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function $6(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Yg(n,e,t){let i,s,r,o,l=!1,a,c,h,d;for(let p=n.firstChild;p;p=p.nextSibling){let g=Qa(p);for(let b=0;b<g.length;b++){let y=g[b];s&&ff(s,y)&&(y=U6($6(y,s.bottom),s.top));let w=CG(e,y),M=yG(t,y);if(w==0&&M==0)return p.nodeType==3?K6(p,e,t):Yg(p,e,t);if(!i||o>M||o==M&&r>w){i=p,s=y,r=w,o=M;let k=M?t<y.top?-1:1:w?e<y.left?-1:1:0;l=!k||(k>0?b<g.length-1:b>0)}w==0?t>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):t<y.top&&(!d||d.top>y.top)&&(c=p,d=y):h&&ff(h,y)?h=$6(h,y.bottom):d&&ff(d,y)&&(d=U6(d,y.top))}}if(h&&h.bottom>=t?(i=a,s=h):d&&d.top<=t&&(i=c,s=d),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return K6(i,u,t);if(l&&i.contentEditable!="false")return Yg(i,u,t);let f=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:f}}function K6(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=Xr(n,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let d=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&d<r){let u=e>=(h.left+h.right)/2,f=u;if((re.chrome||re.gecko)&&Xr(n,l).getBoundingClientRect().left==h.right&&(f=!u),d<=0)return{node:n,offset:l+(f?1:0)};s=l+(f?1:0),r=d}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Vx(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:d}=e,u=d-l;if(u<0)return 0;if(u>c)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,V=!1;a=n.elementAtHeight(u),a.type!=sn.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(V)return t?null:0;V=!0,i=-i}d=l+u;let f=a.from;if(f<n.viewport.from)return n.viewport.from==0?0:t?null:G6(n,o,a,h,d);if(f>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:G6(n,o,a,h,d);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,b=g.elementFromPoint(h,d);b&&!n.contentDOM.contains(b)&&(b=null),b||(h=Math.max(o.left+1,Math.min(o.right-1,h)),b=g.elementFromPoint(h,d),b&&!n.contentDOM.contains(b)&&(b=null));let y,w=-1;if(b&&((s=n.docView.nearest(b))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,d);k&&({offsetNode:y,offset:w}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,d);k&&({startContainer:y,startOffset:w}=k,(!n.contentDOM.contains(y)||re.safari&&bG(y,w,h)||re.chrome&&SG(y,w,h))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let k=hi.find(n.docView,f);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:w}=Yg(k.dom,h,d))}let M=n.docView.nearest(y);if(!M)return null;if(M.isWidget&&((r=M.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=M.dom.getBoundingClientRect();return e.y<k.top||e.y<=k.bottom&&e.x<=(k.left+k.right)/2?M.posAtStart:M.posAtEnd}else return M.localPosFromDOM(y,w)+M.posAtStart}function G6(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+lr(o,r,n.state.tabSize)}function bG(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 Xr(n,i-1,i).getBoundingClientRect().left>t}function SG(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Xr(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function wG(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==sn.Text))return i}return t}function vG(n,e,t,i){let s=wG(n,e.head),r=!i||s.type!=sn.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==Kt.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return T.cursor(a,t?-1:1)}return T.cursor(t?s.to:s.from,t?-1:1)}function q6(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let c=rG(s,r,o,l,t),h=gx;if(!c){if(s.number==(t?n.state.doc.lines:1))return l;h=` `,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),c=n.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function kG(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==He.Space&&(s=o),s==o}}function xG(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return T.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,e.assoc||-1),h=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let f=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-f.from))),l=(r<0?f.top:f.bottom)+h}let d=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let f=0;;f+=10){let p=l+(u+f)*r,g=Vx(n,{x:d,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let b=n.docView.coordsForChar(g),y=!b||p<b.top?-1:1;return T.cursor(g,y,void 0,o)}}}function kc(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function pf(n,e,t){let i=kc(n.state.facet(B2).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:T.cursor(i,i<t.from?1:-1)}class MG{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,re.safari&&e.contentDOM.addEventListener("input",()=>null),re.gecko&&zG(e.contentDOM.ownerDocument)}handleEvent(e){!LG(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=AG(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,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&&TG.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),re.android&&re.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return re.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Ex.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||DG.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,Po(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:re.safari&&!re.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 Z6(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){Js(t.state,s)}}}function AG(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 r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(Z6(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(Z6(i.value,o))}}for(let i in As)t(i).handlers.push(As[i]);for(let i in rs)t(i).observers.push(rs[i]);return e}const Ex=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],DG="dthko",TG=[16,17,18,20,91,92,224,225],M1=6;function A1(n){return Math.max(0,n)*.7+8}function _G(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}let OG=class{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=UK(e.contentDOM),this.atoms=e.state.facet(B2).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ae.allowMultipleSelections)&&VG(e,t),this.dragging=PG(e,t)&&Rx(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&&_G(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=_x(this.view);e.clientX-a.left<=s+M1?t=-A1(s-e.clientX):e.clientX+a.right>=o-M1&&(t=A1(e.clientX-o)),e.clientY-a.top<=r+M1?i=-A1(r-e.clientY):e.clientY+a.bottom>=l-M1&&(i=A1(e.clientY-l)),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],r=null;if(s.empty){let o=kc(this.atoms,s.from,0);o!=s.from&&(r=T.cursor(o,-1))}else{let o=kc(this.atoms,s.from,-1),l=kc(this.atoms,s.to,1);(o!=s.from||l!=s.to)&&(r=T.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?T.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 VG(n,e){let t=n.state.facet(mx);return t.length?t[0](e):re.mac?e.metaKey:e.ctrlKey}function EG(n,e){let t=n.state.facet(Cx);return t.length?t[0](e):re.mac?!e.altKey:!e.ctrlKey}function PG(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Xa(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function LG(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=ft.get(t))&&i.ignoreEvent(e))return!1;return!0}const As=Object.create(null),rs=Object.create(null),Px=re.ie&&re.ie_version<15||re.ios&&re.webkit_version<604;function RG(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(),Lx(n,t.value)},50)}function Lx(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Jg!=null&&t.selection.ranges.every(a=>a.empty)&&Jg==r.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let d=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:d},range:T.cursor(c.from+d.length)}})}else o?i=t.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:T.cursor(a.from+c.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}rs.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};As.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);rs.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};rs.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};As.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(yx))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=NG(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new OG(n,e,t,i)),i&&n.observer.ignore(()=>{Zk(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function j6(n,e,t,i){if(i==1)return T.cursor(e,t);if(i==2)return mG(n.state,e,t);{let s=hi.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,T.range(o,l)}}let Y6=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function BG(n,e,t,i){let s=hi.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Y6(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&Y6(t,i,l)?1:o&&o.bottom>=i?-1:1}function J6(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:BG(n,t,e.clientX,e.clientY)}}const HG=re.ie&&re.ie_version<=11;let X6=null,Q6=0,e7=0;function Rx(n){if(!HG)return n.detail;let e=X6,t=e7;return X6=n,e7=Date.now(),Q6=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Q6+1)%3:1}function NG(n,e){let t=J6(n,e),i=Rx(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=J6(n,r),c,h=j6(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let d=j6(n,t.pos,t.bias,i),u=Math.min(d.from,h.from),f=Math.max(d.to,h.to);h=u<h.from?T.range(u,f):T.range(f,u)}return o?s.replaceRange(s.main.extend(h.from,h.to)):l&&i==1&&s.ranges.length>1&&(c=FG(s,a.pos))?c:l?s.addRange(h):T.create([h])}}}function FG(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 T.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}As.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 r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=T.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};As.dragend=n=>(n.inputState.draggedContent=null,!1);function t7(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&EG(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}As.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,r=()=>{++s==t.length&&t7(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return t7(n,e,i,!0),!0}return!1};As.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Px?null:e.clipboardData;return t?(Lx(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(RG(n),!1)};function IG(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 WG(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:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Jg=null;As.copy=As.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=WG(n.state);if(!t&&!s)return!1;Jg=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Px?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(IG(n,t),!1)};const Bx=gi.define();function Hx(n,e){let t=[];for(let i of n.facet(wx)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:Bx.of(!0)}):null}function Nx(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Hx(n.state,e);t?n.dispatch(t):n.update([])}},10)}rs.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),Nx(n)};rs.blur=n=>{n.observer.clearSelectionRange(),Nx(n)};rs.compositionstart=rs.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};rs.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,re.chrome&&re.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};rs.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};As.beforeinput=(n,e)=>{var t;let i;if(re.chrome&&re.android&&(i=Ex.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return re.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),re.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>rs.compositionend(n,e),20),!1};const i7=new Set;function zG(n){i7.has(n)||(i7.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const s7=["pre-wrap","normal","pre-line","break-spaces"];class UG{constructor(e){this.lineWrapping=e,this.doc=$.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}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 s7.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,r,o){let l=s7.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}}class $G{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class qs{constructor(e,t,i,s,r){this.from=e,this.length=t,this.top=i,this.height=s,this._content=r}get type(){return typeof this._content=="number"?sn.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 ll?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 qs(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var lt=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(lt||(lt={}));const xc=.001;class ui{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,t){this.height!=t&&(Math.abs(this.height-t)>xc&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return ui.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:d}=s[l],u=r.lineAt(a,lt.ByPosNoHeight,i.setDoc(t),0,0),f=u.to>=c?u:r.lineAt(c,lt.ByPosNoHeight,i,0,0);for(d+=f.to-c,c=f.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,lt.ByPosNoHeight,i,0,0));h+=u.from-a,a=u.from;let p=H2.build(i.setDoc(o),e,h,d);r=r.replace(a,c,p)}return r.updateHeight(i,0)}static empty(){return new Li(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,s=0,r=0;for(;;)if(t==i)if(s>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[t++];l&&(s+=l.size)}else{let l=e[--i];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new KG(ui.of(e.slice(0,t)),o,ui.of(e.slice(i)))}}ui.prototype.size=1;class Fx extends ui{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,s){return new qs(s,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,s,r){return this.blockAt(0,i,s,r)}forEachLine(e,t,i,s,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Li extends Fx{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new qs(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Li||s instanceof Wt&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Wt?s=new Li(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ui.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,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 Wt extends ui{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let c=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=t.doc.lineAt(c),d=l+h.length*a,u=Math.max(i,e-d/2);return new qs(h.from,h.length,u,d,0)}else{let c=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:h,length:d}=t.doc.line(r+c);return new qs(h,d,i+l*c,l,0)}}lineAt(e,t,i,s,r){if(t==lt.ByHeight)return this.blockAt(e,i,s,r);if(t==lt.ByPosNoHeight){let{from:f,to:p}=i.doc.lineAt(e);return new qs(f,p-f,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),c=i.doc.lineAt(e),h=l+c.length*a,d=c.number-o,u=s+l*d+a*(c.from-r-d);return new qs(c.from,c.length,Math.max(s,Math.min(u,s+this.height-h)),h,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,r);for(let h=e,d=s;h<=t;){let u=i.doc.lineAt(h);if(h==e){let p=u.number-l;d+=a*p+c*(e-r-p)}let f=a+c*u.length;o(new qs(u.from,u.length,d,f,0)),d+=f,h=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof Wt?i[i.length-1]=new Wt(r.length+s):i.push(null,new Wt(s-1))}if(e>0){let r=i[0];r instanceof Wt?i[0]=new Wt(e+r.length):i.unshift(new Wt(e-1),null)}return ui.of(i)}decomposeLeft(e,t){t.push(new Wt(e-1),null)}decomposeRight(e,t){t.push(null,new Wt(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new Wt(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let d=s.heights[s.index++];a==-1?a=d:Math.abs(d-a)>=xc&&(a=-2);let u=new Li(h,d);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new Wt(r-l).updateHeight(e,l));let c=ui.of(o);return(a<0||Math.abs(c.height-this.height)>=xc||Math.abs(a-this.heightMetrics(e,t).perLine)>=xc)&&(e.heightChanged=!0),c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class KG extends ui{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 r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,s):this.right.blockAt(e,t,r,s+this.left.length+this.break)}lineAt(e,t,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=t==lt.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,i,s,r):this.right.lineAt(e,t,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=t==lt.ByPosNoHeight?lt.ByPosNoHeight:lt.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,s,r).join(c)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,s,r,o),t>=a&&this.right.forEachLine(e,t,i,l,a,o);else{let c=this.lineAt(a,lt.ByPos,i,s,r);e<c.from&&this.left.forEachLine(e,c.from-1,i,s,r,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,l,a,o)}}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 r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&n7(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),n7(r,l)}return ui.of(r)}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?ui.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function n7(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof Wt&&(i=n[e+1])instanceof Wt&&n.splice(e-1,3,new Wt(t.length+1+i.length))}const GG=5;class H2{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 Li?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Li(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,r=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new Fx(o,s,i)):(o||r||s>=GG)&&this.addLineDeco(s,r,o)}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 Li(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new Wt(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 Li)return e;let t=new Li(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 Li)&&!this.isCovered?this.nodes.push(new Li(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 Li&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,t,i,s){let r=new H2(i,e);return K.spans(t,i,s,r,0),r.finish(i)}}function qG(n,e,t){let i=new ZG;return K.compare(n,e,t,i,0),i.changes}class ZG{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,s){(e<t||i&&i.heightRelevant||s&&s.heightRelevant)&&$g(e,t,this.changes,5)}}function jG(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,r=Math.max(0,t.left),o=Math.min(s.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(s.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=i.body;)if(c.nodeType==1){let h=c,d=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=c==n.parentNode?u.bottom:Math.min(a,u.bottom)}c=d.position=="absolute"||d.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function YG(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class gf{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],r=t[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e,t){return Tt.replace({widget:new JG(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class JG extends zd{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 r7{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=o7,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Kt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(R2).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new UG(t),this.stateDeco=e.facet(th).filter(i=>typeof i!="function"),this.heightMap=ui.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle.setDoc(e.doc),[new Xi(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=Tt.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:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new D1(r,o))}}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?o7:new N2(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(aa(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(th).filter(h=>typeof h!="function");let s=e.changedRanges,r=Xi.extendWithRanges(s,qG(i,this.stateDeco,e?e.changes:Be.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(lG)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Kt.RTL:Kt.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:V}=qk(t,l);(k>.005&&Math.abs(this.scaleX-k)>.005||V>.005&&Math.abs(this.scaleY-V)>.005)&&(this.scaleX=k,this.scaleY=V,c|=8,o=a=!0)}let d=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=u)&&(this.paddingTop=d,this.paddingBottom=u,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=Yk(e.scrollDOM);let p=(this.printing?YG:jG)(t,this.paddingTop),g=p.top-this.pixelViewport.top,b=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(k)&&(o=!0),o||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:V,charWidth:R,textHeight:H}=e.docView.measureTextSize();o=V>0&&s.refresh(r,V,R,H,w/R,k),o&&(e.docView.minWidth=0,c|=8)}g>0&&b>0?h=Math.max(g,b):g<0&&b<0&&(h=Math.min(g,b)),s.heightChanged=!1;for(let V of this.viewports){let R=V.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(V);this.heightMap=(o?ui.empty().applyChanges(this.stateDeco,$.empty,this.heightOracle,[new Xi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new $G(V.from,R))}s.heightChanged&&(c|=2)}let M=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||M)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}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,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new D1(s.lineAt(o-i*1e3,lt.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,lt.ByHeight,r,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=s.lineAt(c,lt.ByPos,r,0,0),u;t.y=="center"?u=(d.top+d.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c<a.from?u=d.top:u=d.bottom-h,a=new D1(s.lineAt(u-1e3/2,lt.ByHeight,r,0,0).from,s.lineAt(u+h+1e3/2,lt.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new D1(this.heightMap.lineAt(i,lt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,lt.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,lt.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,lt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r<l+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 gf(t.mapPos(s.from),t.mapPos(s.to),s.size));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=Kt.LTR&&!i)return[];let l=[],a=(h,d,u,f)=>{if(d-h<r)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let y of g)if(y>h&&y<d){a(h,y-10,u,f),a(y+10,d,u,f);return}let b=QG(e,y=>y.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)<r&&Math.abs(y.to-d)<r&&!g.some(w=>y.from<w&&y.to>w));if(!b){if(d<u.to&&t&&i&&t.visibleRanges.some(y=>y.from<=d&&y.to>=d)){let y=t.moveToLineBoundary(T.cursor(d),!1,!0).head;y>h&&(d=y)}b=new gf(h,d,this.gapSize(u,h,d,f))}l.push(b)},c=h=>{if(h.length<o||h.type!=sn.Text)return;let d=XG(h.from,h.to,this.stateDeco);if(d.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,f,p;if(i){let g=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,y;if(u!=null){let w=_1(d,u),M=((this.visibleBottom-this.visibleTop)/2+g)/h.height;b=w-M,y=w+M}else b=(this.visibleTop-h.top-g)/h.height,y=(this.visibleBottom-h.top+g)/h.height;f=T1(d,b),p=T1(d,y)}else{let g=d.total*this.heightOracle.charWidth,b=s*this.heightOracle.charWidth,y,w;if(u!=null){let M=_1(d,u),k=((this.pixelViewport.right-this.pixelViewport.left)/2+b)/g;y=M-k,w=M+k}else y=(this.pixelViewport.left-b)/g,w=(this.pixelViewport.right+b)/g;f=T1(d,y),p=T1(d,w)}f>h.from&&a(h.from,f,h,d),p<h.to&&a(p,h.to,h,d)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(e,t,i,s){let r=_1(s,i)-_1(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){gf.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Tt.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];K.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||aa(this.heightMap.lineAt(e,lt.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)||aa(this.heightMap.lineAt(this.scaler.fromDOM(e),lt.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 aa(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}}class D1{constructor(e,t){this.from=e,this.to=t}}function XG(n,e,t){let i=[],s=n,r=0;return K.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(i.push({from:s,to:e}),r+=e-s),{total:r,ranges:i}}function T1({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:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function _1(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 QG(n,e){for(let t of n)if(e(t))return t}const o7={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class N2{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=t.lineAt(l,lt.ByPos,e,0,0).top,h=t.lineAt(a,lt.ByPos,e,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return s+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,s=r.domBottom}}fromDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,s=r.domBottom}}eq(e){return e instanceof N2?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 aa(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new qs(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(s=>aa(s,e)):n._content)}const O1=P.define({combine:n=>n.join(" ")}),Xg=P.define({combine:n=>n.indexOf(!0)>-1}),Qg=we.newName(),Ix=we.newName(),Wx=we.newName(),zx={"&light":"."+Ix,"&dark":"."+Wx};function em(n,e,t){return new we(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 eq=em("."+Qg,{"&":{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},".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:"#444"},".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},"&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:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".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"}},zx),ha="";class tq{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ae.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ha}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=ft.get(s),a=ft.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:od(s))||od(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}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 r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=ft.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+(iq(e,i.node,i.offset)?t:0))}}function iq(n,e,t){for(;;){if(!e||t<vn(e))return!1;if(e==n)return!0;t=Jr(e)+1,e=e.parentNode}}class l7{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class sq{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:oq(e),a=new tq(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=lq(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Eg(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Eg(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((re.ios||re.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.to<e.state.doc.length)){let d=Math.min(a,c),u=Math.max(a,c),f=h.from-d,p=h.to-u;(f==0||f==1||d==0)&&(p==0||p==-1||u==e.state.doc.length)&&(a=0,c=e.state.doc.length)}this.newSel=T.single(c,a)}}}function Ux(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,c=null;(r===8||re.android&&e.text.length<l-o)&&(a=s.to,c="end");let h=rq(n.state.doc.sliceString(o,l,ha),e.text,a-o,c);h&&(re.chrome&&r==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==ha+ha&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:$.of(e.text.slice(h.from,h.toB).split(ha))})}else i&&(!n.hasFocus&&n.state.facet(zn)||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))}:(re.mac||re.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=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}):re.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` `&&n.lineWrapping&&(i&&(i=T.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:$.of([" "])}),t)return $x(n,t,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function $x(n,e,t,i=-1){if(re.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(re.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&&Po(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)&&Po(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Po(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=nq(n,e,t));return n.state.facet(Sx).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function nq(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.from<e.from?s.sliceDoc(r.from,e.from):"",a=r.to>e.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let c=n.state.sliceDoc(e.from,e.to),h,d=t&&Ox(n,t.main.head);if(d){let p=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-e.to,f=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,b=g-c.length;if(p.to-p.from!=f||n.state.sliceDoc(b,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:b,to:g,insert:e.insert}),w=p.to-r.to;return{changes:y,range:a?T.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function rq(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function oq(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new l7(t,i)),(s!=t||r!=i)&&e.push(new l7(s,r))),e}function lq(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?T.single(t+e,i+e):null}const aq={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},mf=re.ie&&re.ie_version<=11;class hq{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new $K,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);(re.ie&&re.ie_version<=11||re.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&&!(re.chrome&&re.chrome_version<126)&&(this.editContext=new dq(e),e.state.facet(zn)&&(e.contentDOM.editContext=this.editContext.editContext)),mf&&(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.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(zn)?i.root.activeElement!=this.dom:!vc(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(re.ie&&re.ie_version<=11||re.android&&re.chrome)&&!i.state.selection.main.empty&&s.focusNode&&ka(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Xa(e.root);if(!t)return!1;let i=re.safari&&e.root.nodeType==11&&IK(this.dom.ownerDocument)==this.dom&&cq(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let s=vc(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&GK(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,aq),mf&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),mf&&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 r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Po(this.dom,r.key,r.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 r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&vc(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 r=new sq(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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=Ux(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=a7(t,e.previousSibling||e.target.previousSibling,-1),s=a7(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("change",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("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(zn)!=e.state.facet(zn)&&(e.view.contentDOM.editContext=e.state.facet(zn)?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 a7(n,e,t){for(;e;){let i=ft.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 h7(n,e){let t=e.startContainer,i=e.startOffset,s=e.endContainer,r=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return ka(o.node,o.offset,s,r)&&([t,i,s,r]=[s,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}}function cq(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return h7(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?h7(n,t):null}class dq{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(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,r={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:$.of(i.text.split(` `))};r.from==this.from&&s<this.from?r.from=s:r.to==this.to&&s>this.to&&(r.to=s),!(r.from==r.to&&!r.insert.length)&&(this.pendingContextChange=r,e.state.readOnly||$x(e,r,T.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(Tt.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}e.dispatch({effects:xx.of(Tt.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=Xa(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((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(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)}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){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Le{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={}){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:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||KK(e.parent)||document,this.viewState=new r7(e.state||ae.create(e)),e.scrollTo&&e.scrollTo.is(x1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(oa).map(i=>new uf(i));for(let i of this.plugins)i.update(this);this.observer=new hq(this),this.inputState=new MG(this),this.inputState.ensureHandlers(this.plugins),this.docView=new W6(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof pt?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,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Bx))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Hx(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(ae.phrases)!=this.state.facet(ae.phrases))return this.setState(r);s=ad.create(this,r,e),s.flags|=l;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(d&&(d=d.map(u.changes)),u.scrollIntoView){let{main:f}=u.state.selection;d=new Lo(f.empty?f:T.cursor(f.head,f.head>f.anchor?-1:1))}for(let f of u.effects)f.is(x1)&&(d=f.value.clip(this.state))}this.viewState.update(s,d),this.bidiCache=hd.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(la)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(O1)!=s.state.facet(O1)&&(this.viewState.mustMeasureContent=!0),(t||i||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(Zg))try{u(s)}catch(f){Js(this.state,f,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Ux(this,h)&&c.force&&Po(this.contentDOM,c.key,c.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 r7(e),this.plugins=e.facet(oa).map(i=>new uf(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new W6(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(oa),i=e.state.facet(oa);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new uf(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.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){Js(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:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Yk(i))r=-1,o=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(s);r=f.from,o=f.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(f=>{try{return f.read(this)}catch(p){return Js(this.state,p),c7}}),d=ad.create(this,this.state,[]),u=!1;d.flags|=a,t?t.flags|=a:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),u=this.docView.update(d),u&&this.docViewUpdate());for(let f=0;f<c.length;f++)if(h[f]!=c7)try{let p=c[f];p.write&&p.write(h[f],this)}catch(p){Js(this.state,p)}if(u&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Zg))l(t)}get themeClasses(){return Qg+" "+(this.state.facet(Xg)?Wx:Ix)+" "+this.state.facet(O1)}updateAttrs(){let e=d7(this,Mx,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(zn)?"true":"false",class:"cm-content",style:`${re.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),d7(this,R2,t);let i=this.observer.ignore(()=>{let s=Ug(this.contentDOM,this.contentAttrs,t),r=Ug(this.dom,this.editorAttrs,e);return s||r});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(Le.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(la);let e=this.state.facet(Le.cspNonce);we.mount(this.root,this.styleModules.concat(eq).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 pf(this,e,q6(this,e,t,i))}moveByGroup(e,t){return pf(this,e,q6(this,e,t,i=>kG(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return T.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return vG(this,e,t,i)}moveVertically(e,t,i){return pf(this,e,xG(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(),Vx(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),r=this.bidiSpans(s),o=r[Yn.find(r,e-s.from,-1,t)];return _2(i,o.dir==Kt.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(vx)||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>uq)return px(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||fx(r.isolates,i=I6(this,e))))return r.order;i||(i=I6(this,e));let s=nG(e.text,t,i);return this.bidiCache.push(new hd(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||re.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Zk(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 x1.of(new Lo(typeof e=="number"?T.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 x1.of(new Lo(T.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 eh.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return eh.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=we.newName(),s=[O1.of(i),la.of(em(`.${i}`,e))];return t&&t.dark&&s.push(Xg.of(!0)),s}static baseTheme(e){return Vi.lowest(la.of(em("."+Qg,e,zx)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&ft.get(i)||ft.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}Le.styleModule=la;Le.inputHandler=Sx;Le.scrollHandler=kx;Le.focusChangeEffect=wx;Le.perLineTextDirection=vx;Le.exceptionSink=bx;Le.updateListener=Zg;Le.editable=zn;Le.mouseSelectionStyle=yx;Le.dragMovesSelection=Cx;Le.clickAddsSelectionRange=mx;Le.decorations=th;Le.outerDecorations=Ax;Le.atomicRanges=B2;Le.bidiIsolatedRanges=Dx;Le.scrollMargins=Tx;Le.darkTheme=Xg;Le.cspNonce=P.define({combine:n=>n.length?n[0]:""});Le.contentAttributes=R2;Le.editorAttributes=Mx;Le.lineWrapping=Le.contentAttributes.of({class:"cm-lineWrapping"});Le.announce=ce.define();const uq=4096,c7={};class hd{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:Kt.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!t.touchesRange(o.from,o.to)&&i.push(new hd(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function d7(n,e,t){for(let i=n.state.facet(e),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&zg(o,t)}return t}const fq=!re.ios,u7={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};fq&&(u7[".cm-line"].caretColor=u7[".cm-content"].caretColor="transparent !important");const Al="-10000px";class Kx{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(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(e,t){var i;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;a<r.length;a++){let c=r[a],h=-1;if(c){for(let d=0;d<this.tooltips.length;d++){let u=this.tooltips[d];u&&u.create==c.create&&(h=d)}if(h<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let d=o[a]=this.tooltipViews[h];l&&(l[a]=t[h]),d.update&&d.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return t&&(l.forEach((a,c)=>t[c]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function pq(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Cf=P.define({combine:n=>{var e,t,i;return{position:re.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)||pq}}}),f7=new WeakMap,Gx=eh.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(Cf);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 Kx(n,qx,(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(Cf);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=Al,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=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(re.gecko)i=s.offsetParent!=this.container.ownerDocument.body;else if(s.style.top==Al&&s.style.left=="0px"){let r=s.getBoundingClientRect();i=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((s,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Cf).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:h}=c,d=n.pos[l],u=n.size[l];if(!d||d.bottom<=Math.max(t.top,i.top)||d.top>=Math.min(t.bottom,i.bottom)||d.right<Math.max(t.left,i.left)-.1||d.left>Math.min(t.right,i.right)+.1){h.style.top=Al;continue}let f=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=f?7:0,g=u.right-u.left,b=(e=f7.get(c))!==null&&e!==void 0?e:u.bottom-u.top,y=c.offset||mq,w=this.view.textDirection==Kt.LTR,M=u.width>i.right-i.left?w?i.left:i.right-u.width:w?Math.max(i.left,Math.min(d.left-(f?14:0)+y.x,i.right-g)):Math.min(Math.max(i.left,d.left-g+(f?14:0)-y.x),i.right-g),k=this.above[l];!a.strictSide&&(k?d.top-(u.bottom-u.top)-y.y<i.top:d.bottom+(u.bottom-u.top)+y.y>i.bottom)&&k==i.bottom-d.bottom>d.top-i.top&&(k=this.above[l]=!k);let V=(k?d.top-i.top:i.bottom-d.bottom)-p;if(V<b&&c.resize!==!1){if(V<this.view.defaultLineHeight){h.style.top=Al;continue}f7.set(c,b),h.style.height=(b=V)/r+"px"}else h.style.height&&(h.style.height="");let R=k?d.top-b-p-y.y:d.bottom+p+y.y,H=M+g;if(c.overlap!==!0)for(let W of o)W.left<H&&W.right>M&&W.top<R+b&&W.bottom>R&&(R=k?W.top-b-2-p:W.bottom+p+2);if(this.position=="absolute"?(h.style.top=(R-n.parent.top)/r+"px",h.style.left=(M-n.parent.left)/s+"px"):(h.style.top=R/r+"px",h.style.left=M/s+"px"),f){let W=d.left+(w?y.x:-y.x)-(M+14-7);f.style.left=W/s+"px"}c.overlap!==!0&&o.push({left:M,top:R,right:H,bottom:R+b}),h.classList.toggle("cm-tooltip-above",k),h.classList.toggle("cm-tooltip-below",!k),c.positioned&&c.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=Al}},{eventObservers:{scroll(){this.maybeMeasure()}}}),gq=Le.baseTheme({".cm-tooltip":{zIndex:100,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"}}}),mq={x:0,y:0},qx=P.define({enables:[Gx,gq]}),cd=P.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Ud{static create(e){return new Ud(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Kx(e,cd,(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 Cq=qx.compute([cd],n=>{let e=n.facet(cd);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:Ud.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class yq{constructor(e,t,i,s,r){this.view=e,this.source=t,this.field=i,this.setHover=s,this.hoverTime=r,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,r=1;if(i instanceof V2)s=i.posAtStart;else{if(s=e.posAtCoords(t),s==null)return;let l=e.coordsAtPos(s);if(!l||t.y<l.top||t.y>l.bottom||t.x<l.left-e.defaultCharacterWidth||t.x>l.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(s)).find(h=>h.from<=s&&h.to>=s),c=a&&a.dir==Kt.RTL?-1:1;r=t.x<l.left?-c:c}let o=this.source(e,s,r);if(o!=null&&o.then){let l=this.pending={pos:s};o.then(a=>{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>Js(e.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(Gx),t=e?e.manager.tooltips.findIndex(i=>i.create==Ud.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:r}=this;if(s.length&&r&&!bq(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(i=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!Sq(this.view,o,l,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 V1=4;function bq(n,e){let t=n.getBoundingClientRect();return e.clientX>=t.left-V1&&e.clientX<=t.right+V1&&e.clientY>=t.top-V1&&e.clientY<=t.bottom+V1}function Sq(n,e,t,i,s,r){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.right<i||o.top>s||Math.min(o.bottom,l)<s)return!1;let a=n.posAtCoords({x:i,y:s},!1);return a>=e&&a<=t}function wq(n,e={}){let t=ce.define(),i=qt.define({create(){return[]},update(s,r){if(s.length&&(e.hideOnChange&&(r.docChanged||r.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of s){let a=r.changes.mapPos(l.pos,-1,fe.TrackDel);if(a!=null){let c=Object.assign(Object.create(null),l);c.pos=a,c.end!=null&&(c.end=r.changes.mapPos(c.end)),o.push(c)}}s=o}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(vq)&&(s=[]);return s},provide:s=>cd.from(s)});return[i,eh.define(s=>new yq(s,n,i,t,e.hoverTime||300)),Cq]}const vq=ce.define(),p7=P.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 kq(n,e){let t=n.plugin(Zx),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Zx=eh.fromClass(class{constructor(n){this.input=n.state.facet(tm),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(p7);this.top=new E1(n,!0,e.topContainer),this.bottom=new E1(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(p7);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new E1(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new E1(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(tm);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(n.view),l.push(h)):(h=this.panels[c],h.update&&h.update(n)),s.push(h),(h.top?r:o).push(h)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Le.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class E1{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=g7(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=g7(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 g7(n){let e=n.nextSibling;return n.remove(),e}const tm=P.define({enables:Zx});let hl=class extends Bt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};hl.prototype.elementClass="";hl.prototype.toDOM=void 0;hl.prototype.mapMode=fe.TrackBefore;hl.prototype.startSide=hl.prototype.endSide=-1;hl.prototype.point=!0;class xq{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Ar{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=e,r=i.facet(ih).markerFilter;r&&(s=r(s,i));let o=Tt.set(s.map(l=>l.from==l.to||l.from==l.to-1&&i.doc.lineAt(l.from).to==l.from?Tt.widget({widget:new Pq(l),diagnostic:l}).range(l.from):Tt.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l}).range(l.from,l.to)),!0);return new Ar(o,t,cl(o))}}function cl(n,e=null,t=0){let i=null;return n.between(t,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostic!=e))return i=new xq(s,r,o.diagnostic),!1}),i}function Mq(n,e){let t=e.pos,i=e.end||t,s=n.state.facet(ih).hideOn(n,t,i);if(s!=null)return s;let r=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(jx))||n.changes.touchesRange(r.from,Math.max(r.to,i)))}function Aq(n,e){return n.field(Ui,!1)?e:e.concat(ce.appendConfig.of(Bq))}const jx=ce.define(),F2=ce.define(),Yx=ce.define(),Ui=qt.define({create(){return new Ar(Tt.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 r=e.changes.mapPos(n.selected.from,1);i=cl(t,n.selected.diagnostic,r)||cl(t,null,r)}!t.size&&s&&e.state.facet(ih).autoPanel&&(s=null),n=new Ar(t,s,i)}for(let t of e.effects)if(t.is(jx)){let i=e.state.facet(ih).autoPanel?t.value.length?sh.open:null:n.panel;n=Ar.init(t.value,i,e.state)}else t.is(F2)?n=new Ar(n.diagnostics,t.value?sh.open:null,n.selected):t.is(Yx)&&(n=new Ar(n.diagnostics,n.panel,t.value));return n},provide:n=>[tm.from(n,e=>e.panel),Le.decorations.from(n,e=>e.diagnostics)]}),Dq=Tt.mark({class:"cm-lintRange cm-lintRange-active"});function Tq(n,e,t){let{diagnostics:i}=n.state.field(Ui),s=[],r=2e8,o=0;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:h})=>{e>=a&&e<=c&&(a==c||(e>a||t>0)&&(e<c||t<0))&&(s.push(h.diagnostic),r=Math.min(a,r),o=Math.max(c,o))});let l=n.state.facet(ih).tooltipFilter;return l&&(s=l(s,n.state)),s.length?{pos:r,end:o,above:n.state.doc.lineAt(r).to<o,create(){return{dom:_q(n,s)}}}:null}function _q(n,e){return Xe("ul",{class:"cm-tooltip-lint"},e.map(t=>Xx(n,t,!1)))}const Oq=n=>{let e=n.state.field(Ui,!1);(!e||!e.panel)&&n.dispatch({effects:Aq(n.state,[F2.of(!0)])});let t=kq(n,sh.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},m7=n=>{let e=n.state.field(Ui,!1);return!e||!e.panel?!1:(n.dispatch({effects:F2.of(!1)}),!0)},Vq=n=>{let e=n.state.field(Ui,!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)},Eq=[{key:"Mod-Shift-m",run:Oq,preventDefault:!0},{key:"F8",run:Vq}],ih=P.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},on(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 Jx(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(r=>r.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function Xx(n,e,t){var i;let s=t?Jx(e.actions):[];return Xe("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Xe("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=u=>{if(u.preventDefault(),l)return;l=!0;let f=cl(n.state.field(Ui).diagnostics,e);f&&r.apply(n,f.from,f.to)},{name:c}=r,h=s[o]?c.indexOf(s[o]):-1,d=h<0?c:[c.slice(0,h),Xe("u",c.slice(h,h+1)),c.slice(h+1)];return Xe("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${s[o]})"`}.`},d)}),e.source&&Xe("div",{class:"cm-diagnosticSource"},e.source))}class Pq extends zd{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Xe("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class C7{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Xx(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class sh{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)m7(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:r}=this.items[this.selectedIndex],o=Jx(r.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==s.keyCode){let a=cl(this.view.state.field(Ui).diagnostics,r);a&&r.actions[l].apply(e,a.from,a.to)}}else return;s.preventDefault()},i=s=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(s.target)&&this.moveSelection(r)};this.list=Xe("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:i}),this.dom=Xe("div",{class:"cm-panel-lint"},this.list,Xe("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>m7(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ui).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(Ui),i=0,s=!1,r=null;for(e.between(0,this.view.state.doc.length,(o,l,{spec:a})=>{let c=-1,h;for(let d=i;d<this.items.length;d++)if(this.items[d].diagnostic==a.diagnostic){c=d;break}c<0?(h=new C7(this.view,a.diagnostic),this.items.splice(i,0,h),s=!0):(h=this.items[c],c>i&&(this.items.splice(i,c-i),s=!0)),t&&h.diagnostic==t.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),r=h):h.dom.hasAttribute("aria-selected")&&h.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 C7(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let a=l.height/this.list.offsetHeight;o.top<l.top?this.list.scrollTop-=(l.top-o.top)/a:o.bottom>l.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/a)}})):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(Ui),i=cl(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:Yx.of(i)})}static open(e){return new sh(e)}}function Lq(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 P1(n){return Lq(`<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 Rq=Le.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:P1("#d11")},".cm-lintRange-warning":{backgroundImage:P1("orange")},".cm-lintRange-info":{backgroundImage:P1("#999")},".cm-lintRange-hint":{backgroundImage:P1("#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}}}),Bq=[Ui,Le.decorations.compute([Ui],n=>{let{selected:e,panel:t}=n.field(Ui);return!e||!t||e.from==e.to?Tt.none:Tt.set([Dq.range(e.from,e.to)])}),wq(Tq,{hideOn:Mq}),Rq],Hq=[SR(),kR(),XL(),QF(),jH(),WL(),GL(),ae.allowMultipleSelections.of(!0),RH(),JH(eN,{fallback:!0}),lN(),DK(),NK(),cR(),fR(),nR(),$z(),$C.of([...VK,...iW,...hU,...aI,...KH,...Gk,...Eq])];var y7={};class dd{constructor(e,t,i,s,r,o,l,a,c,h=0,d){this.p=e,this.stack=t,this.state=i,this.reducePos=s,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=h,this.parent=d}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let s=e.parser.context;return new dd(e,[],t,i,i,0,[],0,s?new b7(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,s=e&65535,{parser:r}=this.p;this.reducePos<this.pos-25&&this.setLookAhead(this.pos);let o=r.dynamicPrecedence(s);if(o&&(this.score+=o),i==0){this.pushState(r.getGoto(this.state,s,!0),this.reducePos),s<r.minRepeatTerm&&this.storeNode(s,this.reducePos,this.reducePos,4,!0),this.reduceContext(s,this.reducePos);return}let l=this.stack.length-(i-1)*3-(e&262144?6:0),a=l?this.stack[l-2]:this.p.ranges[0].from,c=this.reducePos-a;c>=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=a,this.p.lastBigReductionSize=c));let h=l?this.stack[l-1]:0,d=this.bufferBase+this.buffer.length-h;if(s<r.minRepeatTerm||e&131072){let u=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(s,a,u,d+4,!0)}if(e&262144)this.state=this.stack[l];else{let u=this.stack[l-3];this.state=r.getGoto(u,s,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(s,a)}storeNode(e,t,i,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==i)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=i;return}}}if(!r||this.pos==i)this.buffer.push(e,t,i,s);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4);this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=i,this.buffer[o+3]=s}}shift(e,t,i,s){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=s,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,s,4);else{let r=e,{parser:o}=this.p;(s>this.pos||t<=o.maxNode)&&(this.pos=s,o.stateFlag(r,1)||(this.reducePos=s)),this.pushState(r,i),this.shiftContext(t,i),t<=o.maxNode&&this.buffer.push(t,i,s,4)}}apply(e,t,i,s){e&65536?this.reduce(e):this.shift(e,t,i,s)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(i,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new dd(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Nq(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let r=0,o;r<t.length;r+=2)(o=t[r+1])!=this.state&&this.p.parser.hasAction(o,e)&&s.push(t[r],o);if(this.stack.length<120)for(let r=0;s.length<8&&r<t.length;r+=2){let o=t[r+1];s.some((l,a)=>a&1&&l==o)||s.push(t[r],o)}t=s}let i=[];for(let s=0;s<t.length&&i.length<4;s+=2){let r=t[s+1];if(r==this.state)continue;let o=this.split();o.pushState(r,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[s],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let i=t>>19,s=t&65535,r=this.stack.length-i*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(s,r)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let a=o&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,r+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new b7(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class b7{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Nq{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}}class ud{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new ud(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}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]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ud(this.stack,this.pos,this.index)}}function L1(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,s=0;i<n.length;){let r=0;for(;;){let o=n.charCodeAt(i++),l=!1;if(o==126){r=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),r+=a,l)break;r*=46}t?t[s++]=r:t=new e(r)}return t}class Mc{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const S7=new Mc;class Fq{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=S7,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,s=this.rangeIndex,r=this.pos+e;for(;r<i.from;){if(!s)return null;let o=this.ranges[--s];r-=i.from-o.to,i=o}for(;t<0?r>i.to:r>=i.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-i.to,i=o}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,s;if(t>=0&&t<this.chunk.length)i=this.pos+e,s=this.chunk.charCodeAt(t);else{let r=this.resolveOffset(e,1);if(r==null)return-1;if(i=r,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),s=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),s}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=S7,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(i+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return i}}class Ro{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;Iq(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Ro.prototype.contextual=Ro.prototype.fallback=Ro.prototype.extend=!1;Ro.prototype.fallback=Ro.prototype.extend=!1;function Iq(n,e,t,i,s,r){let o=0,l=1<<i,{dialect:a}=t.p.parser;e:for(;l&n[o];){let c=n[o+1];for(let f=o+3;f<c;f+=2)if((n[f+1]&l)>0){let p=n[f];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||Wq(p,e.token.value,s,r))){e.acceptToken(p);break}}let h=e.next,d=0,u=n[o+2];if(e.next<0&&u>d&&n[c+u*3-3]==65535){o=n[c+u*3-1];continue e}for(;d<u;){let f=d+u>>1,p=c+f+(f<<1),g=n[p],b=n[p+1]||65536;if(h<g)u=f;else if(h>=b)d=f+1;else{o=n[p+2],e.advance();continue e}}break}}function w7(n,e,t){for(let i=e,s;(s=n[i])!=65535;i++)if(s==t)return i-e;return-1}function Wq(n,e,t,i){let s=w7(t,i,e);return s<0||w7(t,i,n)<s}const Pi=typeof process<"u"&&y7&&/\bparse\b/.test(y7.LOG);let yf=null;function v7(n,e,t){let i=n.cursor(Ht.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class zq{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?v7(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?v7(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],s=this.index[t];if(s==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=i.children[s],o=this.start[t]+i.positions[s];if(o>e)return this.nextStart=o,null;if(r instanceof At){if(o==e){if(o<this.safeFrom)return null;let l=o+r.length;if(l<=this.safeTo){let a=r.prop(Se.lookAhead);if(!a||l+a<this.fragment.to)return r}}this.index[t]++,o+r.length>=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class Uq{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Mc)}getActions(e){let t=0,i=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<r.length;c++){if(!(1<<c&o))continue;let h=r[c],d=this.tokens[c];if(!(i&&!h.fallback)&&((h.contextual||d.start!=e.pos||d.mask!=o||d.context!=l)&&(this.updateCachedToken(d,h,e),d.mask=o,d.context=l),d.lookAhead>d.end+25&&(a=Math.max(d.lookAhead,a)),d.value!=0)){let u=t;if(d.extended>-1&&(t=this.addActions(e,d.extended,d.end,t)),t=this.addActions(e,d.value,d.end,t),!h.extend&&(i=d,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Mc,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Mc,{pos:i,p:s}=e;return t.start=i,t.end=Math.min(i+1,s.stream.end),t.value=i==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,i){let s=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(s,e),i),e.value>-1){let{parser:r}=i.p;for(let o=0;o<r.specialized.length;o++)if(r.specialized[o]==e.value){let l=r.specializers[o](this.stream.read(e.start,e.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,i,s){for(let r=0;r<s;r+=3)if(this.actions[r]==e)return s;return this.actions[s++]=e,this.actions[s++]=t,this.actions[s++]=i,s}addActions(e,t,i,s){let{state:r}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let c=o.stateSlot(r,a?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=hn(l,c+2);else{s==0&&l[c+1]==2&&(s=this.putAction(hn(l,c+2),t,i,s));break}l[c]==t&&(s=this.putAction(hn(l,c+1),t,i,s))}return s}}class $q{constructor(e,t,i,s){this.parser=e,this.input=t,this.ranges=s,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Fq(t,s),this.tokens=new Uq(e,this.stream),this.topTerm=e.top[1];let{from:r}=s[0];this.stacks=[dd.start(this,e.top[0],r)],this.fragments=i.length&&this.stream.end-r>e.bufferLength*4?new zq(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>t)i.push(l);else{if(this.advanceStack(l,i,e))continue;{s||(s=[],r=[]),s.push(l);let a=this.tokens.getMainToken(l);r.push(a.value,a.end)}}break}}if(!i.length){let o=s&&Gq(s);if(o)return Pi&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Pi&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,i);if(o)return Pi&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let l=i[o];for(let a=o+1;a<i.length;a++){let c=i[a];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let s=e.pos,{parser:r}=this,o=Pi?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,h=c?e.curContext.hash:0;for(let d=this.fragments.nodeAt(s);d;){let u=this.parser.nodeSet.types[d.type.id]==d.type?r.getGoto(e.state,d.type.id):-1;if(u>-1&&d.length&&(!c||(d.prop(Se.contextHash)||0)==h))return e.useNode(d,u),Pi&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(d.type.id)})`),!0;if(!(d instanceof At)||d.children.length==0||d.positions[0]>0)break;let f=d.children[0];if(f instanceof At&&d.positions[0]==0)d=f;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Pi&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let h=a[c++],d=a[c++],u=a[c++],f=c==a.length||!i,p=f?e:e.split(),g=this.tokens.mainToken;if(p.apply(h,d,g?g.start:p.pos,u),Pi&&console.log(o+this.stackID(p)+` (via ${h&65536?`reduce of ${r.getName(h&65535)}`:"shift"} for ${r.getName(d)} @ ${s}${p==e?"":", split"})`),f)return!0;p.pos>s?t.push(p):i.push(p)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return k7(e,t),!0}}runRecovery(e,t,i){let s=null,r=!1;for(let o=0;o<e.length;o++){let l=e[o],a=t[o<<1],c=t[(o<<1)+1],h=Pi?this.stackID(l)+" -> ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),Pi&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let d=l.split(),u=h;for(let f=0;d.forceReduce()&&f<10&&(Pi&&console.log(u+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,i));f++)Pi&&(u=this.stackID(d)+" -> ");for(let f of l.recoverByInsert(a))Pi&&console.log(h+this.stackID(f)+" (via recover-insert)"),this.advanceFully(f,i);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),Pi&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),k7(l,i)):(!s||s.score<l.score)&&(s=l)}return s}stackToTree(e){return e.close(),At.build({buffer:ud.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(yf||(yf=new WeakMap)).get(e);return t||yf.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function k7(n,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==n.pos&&i.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class Kq{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}class fd extends ty{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;l<e.repeatNodeCount;l++)t.push("");let i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),s=[];for(let l=0;l<t.length;l++)s.push([]);function r(l,a,c){s[l].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=Se[a]);for(let c=1;c<l.length;){let h=l[c++];if(h>=0)r(h,a,l[c++]);else{let d=l[c+-h];for(let u=-h;u>0;u--)r(l[c++],a,d);c++}}}this.nodeSet=new Bm(t.map((l,a)=>Oi.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:s[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=JC;let o=L1(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(x7),this.states=L1(e.states,Uint32Array),this.data=L1(e.stateData),this.goto=L1(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Ro(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let s=new $q(this,e,t,i);for(let r of this.wrappers)s=r(s,e,t,i);return s}getGoto(e,t,i=!1){let s=this.goto;if(t>=s[0])return-1;for(let r=s[t+1];;){let o=s[r++],l=o&1,a=s[r++];if(l&&i)return a;for(let c=r+(o>>1);r<c;r++)if(s[r]==e)return a;if(l)return-1}}hasAction(e,t){let i=this.data;for(let s=0;s<2;s++)for(let r=this.stateSlot(e,s?2:1),o;;r+=3){if((o=i[r])==65535)if(i[r+1]==1)o=i[r=hn(i,r+2)];else{if(i[r+1]==2)return hn(i,r+2);break}if(o==t||o==0)return hn(i,r+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),s=i?t(i):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=hn(this.data,r+2);else break;s=t(hn(this.data,r+1))}return s}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=hn(this.data,i+2);else break;if(!(this.data[i+2]&1)){let s=this.data[i+1];t.some((r,o)=>o&1&&r==s)||t.push(this.data[i],s)}}return t}configure(e){let t=Object.assign(Object.create(fd.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let s=e.tokenizers.find(r=>r.from==i);return s?s.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,s)=>{let r=e.specializers.find(l=>l.from==i.external);if(!r)return i;let o=Object.assign(Object.assign({},i),{external:r.to});return t.specializers[s]=x7(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let r of e.split(" ")){let o=t.indexOf(r);o>=0&&(i[o]=!0)}let s=null;for(let r=0;r<t.length;r++)if(!i[r])for(let o=this.dialects[t[r]],l;(l=this.data[o++])!=65535;)(s||(s=new Uint8Array(this.maxTerm+1)))[l]=1;return new Kq(e,i,s)}static deserialize(e){return new fd(e)}}function hn(n,e){return n[e]|n[e+1]<<16}function Gq(n){let e=null;for(let t of n){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function x7(n){if(n.external){let e=n.extend?1:0;return(t,i)=>n.external(t,i)<<1|e}return n.get}const qq=ab({String:Y.string,Number:Y.number,"True False":Y.bool,PropertyName:Y.propertyName,Null:Y.null,",":Y.separator,"[ ]":Y.squareBracket,"{ }":Y.brace}),Zq=fd.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[qq],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),jq=Hc.define({name:"json",parser:Zq.configure({props:[ub.add({Object:s3({except:/^\s*\}/}),Array:s3({except:/^\s*\]/})}),pb.add({"Object Array":HH})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Yq(){return new MH(jq)}function Jq(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function I2(n){return n.nodeType==3?Qx(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function M7(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Xq(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function W2(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Qq(n){let e=n.ownerDocument;for(let t=n.parentNode;t&&t!=e.body;)if(t.nodeType==1){if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}let ao=null;function eZ(n){if(n.setActive)return n.setActive();if(ao)return n.focus(ao);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(ao==null?{get preventScroll(){return ao={preventScroll:!0},!0}}:void 0),!ao){ao=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let A7;function Qx(n,e,t=e){let i=A7||(A7=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function eM(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}class kn{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new kn(e.parentNode,M7(e),t)}static after(e,t){return new kn(e.parentNode,M7(e)+1,t)}}const tM=[];class Ss{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,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=Ss.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=D7(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=D7(r)}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=Xq(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!Ss.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,h=i;a<this.children.length;a++){let d=this.children[a],u=c+d.length;if(c<e&&u>t)return d.domBoundsAround(e,t,c);if(u>=e&&s==-1&&(s=a,r=c),c>t&&d.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+d.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].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=tM){this.markDirty();for(let s=e;s<t;s++){let r=this.children[s];r.parent==this&&i.indexOf(r)<0&&r.destroy()}this.children.splice(e,t-e,...i);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 tZ(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,r,o){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}}Ss.prototype.breakAfter=0;function D7(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class tZ{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 iZ(n,e,t,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[e]:null,d=r.length?r[r.length-1]:null,u=d?d.breakAfter:o;if(!(e==i&&h&&!o&&!u&&r.length<2&&h.merge(t,s,r.length?d:null,t==0,l,a))){if(i<c.length){let f=c[i];f&&(s<f.length||f.breakAfter&&(d!=null&&d.breakAfter))?(e==i&&(f=f.split(s),s=0),!u&&d&&f.merge(0,s,d,!0,0,a)?r[r.length-1]=f:((s||f.children.length&&!f.children[0].length)&&f.merge(0,s,null,!1,0,a),r.push(f))):f!=null&&f.breakAfter&&(d?d.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,t>0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[e].become(r[0]))e++,r.shift(),l=r.length?0:a;else break;!r.length&&e&&i<c.length&&!c[e-1].breakAfter&&c[i].merge(0,0,c[e-1],!1,l,a)&&e--,(e<i||r.length)&&n.replaceChildren(e,i,r)}}function iM(n,e,t,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),d=e-t;for(let u of i)d+=u.length;n.length+=d,iZ(n,c,h,l,a,i,0,s,r)}let zi=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},im=typeof document<"u"?document:{documentElement:{style:{}}};const sm=/Edge\/(\d+)/.exec(zi.userAgent),sM=/MSIE \d/.test(zi.userAgent),nm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zi.userAgent),$d=!!(sM||nm||sm),T7=!$d&&/gecko\/(\d+)/i.test(zi.userAgent),bf=!$d&&/Chrome\/(\d+)/.exec(zi.userAgent),_7="webkitFontSmoothing"in im.documentElement.style,nM=!$d&&/Apple Computer/.test(zi.vendor),O7=nM&&(/Mobile\/\w+/.test(zi.userAgent)||zi.maxTouchPoints>2);var Ft={mac:O7||/Mac/.test(zi.platform),windows:/Win/.test(zi.platform),linux:/Linux|X11/.test(zi.platform),ie:$d,ie_version:sM?im.documentMode||6:nm?+nm[1]:sm?+sm[1]:0,gecko:T7,gecko_version:T7?+(/Firefox\/(\d+)/.exec(zi.userAgent)||[0,0])[1]:0,chrome:!!bf,chrome_version:bf?+bf[1]:0,ios:O7,android:/Android\b/.test(zi.userAgent),webkit:_7,safari:nM,webkit_version:_7?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:im.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const sZ=256;class dl extends Ss{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 dl)||this.length-(t-e)+i.length>sZ||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 dl(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 kn(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 nZ(this.dom,e,t)}}class ul extends Ss{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(eM(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,r,o){return i&&(!(i instanceof ul&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(iM(this,e,t,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>e&&t.push(i<e?l.split(e-i):l),s<0&&i>=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new ul(this.mark,t,o)}domAtPos(e){return rM(this,e)}coordsAt(e,t){return lM(this,e,t)}}function nZ(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?Ft.chrome||Ft.gecko||(e?(s--,o=1):r<i&&(r++,o=-1)):t<0?s--:r<i&&r++;let l=Qx(n,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return Ft.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?W2(a,o<0):a||null}class yo extends Ss{static create(e,t,i){return new yo(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=yo.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,r,o){return i&&(!(i instanceof yo)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof yo&&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 $.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):$.empty}domAtPos(e){return(this.length?e==0:this.side>0)?kn.before(this.dom):kn.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(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top<r.bottom);l+=o?-1:1);return W2(r,!o)}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 pd extends Ss{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof pd&&e.side==this.side}split(){return new pd(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?kn.before(this.dom):kn.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return $.empty}get isHidden(){return!0}}dl.prototype.children=yo.prototype.children=pd.prototype.children=tM;function rM(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new kn(t,0)}function oM(n,e,t){let i,{children:s}=n;t>0&&e instanceof ul&&s.length&&(i=s[s.length-1])instanceof ul&&i.mark.eq(e.mark)?oM(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function lM(n,e,t){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let d=0,u=0;d<c.children.length&&u<=h;d++){let f=c.children[d],p=u+f.length;p>=h&&(f.children.length?l(f,h-u):(!r||r.isHidden&&t>0)&&(p>h||u==p&&f.getSide()>0)?(r=f,o=h-u):(u<h||u==p&&f.getSide()<0&&!f.isHidden)&&(i=f,s=h-u)),u=p}}l(n,e);let a=(t<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?s:o),t):rZ(n)}function rZ(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=I2(e);return t[t.length-1]||null}function V7(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 E7=Object.create(null);function z2(n,e,t){if(n==e)return!0;n||(n=E7),e||(e=E7);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 r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function oZ(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}class Bo extends Ss{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof Bo))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),iM(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new Bo;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 r=i;r<this.children.length;r++)t.append(this.children[r],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){z2(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){oM(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=V7(t,this.attrs||{})),i&&(this.attrs=V7({class:i},this.attrs||{}))}domAtPos(e){return rM(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(eM(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&&(oZ(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&&Ss.get(s)instanceof ul;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=Ss.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!Ft.ios||!this.children.some(r=>r instanceof dl))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof dl)||/[^ -~]/.test(i.text))return null;let s=I2(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=lM(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight<r){let o=(r-s.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(e){return!1}covers(){return!0}static find(e,t){for(let i=0,s=0;i<e.children.length;i++){let r=e.children[i],o=s+r.length;if(o>=t){if(r instanceof Bo)return r;if(o>t)break}s=o+r.breakAfter}return null}}class aM{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 Ma=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Ma||(Ma={}));class gn extends Bt{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 Kd(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 nh(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:r,end:o}=hM(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new nh(e,i,s,t,e.widget||null,!0)}static line(e){return new Ch(e)}static set(e,t=!1){return K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}gn.none=K.empty;class Kd extends gn{constructor(e){let{start:t,end:i}=hM(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 Kd&&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))&&z2(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)}}Kd.prototype.point=!1;class Ch extends gn{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ch&&this.spec.class==e.spec.class&&z2(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)}}Ch.prototype.mapMode=fe.TrackBefore;Ch.prototype.point=!0;class nh extends gn{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?fe.TrackBefore:fe.TrackAfter:fe.TrackDel}get type(){return this.startSide!=this.endSide?Ma.WidgetRange:this.startSide<=0?Ma.WidgetBefore:Ma.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof nh&&lZ(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)}}nh.prototype.point=!0;function hM(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 lZ(n,e){return n==e||!!(n&&e&&n.compare(e))}class gd extends aM{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}}gd.inline=new gd("span");gd.block=new gd("div");var md=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(md||(md={}));md.LTR;md.RTL;const P7=Object.create(null);for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);P7[e]=t,P7[t]=-e}const aZ=P.define(),hZ=P.define(),cZ=P.define(),dZ=P.define();let uZ=0;const fZ=P.define();class Cd{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new Cd(uZ++,e,i,s,l=>{let a=[fZ.of(l)];return o&&a.push(pZ.of(c=>{let h=c.plugin(l);return h?o(h):gn.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return Cd.define(i=>new e(i),t)}}const pZ=P.define(),gZ=P.define(),mZ=P.define();function CZ(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(mZ)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}function yZ(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return T.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=de(s.text,r,!1):l=de(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=de(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=de(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return T.range(o+s.from,l+s.from)}function Sf(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}const bZ=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],R1=6;function B1(n){return Math.max(0,n)*.7+8}function SZ(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class wZ{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.scrollParent=Qq(e.contentDOM),this.atoms=e.state.facet(gZ).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ae.allowMultipleSelections)&&vZ(e,t),this.dragging=xZ(e,t)&&fM(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&SZ(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=CZ(this.view);e.clientX-o.left<=r.left+R1?i=-B1(r.left-e.clientX):e.clientX+o.right>=r.right-R1&&(i=B1(e.clientX-r.right)),e.clientY-o.top<=r.top+R1?s=-B1(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-R1&&(s=B1(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}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(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),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],r=null;if(s.empty){let o=Sf(this.atoms,s.from,0);o!=s.from&&(r=T.cursor(o,-1))}else{let o=Sf(this.atoms,s.from,-1),l=Sf(this.atoms,s.to,1);(o!=s.from||l!=s.to)&&(r=T.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?T.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){this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function vZ(n,e){let t=n.state.facet(aZ);return t.length?t[0](e):Ft.mac?e.metaKey:e.ctrlKey}function kZ(n,e){let t=n.state.facet(hZ);return t.length?t[0](e):Ft.mac?!e.altKey:!e.ctrlKey}function xZ(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Jq(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}const xn=Object.create(null),rn=Object.create(null),cM=Ft.ie&&Ft.ie_version<15||Ft.ios&&Ft.webkit_version<604;function MZ(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(),dM(n,t.value)},50)}function dM(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(rm!=null&&t.selection.ranges.every(a=>a.empty)&&rm==r.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let d=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:d},range:T.cursor(c.from+d.length)}})}else o?i=t.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:T.cursor(a.from+c.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}rn.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};xn.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);rn.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};rn.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};xn.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(cZ))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=TZ(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new wZ(n,e,t,i)),i&&n.observer.ignore(()=>eZ(n.contentDOM));let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function L7(n,e,t,i){if(i==1)return T.cursor(e,t);if(i==2)return yZ(n.state,e,t);{let s=Bo.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,T.range(o,l)}}let uM=(n,e)=>n>=e.top&&n<=e.bottom,R7=(n,e,t)=>uM(e,t)&&n>=t.left&&n<=t.right;function AZ(n,e,t,i){let s=Bo.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&R7(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&R7(t,i,l)?1:o&&uM(i,o)?-1:1}function B7(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:AZ(n,t,e.clientX,e.clientY)}}const DZ=Ft.ie&&Ft.ie_version<=11;let H7=null,N7=0,F7=0;function fM(n){if(!DZ)return n.detail;let e=H7,t=F7;return H7=n,F7=Date.now(),N7=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(N7+1)%3:1}function TZ(n,e){let t=B7(n,e),i=fM(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=B7(n,r),c,h=L7(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let d=L7(n,t.pos,t.bias,i),u=Math.min(d.from,h.from),f=Math.max(d.to,h.to);h=u<h.from?T.range(u,f):T.range(f,u)}return o?s.replaceRange(s.main.extend(h.from,h.to)):l&&i==1&&s.ranges.length>1&&(c=_Z(s,a.pos))?c:l?s.addRange(h):T.create([h])}}}function _Z(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 T.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}xn.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 r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=T.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};xn.dragend=n=>(n.inputState.draggedContent=null,!1);function I7(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&kZ(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}xn.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,r=()=>{++s==t.length&&I7(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return I7(n,e,i,!0),!0}return!1};xn.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=cM?null:e.clipboardData;return t?(dM(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(MZ(n),!1)};function OZ(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 VZ(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:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let rm=null;xn.copy=xn.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=VZ(n.state);if(!t&&!s)return!1;rm=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=cM?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(OZ(n,t),!1)};const EZ=gi.define();function PZ(n,e){let t=[];for(let i of n.facet(dZ)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:EZ.of(!0)}):null}function pM(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=PZ(n.state,e);t?n.dispatch(t):n.update([])}},10)}rn.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),pM(n)};rn.blur=n=>{n.observer.clearSelectionRange(),pM(n)};rn.compositionstart=rn.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};rn.compositionend=n=>{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,Ft.chrome&&Ft.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};rn.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};xn.beforeinput=(n,e)=>{var t;let i;if(Ft.chrome&&Ft.android&&(i=bZ.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Ft.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Ft.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>rn.compositionend(n,e),20),!1};class LZ extends aM{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?I2(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=W2(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function RZ(n){return Cd.fromClass(class{constructor(e){this.view=e,this.placeholder=n?gn.set([gn.widget({widget:new LZ(n),side:1}).range(0)]):gn.none}get decorations(){return this.view.state.doc.length?gn.none:this.placeholder}},{decorations:e=>e.decorations})}class fl extends Bt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}fl.prototype.elementClass="";fl.prototype.toDOM=void 0;fl.prototype.mapMode=fe.TrackBefore;fl.prototype.startSide=fl.prototype.endSide=-1;fl.prototype.point=!0;const BZ={props:{editorId:{type:String,required:!0},language:{type:String,default(){return"json"}},placeholder:{type:String,default(){return""}},value:{type:String,default(){return""}},readonly:{type:Boolean,default(){return!1}}},data(){return{editorInstance:null}},computed:{languageExtension(){switch(this.language){case"json":default:return Yq()}}},mounted(){const n=this,e=[Hq,this.languageExtension,Pe.domEventHandlers({paste(t,i){n.$emit("paste",{event:t,editorView:i})},blur(t,i){n.$emit("blur",{event:t,editorView:i})},input(t,i){n.$emit("change",i.viewState.state.doc.toString())}}),RZ(n.placeholder)];this.readonly&&e.push(Pe.editable.of(!1)),this.$nextTick(()=>{this.editorInstance=new Pe({doc:this.value,extensions:e,parent:document.getElementById(n.editorId)})})}},HZ=["id"];function NZ(n,e,t,i,s,r){return v(),L("div",{id:t.editorId,class:"aioseo-code-editor"},null,8,HZ)}const gM=Z(BZ,[["render",NZ]]),FZ={class:"custom-schema"},IZ={class:"main"},WZ={class:"header"},zZ=["innerHTML"],UZ={class:"custom-schema-editor-container"},$Z={key:0,class:"buttons add-custom-schema"},KZ=A("div",{class:"left"},null,-1),GZ={class:"right"},qZ={key:1,class:"buttons edit-custom-schema"},ZZ={class:"left"},jZ={class:"right"},YZ={key:2,class:"buttons edit-custom-template"},JZ={class:"left"},XZ={class:"right"},QZ={__name:"Custom",setup(n){const e="aioseo-pro",t=Ie(),i=Ze(""),s=Ze(!1),r=Ze(null),o=Ze(""),l=Ze(""),a=Ze(0),c={schemaJson:C("Schema (JSON-LD Format)",e),tooltipDescription:j(C("Our custom schema only works with the JSON-LD format. This gives a detailed description of what your page is all about. Search engines can then use this data to understand your site better and provide more relevant search results and rich snippets. %1$s",e),be.getDocLink(St.learnMore,"schemaJsonLd",!0)),placeholder:C("Enter a name for your custom schema graph...",e),editorPlaceholder:C("Enter your JSON schema here...",e),addSchema:C("Add Schema",e),updateSchema:C("Update Schema",e),deleteSchema:C("Delete Schema",e),saveAsTemplate:C("Save as Template",e),deleteTemplate:C("Delete Template",e),updateTemplate:C("Update Template",e),errors:{invalidJson:C("The text you've entered is not valid JSON. Please enter valid JSON schema.",e)},modal:{graphDelete:{areYouSure:C("Are you sure you want to delete this custom schema?",e),actionCannotBeUndone:C("This action cannot be undone.",e),confirmation:C("Yes, I want to delete this custom schema",e),noChangedMind:C("No, I changed my mind",e)},templateDelete:{areYouSure:C("Are you sure you want to delete this template?",e),actionCannotBeUndone:C("This action cannot be undone.",e),confirmation:C("Yes, I want to delete this template",e),noChangedMind:C("No, I changed my mind",e)}}},h=xe({get(){return t.isEditingCustomGraph||t.isEditingCustomTemplate?t.graph.graphName:t.custom.graphName},set(M){if(t.isEditingCustomGraph||t.isEditingCustomTemplate){t.graph.graphName=M;return}t.custom.graphName=M}}),d=xe({get(){return t.isEditingCustomGraph||t.isEditingCustomTemplate?t.graph.schema:t.custom.schema},set(M){if(t.isEditingCustomGraph||t.isEditingCustomTemplate){t.graph.schema=M;return}t.custom.schema=M}}),u=xe(()=>{switch(i.value){case"deleteCustomGraph":return c.modal.graphDelete;case"deleteTemplate":return c.modal.templateDelete;default:return{}}}),f=xe(()=>(!d.value||!h.value||o.value.length)!==0),p=()=>{if(o.value="",l.value="",!d.value)return;let M=null;try{const k=new RegExp("(<[^>]+>|</[^>]+>)","igm");d.value=d.value.replace(k,""),M=JSON.parse(d.value)}catch{l.value=this.strings.errors.invalidJson;return}M["@context"]&&delete M["@context"],M["@type"]&&!t.custom.graphName&&(t.custom.graphName=M["@type"]),d.value=JSON.stringify(M,null," ").trim(),r.value.$data.editorInstance.viewState.state.doc.toString()!==d.value&&r.value.$data.editorInstance.dispatch({changes:{from:0,to:r.value.$data.editorInstance.viewState.state.doc.length,insert:d.value}})},g=()=>{Jn(()=>{const M=r.value.$data.editorInstance.viewState.state.doc.toString();d.value=M,p()})},b=()=>{d.value=r.value.$data.editorInstance.viewState.state.doc.toString(),p(),o.value=l.value},y=M=>{i.value=M,s.value=!0},w=()=>{switch(s.value=!1,a.value++,i.value){case"deleteCustomGraph":t.deleteCustomGraph();break;case"deleteTemplate":t.deleteTemplate();break}i.value=""};return(M,k)=>{const V=x("base-input"),R=x("base-button");return v(),L("div",FZ,[A("div",IZ,[A("div",WZ,[A("span",null,D(c.schemaJson),1),m(_(qe),null,{tooltip:S(()=>[A("span",{innerHTML:c.tooltipDescription},null,8,zZ)]),default:S(()=>[m(_(yr))]),_:1})]),m(V,{class:"template-name",size:"medium",prependIcon:"custom-schema",modelValue:h.value,"onUpdate:modelValue":k[0]||(k[0]=H=>h.value=H),placeholder:c.placeholder},null,8,["modelValue","placeholder"]),A("div",UZ,[o.value?(v(),E(_(wt),{key:0,type:"red"},{default:S(()=>[B(D(o.value),1)]),_:1})):O("",!0),m(_(gM),{ref_key:"customSchemaEditor",ref:r,editorId:"custom-schema-editor",placeholder:c.editorPlaceholder,value:d.value,onChange:k[1]||(k[1]=H=>d.value=H),onPaste:g,onBlur:b},null,8,["placeholder","value"])]),!_(t).isEditingCustomGraph&&!_(t).isEditingCustomTemplate?(v(),L("div",$Z,[KZ,A("div",GZ,[m(R,{class:"medium",type:"gray",onClick:k[2]||(k[2]=H=>_(t).addCustomAsTemplate()),disabled:f.value},{default:S(()=>[B(D(c.saveAsTemplate),1)]),_:1},8,["disabled"]),m(R,{class:"medium",type:"blue",onClick:k[3]||(k[3]=H=>_(t).addCustomAsGraph()),disabled:f.value},{default:S(()=>[B(D(c.addSchema),1)]),_:1},8,["disabled"])])])):O("",!0),_(t).isEditingCustomGraph?(v(),L("div",qZ,[A("div",ZZ,[m(R,{class:"medium",type:"red",onClick:k[4]||(k[4]=H=>y("deleteCustomGraph"))},{default:S(()=>[B(D(c.deleteSchema),1)]),_:1})]),A("div",jZ,[m(R,{class:"medium",type:"gray",onClick:k[5]||(k[5]=H=>_(t).addGraphAsTemplate()),disabled:f.value},{default:S(()=>[B(D(c.saveAsTemplate),1)]),_:1},8,["disabled"]),m(R,{class:"medium",type:"blue",onClick:k[6]||(k[6]=H=>_(t).updateCustomGraph()),disabled:f.value},{default:S(()=>[B(D(c.updateSchema),1)]),_:1},8,["disabled"])])])):O("",!0),_(t).isEditingCustomTemplate?(v(),L("div",YZ,[A("div",JZ,[m(R,{class:"medium",type:"red",onClick:k[7]||(k[7]=H=>y("deleteTemplate"))},{default:S(()=>[B(D(c.deleteTemplate),1)]),_:1})]),A("div",XZ,[m(R,{class:"medium",type:"gray",onClick:k[8]||(k[8]=H=>_(t).updateTemplate()),disabled:f.value},{default:S(()=>[B(D(c.updateTemplate),1)]),_:1},8,["disabled"]),m(R,{class:"medium",type:"blue",onClick:k[9]||(k[9]=H=>_(t).addCustomTemplateAsGraph()),disabled:f.value},{default:S(()=>[B(D(c.addSchema),1)]),_:1},8,["disabled"])])])):O("",!0)]),(v(),E(_(km),{show:s.value,strings:u.value,onDoAction:w,onCloseModal:k[10]||(k[10]=H=>s.value=!1),key:"confirmationModal"+a.value},null,8,["show","strings"]))])}}},ej={components:{CoreTooltip:qe,SvgCircleQuestionMark:yr},props:{header:{type:String,required:!0},headerTooltip:{type:String,required:!1}}},tj={class:"aioseo-schema-field-group"},ij={class:"header"},sj={class:"header-title"},nj={class:"fields"},rj={key:0,class:"footer"};function oj(n,e,t,i,s,r){const o=x("svg-circle-question-mark"),l=x("core-tooltip");return v(),L("section",tj,[A("div",ij,[A("span",sj,[B(D(t.header)+" ",1),t.headerTooltip?(v(),E(l,{key:0},{tooltip:S(()=>[B(D(t.headerTooltip),1)]),default:S(()=>[m(o)]),_:1})):O("",!0)]),qi(n.$slots,"header-extra")]),A("div",nj,[qi(n.$slots,"default")]),n.$slots.footer?(v(),L("div",rj,[qi(n.$slots,"footer")])):O("",!0)])}const Zt=Z(ej,[["render",oj]]),Et="aioseo-pro",lj={setup(){const{isEditing:n}=ch(),{getJsonValue:e,setJsonValue:t}=Sr(),{initSchemaEditor:i}=gt();return{GLOBAL_STRINGS:St,dateJsToLocal:Ds,dateStringToLocalJs:Ts,getJsonValue:e,initSchemaEditor:i,isEditing:n,postEditorStore:Te(),schemaStore:Ie(),setJsonValue:t}},components:{BaseDatePicker:_s,BaseRadio:hh,BaseRadioToggle:br,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt},data(){return{strings:{type:C("Type",Et),article:C("Article",Et),blogPosting:C("Blog Post",Et),newsArticle:C("News Article",Et),name:C("Name",Et),headline:C("Headline",Et),description:C("Description",Et),author:C("Author",Et),url:C("URL",Et),keywords:C("Keywords",Et),placeholder:C("Type to enter a keyword...",Et),tagPlaceholder:C("Press enter to create a keyword",Et),dates:C("Dates",Et),includeDates:C("Include Dates",Et),includeDatesDescription:C("Disable this setting to prevent search engines from including dates in their search results.",Et),datePublished:C("Date Published",Et),dateModified:C("Date Modified",Et),image:C("Image",Et)}}},beforeMount(){const n={id:"#aioseo-article-"+new Date().getTime().toString(36),slug:"article",graphName:"Article",label:C("Article",Et),properties:{type:this.schemaStore.isEditingDefaultGraph?this.postEditorStore.currentPost.schema.default.graphName:"Article",name:"#post_title",headline:"#post_title",description:"",image:"",keywords:"",author:{name:"#author_name",url:"#author_url"},dates:{include:!0,datePublished:"",dateModified:""}}};this.initSchemaEditor(n)},async mounted(){this.schemaStore.graph.id||await xd().then(n=>{var e;(e=this.schemaStore.graph)!=null&&e.properties&&(this.schemaStore.graph.properties.image=n,this.$nextTick(()=>{this.schemaStore.isDirty=!1}))})}},aj={class:"graph-editor-fields graph-article"},hj={class:"aioseo-description"};function cj(n,e,t,i,s,r){const o=x("base-radio"),l=x("core-settings-row"),a=x("core-html-tags-editor"),c=x("core-image-uploader"),h=x("base-select"),d=x("field-group"),u=x("base-radio-toggle"),f=x("base-date-picker");return v(),L("div",aj,[i.schemaStore.isEditingDefaultGraph?O("",!0):(v(),E(l,{key:0,name:s.strings.type},{content:S(()=>[m(o,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.type==="Article","onUpdate:modelValue":e[0]||(e[0]=p=>i.schemaStore.graph.properties.type="Article"),type:2},{default:S(()=>[B(D(s.strings.article),1)]),_:1},8,["modelValue"]),m(o,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.type==="BlogPosting","onUpdate:modelValue":e[1]||(e[1]=p=>i.schemaStore.graph.properties.type="BlogPosting"),type:2},{default:S(()=>[B(D(s.strings.blogPosting),1)]),_:1},8,["modelValue"]),m(o,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.type==="NewsArticle","onUpdate:modelValue":e[2]||(e[2]=p=>i.schemaStore.graph.properties.type="NewsArticle"),type:2},{default:S(()=>[B(D(s.strings.newsArticle),1)]),_:1},8,["modelValue"])]),_:1},8,["name"])),m(l,{name:s.strings.name},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[3]||(e[3]=p=>i.schemaStore.graph.properties.name=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.headline},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.headline,"onUpdate:modelValue":e[4]||(e[4]=p=>i.schemaStore.graph.properties.headline=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[5]||(e[5]=p=>i.schemaStore.graph.properties.description=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"top","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[6]||(e[6]=p=>i.schemaStore.graph.properties.image=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.keywords,align:""},{content:S(()=>[m(h,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.keywords)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.keywords)||[],"onUpdate:modelValue":e[7]||(e[7]=p=>i.schemaStore.graph.properties.keywords=i.setJsonValue(p)),placeholder:s.strings.placeholder,"tag-placeholder":s.strings.tagPlaceholder},null,8,["options","modelValue","placeholder","tag-placeholder"])]),_:1},8,["name"]),m(d,{header:s.strings.author},{default:S(()=>[m(l,{name:s.strings.name},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.author.name,"onUpdate:modelValue":e[8]||(e[8]=p=>i.schemaStore.graph.properties.author.name=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"top","default-tags":["author_name","author_first_name","author_last_name"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.author.url,"onUpdate:modelValue":e[9]||(e[9]=p=>i.schemaStore.graph.properties.author.url=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"top","default-tags":["author_url"],tagsDescription:"","disable-emoji":""},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(d,{header:s.strings.dates},{default:S(()=>[m(l,{name:s.strings.includeDates,align:""},{content:S(()=>[m(u,{name:"includeDates",modelValue:i.schemaStore.graph.properties.dates.include,"onUpdate:modelValue":e[10]||(e[10]=p=>i.schemaStore.graph.properties.dates.include=p),options:[{label:i.GLOBAL_STRINGS.no,value:!1,activeClass:"dark"},{label:i.GLOBAL_STRINGS.yes,value:!0}]},null,8,["modelValue","options"]),A("div",hj,D(s.strings.includeDatesDescription),1)]),_:1},8,["name"]),i.schemaStore.graph.properties.dates.include?(v(),E(l,{key:0,name:s.strings.datePublished,align:""},{content:S(()=>[m(f,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.dates.datePublished),onChange:e[11]||(e[11]=p=>i.schemaStore.graph.properties.dates.datePublished=i.dateJsToLocal(p,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"])):O("",!0),i.schemaStore.graph.properties.dates.include?(v(),E(l,{key:1,name:s.strings.dateModified,align:""},{content:S(()=>[m(f,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.dates.dateModified),onChange:e[12]||(e[12]=p=>i.schemaStore.graph.properties.dates.dateModified=i.dateJsToLocal(p,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"])):O("",!0)]),_:1},8,["header"])])}const dj=Z(lj,[["render",cj]]),W7="aioseo-pro",uj={components:{FieldGroup:Zt},props:{groupProp:{type:Array,required:!0},defaults:{type:Object,required:!0},pluralName:{type:String,required:!0},singularName:{type:String,required:!0},maxGroups:{type:Number,default(){return 50}},headerTooltip:{type:String,required:!1}},data(){return{strings:{delete:C("Delete",W7)}}},computed:{addLink(){return j(C("Add Another %1$s",W7),this.singularName)},showLink(){return this.singularName?!this.groupProp.length||!this.maxGroups?!0:this.groupProp.length<this.maxGroups:!1}},methods:{addGroup(){const n=JSON.parse(JSON.stringify(this.defaults));this.groupProp.push(n)},deleteGroup(n){this.groupProp.splice(n,1)}},beforeMount(){this.groupProp.forEach((n,e)=>{const t=JSON.parse(JSON.stringify(this.defaults));this.groupProp[e]=J7(t,n)})}},fj={class:"header"},pj={class:"header-title"},gj={class:"fields-inner"};function mj(n,e,t,i,s,r){const o=x("base-button"),l=x("field-group");return v(),E(l,{class:"aioseo-schema-field-group-repeater",header:t.pluralName,headerTooltip:t.headerTooltip},{"header-extra":S(()=>[r.showLink?(v(),L("a",{key:0,href:"#",onClick:e[0]||(e[0]=Dt((...a)=>r.addGroup&&r.addGroup(...a),["prevent"]))},D(r.addLink),1)):O("",!0)]),footer:S(()=>[r.showLink?(v(),L("a",{key:0,href:"#",onClick:e[1]||(e[1]=Dt((...a)=>r.addGroup&&r.addGroup(...a),["prevent"]))},D(r.addLink),1)):O("",!0)]),default:S(()=>[(v(!0),L(xt,null,_i(t.groupProp,(a,c)=>(v(),L("section",{class:"aioseo-schema-field-group-repeater-inner",key:c},[A("div",fj,[A("span",pj,D(t.singularName+" "+(c+1)),1),t.groupProp.length>1?(v(),E(o,{key:0,class:"small",type:"gray",onClick:Dt(h=>r.deleteGroup(c),["prevent"])},{default:S(()=>[B(D(s.strings.delete),1)]),_:2},1032,["onClick"])):O("",!0)]),A("div",gj,[qi(n.$slots,"fields-inner",{groupIndex:c})])]))),128))]),_:3},8,["header","headerTooltip"])}const vr=Z(uj,[["render",mj]]),si="aioseo-pro",Cj={setup(){const{initSchemaEditor:n}=gt();return{dateJsToLocal:Ds,dateStringToLocalJs:Ts,initSchemaEditor:n,schemaStore:Ie()}},components:{BaseDatePicker:_s,BaseRadio:hh,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroupRepeater:vr},data(){return{editionDefaults:{name:"",bookEdition:"",author:"",isbn:"",datePublished:"",format:""},strings:{name:C("Title",si),description:C("Description",si),author:C("Author",si),image:C("Image",si),editions:C("Editions",si),edition:C("Edition",si),bookEdition:C("Book Edition",si),isbn:C("ISBN",si),datePublished:C("Date Published",si),bookFormat:C("Book Format",si),paperback:C("Paperback",si),hardcover:C("Hardcover",si),eBook:C("eBook",si),audioBook:C("Audiobook",si)}}},beforeMount(){const n={id:"#aioseo-book-"+new Date().getTime().toString(36),slug:"book",graphName:"Book",label:C("Book",si),properties:{name:"#post_title",description:"",author:"",reviewLocation:"",editions:[JSON.parse(JSON.stringify(this.editionDefaults))],reviewRating:{rating:"",minimumRating:1,maximumRating:5},image:""}};this.initSchemaEditor(n)}},yj={class:"graph-editor-fields graph-book"};function bj(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-input"),c=x("core-image-uploader"),h=x("base-radio"),d=x("base-date-picker"),u=x("field-group-repeater");return v(),L("div",yj,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=f=>i.schemaStore.graph.properties.name=f),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=f=>i.schemaStore.graph.properties.description=f),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.author},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.author,"onUpdate:modelValue":e[2]||(e[2]=f=>i.schemaStore.graph.properties.author=f)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[3]||(e[3]=f=>i.schemaStore.graph.properties.image=f)},null,8,["modelValue"])]),_:1},8,["name"]),m(u,{groupProp:i.schemaStore.graph.properties.editions,defaults:s.editionDefaults,pluralName:s.strings.editions,singularName:s.strings.edition},{"fields-inner":S(({groupIndex:f})=>[m(l,{name:s.strings.name},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.editions[f].name,"onUpdate:modelValue":p=>i.schemaStore.graph.properties.editions[f].name=p},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.bookEdition},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.editions[f].bookEdition,"onUpdate:modelValue":p=>i.schemaStore.graph.properties.editions[f].bookEdition=p},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.author},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.editions[f].author,"onUpdate:modelValue":p=>i.schemaStore.graph.properties.editions[f].author=p},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.isbn},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.editions[f].isbn,"onUpdate:modelValue":p=>i.schemaStore.graph.properties.editions[f].isbn=p},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.bookFormat},{content:S(()=>[m(h,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.editions[f].bookFormat==="Paperback","onUpdate:modelValue":p=>i.schemaStore.graph.properties.editions[f].bookFormat="Paperback",type:2},{default:S(()=>[B(D(s.strings.paperback),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]),m(h,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.editions[f].bookFormat==="Hardcover","onUpdate:modelValue":p=>i.schemaStore.graph.properties.editions[f].bookFormat="Hardcover",type:2},{default:S(()=>[B(D(s.strings.hardcover),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]),m(h,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.editions[f].bookFormat==="EBook","onUpdate:modelValue":p=>i.schemaStore.graph.properties.editions[f].bookFormat="EBook",type:2},{default:S(()=>[B(D(s.strings.eBook),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]),m(h,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.editions[f].bookFormat==="AudiobookFormat",type:2,"onUpdate:modelValue":p=>i.schemaStore.graph.properties.editions[f].bookFormat="AudiobookFormat"},{default:S(()=>[B(D(s.strings.audioBook),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.datePublished,align:""},{content:S(()=>[m(d,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.editions[f].datePublished),onChange:p=>i.schemaStore.graph.properties.editions[f].datePublished=i.dateJsToLocal(p,"MM/dd/yyyy")},null,8,["defaultValue","onChange"])]),_:2},1032,["name"])]),_:1},8,["groupProp","defaults","pluralName","singularName"])])}const Sj=Z(Cj,[["render",bj]]),ge="all-in-one-seo-pack",wj={setup(){const{initSchemaEditor:n}=gt();return{CURRENCY_LIST:fi,SCHEMA_DISTANCE_UNIT:HM,SCHEMA_DRIVE_WHEEL_CONFIGURATION:NM,SCHEMA_VEHICLE_AVAILABILITY:FM,SCHEMA_VEHICLE_OFFER_ITEM_CONDITION:IM,dateJsToLocal:Ds,dateStringToLocalJs:Ts,initSchemaEditor:n,postEditorStore:Te(),rootStore:je(),schemaStore:Ie()}},components:{BaseDatePicker:_s,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt},data(){return{strings:{name:C("Name",ge),description:C("Description",ge),brand:C("Brand",ge),image:C("Image",ge),identifiers:C("Identifiers",ge),vehicleIdentificationNumber:C("Vehicle Identification Number",ge),vehicleIdentificationNumberDescription:C("The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles.",ge),model:C("Model",ge),modelDescription:C("The model of the vehicle.",ge),vehicleConfiguration:C("Configuration",ge),vehicleConfigurationDescription:C("A short text indicating the configuration of the vehicle, e.g. '5dr hatchback ST 2.5 MT 225 hp' or 'limited edition'.",ge),vehicleModelDate:C("Model Year",ge),vehicleModelDateDescription:C("The release year of the vehicle's model.",ge),offer:C("Offer",ge),price:C("Price",ge),currency:C("Currency",ge),priceValidUntil:C("Price Valid Until",ge),priceValidDescription:C("The date until this pricing lasts (optional).",ge),availability:C("Availability",ge),attributes:C("Attributes",ge),color:C("Color",ge),vehicleInteriorColor:C("Interior Color",ge),vehicleInteriorColorDescription:C("The color or color combination of the interior of the vehicle.",ge),vehicleInteriorType:C("Interior Type",ge),vehicleInteriorTypeDescription:C("The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.).",ge),bodyType:C("Body Type",ge),bodyTypeDescription:C("Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).",ge),driveWheelConfiguration:C("Drive Wheel Configuration",ge),driveWheelConfigurationDescription:C("The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle's engine via the drivetrain.",ge),vehicleTransmission:C("Transmission",ge),vehicleTransmissionDescription:C('The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars).',ge),vehicleSeatingCapacity:C("Seating Capacity",ge),vehicleSeatingCapacityDescription:C("The number of passengers that can be seated in the vehicle",ge),itemCondition:C("Item Condition",ge),vehicleEngineFuelType:C("Fuel Type",ge),vehicleEngineFuelTypeDescription:C(`The type of fuel that's suitable for the engine of the vehicle, e.g. "gasoline" or "electric".`,ge),numberOfDoors:C("Number of Doors",ge),mileageFromOdometer:C("Odometer Mileage",ge),mileageFromOdometerValue:C("Amount",ge),mileageFromOdometerUnitCode:C("Unit",ge)}}},methods:{getAvailability(n){return this.SCHEMA_VEHICLE_AVAILABILITY.find(e=>e.value===n)},saveAvailability(n){this.schemaStore.graph.properties.offer.availability=n},getCurrency(n){return this.CURRENCY_LIST.find(e=>e.value===n)},saveCurrency(n){this.schemaStore.graph.properties.offer.currency=n},getItemCondition(n){return this.SCHEMA_VEHICLE_OFFER_ITEM_CONDITION.find(e=>e.value===n)},saveItemCondition(n){this.schemaStore.graph.properties.attributes.itemCondition=n},getDriveWheelConfiguration(n){return this.SCHEMA_DRIVE_WHEEL_CONFIGURATION.find(e=>e.value===n)},saveDriveWheelConfiguration(n){this.schemaStore.graph.properties.attributes.driveWheelConfiguration=n}},beforeMount(){const n={id:"#aioseo-product-review-"+new Date().getTime().toString(36),slug:"product-review",graphName:"ProductReview",label:C("Product Review",ge),properties:{autogenerate:!1,name:"#post_title",description:"#post_excerpt",brand:"",image:"",identifiers:{vehicleIdentificationNumber:"",model:"",vehicleConfiguration:"",vehicleModelDate:""},offer:{price:"",currency:"",availability:"",validUntil:""},attributes:{color:"",vehicleInteriorColor:"",vehicleInteriorType:"",bodyType:"",driveWheelConfiguration:"",vehicleTransmission:"",vehicleSeatingCapacity:"",itemCondition:"",numberOfDoors:"",vehicleEngineFuelType:""},mileageFromOdometer:{value:"",unitCode:""}}};this.initSchemaEditor(n)},async mounted(){this.schemaStore.graph.id||await xd().then(n=>{var e;(e=this.schemaStore.graph)!=null&&e.properties&&(this.schemaStore.graph.properties.image=n,this.$nextTick(()=>{this.schemaStore.isDirty=!1}))})}},vj={class:"graph-editor-fields graph-car"},kj={class:"aioseo-description"},xj={class:"aioseo-description"},Mj={class:"aioseo-description"},Aj={class:"aioseo-description"},Dj={class:"aioseo-description"},Tj={class:"aioseo-description"},_j={class:"aioseo-description"},Oj={class:"aioseo-description"},Vj={class:"aioseo-description"},Ej={class:"aioseo-description"},Pj={class:"aioseo-description"},Lj={class:"aioseo-description"};function Rj(n,e,t,i,s,r){var f;const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-input"),c=x("core-image-uploader"),h=x("field-group"),d=x("base-select"),u=x("base-date-picker");return v(),L("div",vj,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=p=>i.schemaStore.graph.properties.name=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=p=>i.schemaStore.graph.properties.description=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.brand,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.brand,"onUpdate:modelValue":e[2]||(e[2]=p=>i.schemaStore.graph.properties.brand=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[3]||(e[3]=p=>i.schemaStore.graph.properties.image=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(h,{header:s.strings.identifiers},{default:S(()=>[m(l,{name:s.strings.vehicleIdentificationNumber,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.vehicleIdentificationNumber,"onUpdate:modelValue":e[4]||(e[4]=p=>i.schemaStore.graph.properties.identifiers.vehicleIdentificationNumber=p)},null,8,["modelValue"]),A("div",kj,D(s.strings.vehicleIdentificationNumberDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.vehicleConfiguration,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.vehicleConfiguration,"onUpdate:modelValue":e[5]||(e[5]=p=>i.schemaStore.graph.properties.identifiers.vehicleConfiguration=p)},null,8,["modelValue"]),A("div",xj,D(s.strings.vehicleConfigurationDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.model,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.model,"onUpdate:modelValue":e[6]||(e[6]=p=>i.schemaStore.graph.properties.identifiers.model=p)},null,8,["modelValue"]),A("div",Mj,D(s.strings.modelDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.vehicleModelDate,align:""},{content:S(()=>[m(a,{size:"medium",type:"number",modelValue:i.schemaStore.graph.properties.identifiers.vehicleModelDate,"onUpdate:modelValue":e[7]||(e[7]=p=>i.schemaStore.graph.properties.identifiers.vehicleModelDate=p)},null,8,["modelValue"]),A("div",Aj,D(s.strings.vehicleModelDateDescription),1)]),_:1},8,["name"])]),_:1},8,["header"]),m(h,{header:s.strings.offer},{default:S(()=>[m(l,{name:s.strings.price,align:""},{content:S(()=>[m(a,{size:"medium",type:"number",min:0,step:.01,modelValue:i.schemaStore.graph.properties.offer.price,"onUpdate:modelValue":e[8]||(e[8]=p=>i.schemaStore.graph.properties.offer.price=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.currency,align:""},{content:S(()=>[m(d,{size:"medium",options:i.CURRENCY_LIST,modelValue:r.getCurrency(i.schemaStore.graph.properties.offer.currency),"onUpdate:modelValue":e[9]||(e[9]=p=>r.saveCurrency(p.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.priceValidUntil,align:""},{content:S(()=>[m(u,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.offer.validUntil),onChange:e[10]||(e[10]=p=>i.schemaStore.graph.properties.offer.validUntil=i.dateJsToLocal(p,"MM/dd/yyyy"))},null,8,["defaultValue"]),A("div",Dj,D(s.strings.priceValidDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.availability,align:""},{content:S(()=>[m(d,{class:"aioseo-product-availibility",size:"medium",options:i.SCHEMA_VEHICLE_AVAILABILITY,modelValue:r.getAvailability(i.schemaStore.graph.properties.offer.availability),"onUpdate:modelValue":e[11]||(e[11]=p=>r.saveAvailability(p.value))},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(h,{header:s.strings.attributes},{default:S(()=>[m(l,{name:s.strings.color,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.color,"onUpdate:modelValue":e[12]||(e[12]=p=>i.schemaStore.graph.properties.attributes.color=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.vehicleInteriorColor,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.vehicleInteriorColor,"onUpdate:modelValue":e[13]||(e[13]=p=>i.schemaStore.graph.properties.attributes.vehicleInteriorColor=p)},null,8,["modelValue"]),A("div",Tj,D(s.strings.vehicleInteriorColorDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.vehicleInteriorType,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.vehicleInteriorType,"onUpdate:modelValue":e[14]||(e[14]=p=>i.schemaStore.graph.properties.attributes.vehicleInteriorType=p)},null,8,["modelValue"]),A("div",_j,D(s.strings.vehicleInteriorTypeDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.bodyType,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.bodyType,"onUpdate:modelValue":e[15]||(e[15]=p=>i.schemaStore.graph.properties.attributes.bodyType=p)},null,8,["modelValue"]),A("div",Oj,D(s.strings.bodyTypeDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.driveWheelConfiguration,align:""},{content:S(()=>[m(d,{size:"medium",options:i.SCHEMA_DRIVE_WHEEL_CONFIGURATION,modelValue:r.getDriveWheelConfiguration(i.schemaStore.graph.properties.attributes.driveWheelConfiguration),"onUpdate:modelValue":e[16]||(e[16]=p=>r.saveDriveWheelConfiguration(p.value))},null,8,["options","modelValue"]),A("div",Vj,D(s.strings.driveWheelConfigurationDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.vehicleTransmission,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.vehicleTransmission,"onUpdate:modelValue":e[17]||(e[17]=p=>i.schemaStore.graph.properties.attributes.vehicleTransmission=p)},null,8,["modelValue"]),A("div",Ej,D(s.strings.vehicleTransmissionDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.vehicleSeatingCapacity,align:""},{content:S(()=>[m(a,{size:"medium",type:"number",modelValue:i.schemaStore.graph.properties.attributes.vehicleSeatingCapacity,"onUpdate:modelValue":e[18]||(e[18]=p=>i.schemaStore.graph.properties.attributes.vehicleSeatingCapacity=p)},null,8,["modelValue"]),A("div",Pj,D(s.strings.vehicleSeatingCapacityDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.numberOfDoors,align:""},{content:S(()=>[m(a,{size:"medium",type:"number",modelValue:i.schemaStore.graph.properties.attributes.numberOfDoors,"onUpdate:modelValue":e[19]||(e[19]=p=>i.schemaStore.graph.properties.attributes.numberOfDoors=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.itemCondition,align:""},{content:S(()=>[m(d,{size:"medium",options:i.SCHEMA_VEHICLE_OFFER_ITEM_CONDITION,modelValue:r.getItemCondition(i.schemaStore.graph.properties.attributes.itemCondition),"onUpdate:modelValue":e[20]||(e[20]=p=>r.saveItemCondition(p.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.vehicleEngineFuelType,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.vehicleEngineFuelType,"onUpdate:modelValue":e[21]||(e[21]=p=>i.schemaStore.graph.properties.attributes.vehicleEngineFuelType=p)},null,8,["modelValue"]),A("div",Lj,D(s.strings.vehicleEngineFuelTypeDescription),1)]),_:1},8,["name"])]),_:1},8,["header"]),((f=r.getItemCondition(i.schemaStore.graph.properties.attributes.itemCondition))==null?void 0:f.label.toLowerCase())==="used"?(v(),E(h,{key:0,header:s.strings.mileageFromOdometer},{default:S(()=>[m(l,{name:s.strings.mileageFromOdometerValue,align:""},{content:S(()=>[m(a,{type:"number",size:"medium",min:0,step:1,modelValue:i.schemaStore.graph.properties.mileageFromOdometer.value,"onUpdate:modelValue":e[22]||(e[22]=p=>i.schemaStore.graph.properties.mileageFromOdometer.value=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.mileageFromOdometerUnitCode,align:""},{content:S(()=>[m(d,{size:"medium",options:i.SCHEMA_DISTANCE_UNIT,modelValue:i.SCHEMA_DISTANCE_UNIT.find(p=>p.value===i.schemaStore.graph.properties.mileageFromOdometer.unitCode),"onUpdate:modelValue":e[23]||(e[23]=p=>i.schemaStore.graph.properties.mileageFromOdometer.unitCode=p.value)},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"])):O("",!0)])}const Bj=Z(wj,[["render",Rj]]),Hj={class:"aioseo-description"},Nj={class:"aioseo-description"},yh={__name:"Review",props:{reviewProp:{type:Object,required:!0},multiple:{type:Boolean,default:!0},enableReviewNotes:{type:Boolean,default:!1}},setup(n){const e="aioseo-pro",{getJsonValue:t,setJsonValue:i}=Sr(),s={review:C("Review",e),rating:C("Rating",e),headline:C("Headline",e),content:C("Content",e),author:C("Author",e),positiveNotes:C("Positive Notes",e),negativeNotes:C("Negative Notes",e),positiveNotesDescription:C("Enter the positive notes for the review.",e),negativeNotesDescription:C("Enter the negative notes for the review.",e),placeholderPositiveNotes:C("Enter positive notes",e),tagPlaceholderPositiveNotes:C("Add positive note",e),placeholderNegativeNotes:C("Enter negative notes",e),tagPlaceholderNegativeNotes:C("Add negative note",e)};return(r,o)=>{const l=x("base-input"),a=x("base-select");return v(),E(_(Zt),{class:Re(["graph-review",{multiple:n.multiple}]),header:s.review},{default:S(()=>[m(_(Ce),{name:s.rating,align:""},{content:S(()=>[m(l,{size:"medium",type:"number",min:0,step:1,modelValue:n.reviewProp.rating,"onUpdate:modelValue":o[0]||(o[0]=c=>n.reviewProp.rating=c)},null,8,["modelValue"])]),_:1},8,["name"]),m(_(Ce),{name:s.headline,align:""},{content:S(()=>[m(l,{size:"medium",modelValue:n.reviewProp.headline,"onUpdate:modelValue":o[1]||(o[1]=c=>n.reviewProp.headline=c)},null,8,["modelValue"])]),_:1},8,["name"]),m(_(Ce),{name:s.content,align:""},{content:S(()=>[m(_(to),{size:"medium",modelValue:n.reviewProp.content,"onUpdate:modelValue":o[2]||(o[2]=c=>n.reviewProp.content=c),minHeight:120},null,8,["modelValue"])]),_:1},8,["name"]),m(_(Ce),{name:s.author},{content:S(()=>[n.multiple?O("",!0):(v(),E(_(vt),{key:0,modelValue:n.reviewProp.author,"onUpdate:modelValue":o[3]||(o[3]=c=>n.reviewProp.author=c),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"top","default-tags":["author_name","author_first_name","author_last_name"],"disable-emoji":"",tagsDescription:""},null,8,["modelValue"])),n.multiple?(v(),E(l,{key:1,size:"medium",modelValue:n.reviewProp.author,"onUpdate:modelValue":o[4]||(o[4]=c=>n.reviewProp.author=c)},null,8,["modelValue"])):O("",!0)]),_:1},8,["name"]),n.enableReviewNotes?(v(),E(_(Ce),{key:0,name:s.positiveNotes},{content:S(()=>[m(a,{size:"medium",multiple:"",taggable:"",options:_(t)(n.reviewProp.positiveNotes)||[],modelValue:_(t)(n.reviewProp.positiveNotes)||[],"onUpdate:modelValue":o[5]||(o[5]=c=>n.reviewProp.positiveNotes=_(i)(c)),placeholder:s.placeholderPositiveNotes,"tag-placeholder":s.tagPlaceholderPositiveNotes},null,8,["options","modelValue","placeholder","tag-placeholder"]),A("div",Hj,D(s.positiveNotesDescription),1)]),_:1},8,["name"])):O("",!0),n.enableReviewNotes?(v(),E(_(Ce),{key:1,name:s.negativeNotes},{content:S(()=>[m(a,{size:"medium",multiple:"",taggable:"",options:_(t)(n.reviewProp.negativeNotes)||[],modelValue:_(t)(n.reviewProp.negativeNotes)||[],"onUpdate:modelValue":o[6]||(o[6]=c=>n.reviewProp.negativeNotes=_(i)(c)),placeholder:s.placeholderNegativeNotes,"tag-placeholder":s.tagPlaceholderNegativeNotes},null,8,["options","modelValue","placeholder","tag-placeholder"]),A("div",Nj,D(s.negativeNotesDescription),1)]),_:1},8,["name"])):O("",!0)]),_:1},8,["class","header"])}}},wf="aioseo-pro",Fj={setup(){return{schemaStore:Ie()}},components:{CoreSettingsRow:Ce,FieldGroup:Zt},data(){return{ratingKey:0,strings:{reviewRating:C("Review Rating",wf),ratingMinimum:C("Rating Minimum",wf),ratingMaximum:C("Rating Maximum",wf)}}},computed:{minimum(){return parseFloat(this.schemaStore.graph.properties.rating.minimum)},maximum(){return parseFloat(this.schemaStore.graph.properties.rating.maximum)}},methods:{updateMinimumRating(n){if(n=parseFloat(n),n>parseFloat(this.schemaStore.graph.properties.rating.maximum)){this.schemaStore.graph.properties.rating.minimum=parseFloat(this.schemaStore.graph.properties.rating.maximum),this.ratingKey++;return}n>this.schemaStore.graph.properties.rating.value&&(this.schemaStore.graph.properties.rating.value=n),this.schemaStore.graph.properties.rating.minimum=n,this.ratingKey++},updateMaximumRating(n){if(n=parseFloat(n),n<parseFloat(this.schemaStore.graph.properties.rating.minimum)){this.schemaStore.graph.properties.rating.maximum=parseFloat(this.schemaStore.graph.properties.rating.minimum),this.ratingKey++;return}n<parseFloat(this.schemaStore.graph.properties.rating.value)&&(this.schemaStore.graph.properties.rating.value=n),this.schemaStore.graph.properties.rating.maximum=n,this.ratingKey++}}};function Ij(n,e,t,i,s,r){const o=x("base-input"),l=x("core-settings-row"),a=x("field-group");return v(),E(a,{header:s.strings.reviewRating},{default:S(()=>[(v(),E(l,{name:s.strings.ratingMinimum,key:"ratingMinimum"+s.ratingKey,align:""},{content:S(()=>[m(o,{size:"medium",type:"number",min:0,modelValue:i.schemaStore.graph.properties.rating.minimum,step:.1,onBlur:e[0]||(e[0]=c=>r.updateMinimumRating(c))},null,8,["modelValue"])]),_:1},8,["name"])),(v(),E(l,{name:s.strings.ratingMaximum,key:"ratingMaximum"+s.ratingKey,align:""},{content:S(()=>[m(o,{size:"medium",type:"number",min:0,modelValue:i.schemaStore.graph.properties.rating.maximum,step:.1,onBlur:e[1]||(e[1]=c=>r.updateMaximumRating(c))},null,8,["modelValue"])]),_:1},8,["name"]))]),_:1},8,["header"])}const yl=Z(Fj,[["render",Ij]]),ue="aioseo-pro",Wj={setup(){const{getJsonValue:n,setJsonValue:e}=Sr(),{initSchemaEditor:t}=gt();return{COURSE_MODE_LIST:WM,COURSE_REPEAT_FREQUENCY:zM,CURRENCY_LIST:fi,GLOBAL_STRINGS:St,OFFER_PRICING_CATEGORY_LIST:UM,dateJsToLocal:Ds,dateStringToLocalJs:Ts,getJsonValue:n,initSchemaEditor:t,optionsStore:Lt(),postEditorStore:Te(),rootStore:je(),schemaStore:Ie(),setJsonValue:e}},components:{BaseDatePicker:_s,BaseRadioToggle:br,BaseTextarea:to,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt,FieldGroupRepeater:vr,Review:yh,ReviewRating:yl},data(){return{courseInstanceDefaults:{mode:"Online",location:"",workload:null,schedule:{duration:null,repeatCount:0,repeatFrequency:"",startDate:"",endDate:""},instructor:{name:"",description:"",image:""}},offerDefaults:{category:"Paid",price:"",currency:"USD"},reviewDefaults:{rating:"",headline:"",content:"",author:""},syllabusSectionDefaults:{name:"",description:"",timeRequired:""},strings:{autogenerate:C("Autogenerate",ue),name:C("Name",ue),description:C("Description",ue),about:C("About",ue),prerequisites:C("Prerequisites",ue),publishDate:C("Publish Date",ue),provider:C("Provider",ue),url:C("URL",ue),image:C("Image",ue),organizationDescription:j(C("Leave this empty if you want to use the Organization you've set under %1$s.",ue),be.getPlainLink(C("Search Appearance > Knowledge Graph",ue),this.rootStore.aioseo.urls.aio.searchAppearance+"#/global-settings")),offers:C("Offers",ue),offer:C("Offer",ue),pricingCategory:C("Pricing Category",ue),price:C("Price",ue),currency:C("Currency",ue),courseInstances:C("Course Instances",ue),courseInstance:C("Course Instance",ue),mode:C("Mode",ue),location:C("Location",ue),workload:C("Workload",ue),schedule:C("Schedule",ue),duration:C("Duration",ue),repeatCount:C("Repeat Count",ue),repeatFrequency:C("Repeat Frequency",ue),startDate:C("Start Date",ue),endDate:C("End Date",ue),instructor:C("Instructor",ue),reviews:C("Reviews",ue),review:C("Review",ue),syllabusSections:C("Syllabus Sections",ue),syllabusSection:C("Syllabus Section",ue),timeRequired:C("Time Required",ue),teaches:C("Teaches",ue),totalHistoricalEnrollment:C("Total Historical Enrollment",ue),video:C("Video",ue),placeholder:C("Type to enter an item...",ue),tagPlaceholder:C("Press enter to create an item",ue),aboutDescription:C("Describe the skills that the user will develop by taking the course, if applicable.",ue),teachesDescription:C("The learning outcomes or specific knowledge the user will learn by taking the course, if applicable.",ue),prerequisitesDescription:C("Any prior knowledge that is needed for the course, if applicable. This can be represented by describing the prior knowledge or linking to another course (or both).",ue),workloadDescription:C("The total average time (in minutes) it takes for a user to complete the entire course.",ue),durationDescription:C('The average time (in minutes) a user can expect to spend during each repeat interval. For example, if the repeat frequency is "Monthly", then the user could expect to spend 2 hours per month on the course.',ue),syllabusSectionDescription:C("Information about the different modules that make up the course, if applicable.",ue)}}},computed:{isMemberMouseCoursesActive(){return this.rootStore.aioseo.data.isMemberMouseCoursesActive&&this.postEditorStore.currentPost.postType==="mmcs-course"},isMemberPressCoursesActive(){return this.rootStore.aioseo.data.isMemberPressCoursesActive&&this.postEditorStore.currentPost.postType==="mpcs-course"},autogenerateDescription(){let n="";return this.isMemberMouseCoursesActive&&(n="MemberMouse Courses"),this.isMemberPressCoursesActive&&(n="MemberPress Courses"),j(C("Disable this setting if you'd like to edit all fields manually instead of letting %1$s automatically generate them for you based on the course data from %2$s.",ue),"AIOSEO",n)},showField(){return!this.isMemberMouseCoursesActive&&!this.isMemberPressCoursesActive?!0:!this.schemaStore.graph.properties.autogenerate}},beforeMount(){const n={id:"#aioseo-course-"+new Date().getTime().toString(36),slug:"course",graphName:"Course",label:C("Course",ue),properties:{autogenerate:!0,name:"#post_title",description:"#post_excerpt",publishDate:"",about:"",prerequisites:"",teaches:"",image:"",provider:{name:"",url:"",image:""},offers:[JSON.parse(JSON.stringify(this.offerDefaults))],courseInstances:[JSON.parse(JSON.stringify(this.courseInstanceDefaults))],reviews:[JSON.parse(JSON.stringify(this.reviewDefaults))],rating:{minimum:1,maximum:5},syllabusSections:[JSON.parse(JSON.stringify(this.syllabusSectionDefaults))]}};this.initSchemaEditor(n)}},zj={class:"graph-editor-fields graph-course"},Uj={class:"aioseo-description"},$j={class:"aioseo-description"},Kj={class:"aioseo-description"},Gj={class:"aioseo-description"},qj=["innerHTML"],Zj={class:"aioseo-description"},jj={class:"aioseo-description"};function Yj(n,e,t,i,s,r){const o=x("base-radio-toggle"),l=x("core-settings-row"),a=x("core-html-tags-editor"),c=x("base-date-picker"),h=x("base-select"),d=x("core-image-uploader"),u=x("base-input"),f=x("field-group"),p=x("field-group-repeater"),g=x("base-textarea"),b=x("review"),y=x("review-rating");return v(),L("div",zj,[r.isMemberMouseCoursesActive||r.isMemberPressCoursesActive?(v(),E(l,{key:0,name:s.strings.autogenerate,align:""},{content:S(()=>[m(o,{name:"autogenerate",modelValue:i.schemaStore.graph.properties.autogenerate,"onUpdate:modelValue":e[0]||(e[0]=w=>i.schemaStore.graph.properties.autogenerate=w),options:[{label:i.GLOBAL_STRINGS.no,value:!1,activeClass:"dark"},{label:i.GLOBAL_STRINGS.yes,value:!0}]},null,8,["modelValue","options"]),A("div",Uj,D(r.autogenerateDescription),1)]),_:1},8,["name"])):O("",!0),m(l,{name:s.strings.name},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[1]||(e[1]=w=>i.schemaStore.graph.properties.name=w),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[2]||(e[2]=w=>i.schemaStore.graph.properties.description=w),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.publishDate,align:""},{content:S(()=>[m(c,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.publishDate),onChange:e[3]||(e[3]=w=>i.schemaStore.graph.properties.publishDate=i.dateJsToLocal(w,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"]),m(l,{name:s.strings.about,align:""},{content:S(()=>[m(h,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.about)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.about)||[],"onUpdate:modelValue":e[4]||(e[4]=w=>i.schemaStore.graph.properties.about=i.setJsonValue(w)),placeholder:s.strings.placeholder,"tag-placeholder":s.strings.tagPlaceholder},null,8,["options","modelValue","placeholder","tag-placeholder"]),A("div",$j,D(s.strings.aboutDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.teaches,align:""},{content:S(()=>[m(h,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.teaches)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.teaches)||[],"onUpdate:modelValue":e[5]||(e[5]=w=>i.schemaStore.graph.properties.teaches=i.setJsonValue(w)),placeholder:s.strings.placeholder,"tag-placeholder":s.strings.tagPlaceholder},null,8,["options","modelValue","placeholder","tag-placeholder"]),A("div",Kj,D(s.strings.teachesDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.prerequisites,align:""},{content:S(()=>[m(h,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.prerequisites)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.prerequisites)||[],"onUpdate:modelValue":e[6]||(e[6]=w=>i.schemaStore.graph.properties.prerequisites=i.setJsonValue(w)),placeholder:s.strings.placeholder,"tag-placeholder":s.strings.tagPlaceholder},null,8,["options","modelValue","placeholder","tag-placeholder"]),A("div",Gj,D(s.strings.prerequisitesDescription),1)]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(d,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[7]||(e[7]=w=>i.schemaStore.graph.properties.image=w)},null,8,["modelValue"])]),_:1},8,["name"]),m(f,{header:s.strings.provider},{default:S(()=>[m(l,{name:s.strings.name},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.provider.name,"onUpdate:modelValue":e[8]||(e[8]=w=>i.schemaStore.graph.properties.provider.name=w)},null,8,["modelValue"]),i.optionsStore.options.searchAppearance.global.schema.siteRepresents==="organization"?(v(),L("div",{key:0,class:"aioseo-description",innerHTML:s.strings.organizationDescription},null,8,qj)):O("",!0)]),_:1},8,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(u,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.provider.url,"onUpdate:modelValue":e[9]||(e[9]=w=>i.schemaStore.graph.properties.provider.url=w)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(d,{modelValue:i.schemaStore.graph.properties.provider.image,"onUpdate:modelValue":e[10]||(e[10]=w=>i.schemaStore.graph.properties.provider.image=w)},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),r.showField?(v(),E(p,{key:1,groupProp:i.schemaStore.graph.properties.offers,defaults:s.offerDefaults,pluralName:s.strings.offers,singularName:s.strings.offer},{"fields-inner":S(({groupIndex:w})=>[m(l,{name:s.strings.pricingCategory,align:""},{content:S(()=>[m(h,{size:"medium",options:i.OFFER_PRICING_CATEGORY_LIST,modelValue:i.OFFER_PRICING_CATEGORY_LIST.find(M=>M.value===i.schemaStore.graph.properties.offers[w].category),"onUpdate:modelValue":M=>i.schemaStore.graph.properties.offers[w].category=M.value},null,8,["options","modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),i.schemaStore.graph.properties.offers[w].category.toLowerCase()!=="free"?(v(),L(xt,{key:0},[m(l,{name:s.strings.price,align:""},{content:S(()=>[m(u,{size:"medium",type:"number",min:0,step:.01,modelValue:i.schemaStore.graph.properties.offers[w].price,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.offers[w].price=M},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.currency,align:""},{content:S(()=>[m(h,{size:"medium",options:i.CURRENCY_LIST,modelValue:i.CURRENCY_LIST.find(M=>M.value===i.schemaStore.graph.properties.offers[w].currency),"onUpdate:modelValue":M=>i.schemaStore.graph.properties.offers[w].currency=M.value},null,8,["options","modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])],64)):O("",!0)]),_:1},8,["groupProp","defaults","pluralName","singularName"])):O("",!0),m(p,{groupProp:i.schemaStore.graph.properties.courseInstances,defaults:s.courseInstanceDefaults,pluralName:s.strings.courseInstances,singularName:s.strings.courseInstance},{"fields-inner":S(({groupIndex:w})=>[m(l,{name:s.strings.mode,align:""},{content:S(()=>[m(h,{size:"medium",options:i.COURSE_MODE_LIST,modelValue:i.COURSE_MODE_LIST.find(M=>M.value===i.schemaStore.graph.properties.courseInstances[w].mode),"onUpdate:modelValue":M=>i.schemaStore.graph.properties.courseInstances[w].mode=M.value},null,8,["options","modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),i.schemaStore.graph.properties.courseInstances[w].mode!=="Online"?(v(),E(l,{key:0,name:s.strings.location},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.courseInstances[w].location,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.courseInstances[w].location=M},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])):O("",!0),m(l,{name:s.strings.workload},{content:S(()=>[m(u,{type:"number",size:"medium",min:0,step:1,modelValue:i.schemaStore.graph.properties.courseInstances[w].workload,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.courseInstances[w].workload=M},null,8,["modelValue","onUpdate:modelValue"]),A("div",Zj,D(s.strings.workloadDescription),1)]),_:2},1032,["name"]),m(f,{header:s.strings.schedule},{default:S(()=>[m(l,{name:s.strings.duration},{content:S(()=>[m(u,{type:"number",size:"medium",min:0,step:1,modelValue:i.schemaStore.graph.properties.courseInstances[w].schedule.duration,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.courseInstances[w].schedule.duration=M},null,8,["modelValue","onUpdate:modelValue"]),A("div",jj,D(s.strings.durationDescription),1)]),_:2},1032,["name"]),m(l,{name:s.strings.repeatCount,align:""},{content:S(()=>[m(u,{size:"medium",type:"number",min:0,step:1,modelValue:i.schemaStore.graph.properties.courseInstances[w].schedule.repeatCount,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.courseInstances[w].schedule.repeatCount=M},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.repeatFrequency,align:""},{content:S(()=>[m(h,{size:"medium",options:i.COURSE_REPEAT_FREQUENCY,modelValue:i.COURSE_REPEAT_FREQUENCY.find(M=>M.value===i.schemaStore.graph.properties.courseInstances[w].schedule.repeatFrequency),"onUpdate:modelValue":M=>i.schemaStore.graph.properties.courseInstances[w].schedule.repeatFrequency=M.value},null,8,["options","modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.startDate,align:""},{content:S(()=>[m(c,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.courseInstances[w].schedule.startDate),onChange:M=>i.schemaStore.graph.properties.courseInstances[w].schedule.startDate=i.dateJsToLocal(M,"MM/dd/yyyy")},null,8,["defaultValue","onChange"])]),_:2},1032,["name"]),m(l,{name:s.strings.endDate,align:""},{content:S(()=>[m(c,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.courseInstances[w].schedule.endDate),onChange:M=>i.schemaStore.graph.properties.courseInstances[w].schedule.endDate=i.dateJsToLocal(M,"MM/dd/yyyy")},null,8,["defaultValue","onChange"])]),_:2},1032,["name"])]),_:2},1032,["header"]),m(f,{header:s.strings.instructor},{default:S(()=>[m(l,{name:s.strings.name},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.courseInstances[w].instructor.name,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.courseInstances[w].instructor.name=M},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(g,{size:"medium",modelValue:i.schemaStore.graph.properties.courseInstances[w].instructor.description,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.courseInstances[w].instructor.description=M,minHeight:120},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{class:"image-field",name:s.strings.image},{content:S(()=>[m(d,{modelValue:i.schemaStore.graph.properties.courseInstances[w].instructor.image,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.courseInstances[w].instructor.image=M},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])]),_:2},1032,["header"])]),_:1},8,["groupProp","defaults","pluralName","singularName"]),m(p,{groupProp:i.schemaStore.graph.properties.reviews,defaults:s.reviewDefaults,pluralName:s.strings.reviews,singularName:s.strings.review},{"fields-inner":S(({groupIndex:w})=>[m(b,{reviewProp:i.schemaStore.graph.properties.reviews[w]},null,8,["reviewProp"])]),_:1},8,["groupProp","defaults","pluralName","singularName"]),m(y),r.showField?(v(),E(p,{key:2,groupProp:i.schemaStore.graph.properties.syllabusSections,defaults:s.syllabusSectionDefaults,pluralName:s.strings.syllabusSections,singularName:s.strings.syllabusSection,headerTooltip:s.strings.syllabusSectionDescription},{"fields-inner":S(({groupIndex:w})=>[m(l,{name:s.strings.name},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.syllabusSections[w].name,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.syllabusSections[w].name=M},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(g,{size:"medium",modelValue:i.schemaStore.graph.properties.syllabusSections[w].description,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.syllabusSections[w].description=M,minHeight:120},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.timeRequired},{content:S(()=>[m(u,{type:"number",size:"medium",min:0,step:1,modelValue:i.schemaStore.graph.properties.syllabusSections[w].timeRequired,"onUpdate:modelValue":M=>i.schemaStore.graph.properties.syllabusSections[w].timeRequired=M},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])]),_:1},8,["groupProp","defaults","pluralName","singularName","headerTooltip"])):O("",!0)])}const Jj=Z(Wj,[["render",Yj]]),Oe="aioseo-pro",Xj={setup(){const{getJsonValue:n,setJsonValue:e}=Sr(),{initSchemaEditor:t}=gt();return{GLOBAL_STRINGS:St,getJsonValue:n,initSchemaEditor:t,schemaStore:Ie(),setJsonValue:e}},components:{BaseRadioToggle:br,BaseTextarea:to,CoreHtmlTagsEditor:vt,CoreSettingsRow:Ce,FieldGroupRepeater:vr},data(){return{subDatasetDefaults:{name:"",description:""},downloadDefaults:{encodingFormat:"",url:""},strings:{name:C("Name",Oe),description:C("Description",Oe),descriptionDescription:C("A short summary describing the dataset. The description must be between 50 and 5,000 characters long.",Oe),url:C("URL",Oe),sameAs:C("Same As",Oe),sameAsDescription:C("The URL of a reference web page that unambiguously indicates the dataset's identity.",Oe),alternateName:C("Alternative Names",Oe),alternateNamePlaceholder:C("Type to enter an alternative name...",Oe),alternateNameTagPlaceholder:C("Press enter to create an alternative name",Oe),author:C("Author",Oe),type:C("Type",Oe),organization:C("Organization",Oe),person:C("Person",Oe),identifier:C("Identifier",Oe),isAccessibleForFree:C("Accessible for Free",Oe),license:C("License",Oe),version:C("Version",Oe),keywords:C("Keywords",Oe),keywordsPlaceholder:C("Type to enter a keyword...",Oe),keywordsTagPlaceholder:C("Press enter to create a keyword",Oe),temporalCoverage:C("Temporal Coverage",Oe),temporalCoverageDescription:C("The specific time interval this dataset covers.",Oe),spatialCoverage:C("Spatial Coverage",Oe),spatialCoverageDescription:C("The specific coordinates where the measurements were collected.",Oe),dataCatalog:C("Data Catalog",Oe),dataCatalogDescription:C("The name of the larger Data Catalog this dataset is a part of.",Oe),subDatasets:C("Sub Datasets",Oe),subDataset:C("Sub Dataset",Oe),downloads:C("Downloads",Oe),download:C("Download",Oe),encodingFormat:C("Encoding Format",Oe),encodingFormatDescription:C("The file format of the download.",Oe)}}},beforeMount(){const n={id:"#aioseo-dataset-"+new Date().getTime().toString(36),slug:"dataset",graphName:"Dataset",label:C("Dataset",Oe),properties:{name:"#post_title",description:"#post_excerpt",sameAs:"",alternateName:"",dataCatalog:"",identifier:"",license:"",free:!0,keywords:"",temporalCoverage:"",spatialCoverage:"",subDatasets:[JSON.parse(JSON.stringify(this.subDatasetDefaults))],downloads:[JSON.parse(JSON.stringify(this.downloadDefaults))]}};this.initSchemaEditor(n)}},Qj={class:"graph-editor-fields graph-dataset"},eY={class:"aioseo-description"},tY={class:"aioseo-description"},iY={class:"aioseo-description"},sY={class:"aioseo-description"},nY={class:"aioseo-description"},rY={class:"aioseo-description"};function oY(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-input"),c=x("base-select"),h=x("base-radio-toggle"),d=x("base-textarea"),u=x("field-group-repeater");return v(),L("div",Qj,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=f=>i.schemaStore.graph.properties.name=f),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=f=>i.schemaStore.graph.properties.description=f),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"]),A("div",eY,D(s.strings.descriptionDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.sameAs},{content:S(()=>[m(a,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.sameAs,"onUpdate:modelValue":e[2]||(e[2]=f=>i.schemaStore.graph.properties.sameAs=f)},null,8,["modelValue"]),A("div",tY,D(s.strings.sameAsDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.alternateName,align:""},{content:S(()=>[m(c,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.alternateName)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.alternateName)||[],"onUpdate:modelValue":e[3]||(e[3]=f=>i.schemaStore.graph.properties.alternateName=i.setJsonValue(f)),placeholder:s.strings.alternateNamePlaceholder,"tag-placeholder":s.strings.alternateNameTagPlaceholder},null,8,["options","modelValue","placeholder","tag-placeholder"])]),_:1},8,["name"]),m(l,{name:s.strings.dataCatalog},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.dataCatalog,"onUpdate:modelValue":e[4]||(e[4]=f=>i.schemaStore.graph.properties.dataCatalog=f)},null,8,["modelValue"]),A("div",iY,D(s.strings.dataCatalogDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.identifier},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.identifier,"onUpdate:modelValue":e[5]||(e[5]=f=>i.schemaStore.graph.properties.identifier=f)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.license},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.license,"onUpdate:modelValue":e[6]||(e[6]=f=>i.schemaStore.graph.properties.license=f)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.isAccessibleForFree,align:""},{content:S(()=>[m(h,{name:"isAccessibleForFree",modelValue:i.schemaStore.graph.properties.free,"onUpdate:modelValue":e[7]||(e[7]=f=>i.schemaStore.graph.properties.free=f),options:[{label:i.GLOBAL_STRINGS.no,value:!1,activeClass:"dark"},{label:i.GLOBAL_STRINGS.yes,value:!0}]},null,8,["modelValue","options"])]),_:1},8,["name"]),m(l,{name:s.strings.keywords,align:""},{content:S(()=>[m(c,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.keywords)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.keywords)||[],"onUpdate:modelValue":e[8]||(e[8]=f=>i.schemaStore.graph.properties.keywords=i.setJsonValue(f)),placeholder:s.strings.keywordsPlaceholder,"tag-placeholder":s.strings.keywordsTagPlaceholder},null,8,["options","modelValue","placeholder","tag-placeholder"])]),_:1},8,["name"]),m(l,{name:s.strings.temporalCoverage},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.temporalCoverage,"onUpdate:modelValue":e[9]||(e[9]=f=>i.schemaStore.graph.properties.temporalCoverage=f)},null,8,["modelValue"]),A("div",sY,D(s.strings.temporalCoverageDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.spatialCoverage},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.spatialCoverage,"onUpdate:modelValue":e[10]||(e[10]=f=>i.schemaStore.graph.properties.spatialCoverage=f)},null,8,["modelValue"]),A("div",nY,D(s.strings.spatialCoverageDescription),1)]),_:1},8,["name"]),m(u,{groupProp:i.schemaStore.graph.properties.subDatasets,defaults:s.subDatasetDefaults,pluralName:s.strings.subDatasets,singularName:s.strings.subDataset},{"fields-inner":S(({groupIndex:f})=>[m(l,{name:s.strings.name},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.subDatasets[f].name,"onUpdate:modelValue":p=>i.schemaStore.graph.properties.subDatasets[f].name=p},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(d,{size:"medium",modelValue:i.schemaStore.graph.properties.subDatasets[f].description,"onUpdate:modelValue":p=>i.schemaStore.graph.properties.subDatasets[f].description=p,minHeight:120},null,8,["modelValue","onUpdate:modelValue"]),A("div",rY,D(s.strings.descriptionDescription),1)]),_:2},1032,["name"])]),_:1},8,["groupProp","defaults","pluralName","singularName"]),m(u,{groupProp:i.schemaStore.graph.properties.downloads,defaults:s.downloadDefaults,pluralName:s.strings.downloads,singularName:s.strings.download},{"fields-inner":S(({groupIndex:f})=>[m(l,{name:s.strings.encodingFormat},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.downloads[f].encodingFormat,"onUpdate:modelValue":p=>i.schemaStore.graph.properties.downloads[f].encodingFormat=p},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(a,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.downloads[f].url,"onUpdate:modelValue":p=>i.schemaStore.graph.properties.downloads[f].url=p},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])]),_:1},8,["groupProp","defaults","pluralName","singularName"])])}const lY=Z(Xj,[["render",oY]]),Ae="aioseo-pro",aY={setup(){const{initSchemaEditor:n}=gt();return{COUNTRY_LIST:ah,CURRENCY_LIST:fi,EVENT_STATUS_LIST:U2,EVENT_TYPE_LIST:$2,dateJsToLocal:Ds,dateStringToLocalJs:Ts,initSchemaEditor:n,optionsStore:Lt(),rootStore:je(),schemaStore:Ie()}},components:{BaseDatePicker:_s,BaseRadio:hh,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt,FieldGroupRepeater:vr},data(){return{imageDefaults:{url:""},strings:{name:C("Name",Ae),description:C("Description",Ae),eventType:C("Type",Ae),status:C("Status",Ae),attendanceMode:C("Attendance Mode",Ae),online:C("Online",Ae),offline:C("Offline",Ae),onlineAndOffline:C("Online + Offline",Ae),dates:C("Dates",Ae),eventDate:C("Event Date",Ae),url:C("URL",Ae),location:C("Location",Ae),streetAddress:C("Street Address",Ae),locality:C("Locality",Ae),postalCode:C("Postal Code",Ae),region:C("Region",Ae),country:C("Country",Ae),nameDescription:C("The name of the place or venue where the event is being held. Leave this empty if the event doesn't take place at a physical location.",Ae),urlDescription:C("A URL for the place or venue where the event is being held.",Ae),offer:C("Offer",Ae),price:C("Price",Ae),priceDescription:C('If the event can be attended for free, set the price to "0".',Ae),currency:C("Currency",Ae),validFrom:C("Sale Start Date",Ae),offerUrlDescription:C("A URL to the page where tickets can be purchased.",Ae),type:C("Type",Ae),organizer:C("Organizer",Ae),person:C("Person",Ae),organization:C("Organization",Ae),organizationDescription:j(C("Leave this empty if you want to use the Organization you've set under %1$s.",Ae),be.getPlainLink(C("Search Appearance > Knowledge Graph",Ae),this.rootStore.aioseo.urls.aio.searchAppearance+"#/global-settings")),performer:C("Performer",Ae),images:C("Images",Ae),image:C("Image",Ae)}}},methods:{getEventType(n){return $2.find(e=>e.value===n)},saveEventType(n){this.schemaStore.graph.properties.eventType=n},getEventStatus(n){return U2.find(e=>e.value===n)},saveEventStatus(n){this.schemaStore.graph.properties.status=n},getCurrency(n){return fi.find(e=>e.value===n)},saveCurrency(n){this.schemaStore.graph.properties.offer.currency=n}},beforeMount(){const n={id:"#aioseo-event-"+new Date().getTime().toString(36),slug:"event",graphName:"Event",label:C("Event",Ae),properties:{name:"#post_title",description:"#post_excerpt",eventType:"",status:"EventScheduled",attendanceMode:"OfflineEventAttendanceMode",image:"",dates:{startDate:"",endDate:""},location:{name:"",url:"",streetAddress:"",locality:"",postalCode:"",region:"",country:""},offer:{price:"",currency:"",validFrom:"",availablity:"",url:""},organizer:{type:"Organization",name:"",url:""},performer:{type:"Organization",name:"",url:""},images:[JSON.parse(JSON.stringify(this.imageDefaults))]}};this.initSchemaEditor(n)}},hY={class:"graph-editor-fields graph-event"},cY={class:"aioseo-description"},dY={class:"aioseo-description"},uY={class:"aioseo-description"},fY={class:"aioseo-description"},pY=["innerHTML"];function gY(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-select"),c=x("base-radio"),h=x("base-date-picker"),d=x("field-group"),u=x("base-input"),f=x("core-image-uploader"),p=x("field-group-repeater");return v(),L("div",hY,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=g=>i.schemaStore.graph.properties.name=g),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=g=>i.schemaStore.graph.properties.description=g),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.eventType,align:""},{content:S(()=>[m(a,{size:"medium",options:i.EVENT_TYPE_LIST,modelValue:r.getEventType(i.schemaStore.graph.properties.eventType),"onUpdate:modelValue":e[2]||(e[2]=g=>r.saveEventType(g.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.status,align:""},{content:S(()=>[m(a,{size:"medium",options:i.EVENT_STATUS_LIST,modelValue:r.getEventStatus(i.schemaStore.graph.properties.status),"onUpdate:modelValue":e[3]||(e[3]=g=>r.saveEventStatus(g.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.attendanceMode},{content:S(()=>[m(c,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.attendanceMode==="OnlineEventAttendanceMode","onUpdate:modelValue":e[4]||(e[4]=g=>i.schemaStore.graph.properties.attendanceMode="OnlineEventAttendanceMode"),type:2},{default:S(()=>[B(D(s.strings.online),1)]),_:1},8,["modelValue"]),m(c,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.attendanceMode==="OfflineEventAttendanceMode","onUpdate:modelValue":e[5]||(e[5]=g=>i.schemaStore.graph.properties.attendanceMode="OfflineEventAttendanceMode"),type:2},{default:S(()=>[B(D(s.strings.offline),1)]),_:1},8,["modelValue"]),m(c,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.attendanceMode==="MixedEventAttendanceMode","onUpdate:modelValue":e[6]||(e[6]=g=>i.schemaStore.graph.properties.attendanceMode="MixedEventAttendanceMode"),type:2},{default:S(()=>[B(D(s.strings.onlineAndOffline),1)]),_:1},8,["modelValue"])]),_:1},8,["name"]),m(d,{header:s.strings.dates},{default:S(()=>[m(l,{name:s.strings.eventDate,align:""},{content:S(()=>[m(h,{type:"datetimerange",size:"large",dateFormat:"m/d/Y H:i:s",defaultValue:i.schemaStore.graph.properties.dates.startDate&&i.schemaStore.graph.properties.dates.endDate?[i.dateStringToLocalJs(i.schemaStore.graph.properties.dates.startDate),i.dateStringToLocalJs(i.schemaStore.graph.properties.dates.endDate)]:null,onChange:e[7]||(e[7]=g=>{i.schemaStore.graph.properties.dates.startDate=g?i.dateJsToLocal(g[0],"MM/dd/yyyy HH:mm:ss"):"",i.schemaStore.graph.properties.dates.endDate=g?i.dateJsToLocal(g[1],"MM/dd/yyyy HH:mm:ss"):""})},null,8,["defaultValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(d,{header:s.strings.location},{default:S(()=>[m(l,{name:s.strings.name},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.name,"onUpdate:modelValue":e[8]||(e[8]=g=>i.schemaStore.graph.properties.location.name=g)},null,8,["modelValue"]),A("div",cY,D(s.strings.nameDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(u,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.location.url,"onUpdate:modelValue":e[9]||(e[9]=g=>i.schemaStore.graph.properties.location.url=g)},null,8,["modelValue"]),A("div",dY,D(s.strings.urlDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.streetAddress},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.streetAddress,"onUpdate:modelValue":e[10]||(e[10]=g=>i.schemaStore.graph.properties.location.streetAddress=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.locality},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.locality,"onUpdate:modelValue":e[11]||(e[11]=g=>i.schemaStore.graph.properties.location.locality=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.postalCode},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.postalCode,"onUpdate:modelValue":e[12]||(e[12]=g=>i.schemaStore.graph.properties.location.postalCode=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.region},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.region,"onUpdate:modelValue":e[13]||(e[13]=g=>i.schemaStore.graph.properties.location.region=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.country},{content:S(()=>[m(a,{size:"medium",options:i.COUNTRY_LIST,modelValue:i.COUNTRY_LIST.find(g=>g.value===i.schemaStore.graph.properties.location.country),"onUpdate:modelValue":e[14]||(e[14]=g=>i.schemaStore.graph.properties.location.country=g.value)},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(d,{header:s.strings.offer},{default:S(()=>[m(l,{name:s.strings.price,align:""},{content:S(()=>[m(u,{size:"medium",type:"number",min:0,step:.01,modelValue:i.schemaStore.graph.properties.offer.price,"onUpdate:modelValue":e[15]||(e[15]=g=>i.schemaStore.graph.properties.offer.price=g)},null,8,["modelValue"]),A("div",uY,D(s.strings.priceDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.currency,align:""},{content:S(()=>[m(a,{size:"medium",options:i.CURRENCY_LIST,modelValue:r.getCurrency(i.schemaStore.graph.properties.offer.currency),"onUpdate:modelValue":e[16]||(e[16]=g=>r.saveCurrency(g.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.validFrom,align:""},{content:S(()=>[m(h,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.offer.validFrom),onChange:e[17]||(e[17]=g=>i.schemaStore.graph.properties.offer.validFrom=i.dateJsToLocal(g,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(u,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.offer.url,"onUpdate:modelValue":e[18]||(e[18]=g=>i.schemaStore.graph.properties.offer.url=g)},null,8,["modelValue"]),A("div",fY,D(s.strings.offerUrlDescription),1)]),_:1},8,["name"])]),_:1},8,["header"]),m(d,{header:s.strings.organizer},{default:S(()=>[m(l,{name:s.strings.type},{content:S(()=>[m(c,{size:"small",name:"organizerType",modelValue:i.schemaStore.graph.properties.organizer.type==="Person","onUpdate:modelValue":e[19]||(e[19]=g=>i.schemaStore.graph.properties.organizer.type="Person"),type:2},{default:S(()=>[B(D(s.strings.person),1)]),_:1},8,["modelValue"]),m(c,{size:"small",name:"organizerType",modelValue:i.schemaStore.graph.properties.organizer.type==="Organization","onUpdate:modelValue":e[20]||(e[20]=g=>i.schemaStore.graph.properties.organizer.type="Organization"),type:2},{default:S(()=>[B(D(s.strings.organization),1)]),_:1},8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.name},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.organizer.name,"onUpdate:modelValue":e[21]||(e[21]=g=>i.schemaStore.graph.properties.organizer.name=g)},null,8,["modelValue"]),i.schemaStore.graph.properties.organizer.type==="Organization"&&i.optionsStore.options.searchAppearance.global.schema.siteRepresents==="organization"?(v(),L("div",{key:0,class:"aioseo-description",innerHTML:s.strings.organizationDescription},null,8,pY)):O("",!0)]),_:1},8,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(u,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.organizer.url,"onUpdate:modelValue":e[22]||(e[22]=g=>i.schemaStore.graph.properties.organizer.url=g)},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(d,{header:s.strings.performer},{default:S(()=>[m(l,{name:s.strings.type},{content:S(()=>[m(c,{size:"small",name:"performerType",modelValue:i.schemaStore.graph.properties.performer.type==="Person","onUpdate:modelValue":e[23]||(e[23]=g=>i.schemaStore.graph.properties.performer.type="Person"),type:2},{default:S(()=>[B(D(s.strings.person),1)]),_:1},8,["modelValue"]),m(c,{size:"small",name:"performerType",modelValue:i.schemaStore.graph.properties.performer.type==="Organization","onUpdate:modelValue":e[24]||(e[24]=g=>i.schemaStore.graph.properties.performer.type="Organization"),type:2},{default:S(()=>[B(D(s.strings.organization),1)]),_:1},8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.name},{content:S(()=>[m(u,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.performer.name,"onUpdate:modelValue":e[25]||(e[25]=g=>i.schemaStore.graph.properties.performer.name=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(u,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.performer.url,"onUpdate:modelValue":e[26]||(e[26]=g=>i.schemaStore.graph.properties.performer.url=g)},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(p,{groupProp:i.schemaStore.graph.properties.images,defaults:s.imageDefaults,pluralName:s.strings.images,singularName:s.strings.image},{"fields-inner":S(({groupIndex:g})=>[m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(f,{modelValue:i.schemaStore.graph.properties.images[g].url,"onUpdate:modelValue":b=>i.schemaStore.graph.properties.images[g].url=b},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])]),_:1},8,["groupProp","defaults","pluralName","singularName"])])}const z7=Z(aY,[["render",gY]]),mY={key:1},CY=["innerHTML"],yY={__name:"Event",setup(n){const{hasFeature:e,graphNotIncluded:t}=ch();return(i,s)=>(v(),L("div",null,[_(e)?(v(),E(_(z7),{key:0})):O("",!0),_(e)?O("",!0):(v(),L("div",mY,[m(_(wt),{class:"feature-alert",type:"yellow"},{default:S(()=>[A("strong",{innerHTML:_(t)},null,8,CY)]),_:1}),m(_(eo),null,{default:S(()=>[m(_(z7))]),_:1})]))]))}},ho="aioseo-pro",bY={setup(){const{initSchemaEditor:n}=gt();return{initSchemaEditor:n,schemaStore:Ie()}},components:{BaseTextarea:to,CoreHtmlTagsEditor:vt,CoreSettingsRow:Ce,FieldGroupRepeater:vr},data(){return{questionDefaults:{question:"",answer:""},strings:{name:C("Name",ho),description:C("Description",ho),questions:C("Questions",ho),question:C("Question",ho),answer:C("Answer",ho)}}},beforeMount(){const n={id:"#aioseo-faq-page-"+new Date().getTime().toString(36),slug:"faq-page",graphName:"FAQPage",label:C("FAQ Page",ho),properties:{name:"#post_title",description:"",questions:[JSON.parse(JSON.stringify(this.questionDefaults))]}};this.initSchemaEditor(n)}},SY={class:"graph-editor-fields graph-faq-page"};function wY(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-input"),c=x("base-textarea"),h=x("field-group-repeater");return v(),L("div",SY,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=d=>i.schemaStore.graph.properties.name=d),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=d=>i.schemaStore.graph.properties.description=d),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(h,{groupProp:i.schemaStore.graph.properties.questions,defaults:s.questionDefaults,pluralName:s.strings.questions,singularName:s.strings.question},{"fields-inner":S(({groupIndex:d})=>[m(l,{name:s.strings.question},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.questions[d].question,"onUpdate:modelValue":u=>i.schemaStore.graph.properties.questions[d].question=u},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.answer},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.questions[d].answer,"onUpdate:modelValue":u=>i.schemaStore.graph.properties.questions[d].answer=u,minHeight:120},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])]),_:1},8,["groupProp","defaults","pluralName","singularName"])])}const vY=Z(bY,[["render",wY]]),Je="aioseo-pro",kY={setup(){const{initSchemaEditor:n}=gt();return{dateJsToLocal:Ds,dateStringToLocalJs:Ts,initSchemaEditor:n,optionsStore:Lt(),rootStore:je(),schemaStore:Ie()}},components:{BaseDatePicker:_s,BaseRadio:hh,CoreHtmlTagsEditor:vt,CoreSettingsRow:Ce,FieldGroup:Zt},data(){return{graphKey:0,strings:{name:C("Name",Je),description:C("Description",Je),descriptionDescription:C("A short summary of the claim being evaluated. It is recommended to keep this less than 75 characters.",Je),organizationDescription:j(C("Leave this empty if you want to use the Organization you've set under %1$s.",Je),be.getPlainLink(C("Search Appearance > Knowledge Graph",Je),this.rootStore.aioseo.urls.aio.searchAppearance+"#/global-settings")),claimRating:C("Rating",Je),false:C("False",Je),mostlyFalse:C("Mostly False",Je),halfTrue:C("Half True",Je),mostlyTrue:C("Mostly True",Je),true:C("True",Je),person:C("Person",Je),organization:C("Organization",Je),datePublished:C("Date Published",Je),author:C("Author",Je),authorDescription:C("The name of the author of the fact check",Je),type:C("Type",Je),url:C("URL",Je),authorType:C("Author Type",Je),authorName:C("Author Name",Je),claimAuthorDescription:C("The name of the author who published the claim.",Je),authorUrl:C("Author URL",Je),claim:C("Claim",Je),appearance:C("Appearance",Je),appearanceDescription:C("A link to, or an inline description of, the article or outlet where this claim appears.",Je)}}},beforeMount(){const n={id:"#aioseo-fact-check-"+new Date().getTime().toString(36),slug:"fact-check",graphName:"FactCheck",label:C("Fact Check",Je),properties:{name:"#post_title",claimReviewed:"",claimRating:1,datePublished:"",author:{type:"Person",name:"",url:""},claim:{appearance:"",datePublished:"",author:{type:"Organization",name:"",url:""}}}};this.initSchemaEditor(n)}},xY={class:"graph-editor-fields graph-fact-check"},MY={class:"aioseo-description"},AY={class:"aioseo-description"},DY=["innerHTML"],TY={class:"aioseo-description"},_Y={class:"aioseo-description"};function OY(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-radio"),c=x("base-date-picker"),h=x("base-input"),d=x("field-group");return v(),L("div",xY,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=u=>i.schemaStore.graph.properties.name=u),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.claimReviewed,"onUpdate:modelValue":e[1]||(e[1]=u=>i.schemaStore.graph.properties.claimReviewed=u),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"]),A("div",MY,D(s.strings.descriptionDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.claimRating},{content:S(()=>[m(a,{size:"small",name:"claimRating",modelValue:i.schemaStore.graph.properties.claimRating===1,"onUpdate:modelValue":e[2]||(e[2]=u=>i.schemaStore.graph.properties.claimRating=1),type:2},{default:S(()=>[B(D(s.strings.false),1)]),_:1},8,["modelValue"]),m(a,{size:"small",name:"claimRating",modelValue:i.schemaStore.graph.properties.claimRating===2,"onUpdate:modelValue":e[3]||(e[3]=u=>i.schemaStore.graph.properties.claimRating=2),type:2},{default:S(()=>[B(D(s.strings.mostlyFalse),1)]),_:1},8,["modelValue"]),m(a,{size:"small",name:"claimRating",modelValue:i.schemaStore.graph.properties.claimRating===3,"onUpdate:modelValue":e[4]||(e[4]=u=>i.schemaStore.graph.properties.claimRating=3),type:2},{default:S(()=>[B(D(s.strings.halfTrue),1)]),_:1},8,["modelValue"]),m(a,{size:"small",name:"claimRating",modelValue:i.schemaStore.graph.properties.claimRating===4,"onUpdate:modelValue":e[5]||(e[5]=u=>i.schemaStore.graph.properties.claimRating=4),type:2},{default:S(()=>[B(D(s.strings.mostlyTrue),1)]),_:1},8,["modelValue"]),m(a,{size:"small",name:"claimRating",modelValue:i.schemaStore.graph.properties.claimRating===5,"onUpdate:modelValue":e[6]||(e[6]=u=>i.schemaStore.graph.properties.claimRating=5),type:2},{default:S(()=>[B(D(s.strings.true),1)]),_:1},8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.datePublished,align:""},{content:S(()=>[m(c,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.datePublished),onChange:e[7]||(e[7]=u=>i.schemaStore.graph.properties.datePublished=i.dateJsToLocal(u,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"]),m(d,{header:s.strings.author},{default:S(()=>[m(l,{name:s.strings.type},{content:S(()=>[m(a,{size:"small",name:"authorType",modelValue:i.schemaStore.graph.properties.author.type==="Person","onUpdate:modelValue":e[8]||(e[8]=u=>i.schemaStore.graph.properties.author.type="Person"),type:2},{default:S(()=>[B(D(s.strings.person),1)]),_:1},8,["modelValue"]),m(a,{size:"small",name:"authorType",modelValue:i.schemaStore.graph.properties.author.type==="Organization","onUpdate:modelValue":e[9]||(e[9]=u=>i.schemaStore.graph.properties.author.type="Organization"),type:2},{default:S(()=>[B(D(s.strings.organization),1)]),_:1},8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.name},{content:S(()=>[m(h,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.author.name,"onUpdate:modelValue":e[10]||(e[10]=u=>i.schemaStore.graph.properties.author.name=u)},null,8,["modelValue"]),A("div",AY,D(s.strings.authorDescription),1),i.schemaStore.graph.properties.author.type==="Organization"&&i.optionsStore.options.searchAppearance.global.schema.siteRepresents==="organization"?(v(),L("div",{key:0,class:"aioseo-description",innerHTML:s.strings.organizationDescription},null,8,DY)):O("",!0)]),_:1},8,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(h,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.author.url,"onUpdate:modelValue":e[11]||(e[11]=u=>i.schemaStore.graph.properties.author.url=u)},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(d,{header:s.strings.claim},{default:S(()=>[m(l,{name:s.strings.appearance},{content:S(()=>[m(h,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.claim.appearance,"onUpdate:modelValue":e[12]||(e[12]=u=>i.schemaStore.graph.properties.claim.appearance=u)},null,8,["modelValue"]),A("div",TY,D(s.strings.appearanceDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.datePublished,align:""},{content:S(()=>[m(c,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.claim.datePublished),onChange:e[13]||(e[13]=u=>i.schemaStore.graph.properties.claim.datePublished=i.dateJsToLocal(u,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"]),m(l,{name:s.strings.authorType},{content:S(()=>[m(a,{size:"small",name:"claimAuthorType",modelValue:i.schemaStore.graph.properties.claim.author.type==="Person","onUpdate:modelValue":e[14]||(e[14]=u=>i.schemaStore.graph.properties.claim.author.type="Person"),type:2},{default:S(()=>[B(D(s.strings.person),1)]),_:1},8,["modelValue"]),m(a,{size:"small",name:"claimAuthorType",modelValue:i.schemaStore.graph.properties.claim.author.type==="Organization","onUpdate:modelValue":e[15]||(e[15]=u=>i.schemaStore.graph.properties.claim.author.type="Organization"),type:2},{default:S(()=>[B(D(s.strings.organization),1)]),_:1},8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.authorName},{content:S(()=>[m(h,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.claim.author.name,"onUpdate:modelValue":e[16]||(e[16]=u=>i.schemaStore.graph.properties.claim.author.name=u)},null,8,["modelValue"]),A("div",_Y,D(s.strings.claimAuthorDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.authorUrl},{content:S(()=>[m(h,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.claim.author.url,"onUpdate:modelValue":e[17]||(e[17]=u=>i.schemaStore.graph.properties.claim.author.url=u)},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"])])}const VY=Z(kY,[["render",OY]]),Ct="aioseo-pro",EY={setup(){const{getJsonValue:n,setJsonValue:e}=Sr(),{initSchemaEditor:t}=gt();return{CURRENCY_LIST:fi,getJsonValue:n,initSchemaEditor:t,schemaStore:Ie(),setJsonValue:e}},components:{BaseTextarea:to,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt,FieldGroupRepeater:vr},data(){return{stepDefaults:{name:"",text:"",image:""},strings:{name:C("Name",Ct),description:C("Description",Ct),supplies:C("Supplies",Ct),tools:C("Tools",Ct),totalTime:C("Required Time",Ct),image:C("Image",Ct),estimatedCost:C("Estimated Cost",Ct),price:C("Price",Ct),currency:C("Currency",Ct),steps:C("Steps",Ct),step:C("Step",Ct),title:C("Title",Ct),details:C("Details",Ct),url:C("URL",Ct),urlDescription:C("A URL that directly links to the step (if one is available). For example, an anchor link fragment or a video with a time offset.",Ct),supplyKeyword:C("Type to enter a supply...",Ct),supplyTagPlaceholder:C("Press enter to create a supply",Ct),toolPlaceholder:C("Type to enter a tool...",Ct),toolTagPlaceholder:C("Press enter to create a tool",Ct),days:C("Days",Ct),hours:C("Hours",Ct),minutes:C("Minutes",Ct)}}},methods:{getCurrency(n){return fi.find(e=>e.value===n)},saveCurrency(n){this.schemaStore.graph.properties.estimatedCost.currency=n}},beforeMount(){const n={id:"#aioseo-how-to-"+new Date().getTime().toString(36),slug:"how-to",graphName:"HowTo",label:C("How To",Ct),properties:{name:"#post_title",description:"",supplies:"",tools:"",totalTime:{days:"",hours:"",minutes:""},image:"",estimatedCost:{price:"",currency:""},steps:[JSON.parse(JSON.stringify(this.stepDefaults))]}};this.initSchemaEditor(n)}},PY={class:"graph-editor-fields graph-how-to"},LY={class:"aioseo-description"};function RY(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-select"),c=x("base-input"),h=x("core-image-uploader"),d=x("field-group"),u=x("base-textarea"),f=x("field-group-repeater");return v(),L("div",PY,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=p=>i.schemaStore.graph.properties.name=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=p=>i.schemaStore.graph.properties.description=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.supplies,align:""},{content:S(()=>[m(a,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.supplies)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.supplies)||[],"onUpdate:modelValue":e[2]||(e[2]=p=>i.schemaStore.graph.properties.supplies=i.setJsonValue(p)),placeholder:s.strings.supplyKeyword,"tag-placeholder":s.strings.supplyTagPlaceholder},null,8,["options","modelValue","placeholder","tag-placeholder"])]),_:1},8,["name"]),m(l,{name:s.strings.tools,align:""},{content:S(()=>[m(a,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.tools)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.tools)||[],"onUpdate:modelValue":e[3]||(e[3]=p=>i.schemaStore.graph.properties.tools=i.setJsonValue(p)),placeholder:s.strings.toolPlaceholder,"tag-placeholder":s.strings.toolTagPlaceholder},null,8,["options","modelValue","placeholder","tag-placeholder"])]),_:1},8,["name"]),m(l,{class:"required-time",name:s.strings.totalTime,align:""},{content:S(()=>[A("div",null,[A("strong",null,D(s.strings.days),1),m(c,{type:"number",size:"medium",min:0,modelValue:i.schemaStore.graph.properties.totalTime.days,"onUpdate:modelValue":e[4]||(e[4]=p=>i.schemaStore.graph.properties.totalTime.days=p)},null,8,["modelValue"])]),A("div",null,[A("strong",null,D(s.strings.hours),1),m(c,{type:"number",size:"medium",min:0,max:24,modelValue:i.schemaStore.graph.properties.totalTime.hours,"onUpdate:modelValue":e[5]||(e[5]=p=>i.schemaStore.graph.properties.totalTime.hours=p)},null,8,["modelValue"])]),A("div",null,[A("strong",null,D(s.strings.minutes),1),m(c,{type:"number",size:"medium",min:0,max:60,modelValue:i.schemaStore.graph.properties.totalTime.minutes,"onUpdate:modelValue":e[6]||(e[6]=p=>i.schemaStore.graph.properties.totalTime.minutes=p)},null,8,["modelValue"])])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(h,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[7]||(e[7]=p=>i.schemaStore.graph.properties.image=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(d,{header:s.strings.estimatedCost},{default:S(()=>[m(l,{name:s.strings.price,align:""},{content:S(()=>[m(c,{size:"medium",type:"number",min:0,step:.01,modelValue:i.schemaStore.graph.properties.estimatedCost.price,"onUpdate:modelValue":e[8]||(e[8]=p=>i.schemaStore.graph.properties.estimatedCost.price=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.currency,align:""},{content:S(()=>[m(a,{size:"medium",options:i.CURRENCY_LIST,modelValue:r.getCurrency(i.schemaStore.graph.properties.estimatedCost.currency),"onUpdate:modelValue":e[9]||(e[9]=p=>r.saveCurrency(p.value))},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(f,{groupProp:i.schemaStore.graph.properties.steps,defaults:s.stepDefaults,pluralName:s.strings.steps,singularName:s.strings.step},{"fields-inner":S(({groupIndex:p})=>[m(l,{name:s.strings.title,align:""},{content:S(()=>[m(c,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.steps[p].name,"onUpdate:modelValue":g=>i.schemaStore.graph.properties.steps[p].name=g},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.details,align:""},{content:S(()=>[m(u,{size:"medium",modelValue:i.schemaStore.graph.properties.steps[p].text,"onUpdate:modelValue":g=>i.schemaStore.graph.properties.steps[p].text=g,minHeight:120},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.url,align:""},{content:S(()=>[m(c,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.steps[p].url,"onUpdate:modelValue":g=>i.schemaStore.graph.properties.steps[p].url=g},null,8,["modelValue","onUpdate:modelValue"]),A("div",LY,D(s.strings.urlDescription),1)]),_:2},1032,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(h,{modelValue:i.schemaStore.graph.properties.steps[p].image,"onUpdate:modelValue":g=>i.schemaStore.graph.properties.steps[p].image=g},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])]),_:1},8,["groupProp","defaults","pluralName","singularName"])])}const BY=Z(EY,[["render",RY]]),ve="aioseo-pro",HY={setup(){const{initSchemaEditor:n}=gt();return{COUNTRY_LIST:ah,CURRENCY_LIST:fi,GLOBAL_STRINGS:St,JOBPOSTING_DEGREE_TYPE_LIST:K2,JOBPOSTING_EMPLOYMENT_TYPE_LIST:G2,JOBPOSTING_SALARY_INTERVAL_TYPE_LIST:q2,dateJsToLocal:Ds,dateStringToLocalJs:Ts,initSchemaEditor:n,optionsStore:Lt(),rootStore:je(),schemaStore:Ie()}},components:{BaseDatePicker:_s,BaseRadioToggle:br,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt},data(){return{locationDefaults:{type:"City",name:""},strings:{title:C("Job Title",ve),description:C("Description",ve),dates:C("Dates",ve),datePosted:C("Publish Date",ve),dateExpires:C("Expiration Date",ve),employmentType:C("Employment Type",ve),remote:C("Work from Home",ve),remoteDescription:C("Enable this if the job is 100% remote.",ve),hiringOrganization:C("Hiring Organization",ve),name:C("Name",ve),url:C("URL",ve),logo:C("Logo",ve),locations:C("Locations",ve),location:C("Location",ve),type:C("Type",ve),city:C("City",ve),state:C("State",ve),streetAddress:C("Street Address",ve),locality:C("Locality",ve),postalCode:C("Postal Code",ve),region:C("Region",ve),country:C("Country",ve),salary:C("Salary",ve),range:C("Pay Range",ve),minimum:C("Minimum",ve),maximum:C("Maximum",ve),interval:C("Pay Interval",ve),currency:C("Currency",ve),requirements:C("Requirements",ve),experienceInsteadOfEducation:C("Experience instead of Education",ve),experienceInsteadOfEducationDescription:C("Whether the organization accepts experience in place of the educational qualifications.",ve),monthsOfExperience:C("Months of Experience",ve),requiredDegree:C("Required Degree",ve),requiredDegreeDescription:C("The specifics of the required degree/certificate should be described in the description field above.",ve),organizationDescription:j(C("Leave this empty if you want to use the Organization you've set under %1$s.",ve),be.getPlainLink(C("Search Appearance > Knowledge Graph",ve),this.rootStore.aioseo.urls.aio.searchAppearance+"#/global-settings"))}}},methods:{getEmploymentType(n){return G2.find(e=>e.value===n)},saveEmploymentType(n){this.schemaStore.graph.properties.employmentType=n},getSalaryIntervalType(n){return q2.find(e=>e.value===n)},saveSalaryIntervalType(n){this.schemaStore.graph.properties.salary.interval=n},getCurrency(n){return fi.find(e=>e.value===n)},saveCurrency(n){this.schemaStore.graph.properties.salary.currency=n},getDegree(n){return K2.find(e=>e.value===n)},saveDegree(n){this.schemaStore.graph.properties.requirements.degree=n}},beforeMount(){const n={id:"#aioseo-job-posting-"+new Date().getTime().toString(36),slug:"job-posting",graphName:"JobPosting",label:C("Job Posting",ve),properties:{name:"#post_title",description:"#post_excerpt",employmentType:"",remote:!1,dates:{datePosted:"",dateExpires:""},hiringOrganization:{name:"",url:"",image:""},location:{streetAddress:"",locality:"",postalCode:"",region:"",country:""},salary:{minimum:"",maximum:"",interval:"",currency:""},requirements:{experienceInsteadOfEducation:!1,experience:"",degree:""},locations:[JSON.parse(JSON.stringify(this.locationDefaults))]}};this.initSchemaEditor(n)}},NY={class:"graph-editor-fields graph-job-posting"},FY=["innerHTML"],IY={class:"aioseo-description"},WY={class:"aioseo-description"};function zY(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-select"),c=x("base-input"),h=x("field-group"),d=x("core-image-uploader"),u=x("base-radio-toggle"),f=x("base-date-picker");return v(),L("div",NY,[m(l,{name:s.strings.title},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=p=>i.schemaStore.graph.properties.name=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=p=>i.schemaStore.graph.properties.description=p),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.employmentType,align:""},{content:S(()=>[m(a,{size:"medium",options:i.JOBPOSTING_EMPLOYMENT_TYPE_LIST,modelValue:r.getEmploymentType(i.schemaStore.graph.properties.employmentType),"onUpdate:modelValue":e[2]||(e[2]=p=>r.saveEmploymentType(p.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),i.schemaStore.graph.properties.remote?O("",!0):(v(),E(h,{key:0,header:s.strings.location},{default:S(()=>[m(l,{name:s.strings.streetAddress},{content:S(()=>[m(c,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.streetAddress,"onUpdate:modelValue":e[3]||(e[3]=p=>i.schemaStore.graph.properties.location.streetAddress=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.locality},{content:S(()=>[m(c,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.locality,"onUpdate:modelValue":e[4]||(e[4]=p=>i.schemaStore.graph.properties.location.locality=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.postalCode},{content:S(()=>[m(c,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.postalCode,"onUpdate:modelValue":e[5]||(e[5]=p=>i.schemaStore.graph.properties.location.postalCode=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.region},{content:S(()=>[m(c,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.region,"onUpdate:modelValue":e[6]||(e[6]=p=>i.schemaStore.graph.properties.location.region=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.country},{content:S(()=>[m(a,{size:"medium",options:i.COUNTRY_LIST,modelValue:i.COUNTRY_LIST.find(p=>p.value===i.schemaStore.graph.properties.location.country),"onUpdate:modelValue":e[7]||(e[7]=p=>i.schemaStore.graph.properties.location.country=p.value)},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"])),m(h,{header:s.strings.hiringOrganization},{default:S(()=>[m(l,{name:s.strings.name},{content:S(()=>[m(c,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.hiringOrganization.name,"onUpdate:modelValue":e[8]||(e[8]=p=>i.schemaStore.graph.properties.hiringOrganization.name=p)},null,8,["modelValue"]),i.optionsStore.options.searchAppearance.global.schema.siteRepresents==="organization"?(v(),L("div",{key:0,class:"aioseo-description",innerHTML:s.strings.organizationDescription},null,8,FY)):O("",!0)]),_:1},8,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(c,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.hiringOrganization.url,"onUpdate:modelValue":e[9]||(e[9]=p=>i.schemaStore.graph.properties.hiringOrganization.url=p)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.logo,align:""},{content:S(()=>[m(d,{modelValue:i.schemaStore.graph.properties.hiringOrganization.image,"onUpdate:modelValue":e[10]||(e[10]=p=>i.schemaStore.graph.properties.hiringOrganization.image=p)},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(h,{header:s.strings.salary},{default:S(()=>[m(l,{class:"salary-range",name:s.strings.range,align:""},{content:S(()=>[A("div",null,[A("strong",null,D(s.strings.minimum),1),m(c,{type:"number",size:"medium",min:0,modelValue:i.schemaStore.graph.properties.salary.minimum,"onUpdate:modelValue":e[11]||(e[11]=p=>i.schemaStore.graph.properties.salary.minimum=p)},null,8,["modelValue"])]),A("div",null,[A("strong",null,D(s.strings.maximum),1),m(c,{type:"number",size:"medium",min:0,modelValue:i.schemaStore.graph.properties.salary.maximum,"onUpdate:modelValue":e[12]||(e[12]=p=>i.schemaStore.graph.properties.salary.maximum=p)},null,8,["modelValue"])])]),_:1},8,["name"]),m(l,{name:s.strings.interval,align:""},{content:S(()=>[m(a,{size:"medium",options:i.JOBPOSTING_SALARY_INTERVAL_TYPE_LIST,modelValue:r.getSalaryIntervalType(i.schemaStore.graph.properties.salary.interval),"onUpdate:modelValue":e[13]||(e[13]=p=>r.saveSalaryIntervalType(p.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.currency,align:""},{content:S(()=>[m(a,{size:"medium",options:i.CURRENCY_LIST,modelValue:r.getCurrency(i.schemaStore.graph.properties.salary.currency),"onUpdate:modelValue":e[14]||(e[14]=p=>r.saveCurrency(p.value))},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(h,{header:s.strings.requirements},{default:S(()=>[m(l,{name:s.strings.experienceInsteadOfEducation,align:""},{content:S(()=>[m(u,{name:"experienceInsteadOfEducation",modelValue:i.schemaStore.graph.properties.requirements.experienceInsteadOfEducation,"onUpdate:modelValue":e[15]||(e[15]=p=>i.schemaStore.graph.properties.requirements.experienceInsteadOfEducation=p),options:[{label:i.GLOBAL_STRINGS.no,value:!1,activeClass:"dark"},{label:i.GLOBAL_STRINGS.yes,value:!0}]},null,8,["modelValue","options"]),A("div",IY,D(s.strings.experienceInsteadOfEducationDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.monthsOfExperience,align:""},{content:S(()=>[A("div",null,[m(c,{type:"number",size:"medium",min:0,modelValue:i.schemaStore.graph.properties.salary.experience,"onUpdate:modelValue":e[16]||(e[16]=p=>i.schemaStore.graph.properties.salary.experience=p)},null,8,["modelValue"])])]),_:1},8,["name"]),m(l,{name:s.strings.requiredDegree,align:""},{content:S(()=>[m(a,{size:"medium",options:i.JOBPOSTING_DEGREE_TYPE_LIST,modelValue:r.getDegree(i.schemaStore.graph.properties.requirements.degree),"onUpdate:modelValue":e[17]||(e[17]=p=>r.saveDegree(p.value))},null,8,["options","modelValue"]),A("div",WY,D(s.strings.requiredDegreeDescription),1)]),_:1},8,["name"])]),_:1},8,["header"]),m(h,{header:s.strings.dates},{default:S(()=>[m(l,{name:s.strings.datePosted,align:""},{content:S(()=>[m(f,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.dates.datePosted),onChange:e[18]||(e[18]=p=>i.schemaStore.graph.properties.dates.datePosted=i.dateJsToLocal(p,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"]),m(l,{name:s.strings.dateExpires,align:""},{content:S(()=>[m(f,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.dates.dateExpires),onChange:e[19]||(e[19]=p=>i.schemaStore.graph.properties.dates.dateExpires=i.dateJsToLocal(p,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"])]),_:1},8,["header"])])}const U7=Z(HY,[["render",zY]]),UY={key:1},$Y=["innerHTML"],KY={__name:"JobPosting",setup(n){const{hasFeature:e,graphNotIncluded:t}=ch();return(i,s)=>(v(),L("div",null,[_(e)?(v(),E(_(U7),{key:0})):O("",!0),_(e)?O("",!0):(v(),L("div",UY,[m(_(wt),{class:"feature-alert",type:"yellow"},{default:S(()=>[A("strong",{innerHTML:_(t)},null,8,$Y)]),_:1}),m(_(eo),null,{default:S(()=>[m(_(U7))]),_:1})]))]))}},co="aioseo-pro",GY={setup(){const{initSchemaEditor:n}=gt();return{dateJsToLocal:Ds,dateStringToLocalJs:Ts,initSchemaEditor:n,schemaStore:Ie()}},components:{BaseDatePicker:_s,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,Review:yh,ReviewRating:yl},data(){return{strings:{name:C("Name",co),description:C("Description",co),director:C("Director",co),releaseDate:C("Release Date",co),image:C("Image",co)}}},beforeMount(){const n={id:"#aioseo-movie-"+new Date().getTime().toString(36),slug:"movie",graphName:"Movie",label:C("Movie",co),properties:{name:"#post_title",description:"",director:"",releaseDate:"",image:"",rating:{minimum:1,maximum:5},review:{rating:"",headline:"",content:"",author:"#author_name"}}};this.initSchemaEditor(n)}},qY={class:"graph-editor-fields graph-movie"};function ZY(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-input"),c=x("base-date-picker"),h=x("core-image-uploader"),d=x("review"),u=x("review-rating");return v(),L("div",qY,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=f=>i.schemaStore.graph.properties.name=f),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=f=>i.schemaStore.graph.properties.description=f),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.director},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.director,"onUpdate:modelValue":e[2]||(e[2]=f=>i.schemaStore.graph.properties.director=f)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.releaseDate,align:""},{content:S(()=>[m(c,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.releaseDate),onChange:e[3]||(e[3]=f=>i.schemaStore.graph.properties.releaseDate=i.dateJsToLocal(f,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(h,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[4]||(e[4]=f=>i.schemaStore.graph.properties.image=f)},null,8,["modelValue"])]),_:1},8,["name"]),m(d,{reviewProp:i.schemaStore.graph.properties.review,multiple:!1},null,8,["reviewProp"]),m(u)])}const jY=Z(GY,[["render",ZY]]),xr="aioseo-pro",YY={setup(){const{initSchemaEditor:n}=gt();return{initSchemaEditor:n,schemaStore:Ie()}},components:{BaseRadio:hh,BaseTextarea:to,CoreImageUploader:Gt,CoreSettingsRow:Ce},data(){return{strings:{type:C("Type",xr),name:C("Name",xr),description:C("Description",xr),musicGroup:C("Music Group",xr),musicAlbum:C("Music Album",xr),image:C("Image",xr)}}},beforeMount(){const n={id:"#aioseo-music-"+new Date().getTime().toString(36),slug:"music",graphName:"Music",label:C("Music",xr),properties:{name:"",description:"",type:"MusicGroup",image:""}};this.initSchemaEditor(n)}},JY={class:"graph-editor-fields graph-music"};function XY(n,e,t,i,s,r){const o=x("base-radio"),l=x("core-settings-row"),a=x("base-input"),c=x("base-textarea"),h=x("core-image-uploader");return v(),L("div",JY,[m(l,{name:s.strings.type},{content:S(()=>[m(o,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.type==="MusicGroup","onUpdate:modelValue":e[0]||(e[0]=d=>i.schemaStore.graph.properties.type="MusicGroup"),type:2},{default:S(()=>[B(D(s.strings.musicGroup),1)]),_:1},8,["modelValue"]),m(o,{size:"small",name:"type",modelValue:i.schemaStore.graph.properties.type==="MusicAlbum","onUpdate:modelValue":e[1]||(e[1]=d=>i.schemaStore.graph.properties.type="MusicAlbum"),type:2},{default:S(()=>[B(D(s.strings.musicAlbum),1)]),_:1},8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.name},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[2]||(e[2]=d=>i.schemaStore.graph.properties.name=d)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[3]||(e[3]=d=>i.schemaStore.graph.properties.description=d),minHeight:120},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(h,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[4]||(e[4]=d=>i.schemaStore.graph.properties.image=d)},null,8,["modelValue"])]),_:1},8,["name"])])}const QY=Z(YY,[["render",XY]]),Gi="aioseo-pro",eJ={setup(){const{initSchemaEditor:n}=gt();return{initSchemaEditor:n,schemaStore:Ie(),COUNTRY_LIST:ah}},components:{CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt},data(){return{strings:{name:C("Name",Gi),description:C("Description",Gi),email:C("Email",Gi),jobTitle:C("Job Title",Gi),location:C("Location",Gi),streetAddress:C("Street Address",Gi),locality:C("Locality",Gi),postalCode:C("Postal Code",Gi),region:C("Region",Gi),country:C("Country",Gi),image:C("Image",Gi)}}},beforeMount(){const n={id:"#aioseo-person-"+new Date().getTime().toString(36),slug:"person",graphName:"Person",label:C("Person",Gi),properties:{name:"#post_title",description:"",email:"",jobTitle:"",image:"",location:{streetAddress:"",locality:"",postalCode:"",region:"",country:""}}};this.initSchemaEditor(n)}},tJ={class:"graph-editor-fields graph-person"};function iJ(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-input"),c=x("core-image-uploader"),h=x("base-select"),d=x("field-group");return v(),L("div",tJ,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=u=>i.schemaStore.graph.properties.name=u),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","author_name"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=u=>i.schemaStore.graph.properties.description=u),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.email},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.email,"onUpdate:modelValue":e[2]||(e[2]=u=>i.schemaStore.graph.properties.email=u)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.jobTitle},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.jobTitle,"onUpdate:modelValue":e[3]||(e[3]=u=>i.schemaStore.graph.properties.jobTitle=u)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[4]||(e[4]=u=>i.schemaStore.graph.properties.image=u)},null,8,["modelValue"])]),_:1},8,["name"]),m(d,{header:s.strings.location},{default:S(()=>[m(l,{name:s.strings.streetAddress},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.streetAddress,"onUpdate:modelValue":e[5]||(e[5]=u=>i.schemaStore.graph.properties.location.streetAddress=u)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.locality},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.locality,"onUpdate:modelValue":e[6]||(e[6]=u=>i.schemaStore.graph.properties.location.locality=u)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.postalCode},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.postalCode,"onUpdate:modelValue":e[7]||(e[7]=u=>i.schemaStore.graph.properties.location.postalCode=u)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.region},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.location.region,"onUpdate:modelValue":e[8]||(e[8]=u=>i.schemaStore.graph.properties.location.region=u)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.country},{content:S(()=>[m(h,{size:"medium",options:i.COUNTRY_LIST,modelValue:i.COUNTRY_LIST.find(u=>u.value===i.schemaStore.graph.properties.location.country),"onUpdate:modelValue":e[9]||(e[9]=u=>i.schemaStore.graph.properties.location.country=u.value)},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"])])}const sJ=Z(eJ,[["render",iJ]]),an="aioseo-pro",nJ={components:{CoreSettingsRow:Ce,FieldGroup:Zt},props:{deliveryTime:{type:Object,required:!0,default:()=>({handlingTime:{minValue:"",maxValue:""},transitTime:{minValue:"",maxValue:""}})},onChange:{type:Function,required:!0}},data(){return{strings:{deliveryTime:C("Delivery Time",an),minimumHandling:C("Minimum Handling Time",an),minimumHandlingDescription:C("The minimum delay in days between the receipt of the order and the goods leaving the warehouse.",an),maximumHandling:C("Maximum Handling Time",an),maximumHandlingDescription:C("The maximum delay in days between the receipt of the order and the goods leaving the warehouse.",an),minimumTransit:C("Minimum Transit Time",an),minimumTransitDescription:C("The minimum delay in days between when the order has been sent for delivery and when the goods reach the final customer.",an),maximumTransit:C("Maximum Transit Time",an),maximumTransitDescription:C("The maximum delay in days between when the order has been sent for delivery and when the goods reach the final customer.",an)}}},methods:{updateDeliveryTime(n,e,t){const i={...this.deliveryTime};i[n][e]=!isNaN(t)&&t!==""?parseInt(t):"",this.onChange(i)}}},rJ={class:"aioseo-description"},oJ={class:"aioseo-description"},lJ={class:"aioseo-description"},aJ={class:"aioseo-description"};function hJ(n,e,t,i,s,r){const o=x("base-input"),l=x("core-settings-row"),a=x("field-group");return v(),E(a,{header:s.strings.deliveryTime},{default:S(()=>[m(l,{name:s.strings.minimumHandling,align:""},{content:S(()=>{var c,h;return[m(o,{size:"medium",type:"number",modelValue:(h=(c=t.deliveryTime)==null?void 0:c.handlingTime)==null?void 0:h.minValue,"onUpdate:modelValue":e[0]||(e[0]=d=>r.updateDeliveryTime("handlingTime","minValue",d)),min:0,step:1},null,8,["modelValue"]),A("div",rJ,D(s.strings.minimumHandlingDescription),1)]}),_:1},8,["name"]),m(l,{name:s.strings.maximumHandling,align:""},{content:S(()=>{var c,h;return[m(o,{size:"medium",type:"number",modelValue:(h=(c=t.deliveryTime)==null?void 0:c.handlingTime)==null?void 0:h.maxValue,"onUpdate:modelValue":e[1]||(e[1]=d=>r.updateDeliveryTime("handlingTime","maxValue",d)),min:0,step:1},null,8,["modelValue"]),A("div",oJ,D(s.strings.maximumHandlingDescription),1)]}),_:1},8,["name"]),m(l,{name:s.strings.minimumTransit,align:""},{content:S(()=>{var c,h;return[m(o,{size:"medium",type:"number",modelValue:(h=(c=t.deliveryTime)==null?void 0:c.transitTime)==null?void 0:h.minValue,"onUpdate:modelValue":e[2]||(e[2]=d=>r.updateDeliveryTime("transitTime","minValue",d)),min:0,step:1},null,8,["modelValue"]),A("div",lJ,D(s.strings.minimumTransitDescription),1)]}),_:1},8,["name"]),m(l,{name:s.strings.maximumTransit,align:""},{content:S(()=>{var c,h;return[m(o,{size:"medium",type:"number",modelValue:(h=(c=t.deliveryTime)==null?void 0:c.transitTime)==null?void 0:h.maxValue,"onUpdate:modelValue":e[3]||(e[3]=d=>r.updateDeliveryTime("transitTime","maxValue",d)),min:0,step:1},null,8,["modelValue"]),A("div",aJ,D(s.strings.maximumTransitDescription),1)]}),_:1},8,["name"])]),_:1},8,["header"])}const cJ=Z(nJ,[["render",hJ]]),me="aioseo-pro",dJ={setup(){const{getJsonValue:n,setJsonValue:e}=Sr(),{initSchemaEditor:t}=gt();return{COUNTRY_LIST:ah,CURRENCY_LIST:fi,GLOBAL_STRINGS:St,SCHEMA_AVAILABILITY:Mf,SCHEMA_ENERGY_RATING:Af,SCHEMA_GENDER:Df,dateJsToLocal:Ds,dateStringToLocalJs:Ts,getJsonValue:n,initSchemaEditor:t,postEditorStore:Te(),rootStore:je(),schemaStore:Ie(),setJsonValue:e}},components:{BaseDatePicker:_s,BaseRadioToggle:br,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,DeliveryTime:cJ,FieldGroup:Zt,FieldGroupRepeater:vr,Review:yh,ReviewRating:yl},data(){return{energyRatingKey:0,reviewDefaults:{rating:"",headline:"",content:"",author:""},shippingDestinationDefaults:{type:"country",country:"",postalCodes:[],states:[],rate:0,handlingTime:"",deliveryTime:{handlingTime:{minValue:"",maxValue:"",unitCode:"DAY"},transitTime:{minValue:"",maxValue:"",unitCode:"DAY"}}},strings:{autogenerate:C("Autogenerate Fields",me),name:C("Name",me),description:C("Description",me),brand:C("Brand",me),image:C("Image",me),identifiers:C("Identifiers",me),sku:"SKU",mpn:"MPN",gtin:"GTIN",isbn:"ISBN",offer:C("Offer",me),price:C("Price",me),currency:C("Currency",me),priceValidUntil:C("Price Valid Until",me),priceValidDescription:C("The date until this pricing lasts (optional).",me),availability:C("Availability",me),reviews:C("Reviews",me),review:C("Review",me),shippingDestinations:C("Shipping Destinations",me),shippingDestination:C("Shipping Destination",me),destinationType:C("Type",me),country:C("Country",me),states:C("States",me),statesDescription:C('Enter one or multiple ISO 3166-2 subdivision codes for the states that you ship to. Currently, Google only supports the US, Australia, and Japan. Examples: "NY" (for US, state of New York), "NSW" (for Australia, state of New South Wales), or "03" (for Japan, Iwate prefecture).',me),postalCode:C("Postal Code",me),postalCodeDescription:C("You can enter one or multiple postal codes here if you only ship to certain parts of the country or if this rate only applies to specific postal codes. You cannot combine this together with states.",me),placeholderPostalCode:C("Type to enter a postal code...",me),tagPlaceholderPostalCode:C("Press enter to create a postal code",me),placeholderState:C("Type to enter a state...",me),tagPlaceholderState:C("Press enter to create a state",me),priceDescription:C('Enter "0" if you offer free shipping to this destination.',me),audience:C("Audience",me),gender:C("Gender",me),minimumAge:C("Minimum Age",me),maximumAge:C("Maximum Age",me),attributes:C("Attributes",me),material:C("Material",me),color:C("Color",me),pattern:C("Pattern",me),patternDescription:C('The pattern of the product, such as "polka dots" or "striped", if applicable.',me),size:C("Size",me),sizeDescription:C('A human readable name for the size, such as "XL", if applicable. Do not enter the dimensions of the product.',me),energyRating:C("EU Energy Rating",me)}}},computed:{isEddActive(){return this.rootStore.aioseo.data.isEddActive&&this.postEditorStore.currentPost.postType==="download"},isWooCommerceActive(){return this.rootStore.aioseo.data.isWooCommerceActive&&this.postEditorStore.currentPost.postType==="product"},autogenerateDescription(){return j(C("Disable this setting if you'd like to edit all fields manually instead of letting %1$s automatically generate them for you based on the product data from %2$s.",me),"AIOSEO",this.isEddActive?"Easy Digital Downloads":"WooCommerce")},hideFieldEdd(){return this.schemaStore.graph.properties.autogenerate&&this.isEddActive},hideFieldWooCommerce(){return this.schemaStore.graph.properties.autogenerate&&this.isWooCommerceActive},wooCommerceReviewsEnabled(){var n,e;return this.isWooCommerceActive&&((e=(n=this.rootStore.aioseo.data)==null?void 0:n.wooCommerce)==null?void 0:e.reviewsEnabled)}},methods:{getAvailability(n){return Mf.find(e=>e.value===n)},saveAvailability(n){this.schemaStore.graph.properties.offer.availability=n},getCurrency(n){return fi.find(e=>e.value===n)},saveCurrency(n){this.schemaStore.graph.properties.offer.currency=n},getGender(n){return Df.find(e=>e.value===n)},saveGender(n){this.schemaStore.graph.properties.audience.gender=n},getEnergyRating(n){return Af.find(e=>e.value===n)},saveEnergyRating(n){this.schemaStore.graph.properties.attributes.energyRating=n,this.energyRatingKey++}},beforeMount(){const n={id:"#aioseo-product-"+new Date().getTime().toString(36),slug:"product",graphName:"Product",label:C("Product",me),properties:{autogenerate:!0,name:"#post_title",description:"#post_excerpt",brand:"",image:"",identifiers:{sku:"",gtin:"",mpn:"",isbn:""},offer:{price:"",currency:"",availability:"",validUntil:""},attributes:{material:"",color:"",pattern:"",size:"",energyRating:""},audience:{gender:"Unisex",minimumAge:"",maximumAge:""},rating:{minimum:1,maximum:5},reviews:[JSON.parse(JSON.stringify(this.reviewDefaults))],shippingDestinations:[JSON.parse(JSON.stringify(this.shippingDestinationDefaults))]}};this.initSchemaEditor(n)},async mounted(){this.schemaStore.graph.id||await xd().then(n=>{var e;(e=this.schemaStore.graph)!=null&&e.properties&&(this.schemaStore.graph.properties.image=n,this.$nextTick(()=>{this.schemaStore.isDirty=!1}))})}},uJ={class:"graph-editor-fields graph-product"},fJ={class:"aioseo-description"},pJ={class:"aioseo-description"},gJ={class:"aioseo-description"},mJ={class:"aioseo-description"},CJ={class:"aioseo-description"},yJ={class:"aioseo-description"},bJ={class:"aioseo-description"};function SJ(n,e,t,i,s,r){const o=x("base-radio-toggle"),l=x("core-settings-row"),a=x("core-html-tags-editor"),c=x("base-input"),h=x("core-image-uploader"),d=x("field-group"),u=x("base-select"),f=x("base-date-picker"),p=x("review"),g=x("field-group-repeater"),b=x("review-rating"),y=x("delivery-time");return v(),L("div",uJ,[r.isEddActive||r.isWooCommerceActive?(v(),E(l,{key:0,name:s.strings.autogenerate,align:""},{content:S(()=>[m(o,{name:"autogenerate",modelValue:i.schemaStore.graph.properties.autogenerate,"onUpdate:modelValue":e[0]||(e[0]=w=>i.schemaStore.graph.properties.autogenerate=w),options:[{label:i.GLOBAL_STRINGS.no,value:!1,activeClass:"dark"},{label:i.GLOBAL_STRINGS.yes,value:!0}]},null,8,["modelValue","options"]),A("div",fJ,D(r.autogenerateDescription),1)]),_:1},8,["name"])):O("",!0),!r.hideFieldWooCommerce&&!r.hideFieldEdd?(v(),E(l,{key:1,name:s.strings.name},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[1]||(e[1]=w=>i.schemaStore.graph.properties.name=w),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"])):O("",!0),r.hideFieldWooCommerce?O("",!0):(v(),E(l,{key:2,name:s.strings.description},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[2]||(e[2]=w=>i.schemaStore.graph.properties.description=w),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"])),!i.rootStore.aioseo.data.wooCommerce||!i.rootStore.aioseo.data.wooCommerce.isWooCommerceBrandsActive&&!i.rootStore.aioseo.data.wooCommerce.isPerfectBrandsActive?(v(),E(l,{key:3,name:s.strings.brand,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.brand,"onUpdate:modelValue":e[3]||(e[3]=w=>i.schemaStore.graph.properties.brand=w)},null,8,["modelValue"])]),_:1},8,["name"])):O("",!0),!r.hideFieldWooCommerce&&!r.hideFieldEdd?(v(),E(l,{key:4,class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(h,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[4]||(e[4]=w=>i.schemaStore.graph.properties.image=w)},null,8,["modelValue"])]),_:1},8,["name"])):O("",!0),m(d,{header:s.strings.identifiers},{default:S(()=>[r.hideFieldWooCommerce?O("",!0):(v(),E(l,{key:0,name:s.strings.sku,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.sku,"onUpdate:modelValue":e[5]||(e[5]=w=>i.schemaStore.graph.properties.identifiers.sku=w)},null,8,["modelValue"])]),_:1},8,["name"])),!i.rootStore.aioseo.data.wooCommerce||!i.rootStore.aioseo.data.wooCommerce.isWooCommerceUpcEanIsbnActive?(v(),E(l,{key:1,name:s.strings.gtin,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.gtin,"onUpdate:modelValue":e[6]||(e[6]=w=>i.schemaStore.graph.properties.identifiers.gtin=w)},null,8,["modelValue"])]),_:1},8,["name"])):O("",!0),m(l,{name:s.strings.mpn,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.mpn,"onUpdate:modelValue":e[7]||(e[7]=w=>i.schemaStore.graph.properties.identifiers.mpn=w)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.isbn,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.isbn,"onUpdate:modelValue":e[8]||(e[8]=w=>i.schemaStore.graph.properties.identifiers.isbn=w)},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),r.hideFieldWooCommerce?O("",!0):(v(),E(d,{key:5,header:s.strings.offer},{default:S(()=>[r.hideFieldEdd?O("",!0):(v(),E(l,{key:0,name:s.strings.price,align:""},{content:S(()=>[m(c,{size:"medium",type:"number",min:0,step:.01,modelValue:i.schemaStore.graph.properties.offer.price,"onUpdate:modelValue":e[9]||(e[9]=w=>i.schemaStore.graph.properties.offer.price=w)},null,8,["modelValue"])]),_:1},8,["name"])),r.hideFieldEdd?O("",!0):(v(),E(l,{key:1,name:s.strings.currency,align:""},{content:S(()=>[m(u,{size:"medium",options:i.CURRENCY_LIST,modelValue:r.getCurrency(i.schemaStore.graph.properties.offer.currency),"onUpdate:modelValue":e[10]||(e[10]=w=>r.saveCurrency(w.value))},null,8,["options","modelValue"])]),_:1},8,["name"])),m(l,{name:s.strings.priceValidUntil,align:""},{content:S(()=>[m(f,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.offer.validUntil),onChange:e[11]||(e[11]=w=>i.schemaStore.graph.properties.offer.validUntil=i.dateJsToLocal(w,"MM/dd/yyyy"))},null,8,["defaultValue"]),A("div",pJ,D(s.strings.priceValidDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.availability,align:""},{content:S(()=>[m(u,{class:"aioseo-product-availibility",size:"medium",options:i.SCHEMA_AVAILABILITY,modelValue:r.getAvailability(i.schemaStore.graph.properties.offer.availability),"onUpdate:modelValue":e[12]||(e[12]=w=>r.saveAvailability(w.value))},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"])),r.hideFieldEdd?O("",!0):(v(),E(d,{key:6,header:s.strings.attributes},{default:S(()=>[m(l,{name:s.strings.material,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.material,"onUpdate:modelValue":e[13]||(e[13]=w=>i.schemaStore.graph.properties.attributes.material=w)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.color,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.color,"onUpdate:modelValue":e[14]||(e[14]=w=>i.schemaStore.graph.properties.attributes.color=w)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.pattern,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.pattern,"onUpdate:modelValue":e[15]||(e[15]=w=>i.schemaStore.graph.properties.attributes.pattern=w)},null,8,["modelValue"]),A("div",gJ,D(s.strings.patternDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.size,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.size,"onUpdate:modelValue":e[16]||(e[16]=w=>i.schemaStore.graph.properties.attributes.size=w)},null,8,["modelValue"]),A("div",mJ,D(s.strings.sizeDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.energyRating,align:""},{content:S(()=>[(v(),E(u,{key:s.energyRatingKey,class:"aioseo-product-gender",size:"medium",options:i.SCHEMA_ENERGY_RATING,modelValue:r.getEnergyRating(i.schemaStore.graph.properties.attributes.energyRating),"onUpdate:modelValue":e[17]||(e[17]=w=>r.saveEnergyRating(w.value))},null,8,["options","modelValue"]))]),_:1},8,["name"])]),_:1},8,["header"])),m(d,{header:s.strings.audience},{default:S(()=>[m(l,{name:s.strings.gender,align:""},{content:S(()=>[m(u,{class:"aioseo-product-gender",size:"medium",options:i.SCHEMA_GENDER,modelValue:r.getGender(i.schemaStore.graph.properties.audience.gender),"onUpdate:modelValue":e[18]||(e[18]=w=>r.saveGender(w.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.minimumAge,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.audience.minimumAge,"onUpdate:modelValue":e[19]||(e[19]=w=>i.schemaStore.graph.properties.audience.minimumAge=w),size:"medium",type:"number",min:0,step:1},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.maximumAge,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.audience.maximumAge,"onUpdate:modelValue":e[20]||(e[20]=w=>i.schemaStore.graph.properties.audience.maximumAge=w),size:"medium",type:"number",min:0,step:1},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),!r.hideFieldWooCommerce||!r.wooCommerceReviewsEnabled?(v(),E(g,{key:7,groupProp:i.schemaStore.graph.properties.reviews,defaults:s.reviewDefaults,pluralName:s.strings.reviews,singularName:s.strings.review},{"fields-inner":S(({groupIndex:w})=>[m(p,{reviewProp:i.schemaStore.graph.properties.reviews[w]},null,8,["reviewProp"])]),_:1},8,["groupProp","defaults","pluralName","singularName"])):O("",!0),(!r.hideFieldWooCommerce||!r.wooCommerceReviewsEnabled)&&(!i.rootStore.aioseo.data.edd||!i.rootStore.aioseo.data.edd.isEddReviewsActive)?(v(),E(b,{key:8})):O("",!0),!r.hideFieldWooCommerce&&!r.isEddActive?(v(),E(g,{key:9,groupProp:i.schemaStore.graph.properties.shippingDestinations,defaults:s.shippingDestinationDefaults,pluralName:s.strings.shippingDestinations,singularName:s.strings.shippingDestination},{"fields-inner":S(({groupIndex:w})=>{var M;return[m(l,{name:s.strings.country},{content:S(()=>[m(u,{size:"medium",options:i.COUNTRY_LIST,modelValue:i.COUNTRY_LIST.find(k=>k.value===i.schemaStore.graph.properties.shippingDestinations[w].country),"onUpdate:modelValue":k=>i.schemaStore.graph.properties.shippingDestinations[w].country=k.value},null,8,["options","modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.states,align:""},{content:S(()=>[m(u,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.shippingDestinations[w].states)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.shippingDestinations[w].states)||[],"onUpdate:modelValue":k=>i.schemaStore.graph.properties.shippingDestinations[w].states=i.setJsonValue(k),placeholder:s.strings.placeholderState,"tag-placeholder":s.strings.tagPlaceholderState},null,8,["options","modelValue","onUpdate:modelValue","placeholder","tag-placeholder"]),A("div",CJ,D(s.strings.statesDescription),1)]),_:2},1032,["name"]),m(l,{name:s.strings.postalCode,align:""},{content:S(()=>[m(u,{size:"medium",multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.shippingDestinations[w].postalCodes)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.shippingDestinations[w].postalCodes)||[],"onUpdate:modelValue":k=>i.schemaStore.graph.properties.shippingDestinations[w].postalCodes=i.setJsonValue(k),placeholder:s.strings.placeholderPostalcode,"tag-placeholder":s.strings.tagPlaceholderPostalCode},null,8,["options","modelValue","onUpdate:modelValue","placeholder","tag-placeholder"]),A("div",yJ,D(s.strings.postalCodeDescription),1)]),_:2},1032,["name"]),m(l,{name:s.strings.price,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.shippingDestinations[w].rate,"onUpdate:modelValue":k=>i.schemaStore.graph.properties.shippingDestinations[w].rate=k,size:"medium",type:"number",min:0,step:1},null,8,["modelValue","onUpdate:modelValue"]),A("div",bJ,D(s.strings.priceDescription),1)]),_:2},1032,["name"]),(M=i.schemaStore.graph.properties.shippingDestinations[w])!=null&&M.country?(v(),E(y,{key:0,deliveryTime:i.schemaStore.graph.properties.shippingDestinations[w].deliveryTime||s.shippingDestinationDefaults.deliveryTime,onChange:k=>i.schemaStore.graph.properties.shippingDestinations[w].deliveryTime=k},null,8,["deliveryTime","onChange"])):O("",!0)]}),_:1},8,["groupProp","defaults","pluralName","singularName"])):O("",!0)])}const wJ=Z(dJ,[["render",SJ]]),tt="aioseo-pro",vJ={setup(){const{initSchemaEditor:n}=gt();return{CURRENCY_LIST:fi,SCHEMA_AVAILABILITY:Mf,SCHEMA_ENERGY_RATING:Af,SCHEMA_GENDER:Df,dateJsToLocal:Ds,dateStringToLocalJs:Ts,initSchemaEditor:n,postEditorStore:Te(),rootStore:je(),schemaStore:Ie()}},components:{BaseDatePicker:_s,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt,Review:yh,ReviewRating:yl},data(){return{energyRatingKey:0,reviewDefaults:{rating:"",headline:"",content:"",author:"",positiveNotes:[],negativeNotes:[]},strings:{name:C("Name",tt),description:C("Description",tt),brand:C("Brand",tt),image:C("Image",tt),identifiers:C("Identifiers",tt),sku:"SKU",mpn:"MPN",gtin:"GTIN",isbn:"ISBN",availability:C("Availability",tt),review:C("Review",tt),offer:C("Offer",tt),price:C("Price",tt),currency:C("Currency",tt),priceValidUntil:C("Price Valid Until",tt),priceValidDescription:C("The date until this pricing lasts (optional).",tt),audience:C("Audience",tt),gender:C("Gender",tt),minimumAge:C("Minimum Age",tt),maximumAge:C("Maximum Age",tt),attributes:C("Attributes",tt),material:C("Material",tt),color:C("Color",tt),pattern:C("Pattern",tt),patternDescription:C('The pattern of the product, such as "polka dots" or "striped", if applicable.',tt),size:C("Size",tt),sizeDescription:C('A human readable name for the size, such as "XL", if applicable. Do not enter the dimensions of the product.',tt),energyRating:C("EU Energy Rating",tt)}}},methods:{getAvailability(n){return this.SCHEMA_AVAILABILITY.find(e=>e.value===n)},saveAvailability(n){this.schemaStore.graph.properties.offer.availability=n},getCurrency(n){return this.CURRENCY_LIST.find(e=>e.value===n)},saveCurrency(n){this.schemaStore.graph.properties.offer.currency=n},getGender(n){return this.SCHEMA_GENDER.find(e=>e.value===n)},saveGender(n){this.schemaStore.graph.properties.audience.gender=n},getEnergyRating(n){return this.SCHEMA_ENERGY_RATING.find(e=>e.value===n)},saveEnergyRating(n){this.schemaStore.graph.properties.attributes.energyRating=n,this.energyRatingKey++}},beforeMount(){const n={id:"#aioseo-product-review-"+new Date().getTime().toString(36),slug:"product-review",graphName:"ProductReview",label:C("Product Review",tt),properties:{autogenerate:!1,name:"#post_title",description:"#post_excerpt",brand:"",image:"",identifiers:{sku:"",gtin:"",mpn:"",isbn:""},offer:{price:"",currency:"",availability:"",validUntil:""},attributes:{material:"",color:"",pattern:"",size:"",energyRating:""},audience:{gender:"Unisex",minimumAge:"",maximumAge:""},rating:{minimum:1,maximum:5},reviews:[JSON.parse(JSON.stringify(this.reviewDefaults))]}};this.initSchemaEditor(n)},async mounted(){this.schemaStore.graph.id||await xd().then(n=>{var e;(e=this.schemaStore.graph)!=null&&e.properties&&(this.schemaStore.graph.properties.image=n,this.$nextTick(()=>{this.schemaStore.isDirty=!1}))})}},kJ={class:"graph-editor-fields graph-product-review"},xJ={class:"aioseo-description"},MJ={class:"aioseo-description"},AJ={class:"aioseo-description"};function DJ(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-input"),c=x("core-image-uploader"),h=x("base-select"),d=x("base-date-picker"),u=x("field-group"),f=x("review"),p=x("review-rating");return v(),L("div",kJ,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=g=>i.schemaStore.graph.properties.name=g),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=g=>i.schemaStore.graph.properties.description=g),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.brand,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.brand,"onUpdate:modelValue":e[2]||(e[2]=g=>i.schemaStore.graph.properties.brand=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[3]||(e[3]=g=>i.schemaStore.graph.properties.image=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(u,{header:s.strings.offer},{default:S(()=>[m(l,{name:s.strings.price,align:""},{content:S(()=>[m(a,{size:"medium",type:"number",min:0,step:.01,modelValue:i.schemaStore.graph.properties.offer.price,"onUpdate:modelValue":e[4]||(e[4]=g=>i.schemaStore.graph.properties.offer.price=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.currency,align:""},{content:S(()=>[m(h,{size:"medium",options:i.CURRENCY_LIST,modelValue:r.getCurrency(i.schemaStore.graph.properties.offer.currency),"onUpdate:modelValue":e[5]||(e[5]=g=>r.saveCurrency(g.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.priceValidUntil,align:""},{content:S(()=>[m(d,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.offer.validUntil),onChange:e[6]||(e[6]=g=>i.schemaStore.graph.properties.offer.validUntil=i.dateJsToLocal(g,"MM/dd/yyyy"))},null,8,["defaultValue"]),A("div",xJ,D(s.strings.priceValidDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.availability,align:""},{content:S(()=>[m(h,{class:"aioseo-product-availibility",size:"medium",options:i.SCHEMA_AVAILABILITY,modelValue:r.getAvailability(i.schemaStore.graph.properties.offer.availability),"onUpdate:modelValue":e[7]||(e[7]=g=>r.saveAvailability(g.value))},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(u,{header:s.strings.identifiers},{default:S(()=>[m(l,{name:s.strings.sku,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.sku,"onUpdate:modelValue":e[8]||(e[8]=g=>i.schemaStore.graph.properties.identifiers.sku=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.gtin,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.gtin,"onUpdate:modelValue":e[9]||(e[9]=g=>i.schemaStore.graph.properties.identifiers.gtin=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.mpn,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.mpn,"onUpdate:modelValue":e[10]||(e[10]=g=>i.schemaStore.graph.properties.identifiers.mpn=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.isbn,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.identifiers.isbn,"onUpdate:modelValue":e[11]||(e[11]=g=>i.schemaStore.graph.properties.identifiers.isbn=g)},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(u,{header:s.strings.attributes},{default:S(()=>[m(l,{name:s.strings.material,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.material,"onUpdate:modelValue":e[12]||(e[12]=g=>i.schemaStore.graph.properties.attributes.material=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.color,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.color,"onUpdate:modelValue":e[13]||(e[13]=g=>i.schemaStore.graph.properties.attributes.color=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.pattern,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.pattern,"onUpdate:modelValue":e[14]||(e[14]=g=>i.schemaStore.graph.properties.attributes.pattern=g)},null,8,["modelValue"]),A("div",MJ,D(s.strings.patternDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.size,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.attributes.size,"onUpdate:modelValue":e[15]||(e[15]=g=>i.schemaStore.graph.properties.attributes.size=g)},null,8,["modelValue"]),A("div",AJ,D(s.strings.sizeDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.energyRating,align:""},{content:S(()=>[(v(),E(h,{key:s.energyRatingKey,class:"aioseo-product-gender",size:"medium",options:i.SCHEMA_ENERGY_RATING,modelValue:r.getEnergyRating(i.schemaStore.graph.properties.attributes.energyRating),"onUpdate:modelValue":e[16]||(e[16]=g=>r.saveEnergyRating(g.value))},null,8,["options","modelValue"]))]),_:1},8,["name"])]),_:1},8,["header"]),m(u,{header:s.strings.audience},{default:S(()=>[m(l,{name:s.strings.gender,align:""},{content:S(()=>[m(h,{class:"aioseo-product-gender",size:"medium",options:i.SCHEMA_GENDER,modelValue:r.getGender(i.schemaStore.graph.properties.audience.gender),"onUpdate:modelValue":e[17]||(e[17]=g=>r.saveGender(g.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.minimumAge,align:""},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.audience.minimumAge,"onUpdate:modelValue":e[18]||(e[18]=g=>i.schemaStore.graph.properties.audience.minimumAge=g),size:"medium",type:"number",min:0,step:1},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.maximumAge,align:""},{content:S(()=>[m(a,{modelValue:i.schemaStore.graph.properties.audience.maximumAge,"onUpdate:modelValue":e[19]||(e[19]=g=>i.schemaStore.graph.properties.audience.maximumAge=g),size:"medium",type:"number",min:0,step:1},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(f,{reviewProp:i.schemaStore.graph.properties.reviews[0],multiple:!1,enableReviewNotes:""},null,8,["reviewProp"]),m(p)])}const TJ=Z(vJ,[["render",DJ]]),De="aioseo-pro",_J={setup(){const{getJsonValue:n,setJsonValue:e}=Sr(),{initSchemaEditor:t}=gt();return{getJsonValue:n,initSchemaEditor:t,schemaStore:Ie(),setJsonValue:e}},components:{BaseTextarea:to,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt,FieldGroupRepeater:vr,ReviewRating:yl},data(){return{instructionDefaults:{name:"",text:"",image:""},reviewDefaults:{rating:"",headline:"",content:"",author:""},strings:{name:C("Name",De),description:C("Description",De),author:C("Author",De),dishType:C("Dish Type",De),dishTypeDescription:C('The type of dish, e.g. "dinner", "main course", "dessert" or "snack".',De),cuisineType:C("Cuisine Type",De),cuisineTypeDescription:C('The region associated with the recipe, e.g. "French" or "Mediterranean" or "American".',De),timeRequired:C("Time Required",De),preparationTime:C("Preparation Time",De),preparationDescription:C("The time (in minutes) it takes to prepare the ingredients.",De),cookingTime:C("Cooking Time",De),cookingDescription:C("The time (in minutes) it takes to cook the ingredients.",De),servings:C("Amount of Servings",De),calories:C("Calories",De),caloriesDescription:C("The total number of calories per serving.",De),ingredients:C("Ingredients",De),ingredientsDescription:C('The ingredients and their amounts, e.g. "3/4 cup sugar".',De),instructions:C("Instructions",De),instruction:C("Instruction",De),keywords:C("Keywords",De),keywordsDescription:C("Other relevant terms for your recipe such as a season, a specific holiday or theme, or other descriptors. Don't enter the dish or cuisine type.",De),image:C("Image",De),nutrition:C("Nutrition",De),instructionTitle:C("Title",De),instructionText:C("Details",De),ratingCount:C("Rating Count",De),reviews:C("Reviews",De),review:C("Review",De),reviewRating:C("Review Rating",De),ratingValue:C("Rating Value",De),ratingMinimum:C("Rating Minimum",De),ratingMaximum:C("Rating Maximum",De),headline:C("Headline",De),content:C("Content",De)}}},beforeMount(){const n={id:"#aioseo-recipe-"+new Date().getTime().toString(36),slug:"recipe",graphName:"Recipe",label:C("Recipe",De),properties:{name:"#post_title",description:"#post_excerpt",author:"#author_name",ingredients:"",dishType:"",cuisineType:"",keywords:"",image:"",nutrition:{servings:1,calories:""},timeRequired:{preparation:"",cooking:""},instructions:[JSON.parse(JSON.stringify(this.instructionDefaults))],rating:{minimum:1,maximum:5},reviews:[JSON.parse(JSON.stringify(this.reviewDefaults))]}};this.initSchemaEditor(n)}},OJ={class:"graph-editor-fields graph-recipe"},VJ={class:"aioseo-description"},EJ={class:"aioseo-description"},PJ={class:"aioseo-description"},LJ={class:"aioseo-description"},RJ={class:"aioseo-description"};function BJ(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-select"),c=x("base-input"),h=x("core-image-uploader"),d=x("field-group"),u=x("base-textarea"),f=x("field-group-repeater"),p=x("review-rating");return v(),L("div",OJ,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=g=>i.schemaStore.graph.properties.name=g),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=g=>i.schemaStore.graph.properties.description=g),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.author},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.author,"onUpdate:modelValue":e[2]||(e[2]=g=>i.schemaStore.graph.properties.author=g),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"top","default-tags":["author_name","author_first_name","author_last_name"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.ingredients,align:""},{content:S(()=>[m(a,{multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.ingredients)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.ingredients)||[],"onUpdate:modelValue":e[3]||(e[3]=g=>i.schemaStore.graph.properties.ingredients=i.setJsonValue(g))},null,8,["options","modelValue"]),A("div",VJ,D(s.strings.ingredientsDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.dishType},{content:S(()=>[m(c,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.dishType,"onUpdate:modelValue":e[4]||(e[4]=g=>i.schemaStore.graph.properties.dishType=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.cuisineType},{content:S(()=>[m(c,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.cuisineType,"onUpdate:modelValue":e[5]||(e[5]=g=>i.schemaStore.graph.properties.cuisineType=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.keywords,align:""},{content:S(()=>[m(a,{multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.keywords)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.keywords)||[],"onUpdate:modelValue":e[6]||(e[6]=g=>i.schemaStore.graph.properties.keywords=i.setJsonValue(g))},null,8,["options","modelValue"]),A("div",EJ,D(s.strings.keywordsDescription),1)]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(h,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[7]||(e[7]=g=>i.schemaStore.graph.properties.image=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(d,{header:s.strings.nutrition},{default:S(()=>[m(l,{name:s.strings.servings,align:""},{content:S(()=>[m(c,{type:"number",size:"medium",min:1,modelValue:i.schemaStore.graph.properties.nutrition.servings,"onUpdate:modelValue":e[8]||(e[8]=g=>i.schemaStore.graph.properties.nutrition.servings=g)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.calories,align:""},{content:S(()=>[m(c,{type:"number",size:"medium",min:0,modelValue:i.schemaStore.graph.properties.nutrition.calories,"onUpdate:modelValue":e[9]||(e[9]=g=>i.schemaStore.graph.properties.nutrition.calories=g)},null,8,["modelValue"]),A("div",PJ,D(s.strings.caloriesDescription),1)]),_:1},8,["name"])]),_:1},8,["header"]),m(d,{header:s.strings.timeRequired},{default:S(()=>[m(l,{name:s.strings.preparationTime,align:""},{content:S(()=>[m(c,{type:"number",size:"medium",min:0,modelValue:i.schemaStore.graph.properties.timeRequired.preparation,"onUpdate:modelValue":e[10]||(e[10]=g=>i.schemaStore.graph.properties.timeRequired.preparation=g)},null,8,["modelValue"]),A("div",LJ,D(s.strings.preparationDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.cookingTime,align:""},{content:S(()=>[m(c,{type:"number",size:"medium",min:0,modelValue:i.schemaStore.graph.properties.timeRequired.cooking,"onUpdate:modelValue":e[11]||(e[11]=g=>i.schemaStore.graph.properties.timeRequired.cooking=g)},null,8,["modelValue"]),A("div",RJ,D(s.strings.cookingDescription),1)]),_:1},8,["name"])]),_:1},8,["header"]),m(f,{groupProp:i.schemaStore.graph.properties.instructions,defaults:s.instructionDefaults,pluralName:s.strings.instructions,singularName:s.strings.instruction},{"fields-inner":S(({groupIndex:g})=>[m(l,{name:s.strings.instructionTitle},{content:S(()=>[m(c,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.instructions[g].name,"onUpdate:modelValue":b=>i.schemaStore.graph.properties.instructions[g].name=b},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.instructionText},{content:S(()=>[m(u,{size:"medium",modelValue:i.schemaStore.graph.properties.instructions[g].text,"onUpdate:modelValue":b=>i.schemaStore.graph.properties.instructions[g].text=b,minHeight:120},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(h,{modelValue:i.schemaStore.graph.properties.instructions[g].image,"onUpdate:modelValue":b=>i.schemaStore.graph.properties.instructions[g].image=b},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])]),_:1},8,["groupProp","defaults","pluralName","singularName"]),m(f,{groupProp:i.schemaStore.graph.properties.reviews,defaults:s.reviewDefaults,pluralName:s.strings.reviews,singularName:s.strings.review},{"fields-inner":S(({groupIndex:g})=>[m(l,{name:s.strings.ratingValue,align:""},{content:S(()=>[m(c,{size:"medium",type:"number",min:0,step:1,modelValue:i.schemaStore.graph.properties.reviews[g].rating,"onUpdate:modelValue":b=>i.schemaStore.graph.properties.reviews[g].rating=b},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.headline,align:""},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.reviews[g].headline,"onUpdate:modelValue":b=>i.schemaStore.graph.properties.reviews[g].headline=b},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.content,align:""},{content:S(()=>[m(u,{size:"medium",modelValue:i.schemaStore.graph.properties.reviews[g].content,"onUpdate:modelValue":b=>i.schemaStore.graph.properties.reviews[g].content=b,minHeight:120},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"]),m(l,{name:s.strings.author},{content:S(()=>[m(c,{size:"medium",modelValue:i.schemaStore.graph.properties.reviews[g].author,"onUpdate:modelValue":b=>i.schemaStore.graph.properties.reviews[g].author=b},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["name"])]),_:1},8,["groupProp","defaults","pluralName","singularName"]),m(p)])}const HJ=Z(_J,[["render",BJ]]),bi="aioseo-pro",NJ={setup(){const{initSchemaEditor:n}=gt();return{initSchemaEditor:n,optionsStore:Lt(),rootStore:je(),schemaStore:Ie(),CURRENCY_LIST:fi}},components:{CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce,FieldGroup:Zt},data(){return{strings:{name:C("Name",bi),description:C("Description",bi),type:C("Type",bi),typeDescription:C("The type of service that is being provided, e.g. delivery service, printing services, etc.",bi),image:C("Image",bi),offer:C("Offer",bi),price:C("Price",bi),priceDescription:C('If the service is available for free, set the price to "0".',bi),currency:C("Currency",bi),provider:C("Provider",bi),url:C("URL",bi),organizationDescription:j(C("Leave this empty if you want to use the Organization you've set under %1$s.",bi),be.getPlainLink(C("Search Appearance > Knowledge Graph",bi),this.rootStore.aioseo.urls.aio.searchAppearance+"#/global-settings"))}}},methods:{getCurrency(n){return fi.find(e=>e.value===n)},saveCurrency(n){this.schemaStore.graph.properties.currency=n}},beforeMount(){const n={id:"#aioseo-service-"+new Date().getTime().toString(36),slug:"service",graphName:"Service",label:C("Service",bi),properties:{name:"#post_title",description:"",serviceType:"",price:"",currency:"",image:"",provider:{name:"",url:"",image:""}}};this.initSchemaEditor(n)}},FJ={class:"graph-editor-fields graph-service"},IJ={class:"aioseo-description"},WJ={class:"aioseo-description"},zJ=["innerHTML"];function UJ(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-input"),c=x("core-image-uploader"),h=x("base-select"),d=x("field-group");return v(),L("div",FJ,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=u=>i.schemaStore.graph.properties.name=u),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=u=>i.schemaStore.graph.properties.description=u),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.type,align:""},{content:S(()=>[m(a,{size:"medium",modelValue:i.schemaStore.graph.properties.serviceType,"onUpdate:modelValue":e[2]||(e[2]=u=>i.schemaStore.graph.properties.serviceType=u)},null,8,["modelValue"]),A("div",IJ,D(s.strings.typeDescription),1)]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.image,"onUpdate:modelValue":e[3]||(e[3]=u=>i.schemaStore.graph.properties.image=u)},null,8,["modelValue"])]),_:1},8,["name"]),m(d,{header:s.strings.offer},{default:S(()=>[m(l,{name:s.strings.price,align:""},{content:S(()=>[m(a,{size:"medium",type:"number",min:0,step:.01,modelValue:i.schemaStore.graph.properties.price,"onUpdate:modelValue":e[4]||(e[4]=u=>i.schemaStore.graph.properties.price=u)},null,8,["modelValue"]),A("div",WJ,D(s.strings.priceDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.currency,align:""},{content:S(()=>[m(h,{size:"medium",options:i.CURRENCY_LIST,modelValue:r.getCurrency(i.schemaStore.graph.properties.currency),"onUpdate:modelValue":e[5]||(e[5]=u=>r.saveCurrency(u.value))},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(d,{header:s.strings.provider},{default:S(()=>[m(l,{name:s.strings.name},{content:S(()=>[m(a,{type:"text",size:"medium",modelValue:i.schemaStore.graph.properties.provider.name,"onUpdate:modelValue":e[6]||(e[6]=u=>i.schemaStore.graph.properties.provider.name=u)},null,8,["modelValue"]),i.optionsStore.options.searchAppearance.global.schema.siteRepresents==="organization"?(v(),L("div",{key:0,class:"aioseo-description",innerHTML:s.strings.organizationDescription},null,8,zJ)):O("",!0)]),_:1},8,["name"]),m(l,{name:s.strings.url},{content:S(()=>[m(a,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.provider.url,"onUpdate:modelValue":e[7]||(e[7]=u=>i.schemaStore.graph.properties.provider.url=u)},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.image,align:""},{content:S(()=>[m(c,{modelValue:i.schemaStore.graph.properties.provider.image,"onUpdate:modelValue":e[8]||(e[8]=u=>i.schemaStore.graph.properties.provider.image=u)},null,8,["modelValue"])]),_:1},8,["name"])]),_:1},8,["header"])])}const $J=Z(NJ,[["render",UJ]]),ke="aioseo-pro",KJ={setup(){const{getJsonValue:n,setJsonValue:e}=Sr(),{initSchemaEditor:t}=gt();return{CURRENCY_LIST:fi,getJsonValue:n,initSchemaEditor:t,schemaStore:Ie(),setJsonValue:e}},components:{CoreHtmlTagsEditor:vt,CoreSettingsRow:Ce,FieldGroup:Zt,Review:yh,ReviewRating:yl},data(){return{strings:{name:C("Name",ke),description:C("Description",ke),price:C("Price",ke),priceDescription:C('If the software is available for free, set the price to "0".',ke),currency:C("Currency",ke),operatingSystem:C("Operating System",ke),operatingSystemDescription:C('The supported operating systems, e.g. "Windows 10", "OSX 10.6", "Android 9"',ke),category:C("Category",ke),offer:C("Offer",ke),review:C("Review",ke),rating:C("Rating",ke),headline:C("Headline",ke),content:C("Content",ke),author:C("Author",ke)},categories:[{label:C("Business App",ke),value:"BusinessApplication"},{label:C("Entertainment App",ke),value:"EntertainmentApplication"},{label:C("Communication App",ke),value:"CommunicationApplication"},{label:C("Social Network App",ke),value:"SocialNetworkingApplication"},{label:C("Educational App",ke),value:"EducationalApplication"},{label:C("Health App",ke),value:"HealthApplication"},{label:C("Finance App",ke),value:"FinanceApplication"},{label:C("Shopping App",ke),value:"ShoppingApplication"},{label:C("Travel App",ke),value:"TravelApplication"},{label:C("Sports App",ke),value:"SportsApplication"},{label:C("Video Game App",ke),value:"GameApplication"},{label:C("Browser App",ke),value:"BrowserApplication"},{label:C("Security App",ke),value:"SecurityApplication"},{label:C("Design App",ke),value:"DesignApplication"},{label:C("Developer App",ke),value:"DeveloperApplication"},{label:C("Lifestyle App",ke),value:"LifestyleApplication"},{label:C("Driver App",ke),value:"DriverApplication"},{label:C("Desktop Enhancement App",ke),value:"DesktopEnhancementApplication"},{label:C("Multimedia App",ke),value:"MultimediaApplication"},{label:C("Home App",ke),value:"HomeApplication"},{label:C("Utilities App",ke),value:"UtilitiesApplication"},{label:C("Reference App",ke),value:"ReferenceApplication"}]}},methods:{getCurrency(n){return fi.find(e=>e.value===n)},saveCurrency(n){this.schemaStore.graph.properties.currency=n},getCategory(n){return this.categories.find(e=>e.value===n)},saveCategory(n){this.schemaStore.graph.properties.category=n}},beforeMount(){const n={id:"#aioseo-software-application-"+new Date().getTime().toString(36),slug:"software-application",graphName:"SoftwareApplication",label:C("Software",ke),properties:{name:"#post_title",description:"",price:"",currency:"",operatingSystem:"",category:"",rating:{minimum:1,maximum:5},review:{rating:"",headline:"",content:"",author:"#author_name"}}};this.initSchemaEditor(n)}},GJ={class:"graph-editor-fields graph-software-application"},qJ={class:"aioseo-description"},ZJ={class:"aioseo-description"};function jJ(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-select"),c=x("base-input"),h=x("field-group"),d=x("review"),u=x("review-rating");return v(),L("div",GJ,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=f=>i.schemaStore.graph.properties.name=f),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=f=>i.schemaStore.graph.properties.description=f),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.category,align:""},{content:S(()=>[m(a,{size:"medium",options:s.categories,modelValue:r.getCategory(i.schemaStore.graph.properties.category),"onUpdate:modelValue":e[2]||(e[2]=f=>r.saveCategory(f.value))},null,8,["options","modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.operatingSystem,align:""},{content:S(()=>[m(a,{multiple:"",taggable:"",options:i.getJsonValue(i.schemaStore.graph.properties.operatingSystem)||[],modelValue:i.getJsonValue(i.schemaStore.graph.properties.operatingSystem)||[],"onUpdate:modelValue":e[3]||(e[3]=f=>i.schemaStore.graph.properties.operatingSystem=i.setJsonValue(f))},null,8,["options","modelValue"]),A("div",qJ,D(s.strings.operatingSystemDescription),1)]),_:1},8,["name"]),m(h,{header:s.strings.offer},{default:S(()=>[m(l,{name:s.strings.price,align:""},{content:S(()=>[m(c,{size:"medium",type:"number",min:0,step:.01,modelValue:i.schemaStore.graph.properties.price,"onUpdate:modelValue":e[4]||(e[4]=f=>i.schemaStore.graph.properties.price=f)},null,8,["modelValue"]),A("div",ZJ,D(s.strings.priceDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.currency,align:""},{content:S(()=>[m(a,{size:"medium",options:i.CURRENCY_LIST,modelValue:r.getCurrency(i.schemaStore.graph.properties.currency),"onUpdate:modelValue":e[5]||(e[5]=f=>r.saveCurrency(f.value))},null,8,["options","modelValue"])]),_:1},8,["name"])]),_:1},8,["header"]),m(d,{reviewProp:i.schemaStore.graph.properties.review,multiple:!1},null,8,["reviewProp"]),m(u)])}const YJ=Z(KJ,[["render",jJ]]),as="aioseo-pro",JJ={setup(){const{initSchemaEditor:n}=gt();return{GLOBAL_STRINGS:St,dateJsToLocal:Ds,dateStringToLocalJs:Ts,initSchemaEditor:n,schemaStore:Ie()}},components:{BaseDatePicker:_s,BaseRadioToggle:br,CoreHtmlTagsEditor:vt,CoreImageUploader:Gt,CoreSettingsRow:Ce},data(){return{strings:{name:C("Name",as),description:C("Description",as),uploadDate:C("Upload Date",as),duration:C("Duration",as),contentUrl:C("Content URL",as),contentUrlDescription:C("A URL pointing to the video media file (e.g. MP4, MOV, etc.). Search engines prefer the content URL over the embed URL.",as),embedUrl:C("Embed URL",as),embedUrlDescription:C("A URL pointing to an embeddable player for the video (e.g. a YouTube link).",as),thumbnailUrl:C("Thumbnail URL",as),familyFriendly:C("Is Family Friendly",as)}}},beforeMount(){const n={id:"#aioseo-video-"+new Date().getTime().toString(36),slug:"video",graphName:"Video",label:C("Video",as),properties:{name:"#post_title",description:"#post_excerpt",uploadDate:"",contentUrl:"",embedUrl:"",thumbnailUrl:"",duration:"",familyFriendly:!0}};this.initSchemaEditor(n)}},XJ={class:"graph-editor-fields graph-video"},QJ={class:"aioseo-description"},eX={class:"aioseo-description"};function tX(n,e,t,i,s,r){const o=x("core-html-tags-editor"),l=x("core-settings-row"),a=x("base-input"),c=x("base-date-picker"),h=x("base-radio-toggle"),d=x("core-image-uploader");return v(),L("div",XJ,[m(l,{name:s.strings.name},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.name,"onUpdate:modelValue":e[0]||(e[0]=u=>i.schemaStore.graph.properties.name=u),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_title","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.description},{content:S(()=>[m(o,{modelValue:i.schemaStore.graph.properties.description,"onUpdate:modelValue":e[1]||(e[1]=u=>i.schemaStore.graph.properties.description=u),"line-numbers":!1,single:"","tags-context":"schema",defaultMenuOrientation:"bottom","default-tags":["post_excerpt","separator_sa","site_title"],tagsDescription:""},null,8,["modelValue"])]),_:1},8,["name"]),m(l,{name:s.strings.contentUrl},{content:S(()=>[m(a,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.contentUrl,"onUpdate:modelValue":e[2]||(e[2]=u=>i.schemaStore.graph.properties.contentUrl=u)},null,8,["modelValue"]),A("div",QJ,D(s.strings.contentUrlDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.embedUrl},{content:S(()=>[m(a,{type:"text",size:"medium",validation:"url",modelValue:i.schemaStore.graph.properties.embedUrl,"onUpdate:modelValue":e[3]||(e[3]=u=>i.schemaStore.graph.properties.embedUrl=u)},null,8,["modelValue"]),A("div",eX,D(s.strings.embedUrlDescription),1)]),_:1},8,["name"]),m(l,{name:s.strings.uploadDate,align:""},{content:S(()=>[m(c,{type:"date",size:"large",dateFormat:"m/d/Y",defaultValue:i.dateStringToLocalJs(i.schemaStore.graph.properties.uploadDate),onChange:e[4]||(e[4]=u=>i.schemaStore.graph.properties.uploadDate=i.dateJsToLocal(u,"MM/dd/yyyy"))},null,8,["defaultValue"])]),_:1},8,["name"]),m(l,{name:s.strings.familyFriendly,align:""},{content:S(()=>[m(h,{name:"includeDates",modelValue:i.schemaStore.graph.properties.familyFriendly,"onUpdate:modelValue":e[5]||(e[5]=u=>i.schemaStore.graph.properties.familyFriendly=u),options:[{label:i.GLOBAL_STRINGS.no,value:!1,activeClass:"dark"},{label:i.GLOBAL_STRINGS.yes,value:!0}]},null,8,["modelValue","options"])]),_:1},8,["name"]),m(l,{class:"image-field",name:s.strings.thumbnailUrl,align:""},{content:S(()=>[m(d,{modelValue:i.schemaStore.graph.properties.thumbnailUrl,"onUpdate:modelValue":e[6]||(e[6]=u=>i.schemaStore.graph.properties.thumbnailUrl=u)},null,8,["modelValue"])]),_:1},8,["name"])])}const iX=Z(JJ,[["render",tX]]),H1="aioseo-pro",sX={setup(){const{initSchemaEditor:n}=gt();return{initSchemaEditor:n,schemaStore:Ie(),WEBPAGE_TYPE_LIST:Z2}},components:{CoreSettingsRow:Ce},data(){return{strings:{type:C("Type",H1),name:C("Name",H1),description:C("Description",H1)}}},methods:{getWebPageType(n){return Z2.find(e=>e.value===n)},saveWebPageType(n){this.schemaStore.graph.properties.type=n}},beforeMount(){const n={id:"#aioseo-web-page-"+new Date().getTime().toString(36),slug:"web-page",graphName:"WebPage",label:C("Web Page",H1),properties:{type:"WebPage",name:"#post_title",description:"#post_excerpt"}};this.initSchemaEditor(n)}},nX={class:"graph-editor-fields graph-web-page"};function rX(n,e,t,i,s,r){const o=x("base-select"),l=x("core-settings-row");return v(),L("div",nX,[m(l,{name:s.strings.type,align:""},{content:S(()=>[m(o,{size:"medium",options:i.WEBPAGE_TYPE_LIST,modelValue:r.getWebPageType(i.schemaStore.graph.properties.type),"onUpdate:modelValue":e[0]||(e[0]=a=>r.saveWebPageType(a.value))},null,8,["options","modelValue"])]),_:1},8,["name"])])}const oX=Z(sX,[["render",rX]]),lX={emits:["closeModal","doAction","openModal"],setup(){return{schemaStore:Ie()}},components:{CoreModal:Qt,SvgClose:Sd},props:{strings:{type:Object,required:!0},show:Boolean},watch:{show(n){n&&this.$emit("openModal",!0)}}},aX={class:"aioseo-modal-body"},hX=["innerHTML"],cX={class:"action-buttons"};function dX(n,e,t,i,s,r){const o=x("svg-close"),l=x("base-input"),a=x("base-button"),c=x("core-modal");return v(),E(c,{show:t.show,classes:["aioseo-post-schema-naming-modal"],"no-header":"",onClose:e[5]||(e[5]=h=>n.$emit("closeModal",!0))},{body:S(()=>[A("div",aX,[A("button",{class:"close",onClick:e[1]||(e[1]=Dt(h=>n.$emit("closeModal",!0),["stop"]))},[m(o,{onClick:e[0]||(e[0]=h=>n.$emit("closeModal",!0))})]),A("h3",null,D(t.strings.title),1),A("div",{class:"reset-description",innerHTML:t.strings.description},null,8,hX),m(l,{size:"medium",placeholder:t.strings.placeholder,modelValue:i.schemaStore.templateName,"onUpdate:modelValue":e[2]||(e[2]=h=>i.schemaStore.templateName=h)},null,8,["placeholder","modelValue"]),A("div",cX,[m(a,{type:"gray",size:"medium",onClick:e[3]||(e[3]=h=>n.$emit("closeModal",!0))},{default:S(()=>[B(D(t.strings.noChangedMind),1)]),_:1}),m(a,{type:"blue",size:"medium",onClick:e[4]||(e[4]=h=>n.$emit("doAction",h)),disabled:!i.schemaStore.templateName},{default:S(()=>[B(D(t.strings.continue),1)]),_:1},8,["disabled"])])])]),_:1},8,["show"])}const uX=Z(lX,[["render",dX]]),fX={class:"schema-templates"},pX={class:"main"},gX={key:1,class:"schema-catalog"},mX={key:0,class:"graphs"},CX={key:2,class:"your-templates"},yX={key:0,class:"graphs"},bX={key:3,class:"graph-editor"},SX={class:"option-label"},wX={class:"option-label"},vX={key:0,class:"buttons new-graph"},kX={class:"left"},xX={key:0,class:"right"},MX={key:1,class:"buttons edit-graph"},AX={class:"left"},DX={key:0,class:"right"},TX={key:2,class:"buttons edit-graph"},_X={class:"left"},OX={key:0,class:"right"},VX={key:3,class:"buttons edit-template"},EX={class:"left"},PX={key:0,class:"right"},LX={__name:"Templates",emits:["sub-modal-toggle","open-new-graph"],setup(n,{emit:e}){const t="aioseo-pro",{graphs:i,getParentGraphName:s}=gt(),{hasFeature:r,isEditing:o}=ch(),l=Lt(),a=Te(),c=je(),h=Ie(),d=Ze(""),u=Ze(""),f=Ze(!1),p=Ze(0),g=Ze(!1),b=Ze(""),y={searchSchema:C("Search Schema",t),searchTemplates:C("Search Templates",t),addSchema:C("Add Schema",t),saveSchemaAsTemplate:C("Save Schema as Template",t),deleteSchema:C("Delete Schema",t),updateSchema:C("Update Schema",t),backToSchemaCatalog:C("Back to Schema Catalog",t),addTemplate:C("Add Template",t),editTemplate:C("Edit Template",t),deleteTemplate:C("Delete Template",t),updateTemplate:C("Update Template",t),placeholder:C("Enter a name for your schema graph...",t),defaultGraphAlert:j(C("You are now editing the default schema graph for this post. You can change the default schema type for %1$s in the %2$sSearch Appearance%3$s settings.",t),c.aioseo.postData.postTypes.find(N=>N.name===a.currentPost.postType).label,`<a href="${c.aioseo.urls.aio.searchAppearance}#/content-types" target="_blank">`,"</a>"),modal:{isDirtyLeaving:{areYouSure:C("Are you sure you want to leave this page?",t),actionCannotBeUndone:C("Any changes you've made will be lost. This action cannot be undone.",t),confirmation:C("Yes, I want to leave this page",t),noChangedMind:C("No, I changed my mind",t)},isDirtySwitching:{areYouSure:C("Are you sure you want to switch to a different schema?",t),actionCannotBeUndone:C("Any changes you've made will be lost. This action cannot be undone.",t),confirmation:C("Yes, I want to switch",t),noChangedMind:C("No, I changed my mind",t)},graphDelete:{areYouSure:C("Are you sure you want to delete this schema?",t),actionCannotBeUndone:C("This action cannot be undone.",t),confirmation:C("Yes, I want to delete this schema",t),noChangedMind:C("No, I changed my mind",t)},namingTemplateNew:{title:C("Enter a name for this template",t),description:C("Before you can save this template, you must first enter a name so that you can easily identify it later.",t),continue:C("Save Template",t),noChangedMind:C("No, I changed my mind",t),placeholder:C("Type to enter a name for your template...",t)},templateDelete:{areYouSure:C("Are you sure you want to delete this template?",t),actionCannotBeUndone:C("This action cannot be undone.",t),confirmation:C("Yes, I want to delete this template",t),noChangedMind:C("No, I changed my mind",t)}}},w=xe(()=>{const N=[];return h.isEditingTemplate||N.push({slug:"schema-catalog",name:C("Schema Catalog",t)}),l.internalOptions.internal.schema.templates.length&&!h.graph&&N.push({slug:"your-templates",name:C("Your Templates",t)}),N.length===1&&h.setTabTemplates("schema-catalog"),N}),M=xe(()=>{let N=[];if(!b.value)return N=i,N.sort((X,ne)=>X.graphName<ne.graphName?-1:1);const I=new RegExp(Tf(b.value).replace(/\s/g,"\\s"),"i");return N=i.filter(X=>X.graphName.match(I)||X.label.match(I)),N.sort((X,ne)=>X.graphName<ne.graphName?-1:1)}),k=xe(()=>{let N=[];if(!b.value)return N=l.internalOptions.internal.schema.templates,N.sort((X,ne)=>X.graphName<ne.graphName?-1:1);const I=new RegExp(Tf(b.value).replace(/\s/g,"\\s"),"i");return N=l.internalOptions.internal.schema.templates.filter(X=>{var ne;return(ne=X==null?void 0:X.label)==null?void 0:ne.match(I)}),N.sort((X,ne)=>X.graphName<ne.graphName?-1:1)}),V=xe(()=>{let N="";return h.isEditingDefaultGraph&&(N=s(a.currentPost.schema.default.graphName)),R(N||h.graph.graphName)}),R=N=>{switch(N){case"Article":return dj;case"Book":return Sj;case"Car":return Bj;case"Course":return Jj;case"Dataset":return lY;case"Event":return yY;case"FAQPage":return vY;case"FactCheck":return VY;case"HowTo":return BY;case"JobPosting":return KY;case"Movie":return jY;case"Music":return QY;case"Person":return sJ;case"Product":return wJ;case"ProductReview":return TJ;case"Recipe":return HJ;case"Service":return $J;case"SoftwareApplication":return YJ;case"Video":return iX;case"WebPage":return oX;default:return null}},H=xe(()=>i.map(N=>(N.value=N.slug,N))),W=xe(()=>h.tabs.templates==="schema-catalog"?y.searchSchema:y.searchTemplates),G=xe(()=>{switch(d.value){case"backToSchemaCatalog":return y.modal.isDirtyLeaving;case"deleteDefaultGraph":case"deleteGraph":return y.modal.graphDelete;case"deleteTemplate":return y.modal.templateDelete;case"setGraphName":return y.modal.isDirtySwitching;default:return{}}}),z=xe(()=>{switch(d.value){case"addGraphAsTemplate":return y.modal.namingTemplateNew;case"updateTemplate":return y.modal.namingTemplateUpdate;default:return{}}}),q=e,ee=N=>{N==="namingModalOpen"?g.value=!1:f.value=!1,q("sub-modal-toggle",!1)},he=N=>{const I=i.find(X=>X.graphName===N);h.graph=I,q("open-new-graph")},pe=N=>!N&&h.isEditingDefaultGraph?a.currentPost.schema.default.graphName:H.value.find(I=>I.graphName===N.graphName),Ee=N=>{h.graph=H.value.find(I=>I.value===N)},_t=N=>{h.setTabTemplates(N),b.value=""},mt=(N,I)=>{if(d.value=N,u.value=I,(N==="backToSchemaCatalog"||N==="setGraphName")&&!h.isDirty){U();return}f.value=!0},F=N=>{d.value=N,g.value=!0},U=()=>{switch(d.value){case"backToSchemaCatalog":h.graph=null;break;case"deleteDefaultGraph":h.deleteDefaultGraph();break;case"deleteGraph":h.deleteGraph();break;case"deleteTemplate":h.deleteTemplate();break;case"addGraphAsTemplate":h.addGraphAsTemplate();break;case"setGraphName":Ee(u.value);break;case"updateTemplate":h.updateTemplate();break}q("open-new-graph"),d.value="",u.value="",f.value=!1,g.value=!1,p.value++,q("sub-modal-toggle",!1)};return(N,I)=>{const X=x("base-input"),ne=x("base-button"),Me=x("base-select");return v(),L("div",fX,[_(o)?O("",!0):(v(),E(_(Qi),{key:0,tabs:w.value,active:_(h).tabs.templates,showSaveButton:!1,onChanged:I[0]||(I[0]=Q=>_t(Q))},{"var-tab-icon":S(({tab:Q})=>[(v(),E(bt(Q.icon)))]),_:1},8,["tabs","active"])),A("div",pX,[_(h).graph?O("",!0):(v(),E(X,{key:0,class:"search",size:"medium",prependIcon:"search",modelValue:b.value,"onUpdate:modelValue":I[1]||(I[1]=Q=>b.value=Q),placeholder:W.value},null,8,["modelValue","placeholder"])),_(h).tabs.templates==="schema-catalog"?(v(),L("div",gX,[_(h).graph?O("",!0):(v(),L("div",mX,[!_(a).currentPost.schema.default.isEnabled&&_(a).currentPost.schema.default.graphName?(v(),E(_(dn),{key:0,defaultGraph:_(a).currentPost.schema.default.graphName},{buttons:S(()=>[m(_(qe),{type:"action"},{tooltip:S(()=>[B(D(y.addSchema),1)]),default:S(()=>[m(ne,{class:"small",type:"gray",onClick:Dt(_(h).addDefaultGraph,["prevent"])},{default:S(()=>[m(_(Or))]),_:1},8,["onClick"])]),_:1})]),_:1},8,["defaultGraph"])):O("",!0),(v(!0),L(xt,null,_i(M.value,(Q,ye)=>(v(),E(_(dn),{key:ye,graph:Q},{buttons:S(()=>[m(_(qe),{type:"action"},{tooltip:S(()=>[B(D(y.addSchema),1)]),default:S(()=>[m(ne,{class:"small",type:"gray",onClick:Dt(Ye=>he(Q.graphName),["prevent"])},{default:S(()=>[m(_(Or))]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1032,["graph"]))),128))]))])):O("",!0),_(h).tabs.templates==="your-templates"?(v(),L("div",CX,[_(h).graph?O("",!0):(v(),L("div",yX,[(v(!0),L(xt,null,_i(k.value,(Q,ye)=>(v(),E(_(dn),{key:ye,graph:Q,customGraph:Q.custom},{buttons:S(()=>[m(_(qe),{type:"action"},{tooltip:S(()=>[B(D(y.editTemplate),1)]),default:S(()=>[m(ne,{class:"small",type:"gray",onClick:Ye=>_(h).editTemplate(ye,b.value)},{default:S(()=>[m(_(_r))]),_:2},1032,["onClick"])]),_:2},1024),m(_(qe),{type:"action"},{tooltip:S(()=>[B(D(y.addTemplate),1)]),default:S(()=>[m(ne,{class:"small",type:"gray",onClick:Ye=>_(h).addTemplateAsGraph(ye,b.value)},{default:S(()=>[m(_(Or))]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1032,["graph","customGraph"]))),128))]))])):O("",!0),_(h).graph||_(h).isEditingDefaultGraph?(v(),L("div",bX,[A("div",{class:Re(["graph-editor-fields-container",[{blurred:!_(r)}]])},[_(h).isEditingDefaultGraph?(v(),E(_(wt),{key:0,class:"default-graph-alert",type:"blue",innerHTML:y.defaultGraphAlert},null,8,["innerHTML"])):O("",!0),_(o)?O("",!0):(v(),E(Me,{key:1,class:"graph-selector",size:"medium",options:H.value,modelValue:pe(_(h).graph),"onUpdate:modelValue":I[2]||(I[2]=Q=>mt("setGraphName",Q.value))},{singleLabel:S(({option:Q})=>[(v(),E(bt("svg-"+Q.slug))),A("span",SX,D(Q.label),1)]),option:S(({option:Q})=>[(v(),E(bt("svg-"+Q.slug))),A("span",wX,D(Q.label),1)]),_:1},8,["options","modelValue"])),_(h).isEditingTemplate?(v(),E(X,{key:2,class:"template-name",size:"medium",modelValue:_(h).templateName,"onUpdate:modelValue":I[3]||(I[3]=Q=>_(h).templateName=Q),prependIcon:_(h).graph.slug,placeholder:y.placeholder},null,8,["modelValue","prependIcon","placeholder"])):O("",!0),(v(),E(bt(V.value)))],2),_(o)?O("",!0):(v(),L("div",vX,[A("div",kX,[m(ne,{class:"medium",type:"gray",onClick:I[4]||(I[4]=Q=>mt("backToSchemaCatalog"))},{default:S(()=>[B(D(y.backToSchemaCatalog),1)]),_:1})]),_(r)?(v(),L("div",xX,[m(ne,{class:"medium",type:"gray",onClick:I[5]||(I[5]=Q=>F("addGraphAsTemplate"))},{default:S(()=>[B(D(y.saveSchemaAsTemplate),1)]),_:1}),m(ne,{class:"medium",type:"blue",onClick:I[6]||(I[6]=Q=>_(h).addGraph())},{default:S(()=>[B(D(y.addSchema),1)]),_:1})])):O("",!0)])),_(h).isEditingDefaultGraph?(v(),L("div",MX,[A("div",AX,[m(ne,{class:"medium",type:"red",onClick:I[7]||(I[7]=Q=>mt("deleteDefaultGraph"))},{default:S(()=>[B(D(y.deleteSchema),1)]),_:1})]),_(r)?(v(),L("div",DX,[m(ne,{class:"medium",type:"blue",onClick:I[8]||(I[8]=Q=>_(h).updateDefaultGraph())},{default:S(()=>[B(D(y.updateSchema),1)]),_:1})])):O("",!0)])):O("",!0),_(h).isEditingGraph?(v(),L("div",TX,[A("div",_X,[m(ne,{class:"medium",type:"red",onClick:I[9]||(I[9]=Q=>mt("deleteGraph"))},{default:S(()=>[B(D(y.deleteSchema),1)]),_:1})]),_(r)?(v(),L("div",OX,[m(ne,{class:"medium",type:"gray",onClick:I[10]||(I[10]=Q=>F("addGraphAsTemplate"))},{default:S(()=>[B(D(y.saveSchemaAsTemplate),1)]),_:1}),m(ne,{class:"medium",type:"blue",onClick:I[11]||(I[11]=Q=>_(h).updateGraph())},{default:S(()=>[B(D(y.updateSchema),1)]),_:1})])):O("",!0)])):O("",!0),_(h).isEditingTemplate?(v(),L("div",VX,[A("div",EX,[m(ne,{class:"medium",type:"red",onClick:I[12]||(I[12]=Q=>mt("deleteTemplate"))},{default:S(()=>[B(D(y.deleteTemplate),1)]),_:1})]),_(r)?(v(),L("div",PX,[m(ne,{class:"medium",type:"gray",onClick:I[13]||(I[13]=Q=>_(h).updateTemplate())},{default:S(()=>[B(D(y.updateTemplate),1)]),_:1}),m(ne,{class:"medium",type:"blue",onClick:I[14]||(I[14]=Q=>_(h).addGraph())},{default:S(()=>[B(D(y.addSchema),1)]),_:1})])):O("",!0)])):O("",!0)])):O("",!0)]),(v(),E(_(uX),{show:g.value,strings:z.value,onDoAction:U,onOpenModal:I[15]||(I[15]=Q=>q("sub-modal-toggle",!0)),onCloseModal:I[16]||(I[16]=Q=>ee("namingModalOpen")),key:"namingModal"+p.value},null,8,["show","strings"])),(v(),E(_(km),{show:f.value,strings:G.value,onDoAction:U,onOpenModal:I[17]||(I[17]=Q=>q("sub-modal-toggle",!0)),onCloseModal:I[18]||(I[18]=Q=>ee("confirmationModalOpen")),key:"confirmationModal"+p.value},null,8,["show","strings"]))])}}},RX={class:"schema-validation"},BX={class:"main"},HX={class:"header"},NX={class:"title"},FX=["innerHTML"],IX={class:"action-buttons"},WX={id:"form-test-with-google",method:"post",action:"https://search.google.com/test/rich-results",target:"_blank"},zX=["value"],UX={class:"schema-output"},$X={__name:"Validation",setup(n){const e="aioseo-pro",t=Ie(),i=Ze(!1),s=Ze(!1),r={schemaJson:C("Schema (JSON-LD Format)",e),tooltipDescription:j(C("Our custom schema only works with the JSON-LD format. This gives a detailed description of what your page is all about. Search engines can then use this data to understand your site better and provide more relevant search results and rich snippets. %1$s",e),be.getDocLink(St.learnMore,"schemaJsonLd",!0)),copy:C("Copy",e),copied:C("Copied!",e),testWithGoogle:C("Test with Google",e),postSavedWarning:C("Before the schema can be generated correctly, the post must first be saved as a draft or published.",e)},o=xe(()=>i.value?r.copied:r.copy),l=()=>{i.value=!0,setTimeout(()=>{i.value=!1},2e3)},a=()=>{document.getElementById("form-test-with-google").submit()};return am(()=>{const c=IA();s.value=c&&c!=="auto-draft"}),rh(()=>{s.value&&t.updateSchemaOutput()}),(c,h)=>{const d=x("base-button"),u=SM("clipboard");return v(),L("div",RX,[A("div",BX,[A("div",HX,[A("div",NX,[A("span",null,D(r.schemaJson),1),m(_(qe),null,{tooltip:S(()=>[A("span",{innerHTML:r.tooltipDescription},null,8,FX)]),default:S(()=>[m(_(yr))]),_:1})]),A("div",IX,[A("div",null,[wM((v(),E(d,{class:"small",type:"gray"},{default:S(()=>[i.value?O("",!0):(v(),E(_(xA),{key:0})),i.value?(v(),E(_(jA),{key:1})):O("",!0),A("span",null,D(o.value),1)]),_:1})),[[u,_(t).output,"copy"],[u,l,"success"]])]),A("div",null,[A("form",WX,[A("textarea",{name:"code_snippet",value:_(t).output,hidden:""},null,8,zX),m(d,{class:"small",type:"blue",onClick:h[0]||(h[0]=f=>a())},{default:S(()=>[m(_(MA)),A("span",null,D(r.testWithGoogle),1)]),_:1})])])])]),A("div",UX,[s.value?O("",!0):(v(),E(_(wt),{key:0,class:"post-status-alert",type:"yellow"},{default:S(()=>[A("div",null,D(r.postSavedWarning),1)]),_:1})),m(_(gM),{ref:"schemaValidator",editorId:"schema-validator",value:_(t).output,readonly:""},null,8,["value"])])])])}}},KX={class:"title"},GX=["innerHTML"],$7={__name:"SchemaGenerator",props:{allowModalClose:Boolean,show:Boolean},emits:["close","sub-modal-toggle"],setup(n,{emit:e}){const t="aioseo-pro",{isEditing:i}=ch(),s=Te(),r=Ie(),o=e,l={schemaGenerator:C("Schema Generator",t),headerTooltip:j(C("Use our powerful Schema Generator to configure Schema Markup for your content. Search Engines use structured data to better understand what your site is about as well as to display rich snippets in search results. %1$s",t),be.getDocLink(St.learnMore,"schema",!0))},a=[{slug:"schema-templates",icon:r9,name:C("Schema Templates",t),component:LX},{slug:"custom-schema",icon:o9,name:C("Custom Schema",t),component:QZ},{slug:"schema-validation",icon:l9,name:C("Schema Validation",t),component:$X}];Z7(()=>r.graph,p=>{if(p===null){r.isDirty=!1;return}r.isDirty=!0},{deep:!0});const c=xe(()=>a.find(p=>p.slug===r.tabs.generator)),h=xe(()=>{if(i.value){let p="";return r.isEditingDefaultGraph?p=s.currentPost.schema.default.graphName:r.isEditingCustomGraph||r.isEditingCustomTemplate?p=C("Custom Schema",t):p=r.graph.label,j(C("Edit %1$s",t),p)}return l.schemaGenerator}),d=p=>{r.tabs.generator=p,f()},u=()=>{f()},f=async()=>{await Jn();const p=document.querySelector("#aioseo-schema-generator-main .graph-editor-fields-container");p&&(p.scrollTop=0)};return rh(()=>{f()}),(p,g)=>(v(),E(_(Qt),{show:n.show,classes:["aioseo-post-schema-modal"],onClose:g[1]||(g[1]=b=>o("close")),"modal-name":"schema-generator"},{headerTitle:S(()=>[A("div",KX,D(h.value),1),_(i)?O("",!0):(v(),E(_(qe),{key:0,flip:""},{tooltip:S(()=>[A("span",{innerHTML:l.headerTooltip},null,8,GX)]),default:S(()=>[m(_(yr))]),_:1}))]),body:S(()=>[_(i)?O("",!0):(v(),E(_(Qi),{key:0,tabs:a,active:_(r).tabs.generator,showSaveButton:!1,onChanged:d},{"var-tab-icon":S(({tab:b})=>[(v(),E(bt(b.icon)))]),_:1},8,["active"])),(v(),E(bt(c.value.component),{id:"aioseo-schema-generator-main",onOpenNewGraph:u,onSubModalToggle:g[0]||(g[0]=b=>o("sub-modal-toggle",b))},null,32))]),_:1},8,["show"]))}},qX={},ZX={viewBox:"0 0 11 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-trash"},jX=A("path",{d:"M8.0013 4V10.6667H2.66797V4H8.0013ZM7.0013 0H3.66797L3.0013 0.666667H0.667969V2H10.0013V0.666667H7.66797L7.0013 0ZM9.33463 2.66667H1.33464V10.6667C1.33464 11.4 1.93464 12 2.66797 12H8.0013C8.73464 12 9.33463 11.4 9.33463 10.6667V2.66667Z",fill:"currentColor"},null,-1),YX=[jX];function JX(n,e){return v(),L("svg",ZX,YX)}const vf=Z(qX,[["render",JX]]),XX={key:0,class:"sidebar-description"},QX={class:"description"},eQ=["innerHTML"],tQ={__name:"Schema",setup(n){const e="aioseo-pro",{graphs:t,getGraphObject:i,getParentGraphName:s}=gt(),r=Lt(),o=Te(),l=je(),a=Ie(),c=Ze(!1),h=Ze(""),d=Ze(null),u=Ze(!1),f={sidebarDescription:C("Configure Schema Markup for your content. Search engines use structured data to display rich results in SERPs.",e),noGraphs:C("You have not added any schema yet. You can add any schema graphs you like via the Schema Generator below.",e),schemaInUse:C("Schema In Use",e),generateSchema:C("Generate Schema",e),validateSchema:C("Validate Schema",e),editSchema:C("Edit Schema",e),deleteSchema:C("Delete Schema",e),viewInEditor:C("View in Editor",e),modal:{isDirtyClosing:{areYouSure:C("Are you sure you want to close the Schema Generator?",e),actionCannotBeUndone:C("Any changes you've made will be lost. This action cannot be undone.",e),confirmation:C("Yes, I want to close the Schema Generator",e),noChangedMind:C("No, I changed my mind",e)},graphDelete:{areYouSure:C("Are you sure you want to delete this schema?",e),actionCannotBeUndone:C("This action cannot be undone.",e),confirmation:C("Yes, I want to delete this schema",e),noChangedMind:C("No, I changed my mind",e)}}},p=kM(),g=xe(()=>{var H,W;return((W=(H=p==null?void 0:p.root)==null?void 0:H.data)==null?void 0:W.screenContext)==="sidebar"}),b=xe(()=>{let H=o.currentPost.schema.graphs;return H=JSON.parse(JSON.stringify(H)),H=H.reverse().map(W=>{var ee;let G=!1,z=!1,q=0;if(H.forEach(he=>{if(he.id===W.id){G=!0;return}he.graphName===W.graphName&&(z=!0,G&&q++)}),(ee=W==null?void 0:W.properties)!=null&&ee.type&&W.properties.type!==W.graphName){const he=i(W);he&&(W.label=W.label+" - "+he.label)}return(0<q||z)&&(W.label=W.label+" - "+(q+1)),W}),H.reverse()}),y=xe(()=>{if(Y7()||Er())return[];let H=o.currentPost.schema.blockGraphs;return H=JSON.parse(JSON.stringify(H)),H=H.reverse().map(W=>{let G=!1,z=!1,q=0;return H.forEach(ee=>{if(ee.schemaBlockId===W.schemaBlockId){G=!0;return}ee.graphName===W.graphName&&(z=!0,G&&q++)}),(0<q||z)&&(W.label+=" - "+(q+1)),W}),H.reverse()}),w=xe(()=>{switch(h.value){case"setModalOpen":return f.modal.isDirtyClosing;default:return f.modal.graphDelete}}),M=(H,W)=>{if(h.value=H,d.value=W,h.value==="setModalOpen"&&!a.isDirty){k();return}Jn(()=>{l.modals.all.push("schema-generator")}),u.value=!0},k=()=>{switch(h.value){case"deleteDefaultGraph":a.deleteDefaultGraph();break;case"deleteCustomGraph":a.deleteCustomGraph(d.value);break;case"deleteGraph":a.deleteGraph(d.value);break;case"setModalOpen":a.setModalOpen(d.value);break}h.value="",d.value="",u.value=!1},V=H=>{let W=window.wp.data.select("core/block-editor").getBlocks();W=iA(W);const G=W.find(z=>{var q;return((q=z==null?void 0:z.attributes)==null?void 0:q.schemaBlockId)===H.schemaBlockId});G&&(window.wp.data.dispatch("core/block-editor").selectBlock(G.clientId),window.wp.data.dispatch("core/block-editor").toggleBlockHighlight(G.clientId,!0))},R=()=>{o.currentPost.schema.blockGraphs.forEach((H,W)=>{const G=H.type.replace(/aioseo\//,"");let z="";switch(G){case"faq":z="faq-page";break;default:z=G;break}const q=t.find(ee=>ee.slug===z);q&&(H.graphName=q.graphName,H.label=q.label+" ("+C("Block",e)+") ",H.slug=q.slug,o.currentPost.schema.blockGraphs[W]=H)})};return Z7(()=>o.currentPost.schema,()=>{R(),a.updateSchemaOutput()},{deep:!0}),a.parseAndUpdateTemplates(r.internalOptions.internal.schema.templates),rh(()=>{a.updateSchemaOutput()}),vM(()=>{R()}),(H,W)=>{const G=x("base-button");return v(),L("div",{class:Re(["aioseo-tab-content aioseo-post-schema",[{sidebar:g.value}]])},[m(_(Ce),{id:"aioseo-post-schema",name:f.schemaInUse},{content:S(()=>[(v(),L("div",{class:"graphs",key:_(a).graphCardsKey},[g.value?(v(),L("div",XX,[A("p",QX,D(f.sidebarDescription),1),A("p",{class:"description",innerHTML:_(be).getDocLink(_(St).learnMore,"schema",!0)},null,8,eQ)])):O("",!0),_(o).currentPost.schema.default.isEnabled&&_(o).currentPost.schema.default.graphName&&_(o).currentPost.schema.default.graphName!=="none"?(v(),E(_(dn),{key:1,defaultGraph:_(o).currentPost.schema.default.graphName},{buttons:S(()=>[m(_(qe),{type:"action"},{tooltip:S(()=>[B(D(f.editSchema),1)]),default:S(()=>[_(s)(_(o).currentPost.schema.default.graphName)!=="WebPage"?(v(),E(G,{key:0,class:"small",type:"gray",disabled:_(a).modalOpenMetabox||_(a).modalOpenSidebar,onClick:W[0]||(W[0]=z=>_(a).editDefaultGraph({parentGraphName:_(s)(_(o).currentPost.schema.default.graphName),isSidebar:g.value}))},{default:S(()=>[m(_(_r))]),_:1},8,["disabled"])):O("",!0)]),_:1}),m(_(qe),{type:"action",offset:g.value?"-25px,0":"0,0"},{tooltip:S(()=>[B(D(f.deleteSchema),1)]),default:S(()=>[m(G,{class:"small",type:"gray",onClick:W[1]||(W[1]=z=>M("deleteDefaultGraph"))},{default:S(()=>[m(_(vf))]),_:1})]),_:1},8,["offset"])]),_:1},8,["defaultGraph"])):O("",!0),(v(!0),L(xt,null,_i(b.value,(z,q)=>(v(),E(_(dn),{key:z.id,graph:z},{buttons:S(()=>[m(_(qe),{type:"action"},{tooltip:S(()=>[B(D(f.editSchema),1)]),default:S(()=>[m(G,{class:"small",type:"gray",onClick:ee=>_(a).editGraph({graphIndex:q,isSidebar:g.value})},{default:S(()=>[m(_(_r))]),_:2},1032,["onClick"])]),_:2},1024),m(_(qe),{type:"action",offset:g.value?"-25px,0":"0,0"},{tooltip:S(()=>[B(D(f.deleteSchema),1)]),default:S(()=>[m(G,{class:"small",type:"gray",onClick:ee=>M("deleteGraph",q)},{default:S(()=>[m(_(vf))]),_:2},1032,["onClick"])]),_:2},1032,["offset"])]),_:2},1032,["graph"]))),128)),(v(!0),L(xt,null,_i(_(o).currentPost.schema.customGraphs,(z,q)=>(v(),E(_(dn),{key:z.id,graph:z,customGraph:""},{buttons:S(()=>[m(_(qe),{type:"action"},{tooltip:S(()=>[B(D(f.editSchema),1)]),default:S(()=>[m(G,{class:"small",type:"gray",onClick:ee=>_(a).editCustomGraph({customGraphIndex:q,isSidebar:g.value})},{default:S(()=>[m(_(_r))]),_:2},1032,["onClick"])]),_:2},1024),m(_(qe),{type:"action",offset:g.value?"-25px,0":"0,0"},{tooltip:S(()=>[B(D(f.deleteSchema),1)]),default:S(()=>[m(G,{class:"small",type:"gray",onClick:ee=>M("deleteCustomGraph",q)},{default:S(()=>[m(_(vf))]),_:2},1032,["onClick"])]),_:2},1032,["offset"])]),_:2},1032,["graph"]))),128)),(v(!0),L(xt,null,_i(y.value,z=>(v(),E(_(dn),{key:z.id,graph:z},{buttons:S(()=>[m(_(qe),{type:"action",offset:g.value?"-25px,0":"0,0"},{tooltip:S(()=>[B(D(f.viewInEditor),1)]),default:S(()=>[m(G,{class:"small",type:"gray",onClick:q=>V(z)},{default:S(()=>[m(_(pl))]),_:2},1032,["onClick"])]),_:2},1032,["offset"])]),_:2},1032,["graph"]))),128))])),A("div",{class:Re(["buttons",{"no-margin":!_(o).currentPost.schema.graphs.length&&!_(o).currentPost.schema.customGraphs.length&&!_(o).currentPost.schema.defaultGraph}])},[!_(o).currentPost.schema.graphs.length&&!_(o).currentPost.schema.customGraphs.length&&!_(o).currentPost.schema.default.isEnabled?(v(),E(_(wt),{key:0,class:"no-graphs",type:"yellow"},{default:S(()=>[B(D(f.noGraphs),1)]),_:1})):O("",!0),m(G,{class:"medium",type:"blue",onClick:W[2]||(W[2]=z=>_(a).setModalOpen({isOpen:!0,initialTab:"schema-templates",isSidebar:g.value}))},{default:S(()=>[B(D(f.generateSchema),1)]),_:1}),m(G,{class:"medium",type:"gray",onClick:W[3]||(W[3]=z=>_(a).setModalOpen({isOpen:!0,initialTab:"schema-validation",isSidebar:g.value}))},{default:S(()=>[B(D(f.validateSchema),1)]),_:1})],2),m(_($7),{show:!g.value&&_(a).modalOpenMetabox,onClose:W[4]||(W[4]=z=>M("setModalOpen",{isOpen:!1,initialTab:"schema-templates",isSidebar:g.value})),"allow-modal-close":!u.value&&!c.value&&!_(a).isDirty,onSubModalToggle:W[5]||(W[5]=z=>c.value=z)},null,8,["show","allow-modal-close"]),m(_($7),{show:g.value&&_(a).modalOpenSidebar,onClose:W[6]||(W[6]=z=>M("setModalOpen",{isOpen:!1,initialTab:"schema-templates",isSidebar:g.value})),"allow-modal-close":!u.value&&!c.value&&!_(a).isDirty,onSubModalToggle:W[7]||(W[7]=z=>c.value=z)},null,8,["show","allow-modal-close"]),m(_(km),{show:u.value,strings:w.value,onDoAction:k,onCloseModal:W[8]||(W[8]=z=>u.value=!1)},null,8,["show","strings"])]),_:1},8,["name"])],2)}}},iQ={class:"title"},sQ=["innerHTML"],nQ={class:"schema-templates"},rQ={class:"main"},oQ={class:"schema-catalog"},lQ={class:"graphs"},aQ={__name:"CtaModal",setup(n){const e="all-in-one-seo-pack",{graphs:t}=gt(),i=je(),s={schemaGenerator:C("Schema Generator",e),headerTooltip:j(C("Use our powerful Schema Generator to configure Schema Markup for your content. Search Engines use structured data to better understand what your site is about as well as to display rich snippets in search results. %1$s",e),be.getDocLink(St.learnMore,"schema",!0)),searchSchema:C("Search Schema",e),ctaDescription:C("Easily generate unlimited schema markup for your content to help you rank higher in search results. Our schema validator ensures your schema works out of the box.",e),ctaButtonText:C("Unlock Schema Generator",e),ctaHeader:j(C("Schema Generator is a %1$s Feature",e),"PRO")},r=[C("Unlimited Schema",e),C("Validate with Google",e),C("Increase Rankings",e),C("Additional Schema Types",e)],o=[{slug:"schema-templates",icon:r9,name:C("Schema Templates",e),component:"templates"},{slug:"custom-schema",icon:o9,name:C("Custom Schema",e),component:"custom"},{slug:"schema-validation",icon:l9,name:C("Schema Validation",e),component:"validation"}],l=[{slug:"schema-catalog",name:C("Schema Catalog",e)},{slug:"your-templates",name:C("Your Templates",e)}];return(a,c)=>{const h=x("base-input"),d=x("base-button");return v(),E(_(Qt),{classes:["aioseo-post-schema-modal-cta"],onClose:c[0]||(c[0]=u=>a.$emit("close"))},{headerTitle:S(()=>[A("div",iQ,D(s.schemaGenerator),1),m(_(qe),null,{tooltip:S(()=>[A("span",{innerHTML:s.headerTooltip},null,8,sQ)]),default:S(()=>[m(_(yr))]),_:1})]),body:S(()=>[m(_(eo),null,{default:S(()=>[m(_(Qi),{tabs:o,active:"schema-templates",showSaveButton:!1},{"var-tab-icon":S(({tab:u})=>[(v(),E(bt(u.icon)))]),_:1}),A("div",nQ,[m(_(Qi),{tabs:l,active:"schema-catalog",showSaveButton:!1},{"var-tab-icon":S(({tab:u})=>[(v(),E(bt(u.icon)))]),_:1}),A("div",rQ,[m(h,{class:"search",size:"medium",prependIcon:"search",placeholder:s.searchSchema},null,8,["placeholder"]),A("div",oQ,[A("div",lQ,[(v(!0),L(xt,null,_i(_(t),(u,f)=>(v(),E(_(dn),{key:u.graphName+f,graph:u},{buttons:S(()=>[m(d,{class:"small",type:"gray"},{default:S(()=>[m(_(Or))]),_:1})]),_:2},1032,["graph"]))),128))])])])])]),_:1}),m(_(vd),{"cta-link":_(be).getPricingUrl("schema-generator","schema-generator-upsell"),"button-text":s.ctaButtonText,"learn-more-link":_(be).getUpsellUrl("schema-generator",null,_(i).isPro?"pricing":"liteUpgrade"),"feature-list":r},{"header-text":S(()=>[B(D(s.ctaHeader),1)]),description:S(()=>[B(D(s.ctaDescription),1)]),_:1},8,["cta-link","button-text","learn-more-link"])]),_:1})}}},uo="all-in-one-seo-pack",hQ={setup(){return{postEditorStore:Te(),GLOBAL_STRINGS:St,links:be}},components:{CoreAlert:wt,CoreSettingsRow:Ce,CoreTooltip:qe,CtaModal:aQ,GraphCard:dn,SvgEye:pl},props:{parentComponentContext:String},data(){return{modalOpenMetabox:!1,modalOpenSidebar:!1,strings:{sidebarDescription:C("Configure Schema Markup for your content. Search engines use structured data to display rich results in SERPs.",uo),noGraphs:C("You have not added any schema yet. You can add any schema graphs you like via the Schema Generator below.",uo),schemaInUse:C("Schema In Use",uo),generateSchema:C("Generate Schema",uo),validateSchema:C("Validate Schema",uo),defaultGraphTooltip:C("This is the default graph for this post type. All data for this graph will be automatically generated.",uo)}}},computed:{isSidebar(){return this.$root.$data.screenContext==="sidebar"}},methods:{getDefaultSchemaTooltipOffset(){return Er()?"-120px,0":this.isSidebar?"-70px,0":"0,0"}}},cQ={class:"graphs"},dQ={key:0,class:"sidebar-description"},uQ={class:"description"},fQ=["innerHTML"],pQ=["innerHTML"],gQ={class:"buttons"};function mQ(n,e,t,i,s,r){const o=x("svg-eye"),l=x("base-button"),a=x("core-tooltip"),c=x("graph-card"),h=x("core-alert"),d=x("cta-modal"),u=x("core-settings-row");return v(),L("div",{class:Re(["aioseo-tab-content aioseo-post-schema",[{sidebar:r.isSidebar}]])},[m(u,{name:s.strings.schemaInUse},{content:S(()=>[A("div",cQ,[r.isSidebar?(v(),L("div",dQ,[A("p",uQ,D(s.strings.sidebarDescription),1),A("p",{class:"description",innerHTML:i.links.getDocLink(i.GLOBAL_STRINGS.learnMore,"schema",!0)},null,8,fQ)])):O("",!0),i.postEditorStore.currentPost.schema.default.graphName&&i.postEditorStore.currentPost.schema.default.isEnabled?(v(),E(c,{key:1,defaultGraph:i.postEditorStore.currentPost.schema.default.graphName},{buttons:S(()=>[m(a,{offset:r.getDefaultSchemaTooltipOffset()},{tooltip:S(()=>[A("span",{innerHTML:s.strings.defaultGraphTooltip},null,8,pQ)]),default:S(()=>[m(l,{class:"small no-hover",type:"gray"},{default:S(()=>[m(o)]),_:1})]),_:1},8,["offset"])]),_:1},8,["defaultGraph"])):O("",!0)]),A("div",gQ,[!i.postEditorStore.currentPost.schema.default.graphName||!i.postEditorStore.currentPost.schema.default.isEnabled?(v(),E(h,{key:0,class:"no-graphs",type:"yellow"},{default:S(()=>[B(D(s.strings.noGraphs),1)]),_:1})):O("",!0),m(l,{class:"medium",type:"blue",onClick:e[0]||(e[0]=f=>{s.modalOpenMetabox=!0,s.modalOpenSidebar=!0})},{default:S(()=>[B(D(s.strings.generateSchema),1)]),_:1}),m(l,{class:"medium",type:"gray",onClick:e[1]||(e[1]=f=>{s.modalOpenMetabox=!0,s.modalOpenSidebar=!0})},{default:S(()=>[B(D(s.strings.validateSchema),1)]),_:1})]),m(d,{show:!r.isSidebar&&s.modalOpenMetabox,onClose:e[2]||(e[2]=f=>s.modalOpenMetabox=!1)},null,8,["show"]),m(d,{show:r.isSidebar&&s.modalOpenSidebar,onClose:e[3]||(e[3]=f=>s.modalOpenSidebar=!1)},null,8,["show"])]),_:1},8,["name"])],2)}const CQ=Z(hQ,[["render",mQ]]),yQ={setup(){return{licenseStore:pi()}},components:{Schema:tQ,SchemaLite:CQ},props:{parentComponentContext:String}},bQ={class:"aioseo-post-schema-view"};function SQ(n,e,t,i,s,r){const o=x("schema",!0),l=x("schema-lite");return v(),L("div",bQ,[i.licenseStore.isUnlicensed?O("",!0):(v(),E(o,{key:0,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])),i.licenseStore.isUnlicensed?(v(),E(l,{key:1,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])):O("",!0)])}const wQ=Z(yQ,[["render",SQ]]),vQ={},kQ={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 360 140"},xQ=xM('<g clip-path="url(#clip0_2413_17199)"><rect width="360" height="140" fill="#F0F6FF"></rect><mask id="mask0_2413_17199" style="mask-type:alpha;" maskUnits="userSpaceOnUse" x="0" y="0" width="360" height="140"><rect width="360" height="140" fill="#F0F6FF"></rect></mask><g mask="url(#mask0_2413_17199)"><path d="M103.999 43.373L96.5342 50.8383H100.475V60.8697H107.496V50.8383H111.465L103.999 43.373Z" fill="#99C2FF"></path><mask id="mask1_2413_17199" style="mask-type:alpha;" maskUnits="userSpaceOnUse" x="1" y="7" width="330" height="133"><path d="M39.4936 111.282L1.97168 139.869H330.75V7.875L83.2671 106.2L39.4936 111.282Z" fill="#E5F0FF"></path></mask><g mask="url(#mask1_2413_17199)"><rect x="29" y="-2" width="36.1429" height="145" fill="url(#paint0_linear_2413_17199)"></rect><rect x="73.1428" y="-2" width="36.1429" height="145" fill="url(#paint1_linear_2413_17199)"></rect><rect x="117.286" y="-2" width="36.1429" height="145" fill="url(#paint2_linear_2413_17199)"></rect><rect x="161.429" y="-2" width="36.1429" height="145" fill="url(#paint3_linear_2413_17199)"></rect><rect x="205.571" y="-2" width="36.1429" height="145" fill="url(#paint4_linear_2413_17199)"></rect><rect x="249.714" y="-2" width="36.1429" height="145" fill="url(#paint5_linear_2413_17199)"></rect><rect x="293.857" y="-2" width="36.1429" height="145" fill="url(#paint6_linear_2413_17199)"></rect></g><path d="M1.97168 139.869L39.4936 111.282L83.2671 106.2L328.875 8.25" stroke="#005AE0"></path><circle cx="3" cy="140" r="2" fill="#005AE0"></circle><circle cx="39.3492" cy="111.479" r="2" fill="#005AE0"></circle><circle cx="83.1083" cy="106.291" r="2" fill="#005AE0"></circle><circle cx="330" cy="4.125" r="2" fill="#005AE0"></circle><rect x="34" y="105" width="12" height="12" rx="6" fill="#005AE0"></rect><path d="M40.7705 113H39.915V110.07H38.916V109.502C39.1797 109.49 39.3643 109.473 39.4697 109.449C39.6377 109.412 39.7744 109.338 39.8799 109.227C39.9521 109.15 40.0068 109.049 40.0439 108.922C40.0654 108.846 40.0762 108.789 40.0762 108.752H40.7705V113Z" fill="white"></path><rect x="77" y="100" width="12" height="12" rx="6" fill="#005AE0"></rect><path d="M83.5859 104.616C83.4863 104.497 83.3438 104.438 83.1582 104.438C82.9043 104.438 82.7314 104.532 82.6396 104.722C82.5869 104.831 82.5557 105.005 82.5459 105.243H81.7344C81.748 104.882 81.8135 104.59 81.9307 104.367C82.1533 103.943 82.5488 103.731 83.1172 103.731C83.5664 103.731 83.9238 103.856 84.1895 104.106C84.4551 104.354 84.5879 104.684 84.5879 105.094C84.5879 105.408 84.4941 105.688 84.3066 105.932C84.1836 106.094 83.9814 106.274 83.7002 106.474L83.3662 106.711C83.1572 106.859 83.0137 106.967 82.9355 107.033C82.8594 107.1 82.7949 107.177 82.7422 107.265H84.5967V108H81.6875C81.6953 107.695 81.7607 107.417 81.8838 107.165C82.0029 106.882 82.2842 106.582 82.7275 106.266C83.1123 105.99 83.3613 105.793 83.4746 105.674C83.6484 105.488 83.7354 105.285 83.7354 105.064C83.7354 104.885 83.6855 104.735 83.5859 104.616Z" fill="white"></path><rect x="323" y="2" width="12" height="12" rx="6" fill="#005AE0"></rect><circle cx="329" cy="8" r="3.1875" fill="#005AE0" stroke="white" stroke-width="2"></circle><rect x="29.0171" y="80.9497" width="61" height="14" rx="2" fill="#141B38"></rect><path d="M35.3081 88.397H34.3911V89.9497H33.4946V85.6313H35.3755C35.8091 85.6313 36.1548 85.7427 36.4126 85.9653C36.6704 86.188 36.7993 86.5327 36.7993 86.9995C36.7993 87.5093 36.6704 87.8696 36.4126 88.0806C36.1548 88.2915 35.7866 88.397 35.3081 88.397ZM35.73 87.4976C35.8472 87.394 35.9058 87.23 35.9058 87.0054C35.9058 86.7808 35.8462 86.6206 35.7271 86.5249C35.6099 86.4292 35.4448 86.3813 35.2319 86.3813H34.3911V87.6528H35.2319C35.4448 87.6528 35.6108 87.6011 35.73 87.4976ZM39.0142 87.5269C38.6782 87.5269 38.4526 87.6362 38.3374 87.855C38.2729 87.978 38.2407 88.1675 38.2407 88.4233V89.9497H37.3999V86.7563H38.1968V87.313C38.3257 87.1001 38.438 86.9546 38.5337 86.8765C38.6899 86.7456 38.8931 86.6802 39.1431 86.6802C39.1587 86.6802 39.1714 86.6812 39.1812 86.6831C39.1929 86.6831 39.2173 86.6841 39.2544 86.686V87.5415C39.2017 87.5356 39.1548 87.5317 39.1138 87.5298C39.0728 87.5278 39.0396 87.5269 39.0142 87.5269ZM42.48 89.0122C42.4585 89.2017 42.3599 89.394 42.1841 89.5894C41.9106 89.8999 41.5278 90.0552 41.0356 90.0552C40.6294 90.0552 40.271 89.9243 39.9604 89.6626C39.6499 89.4009 39.4946 88.9751 39.4946 88.3853C39.4946 87.8325 39.6343 87.4087 39.9136 87.1138C40.1948 86.8188 40.5591 86.6714 41.0063 86.6714C41.272 86.6714 41.5112 86.7212 41.7241 86.8208C41.937 86.9204 42.1128 87.0776 42.2515 87.2925C42.3765 87.4819 42.4575 87.7017 42.4946 87.9517C42.5161 88.0981 42.5249 88.3091 42.521 88.5845H40.3354C40.3472 88.9048 40.4478 89.1294 40.6372 89.2583C40.7524 89.3384 40.8911 89.3784 41.0532 89.3784C41.2251 89.3784 41.3647 89.3296 41.4722 89.2319C41.5308 89.1792 41.5825 89.106 41.6274 89.0122H42.48ZM41.6538 88.0337C41.6401 87.813 41.5728 87.646 41.4517 87.5327C41.3325 87.4175 41.1841 87.3599 41.0063 87.3599C40.813 87.3599 40.6626 87.4204 40.5552 87.5415C40.4497 87.6626 40.3833 87.8267 40.356 88.0337H41.6538ZM42.7729 86.7563H43.7104L44.3755 89.1118L45.0552 86.7563H45.9517L44.8003 89.9497H43.9185L42.7729 86.7563ZM47.2847 86.7563V89.9497H46.438V86.7563H47.2847ZM47.2847 85.605V86.3755H46.438V85.605H47.2847ZM50.7593 87.1606C51.0288 87.4985 51.1636 87.8979 51.1636 88.3589C51.1636 88.8276 51.0288 89.229 50.7593 89.563C50.4897 89.895 50.0806 90.061 49.5317 90.061C48.9829 90.061 48.5737 89.895 48.3042 89.563C48.0347 89.229 47.8999 88.8276 47.8999 88.3589C47.8999 87.8979 48.0347 87.4985 48.3042 87.1606C48.5737 86.8228 48.9829 86.6538 49.5317 86.6538C50.0806 86.6538 50.4897 86.8228 50.7593 87.1606ZM49.5288 87.3599C49.2847 87.3599 49.0962 87.4468 48.9634 87.6206C48.8325 87.7925 48.7671 88.0386 48.7671 88.3589C48.7671 88.6792 48.8325 88.9263 48.9634 89.1001C49.0962 89.2739 49.2847 89.3608 49.5288 89.3608C49.7729 89.3608 49.9604 89.2739 50.0913 89.1001C50.2222 88.9263 50.2876 88.6792 50.2876 88.3589C50.2876 88.0386 50.2222 87.7925 50.0913 87.6206C49.9604 87.4468 49.7729 87.3599 49.5288 87.3599ZM53.812 89.4985C53.8042 89.5083 53.7847 89.5376 53.7534 89.5864C53.7222 89.6353 53.6851 89.6782 53.6421 89.7153C53.5112 89.8325 53.3843 89.9126 53.2612 89.9556C53.1401 89.9985 52.9976 90.02 52.8335 90.02C52.3608 90.02 52.0425 89.8501 51.8784 89.5103C51.7866 89.3228 51.7407 89.0464 51.7407 88.6812V86.7563H52.5962V88.6812C52.5962 88.8628 52.6177 88.9995 52.6606 89.0913C52.7368 89.2534 52.8862 89.3345 53.1089 89.3345C53.394 89.3345 53.5894 89.2192 53.6948 88.9888C53.7495 88.8638 53.7769 88.6987 53.7769 88.4937V86.7563H54.6235V89.9497H53.812V89.4985ZM57.6323 86.9028C57.8823 87.063 58.0259 87.3384 58.063 87.729H57.228C57.2163 87.6216 57.186 87.5366 57.1372 87.4741C57.0454 87.3608 56.8892 87.3042 56.6685 87.3042C56.4868 87.3042 56.3569 87.3325 56.2788 87.3892C56.2026 87.4458 56.1646 87.5122 56.1646 87.5884C56.1646 87.6841 56.2056 87.7534 56.2876 87.7964C56.3696 87.8413 56.6597 87.9185 57.1577 88.0278C57.4897 88.106 57.7388 88.2241 57.9048 88.3823C58.0688 88.5425 58.1509 88.7427 58.1509 88.9829C58.1509 89.2993 58.0327 89.5581 57.7964 89.7593C57.562 89.9585 57.1987 90.0581 56.7065 90.0581C56.2046 90.0581 55.8335 89.9526 55.5933 89.7417C55.355 89.5288 55.2358 89.2583 55.2358 88.9302H56.0825C56.1001 89.0786 56.1382 89.1841 56.1968 89.2466C56.3003 89.3579 56.4917 89.4136 56.771 89.4136C56.9351 89.4136 57.0649 89.3892 57.1606 89.3403C57.2583 89.2915 57.3071 89.2183 57.3071 89.1206C57.3071 89.0269 57.2681 88.9556 57.1899 88.9067C57.1118 88.8579 56.8218 88.7739 56.3198 88.6548C55.9585 88.5649 55.7036 88.4526 55.5552 88.3179C55.4067 88.1851 55.3325 87.9937 55.3325 87.7437C55.3325 87.4487 55.4478 87.1958 55.6782 86.9849C55.9106 86.772 56.2368 86.6655 56.6567 86.6655C57.0552 86.6655 57.3804 86.7446 57.6323 86.9028ZM62.3433 88.2563H61.4116V89.9497H60.5298V85.6313H62.6479C62.9507 85.6372 63.1831 85.6743 63.3452 85.7427C63.5093 85.811 63.6479 85.9116 63.7612 86.0444C63.855 86.1538 63.9292 86.2749 63.9839 86.4077C64.0386 86.5405 64.0659 86.6919 64.0659 86.8618C64.0659 87.0669 64.0142 87.269 63.9106 87.4683C63.8071 87.6655 63.6362 87.8052 63.3979 87.8872C63.5972 87.9673 63.7378 88.0815 63.8198 88.23C63.9038 88.3765 63.9458 88.6011 63.9458 88.9038V89.1938C63.9458 89.3911 63.9536 89.5249 63.9692 89.5952C63.9927 89.7065 64.0474 89.7886 64.1333 89.8413V89.9497H63.1401C63.1128 89.854 63.0933 89.7769 63.0815 89.7183C63.0581 89.5972 63.0454 89.4731 63.0435 89.3462L63.0376 88.9448C63.0337 88.6694 62.9829 88.4858 62.8853 88.394C62.7896 88.3022 62.6089 88.2563 62.3433 88.2563ZM62.8911 87.4712C63.0708 87.3892 63.1606 87.2271 63.1606 86.9849C63.1606 86.7231 63.0737 86.5474 62.8999 86.4575C62.8022 86.4067 62.6558 86.3813 62.4604 86.3813H61.4116V87.5415H62.4341C62.6372 87.5415 62.7896 87.5181 62.8911 87.4712ZM67.5112 89.0122C67.4897 89.2017 67.3911 89.394 67.2153 89.5894C66.9419 89.8999 66.5591 90.0552 66.0669 90.0552C65.6606 90.0552 65.3022 89.9243 64.9917 89.6626C64.6812 89.4009 64.5259 88.9751 64.5259 88.3853C64.5259 87.8325 64.6655 87.4087 64.9448 87.1138C65.2261 86.8188 65.5903 86.6714 66.0376 86.6714C66.3032 86.6714 66.5425 86.7212 66.7554 86.8208C66.9683 86.9204 67.144 87.0776 67.2827 87.2925C67.4077 87.4819 67.4888 87.7017 67.5259 87.9517C67.5474 88.0981 67.5562 88.3091 67.5522 88.5845H65.3667C65.3784 88.9048 65.479 89.1294 65.6685 89.2583C65.7837 89.3384 65.9224 89.3784 66.0845 89.3784C66.2563 89.3784 66.396 89.3296 66.5034 89.2319C66.562 89.1792 66.6138 89.106 66.6587 89.0122H67.5112ZM66.6851 88.0337C66.6714 87.813 66.604 87.646 66.4829 87.5327C66.3638 87.4175 66.2153 87.3599 66.0376 87.3599C65.8442 87.3599 65.6938 87.4204 65.5864 87.5415C65.481 87.6626 65.4146 87.8267 65.3872 88.0337H66.6851ZM67.8042 86.7563H68.7417L69.4067 89.1118L70.0864 86.7563H70.9829L69.8315 89.9497H68.9497L67.8042 86.7563ZM72.3159 86.7563V89.9497H71.4692V86.7563H72.3159ZM72.3159 85.605V86.3755H71.4692V85.605H72.3159ZM75.3276 86.9028C75.5776 87.063 75.7212 87.3384 75.7583 87.729H74.9233C74.9116 87.6216 74.8813 87.5366 74.8325 87.4741C74.7407 87.3608 74.5845 87.3042 74.3638 87.3042C74.1821 87.3042 74.0522 87.3325 73.9741 87.3892C73.8979 87.4458 73.8599 87.5122 73.8599 87.5884C73.8599 87.6841 73.9009 87.7534 73.9829 87.7964C74.0649 87.8413 74.355 87.9185 74.853 88.0278C75.1851 88.106 75.4341 88.2241 75.6001 88.3823C75.7642 88.5425 75.8462 88.7427 75.8462 88.9829C75.8462 89.2993 75.728 89.5581 75.4917 89.7593C75.2573 89.9585 74.894 90.0581 74.4019 90.0581C73.8999 90.0581 73.5288 89.9526 73.2886 89.7417C73.0503 89.5288 72.9312 89.2583 72.9312 88.9302H73.7778C73.7954 89.0786 73.8335 89.1841 73.8921 89.2466C73.9956 89.3579 74.187 89.4136 74.4663 89.4136C74.6304 89.4136 74.7603 89.3892 74.856 89.3403C74.9536 89.2915 75.0024 89.2183 75.0024 89.1206C75.0024 89.0269 74.9634 88.9556 74.8853 88.9067C74.8071 88.8579 74.5171 88.7739 74.0151 88.6548C73.6538 88.5649 73.3989 88.4526 73.2505 88.3179C73.1021 88.1851 73.0278 87.9937 73.0278 87.7437C73.0278 87.4487 73.1431 87.1958 73.3735 86.9849C73.606 86.772 73.9321 86.6655 74.3521 86.6655C74.7505 86.6655 75.0757 86.7446 75.3276 86.9028ZM77.3257 86.7563V89.9497H76.479V86.7563H77.3257ZM77.3257 85.605V86.3755H76.479V85.605H77.3257ZM80.8003 87.1606C81.0698 87.4985 81.2046 87.8979 81.2046 88.3589C81.2046 88.8276 81.0698 89.229 80.8003 89.563C80.5308 89.895 80.1216 90.061 79.5728 90.061C79.0239 90.061 78.6147 89.895 78.3452 89.563C78.0757 89.229 77.9409 88.8276 77.9409 88.3589C77.9409 87.8979 78.0757 87.4985 78.3452 87.1606C78.6147 86.8228 79.0239 86.6538 79.5728 86.6538C80.1216 86.6538 80.5308 86.8228 80.8003 87.1606ZM79.5698 87.3599C79.3257 87.3599 79.1372 87.4468 79.0044 87.6206C78.8735 87.7925 78.8081 88.0386 78.8081 88.3589C78.8081 88.6792 78.8735 88.9263 79.0044 89.1001C79.1372 89.2739 79.3257 89.3608 79.5698 89.3608C79.814 89.3608 80.0015 89.2739 80.1323 89.1001C80.2632 88.9263 80.3286 88.6792 80.3286 88.3589C80.3286 88.0386 80.2632 87.7925 80.1323 87.6206C80.0015 87.4468 79.814 87.3599 79.5698 87.3599ZM83.3081 87.3745C83.0249 87.3745 82.8306 87.4946 82.7251 87.7349C82.6704 87.8618 82.6431 88.0239 82.6431 88.2212V89.9497H81.811V86.7622H82.6167V87.228C82.7241 87.064 82.8257 86.9458 82.9214 86.8735C83.0933 86.7446 83.311 86.6802 83.5747 86.6802C83.9048 86.6802 84.1743 86.7671 84.3833 86.9409C84.5942 87.1128 84.6997 87.3989 84.6997 87.7993V89.9497H83.8442V88.0073C83.8442 87.8394 83.8218 87.7104 83.7769 87.6206C83.6948 87.4565 83.5386 87.3745 83.3081 87.3745Z" fill="white"></path><path d="M83.0171 97.9497L86.0171 94.9497L80.0171 94.9497L83.0171 97.9497Z" fill="#141B38"></path><path d="M330 17L327 20H333L330 17Z" fill="#141B38"></path><rect x="301.5" y="20" width="57" height="14" rx="2" fill="#141B38"></rect><path d="M309.004 28.6777C308.682 28.9727 308.27 29.1201 307.768 29.1201C307.146 29.1201 306.658 28.9209 306.303 28.5225C305.947 28.1221 305.77 27.5732 305.77 26.876C305.77 26.1221 305.972 25.541 306.376 25.1328C306.728 24.7773 307.175 24.5996 307.718 24.5996C308.444 24.5996 308.976 24.8379 309.312 25.3145C309.497 25.582 309.597 25.8506 309.61 26.1201H308.708C308.649 25.9131 308.574 25.7568 308.482 25.6514C308.318 25.4639 308.075 25.3701 307.753 25.3701C307.425 25.3701 307.166 25.5029 306.977 25.7686C306.787 26.0322 306.692 26.4062 306.692 26.8906C306.692 27.375 306.792 27.7383 306.991 27.9805C307.192 28.2207 307.447 28.3408 307.756 28.3408C308.072 28.3408 308.313 28.2373 308.479 28.0303C308.571 27.9189 308.647 27.752 308.708 27.5293H309.602C309.523 28 309.324 28.3828 309.004 28.6777ZM312.273 28.5488C312.266 28.5586 312.246 28.5879 312.215 28.6367C312.184 28.6855 312.146 28.7285 312.104 28.7656C311.973 28.8828 311.846 28.9629 311.723 29.0059C311.602 29.0488 311.459 29.0703 311.295 29.0703C310.822 29.0703 310.504 28.9004 310.34 28.5605C310.248 28.373 310.202 28.0967 310.202 27.7314V25.8066H311.058V27.7314C311.058 27.9131 311.079 28.0498 311.122 28.1416C311.198 28.3037 311.348 28.3848 311.57 28.3848C311.855 28.3848 312.051 28.2695 312.156 28.0391C312.211 27.9141 312.238 27.749 312.238 27.5439V25.8066H313.085V29H312.273V28.5488ZM315.499 26.5771C315.163 26.5771 314.938 26.6865 314.822 26.9053C314.758 27.0283 314.726 27.2178 314.726 27.4736V29H313.885V25.8066H314.682V26.3633C314.811 26.1504 314.923 26.0049 315.019 25.9268C315.175 25.7959 315.378 25.7305 315.628 25.7305C315.644 25.7305 315.656 25.7314 315.666 25.7334C315.678 25.7334 315.702 25.7344 315.739 25.7363V26.5918C315.687 26.5859 315.64 26.582 315.599 26.5801C315.558 26.5781 315.524 26.5771 315.499 26.5771ZM317.837 26.5771C317.501 26.5771 317.275 26.6865 317.16 26.9053C317.096 27.0283 317.063 27.2178 317.063 27.4736V29H316.223V25.8066H317.02V26.3633C317.148 26.1504 317.261 26.0049 317.356 25.9268C317.513 25.7959 317.716 25.7305 317.966 25.7305C317.981 25.7305 317.994 25.7314 318.004 25.7334C318.016 25.7334 318.04 25.7344 318.077 25.7363V26.5918C318.024 26.5859 317.978 26.582 317.937 26.5801C317.896 26.5781 317.862 26.5771 317.837 26.5771ZM321.303 28.0625C321.281 28.252 321.183 28.4443 321.007 28.6396C320.733 28.9502 320.351 29.1055 319.858 29.1055C319.452 29.1055 319.094 28.9746 318.783 28.7129C318.473 28.4512 318.317 28.0254 318.317 27.4355C318.317 26.8828 318.457 26.459 318.736 26.1641C319.018 25.8691 319.382 25.7217 319.829 25.7217C320.095 25.7217 320.334 25.7715 320.547 25.8711C320.76 25.9707 320.936 26.1279 321.074 26.3428C321.199 26.5322 321.28 26.752 321.317 27.002C321.339 27.1484 321.348 27.3594 321.344 27.6348H319.158C319.17 27.9551 319.271 28.1797 319.46 28.3086C319.575 28.3887 319.714 28.4287 319.876 28.4287C320.048 28.4287 320.188 28.3799 320.295 28.2822C320.354 28.2295 320.405 28.1562 320.45 28.0625H321.303ZM320.477 27.084C320.463 26.8633 320.396 26.6963 320.274 26.583C320.155 26.4678 320.007 26.4102 319.829 26.4102C319.636 26.4102 319.485 26.4707 319.378 26.5918C319.272 26.7129 319.206 26.877 319.179 27.084H320.477ZM323.412 26.4248C323.129 26.4248 322.935 26.5449 322.829 26.7852C322.774 26.9121 322.747 27.0742 322.747 27.2715V29H321.915V25.8125H322.721V26.2783C322.828 26.1143 322.93 25.9961 323.025 25.9238C323.197 25.7949 323.415 25.7305 323.679 25.7305C324.009 25.7305 324.278 25.8174 324.487 25.9912C324.698 26.1631 324.804 26.4492 324.804 26.8496V29H323.948V27.0576C323.948 26.8896 323.926 26.7607 323.881 26.6709C323.799 26.5068 323.643 26.4248 323.412 26.4248ZM327.039 28.4053V29.0293L326.644 29.0439C326.249 29.0576 325.979 28.9893 325.835 28.8389C325.741 28.7432 325.694 28.5957 325.694 28.3965V26.4307H325.249V25.8359H325.694V24.9453H326.521V25.8359H327.039V26.4307H326.521V28.1182C326.521 28.249 326.537 28.3311 326.57 28.3643C326.604 28.3955 326.705 28.4111 326.875 28.4111C326.9 28.4111 326.927 28.4111 326.954 28.4111C326.983 28.4092 327.012 28.4072 327.039 28.4053ZM331.146 27.3066H330.215V29H329.333V24.6816H331.451C331.754 24.6875 331.986 24.7246 332.148 24.793C332.312 24.8613 332.451 24.9619 332.564 25.0947C332.658 25.2041 332.732 25.3252 332.787 25.458C332.842 25.5908 332.869 25.7422 332.869 25.9121C332.869 26.1172 332.817 26.3193 332.714 26.5186C332.61 26.7158 332.439 26.8555 332.201 26.9375C332.4 27.0176 332.541 27.1318 332.623 27.2803C332.707 27.4268 332.749 27.6514 332.749 27.9541V28.2441C332.749 28.4414 332.757 28.5752 332.772 28.6455C332.796 28.7568 332.851 28.8389 332.937 28.8916V29H331.943C331.916 28.9043 331.896 28.8271 331.885 28.7686C331.861 28.6475 331.849 28.5234 331.847 28.3965L331.841 27.9951C331.837 27.7197 331.786 27.5361 331.688 27.4443C331.593 27.3525 331.412 27.3066 331.146 27.3066ZM331.694 26.5215C331.874 26.4395 331.964 26.2773 331.964 26.0352C331.964 25.7734 331.877 25.5977 331.703 25.5078C331.605 25.457 331.459 25.4316 331.264 25.4316H330.215V26.5918H331.237C331.44 26.5918 331.593 26.5684 331.694 26.5215ZM336.314 28.0625C336.293 28.252 336.194 28.4443 336.019 28.6396C335.745 28.9502 335.362 29.1055 334.87 29.1055C334.464 29.1055 334.105 28.9746 333.795 28.7129C333.484 28.4512 333.329 28.0254 333.329 27.4355C333.329 26.8828 333.469 26.459 333.748 26.1641C334.029 25.8691 334.394 25.7217 334.841 25.7217C335.106 25.7217 335.346 25.7715 335.559 25.8711C335.771 25.9707 335.947 26.1279 336.086 26.3428C336.211 26.5322 336.292 26.752 336.329 27.002C336.351 27.1484 336.359 27.3594 336.355 27.6348H334.17C334.182 27.9551 334.282 28.1797 334.472 28.3086C334.587 28.3887 334.726 28.4287 334.888 28.4287C335.06 28.4287 335.199 28.3799 335.307 28.2822C335.365 28.2295 335.417 28.1562 335.462 28.0625H336.314ZM335.488 27.084C335.475 26.8633 335.407 26.6963 335.286 26.583C335.167 26.4678 335.019 26.4102 334.841 26.4102C334.647 26.4102 334.497 26.4707 334.39 26.5918C334.284 26.7129 334.218 26.877 334.19 27.084H335.488ZM336.607 25.8066H337.545L338.21 28.1621L338.89 25.8066H339.786L338.635 29H337.753L336.607 25.8066ZM341.119 25.8066V29H340.272V25.8066H341.119ZM341.119 24.6553V25.4258H340.272V24.6553H341.119ZM344.131 25.9531C344.381 26.1133 344.524 26.3887 344.562 26.7793H343.727C343.715 26.6719 343.685 26.5869 343.636 26.5244C343.544 26.4111 343.388 26.3545 343.167 26.3545C342.985 26.3545 342.855 26.3828 342.777 26.4395C342.701 26.4961 342.663 26.5625 342.663 26.6387C342.663 26.7344 342.704 26.8037 342.786 26.8467C342.868 26.8916 343.158 26.9688 343.656 27.0781C343.988 27.1562 344.237 27.2744 344.403 27.4326C344.567 27.5928 344.649 27.793 344.649 28.0332C344.649 28.3496 344.531 28.6084 344.295 28.8096C344.061 29.0088 343.697 29.1084 343.205 29.1084C342.703 29.1084 342.332 29.0029 342.092 28.792C341.854 28.5791 341.734 28.3086 341.734 27.9805H342.581C342.599 28.1289 342.637 28.2344 342.695 28.2969C342.799 28.4082 342.99 28.4639 343.27 28.4639C343.434 28.4639 343.563 28.4395 343.659 28.3906C343.757 28.3418 343.806 28.2686 343.806 28.1709C343.806 28.0771 343.767 28.0059 343.688 27.957C343.61 27.9082 343.32 27.8242 342.818 27.7051C342.457 27.6152 342.202 27.5029 342.054 27.3682C341.905 27.2354 341.831 27.0439 341.831 26.7939C341.831 26.499 341.946 26.2461 342.177 26.0352C342.409 25.8223 342.735 25.7158 343.155 25.7158C343.554 25.7158 343.879 25.7949 344.131 25.9531ZM346.129 25.8066V29H345.282V25.8066H346.129ZM346.129 24.6553V25.4258H345.282V24.6553H346.129ZM349.604 26.2109C349.873 26.5488 350.008 26.9482 350.008 27.4092C350.008 27.8779 349.873 28.2793 349.604 28.6133C349.334 28.9453 348.925 29.1113 348.376 29.1113C347.827 29.1113 347.418 28.9453 347.148 28.6133C346.879 28.2793 346.744 27.8779 346.744 27.4092C346.744 26.9482 346.879 26.5488 347.148 26.2109C347.418 25.873 347.827 25.7041 348.376 25.7041C348.925 25.7041 349.334 25.873 349.604 26.2109ZM348.373 26.4102C348.129 26.4102 347.94 26.4971 347.808 26.6709C347.677 26.8428 347.611 27.0889 347.611 27.4092C347.611 27.7295 347.677 27.9766 347.808 28.1504C347.94 28.3242 348.129 28.4111 348.373 28.4111C348.617 28.4111 348.805 28.3242 348.936 28.1504C349.066 27.9766 349.132 27.7295 349.132 27.4092C349.132 27.0889 349.066 26.8428 348.936 26.6709C348.805 26.4971 348.617 26.4102 348.373 26.4102ZM352.111 26.4248C351.828 26.4248 351.634 26.5449 351.528 26.7852C351.474 26.9121 351.446 27.0742 351.446 27.2715V29H350.614V25.8125H351.42V26.2783C351.527 26.1143 351.629 25.9961 351.725 25.9238C351.896 25.7949 352.114 25.7305 352.378 25.7305C352.708 25.7305 352.978 25.8174 353.187 25.9912C353.397 26.1631 353.503 26.4492 353.503 26.8496V29H352.647V27.0576C352.647 26.8896 352.625 26.7607 352.58 26.6709C352.498 26.5068 352.342 26.4248 352.111 26.4248Z" fill="white"></path></g><g filter="url(#filter0_dd_2413_17199)"><rect x="96.9312" y="15.1432" width="166.138" height="109.714" rx="3.13467" fill="white"></rect><path d="M96.9312 18.7548C96.9312 16.7601 98.5482 15.1431 100.543 15.1431H259.457C261.452 15.1431 263.069 16.7601 263.069 18.7548V30.8165H96.9312V18.7548Z" fill="#141B38"></path><circle cx="106.28" cy="22.9798" r="2.03477" fill="#F83C5D"></circle><circle cx="112.757" cy="22.9799" r="2.03477" fill="#F18200"></circle><circle cx="119.235" cy="22.9799" r="2.03477" fill="#07C575"></circle><rect x="129.697" y="17.8858" width="122.416" height="10.1884" rx="5.0942" fill="white"></rect><rect x="143.203" y="20.9965" width="85.4097" height="3.96698" rx="1.98349" fill="#E8E8EB"></rect><g clip-path="url(#clip1_2413_17199)"><path d="M138.853 21.9907H138.571V21.4255C138.571 20.6455 137.938 20.0125 137.158 20.0125C136.378 20.0125 135.745 20.6455 135.745 21.4255V21.9907H135.462C135.151 21.9907 134.897 22.245 134.897 22.5559V25.382C134.897 25.6928 135.151 25.9472 135.462 25.9472H138.853C139.164 25.9472 139.418 25.6928 139.418 25.382V22.5559C139.418 22.245 139.164 21.9907 138.853 21.9907ZM137.158 24.5342C136.847 24.5342 136.592 24.2798 136.592 23.9689C136.592 23.6581 136.847 23.4037 137.158 23.4037C137.468 23.4037 137.723 23.6581 137.723 23.9689C137.723 24.2798 137.468 24.5342 137.158 24.5342ZM138.034 21.9907H136.281V21.4255C136.281 20.9422 136.674 20.5494 137.158 20.5494C137.641 20.5494 138.034 20.9422 138.034 21.4255V21.9907Z" fill="#D0D1D7"></path></g><path d="M96.9312 30.8165H263.069V121.245C263.069 123.24 261.452 124.857 259.457 124.857H100.543C98.5482 124.857 96.9312 123.24 96.9312 121.245V30.8165Z" fill="white"></path><g clip-path="url(#clip2_2413_17199)"><path d="M106.109 43.3276C106.115 43.4458 106.143 43.5418 106.192 43.6156C106.286 43.7537 106.451 43.8227 106.687 43.8227C106.793 43.8227 106.89 43.8076 106.977 43.7773C107.145 43.7187 107.229 43.6137 107.229 43.4624C107.229 43.3489 107.194 43.268 107.123 43.2198C107.051 43.1725 106.939 43.1314 106.785 43.0964L106.503 43.0326C106.319 42.991 106.188 42.9451 106.112 42.895C105.979 42.808 105.913 42.6779 105.913 42.5049C105.913 42.3176 105.978 42.164 106.107 42.0439C106.237 41.9238 106.42 41.8637 106.658 41.8637C106.876 41.8637 107.061 41.9167 107.214 42.0226C107.367 42.1276 107.444 42.2959 107.444 42.5276H107.178C107.164 42.416 107.134 42.3304 107.087 42.2708C107.001 42.1621 106.855 42.1077 106.649 42.1077C106.483 42.1077 106.363 42.1427 106.29 42.2127C106.217 42.2826 106.181 42.364 106.181 42.4567C106.181 42.5588 106.224 42.6335 106.309 42.6808C106.365 42.711 106.491 42.7489 106.687 42.7943L106.98 42.8609C107.121 42.8931 107.229 42.9371 107.306 42.9929C107.438 43.0903 107.505 43.2316 107.505 43.417C107.505 43.6477 107.42 43.8128 107.252 43.9121C107.085 44.0113 106.89 44.061 106.668 44.061C106.408 44.061 106.206 43.9948 106.059 43.8624C105.912 43.731 105.841 43.5527 105.843 43.3276H106.109ZM108.455 42.4467C108.563 42.4467 108.667 42.4723 108.768 42.5233C108.869 42.5734 108.947 42.6387 109 42.7191C109.051 42.7957 109.085 42.885 109.102 42.9872C109.117 43.0572 109.124 43.1687 109.124 43.3219H108.011C108.016 43.4761 108.052 43.6 108.12 43.6936C108.188 43.7863 108.294 43.8326 108.436 43.8326C108.57 43.8326 108.676 43.7886 108.756 43.7007C108.801 43.6496 108.833 43.5905 108.852 43.5234H109.103C109.096 43.5792 109.074 43.6416 109.036 43.7106C109 43.7787 108.958 43.8345 108.912 43.878C108.834 43.9537 108.738 44.0047 108.624 44.0312C108.562 44.0463 108.493 44.0539 108.415 44.0539C108.226 44.0539 108.066 43.9853 107.934 43.8482C107.803 43.7101 107.737 43.5172 107.737 43.2695C107.737 43.0255 107.803 42.8274 107.936 42.6751C108.068 42.5228 108.241 42.4467 108.455 42.4467ZM108.862 43.1191C108.852 43.0085 108.827 42.92 108.79 42.8538C108.72 42.7309 108.603 42.6694 108.439 42.6694C108.322 42.6694 108.224 42.712 108.144 42.7971C108.065 42.8813 108.023 42.9886 108.018 43.1191H108.862ZM109.629 43.5957C109.629 43.6695 109.656 43.7276 109.71 43.7702C109.764 43.8128 109.828 43.834 109.902 43.834C109.991 43.834 110.078 43.8132 110.163 43.7716C110.304 43.7026 110.375 43.5896 110.375 43.4326V43.2269C110.344 43.2468 110.304 43.2633 110.255 43.2766C110.206 43.2898 110.157 43.2993 110.11 43.3049L109.955 43.3248C109.863 43.3371 109.793 43.3565 109.747 43.3829C109.668 43.4274 109.629 43.4983 109.629 43.5957ZM110.248 43.0794C110.306 43.0718 110.346 43.0472 110.365 43.0056C110.377 42.9829 110.382 42.9503 110.382 42.9077C110.382 42.8207 110.351 42.7579 110.289 42.7191C110.227 42.6794 110.139 42.6595 110.024 42.6595C109.89 42.6595 109.796 42.6954 109.74 42.7673C109.709 42.807 109.688 42.8661 109.679 42.9446H109.441C109.445 42.7574 109.506 42.6273 109.622 42.5545C109.739 42.4808 109.875 42.4439 110.029 42.4439C110.208 42.4439 110.353 42.4779 110.465 42.546C110.575 42.6141 110.631 42.72 110.631 42.8638V43.739C110.631 43.7655 110.636 43.7867 110.646 43.8028C110.658 43.8189 110.681 43.8269 110.716 43.8269C110.727 43.8269 110.74 43.8265 110.754 43.8255C110.768 43.8236 110.783 43.8213 110.799 43.8184V44.0071C110.76 44.0184 110.729 44.0255 110.709 44.0284C110.688 44.0312 110.66 44.0326 110.624 44.0326C110.536 44.0326 110.472 44.0014 110.432 43.939C110.411 43.9059 110.397 43.8591 110.388 43.7986C110.336 43.8667 110.261 43.9258 110.164 43.9759C110.067 44.026 109.959 44.0511 109.842 44.0511C109.701 44.0511 109.586 44.0085 109.496 43.9234C109.407 43.8373 109.363 43.73 109.363 43.6014C109.363 43.4605 109.406 43.3513 109.494 43.2737C109.582 43.1962 109.698 43.1484 109.841 43.1304L110.248 43.0794ZM111.052 42.4808H111.294V42.7432C111.314 42.6921 111.363 42.6302 111.441 42.5574C111.518 42.4836 111.607 42.4467 111.709 42.4467C111.713 42.4467 111.721 42.4472 111.733 42.4481C111.744 42.4491 111.763 42.451 111.791 42.4538V42.7233C111.776 42.7205 111.762 42.7186 111.748 42.7177C111.736 42.7167 111.722 42.7162 111.707 42.7162C111.579 42.7162 111.48 42.7579 111.411 42.8411C111.342 42.9233 111.307 43.0184 111.307 43.1262V44H111.052V42.4808ZM112.592 42.4368C112.763 42.4368 112.902 42.4784 113.009 42.5616C113.117 42.6448 113.182 42.7881 113.204 42.9914H112.955C112.94 42.8978 112.906 42.8203 112.852 42.7588C112.798 42.6964 112.711 42.6652 112.592 42.6652C112.43 42.6652 112.313 42.7446 112.243 42.9035C112.198 43.0066 112.175 43.1338 112.175 43.2851C112.175 43.4373 112.207 43.5655 112.272 43.6695C112.336 43.7735 112.437 43.8255 112.575 43.8255C112.681 43.8255 112.765 43.7934 112.826 43.7291C112.889 43.6638 112.932 43.5749 112.955 43.4624H113.204C113.175 43.6638 113.104 43.8113 112.991 43.905C112.877 43.9976 112.732 44.044 112.555 44.044C112.357 44.044 112.198 43.9716 112.08 43.8269C111.962 43.6813 111.903 43.4997 111.903 43.2822C111.903 43.0155 111.968 42.808 112.097 42.6595C112.227 42.511 112.392 42.4368 112.592 42.4368ZM113.453 41.9091H113.708V42.6865C113.769 42.6099 113.823 42.5559 113.872 42.5247C113.954 42.4708 114.056 42.4439 114.179 42.4439C114.4 42.4439 114.549 42.521 114.628 42.6751C114.67 42.7593 114.691 42.8761 114.691 43.0255V44H114.429V43.0425C114.429 42.9309 114.415 42.8491 114.386 42.7971C114.34 42.7139 114.253 42.6723 114.125 42.6723C114.02 42.6723 113.924 42.7087 113.838 42.7815C113.751 42.8543 113.708 42.9919 113.708 43.1943V44H113.453V41.9091ZM115.965 41.9162H116.25V44H115.965V41.9162ZM116.67 42.4808H116.922V42.6964C116.983 42.6217 117.038 42.5673 117.087 42.5333C117.171 42.4756 117.267 42.4467 117.373 42.4467C117.495 42.4467 117.592 42.4765 117.666 42.5361C117.707 42.5701 117.745 42.6203 117.779 42.6865C117.836 42.6051 117.903 42.5451 117.979 42.5063C118.056 42.4666 118.142 42.4467 118.237 42.4467C118.442 42.4467 118.581 42.5205 118.654 42.668C118.694 42.7474 118.714 42.8543 118.714 42.9886V44H118.449V42.9446C118.449 42.8434 118.423 42.7739 118.372 42.7361C118.322 42.6983 118.261 42.6794 118.188 42.6794C118.087 42.6794 118.001 42.7129 117.928 42.7801C117.856 42.8472 117.82 42.9593 117.82 43.1163V44H117.561V43.0085C117.561 42.9054 117.548 42.8302 117.524 42.7829C117.485 42.712 117.413 42.6765 117.307 42.6765C117.21 42.6765 117.122 42.7139 117.043 42.7886C116.964 42.8633 116.925 42.9985 116.925 43.1943V44H116.67V42.4808ZM119.725 43.8284C119.844 43.8284 119.943 43.7787 120.022 43.6794C120.101 43.5792 120.141 43.4298 120.141 43.2312C120.141 43.1101 120.123 43.0061 120.088 42.9191C120.022 42.7517 119.901 42.668 119.725 42.668C119.548 42.668 119.427 42.7564 119.362 42.9333C119.327 43.0278 119.31 43.1479 119.31 43.2936C119.31 43.4108 119.327 43.5106 119.362 43.5929C119.428 43.7499 119.549 43.8284 119.725 43.8284ZM119.064 42.4879H119.312V42.6893C119.364 42.6203 119.419 42.5668 119.48 42.529C119.566 42.4723 119.667 42.4439 119.783 42.4439C119.956 42.4439 120.102 42.5101 120.222 42.6425C120.342 42.7739 120.402 42.9621 120.402 43.207C120.402 43.538 120.315 43.7745 120.142 43.9163C120.033 44.0061 119.905 44.0511 119.759 44.0511C119.645 44.0511 119.549 44.026 119.471 43.9759C119.426 43.9475 119.375 43.8988 119.32 43.8298V44.6057H119.064V42.4879ZM120.702 42.4808H120.945V42.7432C120.965 42.6921 121.014 42.6302 121.091 42.5574C121.169 42.4836 121.258 42.4467 121.359 42.4467C121.364 42.4467 121.372 42.4472 121.383 42.4481C121.395 42.4491 121.414 42.451 121.442 42.4538V42.7233C121.426 42.7205 121.412 42.7186 121.399 42.7177C121.387 42.7167 121.373 42.7162 121.358 42.7162C121.229 42.7162 121.13 42.7579 121.061 42.8411C120.992 42.9233 120.958 43.0184 120.958 43.1262V44H120.702V42.4808ZM122.29 42.4467C122.397 42.4467 122.502 42.4723 122.603 42.5233C122.704 42.5734 122.781 42.6387 122.834 42.7191C122.885 42.7957 122.919 42.885 122.937 42.9872C122.952 43.0572 122.959 43.1687 122.959 43.3219H121.846C121.85 43.4761 121.887 43.6 121.955 43.6936C122.023 43.7863 122.128 43.8326 122.271 43.8326C122.405 43.8326 122.511 43.7886 122.59 43.7007C122.636 43.6496 122.668 43.5905 122.687 43.5234H122.938C122.931 43.5792 122.909 43.6416 122.871 43.7106C122.834 43.7787 122.793 43.8345 122.746 43.878C122.669 43.9537 122.573 44.0047 122.458 44.0312C122.397 44.0463 122.327 44.0539 122.25 44.0539C122.061 44.0539 121.901 43.9853 121.769 43.8482C121.638 43.7101 121.572 43.5172 121.572 43.2695C121.572 43.0255 121.638 42.8274 121.77 42.6751C121.903 42.5228 122.076 42.4467 122.29 42.4467ZM122.697 43.1191C122.686 43.0085 122.662 42.92 122.624 42.8538C122.554 42.7309 122.438 42.6694 122.274 42.6694C122.157 42.6694 122.058 42.712 121.979 42.7971C121.9 42.8813 121.857 42.9886 121.853 43.1191H122.697ZM123.42 43.5234C123.428 43.6085 123.449 43.6737 123.484 43.7191C123.548 43.8014 123.66 43.8425 123.819 43.8425C123.913 43.8425 123.996 43.8222 124.068 43.7815C124.14 43.7399 124.176 43.6761 124.176 43.59C124.176 43.5248 124.147 43.4751 124.09 43.4411C124.053 43.4203 123.98 43.3962 123.871 43.3688L123.668 43.3177C123.539 43.2855 123.443 43.2496 123.382 43.2099C123.272 43.1409 123.217 43.0453 123.217 42.9233C123.217 42.7796 123.269 42.6633 123.372 42.5744C123.476 42.4855 123.615 42.441 123.79 42.441C124.019 42.441 124.184 42.5082 124.285 42.6425C124.349 42.7276 124.379 42.8193 124.378 42.9177H124.136C124.132 42.86 124.111 42.8075 124.075 42.7602C124.017 42.6931 123.915 42.6595 123.77 42.6595C123.674 42.6595 123.601 42.6779 123.551 42.7148C123.501 42.7517 123.477 42.8004 123.477 42.8609C123.477 42.9271 123.509 42.9801 123.575 43.0198C123.613 43.0434 123.668 43.0643 123.742 43.0822L123.911 43.1234C124.094 43.1678 124.217 43.2108 124.28 43.2524C124.379 43.3177 124.429 43.4203 124.429 43.5603C124.429 43.6955 124.377 43.8123 124.274 43.9106C124.172 44.009 124.016 44.0582 123.806 44.0582C123.58 44.0582 123.42 44.0071 123.325 43.905C123.231 43.8019 123.181 43.6747 123.175 43.5234H123.42ZM124.867 43.5234C124.874 43.6085 124.896 43.6737 124.931 43.7191C124.995 43.8014 125.107 43.8425 125.265 43.8425C125.36 43.8425 125.443 43.8222 125.515 43.7815C125.587 43.7399 125.623 43.6761 125.623 43.59C125.623 43.5248 125.594 43.4751 125.536 43.4411C125.499 43.4203 125.427 43.3962 125.318 43.3688L125.115 43.3177C124.986 43.2855 124.89 43.2496 124.829 43.2099C124.719 43.1409 124.664 43.0453 124.664 42.9233C124.664 42.7796 124.716 42.6633 124.819 42.5744C124.923 42.4855 125.062 42.441 125.237 42.441C125.466 42.441 125.631 42.5082 125.732 42.6425C125.795 42.7276 125.826 42.8193 125.824 42.9177H125.583C125.578 42.86 125.558 42.8075 125.522 42.7602C125.464 42.6931 125.362 42.6595 125.217 42.6595C125.121 42.6595 125.047 42.6779 124.997 42.7148C124.948 42.7517 124.924 42.8004 124.924 42.8609C124.924 42.9271 124.956 42.9801 125.021 43.0198C125.059 43.0434 125.115 43.0643 125.189 43.0822L125.358 43.1234C125.541 43.1678 125.664 43.2108 125.726 43.2524C125.826 43.3177 125.875 43.4203 125.875 43.5603C125.875 43.6955 125.824 43.8123 125.721 43.9106C125.619 44.009 125.463 44.0582 125.253 44.0582C125.027 44.0582 124.866 44.0071 124.772 43.905C124.678 43.8019 124.628 43.6747 124.621 43.5234H124.867ZM126.162 42.4879H126.421V44H126.162V42.4879ZM126.162 41.9162H126.421V42.2056H126.162V41.9162ZM127.406 43.8355C127.575 43.8355 127.691 43.7716 127.753 43.644C127.817 43.5153 127.848 43.3725 127.848 43.2156C127.848 43.0737 127.826 42.9583 127.78 42.8694C127.708 42.7295 127.584 42.6595 127.409 42.6595C127.253 42.6595 127.139 42.7191 127.068 42.8382C126.997 42.9574 126.962 43.1011 126.962 43.2695C126.962 43.4312 126.997 43.5659 127.068 43.6737C127.139 43.7815 127.252 43.8355 127.406 43.8355ZM127.416 42.4368C127.611 42.4368 127.777 42.502 127.912 42.6325C128.047 42.7631 128.115 42.955 128.115 43.2085C128.115 43.4534 128.055 43.6558 127.936 43.8156C127.817 43.9754 127.632 44.0553 127.382 44.0553C127.173 44.0553 127.007 43.9849 126.884 43.844C126.761 43.7021 126.699 43.512 126.699 43.2737C126.699 43.0184 126.764 42.8151 126.894 42.6638C127.023 42.5124 127.197 42.4368 127.416 42.4368ZM128.414 42.4808H128.657V42.6964C128.729 42.6075 128.805 42.5437 128.885 42.5049C128.965 42.4661 129.055 42.4467 129.153 42.4467C129.369 42.4467 129.514 42.5219 129.59 42.6723C129.632 42.7545 129.653 42.8723 129.653 43.0255V44H129.393V43.0425C129.393 42.9498 129.379 42.8751 129.352 42.8184C129.306 42.7238 129.224 42.6765 129.105 42.6765C129.044 42.6765 128.995 42.6827 128.956 42.695C128.886 42.7158 128.825 42.7574 128.772 42.8198C128.729 42.8699 128.701 42.9219 128.688 42.9758C128.676 43.0288 128.669 43.1049 128.669 43.2042V44H128.414V42.4808ZM130.177 43.5234C130.185 43.6085 130.206 43.6737 130.241 43.7191C130.305 43.8014 130.417 43.8425 130.576 43.8425C130.67 43.8425 130.754 43.8222 130.825 43.7815C130.897 43.7399 130.933 43.6761 130.933 43.59C130.933 43.5248 130.904 43.4751 130.847 43.4411C130.81 43.4203 130.737 43.3962 130.628 43.3688L130.425 43.3177C130.296 43.2855 130.2 43.2496 130.139 43.2099C130.029 43.1409 129.974 43.0453 129.974 42.9233C129.974 42.7796 130.026 42.6633 130.129 42.5744C130.233 42.4855 130.373 42.441 130.547 42.441C130.776 42.441 130.941 42.5082 131.043 42.6425C131.106 42.7276 131.137 42.8193 131.135 42.9177H130.894C130.889 42.86 130.869 42.8075 130.833 42.7602C130.774 42.6931 130.672 42.6595 130.528 42.6595C130.431 42.6595 130.358 42.6779 130.308 42.7148C130.259 42.7517 130.234 42.8004 130.234 42.8609C130.234 42.9271 130.267 42.9801 130.332 43.0198C130.37 43.0434 130.425 43.0643 130.499 43.0822L130.668 43.1234C130.851 43.1678 130.974 43.2108 131.037 43.2524C131.136 43.3177 131.186 43.4203 131.186 43.5603C131.186 43.6955 131.134 43.8123 131.031 43.9106C130.929 44.009 130.773 44.0582 130.563 44.0582C130.337 44.0582 130.177 44.0071 130.082 43.905C129.989 43.8019 129.938 43.6747 129.932 43.5234H130.177Z" fill="#434960"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M133.363 43C133.363 42.3127 133.921 41.7549 134.608 41.7549C135.295 41.7549 135.853 42.3127 135.853 43C135.853 43.6873 135.295 44.2451 134.608 44.2451C133.921 44.2451 133.363 43.6873 133.363 43ZM134.733 43.7476H134.484V43.4977H134.733V43.7476ZM134.608 43.9959C134.059 43.9959 133.612 43.5489 133.612 42.9998C133.612 42.4507 134.059 42.0038 134.608 42.0038C135.157 42.0038 135.604 42.4507 135.604 42.9998C135.604 43.5489 135.157 43.9959 134.608 43.9959ZM134.11 42.7506C134.11 42.4755 134.333 42.2526 134.608 42.2526C134.883 42.2526 135.106 42.4755 135.106 42.7506C135.106 42.9103 135.008 42.9963 134.912 43.08C134.821 43.1594 134.732 43.2368 134.732 43.3731H134.483C134.483 43.1464 134.601 43.0565 134.704 42.9774C134.785 42.9154 134.857 42.8601 134.857 42.7506C134.857 42.6137 134.745 42.5016 134.608 42.5016C134.471 42.5016 134.359 42.6137 134.359 42.7506H134.11Z" fill="#8C8F9A"></path></g><path d="M107.902 52H107.073V49.163H106.106V48.6126C106.361 48.6012 106.54 48.5842 106.642 48.5615C106.805 48.5256 106.937 48.4537 107.039 48.3459C107.109 48.2721 107.162 48.1738 107.198 48.0508C107.219 47.9771 107.229 47.9222 107.229 47.8863H107.902V52ZM110.537 52.1021C110.013 52.1021 109.646 51.9187 109.434 51.5517C109.224 51.1848 109.119 50.6619 109.119 49.9829C109.119 49.3039 109.224 48.78 109.434 48.4111C109.646 48.0423 110.013 47.8579 110.537 47.8579C111.061 47.8579 111.429 48.0423 111.641 48.4111C111.851 48.78 111.956 49.3039 111.956 49.9829C111.956 50.6619 111.85 51.1848 111.638 51.5517C111.428 51.9187 111.061 52.1021 110.537 52.1021ZM111.011 51.0666C111.085 50.817 111.122 50.4557 111.122 49.9829C111.122 49.4873 111.084 49.1204 111.008 48.8821C110.934 48.6438 110.778 48.5246 110.537 48.5246C110.297 48.5246 110.138 48.6438 110.061 48.8821C109.983 49.1204 109.944 49.4873 109.944 49.9829C109.944 50.4557 109.983 50.8179 110.061 51.0695C110.138 51.3191 110.297 51.4439 110.537 51.4439C110.778 51.4439 110.935 51.3182 111.011 51.0666ZM113.772 52.1021C113.248 52.1021 112.88 51.9187 112.668 51.5517C112.458 51.1848 112.353 50.6619 112.353 49.9829C112.353 49.3039 112.458 48.78 112.668 48.4111C112.88 48.0423 113.248 47.8579 113.772 47.8579C114.295 47.8579 114.663 48.0423 114.875 48.4111C115.085 48.78 115.19 49.3039 115.19 49.9829C115.19 50.6619 115.084 51.1848 114.872 51.5517C114.662 51.9187 114.295 52.1021 113.772 52.1021ZM114.245 51.0666C114.319 50.817 114.356 50.4557 114.356 49.9829C114.356 49.4873 114.318 49.1204 114.242 48.8821C114.169 48.6438 114.012 48.5246 113.772 48.5246C113.531 48.5246 113.372 48.6438 113.295 48.8821C113.217 49.1204 113.179 49.4873 113.179 49.9829C113.179 50.4557 113.217 50.8179 113.295 51.0695C113.372 51.3191 113.531 51.4439 113.772 51.4439C114.012 51.4439 114.17 51.3182 114.245 51.0666ZM119.553 52H118.43L117.139 50.1729L116.722 50.6013V52H115.862V47.8182H116.722V49.5403L118.336 47.8182H119.465L117.752 49.5403L119.553 52Z" fill="#2C324C"></path><path d="M122.908 50.415L123.946 49.3775L124.983 50.415H122.908Z" fill="#00AA63"></path><path d="M128.107 51H127.634V49.3788H127.081V49.0643C127.227 49.0578 127.329 49.0481 127.388 49.0351C127.481 49.0146 127.556 48.9735 127.615 48.9119C127.655 48.8698 127.685 48.8136 127.705 48.7433C127.717 48.7012 127.723 48.6698 127.723 48.6493H128.107V51ZM129.853 49.1276C129.798 49.0616 129.719 49.0287 129.617 49.0287C129.476 49.0287 129.381 49.0811 129.33 49.1859C129.301 49.2464 129.283 49.3426 129.278 49.4745H128.829C128.836 49.2745 128.873 49.113 128.937 48.9898C129.061 48.7552 129.279 48.638 129.594 48.638C129.843 48.638 130.04 48.7071 130.187 48.8455C130.334 48.9827 130.408 49.1648 130.408 49.3918C130.408 49.5658 130.356 49.7204 130.252 49.8555C130.184 49.9452 130.072 50.0451 129.917 50.1554L129.732 50.2867C129.616 50.3688 129.537 50.4283 129.493 50.465C129.451 50.5018 129.416 50.5445 129.386 50.5931H130.413V51H128.803C128.807 50.8314 128.843 50.6774 128.911 50.538C128.977 50.3813 129.133 50.2154 129.378 50.0403C129.591 49.8879 129.729 49.7787 129.792 49.7128C129.888 49.6101 129.936 49.4977 129.936 49.3756C129.936 49.2762 129.908 49.1935 129.853 49.1276ZM130.755 50.5169H131.246V51H130.755V50.5169ZM132.728 51H132.254V49.3788H131.701V49.0643C131.847 49.0578 131.95 49.0481 132.008 49.0351C132.101 49.0146 132.176 48.9735 132.235 48.9119C132.275 48.8698 132.305 48.8136 132.326 48.7433C132.338 48.7012 132.343 48.6698 132.343 48.6493H132.728V51ZM134.971 50.4439C134.971 50.2764 135.03 50.1338 135.148 50.016C135.266 49.8992 135.408 49.8409 135.574 49.8409C135.741 49.8409 135.883 49.8998 136.001 50.0176C136.119 50.1354 136.178 50.2775 136.178 50.4439C136.178 50.6104 136.119 50.7525 136.001 50.8703C135.883 50.9881 135.741 51.047 135.574 51.047C135.408 51.047 135.266 50.9881 135.148 50.8703C135.03 50.7525 134.971 50.6104 134.971 50.4439ZM133.572 49.6901C133.454 49.5723 133.396 49.4302 133.396 49.2637C133.396 49.0973 133.454 48.9552 133.572 48.8374C133.69 48.7196 133.832 48.6607 133.999 48.6607C134.165 48.6607 134.307 48.7196 134.425 48.8374C134.543 48.9552 134.602 49.0973 134.602 49.2637C134.602 49.4302 134.543 49.5723 134.425 49.6901C134.308 49.8079 134.166 49.8668 133.999 49.8668C133.832 49.8668 133.69 49.8079 133.572 49.6901ZM134.253 51.0616H134.002L135.317 48.6493H135.563L134.253 51.0616ZM135.393 50.6255C135.443 50.6763 135.503 50.7017 135.574 50.7017C135.646 50.7017 135.706 50.6768 135.756 50.6271C135.807 50.5763 135.832 50.5153 135.832 50.4439C135.832 50.3726 135.807 50.3121 135.756 50.2624C135.706 50.2116 135.646 50.1862 135.574 50.1862C135.503 50.1862 135.442 50.2116 135.391 50.2624C135.342 50.3121 135.317 50.3726 135.317 50.4439C135.317 50.5153 135.342 50.5758 135.393 50.6255ZM133.817 49.4453C133.867 49.4961 133.927 49.5215 133.999 49.5215C134.07 49.5215 134.131 49.4966 134.18 49.4469C134.231 49.3961 134.256 49.3351 134.256 49.2637C134.256 49.1924 134.231 49.1319 134.18 49.0822C134.131 49.0314 134.07 49.006 133.999 49.006C133.927 49.006 133.866 49.0314 133.815 49.0822C133.766 49.1319 133.741 49.1924 133.741 49.2637C133.741 49.3351 133.766 49.3956 133.817 49.4453Z" fill="#00AA63"></path><path d="M142.851 41V53" stroke="#DCDDE1" stroke-width="0.2"></path><g clip-path="url(#clip3_2413_17199)"><path d="M149.257 43.3276C149.263 43.4458 149.291 43.5418 149.34 43.6156C149.434 43.7537 149.599 43.8227 149.835 43.8227C149.941 43.8227 150.038 43.8076 150.125 43.7773C150.293 43.7187 150.377 43.6137 150.377 43.4624C150.377 43.3489 150.342 43.268 150.271 43.2198C150.199 43.1725 150.086 43.1314 149.933 43.0964L149.651 43.0326C149.467 42.991 149.336 42.9451 149.259 42.895C149.127 42.808 149.061 42.6779 149.061 42.5049C149.061 42.3176 149.126 42.164 149.255 42.0439C149.385 41.9238 149.568 41.8637 149.806 41.8637C150.024 41.8637 150.209 41.9167 150.362 42.0226C150.515 42.1276 150.591 42.2959 150.591 42.5276H150.326C150.312 42.416 150.282 42.3304 150.235 42.2708C150.149 42.1621 150.003 42.1077 149.797 42.1077C149.631 42.1077 149.511 42.1427 149.438 42.2127C149.365 42.2826 149.329 42.364 149.329 42.4567C149.329 42.5588 149.372 42.6335 149.457 42.6808C149.512 42.711 149.639 42.7489 149.835 42.7943L150.128 42.8609C150.269 42.8931 150.377 42.9371 150.454 42.9929C150.586 43.0903 150.652 43.2316 150.652 43.417C150.652 43.6477 150.568 43.8128 150.4 43.9121C150.233 44.0113 150.038 44.061 149.816 44.061C149.556 44.061 149.354 43.9948 149.207 43.8624C149.06 43.731 148.989 43.5527 148.991 43.3276H149.257ZM151.603 42.4467C151.711 42.4467 151.815 42.4723 151.916 42.5233C152.017 42.5734 152.094 42.6387 152.147 42.7191C152.199 42.7957 152.233 42.885 152.25 42.9872C152.265 43.0572 152.272 43.1687 152.272 43.3219H151.159C151.163 43.4761 151.2 43.6 151.268 43.6936C151.336 43.7863 151.442 43.8326 151.584 43.8326C151.718 43.8326 151.824 43.7886 151.903 43.7007C151.949 43.6496 151.981 43.5905 152 43.5234H152.251C152.244 43.5792 152.222 43.6416 152.184 43.7106C152.147 43.7787 152.106 43.8345 152.06 43.878C151.982 43.9537 151.886 44.0047 151.772 44.0312C151.71 44.0463 151.641 44.0539 151.563 44.0539C151.374 44.0539 151.214 43.9853 151.082 43.8482C150.951 43.7101 150.885 43.5172 150.885 43.2695C150.885 43.0255 150.951 42.8274 151.084 42.6751C151.216 42.5228 151.389 42.4467 151.603 42.4467ZM152.01 43.1191C151.999 43.0085 151.975 42.92 151.938 42.8538C151.868 42.7309 151.751 42.6694 151.587 42.6694C151.47 42.6694 151.372 42.712 151.292 42.7971C151.213 42.8813 151.171 42.9886 151.166 43.1191H152.01ZM152.777 43.5957C152.777 43.6695 152.804 43.7276 152.858 43.7702C152.912 43.8128 152.976 43.834 153.049 43.834C153.139 43.834 153.226 43.8132 153.311 43.7716C153.452 43.7026 153.523 43.5896 153.523 43.4326V43.2269C153.492 43.2468 153.452 43.2633 153.403 43.2766C153.354 43.2898 153.305 43.2993 153.258 43.3049L153.103 43.3248C153.011 43.3371 152.941 43.3565 152.895 43.3829C152.816 43.4274 152.777 43.4983 152.777 43.5957ZM153.396 43.0794C153.454 43.0718 153.493 43.0472 153.513 43.0056C153.525 42.9829 153.53 42.9503 153.53 42.9077C153.53 42.8207 153.499 42.7579 153.437 42.7191C153.375 42.6794 153.287 42.6595 153.171 42.6595C153.038 42.6595 152.944 42.6954 152.888 42.7673C152.857 42.807 152.836 42.8661 152.827 42.9446H152.588C152.593 42.7574 152.654 42.6273 152.77 42.5545C152.887 42.4808 153.023 42.4439 153.177 42.4439C153.356 42.4439 153.501 42.4779 153.613 42.546C153.723 42.6141 153.779 42.72 153.779 42.8638V43.739C153.779 43.7655 153.784 43.7867 153.794 43.8028C153.806 43.8189 153.829 43.8269 153.864 43.8269C153.875 43.8269 153.888 43.8265 153.902 43.8255C153.916 43.8236 153.931 43.8213 153.947 43.8184V44.0071C153.908 44.0184 153.877 44.0255 153.857 44.0284C153.836 44.0312 153.807 44.0326 153.772 44.0326C153.684 44.0326 153.62 44.0014 153.58 43.939C153.559 43.9059 153.545 43.8591 153.536 43.7986C153.484 43.8667 153.409 43.9258 153.312 43.9759C153.215 44.026 153.107 44.0511 152.99 44.0511C152.849 44.0511 152.734 44.0085 152.644 43.9234C152.555 43.8373 152.51 43.73 152.51 43.6014C152.51 43.4605 152.554 43.3513 152.642 43.2737C152.73 43.1962 152.846 43.1484 152.988 43.1304L153.396 43.0794ZM154.2 42.4808H154.442V42.7432C154.462 42.6921 154.511 42.6302 154.588 42.5574C154.666 42.4836 154.755 42.4467 154.857 42.4467C154.861 42.4467 154.869 42.4472 154.881 42.4481C154.892 42.4491 154.911 42.451 154.939 42.4538V42.7233C154.924 42.7205 154.91 42.7186 154.896 42.7177C154.884 42.7167 154.87 42.7162 154.855 42.7162C154.727 42.7162 154.628 42.7579 154.559 42.8411C154.49 42.9233 154.455 43.0184 154.455 43.1262V44H154.2V42.4808ZM155.74 42.4368C155.911 42.4368 156.05 42.4784 156.157 42.5616C156.265 42.6448 156.33 42.7881 156.352 42.9914H156.103C156.088 42.8978 156.054 42.8203 156 42.7588C155.946 42.6964 155.859 42.6652 155.74 42.6652C155.577 42.6652 155.461 42.7446 155.391 42.9035C155.346 43.0066 155.323 43.1338 155.323 43.2851C155.323 43.4373 155.355 43.5655 155.42 43.6695C155.484 43.7735 155.585 43.8255 155.723 43.8255C155.829 43.8255 155.913 43.7934 155.974 43.7291C156.037 43.6638 156.08 43.5749 156.103 43.4624H156.352C156.323 43.6638 156.252 43.8113 156.139 43.905C156.025 43.9976 155.88 44.044 155.703 44.044C155.505 44.044 155.346 43.9716 155.228 43.8269C155.11 43.6813 155.051 43.4997 155.051 43.2822C155.051 43.0155 155.116 42.808 155.245 42.6595C155.375 42.511 155.54 42.4368 155.74 42.4368ZM156.601 41.9091H156.856V42.6865C156.917 42.6099 156.971 42.5559 157.02 42.5247C157.102 42.4708 157.204 42.4439 157.327 42.4439C157.548 42.4439 157.697 42.521 157.776 42.6751C157.818 42.7593 157.839 42.8761 157.839 43.0255V44H157.577V43.0425C157.577 42.9309 157.563 42.8491 157.534 42.7971C157.488 42.7139 157.401 42.6723 157.273 42.6723C157.168 42.6723 157.072 42.7087 156.985 42.7815C156.899 42.8543 156.856 42.9919 156.856 43.1943V44H156.601V41.9091ZM159.927 41.8595C160.191 41.8595 160.396 41.929 160.541 42.068C160.687 42.207 160.768 42.3649 160.784 42.5418H160.509C160.478 42.4075 160.415 42.3011 160.322 42.2226C160.229 42.1441 160.098 42.1049 159.93 42.1049C159.725 42.1049 159.559 42.1772 159.432 42.3219C159.306 42.4656 159.243 42.6865 159.243 42.9843C159.243 43.2283 159.3 43.4264 159.414 43.5787C159.528 43.73 159.698 43.8057 159.924 43.8057C160.132 43.8057 160.291 43.7258 160.4 43.5659C160.457 43.4818 160.5 43.3711 160.529 43.234H160.804C160.779 43.4534 160.698 43.6373 160.56 43.7858C160.394 43.9645 160.171 44.0539 159.89 44.0539C159.648 44.0539 159.445 43.9806 159.28 43.834C159.064 43.6402 158.956 43.3409 158.956 42.9361C158.956 42.6288 159.037 42.3767 159.2 42.18C159.375 41.9663 159.618 41.8595 159.927 41.8595ZM161.116 41.9162H161.371V44H161.116V41.9162ZM161.75 42.4879H162.009V44H161.75V42.4879ZM161.75 41.9162H162.009V42.2056H161.75V41.9162ZM162.977 42.4368C163.148 42.4368 163.287 42.4784 163.394 42.5616C163.501 42.6448 163.566 42.7881 163.588 42.9914H163.34C163.325 42.8978 163.29 42.8203 163.236 42.7588C163.182 42.6964 163.096 42.6652 162.977 42.6652C162.814 42.6652 162.698 42.7446 162.628 42.9035C162.582 43.0066 162.56 43.1338 162.56 43.2851C162.56 43.4373 162.592 43.5655 162.656 43.6695C162.72 43.7735 162.822 43.8255 162.96 43.8255C163.066 43.8255 163.149 43.7934 163.211 43.7291C163.273 43.6638 163.316 43.5749 163.34 43.4624H163.588C163.56 43.6638 163.489 43.8113 163.375 43.905C163.262 43.9976 163.117 44.044 162.94 44.044C162.741 44.044 162.583 43.9716 162.465 43.8269C162.346 43.6813 162.287 43.4997 162.287 43.2822C162.287 43.0155 162.352 42.808 162.482 42.6595C162.611 42.511 162.776 42.4368 162.977 42.4368ZM163.832 41.9162H164.077V43.1262L164.733 42.4808H165.059L164.477 43.0496L165.091 44H164.765L164.291 43.234L164.077 43.4298V44H163.832V41.9162ZM165.436 43.5234C165.444 43.6085 165.465 43.6737 165.5 43.7191C165.564 43.8014 165.676 43.8425 165.835 43.8425C165.929 43.8425 166.012 43.8222 166.084 43.7815C166.156 43.7399 166.192 43.6761 166.192 43.59C166.192 43.5248 166.163 43.4751 166.106 43.4411C166.069 43.4203 165.996 43.3962 165.887 43.3688L165.684 43.3177C165.555 43.2855 165.459 43.2496 165.398 43.2099C165.288 43.1409 165.233 43.0453 165.233 42.9233C165.233 42.7796 165.285 42.6633 165.388 42.5744C165.492 42.4855 165.631 42.441 165.806 42.441C166.035 42.441 166.2 42.5082 166.301 42.6425C166.365 42.7276 166.395 42.8193 166.394 42.9177H166.152C166.148 42.86 166.127 42.8075 166.091 42.7602C166.033 42.6931 165.931 42.6595 165.786 42.6595C165.69 42.6595 165.617 42.6779 165.567 42.7148C165.517 42.7517 165.493 42.8004 165.493 42.8609C165.493 42.9271 165.525 42.9801 165.591 43.0198C165.628 43.0434 165.684 43.0643 165.758 43.0822L165.927 43.1234C166.11 43.1678 166.233 43.2108 166.296 43.2524C166.395 43.3177 166.445 43.4203 166.445 43.5603C166.445 43.6955 166.393 43.8123 166.29 43.9106C166.188 44.009 166.032 44.0582 165.822 44.0582C165.596 44.0582 165.436 44.0071 165.341 43.905C165.247 43.8019 165.197 43.6747 165.191 43.5234H165.436Z" fill="#434960"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M168.511 43C168.511 42.3127 169.069 41.7549 169.756 41.7549C170.443 41.7549 171.001 42.3127 171.001 43C171.001 43.6873 170.443 44.2451 169.756 44.2451C169.069 44.2451 168.511 43.6873 168.511 43ZM169.881 43.7476H169.631V43.4977H169.881V43.7476ZM169.756 43.9959C169.207 43.9959 168.76 43.5489 168.76 42.9998C168.76 42.4507 169.207 42.0038 169.756 42.0038C170.305 42.0038 170.752 42.4507 170.752 42.9998C170.752 43.5489 170.305 43.9959 169.756 43.9959ZM169.258 42.7506C169.258 42.4755 169.481 42.2526 169.756 42.2526C170.031 42.2526 170.254 42.4755 170.254 42.7506C170.254 42.9103 170.155 42.9963 170.06 43.08C169.969 43.1594 169.88 43.2368 169.88 43.3731H169.631C169.631 43.1464 169.749 43.0565 169.852 42.9774C169.933 42.9154 170.005 42.8601 170.005 42.7506C170.005 42.6137 169.893 42.5016 169.756 42.5016C169.619 42.5016 169.507 42.6137 169.507 42.7506H169.258Z" fill="#8C8F9A"></path></g><path d="M150.871 48.7232C150.774 48.6079 150.636 48.5502 150.457 48.5502C150.211 48.5502 150.043 48.6419 149.955 48.8254C149.903 48.9313 149.873 49.0996 149.864 49.3303H149.078C149.091 48.9804 149.155 48.6977 149.268 48.4821C149.484 48.0717 149.867 47.8664 150.417 47.8664C150.852 47.8664 151.198 47.9875 151.455 48.2296C151.713 48.4698 151.841 48.7885 151.841 49.1857C151.841 49.4902 151.75 49.7606 151.569 49.9971C151.45 50.154 151.254 50.329 150.982 50.5219L150.658 50.7517C150.456 50.8954 150.317 50.9995 150.241 51.0638C150.167 51.1281 150.105 51.2028 150.054 51.2879H151.85V52H149.033C149.04 51.7049 149.103 51.4354 149.223 51.1914C149.338 50.9172 149.61 50.6269 150.04 50.3205C150.412 50.0538 150.653 49.8628 150.763 49.7474C150.931 49.5677 151.016 49.371 151.016 49.1573C151.016 48.9833 150.967 48.8386 150.871 48.7232ZM153.197 48.7062C153.107 48.8272 153.063 48.989 153.067 49.1913H152.312C152.32 48.9871 152.355 48.7932 152.417 48.6097C152.483 48.449 152.587 48.3005 152.729 48.1643C152.835 48.0679 152.961 47.9941 153.107 47.943C153.252 47.892 153.431 47.8664 153.643 47.8664C154.036 47.8664 154.353 47.9686 154.593 48.1728C154.835 48.3752 154.956 48.6476 154.956 48.9899C154.956 49.232 154.884 49.4363 154.741 49.6027C154.65 49.7067 154.555 49.7777 154.457 49.8155C154.531 49.8155 154.637 49.8788 154.775 50.0056C154.981 50.1966 155.084 50.4576 155.084 50.7886C155.084 51.1366 154.963 51.443 154.721 51.7078C154.481 51.9707 154.124 52.1021 153.651 52.1021C153.069 52.1021 152.664 51.9121 152.437 51.5319C152.318 51.3295 152.252 51.0647 152.238 50.7375H153.033C153.033 50.9021 153.059 51.0382 153.112 51.1461C153.211 51.3446 153.389 51.4439 153.648 51.4439C153.807 51.4439 153.945 51.39 154.063 51.2822C154.182 51.1725 154.241 51.0155 154.241 50.8113C154.241 50.5408 154.132 50.3602 153.912 50.2694C153.787 50.2183 153.591 50.1928 153.322 50.1928V49.6141C153.585 49.6103 153.768 49.5847 153.873 49.5375C154.052 49.458 154.142 49.2972 154.142 49.0552C154.142 48.8982 154.096 48.7705 154.003 48.6722C153.912 48.5738 153.784 48.5246 153.617 48.5246C153.426 48.5246 153.286 48.5852 153.197 48.7062ZM157.878 49.2084C157.663 49.5148 157.482 49.8306 157.337 50.1559C157.221 50.4113 157.117 50.7233 157.024 51.0921C156.932 51.461 156.885 51.7636 156.885 52H156.046C156.07 51.2624 156.312 50.4954 156.772 49.6992C157.069 49.2055 157.318 48.8613 157.518 48.6665H155.467L155.478 47.9402H158.383V48.5729C158.262 48.692 158.094 48.9038 157.878 49.2084ZM162.701 52H161.578L160.287 50.1729L159.87 50.6013V52H159.01V47.8182H159.87V49.5403L161.484 47.8182H162.613L160.9 49.5403L162.701 52Z" fill="#2C324C"></path><path d="M166.056 50.415L167.094 49.3775L168.131 50.415H166.056Z" fill="#00AA63"></path><path d="M170.289 50.8525C170.154 50.7141 170.086 50.5461 170.086 50.3483C170.086 50.2164 170.116 50.097 170.176 49.99C170.236 49.883 170.324 49.8025 170.44 49.7485C170.326 49.6728 170.252 49.5912 170.218 49.5037C170.184 49.415 170.168 49.3324 170.168 49.2556C170.168 49.0849 170.232 48.9395 170.36 48.8195C170.489 48.6985 170.671 48.638 170.905 48.638C171.14 48.638 171.321 48.6985 171.45 48.8195C171.578 48.9395 171.643 49.0849 171.643 49.2556C171.643 49.3324 171.625 49.415 171.591 49.5037C171.557 49.5912 171.484 49.6674 171.37 49.7322C171.486 49.7971 171.573 49.883 171.631 49.99C171.69 50.097 171.719 50.2164 171.719 50.3483C171.719 50.5461 171.645 50.7147 171.498 50.8541C171.353 50.9924 171.148 51.0616 170.886 51.0616C170.623 51.0616 170.424 50.9919 170.289 50.8525ZM170.566 50.3175C170.566 50.4331 170.596 50.5228 170.655 50.5866C170.716 50.6504 170.799 50.6823 170.905 50.6823C171.011 50.6823 171.094 50.6504 171.153 50.5866C171.214 50.5228 171.244 50.4331 171.244 50.3175C171.244 50.1975 171.213 50.1067 171.152 50.0451C171.091 49.9824 171.009 49.9511 170.905 49.9511C170.801 49.9511 170.719 49.9824 170.657 50.0451C170.597 50.1067 170.566 50.1975 170.566 50.3175ZM170.688 49.5166C170.74 49.5707 170.812 49.5977 170.905 49.5977C170.999 49.5977 171.072 49.5707 171.122 49.5166C171.174 49.4626 171.2 49.3929 171.2 49.3075C171.2 49.2146 171.174 49.1421 171.122 49.0903C171.072 49.0373 170.999 49.0108 170.905 49.0108C170.812 49.0108 170.739 49.0373 170.686 49.0903C170.634 49.1421 170.608 49.2146 170.608 49.3075C170.608 49.3929 170.635 49.4626 170.688 49.5166ZM172.055 50.5169H172.546V51H172.055V50.5169ZM174.507 50.1327V50.4942H174.241V51H173.789V50.4942H172.859V50.0905L173.723 48.6639H174.241V50.1327H174.507ZM173.201 50.1327H173.789V49.1178L173.201 50.1327ZM176.271 50.4439C176.271 50.2764 176.33 50.1338 176.448 50.016C176.566 49.8992 176.708 49.8409 176.874 49.8409C177.041 49.8409 177.183 49.8998 177.301 50.0176C177.418 50.1354 177.477 50.2775 177.477 50.4439C177.477 50.6104 177.418 50.7525 177.301 50.8703C177.183 50.9881 177.041 51.047 176.874 51.047C176.708 51.047 176.566 50.9881 176.448 50.8703C176.33 50.7525 176.271 50.6104 176.271 50.4439ZM174.872 49.6901C174.754 49.5723 174.695 49.4302 174.695 49.2637C174.695 49.0973 174.754 48.9552 174.872 48.8374C174.99 48.7196 175.132 48.6607 175.298 48.6607C175.465 48.6607 175.607 48.7196 175.725 48.8374C175.843 48.9552 175.902 49.0973 175.902 49.2637C175.902 49.4302 175.843 49.5723 175.725 49.6901C175.608 49.8079 175.466 49.8668 175.298 49.8668C175.132 49.8668 174.99 49.8079 174.872 49.6901ZM175.553 51.0616H175.302L176.616 48.6493H176.863L175.553 51.0616ZM176.693 50.6255C176.742 50.6763 176.803 50.7017 176.874 50.7017C176.946 50.7017 177.006 50.6768 177.056 50.6271C177.107 50.5763 177.132 50.5153 177.132 50.4439C177.132 50.3726 177.107 50.3121 177.056 50.2624C177.006 50.2116 176.946 50.1862 176.874 50.1862C176.803 50.1862 176.742 50.2116 176.691 50.2624C176.641 50.3121 176.616 50.3726 176.616 50.4439C176.616 50.5153 176.642 50.5758 176.693 50.6255ZM175.117 49.4453C175.167 49.4961 175.227 49.5215 175.298 49.5215C175.37 49.5215 175.43 49.4966 175.48 49.4469C175.531 49.3961 175.556 49.3351 175.556 49.2637C175.556 49.1924 175.531 49.1319 175.48 49.0822C175.43 49.0314 175.37 49.006 175.298 49.006C175.227 49.006 175.166 49.0314 175.115 49.0822C175.066 49.1319 175.041 49.1924 175.041 49.2637C175.041 49.3351 175.066 49.3956 175.117 49.4453Z" fill="#00AA63"></path><path d="M183.999 41V53" stroke="#DCDDE1" stroke-width="0.2"></path><g clip-path="url(#clip4_2413_17199)"><path d="M191.29 43.1461L190.973 42.2254L190.637 43.1461H191.29ZM190.826 41.9162H191.145L191.901 44H191.592L191.38 43.3759H190.556L190.331 44H190.041L190.826 41.9162ZM192.192 42.4808L192.597 43.7177L193.022 42.4808H193.301L192.728 44H192.456L191.895 42.4808H192.192ZM194.05 42.4538C194.169 42.4538 194.273 42.4831 194.362 42.5418C194.41 42.5749 194.459 42.6231 194.509 42.6865V42.495H194.745V43.8766C194.745 44.0695 194.716 44.2218 194.66 44.3334C194.554 44.5395 194.354 44.6426 194.06 44.6426C193.896 44.6426 193.759 44.6057 193.647 44.5319C193.535 44.4591 193.473 44.3447 193.46 44.1887H193.719C193.732 44.2568 193.756 44.3092 193.793 44.3461C193.851 44.4029 193.942 44.4312 194.065 44.4312C194.261 44.4312 194.389 44.3622 194.45 44.2241C194.486 44.1428 194.502 43.9976 194.499 43.7886C194.448 43.8662 194.387 43.9239 194.315 43.9617C194.243 43.9995 194.148 44.0184 194.03 44.0184C193.865 44.0184 193.721 43.9603 193.597 43.844C193.474 43.7267 193.413 43.5333 193.413 43.2638C193.413 43.0094 193.475 42.8108 193.599 42.668C193.724 42.5252 193.874 42.4538 194.05 42.4538ZM194.509 43.234C194.509 43.0458 194.471 42.9063 194.393 42.8155C194.316 42.7248 194.217 42.6794 194.097 42.6794C193.917 42.6794 193.794 42.7635 193.728 42.9319C193.693 43.0217 193.675 43.1394 193.675 43.2851C193.675 43.4562 193.71 43.5867 193.779 43.6766C193.849 43.7655 193.942 43.8099 194.06 43.8099C194.243 43.8099 194.372 43.7272 194.447 43.5617C194.489 43.4681 194.509 43.3588 194.509 43.234ZM195.186 43.6908H195.482V44H195.186V43.6908ZM197.642 41.8595C197.906 41.8595 198.111 41.929 198.257 42.068C198.402 42.207 198.483 42.3649 198.499 42.5418H198.224C198.193 42.4075 198.13 42.3011 198.037 42.2226C197.944 42.1441 197.814 42.1049 197.645 42.1049C197.44 42.1049 197.274 42.1772 197.147 42.3219C197.022 42.4656 196.959 42.6865 196.959 42.9843C196.959 43.2283 197.016 43.4264 197.129 43.5787C197.243 43.73 197.414 43.8057 197.64 43.8057C197.848 43.8057 198.006 43.7258 198.115 43.5659C198.173 43.4818 198.216 43.3711 198.244 43.234H198.519C198.495 43.4534 198.413 43.6373 198.275 43.7858C198.11 43.9645 197.886 44.0539 197.606 44.0539C197.364 44.0539 197.16 43.9806 196.996 43.834C196.779 43.6402 196.671 43.3409 196.671 42.9361C196.671 42.6288 196.752 42.3767 196.915 42.18C197.091 41.9663 197.333 41.8595 197.642 41.8595ZM200.374 41.9162V42.1644H199.672V44H199.386V42.1644H198.684V41.9162H200.374ZM201.597 42.8709C201.729 42.8709 201.834 42.8444 201.911 42.7914C201.988 42.7385 202.027 42.643 202.027 42.5049C202.027 42.3564 201.973 42.2552 201.865 42.2013C201.807 42.1729 201.73 42.1588 201.634 42.1588H200.945V42.8709H201.597ZM200.662 41.9162H201.627C201.786 41.9162 201.917 41.9394 202.02 41.9857C202.216 42.0746 202.313 42.2387 202.313 42.4779C202.313 42.6028 202.287 42.7049 202.235 42.7843C202.184 42.8638 202.112 42.9276 202.02 42.9758C202.101 43.0089 202.162 43.0524 202.203 43.1063C202.244 43.1602 202.268 43.2477 202.272 43.3688L202.282 43.6482C202.285 43.7276 202.292 43.7867 202.302 43.8255C202.319 43.8917 202.349 43.9343 202.393 43.9532V44H202.047C202.037 43.982 202.03 43.9589 202.024 43.9305C202.018 43.9021 202.014 43.8473 202.01 43.7659L201.993 43.4184C201.986 43.2822 201.936 43.191 201.841 43.1446C201.787 43.1191 201.702 43.1063 201.587 43.1063H200.945V44H200.662V41.9162Z" fill="#434960"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M204.659 43C204.659 42.3127 205.217 41.7549 205.904 41.7549C206.591 41.7549 207.149 42.3127 207.149 43C207.149 43.6873 206.591 44.2451 205.904 44.2451C205.217 44.2451 204.659 43.6873 204.659 43ZM206.029 43.7476H205.779V43.4977H206.029V43.7476ZM205.904 43.9959C205.355 43.9959 204.908 43.5489 204.908 42.9998C204.908 42.4507 205.355 42.0038 205.904 42.0038C206.453 42.0038 206.9 42.4507 206.9 42.9998C206.9 43.5489 206.453 43.9959 205.904 43.9959ZM205.406 42.7506C205.406 42.4755 205.629 42.2526 205.904 42.2526C206.179 42.2526 206.402 42.4755 206.402 42.7506C206.402 42.9103 206.303 42.9963 206.208 43.08C206.117 43.1594 206.028 43.2368 206.028 43.3731H205.779C205.779 43.1464 205.896 43.0565 206 42.9774C206.08 42.9154 206.153 42.8601 206.153 42.7506C206.153 42.6137 206.041 42.5016 205.904 42.5016C205.767 42.5016 205.655 42.6137 205.655 42.7506H205.406Z" fill="#8C8F9A"></path></g><path d="M191.111 48.7062C191.02 48.8272 190.977 48.989 190.98 49.1913H190.226C190.233 48.9871 190.268 48.7932 190.331 48.6097C190.397 48.449 190.501 48.3005 190.643 48.1643C190.749 48.0679 190.874 47.9941 191.02 47.943C191.166 47.892 191.344 47.8664 191.556 47.8664C191.95 47.8664 192.267 47.9686 192.507 48.1728C192.749 48.3752 192.87 48.6476 192.87 48.9899C192.87 49.232 192.798 49.4363 192.654 49.6027C192.563 49.7067 192.469 49.7777 192.371 49.8155C192.444 49.8155 192.55 49.8788 192.688 50.0056C192.894 50.1966 192.998 50.4576 192.998 50.7886C192.998 51.1366 192.876 51.443 192.634 51.7078C192.394 51.9707 192.038 52.1021 191.565 52.1021C190.982 52.1021 190.578 51.9121 190.351 51.5319C190.231 51.3295 190.165 51.0647 190.152 50.7375H190.946C190.946 50.9021 190.973 51.0382 191.026 51.1461C191.124 51.3446 191.303 51.4439 191.562 51.4439C191.721 51.4439 191.859 51.39 191.976 51.2822C192.095 51.1725 192.155 51.0155 192.155 50.8113C192.155 50.5408 192.045 50.3602 191.826 50.2694C191.701 50.2183 191.504 50.1928 191.236 50.1928V49.6141C191.499 49.6103 191.682 49.5847 191.786 49.5375C191.966 49.458 192.056 49.2972 192.056 49.0552C192.056 48.8982 192.009 48.7705 191.917 48.6722C191.826 48.5738 191.697 48.5246 191.531 48.5246C191.34 48.5246 191.2 48.5852 191.111 48.7062ZM193.596 51.1546H194.456V52H193.596V51.1546ZM195.358 51.7418C195.122 51.4997 195.003 51.2056 195.003 50.8595C195.003 50.6288 195.055 50.4198 195.159 50.2325C195.265 50.0453 195.419 49.9044 195.622 49.8098C195.423 49.6774 195.294 49.5346 195.233 49.3814C195.174 49.2263 195.145 49.0816 195.145 48.9473C195.145 48.6485 195.258 48.3941 195.483 48.1842C195.708 47.9724 196.026 47.8664 196.436 47.8664C196.846 47.8664 197.164 47.9724 197.389 48.1842C197.614 48.3941 197.727 48.6485 197.727 48.9473C197.727 49.0816 197.697 49.2263 197.636 49.3814C197.577 49.5346 197.449 49.668 197.25 49.7814C197.453 49.8949 197.605 50.0453 197.707 50.2325C197.809 50.4198 197.86 50.6288 197.86 50.8595C197.86 51.2056 197.732 51.5007 197.474 51.7447C197.219 51.9868 196.862 52.1078 196.402 52.1078C195.942 52.1078 195.594 51.9858 195.358 51.7418ZM195.843 50.8056C195.843 51.008 195.895 51.165 195.999 51.2766C196.105 51.3881 196.251 51.4439 196.436 51.4439C196.621 51.4439 196.766 51.3881 196.87 51.2766C196.976 51.165 197.029 51.008 197.029 50.8056C197.029 50.5957 196.975 50.4368 196.867 50.329C196.761 50.2193 196.618 50.1644 196.436 50.1644C196.254 50.1644 196.11 50.2193 196.002 50.329C195.896 50.4368 195.843 50.5957 195.843 50.8056ZM196.056 49.4041C196.147 49.4987 196.273 49.546 196.436 49.546C196.601 49.546 196.727 49.4987 196.816 49.4041C196.907 49.3095 196.952 49.1876 196.952 49.0381C196.952 48.8755 196.907 48.7488 196.816 48.658C196.727 48.5653 196.601 48.519 196.436 48.519C196.273 48.519 196.146 48.5653 196.053 48.658C195.962 48.7488 195.917 48.8755 195.917 49.0381C195.917 49.1876 195.963 49.3095 196.056 49.4041ZM200.975 51.0269C200.975 50.7337 201.078 50.4841 201.285 50.2779C201.491 50.0737 201.739 49.9715 202.031 49.9715C202.322 49.9715 202.571 50.0746 202.777 50.2808C202.983 50.4869 203.086 50.7356 203.086 51.0269C203.086 51.3182 202.983 51.5669 202.777 51.773C202.571 51.9792 202.322 52.0823 202.031 52.0823C201.739 52.0823 201.491 51.9792 201.285 51.773C201.078 51.5669 200.975 51.3182 200.975 51.0269ZM198.527 49.7077C198.321 49.5015 198.218 49.2528 198.218 48.9615C198.218 48.6703 198.321 48.4216 198.527 48.2154C198.733 48.0092 198.982 47.9062 199.273 47.9062C199.564 47.9062 199.813 48.0092 200.019 48.2154C200.225 48.4216 200.328 48.6703 200.328 48.9615C200.328 49.2528 200.225 49.5015 200.019 49.7077C199.815 49.9138 199.566 50.0169 199.273 50.0169C198.982 50.0169 198.733 49.9138 198.527 49.7077ZM199.718 52.1078H199.279L201.58 47.8863H202.011L199.718 52.1078ZM201.713 51.3446C201.8 51.4335 201.906 51.478 202.031 51.478C202.155 51.478 202.261 51.4345 202.348 51.3475C202.437 51.2586 202.482 51.1517 202.482 51.0269C202.482 50.9021 202.437 50.7962 202.348 50.7091C202.261 50.6203 202.155 50.5758 202.031 50.5758C201.906 50.5758 201.799 50.6203 201.71 50.7091C201.623 50.7962 201.58 50.9021 201.58 51.0269C201.58 51.1517 201.624 51.2576 201.713 51.3446ZM198.955 49.2793C199.042 49.3682 199.148 49.4126 199.273 49.4126C199.398 49.4126 199.504 49.3691 199.591 49.2821C199.68 49.1932 199.724 49.0864 199.724 48.9615C199.724 48.8367 199.68 48.7308 199.591 48.6438C199.504 48.5549 199.398 48.5104 199.273 48.5104C199.148 48.5104 199.041 48.5549 198.952 48.6438C198.865 48.7308 198.822 48.8367 198.822 48.9615C198.822 49.0864 198.866 49.1923 198.955 49.2793Z" fill="#2C324C"></path><path d="M207.204 50.415L208.241 49.3775L209.279 50.415H207.204Z" fill="#00AA63"></path><path d="M212.403 51H211.93V49.3788H211.377V49.0643C211.523 49.0578 211.625 49.0481 211.683 49.0351C211.776 49.0146 211.852 48.9735 211.91 48.9119C211.95 48.8698 211.981 48.8136 212.001 48.7433C212.013 48.7012 212.019 48.6698 212.019 48.6493H212.403V51ZM213.202 50.5169H213.694V51H213.202V50.5169ZM214.833 51.0584C214.534 51.0584 214.324 50.9535 214.203 50.7439C214.083 50.5342 214.023 50.2354 214.023 49.8474C214.023 49.4594 214.083 49.16 214.203 48.9492C214.324 48.7385 214.534 48.6331 214.833 48.6331C215.133 48.6331 215.343 48.7385 215.464 48.9492C215.584 49.16 215.644 49.4594 215.644 49.8474C215.644 50.2354 215.583 50.5342 215.462 50.7439C215.342 50.9535 215.133 51.0584 214.833 51.0584ZM215.104 50.4666C215.146 50.324 215.167 50.1175 215.167 49.8474C215.167 49.5642 215.146 49.3545 215.102 49.2183C215.06 49.0822 214.971 49.0141 214.833 49.0141C214.696 49.0141 214.605 49.0822 214.561 49.2183C214.517 49.3545 214.494 49.5642 214.494 49.8474C214.494 50.1175 214.517 50.3245 214.561 50.4683C214.605 50.6109 214.696 50.6823 214.833 50.6823C214.971 50.6823 215.061 50.6104 215.104 50.4666ZM216.921 49.1276C216.866 49.0616 216.787 49.0287 216.685 49.0287C216.544 49.0287 216.448 49.0811 216.398 49.1859C216.368 49.2464 216.351 49.3426 216.346 49.4745H215.897C215.904 49.2745 215.941 49.113 216.005 48.9898C216.129 48.7552 216.347 48.638 216.662 48.638C216.911 48.638 217.108 48.7071 217.255 48.8455C217.402 48.9827 217.476 49.1648 217.476 49.3918C217.476 49.5658 217.424 49.7204 217.32 49.8555C217.252 49.9452 217.14 50.0451 216.985 50.1554L216.8 50.2867C216.684 50.3688 216.605 50.4283 216.561 50.465C216.519 50.5018 216.484 50.5445 216.454 50.5931H217.481V51H215.871C215.875 50.8314 215.911 50.6774 215.979 50.538C216.045 50.3813 216.201 50.2154 216.446 50.0403C216.659 49.8879 216.797 49.7787 216.86 49.7128C216.956 49.6101 217.004 49.4977 217.004 49.3756C217.004 49.2762 216.976 49.1935 216.921 49.1276ZM219.267 50.4439C219.267 50.2764 219.326 50.1338 219.444 50.016C219.562 49.8992 219.704 49.8409 219.87 49.8409C220.037 49.8409 220.179 49.8998 220.297 50.0176C220.414 50.1354 220.473 50.2775 220.473 50.4439C220.473 50.6104 220.414 50.7525 220.297 50.8703C220.179 50.9881 220.037 51.047 219.87 51.047C219.704 51.047 219.562 50.9881 219.444 50.8703C219.326 50.7525 219.267 50.6104 219.267 50.4439ZM217.868 49.6901C217.75 49.5723 217.691 49.4302 217.691 49.2637C217.691 49.0973 217.75 48.9552 217.868 48.8374C217.986 48.7196 218.128 48.6607 218.294 48.6607C218.461 48.6607 218.603 48.7196 218.721 48.8374C218.839 48.9552 218.898 49.0973 218.898 49.2637C218.898 49.4302 218.839 49.5723 218.721 49.6901C218.604 49.8079 218.462 49.8668 218.294 49.8668C218.128 49.8668 217.986 49.8079 217.868 49.6901ZM218.549 51.0616H218.298L219.612 48.6493H219.859L218.549 51.0616ZM219.689 50.6255C219.738 50.6763 219.799 50.7017 219.87 50.7017C219.942 50.7017 220.002 50.6768 220.052 50.6271C220.103 50.5763 220.128 50.5153 220.128 50.4439C220.128 50.3726 220.103 50.3121 220.052 50.2624C220.002 50.2116 219.942 50.1862 219.87 50.1862C219.799 50.1862 219.738 50.2116 219.687 50.2624C219.637 50.3121 219.612 50.3726 219.612 50.4439C219.612 50.5153 219.638 50.5758 219.689 50.6255ZM218.113 49.4453C218.163 49.4961 218.223 49.5215 218.294 49.5215C218.366 49.5215 218.426 49.4966 218.476 49.4469C218.527 49.3961 218.552 49.3351 218.552 49.2637C218.552 49.1924 218.527 49.1319 218.476 49.0822C218.426 49.0314 218.366 49.006 218.294 49.006C218.223 49.006 218.162 49.0314 218.111 49.0822C218.062 49.1319 218.037 49.1924 218.037 49.2637C218.037 49.3351 218.062 49.3956 218.113 49.4453Z" fill="#00AA63"></path><path d="M227.147 41V53" stroke="#DCDDE1" stroke-width="0.2"></path><g clip-path="url(#clip5_2413_17199)"><path d="M234.438 43.1461L234.121 42.2254L233.785 43.1461H234.438ZM233.974 41.9162H234.293L235.049 44H234.74L234.528 43.3759H233.704L233.479 44H233.189L233.974 41.9162ZM235.34 42.4808L235.745 43.7177L236.169 42.4808H236.449L235.876 44H235.603L235.043 42.4808H235.34ZM237.198 42.4538C237.317 42.4538 237.421 42.4831 237.51 42.5418C237.558 42.5749 237.607 42.6231 237.657 42.6865V42.495H237.893V43.8766C237.893 44.0695 237.864 44.2218 237.808 44.3334C237.702 44.5395 237.502 44.6426 237.208 44.6426C237.044 44.6426 236.906 44.6057 236.795 44.5319C236.683 44.4591 236.621 44.3447 236.608 44.1887H236.867C236.88 44.2568 236.904 44.3092 236.941 44.3461C236.999 44.4029 237.089 44.4312 237.213 44.4312C237.409 44.4312 237.537 44.3622 237.598 44.2241C237.634 44.1428 237.65 43.9976 237.647 43.7886C237.596 43.8662 237.535 43.9239 237.463 43.9617C237.391 43.9995 237.296 44.0184 237.178 44.0184C237.013 44.0184 236.869 43.9603 236.745 43.844C236.622 43.7267 236.561 43.5333 236.561 43.2638C236.561 43.0094 236.623 42.8108 236.747 42.668C236.871 42.5252 237.022 42.4538 237.198 42.4538ZM237.657 43.234C237.657 43.0458 237.619 42.9063 237.541 42.8155C237.463 42.7248 237.365 42.6794 237.245 42.6794C237.065 42.6794 236.942 42.7635 236.876 42.9319C236.841 43.0217 236.823 43.1394 236.823 43.2851C236.823 43.4562 236.858 43.5867 236.927 43.6766C236.997 43.7655 237.09 43.8099 237.208 43.8099C237.391 43.8099 237.52 43.7272 237.595 43.5617C237.637 43.4681 237.657 43.3588 237.657 43.234ZM238.334 43.6908H238.63V44H238.334V43.6908ZM239.939 41.9162H240.877C241.062 41.9162 241.212 41.9687 241.325 42.0737C241.439 42.1777 241.495 42.3243 241.495 42.5134C241.495 42.676 241.445 42.8179 241.344 42.9389C241.242 43.059 241.087 43.1191 240.877 43.1191H240.222V44H239.939V41.9162ZM241.21 42.5148C241.21 42.3616 241.154 42.2576 241.04 42.2027C240.978 42.1734 240.892 42.1588 240.783 42.1588H240.222V42.8808H240.783C240.91 42.8808 241.013 42.8538 241.091 42.7999C241.171 42.746 241.21 42.651 241.21 42.5148ZM242.413 43.8355C242.582 43.8355 242.698 43.7716 242.761 43.644C242.824 43.5153 242.856 43.3725 242.856 43.2156C242.856 43.0737 242.833 42.9583 242.788 42.8694C242.716 42.7295 242.592 42.6595 242.416 42.6595C242.26 42.6595 242.146 42.7191 242.075 42.8382C242.005 42.9574 241.969 43.1011 241.969 43.2695C241.969 43.4312 242.005 43.5659 242.075 43.6737C242.146 43.7815 242.259 43.8355 242.413 43.8355ZM242.423 42.4368C242.619 42.4368 242.784 42.502 242.92 42.6325C243.055 42.7631 243.122 42.955 243.122 43.2085C243.122 43.4534 243.063 43.6558 242.944 43.8156C242.824 43.9754 242.64 44.0553 242.389 44.0553C242.18 44.0553 242.014 43.9849 241.891 43.844C241.768 43.7021 241.707 43.512 241.707 43.2737C241.707 43.0184 241.771 42.8151 241.901 42.6638C242.031 42.5124 242.205 42.4368 242.423 42.4368ZM243.573 43.5234C243.581 43.6085 243.602 43.6737 243.637 43.7191C243.701 43.8014 243.813 43.8425 243.972 43.8425C244.066 43.8425 244.15 43.8222 244.222 43.7815C244.293 43.7399 244.329 43.6761 244.329 43.59C244.329 43.5248 244.301 43.4751 244.243 43.4411C244.206 43.4203 244.133 43.3962 244.024 43.3688L243.822 43.3177C243.692 43.2855 243.596 43.2496 243.535 43.2099C243.425 43.1409 243.37 43.0453 243.37 42.9233C243.37 42.7796 243.422 42.6633 243.525 42.5744C243.629 42.4855 243.769 42.441 243.944 42.441C244.172 42.441 244.337 42.5082 244.439 42.6425C244.502 42.7276 244.533 42.8193 244.531 42.9177H244.29C244.285 42.86 244.265 42.8075 244.229 42.7602C244.17 42.6931 244.068 42.6595 243.924 42.6595C243.827 42.6595 243.754 42.6779 243.704 42.7148C243.655 42.7517 243.63 42.8004 243.63 42.8609C243.63 42.9271 243.663 42.9801 243.728 43.0198C243.766 43.0434 243.822 43.0643 243.895 43.0822L244.064 43.1234C244.248 43.1678 244.371 43.2108 244.433 43.2524C244.532 43.3177 244.582 43.4203 244.582 43.5603C244.582 43.6955 244.53 43.8123 244.427 43.9106C244.325 44.009 244.169 44.0582 243.959 44.0582C243.733 44.0582 243.573 44.0071 243.478 43.905C243.385 43.8019 243.335 43.6747 243.328 43.5234H243.573ZM244.868 42.4879H245.128V44H244.868V42.4879ZM244.868 41.9162H245.128V42.2056H244.868V41.9162ZM245.56 42.0566H245.819V42.4808H246.061V42.6893H245.819V43.6808C245.819 43.7338 245.837 43.7693 245.872 43.7872C245.892 43.7976 245.925 43.8028 245.972 43.8028C245.984 43.8028 245.997 43.8028 246.011 43.8028C246.026 43.8019 246.042 43.8005 246.061 43.7986V44C246.032 44.0085 246.001 44.0147 245.969 44.0184C245.938 44.0222 245.904 44.0241 245.867 44.0241C245.748 44.0241 245.667 43.9939 245.624 43.9333C245.582 43.8719 245.56 43.7924 245.56 43.695V42.6893H245.355V42.4808H245.56V42.0566ZM246.312 42.4879H246.572V44H246.312V42.4879ZM246.312 41.9162H246.572V42.2056H246.312V41.9162ZM247.556 43.8355C247.725 43.8355 247.841 43.7716 247.903 43.644C247.967 43.5153 247.999 43.3725 247.999 43.2156C247.999 43.0737 247.976 42.9583 247.93 42.8694C247.859 42.7295 247.735 42.6595 247.559 42.6595C247.403 42.6595 247.289 42.7191 247.218 42.8382C247.147 42.9574 247.112 43.1011 247.112 43.2695C247.112 43.4312 247.147 43.5659 247.218 43.6737C247.289 43.7815 247.402 43.8355 247.556 43.8355ZM247.566 42.4368C247.762 42.4368 247.927 42.502 248.062 42.6325C248.198 42.7631 248.265 42.955 248.265 43.2085C248.265 43.4534 248.206 43.6558 248.086 43.8156C247.967 43.9754 247.782 44.0553 247.532 44.0553C247.323 44.0553 247.157 43.9849 247.034 43.844C246.911 43.7021 246.85 43.512 246.85 43.2737C246.85 43.0184 246.914 42.8151 247.044 42.6638C247.173 42.5124 247.347 42.4368 247.566 42.4368ZM248.564 42.4808H248.807V42.6964C248.879 42.6075 248.955 42.5437 249.035 42.5049C249.116 42.4661 249.205 42.4467 249.303 42.4467C249.519 42.4467 249.665 42.5219 249.74 42.6723C249.782 42.7545 249.803 42.8723 249.803 43.0255V44H249.543V43.0425C249.543 42.9498 249.529 42.8751 249.502 42.8184C249.457 42.7238 249.374 42.6765 249.255 42.6765C249.195 42.6765 249.145 42.6827 249.106 42.695C249.036 42.7158 248.975 42.7574 248.922 42.8198C248.879 42.8699 248.851 42.9219 248.838 42.9758C248.826 43.0288 248.82 43.1049 248.82 43.2042V44H248.564V42.4808Z" fill="#434960"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M251.807 43C251.807 42.3127 252.365 41.7549 253.052 41.7549C253.739 41.7549 254.297 42.3127 254.297 43C254.297 43.6873 253.739 44.2451 253.052 44.2451C252.365 44.2451 251.807 43.6873 251.807 43ZM253.177 43.7476H252.927V43.4977H253.177V43.7476ZM253.052 43.9959C252.502 43.9959 252.056 43.5489 252.056 42.9998C252.056 42.4507 252.502 42.0038 253.052 42.0038C253.601 42.0038 254.048 42.4507 254.048 42.9998C254.048 43.5489 253.601 43.9959 253.052 43.9959ZM252.554 42.7506C252.554 42.4755 252.776 42.2526 253.052 42.2526C253.327 42.2526 253.55 42.4755 253.55 42.7506C253.55 42.9103 253.451 42.9963 253.356 43.08C253.265 43.1594 253.176 43.2368 253.176 43.3731H252.927C252.927 43.1464 253.044 43.0565 253.148 42.9774C253.228 42.9154 253.301 42.8601 253.301 42.7506C253.301 42.6137 253.189 42.5016 253.052 42.5016C252.915 42.5016 252.803 42.6137 252.803 42.7506H252.554Z" fill="#8C8F9A"></path></g><path d="M236.185 50.4822V51.1148H235.72V52H234.928V51.1148H233.3V50.4084L234.812 47.9118H235.72V50.4822H236.185ZM233.899 50.4822H234.928V48.7062L233.899 50.4822ZM237.89 52.1192C237.582 52.1192 237.305 52.0284 237.059 51.8468C236.813 51.6633 236.672 51.3967 236.636 51.0468H237.442C237.461 51.1678 237.512 51.2662 237.595 51.3418C237.678 51.4175 237.789 51.4553 237.927 51.4553C238.194 51.4553 238.381 51.3078 238.489 51.0127C238.548 50.8501 238.584 50.6127 238.6 50.3006C238.526 50.3933 238.447 50.4642 238.364 50.5134C238.213 50.6042 238.026 50.6496 237.805 50.6496C237.478 50.6496 237.188 50.537 236.934 50.312C236.681 50.085 236.554 49.7587 236.554 49.3332C236.554 48.8925 236.681 48.536 236.934 48.2636C237.19 47.9894 237.52 47.8523 237.927 47.8523C238.553 47.8523 238.983 48.1293 239.215 48.6835C239.348 48.9975 239.414 49.4107 239.414 49.9233C239.414 50.4207 239.35 50.8359 239.224 51.1687C238.982 51.8024 238.537 52.1192 237.89 52.1192ZM237.607 48.6438C237.451 48.7648 237.374 48.97 237.374 49.2594C237.374 49.5034 237.423 49.6869 237.521 49.8098C237.622 49.9309 237.775 49.9914 237.981 49.9914C238.093 49.9914 238.198 49.9592 238.296 49.8949C238.479 49.7777 238.571 49.5743 238.571 49.285C238.571 49.0523 238.516 48.8679 238.407 48.7317C238.299 48.5956 238.15 48.5275 237.961 48.5275C237.823 48.5275 237.705 48.5662 237.607 48.6438Z" fill="#2C324C"></path><path d="M243.352 50.415L244.389 49.3775L245.427 50.415H243.352Z" fill="#00AA63"></path><path d="M248.551 51H248.078V49.3788H247.525V49.0643C247.671 49.0578 247.773 49.0481 247.831 49.0351C247.924 49.0146 248 48.9735 248.058 48.9119C248.098 48.8698 248.128 48.8136 248.149 48.7433C248.161 48.7012 248.167 48.6698 248.167 48.6493H248.551V51ZM249.778 49.1178C249.726 49.187 249.702 49.2794 249.704 49.395H249.272C249.277 49.2783 249.297 49.1675 249.332 49.0627C249.37 48.9708 249.43 48.886 249.511 48.8082C249.571 48.7531 249.643 48.7109 249.726 48.6817C249.81 48.6526 249.912 48.638 250.033 48.638C250.258 48.638 250.439 48.6963 250.576 48.8131C250.714 48.9287 250.783 49.0843 250.783 49.2799C250.783 49.4183 250.742 49.535 250.66 49.6301C250.608 49.6896 250.554 49.7301 250.498 49.7517C250.54 49.7517 250.601 49.7879 250.68 49.8603C250.797 49.9695 250.856 50.1186 250.856 50.3078C250.856 50.5066 250.787 50.6817 250.649 50.833C250.512 50.9832 250.308 51.0584 250.038 51.0584C249.705 51.0584 249.474 50.9497 249.344 50.7325C249.276 50.6169 249.238 50.4656 249.23 50.2786H249.684C249.684 50.3726 249.699 50.4504 249.73 50.512C249.786 50.6255 249.888 50.6823 250.036 50.6823C250.127 50.6823 250.206 50.6514 250.273 50.5898C250.341 50.5272 250.375 50.4375 250.375 50.3207C250.375 50.1662 250.312 50.063 250.187 50.0111C250.116 49.9819 250.003 49.9673 249.85 49.9673V49.6366C250 49.6344 250.105 49.6198 250.164 49.5928C250.267 49.5474 250.318 49.4556 250.318 49.3172C250.318 49.2275 250.292 49.1546 250.239 49.0984C250.187 49.0422 250.113 49.0141 250.018 49.0141C249.909 49.0141 249.829 49.0487 249.778 49.1178Z" fill="#00AA63"></path><path d="M113.015 107.141V107.038C113.112 107.028 113.18 107.013 113.219 106.99C113.258 106.968 113.286 106.915 113.305 106.832H113.412V107.903H113.268V107.141H113.015ZM114.704 107.775C114.755 107.775 114.796 107.77 114.829 107.759C114.887 107.74 114.935 107.702 114.972 107.647C115.001 107.602 115.022 107.545 115.035 107.475C115.043 107.434 115.047 107.395 115.047 107.36C115.047 107.223 115.019 107.117 114.965 107.042C114.911 106.966 114.823 106.928 114.703 106.928H114.438V107.775H114.704ZM114.288 106.8H114.734C114.886 106.8 115.004 106.854 115.087 106.961C115.162 107.058 115.199 107.183 115.199 107.334C115.199 107.451 115.177 107.557 115.133 107.652C115.055 107.819 114.922 107.903 114.733 107.903H114.288V106.8ZM115.715 107.081C115.772 107.081 115.827 107.094 115.881 107.121C115.934 107.148 115.975 107.182 116.003 107.225C116.03 107.265 116.048 107.313 116.057 107.367C116.065 107.404 116.069 107.463 116.069 107.544H115.48C115.482 107.625 115.502 107.691 115.538 107.74C115.574 107.79 115.63 107.814 115.705 107.814C115.776 107.814 115.832 107.791 115.874 107.744C115.898 107.717 115.915 107.686 115.925 107.65H116.058C116.055 107.68 116.043 107.713 116.023 107.749C116.003 107.786 115.981 107.815 115.957 107.838C115.916 107.878 115.865 107.905 115.804 107.919C115.772 107.927 115.735 107.931 115.694 107.931C115.594 107.931 115.509 107.895 115.439 107.822C115.37 107.749 115.335 107.647 115.335 107.516C115.335 107.387 115.37 107.282 115.44 107.201C115.51 107.121 115.602 107.081 115.715 107.081ZM115.93 107.436C115.925 107.378 115.912 107.331 115.892 107.296C115.855 107.231 115.793 107.198 115.707 107.198C115.645 107.198 115.593 107.221 115.551 107.266C115.508 107.311 115.486 107.367 115.484 107.436H115.93ZM116.552 107.075C116.643 107.075 116.716 107.097 116.773 107.141C116.83 107.185 116.864 107.261 116.876 107.369H116.744C116.736 107.319 116.718 107.278 116.69 107.246C116.661 107.213 116.615 107.196 116.552 107.196C116.466 107.196 116.405 107.238 116.367 107.322C116.343 107.377 116.331 107.444 116.331 107.524C116.331 107.605 116.348 107.673 116.382 107.728C116.417 107.783 116.47 107.81 116.543 107.81C116.599 107.81 116.643 107.793 116.676 107.759C116.709 107.725 116.732 107.678 116.744 107.618H116.876C116.861 107.725 116.823 107.803 116.763 107.852C116.703 107.901 116.626 107.926 116.533 107.926C116.428 107.926 116.344 107.888 116.281 107.811C116.219 107.734 116.187 107.638 116.187 107.523C116.187 107.382 116.222 107.272 116.29 107.193C116.359 107.115 116.446 107.075 116.552 107.075Z" fill="#141B38"></path><path d="M135.297 107.629C135.306 107.706 135.342 107.759 135.405 107.789C135.437 107.804 135.474 107.811 135.516 107.811C135.596 107.811 135.655 107.786 135.694 107.734C135.732 107.683 135.752 107.627 135.752 107.565C135.752 107.49 135.729 107.432 135.682 107.391C135.637 107.35 135.582 107.329 135.518 107.329C135.472 107.329 135.431 107.338 135.398 107.356C135.365 107.374 135.337 107.399 135.313 107.431L135.196 107.424L135.278 106.846H135.836V106.976H135.379L135.333 107.275C135.358 107.256 135.382 107.242 135.405 107.232C135.445 107.216 135.491 107.207 135.544 107.207C135.642 107.207 135.726 107.239 135.794 107.303C135.863 107.366 135.897 107.447 135.897 107.545C135.897 107.646 135.866 107.736 135.803 107.813C135.74 107.891 135.64 107.93 135.502 107.93C135.415 107.93 135.337 107.905 135.27 107.856C135.203 107.807 135.165 107.731 135.157 107.629H135.297ZM136.944 107.775C136.995 107.775 137.036 107.77 137.069 107.759C137.127 107.74 137.174 107.702 137.211 107.647C137.241 107.602 137.262 107.545 137.275 107.475C137.283 107.434 137.286 107.395 137.286 107.36C137.286 107.223 137.259 107.117 137.205 107.042C137.15 106.966 137.063 106.928 136.943 106.928H136.678V107.775H136.944ZM136.527 106.8H136.974C137.126 106.8 137.243 106.854 137.327 106.961C137.401 107.058 137.439 107.183 137.439 107.334C137.439 107.451 137.417 107.557 137.373 107.652C137.295 107.819 137.162 107.903 136.973 107.903H136.527V106.8ZM137.955 107.081C138.012 107.081 138.067 107.094 138.121 107.121C138.174 107.148 138.215 107.182 138.243 107.225C138.27 107.265 138.288 107.313 138.297 107.367C138.305 107.404 138.309 107.463 138.309 107.544H137.72C137.722 107.625 137.741 107.691 137.778 107.74C137.814 107.79 137.869 107.814 137.945 107.814C138.015 107.814 138.072 107.791 138.114 107.744C138.138 107.717 138.155 107.686 138.165 107.65H138.298C138.294 107.68 138.283 107.713 138.262 107.749C138.243 107.786 138.221 107.815 138.196 107.838C138.155 107.878 138.105 107.905 138.044 107.919C138.011 107.927 137.975 107.931 137.934 107.931C137.834 107.931 137.749 107.895 137.679 107.822C137.61 107.749 137.575 107.647 137.575 107.516C137.575 107.387 137.61 107.282 137.68 107.201C137.75 107.121 137.842 107.081 137.955 107.081ZM138.17 107.436C138.165 107.378 138.152 107.331 138.132 107.296C138.095 107.231 138.033 107.198 137.946 107.198C137.884 107.198 137.832 107.221 137.79 107.266C137.748 107.311 137.726 107.367 137.723 107.436H138.17ZM138.792 107.075C138.882 107.075 138.956 107.097 139.013 107.141C139.07 107.185 139.104 107.261 139.115 107.369H138.984C138.976 107.319 138.958 107.278 138.929 107.246C138.901 107.213 138.855 107.196 138.792 107.196C138.706 107.196 138.644 107.238 138.607 107.322C138.583 107.377 138.571 107.444 138.571 107.524C138.571 107.605 138.588 107.673 138.622 107.728C138.656 107.783 138.71 107.81 138.783 107.81C138.839 107.81 138.883 107.793 138.916 107.759C138.949 107.725 138.972 107.678 138.984 107.618H139.115C139.1 107.725 139.063 107.803 139.003 107.852C138.943 107.901 138.866 107.926 138.772 107.926C138.667 107.926 138.583 107.888 138.521 107.811C138.458 107.734 138.427 107.638 138.427 107.523C138.427 107.382 138.461 107.272 138.53 107.193C138.598 107.115 138.686 107.075 138.792 107.075Z" fill="#141B38"></path><path d="M157.494 107.141V107.038C157.591 107.028 157.659 107.013 157.698 106.99C157.737 106.968 157.765 106.915 157.784 106.832H157.891V107.903H157.747V107.141H157.494ZM158.625 106.828C158.764 106.828 158.864 106.885 158.926 107C158.974 107.088 158.998 107.209 158.998 107.364C158.998 107.51 158.977 107.631 158.933 107.726C158.87 107.863 158.767 107.932 158.624 107.932C158.495 107.932 158.399 107.876 158.336 107.764C158.283 107.67 158.257 107.545 158.257 107.387C158.257 107.265 158.272 107.16 158.304 107.072C158.363 106.909 158.47 106.828 158.625 106.828ZM158.623 107.809C158.693 107.809 158.749 107.778 158.791 107.716C158.832 107.654 158.853 107.538 158.853 107.369C158.853 107.247 158.838 107.146 158.808 107.068C158.778 106.989 158.719 106.949 158.633 106.949C158.553 106.949 158.495 106.987 158.458 107.062C158.421 107.136 158.403 107.246 158.403 107.392C158.403 107.502 158.415 107.59 158.438 107.656C158.474 107.758 158.536 107.809 158.623 107.809ZM160.045 107.775C160.096 107.775 160.137 107.77 160.17 107.759C160.228 107.74 160.276 107.702 160.313 107.647C160.342 107.602 160.363 107.545 160.376 107.475C160.384 107.434 160.388 107.395 160.388 107.36C160.388 107.223 160.36 107.117 160.306 107.042C160.252 106.966 160.164 106.928 160.044 106.928H159.779V107.775H160.045ZM159.629 106.8H160.075C160.227 106.8 160.345 106.854 160.428 106.961C160.503 107.058 160.54 107.183 160.54 107.334C160.54 107.451 160.518 107.557 160.474 107.652C160.396 107.819 160.263 107.903 160.074 107.903H159.629V106.8ZM161.056 107.081C161.113 107.081 161.168 107.094 161.222 107.121C161.275 107.148 161.316 107.182 161.344 107.225C161.371 107.265 161.389 107.313 161.398 107.367C161.406 107.404 161.41 107.463 161.41 107.544H160.821C160.823 107.625 160.843 107.691 160.879 107.74C160.915 107.79 160.971 107.814 161.046 107.814C161.117 107.814 161.173 107.791 161.215 107.744C161.239 107.717 161.256 107.686 161.266 107.65H161.399C161.396 107.68 161.384 107.713 161.364 107.749C161.344 107.786 161.322 107.815 161.298 107.838C161.257 107.878 161.206 107.905 161.145 107.919C161.113 107.927 161.076 107.931 161.035 107.931C160.935 107.931 160.85 107.895 160.78 107.822C160.711 107.749 160.676 107.647 160.676 107.516C160.676 107.387 160.711 107.282 160.781 107.201C160.851 107.121 160.943 107.081 161.056 107.081ZM161.271 107.436C161.266 107.378 161.253 107.331 161.233 107.296C161.196 107.231 161.134 107.198 161.048 107.198C160.986 107.198 160.934 107.221 160.892 107.266C160.849 107.311 160.827 107.367 160.825 107.436H161.271ZM161.893 107.075C161.984 107.075 162.057 107.097 162.114 107.141C162.171 107.185 162.205 107.261 162.217 107.369H162.085C162.077 107.319 162.059 107.278 162.031 107.246C162.002 107.213 161.956 107.196 161.893 107.196C161.807 107.196 161.746 107.238 161.708 107.322C161.684 107.377 161.672 107.444 161.672 107.524C161.672 107.605 161.689 107.673 161.723 107.728C161.758 107.783 161.811 107.81 161.884 107.81C161.94 107.81 161.984 107.793 162.017 107.759C162.05 107.725 162.073 107.678 162.085 107.618H162.217C162.202 107.725 162.164 107.803 162.104 107.852C162.044 107.901 161.967 107.926 161.874 107.926C161.769 107.926 161.685 107.888 161.622 107.811C161.56 107.734 161.528 107.638 161.528 107.523C161.528 107.382 161.563 107.272 161.631 107.193C161.7 107.115 161.787 107.075 161.893 107.075Z" fill="#141B38"></path><path d="M180.659 107.141V107.038C180.757 107.028 180.825 107.013 180.863 106.99C180.902 106.968 180.931 106.915 180.95 106.832H181.056V107.903H180.912V107.141H180.659ZM181.564 107.629C181.573 107.706 181.609 107.759 181.671 107.789C181.703 107.804 181.74 107.811 181.782 107.811C181.863 107.811 181.922 107.786 181.96 107.734C181.999 107.683 182.018 107.627 182.018 107.565C182.018 107.49 181.995 107.432 181.949 107.391C181.904 107.35 181.849 107.329 181.785 107.329C181.738 107.329 181.698 107.338 181.665 107.356C181.632 107.374 181.603 107.399 181.58 107.431L181.463 107.424L181.545 106.846H182.103V106.976H181.646L181.6 107.275C181.625 107.256 181.649 107.242 181.671 107.232C181.711 107.216 181.758 107.207 181.81 107.207C181.909 107.207 181.992 107.239 182.061 107.303C182.13 107.366 182.164 107.447 182.164 107.545C182.164 107.646 182.132 107.736 182.069 107.813C182.007 107.891 181.907 107.93 181.769 107.93C181.681 107.93 181.604 107.905 181.536 107.856C181.469 107.807 181.432 107.731 181.424 107.629H181.564ZM183.211 107.775C183.261 107.775 183.303 107.77 183.335 107.759C183.393 107.74 183.441 107.702 183.478 107.647C183.507 107.602 183.529 107.545 183.542 107.475C183.549 107.434 183.553 107.395 183.553 107.36C183.553 107.223 183.526 107.117 183.471 107.042C183.417 106.966 183.33 106.928 183.209 106.928H182.944V107.775H183.211ZM182.794 106.8H183.241C183.392 106.8 183.51 106.854 183.594 106.961C183.668 107.058 183.705 107.183 183.705 107.334C183.705 107.451 183.683 107.557 183.639 107.652C183.562 107.819 183.428 107.903 183.239 107.903H182.794V106.8ZM184.221 107.081C184.278 107.081 184.334 107.094 184.387 107.121C184.441 107.148 184.482 107.182 184.51 107.225C184.537 107.265 184.555 107.313 184.564 107.367C184.572 107.404 184.576 107.463 184.576 107.544H183.986C183.989 107.625 184.008 107.691 184.044 107.74C184.08 107.79 184.136 107.814 184.212 107.814C184.282 107.814 184.338 107.791 184.38 107.744C184.405 107.717 184.422 107.686 184.432 107.65H184.564C184.561 107.68 184.549 107.713 184.529 107.749C184.51 107.786 184.488 107.815 184.463 107.838C184.422 107.878 184.371 107.905 184.311 107.919C184.278 107.927 184.241 107.931 184.2 107.931C184.1 107.931 184.015 107.895 183.946 107.822C183.876 107.749 183.841 107.647 183.841 107.516C183.841 107.387 183.876 107.282 183.947 107.201C184.017 107.121 184.108 107.081 184.221 107.081ZM184.437 107.436C184.431 107.378 184.419 107.331 184.399 107.296C184.361 107.231 184.3 107.198 184.213 107.198C184.151 107.198 184.099 107.221 184.057 107.266C184.015 107.311 183.993 107.367 183.99 107.436H184.437ZM185.059 107.075C185.149 107.075 185.223 107.097 185.279 107.141C185.336 107.185 185.371 107.261 185.382 107.369H185.251C185.243 107.319 185.224 107.278 185.196 107.246C185.167 107.213 185.122 107.196 185.059 107.196C184.972 107.196 184.911 107.238 184.874 107.322C184.85 107.377 184.838 107.444 184.838 107.524C184.838 107.605 184.855 107.673 184.889 107.728C184.923 107.783 184.976 107.81 185.05 107.81C185.106 107.81 185.15 107.793 185.182 107.759C185.215 107.725 185.238 107.678 185.251 107.618H185.382C185.367 107.725 185.33 107.803 185.27 107.852C185.209 107.901 185.133 107.926 185.039 107.926C184.934 107.926 184.85 107.888 184.788 107.811C184.725 107.734 184.694 107.638 184.694 107.523C184.694 107.382 184.728 107.272 184.797 107.193C184.865 107.115 184.952 107.075 185.059 107.075Z" fill="#141B38"></path><path d="M203.726 107.903C203.731 107.81 203.75 107.729 203.783 107.661C203.816 107.592 203.881 107.53 203.978 107.474L204.122 107.391C204.187 107.353 204.232 107.321 204.258 107.295C204.299 107.253 204.319 107.205 204.319 107.152C204.319 107.089 204.301 107.04 204.263 107.003C204.226 106.966 204.176 106.948 204.113 106.948C204.02 106.948 203.956 106.983 203.921 107.053C203.902 107.09 203.891 107.142 203.889 107.209H203.752C203.753 107.115 203.771 107.039 203.804 106.98C203.862 106.876 203.966 106.824 204.114 106.824C204.237 106.824 204.327 106.857 204.383 106.924C204.44 106.99 204.469 107.064 204.469 107.146C204.469 107.232 204.439 107.306 204.378 107.367C204.343 107.402 204.28 107.445 204.19 107.496L204.087 107.553C204.038 107.58 203.999 107.606 203.971 107.63C203.921 107.674 203.89 107.722 203.877 107.775H204.464V107.903H203.726ZM204.956 106.828C205.095 106.828 205.195 106.885 205.257 107C205.305 107.088 205.329 107.209 205.329 107.364C205.329 107.51 205.308 107.631 205.264 107.726C205.201 107.863 205.098 107.932 204.955 107.932C204.826 107.932 204.73 107.876 204.666 107.764C204.614 107.67 204.588 107.545 204.588 107.387C204.588 107.265 204.603 107.16 204.635 107.072C204.694 106.909 204.801 106.828 204.956 106.828ZM204.954 107.809C205.024 107.809 205.08 107.778 205.121 107.716C205.163 107.654 205.184 107.538 205.184 107.369C205.184 107.247 205.169 107.146 205.139 107.068C205.109 106.989 205.05 106.949 204.964 106.949C204.884 106.949 204.826 106.987 204.789 107.062C204.752 107.136 204.734 107.246 204.734 107.392C204.734 107.502 204.746 107.59 204.769 107.656C204.805 107.758 204.867 107.809 204.954 107.809ZM206.376 107.775C206.427 107.775 206.468 107.77 206.501 107.759C206.559 107.74 206.606 107.702 206.643 107.647C206.673 107.602 206.694 107.545 206.707 107.475C206.715 107.434 206.719 107.395 206.719 107.36C206.719 107.223 206.691 107.117 206.637 107.042C206.583 106.966 206.495 106.928 206.375 106.928H206.11V107.775H206.376ZM205.96 106.8H206.406C206.558 106.8 206.676 106.854 206.759 106.961C206.834 107.058 206.871 107.183 206.871 107.334C206.871 107.451 206.849 107.557 206.805 107.652C206.727 107.819 206.594 107.903 206.405 107.903H205.96V106.8ZM207.387 107.081C207.444 107.081 207.499 107.094 207.553 107.121C207.606 107.148 207.647 107.182 207.675 107.225C207.702 107.265 207.72 107.313 207.729 107.367C207.737 107.404 207.741 107.463 207.741 107.544H207.152C207.154 107.625 207.174 107.691 207.21 107.74C207.246 107.79 207.302 107.814 207.377 107.814C207.448 107.814 207.504 107.791 207.546 107.744C207.57 107.717 207.587 107.686 207.597 107.65H207.73C207.726 107.68 207.715 107.713 207.695 107.749C207.675 107.786 207.653 107.815 207.629 107.838C207.588 107.878 207.537 107.905 207.476 107.919C207.444 107.927 207.407 107.931 207.366 107.931C207.266 107.931 207.181 107.895 207.111 107.822C207.042 107.749 207.007 107.647 207.007 107.516C207.007 107.387 207.042 107.282 207.112 107.201C207.182 107.121 207.274 107.081 207.387 107.081ZM207.602 107.436C207.597 107.378 207.584 107.331 207.564 107.296C207.527 107.231 207.465 107.198 207.379 107.198C207.317 107.198 207.264 107.221 207.222 107.266C207.18 107.311 207.158 107.367 207.156 107.436H207.602ZM208.224 107.075C208.315 107.075 208.388 107.097 208.445 107.141C208.502 107.185 208.536 107.261 208.548 107.369H208.416C208.408 107.319 208.39 107.278 208.361 107.246C208.333 107.213 208.287 107.196 208.224 107.196C208.138 107.196 208.076 107.238 208.039 107.322C208.015 107.377 208.003 107.444 208.003 107.524C208.003 107.605 208.02 107.673 208.054 107.728C208.088 107.783 208.142 107.81 208.215 107.81C208.271 107.81 208.315 107.793 208.348 107.759C208.381 107.725 208.404 107.678 208.416 107.618H208.548C208.533 107.725 208.495 107.803 208.435 107.852C208.375 107.901 208.298 107.926 208.205 107.926C208.099 107.926 208.016 107.888 207.953 107.811C207.891 107.734 207.859 107.638 207.859 107.523C207.859 107.382 207.894 107.272 207.962 107.193C208.031 107.115 208.118 107.075 208.224 107.075Z" fill="#141B38"></path><path d="M226.891 107.903C226.896 107.81 226.915 107.729 226.948 107.661C226.982 107.592 227.047 107.53 227.143 107.474L227.287 107.391C227.352 107.353 227.397 107.321 227.423 107.295C227.464 107.253 227.485 107.205 227.485 107.152C227.485 107.089 227.466 107.04 227.429 107.003C227.391 106.966 227.341 106.948 227.278 106.948C227.186 106.948 227.122 106.983 227.086 107.053C227.067 107.09 227.057 107.142 227.055 107.209H226.917C226.919 107.115 226.936 107.039 226.969 106.98C227.028 106.876 227.131 106.824 227.279 106.824C227.402 106.824 227.492 106.857 227.549 106.924C227.606 106.99 227.634 107.064 227.634 107.146C227.634 107.232 227.604 107.306 227.543 107.367C227.508 107.402 227.446 107.445 227.355 107.496L227.252 107.553C227.203 107.58 227.165 107.606 227.137 107.63C227.087 107.674 227.055 107.722 227.042 107.775H227.629V107.903H226.891ZM227.895 107.629C227.904 107.706 227.94 107.759 228.002 107.789C228.034 107.804 228.071 107.811 228.113 107.811C228.194 107.811 228.253 107.786 228.291 107.734C228.33 107.683 228.349 107.627 228.349 107.565C228.349 107.49 228.326 107.432 228.28 107.391C228.235 107.35 228.18 107.329 228.116 107.329C228.069 107.329 228.029 107.338 227.996 107.356C227.963 107.374 227.934 107.399 227.911 107.431L227.794 107.424L227.875 106.846H228.434V106.976H227.977L227.931 107.275C227.956 107.256 227.98 107.242 228.002 107.232C228.042 107.216 228.089 107.207 228.141 107.207C228.24 107.207 228.323 107.239 228.392 107.303C228.461 107.366 228.495 107.447 228.495 107.545C228.495 107.646 228.463 107.736 228.4 107.813C228.338 107.891 228.238 107.93 228.1 107.93C228.012 107.93 227.935 107.905 227.867 107.856C227.8 107.807 227.763 107.731 227.755 107.629H227.895ZM229.542 107.775C229.592 107.775 229.634 107.77 229.666 107.759C229.724 107.74 229.772 107.702 229.809 107.647C229.838 107.602 229.86 107.545 229.873 107.475C229.88 107.434 229.884 107.395 229.884 107.36C229.884 107.223 229.857 107.117 229.802 107.042C229.748 106.966 229.661 106.928 229.54 106.928H229.275V107.775H229.542ZM229.125 106.8H229.572C229.723 106.8 229.841 106.854 229.925 106.961C229.999 107.058 230.036 107.183 230.036 107.334C230.036 107.451 230.014 107.557 229.97 107.652C229.893 107.819 229.759 107.903 229.57 107.903H229.125V106.8ZM230.552 107.081C230.609 107.081 230.665 107.094 230.718 107.121C230.772 107.148 230.813 107.182 230.841 107.225C230.868 107.265 230.886 107.313 230.895 107.367C230.903 107.404 230.907 107.463 230.907 107.544H230.317C230.32 107.625 230.339 107.691 230.375 107.74C230.411 107.79 230.467 107.814 230.543 107.814C230.613 107.814 230.669 107.791 230.711 107.744C230.735 107.717 230.752 107.686 230.762 107.65H230.895C230.892 107.68 230.88 107.713 230.86 107.749C230.841 107.786 230.819 107.815 230.794 107.838C230.753 107.878 230.702 107.905 230.642 107.919C230.609 107.927 230.572 107.931 230.531 107.931C230.431 107.931 230.346 107.895 230.277 107.822C230.207 107.749 230.172 107.647 230.172 107.516C230.172 107.387 230.207 107.282 230.277 107.201C230.348 107.121 230.439 107.081 230.552 107.081ZM230.768 107.436C230.762 107.378 230.749 107.331 230.729 107.296C230.692 107.231 230.631 107.198 230.544 107.198C230.482 107.198 230.43 107.221 230.388 107.266C230.346 107.311 230.324 107.367 230.321 107.436H230.768ZM231.389 107.075C231.48 107.075 231.554 107.097 231.61 107.141C231.667 107.185 231.702 107.261 231.713 107.369H231.582C231.574 107.319 231.555 107.278 231.527 107.246C231.498 107.213 231.453 107.196 231.389 107.196C231.303 107.196 231.242 107.238 231.205 107.322C231.181 107.377 231.169 107.444 231.169 107.524C231.169 107.605 231.186 107.673 231.22 107.728C231.254 107.783 231.307 107.81 231.38 107.81C231.437 107.81 231.481 107.793 231.513 107.759C231.546 107.725 231.569 107.678 231.582 107.618H231.713C231.698 107.725 231.661 107.803 231.6 107.852C231.54 107.901 231.464 107.926 231.37 107.926C231.265 107.926 231.181 107.888 231.118 107.811C231.056 107.734 231.025 107.638 231.025 107.523C231.025 107.382 231.059 107.272 231.127 107.193C231.196 107.115 231.283 107.075 231.389 107.075Z" fill="#141B38"></path><path d="M250.408 107.932C250.281 107.932 250.188 107.897 250.131 107.828C250.074 107.758 250.045 107.672 250.045 107.572H250.186C250.192 107.642 250.205 107.692 250.226 107.724C250.261 107.781 250.324 107.809 250.415 107.809C250.487 107.809 250.544 107.79 250.587 107.752C250.63 107.714 250.651 107.665 250.651 107.605C250.651 107.531 250.628 107.479 250.583 107.449C250.538 107.42 250.475 107.405 250.394 107.405C250.385 107.405 250.376 107.405 250.367 107.406C250.358 107.406 250.348 107.406 250.339 107.406V107.287C250.353 107.289 250.365 107.29 250.374 107.29C250.384 107.291 250.394 107.291 250.405 107.291C250.455 107.291 250.497 107.283 250.53 107.267C250.587 107.239 250.615 107.189 250.615 107.117C250.615 107.063 250.596 107.022 250.558 106.993C250.52 106.964 250.476 106.949 250.425 106.949C250.335 106.949 250.273 106.979 250.238 107.039C250.219 107.072 250.208 107.119 250.206 107.18H250.072C250.072 107.1 250.088 107.032 250.12 106.976C250.175 106.876 250.272 106.826 250.411 106.826C250.521 106.826 250.605 106.851 250.665 106.9C250.726 106.948 250.756 107.019 250.756 107.111C250.756 107.177 250.738 107.231 250.702 107.272C250.68 107.298 250.652 107.318 250.617 107.332C250.673 107.348 250.717 107.378 250.749 107.422C250.781 107.466 250.797 107.52 250.797 107.584C250.797 107.687 250.763 107.771 250.695 107.835C250.628 107.9 250.532 107.932 250.408 107.932ZM251.286 106.828C251.426 106.828 251.526 106.885 251.588 107C251.636 107.088 251.66 107.209 251.66 107.364C251.66 107.51 251.639 107.631 251.595 107.726C251.532 107.863 251.429 107.932 251.286 107.932C251.157 107.932 251.06 107.876 250.997 107.764C250.945 107.67 250.919 107.545 250.919 107.387C250.919 107.265 250.934 107.16 250.966 107.072C251.025 106.909 251.132 106.828 251.286 106.828ZM251.285 107.809C251.355 107.809 251.411 107.778 251.452 107.716C251.494 107.654 251.515 107.538 251.515 107.369C251.515 107.247 251.5 107.146 251.47 107.068C251.44 106.989 251.381 106.949 251.295 106.949C251.215 106.949 251.157 106.987 251.12 107.062C251.083 107.136 251.065 107.246 251.065 107.392C251.065 107.502 251.077 107.59 251.1 107.656C251.136 107.758 251.198 107.809 251.285 107.809ZM252.707 107.775C252.758 107.775 252.799 107.77 252.832 107.759C252.89 107.74 252.937 107.702 252.974 107.647C253.004 107.602 253.025 107.545 253.038 107.475C253.046 107.434 253.049 107.395 253.049 107.36C253.049 107.223 253.022 107.117 252.968 107.042C252.914 106.966 252.826 106.928 252.706 106.928H252.441V107.775H252.707ZM252.29 106.8H252.737C252.889 106.8 253.006 106.854 253.09 106.961C253.165 107.058 253.202 107.183 253.202 107.334C253.202 107.451 253.18 107.557 253.136 107.652C253.058 107.819 252.925 107.903 252.736 107.903H252.29V106.8ZM253.718 107.081C253.775 107.081 253.83 107.094 253.884 107.121C253.937 107.148 253.978 107.182 254.006 107.225C254.033 107.265 254.051 107.313 254.06 107.367C254.068 107.404 254.072 107.463 254.072 107.544H253.483C253.485 107.625 253.505 107.691 253.541 107.74C253.577 107.79 253.632 107.814 253.708 107.814C253.779 107.814 253.835 107.791 253.877 107.744C253.901 107.717 253.918 107.686 253.928 107.65H254.061C254.057 107.68 254.046 107.713 254.026 107.749C254.006 107.786 253.984 107.815 253.96 107.838C253.918 107.878 253.868 107.905 253.807 107.919C253.775 107.927 253.738 107.931 253.697 107.931C253.597 107.931 253.512 107.895 253.442 107.822C253.373 107.749 253.338 107.647 253.338 107.516C253.338 107.387 253.373 107.282 253.443 107.201C253.513 107.121 253.605 107.081 253.718 107.081ZM253.933 107.436C253.928 107.378 253.915 107.331 253.895 107.296C253.858 107.231 253.796 107.198 253.71 107.198C253.647 107.198 253.595 107.221 253.553 107.266C253.511 107.311 253.489 107.367 253.487 107.436H253.933ZM254.555 107.075C254.646 107.075 254.719 107.097 254.776 107.141C254.833 107.185 254.867 107.261 254.879 107.369H254.747C254.739 107.319 254.721 107.278 254.692 107.246C254.664 107.213 254.618 107.196 254.555 107.196C254.469 107.196 254.407 107.238 254.37 107.322C254.346 107.377 254.334 107.444 254.334 107.524C254.334 107.605 254.351 107.673 254.385 107.728C254.419 107.783 254.473 107.81 254.546 107.81C254.602 107.81 254.646 107.793 254.679 107.759C254.712 107.725 254.735 107.678 254.747 107.618H254.879C254.864 107.725 254.826 107.803 254.766 107.852C254.706 107.901 254.629 107.926 254.536 107.926C254.43 107.926 254.347 107.888 254.284 107.811C254.221 107.734 254.19 107.638 254.19 107.523C254.19 107.382 254.224 107.272 254.293 107.193C254.362 107.115 254.449 107.075 254.555 107.075Z" fill="#141B38"></path><path d="M107.662 73.0521C107.667 72.9595 107.686 72.8789 107.719 72.8103C107.753 72.7418 107.818 72.6794 107.915 72.6234L108.059 72.5401C108.123 72.5025 108.169 72.4705 108.195 72.444C108.236 72.4024 108.256 72.3549 108.256 72.3013C108.256 72.2388 108.237 72.1892 108.2 72.1527C108.162 72.1156 108.112 72.0971 108.05 72.0971C107.957 72.0971 107.893 72.1322 107.858 72.2022C107.839 72.2398 107.828 72.2918 107.826 72.3584H107.689C107.69 72.2648 107.707 72.1885 107.741 72.1294C107.799 72.0253 107.902 71.9732 108.051 71.9732C108.174 71.9732 108.264 72.0065 108.32 72.0731C108.377 72.1397 108.406 72.2137 108.406 72.2953C108.406 72.3814 108.375 72.455 108.315 72.516C108.28 72.5516 108.217 72.5946 108.126 72.6452L108.024 72.7022C107.974 72.7292 107.936 72.755 107.908 72.7795C107.858 72.8231 107.826 72.8714 107.813 72.9244H108.4V73.0521H107.662ZM108.892 71.977C109.031 71.977 109.132 72.0343 109.194 72.1489C109.242 72.2375 109.266 72.3589 109.266 72.513C109.266 72.6592 109.244 72.78 109.201 72.8756C109.138 73.0128 109.035 73.0813 108.892 73.0813C108.762 73.0813 108.666 73.0253 108.603 72.9132C108.551 72.8196 108.524 72.694 108.524 72.5363C108.524 72.4142 108.54 72.3093 108.572 72.2217C108.631 72.0586 108.738 71.977 108.892 71.977ZM108.891 72.9582C108.961 72.9582 109.017 72.9272 109.058 72.8651C109.1 72.8031 109.121 72.6875 109.121 72.5183C109.121 72.3962 109.106 72.2958 109.075 72.2172C109.045 72.1382 108.987 72.0986 108.901 72.0986C108.821 72.0986 108.763 72.1362 108.726 72.2112C108.689 72.2858 108.671 72.3959 108.671 72.5416C108.671 72.6512 108.683 72.7393 108.706 72.8058C108.742 72.9074 108.804 72.9582 108.891 72.9582ZM109.754 71.977C109.893 71.977 109.994 72.0343 110.056 72.1489C110.104 72.2375 110.128 72.3589 110.128 72.513C110.128 72.6592 110.106 72.78 110.063 72.8756C110 73.0128 109.897 73.0813 109.754 73.0813C109.624 73.0813 109.528 73.0253 109.465 72.9132C109.413 72.8196 109.386 72.694 109.386 72.5363C109.386 72.4142 109.402 72.3093 109.434 72.2217C109.493 72.0586 109.6 71.977 109.754 71.977ZM109.753 72.9582C109.823 72.9582 109.879 72.9272 109.92 72.8651C109.962 72.8031 109.983 72.6875 109.983 72.5183C109.983 72.3962 109.968 72.2958 109.937 72.2172C109.907 72.1382 109.849 72.0986 109.763 72.0986C109.683 72.0986 109.625 72.1362 109.588 72.2112C109.551 72.2858 109.533 72.3959 109.533 72.5416C109.533 72.6512 109.545 72.7393 109.568 72.8058C109.604 72.9074 109.666 72.9582 109.753 72.9582ZM110.296 71.9492H110.426V72.5896L110.773 72.248H110.946L110.638 72.5491L110.963 73.0521H110.79L110.54 72.6467L110.426 72.7503V73.0521H110.296V71.9492Z" fill="#141B38"></path><path d="M107.761 79.9701V79.8665C107.859 79.857 107.927 79.8412 107.966 79.8192C108.004 79.7966 108.033 79.7438 108.052 79.6608H108.159V80.7313H108.014V79.9701H107.761ZM108.666 80.4573C108.675 80.5344 108.711 80.5877 108.774 80.6172C108.806 80.6322 108.843 80.6397 108.885 80.6397C108.965 80.6397 109.024 80.6142 109.063 80.5632C109.101 80.5121 109.12 80.4555 109.12 80.3935C109.12 80.3184 109.097 80.2604 109.051 80.2193C109.006 80.1783 108.951 80.1578 108.887 80.1578C108.84 80.1578 108.8 80.1668 108.767 80.1848C108.734 80.2028 108.705 80.2278 108.682 80.2599L108.565 80.2531L108.647 79.6743H109.205V79.8049H108.748L108.702 80.1037C108.727 80.0847 108.751 80.0704 108.774 80.0609C108.814 80.0444 108.86 80.0361 108.912 80.0361C109.011 80.0361 109.095 80.0679 109.163 80.1315C109.232 80.195 109.266 80.2756 109.266 80.3732C109.266 80.4748 109.235 80.5644 109.171 80.642C109.109 80.7196 109.009 80.7584 108.871 80.7584C108.784 80.7584 108.706 80.7338 108.638 80.6848C108.571 80.6352 108.534 80.5594 108.526 80.4573H108.666ZM109.754 79.6563C109.893 79.6563 109.994 79.7136 110.056 79.8282C110.104 79.9168 110.128 80.0381 110.128 80.1923C110.128 80.3384 110.106 80.4593 110.063 80.5549C110 80.692 109.897 80.7606 109.753 80.7606C109.624 80.7606 109.528 80.7045 109.465 80.5924C109.413 80.4988 109.386 80.3732 109.386 80.2156C109.386 80.0934 109.402 79.9886 109.434 79.901C109.493 79.7378 109.6 79.6563 109.754 79.6563ZM109.753 80.6375C109.823 80.6375 109.879 80.6064 109.92 80.5444C109.962 80.4823 109.982 80.3667 109.982 80.1975C109.982 80.0754 109.967 79.9751 109.937 79.8965C109.907 79.8174 109.849 79.7779 109.762 79.7779C109.683 79.7779 109.625 79.8154 109.588 79.8905C109.551 79.9651 109.533 80.0752 109.533 80.2208C109.533 80.3304 109.544 80.4185 109.568 80.4851C109.604 80.5867 109.666 80.6375 109.753 80.6375ZM110.296 79.6285H110.426V80.2689L110.773 79.9273H110.946L110.638 80.2283L110.963 80.7313H110.79L110.54 80.3259L110.426 80.4295V80.7313H110.296V79.6285Z" fill="#141B38"></path><path d="M107.804 88.1366C107.813 88.2137 107.849 88.267 107.912 88.2965C107.944 88.3115 107.981 88.3191 108.023 88.3191C108.103 88.3191 108.162 88.2935 108.201 88.2425C108.239 88.1914 108.258 88.1349 108.258 88.0728C108.258 87.9977 108.235 87.9397 108.189 87.8986C108.144 87.8576 108.089 87.8371 108.025 87.8371C107.978 87.8371 107.938 87.8461 107.905 87.8641C107.872 87.8821 107.843 87.9071 107.82 87.9392L107.703 87.9324L107.785 87.3536H108.343V87.4842H107.886L107.84 87.783C107.865 87.764 107.889 87.7497 107.912 87.7402C107.952 87.7237 107.998 87.7155 108.05 87.7155C108.149 87.7155 108.233 87.7472 108.301 87.8108C108.37 87.8744 108.404 87.9549 108.404 88.0525C108.404 88.1541 108.373 88.2437 108.309 88.3213C108.247 88.3989 108.147 88.4377 108.009 88.4377C107.922 88.4377 107.844 88.4131 107.776 88.3641C107.709 88.3145 107.672 88.2387 107.664 88.1366H107.804ZM108.892 87.3356C109.031 87.3356 109.132 87.3929 109.194 87.5075C109.242 87.5961 109.266 87.7175 109.266 87.8716C109.266 88.0178 109.244 88.1386 109.201 88.2342C109.138 88.3714 109.035 88.4399 108.891 88.4399C108.762 88.4399 108.666 88.3839 108.603 88.2718C108.551 88.1782 108.524 88.0525 108.524 87.8949C108.524 87.7728 108.54 87.6679 108.572 87.5803C108.631 87.4172 108.738 87.3356 108.892 87.3356ZM108.891 88.3168C108.961 88.3168 109.017 88.2858 109.058 88.2237C109.1 88.1616 109.12 88.046 109.12 87.8769C109.12 87.7547 109.105 87.6544 109.075 87.5758C109.045 87.4967 108.987 87.4572 108.9 87.4572C108.821 87.4572 108.763 87.4947 108.726 87.5698C108.689 87.6444 108.671 87.7545 108.671 87.9001C108.671 88.0097 108.682 88.0978 108.706 88.1644C108.742 88.266 108.804 88.3168 108.891 88.3168ZM109.434 87.3078H109.564V87.9482L109.911 87.6066H110.084L109.776 87.9076L110.101 88.4106H109.928L109.678 88.0052L109.564 88.1088V88.4106H109.434V87.3078Z" fill="#141B38"></path><path d="M107.761 95.3287V95.2251C107.859 95.2156 107.927 95.1998 107.966 95.1778C108.004 95.1553 108.033 95.1025 108.052 95.0194H108.159V96.09H108.014V95.3287H107.761ZM108.892 95.0149C109.031 95.0149 109.132 95.0722 109.194 95.1868C109.242 95.2754 109.266 95.3968 109.266 95.5509C109.266 95.6971 109.244 95.8179 109.201 95.9135C109.138 96.0507 109.035 96.1192 108.891 96.1192C108.762 96.1192 108.666 96.0632 108.603 95.9511C108.551 95.8575 108.524 95.7319 108.524 95.5742C108.524 95.4521 108.54 95.3472 108.572 95.2596C108.631 95.0965 108.738 95.0149 108.892 95.0149ZM108.891 95.9961C108.961 95.9961 109.017 95.9651 109.058 95.903C109.1 95.841 109.12 95.7254 109.12 95.5562C109.12 95.4341 109.105 95.3337 109.075 95.2551C109.045 95.1761 108.987 95.1365 108.9 95.1365C108.821 95.1365 108.763 95.1741 108.726 95.2491C108.689 95.3237 108.671 95.4338 108.671 95.5795C108.671 95.6891 108.682 95.7772 108.706 95.8437C108.742 95.9453 108.804 95.9961 108.891 95.9961ZM109.434 94.9871H109.564V95.6275L109.911 95.2859H110.084L109.776 95.587L110.101 96.09H109.928L109.678 95.6846L109.564 95.7882V96.09H109.434V94.9871Z" fill="#141B38"></path><path d="M108.03 102.694C108.169 102.694 108.27 102.752 108.332 102.866C108.38 102.955 108.404 103.076 108.404 103.23C108.404 103.376 108.382 103.497 108.339 103.593C108.276 103.73 108.173 103.799 108.029 103.799C107.9 103.799 107.804 103.743 107.741 103.63C107.689 103.537 107.662 103.411 107.662 103.254C107.662 103.131 107.678 103.027 107.71 102.939C107.769 102.776 107.876 102.694 108.03 102.694ZM108.029 103.675C108.099 103.675 108.155 103.644 108.196 103.582C108.238 103.52 108.258 103.405 108.258 103.236C108.258 103.113 108.243 103.013 108.213 102.934C108.183 102.855 108.125 102.816 108.038 102.816C107.959 102.816 107.901 102.853 107.864 102.928C107.827 103.003 107.809 103.113 107.809 103.259C107.809 103.368 107.82 103.456 107.844 103.523C107.88 103.625 107.942 103.675 108.029 103.675Z" fill="#141B38"></path><path d="M114.459 72.077H252.837" stroke="#D0D1D7" stroke-width="0.128127"></path><path d="M114.46 79.7646H252.837" stroke="#D0D1D7" stroke-width="0.128127"></path><path d="M114.46 87.4523H252.837" stroke="#D0D1D7" stroke-width="0.128127"></path><path d="M114.46 95.1398H252.837" stroke="#D0D1D7" stroke-width="0.128127"></path><path d="M114.46 102.828H252.837" stroke="#D0D1D7" stroke-width="0.128127"></path><path d="M114.459 102.827V104.365" stroke="#E8E8EB" stroke-width="0.231483"></path><path d="M137.523 102.827V104.365" stroke="#E8E8EB" stroke-width="0.231483"></path><path d="M160.585 102.827V104.365" stroke="#E8E8EB" stroke-width="0.231483"></path><path d="M183.648 102.827V104.365" stroke="#E8E8EB" stroke-width="0.231483"></path><path d="M206.711 102.827V104.365" stroke="#E8E8EB" stroke-width="0.231483"></path><path d="M229.774 102.827V104.365" stroke="#E8E8EB" stroke-width="0.231483"></path><path d="M252.837 102.827V104.365" stroke="#E8E8EB" stroke-width="0.231483"></path><path d="M252.837 97.5152C252.837 97.5152 250.142 96.6728 248.229 96.6728C246.316 96.6728 245.533 97.5152 243.62 97.5152C241.707 97.5152 240.776 97.0481 239.012 96.6728C237.168 96.2806 236.358 95.7563 234.404 95.5416C232.645 95.3484 231.554 95.3484 229.796 95.5416C227.841 95.7563 227.187 96.6728 225.187 96.6728C223.188 96.6728 222.578 95.5416 220.579 95.5416C218.579 95.5416 217.966 96.7359 215.971 96.6728C213.712 96.6014 213.532 95.2167 211.362 94.8917C209.636 94.6333 208.554 94.8917 206.754 94.8917C204.954 94.8917 203.929 94.7706 202.146 94.8917C200.294 95.0174 199.398 95.6262 197.537 95.5416C195.513 95.4495 194.951 94.4202 192.929 94.3141C191.085 94.2173 190.161 94.7798 188.321 94.8917C186.534 95.0004 185.512 94.8917 183.713 94.8917C181.913 94.8917 180.891 95.0004 179.104 94.8917C177.264 94.7798 176.35 94.3141 174.496 94.3141C172.642 94.3141 171.728 94.7798 169.888 94.8917C168.101 95.0004 167.038 94.6985 165.279 94.8917C163.325 95.1064 162.625 95.8083 160.671 96.023C158.912 96.2162 157.862 96.023 156.063 96.023C154.263 96.023 153.213 96.2162 151.454 96.023C149.5 95.8083 148.8 95.1064 146.846 94.8917C145.087 94.6985 144.025 95.0004 142.238 94.8917C140.397 94.7798 139.423 94.5528 137.629 94.3141C135.823 94.0736 134.781 93.982 133.021 93.6642C131.167 93.3293 130.381 92.6293 128.413 92.6293C126.445 92.6293 125.773 93.6642 123.805 93.6642C121.836 93.6642 121.126 92.8266 119.196 92.6293C117.432 92.4488 114.588 92.6293 114.588 92.6293" stroke="#005AE0" stroke-width="0.231483"></path><path opacity="0.6" d="M248.229 96.6728C250.142 96.6728 252.837 97.5152 252.837 97.5152L252.815 102.784H114.588V92.6293C114.588 92.6293 117.432 92.4488 119.196 92.6293C121.126 92.8266 121.836 93.6642 123.805 93.6642C125.773 93.6642 126.445 92.6293 128.413 92.6293C130.381 92.6293 131.167 93.3293 133.021 93.6642C134.781 93.982 135.823 94.0736 137.629 94.3141C139.423 94.5528 140.397 94.7798 142.238 94.8917C144.025 95.0004 145.087 94.6985 146.846 94.8917C148.8 95.1064 149.5 95.8083 151.454 96.023C153.213 96.2162 154.263 96.023 156.063 96.023C157.862 96.023 158.912 96.2162 160.671 96.023C162.625 95.8083 163.325 95.1064 165.279 94.8917C167.038 94.6985 168.101 95.0004 169.888 94.8917C171.728 94.7798 172.642 94.3141 174.496 94.3141C176.35 94.3141 177.264 94.7798 179.104 94.8917C180.891 95.0004 181.913 94.8917 183.713 94.8917C185.512 94.8917 186.534 95.0004 188.321 94.8917C190.161 94.7798 191.085 94.2173 192.929 94.3141C194.951 94.4202 195.513 95.4495 197.537 95.5416C199.398 95.6262 200.294 95.0174 202.146 94.8917C203.929 94.7706 204.954 94.8917 206.754 94.8917C208.554 94.8917 209.636 94.6333 211.362 94.8917C213.532 95.2167 213.712 96.6014 215.971 96.6728C217.966 96.7359 218.579 95.5416 220.579 95.5416C222.578 95.5416 223.188 96.6728 225.187 96.6728C227.187 96.6728 227.841 95.7563 229.796 95.5416C231.554 95.3484 232.645 95.3484 234.404 95.5416C236.358 95.7563 237.168 96.2806 239.012 96.6728C240.776 97.0481 241.707 97.5152 243.62 97.5152C245.533 97.5152 246.316 96.6728 248.229 96.6728Z" fill="url(#paint7_linear_2413_17199)"></path><path d="M114.46 93.4251C115.081 93.7932 116.974 94.3086 119.574 93.4251C122.822 92.3207 126.974 89.6826 129.501 89.6212C132.027 89.5598 131.245 88.3941 136.54 88.6395C141.834 88.885 140.21 89.3145 144.903 88.2101C149.595 87.1057 147.309 87.1057 150.919 87.1057C154.529 87.1057 157.417 89.0077 160.485 88.885C163.553 88.7623 167.284 88.1487 167.584 88.0874C167.885 88.026 172.819 87.2898 175.646 87.842C178.474 88.3941 178.594 88.5782 180.7 88.5782C182.806 88.5782 183.829 89.4985 186.777 89.5599C189.725 89.6212 191.409 92.5662 193.876 92.5662C196.343 92.5662 199.772 96.186 201.036 96.186C202.299 96.186 205.307 100.113 210.842 94.4681C216.377 88.8236 219.807 88.3328 221.852 88.3328C223.898 88.3328 225.161 88.885 227.688 88.5169C230.215 88.1487 229.854 87.7806 233.103 85.5719C236.352 83.3632 238.337 80.725 240.744 80.4796C243.15 80.2341 246.159 79.5593 247.422 79.1298C248.685 78.7003 251.212 73.8534 252.837 73.8534" stroke="#00AA63" stroke-width="0.231483"></path><path opacity="0.6" d="M119.574 93.4251C116.974 94.3086 115.081 93.7932 114.46 93.4251V102.784H252.782L252.837 73.8534C251.212 73.8534 248.685 78.7003 247.422 79.1298C246.159 79.5593 243.15 80.2341 240.744 80.4796C238.337 80.725 236.352 83.3632 233.103 85.5719C229.854 87.7806 230.215 88.1487 227.688 88.5169C225.161 88.885 223.898 88.3328 221.852 88.3328C219.807 88.3328 216.377 88.8236 210.842 94.4681C205.307 100.113 202.299 96.186 201.036 96.186C199.772 96.186 196.343 92.5662 193.876 92.5662C191.409 92.5662 189.725 89.6212 186.777 89.5599C183.829 89.4985 182.806 88.5782 180.7 88.5782C178.594 88.5782 178.474 88.3942 175.646 87.842C172.819 87.2898 167.885 88.026 167.584 88.0874C167.284 88.1487 163.553 88.7623 160.485 88.885C157.417 89.0077 154.529 87.1057 150.919 87.1057C147.309 87.1057 149.595 87.1057 144.903 88.2101C140.21 89.3145 141.834 88.885 136.54 88.6395C131.245 88.3941 132.027 89.5598 129.501 89.6212C126.974 89.6826 122.822 92.3207 119.574 93.4251Z" fill="url(#paint8_linear_2413_17199)"></path><rect x="164.115" y="101.388" width="2.92969" height="2.92969" rx="1.46484" fill="white"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M165.58 103.971C166.197 103.971 166.698 103.47 166.698 102.853C166.698 102.236 166.197 101.735 165.58 101.735C164.963 101.735 164.462 102.236 164.462 102.853C164.462 103.47 164.963 103.971 165.58 103.971ZM165.402 102.144C165.387 102.121 165.359 102.111 165.333 102.12C165.304 102.13 165.275 102.142 165.247 102.156C165.223 102.168 165.211 102.196 165.216 102.223L165.235 102.32C165.24 102.345 165.23 102.371 165.21 102.387C165.18 102.412 165.152 102.441 165.126 102.473C165.111 102.493 165.086 102.503 165.061 102.498L164.966 102.479C164.94 102.474 164.912 102.486 164.9 102.511C164.894 102.525 164.887 102.54 164.881 102.554C164.876 102.569 164.87 102.584 164.865 102.599C164.856 102.625 164.867 102.654 164.89 102.669L164.97 102.724C164.991 102.738 165.001 102.763 164.999 102.788C164.995 102.829 164.995 102.87 164.999 102.91C165.002 102.935 164.992 102.961 164.971 102.975L164.89 103.03C164.868 103.045 164.857 103.074 164.866 103.1C164.876 103.13 164.888 103.159 164.902 103.188C164.914 103.213 164.941 103.225 164.968 103.22L165.063 103.2C165.087 103.195 165.112 103.205 165.128 103.225C165.153 103.256 165.181 103.285 165.212 103.311C165.231 103.327 165.242 103.352 165.237 103.377L165.218 103.474C165.213 103.501 165.225 103.529 165.25 103.541C165.263 103.548 165.278 103.555 165.292 103.561C165.306 103.567 165.321 103.572 165.335 103.578C165.378 103.592 165.438 103.539 165.482 103.5C165.503 103.48 165.517 103.453 165.517 103.423C165.517 103.423 165.517 103.423 165.517 103.423L165.517 103.261C165.517 103.259 165.517 103.257 165.517 103.255C165.387 103.224 165.29 103.104 165.29 102.962V102.79C165.29 102.776 165.301 102.766 165.314 102.766H165.394V102.596C165.394 102.573 165.413 102.554 165.436 102.554C165.459 102.554 165.477 102.573 165.477 102.596V102.766H165.695V102.596C165.695 102.573 165.714 102.554 165.737 102.554C165.76 102.554 165.778 102.573 165.778 102.596V102.766H165.859C165.872 102.766 165.882 102.776 165.882 102.79V102.962C165.882 103.109 165.779 103.231 165.643 103.258C165.643 103.259 165.643 103.26 165.643 103.261L165.643 103.422C165.643 103.452 165.657 103.48 165.679 103.5C165.724 103.539 165.784 103.592 165.827 103.577C165.856 103.566 165.885 103.554 165.913 103.54C165.937 103.528 165.949 103.5 165.944 103.473L165.925 103.376C165.92 103.351 165.93 103.326 165.949 103.31C165.98 103.284 166.008 103.255 166.033 103.223C166.049 103.204 166.074 103.193 166.098 103.198L166.193 103.217C166.22 103.223 166.247 103.21 166.259 103.185C166.266 103.171 166.272 103.157 166.278 103.142C166.284 103.127 166.29 103.112 166.295 103.098C166.304 103.071 166.293 103.043 166.27 103.027L166.189 102.973C166.169 102.958 166.158 102.933 166.161 102.908C166.165 102.867 166.165 102.826 166.161 102.786C166.158 102.761 166.168 102.736 166.189 102.722L166.27 102.667C166.292 102.651 166.303 102.622 166.294 102.596C166.284 102.566 166.272 102.537 166.258 102.509C166.246 102.484 166.219 102.471 166.192 102.477L166.097 102.496C166.073 102.501 166.048 102.491 166.032 102.471C166.007 102.44 165.979 102.411 165.948 102.385C165.928 102.369 165.918 102.344 165.923 102.319L165.942 102.222C165.947 102.195 165.935 102.167 165.91 102.155C165.896 102.148 165.882 102.142 165.868 102.135C165.853 102.129 165.839 102.124 165.824 102.119C165.799 102.11 165.771 102.121 165.755 102.144L165.702 102.226C165.688 102.247 165.663 102.258 165.638 102.255C165.598 102.251 165.559 102.251 165.519 102.256C165.495 102.258 165.47 102.248 165.456 102.227L165.402 102.144Z" fill="#005AE0"></path><rect x="164.115" y="101.388" width="2.92969" height="2.92969" rx="1.46484" stroke="#DCDDE1" stroke-width="0.2"></rect><rect x="124.115" y="101.388" width="2.92969" height="2.92969" rx="1.46484" fill="white"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M125.58 103.971C126.197 103.971 126.698 103.47 126.698 102.853C126.698 102.236 126.197 101.735 125.58 101.735C124.963 101.735 124.462 102.236 124.462 102.853C124.462 103.47 124.963 103.971 125.58 103.971ZM125.402 102.144C125.387 102.121 125.359 102.111 125.333 102.12C125.304 102.13 125.275 102.142 125.247 102.156C125.223 102.168 125.211 102.196 125.216 102.223L125.235 102.32C125.24 102.345 125.23 102.371 125.21 102.387C125.18 102.412 125.152 102.441 125.126 102.473C125.111 102.493 125.086 102.503 125.061 102.498L124.966 102.479C124.94 102.474 124.912 102.486 124.9 102.511C124.894 102.525 124.887 102.54 124.881 102.554C124.876 102.569 124.87 102.584 124.865 102.599C124.856 102.625 124.867 102.654 124.89 102.669L124.97 102.724C124.991 102.738 125.001 102.763 124.999 102.788C124.995 102.829 124.995 102.87 124.999 102.91C125.002 102.935 124.992 102.961 124.971 102.975L124.89 103.03C124.868 103.045 124.857 103.074 124.866 103.1C124.876 103.13 124.888 103.159 124.902 103.188C124.914 103.213 124.941 103.225 124.968 103.22L125.063 103.2C125.087 103.195 125.112 103.205 125.128 103.225C125.153 103.256 125.181 103.285 125.212 103.311C125.231 103.327 125.242 103.352 125.237 103.377L125.218 103.474C125.213 103.501 125.225 103.529 125.25 103.541C125.263 103.548 125.278 103.555 125.292 103.561C125.306 103.567 125.321 103.572 125.335 103.578C125.378 103.592 125.438 103.539 125.482 103.5C125.503 103.48 125.517 103.453 125.517 103.423C125.517 103.423 125.517 103.423 125.517 103.423L125.517 103.261C125.517 103.259 125.517 103.257 125.517 103.255C125.387 103.224 125.29 103.104 125.29 102.962V102.79C125.29 102.776 125.301 102.766 125.314 102.766H125.394V102.596C125.394 102.573 125.413 102.554 125.436 102.554C125.459 102.554 125.477 102.573 125.477 102.596V102.766H125.695V102.596C125.695 102.573 125.714 102.554 125.737 102.554C125.76 102.554 125.778 102.573 125.778 102.596V102.766H125.859C125.872 102.766 125.882 102.776 125.882 102.79V102.962C125.882 103.109 125.779 103.231 125.643 103.258C125.643 103.259 125.643 103.26 125.643 103.261L125.643 103.422C125.643 103.452 125.657 103.48 125.679 103.5C125.724 103.539 125.784 103.592 125.827 103.577C125.856 103.566 125.885 103.554 125.913 103.54C125.937 103.528 125.949 103.5 125.944 103.473L125.925 103.376C125.92 103.351 125.93 103.326 125.949 103.31C125.98 103.284 126.008 103.255 126.033 103.223C126.049 103.204 126.074 103.193 126.098 103.198L126.193 103.217C126.22 103.223 126.247 103.21 126.259 103.185C126.266 103.171 126.272 103.157 126.278 103.142C126.284 103.127 126.29 103.112 126.295 103.098C126.304 103.071 126.293 103.043 126.27 103.027L126.189 102.973C126.169 102.958 126.158 102.933 126.161 102.908C126.165 102.867 126.165 102.826 126.161 102.786C126.158 102.761 126.168 102.736 126.189 102.722L126.27 102.667C126.292 102.651 126.303 102.622 126.294 102.596C126.284 102.566 126.272 102.537 126.258 102.509C126.246 102.484 126.219 102.471 126.192 102.477L126.097 102.496C126.073 102.501 126.048 102.491 126.032 102.471C126.007 102.44 125.979 102.411 125.948 102.385C125.928 102.369 125.918 102.344 125.923 102.319L125.942 102.222C125.947 102.195 125.935 102.167 125.91 102.155C125.896 102.148 125.882 102.142 125.868 102.135C125.853 102.129 125.839 102.124 125.824 102.119C125.799 102.11 125.771 102.121 125.755 102.144L125.702 102.226C125.688 102.247 125.663 102.258 125.638 102.255C125.598 102.251 125.559 102.251 125.519 102.256C125.495 102.258 125.47 102.248 125.456 102.227L125.402 102.144Z" fill="#005AE0"></path><rect x="124.115" y="101.388" width="2.92969" height="2.92969" rx="1.46484" stroke="#DCDDE1" stroke-width="0.2"></rect><circle cx="149.633" cy="113.028" r="1.6521" fill="#005AE0"></circle><path d="M153.341 113.358C153.348 113.476 153.375 113.572 153.424 113.645C153.518 113.782 153.682 113.851 153.917 113.851C154.023 113.851 154.119 113.836 154.205 113.806C154.373 113.748 154.456 113.643 154.456 113.493C154.456 113.38 154.421 113.299 154.35 113.251C154.279 113.204 154.167 113.163 154.015 113.128L153.734 113.065C153.55 113.023 153.42 112.978 153.344 112.928C153.212 112.841 153.146 112.712 153.146 112.54C153.146 112.353 153.211 112.2 153.34 112.081C153.469 111.961 153.651 111.902 153.887 111.902C154.105 111.902 154.289 111.954 154.441 112.06C154.593 112.164 154.67 112.332 154.67 112.562H154.406C154.391 112.451 154.361 112.366 154.315 112.307C154.23 112.198 154.084 112.144 153.879 112.144C153.713 112.144 153.594 112.179 153.522 112.249C153.449 112.318 153.413 112.399 153.413 112.492C153.413 112.593 153.455 112.668 153.54 112.715C153.596 112.745 153.721 112.782 153.917 112.828L154.208 112.894C154.348 112.926 154.456 112.97 154.533 113.025C154.664 113.122 154.73 113.263 154.73 113.447C154.73 113.677 154.646 113.841 154.479 113.94C154.312 114.039 154.119 114.088 153.897 114.088C153.639 114.088 153.438 114.022 153.292 113.891C153.146 113.76 153.074 113.582 153.077 113.358H153.341ZM155.676 112.482C155.783 112.482 155.887 112.507 155.988 112.558C156.089 112.608 156.165 112.673 156.218 112.753C156.269 112.829 156.303 112.918 156.32 113.02C156.335 113.089 156.342 113.2 156.342 113.353H155.234C155.239 113.506 155.275 113.629 155.343 113.723C155.411 113.815 155.515 113.861 155.658 113.861C155.79 113.861 155.896 113.817 155.975 113.73C156.02 113.679 156.052 113.62 156.071 113.553H156.321C156.315 113.609 156.292 113.671 156.255 113.74C156.218 113.807 156.177 113.863 156.131 113.906C156.053 113.981 155.958 114.032 155.844 114.059C155.783 114.074 155.714 114.081 155.636 114.081C155.448 114.081 155.289 114.013 155.158 113.877C155.027 113.739 154.962 113.547 154.962 113.301C154.962 113.058 155.028 112.861 155.159 112.709C155.291 112.558 155.463 112.482 155.676 112.482ZM156.081 113.151C156.071 113.041 156.047 112.953 156.009 112.887C155.939 112.765 155.823 112.703 155.66 112.703C155.544 112.703 155.446 112.746 155.367 112.83C155.288 112.914 155.246 113.021 155.241 113.151H156.081ZM156.845 113.625C156.845 113.699 156.872 113.757 156.925 113.799C156.979 113.841 157.042 113.862 157.116 113.862C157.205 113.862 157.292 113.842 157.376 113.8C157.517 113.732 157.587 113.619 157.587 113.463V113.258C157.556 113.278 157.516 113.294 157.467 113.308C157.418 113.321 157.37 113.33 157.323 113.336L157.169 113.356C157.077 113.368 157.008 113.387 156.962 113.413C156.884 113.458 156.845 113.528 156.845 113.625ZM157.46 113.111C157.519 113.104 157.558 113.079 157.577 113.038C157.589 113.015 157.594 112.983 157.594 112.941C157.594 112.854 157.563 112.791 157.501 112.753C157.44 112.713 157.352 112.694 157.237 112.694C157.104 112.694 157.01 112.729 156.955 112.801C156.924 112.84 156.904 112.899 156.894 112.977H156.657C156.662 112.791 156.722 112.662 156.838 112.589C156.954 112.516 157.089 112.479 157.243 112.479C157.421 112.479 157.565 112.513 157.676 112.581C157.786 112.648 157.841 112.754 157.841 112.897V113.768C157.841 113.794 157.847 113.815 157.857 113.831C157.868 113.847 157.891 113.855 157.926 113.855C157.937 113.855 157.95 113.855 157.964 113.854C157.978 113.852 157.993 113.85 158.009 113.847V114.035C157.97 114.046 157.94 114.053 157.919 114.056C157.898 114.059 157.87 114.06 157.834 114.06C157.747 114.06 157.683 114.029 157.644 113.967C157.623 113.934 157.608 113.887 157.6 113.827C157.548 113.895 157.474 113.954 157.377 114.004C157.28 114.053 157.173 114.078 157.056 114.078C156.916 114.078 156.801 114.036 156.712 113.951C156.624 113.866 156.579 113.759 156.579 113.631C156.579 113.491 156.623 113.382 156.711 113.305C156.798 113.228 156.913 113.18 157.055 113.162L157.46 113.111ZM158.261 112.516H158.502V112.777C158.522 112.726 158.57 112.664 158.647 112.592C158.724 112.518 158.813 112.482 158.914 112.482C158.919 112.482 158.927 112.482 158.938 112.483C158.949 112.484 158.969 112.486 158.996 112.489V112.757C158.981 112.754 158.967 112.752 158.954 112.751C158.941 112.75 158.928 112.75 158.913 112.75C158.785 112.75 158.686 112.791 158.618 112.874C158.549 112.956 158.515 113.051 158.515 113.158V114.028H158.261V112.516ZM159.793 112.472C159.964 112.472 160.102 112.513 160.209 112.596C160.316 112.679 160.38 112.822 160.402 113.024H160.155C160.14 112.931 160.105 112.854 160.052 112.792C159.998 112.73 159.912 112.699 159.793 112.699C159.632 112.699 159.516 112.778 159.446 112.936C159.401 113.039 159.378 113.166 159.378 113.316C159.378 113.468 159.41 113.595 159.474 113.699C159.538 113.802 159.639 113.854 159.777 113.854C159.882 113.854 159.965 113.822 160.026 113.758C160.089 113.693 160.131 113.605 160.155 113.493H160.402C160.374 113.693 160.303 113.84 160.19 113.933C160.077 114.025 159.933 114.071 159.757 114.071C159.559 114.071 159.402 113.999 159.284 113.855C159.166 113.71 159.107 113.53 159.107 113.313C159.107 113.048 159.172 112.841 159.301 112.694C159.43 112.546 159.594 112.472 159.793 112.472ZM160.65 111.947H160.904V112.72C160.965 112.644 161.019 112.59 161.067 112.559C161.149 112.506 161.251 112.479 161.373 112.479C161.592 112.479 161.741 112.556 161.819 112.709C161.861 112.793 161.883 112.909 161.883 113.058V114.028H161.622V113.075C161.622 112.964 161.607 112.882 161.579 112.83C161.533 112.748 161.446 112.706 161.319 112.706C161.214 112.706 161.118 112.742 161.033 112.815C160.947 112.887 160.904 113.024 160.904 113.226V114.028H160.65V111.947ZM163.15 111.954H163.434V114.028H163.15V111.954ZM163.852 112.516H164.103V112.73C164.163 112.656 164.218 112.602 164.267 112.568C164.35 112.51 164.445 112.482 164.552 112.482C164.672 112.482 164.769 112.511 164.843 112.571C164.884 112.605 164.922 112.654 164.956 112.72C165.012 112.639 165.078 112.58 165.155 112.541C165.231 112.502 165.316 112.482 165.412 112.482C165.615 112.482 165.753 112.555 165.827 112.702C165.866 112.781 165.886 112.887 165.886 113.021V114.028H165.622V112.977C165.622 112.877 165.596 112.807 165.546 112.77C165.496 112.732 165.435 112.713 165.362 112.713C165.262 112.713 165.176 112.747 165.104 112.814C165.032 112.88 164.996 112.992 164.996 113.148V114.028H164.738V113.041C164.738 112.938 164.726 112.863 164.701 112.816C164.663 112.746 164.591 112.71 164.485 112.71C164.389 112.71 164.302 112.748 164.223 112.822C164.145 112.896 164.106 113.031 164.106 113.226V114.028H163.852V112.516ZM166.892 113.857C167.011 113.857 167.109 113.807 167.187 113.709C167.266 113.609 167.306 113.46 167.306 113.262C167.306 113.142 167.288 113.038 167.254 112.952C167.188 112.785 167.067 112.702 166.892 112.702C166.716 112.702 166.596 112.79 166.531 112.966C166.496 113.06 166.479 113.18 166.479 113.325C166.479 113.441 166.496 113.541 166.531 113.622C166.597 113.779 166.717 113.857 166.892 113.857ZM166.234 112.523H166.481V112.723C166.532 112.654 166.588 112.601 166.648 112.564C166.734 112.507 166.834 112.479 166.95 112.479C167.121 112.479 167.267 112.545 167.386 112.677C167.506 112.807 167.566 112.995 167.566 113.238C167.566 113.568 167.48 113.803 167.307 113.944C167.198 114.034 167.071 114.078 166.926 114.078C166.812 114.078 166.717 114.053 166.64 114.004C166.594 113.975 166.544 113.927 166.489 113.858V114.63H166.234V112.523ZM167.865 112.516H168.106V112.777C168.126 112.726 168.174 112.664 168.252 112.592C168.329 112.518 168.418 112.482 168.518 112.482C168.523 112.482 168.531 112.482 168.542 112.483C168.554 112.484 168.573 112.486 168.6 112.489V112.757C168.585 112.754 168.571 112.752 168.558 112.751C168.546 112.75 168.532 112.75 168.517 112.75C168.389 112.75 168.291 112.791 168.222 112.874C168.153 112.956 168.119 113.051 168.119 113.158V114.028H167.865V112.516ZM169.444 112.482C169.552 112.482 169.656 112.507 169.756 112.558C169.857 112.608 169.934 112.673 169.986 112.753C170.037 112.829 170.071 112.918 170.088 113.02C170.103 113.089 170.111 113.2 170.111 113.353H169.002C169.007 113.506 169.043 113.629 169.111 113.723C169.179 113.815 169.284 113.861 169.426 113.861C169.559 113.861 169.665 113.817 169.744 113.73C169.789 113.679 169.821 113.62 169.84 113.553H170.09C170.083 113.609 170.061 113.671 170.023 113.74C169.986 113.807 169.945 113.863 169.899 113.906C169.822 113.981 169.726 114.032 169.612 114.059C169.551 114.074 169.482 114.081 169.405 114.081C169.217 114.081 169.057 114.013 168.926 113.877C168.795 113.739 168.73 113.547 168.73 113.301C168.73 113.058 168.796 112.861 168.928 112.709C169.059 112.558 169.232 112.482 169.444 112.482ZM169.85 113.151C169.839 113.041 169.815 112.953 169.778 112.887C169.708 112.765 169.592 112.703 169.429 112.703C169.312 112.703 169.214 112.746 169.135 112.83C169.056 112.914 169.014 113.021 169.01 113.151H169.85ZM170.569 113.553C170.577 113.638 170.598 113.703 170.633 113.748C170.697 113.83 170.808 113.871 170.966 113.871C171.06 113.871 171.143 113.851 171.215 113.81C171.286 113.769 171.322 113.705 171.322 113.62C171.322 113.555 171.293 113.505 171.236 113.471C171.199 113.451 171.127 113.427 171.018 113.399L170.816 113.349C170.687 113.317 170.592 113.281 170.531 113.241C170.422 113.173 170.367 113.078 170.367 112.956C170.367 112.813 170.419 112.697 170.521 112.609C170.625 112.52 170.764 112.476 170.938 112.476C171.166 112.476 171.33 112.543 171.43 112.677C171.494 112.761 171.524 112.853 171.522 112.95H171.282C171.278 112.893 171.257 112.841 171.222 112.794C171.163 112.727 171.062 112.694 170.918 112.694C170.822 112.694 170.749 112.712 170.699 112.749C170.65 112.785 170.626 112.834 170.626 112.894C170.626 112.96 170.658 113.013 170.723 113.052C170.761 113.076 170.816 113.096 170.89 113.114L171.058 113.155C171.24 113.199 171.363 113.242 171.425 113.284C171.524 113.349 171.573 113.451 171.573 113.59C171.573 113.725 171.522 113.841 171.419 113.939C171.318 114.037 171.162 114.085 170.953 114.085C170.728 114.085 170.569 114.035 170.475 113.933C170.382 113.83 170.332 113.704 170.325 113.553H170.569ZM172.009 113.553C172.017 113.638 172.038 113.703 172.073 113.748C172.137 113.83 172.248 113.871 172.406 113.871C172.5 113.871 172.583 113.851 172.654 113.81C172.726 113.769 172.762 113.705 172.762 113.62C172.762 113.555 172.733 113.505 172.675 113.471C172.639 113.451 172.566 113.427 172.458 113.399L172.256 113.349C172.127 113.317 172.032 113.281 171.971 113.241C171.862 113.173 171.807 113.078 171.807 112.956C171.807 112.813 171.859 112.697 171.961 112.609C172.065 112.52 172.204 112.476 172.378 112.476C172.605 112.476 172.77 112.543 172.87 112.677C172.933 112.761 172.964 112.853 172.962 112.95H172.722C172.717 112.893 172.697 112.841 172.661 112.794C172.603 112.727 172.502 112.694 172.358 112.694C172.262 112.694 172.189 112.712 172.139 112.749C172.09 112.785 172.066 112.834 172.066 112.894C172.066 112.96 172.098 113.013 172.163 113.052C172.201 113.076 172.256 113.096 172.33 113.114L172.498 113.155C172.68 113.199 172.803 113.242 172.865 113.284C172.963 113.349 173.013 113.451 173.013 113.59C173.013 113.725 172.962 113.841 172.859 113.939C172.757 114.037 172.602 114.085 172.393 114.085C172.168 114.085 172.009 114.035 171.915 113.933C171.821 113.83 171.772 113.704 171.765 113.553H172.009ZM173.298 112.523H173.556V114.028H173.298V112.523ZM173.298 111.954H173.556V112.242H173.298V111.954ZM174.536 113.864C174.704 113.864 174.82 113.8 174.882 113.673C174.945 113.545 174.976 113.403 174.976 113.247C174.976 113.106 174.954 112.991 174.909 112.902C174.837 112.763 174.714 112.694 174.539 112.694C174.383 112.694 174.27 112.753 174.2 112.871C174.129 112.99 174.094 113.133 174.094 113.301C174.094 113.461 174.129 113.596 174.2 113.703C174.27 113.81 174.382 113.864 174.536 113.864ZM174.546 112.472C174.741 112.472 174.905 112.537 175.04 112.667C175.174 112.797 175.242 112.988 175.242 113.24C175.242 113.484 175.182 113.685 175.064 113.844C174.945 114.003 174.761 114.083 174.512 114.083C174.304 114.083 174.139 114.013 174.016 113.872C173.894 113.731 173.833 113.542 173.833 113.305C173.833 113.051 173.897 112.848 174.026 112.698C174.155 112.547 174.328 112.472 174.546 112.472ZM175.539 112.516H175.781V112.73C175.852 112.642 175.928 112.578 176.008 112.54C176.088 112.501 176.177 112.482 176.275 112.482C176.49 112.482 176.634 112.557 176.71 112.706C176.751 112.788 176.772 112.905 176.772 113.058V114.028H176.514V113.075C176.514 112.982 176.5 112.908 176.473 112.852C176.427 112.758 176.346 112.71 176.227 112.71C176.167 112.71 176.117 112.717 176.079 112.729C176.009 112.75 175.948 112.791 175.895 112.853C175.853 112.903 175.825 112.955 175.812 113.008C175.8 113.061 175.794 113.137 175.794 113.236V114.028H175.539V112.516ZM177.294 113.553C177.302 113.638 177.323 113.703 177.358 113.748C177.422 113.83 177.533 113.871 177.691 113.871C177.785 113.871 177.868 113.851 177.939 113.81C178.011 113.769 178.046 113.705 178.046 113.62C178.046 113.555 178.018 113.505 177.96 113.471C177.924 113.451 177.851 113.427 177.743 113.399L177.541 113.349C177.412 113.317 177.317 113.281 177.256 113.241C177.147 113.173 177.092 113.078 177.092 112.956C177.092 112.813 177.143 112.697 177.246 112.609C177.35 112.52 177.488 112.476 177.662 112.476C177.89 112.476 178.054 112.543 178.155 112.677C178.218 112.761 178.249 112.853 178.247 112.95H178.007C178.002 112.893 177.982 112.841 177.946 112.794C177.888 112.727 177.787 112.694 177.643 112.694C177.547 112.694 177.474 112.712 177.424 112.749C177.375 112.785 177.351 112.834 177.351 112.894C177.351 112.96 177.383 113.013 177.448 113.052C177.486 113.076 177.541 113.096 177.614 113.114L177.782 113.155C177.965 113.199 178.087 113.242 178.15 113.284C178.248 113.349 178.298 113.451 178.298 113.59C178.298 113.725 178.246 113.841 178.144 113.939C178.042 114.037 177.887 114.085 177.678 114.085C177.453 114.085 177.294 114.035 177.199 113.933C177.106 113.83 177.056 113.704 177.05 113.553H177.294Z" fill="#141B38"></path><circle cx="185.546" cy="113.028" r="1.6521" fill="#00AA63"></circle><path d="M189.254 113.358C189.26 113.476 189.288 113.572 189.337 113.645C189.43 113.782 189.594 113.851 189.83 113.851C189.935 113.851 190.031 113.836 190.118 113.806C190.285 113.748 190.369 113.643 190.369 113.493C190.369 113.38 190.334 113.299 190.263 113.251C190.192 113.204 190.08 113.163 189.927 113.128L189.646 113.065C189.463 113.023 189.333 112.978 189.257 112.928C189.125 112.841 189.059 112.712 189.059 112.54C189.059 112.353 189.123 112.2 189.252 112.081C189.381 111.961 189.564 111.902 189.8 111.902C190.017 111.902 190.202 111.954 190.353 112.06C190.506 112.164 190.582 112.332 190.582 112.562H190.318C190.304 112.451 190.274 112.366 190.228 112.307C190.142 112.198 189.997 112.144 189.792 112.144C189.626 112.144 189.507 112.179 189.434 112.249C189.362 112.318 189.326 112.399 189.326 112.492C189.326 112.593 189.368 112.668 189.453 112.715C189.508 112.745 189.634 112.782 189.83 112.828L190.121 112.894C190.261 112.926 190.369 112.97 190.445 113.025C190.577 113.122 190.643 113.263 190.643 113.447C190.643 113.677 190.559 113.841 190.392 113.94C190.225 114.039 190.031 114.088 189.81 114.088C189.552 114.088 189.35 114.022 189.204 113.891C189.058 113.76 188.987 113.582 188.99 113.358H189.254ZM191.589 112.482C191.696 112.482 191.8 112.507 191.901 112.558C192.001 112.608 192.078 112.673 192.131 112.753C192.181 112.829 192.215 112.918 192.232 113.02C192.247 113.089 192.255 113.2 192.255 113.353H191.147C191.151 113.506 191.188 113.629 191.255 113.723C191.323 113.815 191.428 113.861 191.57 113.861C191.703 113.861 191.809 113.817 191.888 113.73C191.933 113.679 191.965 113.62 191.984 113.553H192.234C192.227 113.609 192.205 113.671 192.167 113.74C192.131 113.807 192.089 113.863 192.043 113.906C191.966 113.981 191.87 114.032 191.757 114.059C191.695 114.074 191.626 114.081 191.549 114.081C191.361 114.081 191.201 114.013 191.07 113.877C190.94 113.739 190.874 113.547 190.874 113.301C190.874 113.058 190.94 112.861 191.072 112.709C191.204 112.558 191.376 112.482 191.589 112.482ZM191.994 113.151C191.983 113.041 191.959 112.953 191.922 112.887C191.852 112.765 191.736 112.703 191.573 112.703C191.456 112.703 191.358 112.746 191.279 112.83C191.2 112.914 191.158 113.021 191.154 113.151H191.994ZM192.757 113.625C192.757 113.699 192.784 113.757 192.838 113.799C192.891 113.841 192.955 113.862 193.028 113.862C193.118 113.862 193.204 113.842 193.288 113.8C193.429 113.732 193.5 113.619 193.5 113.463V113.258C193.469 113.278 193.429 113.294 193.38 113.308C193.331 113.321 193.283 113.33 193.236 113.336L193.082 113.356C192.99 113.368 192.921 113.387 192.874 113.413C192.796 113.458 192.757 113.528 192.757 113.625ZM193.373 113.111C193.431 113.104 193.47 113.079 193.49 113.038C193.501 113.015 193.507 112.983 193.507 112.941C193.507 112.854 193.476 112.791 193.414 112.753C193.353 112.713 193.265 112.694 193.15 112.694C193.017 112.694 192.923 112.729 192.867 112.801C192.836 112.84 192.816 112.899 192.807 112.977H192.57C192.574 112.791 192.634 112.662 192.75 112.589C192.867 112.516 193.002 112.479 193.155 112.479C193.333 112.479 193.478 112.513 193.589 112.581C193.699 112.648 193.754 112.754 193.754 112.897V113.768C193.754 113.794 193.759 113.815 193.769 113.831C193.781 113.847 193.804 113.855 193.839 113.855C193.85 113.855 193.863 113.855 193.877 113.854C193.891 113.852 193.906 113.85 193.922 113.847V114.035C193.882 114.046 193.852 114.053 193.832 114.056C193.811 114.059 193.783 114.06 193.747 114.06C193.659 114.06 193.596 114.029 193.556 113.967C193.536 113.934 193.521 113.887 193.513 113.827C193.461 113.895 193.386 113.954 193.29 114.004C193.193 114.053 193.086 114.078 192.969 114.078C192.829 114.078 192.714 114.036 192.625 113.951C192.536 113.866 192.492 113.759 192.492 113.631C192.492 113.491 192.536 113.382 192.623 113.305C192.711 113.228 192.826 113.18 192.968 113.162L193.373 113.111ZM194.173 112.516H194.415V112.777C194.434 112.726 194.483 112.664 194.56 112.592C194.637 112.518 194.726 112.482 194.827 112.482C194.831 112.482 194.839 112.482 194.851 112.483C194.862 112.484 194.881 112.486 194.909 112.489V112.757C194.894 112.754 194.879 112.752 194.866 112.751C194.854 112.75 194.84 112.75 194.825 112.75C194.697 112.75 194.599 112.791 194.53 112.874C194.462 112.956 194.427 113.051 194.427 113.158V114.028H194.173V112.516ZM195.706 112.472C195.876 112.472 196.015 112.513 196.121 112.596C196.228 112.679 196.293 112.822 196.315 113.024H196.067C196.052 112.931 196.018 112.854 195.964 112.792C195.911 112.73 195.825 112.699 195.706 112.699C195.544 112.699 195.428 112.778 195.359 112.936C195.314 113.039 195.291 113.166 195.291 113.316C195.291 113.468 195.323 113.595 195.387 113.699C195.451 113.802 195.552 113.854 195.689 113.854C195.795 113.854 195.878 113.822 195.939 113.758C196.001 113.693 196.044 113.605 196.067 113.493H196.315C196.286 113.693 196.216 113.84 196.103 113.933C195.99 114.025 195.845 114.071 195.669 114.071C195.472 114.071 195.314 113.999 195.196 113.855C195.079 113.71 195.02 113.53 195.02 113.313C195.02 113.048 195.084 112.841 195.213 112.694C195.342 112.546 195.507 112.472 195.706 112.472ZM196.563 111.947H196.817V112.72C196.877 112.644 196.931 112.59 196.979 112.559C197.061 112.506 197.163 112.479 197.286 112.479C197.505 112.479 197.654 112.556 197.732 112.709C197.774 112.793 197.795 112.909 197.795 113.058V114.028H197.534V113.075C197.534 112.964 197.52 112.882 197.492 112.83C197.446 112.748 197.359 112.706 197.232 112.706C197.127 112.706 197.031 112.742 196.945 112.815C196.86 112.887 196.817 113.024 196.817 113.226V114.028H196.563V111.947ZM199.063 111.954H199.346V114.028H199.063V111.954ZM199.764 112.516H200.015V112.73C200.076 112.656 200.13 112.602 200.179 112.568C200.263 112.51 200.358 112.482 200.464 112.482C200.585 112.482 200.682 112.511 200.755 112.571C200.797 112.605 200.834 112.654 200.868 112.72C200.925 112.639 200.991 112.58 201.067 112.541C201.143 112.502 201.229 112.482 201.324 112.482C201.527 112.482 201.666 112.555 201.739 112.702C201.779 112.781 201.798 112.887 201.798 113.021V114.028H201.534V112.977C201.534 112.877 201.509 112.807 201.458 112.77C201.408 112.732 201.347 112.713 201.275 112.713C201.175 112.713 201.089 112.747 201.016 112.814C200.945 112.88 200.909 112.992 200.909 113.148V114.028H200.651V113.041C200.651 112.938 200.639 112.863 200.614 112.816C200.575 112.746 200.503 112.71 200.398 112.71C200.302 112.71 200.215 112.748 200.135 112.822C200.057 112.896 200.018 113.031 200.018 113.226V114.028H199.764V112.516ZM202.805 113.857C202.923 113.857 203.022 113.807 203.1 113.709C203.179 113.609 203.218 113.46 203.218 113.262C203.218 113.142 203.201 113.038 203.166 112.952C203.1 112.785 202.98 112.702 202.805 112.702C202.629 112.702 202.508 112.79 202.443 112.966C202.409 113.06 202.391 113.18 202.391 113.325C202.391 113.441 202.409 113.541 202.443 113.622C202.509 113.779 202.63 113.857 202.805 113.857ZM202.147 112.523H202.394V112.723C202.445 112.654 202.5 112.601 202.561 112.564C202.646 112.507 202.747 112.479 202.863 112.479C203.034 112.479 203.179 112.545 203.299 112.677C203.418 112.807 203.478 112.995 203.478 113.238C203.478 113.568 203.392 113.803 203.22 113.944C203.111 114.034 202.984 114.078 202.839 114.078C202.725 114.078 202.629 114.053 202.552 114.004C202.507 113.975 202.457 113.927 202.401 113.858V114.63H202.147V112.523ZM203.777 112.516H204.019V112.777C204.039 112.726 204.087 112.664 204.164 112.592C204.241 112.518 204.33 112.482 204.431 112.482C204.436 112.482 204.444 112.482 204.455 112.483C204.466 112.484 204.486 112.486 204.513 112.489V112.757C204.498 112.754 204.484 112.752 204.471 112.751C204.458 112.75 204.445 112.75 204.43 112.75C204.302 112.75 204.203 112.791 204.135 112.874C204.066 112.956 204.032 113.051 204.032 113.158V114.028H203.777V112.516ZM205.357 112.482C205.464 112.482 205.568 112.507 205.669 112.558C205.77 112.608 205.846 112.673 205.899 112.753C205.95 112.829 205.984 112.918 206.001 113.02C206.016 113.089 206.023 113.2 206.023 113.353H204.915C204.92 113.506 204.956 113.629 205.024 113.723C205.092 113.815 205.196 113.861 205.339 113.861C205.471 113.861 205.577 113.817 205.656 113.73C205.701 113.679 205.733 113.62 205.752 113.553H206.002C205.996 113.609 205.973 113.671 205.936 113.74C205.899 113.807 205.858 113.863 205.812 113.906C205.734 113.981 205.639 114.032 205.525 114.059C205.464 114.074 205.395 114.081 205.317 114.081C205.129 114.081 204.97 114.013 204.839 113.877C204.708 113.739 204.643 113.547 204.643 113.301C204.643 113.058 204.709 112.861 204.84 112.709C204.972 112.558 205.144 112.482 205.357 112.482ZM205.762 113.151C205.752 113.041 205.728 112.953 205.69 112.887C205.62 112.765 205.504 112.703 205.341 112.703C205.225 112.703 205.127 112.746 205.048 112.83C204.969 112.914 204.927 113.021 204.922 113.151H205.762ZM206.482 113.553C206.489 113.638 206.511 113.703 206.545 113.748C206.609 113.83 206.721 113.871 206.879 113.871C206.973 113.871 207.056 113.851 207.127 113.81C207.199 113.769 207.234 113.705 207.234 113.62C207.234 113.555 207.206 113.505 207.148 113.471C207.112 113.451 207.039 113.427 206.931 113.399L206.729 113.349C206.6 113.317 206.505 113.281 206.444 113.241C206.335 113.173 206.28 113.078 206.28 112.956C206.28 112.813 206.331 112.697 206.434 112.609C206.537 112.52 206.676 112.476 206.85 112.476C207.078 112.476 207.242 112.543 207.343 112.677C207.406 112.761 207.437 112.853 207.435 112.95H207.195C207.19 112.893 207.17 112.841 207.134 112.794C207.076 112.727 206.975 112.694 206.831 112.694C206.735 112.694 206.662 112.712 206.612 112.749C206.563 112.785 206.538 112.834 206.538 112.894C206.538 112.96 206.571 113.013 206.636 113.052C206.673 113.076 206.729 113.096 206.802 113.114L206.97 113.155C207.153 113.199 207.275 113.242 207.337 113.284C207.436 113.349 207.486 113.451 207.486 113.59C207.486 113.725 207.434 113.841 207.332 113.939C207.23 114.037 207.075 114.085 206.866 114.085C206.641 114.085 206.481 114.035 206.387 113.933C206.294 113.83 206.244 113.704 206.238 113.553H206.482ZM207.922 113.553C207.929 113.638 207.95 113.703 207.985 113.748C208.049 113.83 208.16 113.871 208.318 113.871C208.413 113.871 208.495 113.851 208.567 113.81C208.638 113.769 208.674 113.705 208.674 113.62C208.674 113.555 208.645 113.505 208.588 113.471C208.551 113.451 208.479 113.427 208.371 113.399L208.169 113.349C208.04 113.317 207.945 113.281 207.884 113.241C207.774 113.173 207.72 113.078 207.72 112.956C207.72 112.813 207.771 112.697 207.874 112.609C207.977 112.52 208.116 112.476 208.29 112.476C208.518 112.476 208.682 112.543 208.783 112.677C208.846 112.761 208.877 112.853 208.875 112.95H208.635C208.63 112.893 208.61 112.841 208.574 112.794C208.516 112.727 208.414 112.694 208.27 112.694C208.174 112.694 208.102 112.712 208.052 112.749C208.003 112.785 207.978 112.834 207.978 112.894C207.978 112.96 208.011 113.013 208.076 113.052C208.113 113.076 208.169 113.096 208.242 113.114L208.41 113.155C208.593 113.199 208.715 113.242 208.777 113.284C208.876 113.349 208.925 113.451 208.925 113.59C208.925 113.725 208.874 113.841 208.772 113.939C208.67 114.037 208.515 114.085 208.306 114.085C208.081 114.085 207.921 114.035 207.827 113.933C207.734 113.83 207.684 113.704 207.678 113.553H207.922ZM209.211 112.523H209.469V114.028H209.211V112.523ZM209.211 111.954H209.469V112.242H209.211V111.954ZM210.448 113.864C210.617 113.864 210.732 113.8 210.794 113.673C210.857 113.545 210.889 113.403 210.889 113.247C210.889 113.106 210.866 112.991 210.821 112.902C210.75 112.763 210.626 112.694 210.451 112.694C210.296 112.694 210.183 112.753 210.112 112.871C210.042 112.99 210.007 113.133 210.007 113.301C210.007 113.461 210.042 113.596 210.112 113.703C210.183 113.81 210.295 113.864 210.448 113.864ZM210.458 112.472C210.653 112.472 210.818 112.537 210.952 112.667C211.087 112.797 211.154 112.988 211.154 113.24C211.154 113.484 211.095 113.685 210.976 113.844C210.858 114.003 210.674 114.083 210.424 114.083C210.216 114.083 210.051 114.013 209.929 113.872C209.807 113.731 209.745 113.542 209.745 113.305C209.745 113.051 209.81 112.848 209.939 112.698C210.068 112.547 210.241 112.472 210.458 112.472ZM211.452 112.516H211.693V112.73C211.765 112.642 211.841 112.578 211.921 112.54C212.001 112.501 212.09 112.482 212.188 112.482C212.402 112.482 212.547 112.557 212.622 112.706C212.664 112.788 212.684 112.905 212.684 113.058V114.028H212.426V113.075C212.426 112.982 212.412 112.908 212.385 112.852C212.34 112.758 212.258 112.71 212.14 112.71C212.079 112.71 212.03 112.717 211.991 112.729C211.922 112.75 211.86 112.791 211.808 112.853C211.765 112.903 211.738 112.955 211.724 113.008C211.712 113.061 211.706 113.137 211.706 113.236V114.028H211.452V112.516ZM213.207 113.553C213.214 113.638 213.235 113.703 213.27 113.748C213.334 113.83 213.445 113.871 213.603 113.871C213.697 113.871 213.78 113.851 213.852 113.81C213.923 113.769 213.959 113.705 213.959 113.62C213.959 113.555 213.93 113.505 213.873 113.471C213.836 113.451 213.764 113.427 213.656 113.399L213.454 113.349C213.325 113.317 213.23 113.281 213.169 113.241C213.059 113.173 213.005 113.078 213.005 112.956C213.005 112.813 213.056 112.697 213.159 112.609C213.262 112.52 213.401 112.476 213.575 112.476C213.803 112.476 213.967 112.543 214.068 112.677C214.131 112.761 214.161 112.853 214.16 112.95H213.92C213.915 112.893 213.895 112.841 213.859 112.794C213.8 112.727 213.699 112.694 213.555 112.694C213.459 112.694 213.386 112.712 213.337 112.749C213.288 112.785 213.263 112.834 213.263 112.894C213.263 112.96 213.296 113.013 213.361 113.052C213.398 113.076 213.454 113.096 213.527 113.114L213.695 113.155C213.878 113.199 214 113.242 214.062 113.284C214.161 113.349 214.21 113.451 214.21 113.59C214.21 113.725 214.159 113.841 214.056 113.939C213.955 114.037 213.8 114.085 213.591 114.085C213.366 114.085 213.206 114.035 213.112 113.933C213.019 113.83 212.969 113.704 212.962 113.553H213.207Z" fill="#141B38"></path><path d="M256.716 85.209C256.716 85.3906 256.668 85.5316 256.572 85.6318C256.476 85.7321 256.368 85.7878 256.246 85.7988L256.246 85.6094C256.338 85.5879 256.412 85.5449 256.466 85.4805C256.52 85.4167 256.547 85.3268 256.547 85.2109C256.547 85.0697 256.497 84.9554 256.397 84.8682C256.298 84.7816 256.146 84.7383 255.941 84.7383C255.773 84.7383 255.637 84.7773 255.532 84.8555C255.428 84.9342 255.376 85.0514 255.376 85.207C255.376 85.3503 255.431 85.4593 255.541 85.5342C255.599 85.5739 255.675 85.6035 255.769 85.623L255.769 85.8125C255.618 85.7956 255.492 85.7396 255.389 85.6445C255.266 85.5306 255.205 85.377 255.205 85.1836C255.205 85.0169 255.255 84.877 255.356 84.7637C255.49 84.6146 255.696 84.54 255.974 84.54C256.186 84.54 256.359 84.596 256.495 84.708C256.642 84.8291 256.716 84.9961 256.716 85.209ZM256.677 86.0273L256.677 86.203L255.242 86.203L255.242 86.0273L256.677 86.0273ZM256.283 86.4637L256.283 86.6424L255.242 86.6424L255.242 86.4637L256.283 86.4637ZM256.677 86.4637L256.677 86.6424L256.477 86.6424L256.477 86.4637L256.677 86.4637ZM256.318 87.3083C256.318 87.4262 256.289 87.5219 256.232 87.5954C256.175 87.6696 256.076 87.7142 255.936 87.7292L255.936 87.5583C256.001 87.5479 256.054 87.5241 256.096 87.487C256.139 87.4499 256.161 87.3903 256.161 87.3083C256.161 87.1963 256.106 87.1163 255.997 87.0681C255.926 87.0368 255.838 87.0212 255.734 87.0212C255.629 87.0212 255.541 87.0433 255.469 87.0876C255.398 87.1319 255.362 87.2015 255.362 87.2966C255.362 87.3695 255.384 87.4271 255.428 87.4694C255.473 87.5124 255.535 87.542 255.612 87.5583L255.612 87.7292C255.473 87.7097 255.372 87.6609 255.307 87.5827C255.244 87.5046 255.212 87.4047 255.212 87.2829C255.212 87.1462 255.261 87.0372 255.361 86.9558C255.461 86.8744 255.586 86.8337 255.736 86.8337C255.92 86.8337 256.063 86.8783 256.165 86.9675C256.267 87.0567 256.318 87.1703 256.318 87.3083ZM256.677 87.8971L256.677 88.066L255.844 88.066L256.288 88.5172L256.288 88.7418L255.896 88.3414L255.242 88.7643L255.242 88.5397L255.769 88.2135L255.635 88.066L255.242 88.066L255.242 87.8971L256.677 87.8971ZM255.57 89.0015C255.511 89.0067 255.467 89.0213 255.435 89.0454C255.379 89.0897 255.35 89.1665 255.35 89.2759C255.35 89.341 255.364 89.3983 255.392 89.4478C255.421 89.4973 255.465 89.522 255.524 89.522C255.569 89.522 255.603 89.5021 255.627 89.4624C255.641 89.437 255.658 89.3869 255.677 89.312L255.712 89.1724C255.734 89.0832 255.759 89.0174 255.786 88.9751C255.833 88.8996 255.899 88.8618 255.983 88.8618C256.082 88.8618 256.162 88.8973 256.223 88.9683C256.285 89.0399 256.315 89.1359 256.315 89.2564C256.315 89.4139 256.269 89.5275 256.177 89.5972C256.118 89.6408 256.055 89.662 255.987 89.6607L255.987 89.4946C256.027 89.4914 256.063 89.4774 256.095 89.4527C256.142 89.4123 256.165 89.3423 256.165 89.2427C256.165 89.1763 256.152 89.1258 256.127 89.0913C256.101 89.0575 256.068 89.0405 256.026 89.0405C255.981 89.0405 255.944 89.063 255.917 89.1079C255.9 89.134 255.886 89.1724 255.874 89.2232L255.845 89.3394C255.815 89.4657 255.785 89.5503 255.757 89.5933C255.712 89.6616 255.641 89.6958 255.545 89.6958C255.452 89.6958 255.371 89.6603 255.303 89.5894C255.236 89.5191 255.202 89.4116 255.202 89.2671C255.202 89.1115 255.237 89.0012 255.307 88.9361C255.378 88.8716 255.466 88.8371 255.57 88.8325L255.57 89.0015Z" fill="black"></path><path d="M102.105 97.4968L102.105 97.3005L103.54 97.3005L103.54 97.4968L102.105 97.4968ZM102.494 97.0116L102.494 96.8377L102.642 96.8377C102.591 96.7961 102.553 96.7583 102.53 96.7245C102.49 96.6665 102.47 96.6008 102.47 96.5272C102.47 96.4439 102.491 96.3768 102.532 96.326C102.555 96.2974 102.59 96.2713 102.635 96.2479C102.579 96.2088 102.538 96.1629 102.511 96.1102C102.484 96.0575 102.47 95.9982 102.47 95.9325C102.47 95.7918 102.521 95.6961 102.623 95.6454C102.677 95.618 102.751 95.6043 102.843 95.6043L103.54 95.6043L103.54 95.787L102.813 95.787C102.743 95.787 102.695 95.8045 102.669 95.8397C102.643 95.8742 102.63 95.9165 102.63 95.9666C102.63 96.0357 102.653 96.0952 102.7 96.1454C102.746 96.1948 102.823 96.2196 102.931 96.2196L103.54 96.2196L103.54 96.3983L102.857 96.3983C102.786 96.3983 102.734 96.4068 102.702 96.4237C102.653 96.4504 102.628 96.5002 102.628 96.5731C102.628 96.6395 102.654 96.7 102.706 96.7547C102.757 96.8088 102.85 96.8358 102.985 96.8358L103.54 96.8358L103.54 97.0116L102.494 97.0116ZM103.421 94.9081C103.421 94.8261 103.387 94.7581 103.319 94.704C103.25 94.6494 103.147 94.622 103.01 94.622C102.927 94.622 102.855 94.6341 102.795 94.6581C102.68 94.7037 102.623 94.7871 102.623 94.9081C102.623 95.0299 102.683 95.1132 102.805 95.1581C102.87 95.1822 102.953 95.1943 103.053 95.1943C103.134 95.1943 103.203 95.1822 103.259 95.1581C103.367 95.1126 103.421 95.0292 103.421 94.9081ZM102.499 95.3632L102.499 95.1923L102.637 95.1923C102.59 95.1572 102.553 95.1188 102.527 95.0771C102.488 95.0178 102.468 94.9482 102.468 94.8681C102.468 94.7496 102.514 94.649 102.605 94.5663C102.695 94.4837 102.825 94.4423 102.994 94.4423C103.222 94.4423 103.384 94.5019 103.482 94.621C103.544 94.6966 103.575 94.7844 103.575 94.8847C103.575 94.9635 103.557 95.0296 103.523 95.083C103.503 95.1142 103.47 95.149 103.422 95.1874L103.957 95.1874L103.957 95.3632L102.499 95.3632ZM102.494 94.2354L102.494 94.0684L102.674 94.0684C102.639 94.0547 102.597 94.0212 102.546 93.9678C102.496 93.9144 102.47 93.8529 102.47 93.7832C102.47 93.78 102.471 93.7745 102.471 93.7666C102.472 93.7588 102.473 93.7455 102.475 93.7266L102.661 93.7266C102.659 93.737 102.657 93.7468 102.657 93.7559C102.656 93.7644 102.656 93.7738 102.656 93.7842C102.656 93.8728 102.684 93.9408 102.742 93.9883C102.798 94.0358 102.864 94.0596 102.938 94.0596L103.54 94.0596L103.54 94.2354L102.494 94.2354ZM102.47 93.1427C102.47 93.0685 102.488 92.9966 102.523 92.9269C102.557 92.8572 102.602 92.8042 102.658 92.7677C102.71 92.7326 102.772 92.7091 102.842 92.6974C102.89 92.687 102.967 92.6818 103.073 92.6818L103.073 93.4484C103.179 93.4451 103.264 93.4201 103.329 93.3732C103.392 93.3263 103.424 93.2537 103.424 93.1554C103.424 93.0636 103.394 92.9904 103.333 92.9357C103.298 92.9044 103.258 92.8823 103.211 92.8693L103.211 92.6964C103.25 92.701 103.293 92.7163 103.34 92.7423C103.387 92.7677 103.426 92.7964 103.456 92.8283C103.508 92.8816 103.543 92.9477 103.561 93.0265C103.571 93.0688 103.577 93.1167 103.577 93.1701C103.577 93.3003 103.529 93.4106 103.435 93.5011C103.34 93.5916 103.207 93.6368 103.037 93.6368C102.869 93.6368 102.732 93.5913 102.627 93.5001C102.523 93.409 102.47 93.2898 102.47 93.1427ZM102.933 92.8624C102.857 92.8696 102.796 92.8862 102.75 92.9122C102.666 92.9604 102.624 93.0408 102.624 93.1535C102.624 93.2342 102.653 93.3019 102.711 93.3566C102.769 93.4113 102.843 93.4402 102.933 93.4435L102.933 92.8624ZM103.211 92.3645C103.27 92.3593 103.315 92.3446 103.346 92.3205C103.403 92.2763 103.431 92.1994 103.431 92.0901C103.431 92.025 103.417 91.9677 103.389 91.9182C103.361 91.8687 103.317 91.844 103.257 91.844C103.212 91.844 103.178 91.8638 103.155 91.9035C103.14 91.9289 103.124 91.9791 103.105 92.0539L103.07 92.1936C103.048 92.2828 103.023 92.3485 102.996 92.3908C102.948 92.4664 102.882 92.5041 102.798 92.5041C102.699 92.5041 102.619 92.4686 102.558 92.3977C102.497 92.3261 102.466 92.23 102.466 92.1096C102.466 91.952 102.513 91.8384 102.605 91.7688C102.664 91.7252 102.727 91.704 102.794 91.7053L102.794 91.8713C102.755 91.8746 102.719 91.8886 102.686 91.9133C102.64 91.9537 102.617 92.0237 102.617 92.1233C102.617 92.1897 102.629 92.2401 102.655 92.2746C102.68 92.3085 102.714 92.3254 102.755 92.3254C102.801 92.3254 102.837 92.303 102.865 92.258C102.881 92.232 102.895 92.1936 102.908 92.1428L102.936 92.0266C102.967 91.9003 102.996 91.8157 103.025 91.7727C103.07 91.7043 103.14 91.6701 103.237 91.6701C103.33 91.6701 103.41 91.7056 103.478 91.7766C103.546 91.8469 103.58 91.9543 103.58 92.0989C103.58 92.2545 103.544 92.3648 103.474 92.4299C103.403 92.4944 103.316 92.5289 103.211 92.5334L103.211 92.3645ZM103.211 91.3685C103.27 91.3633 103.315 91.3486 103.346 91.3245C103.403 91.2803 103.431 91.2034 103.431 91.0941C103.431 91.029 103.417 90.9717 103.389 90.9222C103.361 90.8727 103.317 90.848 103.257 90.848C103.212 90.848 103.178 90.8678 103.155 90.9075C103.14 90.9329 103.124 90.9831 103.105 91.0579L103.07 91.1976C103.048 91.2868 103.023 91.3525 102.996 91.3948C102.948 91.4704 102.882 91.5081 102.798 91.5081C102.699 91.5081 102.619 91.4726 102.558 91.4017C102.497 91.3301 102.466 91.234 102.466 91.1136C102.466 90.956 102.513 90.8424 102.605 90.7728C102.664 90.7292 102.727 90.708 102.794 90.7093L102.794 90.8753C102.755 90.8786 102.719 90.8926 102.686 90.9173C102.64 90.9577 102.617 91.0277 102.617 91.1273C102.617 91.1937 102.629 91.2441 102.655 91.2786C102.68 91.3125 102.714 91.3294 102.755 91.3294C102.801 91.3294 102.837 91.307 102.865 91.262C102.881 91.236 102.895 91.1976 102.908 91.1468L102.936 91.0306C102.967 90.9043 102.996 90.8197 103.025 90.7767C103.07 90.7083 103.14 90.6741 103.237 90.6741C103.33 90.6741 103.41 90.7096 103.478 90.7806C103.546 90.8509 103.58 90.9583 103.58 91.1029C103.58 91.2585 103.544 91.3688 103.474 91.4339C103.403 91.4984 103.316 91.5329 103.211 91.5374L103.211 91.3685ZM102.499 90.477L102.499 90.2983L103.54 90.2983L103.54 90.477L102.499 90.477ZM102.105 90.477L102.105 90.2983L102.304 90.2983L102.304 90.477L102.105 90.477ZM103.426 89.6206C103.426 89.5041 103.382 89.4243 103.294 89.3814C103.206 89.3377 103.108 89.3159 103 89.3159C102.902 89.3159 102.822 89.3316 102.761 89.3628C102.665 89.4123 102.617 89.4976 102.617 89.6187C102.617 89.7261 102.658 89.8042 102.74 89.853C102.822 89.9019 102.921 89.9263 103.037 89.9263C103.148 89.9263 103.241 89.9019 103.315 89.853C103.389 89.8042 103.426 89.7267 103.426 89.6206ZM102.463 89.6138C102.463 89.479 102.508 89.3651 102.598 89.272C102.688 89.1789 102.82 89.1323 102.995 89.1323C103.163 89.1323 103.303 89.1734 103.413 89.2554C103.523 89.3374 103.578 89.4647 103.578 89.6372C103.578 89.7811 103.529 89.8954 103.432 89.98C103.334 90.0646 103.204 90.107 103.04 90.107C102.864 90.107 102.724 90.0624 102.62 89.9732C102.515 89.884 102.463 89.7642 102.463 89.6138ZM102.494 88.9264L102.494 88.7594L102.642 88.7594C102.581 88.7099 102.537 88.6575 102.51 88.6022C102.484 88.5468 102.47 88.4853 102.47 88.4176C102.47 88.2692 102.522 88.1689 102.625 88.1168C102.682 88.0882 102.763 88.0738 102.869 88.0738L103.54 88.0738L103.54 88.2526L102.88 88.2526C102.817 88.2526 102.765 88.262 102.726 88.2809C102.661 88.3121 102.628 88.3688 102.628 88.4508C102.628 88.4925 102.633 88.5266 102.641 88.5533C102.655 88.6015 102.684 88.6438 102.727 88.6803C102.762 88.7096 102.797 88.7288 102.834 88.7379C102.871 88.7464 102.923 88.7506 102.992 88.7506L103.54 88.7506L103.54 88.9264L102.494 88.9264ZM103.211 87.7126C103.27 87.7074 103.315 87.6928 103.346 87.6687C103.403 87.6244 103.431 87.5476 103.431 87.4382C103.431 87.3731 103.417 87.3158 103.389 87.2663C103.361 87.2168 103.317 87.1921 103.257 87.1921C103.212 87.1921 103.178 87.212 103.155 87.2517C103.14 87.2771 103.124 87.3272 103.105 87.4021L103.07 87.5417C103.048 87.6309 103.023 87.6967 102.996 87.739C102.948 87.8145 102.882 87.8523 102.798 87.8523C102.699 87.8523 102.619 87.8168 102.558 87.7458C102.497 87.6742 102.466 87.5782 102.466 87.4577C102.466 87.3002 102.513 87.1866 102.605 87.1169C102.664 87.0733 102.727 87.0521 102.794 87.0534L102.794 87.2194C102.755 87.2227 102.719 87.2367 102.686 87.2614C102.64 87.3018 102.617 87.3718 102.617 87.4714C102.617 87.5378 102.629 87.5883 102.655 87.6228C102.68 87.6566 102.714 87.6735 102.755 87.6735C102.801 87.6735 102.837 87.6511 102.865 87.6062C102.881 87.5801 102.895 87.5417 102.908 87.4909L102.936 87.3747C102.967 87.2484 102.996 87.1638 103.025 87.1208C103.07 87.0525 103.14 87.0183 103.237 87.0183C103.33 87.0183 103.41 87.0538 103.478 87.1247C103.546 87.195 103.58 87.3025 103.58 87.447C103.58 87.6026 103.544 87.7129 103.474 87.778C103.403 87.8425 103.316 87.877 103.211 87.8816L103.211 87.7126Z" fill="black"></path><g filter="url(#filter1_d_2413_17199)"><rect x="143.931" y="57" width="43.2361" height="42.3677" rx="0.61821" fill="white"></rect><path d="M146.536 60.1869H146.786L147.155 61.2741L147.522 60.1869H147.769V61.4728H147.603V60.7139C147.603 60.6876 147.604 60.6441 147.605 60.5834C147.606 60.5227 147.607 60.4577 147.607 60.3882L147.24 61.4728H147.067L146.698 60.3882V60.4276C146.698 60.4591 146.699 60.5073 146.7 60.5721C146.702 60.6363 146.702 60.6835 146.702 60.7139V61.4728H146.536V60.1869ZM148.13 61.2234C148.13 61.2689 148.147 61.3048 148.18 61.331C148.213 61.3573 148.253 61.3704 148.298 61.3704C148.354 61.3704 148.407 61.3576 148.459 61.3319C148.547 61.2893 148.591 61.2196 148.591 61.1227V60.9957C148.571 61.008 148.547 61.0182 148.516 61.0264C148.486 61.0346 148.456 61.0404 148.427 61.0439L148.331 61.0562C148.274 61.0637 148.231 61.0757 148.203 61.092C148.154 61.1195 148.13 61.1632 148.13 61.2234ZM148.512 60.9047C148.548 60.9 148.572 60.8849 148.584 60.8592C148.591 60.8452 148.595 60.825 148.595 60.7988C148.595 60.7451 148.576 60.7063 148.537 60.6824C148.499 60.6578 148.445 60.6456 148.373 60.6456C148.291 60.6456 148.233 60.6678 148.198 60.7121C148.179 60.7366 148.167 60.7731 148.161 60.8215H148.014C148.017 60.706 148.054 60.6257 148.126 60.5808C148.198 60.5353 148.282 60.5125 148.377 60.5125C148.487 60.5125 148.577 60.5335 148.646 60.5756C148.714 60.6176 148.748 60.6829 148.748 60.7716V61.3118C148.748 61.3281 148.751 61.3412 148.758 61.3512C148.765 61.3611 148.779 61.366 148.801 61.366C148.808 61.366 148.816 61.3657 148.824 61.3652C148.833 61.364 148.842 61.3625 148.852 61.3608V61.4772C148.828 61.4842 148.809 61.4886 148.796 61.4903C148.783 61.4921 148.766 61.493 148.744 61.493C148.69 61.493 148.65 61.4737 148.626 61.4352C148.613 61.4148 148.604 61.3859 148.598 61.3485C148.566 61.3906 148.52 61.427 148.46 61.458C148.4 61.4889 148.334 61.5044 148.261 61.5044C148.174 61.5044 148.103 61.4781 148.048 61.4256C147.993 61.3725 147.966 61.3062 147.966 61.2269C147.966 61.1399 147.993 61.0725 148.047 61.0246C148.101 60.9768 148.172 60.9473 148.261 60.9362L148.512 60.9047ZM149.589 60.5353H149.764C149.741 60.5954 149.692 60.7325 149.616 60.9467C149.558 61.1078 149.511 61.2391 149.472 61.3407C149.381 61.5799 149.317 61.7258 149.279 61.7784C149.242 61.8309 149.178 61.8571 149.087 61.8571C149.065 61.8571 149.047 61.8563 149.035 61.8545C149.024 61.8528 149.009 61.8496 148.991 61.8449V61.7013C149.019 61.7089 149.039 61.7136 149.051 61.7153C149.063 61.7171 149.074 61.718 149.083 61.718C149.113 61.718 149.134 61.713 149.147 61.7031C149.161 61.6937 149.173 61.6821 149.182 61.6681C149.185 61.6634 149.196 61.6395 149.214 61.5963C149.232 61.5531 149.245 61.521 149.253 61.5L148.907 60.5353H149.085L149.336 61.2986L149.589 60.5353ZM150.332 61.4728C150.338 61.3649 150.36 61.2709 150.399 61.191C150.438 61.111 150.514 61.0384 150.627 60.973L150.795 60.8758C150.87 60.832 150.923 60.7947 150.953 60.7638C151.001 60.7153 151.025 60.6599 151.025 60.5974C151.025 60.5245 151.003 60.4667 150.959 60.4241C150.915 60.3809 150.857 60.3593 150.784 60.3593C150.676 60.3593 150.601 60.4002 150.56 60.4819C150.538 60.5257 150.526 60.5864 150.523 60.664H150.363C150.365 60.5548 150.385 60.4658 150.423 60.397C150.492 60.2756 150.612 60.2149 150.785 60.2149C150.929 60.2149 151.033 60.2537 151.099 60.3313C151.166 60.4089 151.199 60.4953 151.199 60.5904C151.199 60.6908 151.164 60.7766 151.093 60.8478C151.052 60.8892 150.979 60.9394 150.873 60.9984L150.753 61.0649C150.696 61.0964 150.651 61.1265 150.619 61.1551C150.56 61.2058 150.523 61.2622 150.508 61.324H151.193V61.4728H150.332ZM151.492 61.1533C151.503 61.2432 151.544 61.3053 151.617 61.3398C151.655 61.3573 151.698 61.366 151.747 61.366C151.84 61.366 151.909 61.3363 151.954 61.2768C151.999 61.2172 152.022 61.1513 152.022 61.0789C152.022 60.9914 151.995 60.9237 151.941 60.8758C151.888 60.828 151.824 60.804 151.75 60.804C151.695 60.804 151.649 60.8145 151.609 60.8356C151.571 60.8566 151.538 60.8857 151.511 60.9231L151.374 60.9152L151.469 60.2403H152.121V60.3926H151.588L151.534 60.741C151.563 60.7188 151.591 60.7022 151.617 60.6911C151.664 60.6719 151.718 60.6622 151.779 60.6622C151.894 60.6622 151.992 60.6993 152.072 60.7734C152.152 60.8475 152.192 60.9415 152.192 61.0553C152.192 61.1737 152.155 61.2782 152.081 61.3687C152.008 61.4591 151.892 61.5044 151.731 61.5044C151.629 61.5044 151.539 61.4758 151.46 61.4186C151.382 61.3608 151.338 61.2724 151.328 61.1533H151.492ZM152.414 61.6558C152.454 61.6488 152.482 61.6205 152.499 61.5709C152.508 61.5446 152.512 61.5192 152.512 61.4947C152.512 61.4906 152.512 61.4868 152.511 61.4833C152.511 61.4804 152.51 61.4769 152.509 61.4728H152.414V61.282H152.601V61.4588C152.601 61.5283 152.587 61.5893 152.559 61.6418C152.531 61.6943 152.483 61.7267 152.414 61.739V61.6558ZM153.312 61.4728C153.318 61.3649 153.34 61.2709 153.378 61.191C153.418 61.111 153.493 61.0384 153.606 60.973L153.774 60.8758C153.849 60.832 153.902 60.7947 153.933 60.7638C153.98 60.7153 154.004 60.6599 154.004 60.5974C154.004 60.5245 153.982 60.4667 153.939 60.4241C153.895 60.3809 153.837 60.3593 153.764 60.3593C153.656 60.3593 153.581 60.4002 153.539 60.4819C153.517 60.5257 153.505 60.5864 153.503 60.664H153.343C153.344 60.5548 153.364 60.4658 153.403 60.397C153.471 60.2756 153.592 60.2149 153.764 60.2149C153.908 60.2149 154.013 60.2537 154.079 60.3313C154.145 60.4089 154.179 60.4953 154.179 60.5904C154.179 60.6908 154.143 60.7766 154.073 60.8478C154.032 60.8892 153.959 60.9394 153.853 60.9984L153.733 61.0649C153.676 61.0964 153.631 61.1265 153.598 61.1551C153.54 61.2058 153.503 61.2622 153.488 61.324H154.172V61.4728H153.312ZM154.735 60.2193C154.897 60.2193 155.015 60.2861 155.087 60.4197C155.143 60.523 155.171 60.6646 155.171 60.8443C155.171 61.0147 155.146 61.1557 155.095 61.2671C155.021 61.427 154.901 61.507 154.734 61.507C154.584 61.507 154.472 61.4416 154.398 61.3109C154.337 61.2018 154.306 61.0553 154.306 60.8714C154.306 60.729 154.325 60.6068 154.361 60.5047C154.43 60.3144 154.555 60.2193 154.735 60.2193ZM154.733 61.3634C154.815 61.3634 154.88 61.3272 154.929 61.2549C154.977 61.1825 155.001 61.0477 155.001 60.8504C155.001 60.708 154.984 60.591 154.949 60.4994C154.914 60.4072 154.846 60.3611 154.745 60.3611C154.652 60.3611 154.584 60.4049 154.541 60.4924C154.498 60.5794 154.477 60.7077 154.477 60.8776C154.477 61.0054 154.491 61.1081 154.518 61.1857C154.56 61.3042 154.632 61.3634 154.733 61.3634ZM155.301 61.4728C155.306 61.3649 155.329 61.2709 155.367 61.191C155.406 61.111 155.482 61.0384 155.595 60.973L155.763 60.8758C155.838 60.832 155.891 60.7947 155.921 60.7638C155.969 60.7153 155.993 60.6599 155.993 60.5974C155.993 60.5245 155.971 60.4667 155.927 60.4241C155.884 60.3809 155.825 60.3593 155.752 60.3593C155.644 60.3593 155.57 60.4002 155.528 60.4819C155.506 60.5257 155.494 60.5864 155.491 60.664H155.331C155.333 60.5548 155.353 60.4658 155.392 60.397C155.46 60.2756 155.58 60.2149 155.753 60.2149C155.897 60.2149 156.002 60.2537 156.067 60.3313C156.134 60.4089 156.167 60.4953 156.167 60.5904C156.167 60.6908 156.132 60.7766 156.061 60.8478C156.02 60.8892 155.947 60.9394 155.842 60.9984L155.722 61.0649C155.664 61.0964 155.62 61.1265 155.587 61.1551C155.529 61.2058 155.492 61.2622 155.477 61.324H156.161V61.4728H155.301ZM156.705 61.507C156.556 61.507 156.449 61.4664 156.382 61.3853C156.315 61.3036 156.282 61.2044 156.282 61.0877H156.446C156.453 61.1688 156.469 61.2277 156.492 61.2645C156.533 61.3304 156.607 61.3634 156.713 61.3634C156.796 61.3634 156.863 61.3412 156.913 61.2969C156.963 61.2525 156.988 61.1953 156.988 61.1253C156.988 61.0389 156.962 60.9785 156.909 60.9441C156.856 60.9097 156.783 60.8925 156.689 60.8925C156.678 60.8925 156.668 60.8927 156.657 60.8933C156.646 60.8933 156.635 60.8936 156.624 60.8942V60.755C156.64 60.7568 156.654 60.7579 156.665 60.7585C156.676 60.7591 156.688 60.7594 156.701 60.7594C156.76 60.7594 156.809 60.7501 156.846 60.7314C156.913 60.6987 156.946 60.6403 156.946 60.5563C156.946 60.4939 156.924 60.4457 156.88 60.4119C156.835 60.378 156.784 60.3611 156.725 60.3611C156.62 60.3611 156.547 60.3961 156.507 60.4661C156.485 60.5047 156.472 60.5595 156.469 60.6307H156.313C156.313 60.5373 156.332 60.458 156.369 60.3926C156.434 60.2759 156.547 60.2175 156.708 60.2175C156.836 60.2175 156.935 60.2461 157.005 60.3033C157.075 60.3599 157.11 60.4422 157.11 60.5502C157.11 60.6272 157.089 60.6897 157.048 60.7375C157.022 60.7673 156.989 60.7906 156.948 60.8075C157.014 60.8256 157.065 60.8606 157.102 60.9126C157.139 60.9639 157.158 61.027 157.158 61.1017C157.158 61.2213 157.119 61.3188 157.04 61.3941C156.961 61.4693 156.849 61.507 156.705 61.507Z" fill="black"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M147.969 66.0101C148.586 66.0101 149.086 65.5097 149.086 64.8923C149.086 64.275 148.586 63.7746 147.969 63.7746C147.351 63.7746 146.851 64.275 146.851 64.8923C146.851 65.5097 147.351 66.0101 147.969 66.0101ZM147.791 64.1837C147.776 64.1606 147.748 64.1498 147.722 64.1589C147.693 64.1693 147.664 64.1814 147.636 64.1953C147.612 64.2076 147.599 64.2355 147.605 64.2627L147.624 64.3597C147.629 64.3847 147.619 64.41 147.599 64.4261C147.569 64.4515 147.54 64.4803 147.515 64.5121C147.5 64.5319 147.475 64.5424 147.45 64.5374L147.355 64.5182C147.328 64.5128 147.301 64.5255 147.289 64.5505C147.283 64.5646 147.276 64.579 147.27 64.5937C147.264 64.6084 147.259 64.6232 147.254 64.6381C147.245 64.6643 147.256 64.6929 147.278 64.7083L147.359 64.763C147.38 64.7771 147.39 64.8024 147.388 64.8277C147.384 64.8685 147.384 64.9092 147.388 64.9492C147.391 64.9746 147.38 64.9999 147.36 65.014L147.279 65.0691C147.256 65.0845 147.246 65.1131 147.255 65.1394C147.265 65.1693 147.277 65.1985 147.29 65.2269C147.302 65.2518 147.33 65.2644 147.356 65.2589L147.451 65.2393C147.476 65.2343 147.501 65.2447 147.517 65.2644C147.541 65.2956 147.57 65.3244 147.601 65.3502C147.62 65.3662 147.631 65.3915 147.626 65.4165L147.607 65.5135C147.602 65.5408 147.614 65.5687 147.638 65.5808C147.652 65.5876 147.666 65.5941 147.681 65.6002C147.695 65.6062 147.71 65.6118 147.724 65.6169C147.767 65.6318 147.826 65.5784 147.87 65.539C147.892 65.5196 147.906 65.4921 147.906 65.4626C147.906 65.4624 147.906 65.4623 147.906 65.4621L147.906 65.2999C147.906 65.2982 147.906 65.2965 147.906 65.2948C147.776 65.263 147.679 65.1436 147.679 65.0011V64.8289C147.679 64.8158 147.69 64.8051 147.702 64.8051H147.783V64.6356C147.783 64.6122 147.802 64.5933 147.824 64.5933C147.847 64.5933 147.866 64.6122 147.866 64.6356V64.8051H148.084V64.6356C148.084 64.6122 148.103 64.5933 148.126 64.5933C148.148 64.5933 148.167 64.6122 148.167 64.6356V64.8051H148.248C148.26 64.8051 148.271 64.8158 148.271 64.8289V65.0011C148.271 65.1481 148.168 65.2706 148.032 65.2975C148.032 65.2983 148.032 65.2991 148.032 65.2999L148.032 65.4614C148.032 65.4915 148.045 65.5195 148.068 65.539C148.113 65.5781 148.173 65.6309 148.216 65.616C148.245 65.6056 148.274 65.5935 148.301 65.5796C148.326 65.5673 148.338 65.5394 148.333 65.5122L148.314 65.4152C148.309 65.3902 148.319 65.3649 148.338 65.3488C148.369 65.3234 148.397 65.2946 148.422 65.2628C148.438 65.243 148.463 65.2325 148.487 65.2375L148.582 65.2567C148.609 65.2621 148.636 65.2494 148.648 65.2244C148.655 65.2103 148.661 65.1959 148.667 65.1812C148.673 65.1665 148.679 65.1517 148.684 65.1369C148.692 65.1106 148.682 65.082 148.659 65.0666L148.578 65.0119C148.558 64.9978 148.547 64.9725 148.55 64.9472C148.554 64.9064 148.554 64.8657 148.549 64.8257C148.547 64.8004 148.557 64.775 148.578 64.7609L148.658 64.7058C148.681 64.6904 148.692 64.6618 148.683 64.6355C148.673 64.6056 148.661 64.5764 148.647 64.548C148.635 64.5231 148.608 64.5105 148.581 64.516L148.486 64.5356C148.461 64.5406 148.437 64.5302 148.421 64.5105C148.396 64.4793 148.368 64.4505 148.337 64.4247C148.317 64.4087 148.307 64.3834 148.312 64.3584L148.331 64.2614C148.336 64.2341 148.323 64.2062 148.299 64.1941C148.285 64.1873 148.271 64.1808 148.257 64.1748C148.242 64.1687 148.228 64.1631 148.213 64.158C148.187 64.149 148.159 64.1599 148.144 64.183L148.091 64.2654C148.077 64.2866 148.052 64.2972 148.027 64.2946C147.987 64.2905 147.947 64.2907 147.908 64.2949C147.883 64.2975 147.859 64.2871 147.845 64.2659L147.791 64.1837Z" fill="#005AE0"></path><rect x="146.46" y="63.3833" width="3.01792" height="3.01792" rx="1.50896" stroke="#DCDDE1" stroke-width="0.111775"></rect><path d="M151.472 65.1402H150.933L150.832 65.4409H150.512L151.035 63.9779H151.38L151.898 65.4409H151.567L151.472 65.1402ZM151.387 64.8881L151.204 64.3124L151.016 64.8881H151.387ZM152.057 63.9779H152.361V65.4409H152.057V63.9779ZM153.289 65.4816C153.08 65.4816 152.921 65.4247 152.81 65.3109C152.662 65.1713 152.588 64.9701 152.588 64.7074C152.588 64.4394 152.662 64.2383 152.81 64.1039C152.921 63.9901 153.08 63.9332 153.289 63.9332C153.499 63.9332 153.658 63.9901 153.769 64.1039C153.916 64.2383 153.99 64.4394 153.99 64.7074C153.99 64.9701 153.916 65.1713 153.769 65.3109C153.658 65.4247 153.499 65.4816 153.289 65.4816ZM153.578 65.0886C153.649 64.9992 153.685 64.8722 153.685 64.7074C153.685 64.5433 153.649 64.4166 153.577 64.3273C153.506 64.2373 153.411 64.1923 153.289 64.1923C153.168 64.1923 153.072 64.2369 153 64.3263C152.927 64.4156 152.891 64.5426 152.891 64.7074C152.891 64.8722 152.927 64.9992 153 65.0886C153.072 65.1779 153.168 65.2226 153.289 65.2226C153.411 65.2226 153.507 65.1779 153.578 65.0886ZM154.751 65.2295C154.824 65.2295 154.882 65.2216 154.927 65.2057C155.012 65.1752 155.055 65.1187 155.055 65.0359C155.055 64.9876 155.034 64.9503 154.992 64.9238C154.949 64.898 154.883 64.8752 154.792 64.8553L154.637 64.8206C154.485 64.7862 154.38 64.7488 154.322 64.7084C154.223 64.6409 154.174 64.5354 154.174 64.3918C154.174 64.2607 154.221 64.1519 154.317 64.0652C154.412 63.9785 154.552 63.9352 154.737 63.9352C154.891 63.9352 155.022 63.9762 155.131 64.0583C155.24 64.1397 155.297 64.2581 155.302 64.4136H155.008C155.003 64.3256 154.965 64.2631 154.893 64.226C154.846 64.2015 154.786 64.1893 154.716 64.1893C154.637 64.1893 154.574 64.2052 154.527 64.2369C154.48 64.2687 154.457 64.313 154.457 64.3699C154.457 64.4222 154.48 64.4612 154.526 64.4871C154.556 64.5043 154.619 64.5244 154.717 64.5476L154.969 64.6081C155.079 64.6346 155.163 64.67 155.219 64.7144C155.306 64.7832 155.35 64.8828 155.35 65.0131C155.35 65.1468 155.299 65.258 155.196 65.3466C155.094 65.4346 154.95 65.4786 154.763 65.4786C154.573 65.4786 154.423 65.4353 154.314 65.3486C154.205 65.2613 154.15 65.1415 154.15 64.9893H154.442C154.451 65.0561 154.469 65.1061 154.496 65.1392C154.546 65.1994 154.631 65.2295 154.751 65.2295ZM156.591 64.8017H155.88V65.1779H156.69V65.4409H155.581V63.9779H156.654V64.2369H155.88V64.5476H156.591V64.8017ZM157.571 65.4816C157.362 65.4816 157.202 65.4247 157.092 65.3109C156.943 65.1713 156.869 64.9701 156.869 64.7074C156.869 64.4394 156.943 64.2383 157.092 64.1039C157.202 63.9901 157.362 63.9332 157.571 63.9332C157.78 63.9332 157.94 63.9901 158.051 64.1039C158.198 64.2383 158.272 64.4394 158.272 64.7074C158.272 64.9701 158.198 65.1713 158.051 65.3109C157.94 65.4247 157.78 65.4816 157.571 65.4816ZM157.86 65.0886C157.931 64.9992 157.966 64.8722 157.966 64.7074C157.966 64.5433 157.93 64.4166 157.859 64.3273C157.788 64.2373 157.692 64.1923 157.571 64.1923C157.45 64.1923 157.353 64.2369 157.281 64.3263C157.209 64.4156 157.173 64.5426 157.173 64.7074C157.173 64.8722 157.209 64.9992 157.281 65.0886C157.353 65.1779 157.45 65.2226 157.571 65.2226C157.692 65.2226 157.789 65.1779 157.86 65.0886ZM159.685 64.8672H159.369V65.4409H159.071V63.9779H159.788C159.891 63.9799 159.97 63.9924 160.025 64.0156C160.08 64.0387 160.127 64.0728 160.166 64.1178C160.197 64.1549 160.222 64.1959 160.241 64.2409C160.259 64.2859 160.269 64.3372 160.269 64.3947C160.269 64.4642 160.251 64.5327 160.216 64.6002C160.181 64.667 160.123 64.7144 160.042 64.7421C160.11 64.7693 160.158 64.808 160.185 64.8583C160.214 64.9079 160.228 64.984 160.228 65.0866V65.1848C160.228 65.2517 160.231 65.297 160.236 65.3208C160.244 65.3585 160.262 65.3863 160.292 65.4042V65.4409H159.955C159.946 65.4085 159.939 65.3824 159.935 65.3625C159.927 65.3215 159.923 65.2795 159.922 65.2364L159.92 65.1005C159.919 65.0072 159.902 64.945 159.869 64.9139C159.836 64.8828 159.775 64.8672 159.685 64.8672ZM159.871 64.6012C159.932 64.5734 159.962 64.5185 159.962 64.4364C159.962 64.3478 159.933 64.2882 159.874 64.2578C159.841 64.2406 159.791 64.232 159.725 64.232H159.369V64.625H159.716C159.785 64.625 159.836 64.6171 159.871 64.6012ZM161.432 65.1233C161.425 65.1875 161.391 65.2527 161.332 65.3188C161.239 65.424 161.109 65.4767 160.943 65.4767C160.805 65.4767 160.684 65.4323 160.578 65.3436C160.473 65.255 160.421 65.1107 160.421 64.9109C160.421 64.7236 160.468 64.58 160.562 64.4801C160.658 64.3802 160.781 64.3302 160.933 64.3302C161.023 64.3302 161.104 64.3471 161.176 64.3809C161.248 64.4146 161.308 64.4679 161.355 64.5407C161.397 64.6048 161.424 64.6793 161.437 64.764C161.444 64.8136 161.447 64.8851 161.446 64.9784H160.705C160.709 65.0869 160.743 65.163 160.808 65.2067C160.847 65.2338 160.894 65.2474 160.949 65.2474C161.007 65.2474 161.054 65.2308 161.091 65.1977C161.11 65.1799 161.128 65.1551 161.143 65.1233H161.432ZM161.152 64.7918C161.147 64.717 161.125 64.6604 161.084 64.622C161.043 64.583 160.993 64.5635 160.933 64.5635C160.867 64.5635 160.816 64.584 160.78 64.625C160.744 64.666 160.722 64.7216 160.712 64.7918H161.152ZM161.527 64.359H161.845L162.07 65.157L162.3 64.359H162.604L162.214 65.4409H161.915L161.527 64.359ZM163.052 64.359V65.4409H162.765V64.359H163.052ZM163.052 63.9689V64.23H162.765V63.9689H163.052ZM164.068 64.4086C164.153 64.4629 164.201 64.5562 164.214 64.6885H163.931C163.927 64.6522 163.917 64.6234 163.9 64.6022C163.869 64.5638 163.816 64.5446 163.741 64.5446C163.68 64.5446 163.636 64.5542 163.609 64.5734C163.584 64.5926 163.571 64.6151 163.571 64.6409C163.571 64.6733 163.585 64.6968 163.612 64.7114C163.64 64.7266 163.738 64.7527 163.907 64.7898C164.02 64.8163 164.104 64.8563 164.16 64.9099C164.216 64.9642 164.244 65.032 164.244 65.1134C164.244 65.2206 164.204 65.3082 164.124 65.3764C164.044 65.4439 163.921 65.4776 163.754 65.4776C163.584 65.4776 163.458 65.4419 163.377 65.3704C163.296 65.2983 163.256 65.2067 163.256 65.0955H163.543C163.549 65.1458 163.562 65.1815 163.582 65.2027C163.617 65.2404 163.681 65.2593 163.776 65.2593C163.832 65.2593 163.876 65.251 163.908 65.2345C163.941 65.2179 163.958 65.1931 163.958 65.16C163.958 65.1283 163.945 65.1041 163.918 65.0876C163.892 65.071 163.793 65.0426 163.623 65.0022C163.501 64.9718 163.414 64.9337 163.364 64.8881C163.314 64.8431 163.289 64.7782 163.289 64.6935C163.289 64.5936 163.328 64.5079 163.406 64.4364C163.485 64.3643 163.595 64.3282 163.737 64.3282C163.872 64.3282 163.983 64.355 164.068 64.4086ZM164.741 64.359V65.4409H164.454V64.359H164.741ZM164.741 63.9689V64.23H164.454V63.9689H164.741ZM165.914 64.496C166.005 64.6105 166.051 64.7458 166.051 64.902C166.051 65.0608 166.005 65.1967 165.914 65.3099C165.823 65.4224 165.684 65.4786 165.498 65.4786C165.312 65.4786 165.173 65.4224 165.082 65.3099C164.991 65.1967 164.945 65.0608 164.945 64.902C164.945 64.7458 164.991 64.6105 165.082 64.496C165.173 64.3815 165.312 64.3243 165.498 64.3243C165.684 64.3243 165.823 64.3815 165.914 64.496ZM165.497 64.5635C165.414 64.5635 165.35 64.5929 165.305 64.6518C165.261 64.7101 165.239 64.7934 165.239 64.902C165.239 65.0105 165.261 65.0942 165.305 65.1531C165.35 65.212 165.414 65.2414 165.497 65.2414C165.58 65.2414 165.643 65.212 165.688 65.1531C165.732 65.0942 165.754 65.0105 165.754 64.902C165.754 64.7934 165.732 64.7101 165.688 64.6518C165.643 64.5929 165.58 64.5635 165.497 64.5635ZM166.76 64.5684C166.664 64.5684 166.598 64.6091 166.562 64.6905C166.543 64.7335 166.534 64.7885 166.534 64.8553V65.4409H166.252V64.361H166.525V64.5188C166.562 64.4632 166.596 64.4232 166.628 64.3987C166.687 64.355 166.761 64.3332 166.85 64.3332C166.962 64.3332 167.053 64.3627 167.124 64.4215C167.195 64.4798 167.231 64.5767 167.231 64.7124V65.4409H166.941V64.7828C166.941 64.7259 166.934 64.6823 166.918 64.6518C166.891 64.5962 166.838 64.5684 166.76 64.5684ZM168.234 64.4086C168.319 64.4629 168.368 64.5562 168.38 64.6885H168.097C168.093 64.6522 168.083 64.6234 168.067 64.6022C168.036 64.5638 167.983 64.5446 167.908 64.5446C167.846 64.5446 167.802 64.5542 167.776 64.5734C167.75 64.5926 167.737 64.6151 167.737 64.6409C167.737 64.6733 167.751 64.6968 167.779 64.7114C167.807 64.7266 167.905 64.7527 168.074 64.7898C168.186 64.8163 168.27 64.8563 168.327 64.9099C168.382 64.9642 168.41 65.032 168.41 65.1134C168.41 65.2206 168.37 65.3082 168.29 65.3764C168.211 65.4439 168.087 65.4776 167.921 65.4776C167.751 65.4776 167.625 65.4419 167.544 65.3704C167.463 65.2983 167.422 65.2067 167.422 65.0955H167.709C167.715 65.1458 167.728 65.1815 167.748 65.2027C167.783 65.2404 167.848 65.2593 167.943 65.2593C167.998 65.2593 168.042 65.251 168.075 65.2345C168.108 65.2179 168.124 65.1931 168.124 65.16C168.124 65.1283 168.111 65.1041 168.085 65.0876C168.058 65.071 167.96 65.0426 167.79 65.0022C167.667 64.9718 167.581 64.9337 167.531 64.8881C167.48 64.8431 167.455 64.7782 167.455 64.6935C167.455 64.5936 167.494 64.5079 167.572 64.4364C167.651 64.3643 167.762 64.3282 167.904 64.3282C168.039 64.3282 168.149 64.355 168.234 64.4086Z" fill="black"></path><rect x="146.404" y="68.93" width="38.2904" height="1.85463" rx="0.927315" fill="#D9D9D9"></rect><rect x="146.404" y="71.7119" width="21.5799" height="1.85463" rx="0.927315" fill="#D9D9D9"></rect><rect x="146.404" y="76.0394" width="37.1313" height="1.39097" rx="0.695487" fill="#D9D9D9"></rect><rect x="146.404" y="78.6668" width="30.4855" height="1.39097" rx="0.695487" fill="#D9D9D9"></rect><rect x="146.404" y="81.2942" width="32.1856" height="1.39097" rx="0.695487" fill="#D9D9D9"></rect><rect x="146.404" y="83.9216" width="32.9197" height="1.39097" rx="0.695487" fill="#D9D9D9"></rect><rect x="146.404" y="86.549" width="32.9197" height="1.39097" rx="0.695487" fill="#D9D9D9"></rect><rect x="146.404" y="89.1765" width="37.3631" height="1.39097" rx="0.695487" fill="#D9D9D9"></rect><rect x="146.404" y="93.0402" width="13.4728" height="3.85463" rx="0.309105" fill="#3258DC"></rect><path d="M147.672 93.9663H147.896L148.113 94.7264L148.333 93.9663H148.55L148.208 94.9675H148.011L147.672 93.9663ZM148.83 94.2272V94.9675H148.634V94.2272H148.83ZM148.83 93.9602V94.1389H148.634V93.9602H148.83ZM149.649 94.7501C149.644 94.794 149.622 94.8386 149.581 94.8839C149.517 94.9559 149.429 94.9919 149.315 94.9919C149.22 94.9919 149.137 94.9616 149.065 94.9009C148.993 94.8402 148.957 94.7415 148.957 94.6048C148.957 94.4766 148.99 94.3784 149.054 94.31C149.12 94.2416 149.204 94.2075 149.308 94.2075C149.369 94.2075 149.425 94.219 149.474 94.2421C149.524 94.2652 149.564 94.3016 149.596 94.3514C149.625 94.3954 149.644 94.4463 149.653 94.5043C149.658 94.5382 149.66 94.5871 149.659 94.651H149.152C149.155 94.7252 149.178 94.7773 149.222 94.8072C149.249 94.8257 149.281 94.835 149.319 94.835C149.358 94.835 149.391 94.8237 149.416 94.8011C149.429 94.7888 149.441 94.7719 149.452 94.7501H149.649ZM149.458 94.5233C149.455 94.4721 149.439 94.4334 149.411 94.4071C149.383 94.3804 149.349 94.3671 149.308 94.3671C149.263 94.3671 149.228 94.3811 149.203 94.4092C149.179 94.4373 149.163 94.4753 149.157 94.5233H149.458ZM150.349 94.9675L150.233 94.4282L150.115 94.9675H149.914L149.706 94.2272H149.914L150.03 94.7583L150.136 94.2272H150.333L150.445 94.7603L150.561 94.2272H150.763L150.548 94.9675H150.349ZM151.692 94.5749H151.476V94.9675H151.272V93.9663H151.763C151.833 93.9677 151.887 93.9763 151.924 93.9922C151.963 94.008 151.995 94.0313 152.021 94.0621C152.043 94.0875 152.06 94.1155 152.073 94.1463C152.085 94.1771 152.092 94.2122 152.092 94.2516C152.092 94.2991 152.08 94.346 152.056 94.3922C152.032 94.4379 151.992 94.4703 151.937 94.4893C151.983 94.5079 152.015 94.5344 152.035 94.5688C152.054 94.6027 152.064 94.6548 152.064 94.725V94.7922C152.064 94.838 152.066 94.869 152.069 94.8853C152.075 94.9111 152.087 94.9301 152.107 94.9423V94.9675H151.877C151.871 94.9453 151.866 94.9274 151.863 94.9138C151.858 94.8857 151.855 94.857 151.855 94.8276L151.853 94.7345C151.852 94.6707 151.84 94.6281 151.818 94.6068C151.796 94.5855 151.754 94.5749 151.692 94.5749ZM151.819 94.3929C151.861 94.3739 151.882 94.3363 151.882 94.2801C151.882 94.2195 151.862 94.1787 151.821 94.1579C151.799 94.1461 151.765 94.1402 151.719 94.1402H151.476V94.4092H151.713C151.76 94.4092 151.796 94.4037 151.819 94.3929ZM152.888 94.7501C152.883 94.794 152.86 94.8386 152.819 94.8839C152.756 94.9559 152.667 94.9919 152.553 94.9919C152.458 94.9919 152.375 94.9616 152.303 94.9009C152.231 94.8402 152.195 94.7415 152.195 94.6048C152.195 94.4766 152.228 94.3784 152.293 94.31C152.358 94.2416 152.442 94.2075 152.546 94.2075C152.607 94.2075 152.663 94.219 152.712 94.2421C152.762 94.2652 152.802 94.3016 152.835 94.3514C152.864 94.3954 152.882 94.4463 152.891 94.5043C152.896 94.5382 152.898 94.5871 152.897 94.651H152.39C152.393 94.7252 152.416 94.7773 152.46 94.8072C152.487 94.8257 152.519 94.835 152.557 94.835C152.597 94.835 152.629 94.8237 152.654 94.8011C152.667 94.7888 152.679 94.7719 152.69 94.7501H152.888ZM152.696 94.5233C152.693 94.4721 152.677 94.4334 152.649 94.4071C152.621 94.3804 152.587 94.3671 152.546 94.3671C152.501 94.3671 152.466 94.3811 152.441 94.4092C152.417 94.4373 152.401 94.4753 152.395 94.5233H152.696ZM152.953 94.2272H153.17L153.324 94.7732L153.482 94.2272H153.69L153.423 94.9675H153.218L152.953 94.2272ZM153.996 94.2272V94.9675H153.8V94.2272H153.996ZM153.996 93.9602V94.1389H153.8V93.9602H153.996ZM154.691 94.2611C154.749 94.2982 154.782 94.3621 154.791 94.4526H154.597C154.595 94.4277 154.588 94.408 154.576 94.3936C154.555 94.3673 154.519 94.3542 154.468 94.3542C154.426 94.3542 154.396 94.3607 154.377 94.3739C154.36 94.387 154.351 94.4024 154.351 94.42C154.351 94.4422 154.36 94.4583 154.379 94.4683C154.398 94.4787 154.466 94.4966 154.581 94.5219C154.658 94.54 154.716 94.5674 154.754 94.6041C154.792 94.6412 154.811 94.6876 154.811 94.7433C154.811 94.8167 154.784 94.8767 154.729 94.9233C154.675 94.9695 154.591 94.9926 154.477 94.9926C154.36 94.9926 154.274 94.9681 154.219 94.9192C154.163 94.8699 154.136 94.8072 154.136 94.7311H154.332C154.336 94.7655 154.345 94.79 154.358 94.8045C154.382 94.8303 154.427 94.8432 154.492 94.8432C154.53 94.8432 154.56 94.8375 154.582 94.8262C154.605 94.8149 154.616 94.7979 154.616 94.7753C154.616 94.7535 154.607 94.737 154.589 94.7257C154.571 94.7144 154.503 94.6949 154.387 94.6673C154.303 94.6464 154.244 94.6204 154.21 94.5892C154.175 94.5584 154.158 94.514 154.158 94.456C154.158 94.3877 154.185 94.329 154.238 94.2801C154.292 94.2308 154.368 94.2061 154.465 94.2061C154.557 94.2061 154.633 94.2244 154.691 94.2611ZM155.152 94.2272V94.9675H154.955V94.2272H155.152ZM155.152 93.9602V94.1389H154.955V93.9602H155.152ZM155.954 94.3209C156.017 94.3992 156.048 94.4918 156.048 94.5987C156.048 94.7073 156.017 94.8004 155.954 94.8778C155.892 94.9548 155.797 94.9933 155.67 94.9933C155.543 94.9933 155.448 94.9548 155.385 94.8778C155.323 94.8004 155.291 94.7073 155.291 94.5987C155.291 94.4918 155.323 94.3992 155.385 94.3209C155.448 94.2426 155.543 94.2034 155.67 94.2034C155.797 94.2034 155.892 94.2426 155.954 94.3209ZM155.669 94.3671C155.613 94.3671 155.569 94.3872 155.538 94.4275C155.508 94.4674 155.493 94.5244 155.493 94.5987C155.493 94.6729 155.508 94.7302 155.538 94.7705C155.569 94.8108 155.613 94.831 155.669 94.831C155.726 94.831 155.769 94.8108 155.8 94.7705C155.83 94.7302 155.845 94.6729 155.845 94.5987C155.845 94.5244 155.83 94.4674 155.8 94.4275C155.769 94.3872 155.726 94.3671 155.669 94.3671ZM156.533 94.3705C156.467 94.3705 156.422 94.3983 156.398 94.454C156.385 94.4834 156.379 94.521 156.379 94.5667V94.9675H156.186V94.2285H156.373V94.3365C156.398 94.2985 156.421 94.2711 156.443 94.2543C156.483 94.2244 156.534 94.2095 156.595 94.2095C156.671 94.2095 156.734 94.2296 156.782 94.2699C156.831 94.3098 156.856 94.3761 156.856 94.4689V94.9675H156.657V94.5172C156.657 94.4782 156.652 94.4483 156.642 94.4275C156.623 94.3895 156.586 94.3705 156.533 94.3705ZM157.542 94.2611C157.6 94.2982 157.633 94.3621 157.642 94.4526H157.448C157.446 94.4277 157.439 94.408 157.427 94.3936C157.406 94.3673 157.37 94.3542 157.319 94.3542C157.277 94.3542 157.247 94.3607 157.228 94.3739C157.211 94.387 157.202 94.4024 157.202 94.42C157.202 94.4422 157.211 94.4583 157.23 94.4683C157.249 94.4787 157.317 94.4966 157.432 94.5219C157.509 94.54 157.567 94.5674 157.605 94.6041C157.643 94.6412 157.662 94.6876 157.662 94.7433C157.662 94.8167 157.635 94.8767 157.58 94.9233C157.526 94.9695 157.442 94.9926 157.328 94.9926C157.211 94.9926 157.125 94.9681 157.069 94.9192C157.014 94.8699 156.987 94.8072 156.987 94.7311H157.183C157.187 94.7655 157.196 94.79 157.209 94.8045C157.233 94.8303 157.278 94.8432 157.343 94.8432C157.381 94.8432 157.411 94.8375 157.433 94.8262C157.455 94.8149 157.467 94.7979 157.467 94.7753C157.467 94.7535 157.458 94.737 157.44 94.7257C157.422 94.7144 157.354 94.6949 157.238 94.6673C157.154 94.6464 157.095 94.6204 157.061 94.5892C157.026 94.5584 157.009 94.514 157.009 94.456C157.009 94.3877 157.036 94.329 157.089 94.2801C157.143 94.2308 157.219 94.2061 157.316 94.2061C157.408 94.2061 157.484 94.2244 157.542 94.2611Z" fill="white"></path><rect x="144.042" y="57.1111" width="43.0139" height="42.1455" rx="0.507139" stroke="#DCDDE1" stroke-width="0.222143"></rect></g><g filter="url(#filter2_d_2413_17199)"><path d="M167.229 99.3677L165.573 101.023L163.869 99.3677L167.229 99.3677Z" fill="white"></path><path d="M165.572 100.867L164.143 99.4787L166.961 99.4787L165.572 100.867Z" stroke="#DCDDE1" stroke-width="0.222143"></path></g><path d="M167.785 98.5258L165.581 100.729L163.314 98.5258L167.785 98.5258Z" fill="white"></path></g></g><defs><filter id="filter0_dd_2413_17199" x="71.6055" y="-1.13766" width="216.789" height="160.365" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feMorphology radius="3.61795" operator="erode" in="SourceAlpha" result="effect1_dropShadow_2413_17199"></feMorphology><feOffset dy="9.04488"></feOffset><feGaussianBlur stdDeviation="14.4718"></feGaussianBlur><feColorMatrix type="matrix" values="0 0 0 0 0.0941176 0 0 0 0 0.152941 0 0 0 0 0.294118 0 0 0 0.1 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2413_17199"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feMorphology radius="5.42693" operator="erode" in="SourceAlpha" result="effect2_dropShadow_2413_17199"></feMorphology><feOffset dy="5.42693"></feOffset><feGaussianBlur stdDeviation="6.33142"></feGaussianBlur><feColorMatrix type="matrix" values="0 0 0 0 0.0941176 0 0 0 0 0.152941 0 0 0 0 0.294118 0 0 0 0.12 0"></feColorMatrix><feBlend mode="normal" in2="effect1_dropShadow_2413_17199" result="effect2_dropShadow_2413_17199"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_2413_17199" result="shape"></feBlend></filter><filter id="filter1_d_2413_17199" x="115.052" y="32.5642" width="100.993" height="100.125" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="4.44287"></feOffset><feGaussianBlur stdDeviation="14.4393"></feGaussianBlur><feColorMatrix type="matrix" values="0 0 0 0 0.172549 0 0 0 0 0.196078 0 0 0 0 0.298039 0 0 0 0.12 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2413_17199"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2413_17199" result="shape"></feBlend></filter><filter id="filter2_d_2413_17199" x="134.991" y="74.9319" width="61.1169" height="59.4131" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="4.44287"></feOffset><feGaussianBlur stdDeviation="14.4393"></feGaussianBlur><feColorMatrix type="matrix" values="0 0 0 0 0.172549 0 0 0 0 0.196078 0 0 0 0 0.298039 0 0 0 0.12 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2413_17199"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2413_17199" result="shape"></feBlend></filter><linearGradient id="paint0_linear_2413_17199" x1="47.0714" y1="70.5" x2="47.0714" y2="143" gradientUnits="userSpaceOnUse"><stop stop-color="#CCE0FF"></stop><stop offset="1" stop-color="#E5F0FF"></stop></linearGradient><linearGradient id="paint1_linear_2413_17199" x1="91.2143" y1="70.5" x2="91.2143" y2="143" gradientUnits="userSpaceOnUse"><stop stop-color="#CCE0FF"></stop><stop offset="1" stop-color="#E5F0FF"></stop></linearGradient><linearGradient id="paint2_linear_2413_17199" x1="135.357" y1="70.5" x2="135.357" y2="143" gradientUnits="userSpaceOnUse"><stop stop-color="#CCE0FF"></stop><stop offset="1" stop-color="#E5F0FF"></stop></linearGradient><linearGradient id="paint3_linear_2413_17199" x1="179.5" y1="70.5" x2="179.5" y2="143" gradientUnits="userSpaceOnUse"><stop stop-color="#CCE0FF"></stop><stop offset="1" stop-color="#E5F0FF"></stop></linearGradient><linearGradient id="paint4_linear_2413_17199" x1="223.643" y1="70.5" x2="223.643" y2="143" gradientUnits="userSpaceOnUse"><stop stop-color="#CCE0FF"></stop><stop offset="1" stop-color="#E5F0FF"></stop></linearGradient><linearGradient id="paint5_linear_2413_17199" x1="267.786" y1="70.5" x2="267.786" y2="143" gradientUnits="userSpaceOnUse"><stop stop-color="#CCE0FF"></stop><stop offset="1" stop-color="#E5F0FF"></stop></linearGradient><linearGradient id="paint6_linear_2413_17199" x1="311.929" y1="70.5" x2="311.929" y2="143" gradientUnits="userSpaceOnUse"><stop stop-color="#CCE0FF"></stop><stop offset="1" stop-color="#E5F0FF"></stop></linearGradient><linearGradient id="paint7_linear_2413_17199" x1="183.713" y1="92.5491" x2="183.713" y2="102.784" gradientUnits="userSpaceOnUse"><stop stop-color="#005AE0" stop-opacity="0.2"></stop><stop offset="1" stop-color="#005AE0" stop-opacity="0"></stop></linearGradient><linearGradient id="paint8_linear_2413_17199" x1="183.648" y1="73.8534" x2="183.648" y2="102.784" gradientUnits="userSpaceOnUse"><stop stop-color="#00AA63" stop-opacity="0.2"></stop><stop offset="1" stop-color="#00AA63" stop-opacity="0"></stop></linearGradient><clipPath id="clip0_2413_17199"><rect width="360" height="140" fill="white"></rect></clipPath><clipPath id="clip1_2413_17199"><rect width="6.78255" height="6.78255" fill="white" transform="translate(133.767 19.5954)"></rect></clipPath><clipPath id="clip2_2413_17199"><rect width="30.1502" height="4" fill="white" transform="translate(105.703 41)"></rect></clipPath><clipPath id="clip3_2413_17199"><rect width="22.1502" height="4" fill="white" transform="translate(148.851 41)"></rect></clipPath><clipPath id="clip4_2413_17199"><rect width="17.1502" height="4" fill="white" transform="translate(189.999 41)"></rect></clipPath><clipPath id="clip5_2413_17199"><rect width="21.1502" height="4" fill="white" transform="translate(233.147 41)"></rect></clipPath></defs>',2),MQ=[xQ];function AQ(n,e){return v(),L("svg",kQ,MQ)}const DQ=Z(vQ,[["render",AQ]]),TQ="aioseo-pro",_Q={setup(){return{rootStore:je()}},components:{SvgSearchStatisticsFrame:DQ},data(){return{strings:{upgradeToPro:j(C("Get actionable insights on how your SEO Revisions are affecting your SEO with Search Statistics (our Google Search Console integration). Experiment with SEO changes and revert with 1-click to help you rank in search results today! %1$s",TQ),be.getPlainLink(St.learnMore,this.rootStore.aioseo.urls.aio.searchStatistics,!0))}}}},OQ={role:"listitem",class:"aioseo-seo-revision-list-item aioseo-seo-revision-list-item--upsell",tabindex:"0"},VQ={class:"main"},EQ=["innerHTML"];function PQ(n,e,t,i,s,r){const o=x("svg-search-statistics-frame");return v(),L("div",OQ,[A("div",VQ,[m(o),A("span",{innerHTML:s.strings.upgradeToPro},null,8,EQ)])])}const LQ=Z(_Q,[["render",PQ],["__scopeId","data-v-191a3a51"]]),K7="aioseo-pro",RQ={data(){return{strings:{noRevisions:C("No revisions yet.",K7),message:C("As you make updates to your SEO data, you will see a list of previous versions with all changes.",K7)}}}},BQ={class:"aioseo-seo-revisions-empty"};function HQ(n,e,t,i,s,r){return v(),L("div",BQ,[A("p",null,D(s.strings.noRevisions),1),A("span",null,D(s.strings.message),1)])}const NQ=Z(RQ,[["render",HQ],["__scopeId","data-v-c7719aeb"]]),FQ={},IQ={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"2.25 4 17.75 16"},WQ=A("path",{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"},null,-1),zQ=[WQ];function UQ(n,e){return v(),L("svg",IQ,zQ)}const mM=Z(FQ,[["render",UQ]]),G7="aioseo-pro",$Q={setup(){return{seoRevisionsStore:lh()}},components:{CoreAlert:wt,SeoRevisionsDeleteWarning:PA,SeoRevisionsEmpty:NQ,SeoRevisionListItem:LA,SeoRevisionListItemUpsell:LQ,SvgBackup:mM},data(){return{btnLoadMoreLoading:!1,itemToBeDeleted:{},license:rr,modalOpenDeleteRevisionWarning:!1,strings:{upgradeToPro:j(C("You have reached the limit of %1$s revisions for this page. In order to unlock more revisions, consider upgrading to a higher plan. %2$s",G7),this.seoRevisionsStore.itemsLimit,be.getUpsellLink("seo-revisions-limit",St.learnMore,"",!0))}}},computed:{btnLoadMoreDisabled(){return this.seoRevisionsStore.itemsTotalCount<=this.seoRevisionsStore.items.length},btnLoadMoreText(){let n=this.seoRevisionsStore.itemsTotalCount-this.seoRevisionsStore.items.length;return n=Math.max(0,n),n===0?!1:(n=99<n?"99+":n,j(qM("%1$s Other Revision","%1$s Other Revisions",n,G7),n))}},methods:{initLoadMore(){this.btnLoadMoreLoading=!0,this.seoRevisionsStore.fetch({offset:this.seoRevisionsStore.items.length},!0).finally(()=>{this.btnLoadMoreLoading=!1})},maybeDeleteSeoRevision(n){this.modalOpenDeleteRevisionWarning=!0,this.itemToBeDeleted=n}}},KQ=n=>(om("data-v-c8cd20f8"),n=n(),lm(),n),GQ={key:0,class:"aioseo-seo-revisions-list",role:"list"},qQ={key:1,class:"btn-load-more-wrapper"},ZQ={key:4},jQ=KQ(()=>A("br",null,null,-1));function YQ(n,e,t,i,s,r){const o=x("seo-revision-list-item-upsell"),l=x("seo-revision-list-item"),a=x("svg-backup"),c=x("base-button"),h=x("seo-revisions-delete-warning"),d=x("seo-revisions-empty"),u=x("core-alert");return v(),L("div",{class:Re(["aioseo-seo-revisions-list-wrapper",{"aioseo-seo-revisions-list-wrapper--metabox":n.$root.$data.screenContext==="metabox","aioseo-seo-revisions-list-wrapper--sidebar":n.$root.$data.screenContext==="sidebar","aioseo-seo-revisions-list-wrapper--bullet":1<i.seoRevisionsStore.items.length}])},[0<i.seoRevisionsStore.items.length?(v(),L("div",GQ,[(v(!0),L(xt,null,_i(i.seoRevisionsStore.items,(f,p)=>(v(),L(xt,{key:"seo-revision-list-item-"+p},[p===5&&!s.license.hasCoreFeature("search-statistics","post-detail-seo-statistics")?(v(),E(o,{key:0})):O("",!0),m(l,{"is-current-version":p===0,revision:f,onMaybeDeleteSeoRevision:r.maybeDeleteSeoRevision},null,8,["is-current-version","revision","onMaybeDeleteSeoRevision"])],64))),128))])):O("",!0),0<i.seoRevisionsStore.items.length&&r.btnLoadMoreText?(v(),L("div",qQ,[m(c,{class:"btn-load-more",type:"blue",size:"small",loading:s.btnLoadMoreLoading,onClick:e[0]||(e[0]=Dt(f=>r.initLoadMore(),["prevent","exact"])),disabled:r.btnLoadMoreDisabled},{default:S(()=>[m(a,{width:"15"}),B(" "+D(r.btnLoadMoreText),1)]),_:1},8,["loading","disabled"])])):O("",!0),0<i.seoRevisionsStore.items.length?(v(),E(h,{key:2,modalOpenDeleteRevisionWarning:s.modalOpenDeleteRevisionWarning,revision:s.itemToBeDeleted},null,8,["modalOpenDeleteRevisionWarning","revision"])):O("",!0),1>i.seoRevisionsStore.itemsTotalCount?(v(),E(d,{key:3})):O("",!0),i.seoRevisionsStore.itemsTotalCount>=i.seoRevisionsStore.itemsLimit&&i.seoRevisionsStore.itemsLimit!==-1?(v(),L("div",ZQ,[jQ,m(u,{innerHTML:s.strings.upgradeToPro},null,8,["innerHTML"])])):O("",!0)],2)}const JQ=Z($Q,[["render",YQ],["__scopeId","data-v-c8cd20f8"]]),XQ={components:{SeoRevisionsList:JQ},methods:{maybeDisplayNotices(n){window.addEventListener("load",()=>{var e,t;if(typeof(((t=(e=window==null?void 0:window.wp)==null?void 0:e.data)==null?void 0:t.select)||null)=="function"){const i=window.wp.data.select("core/editor"),s=i==null?void 0:i.getCurrentPostAttribute("aioseo_notices");s&&s.forEach(r=>{r.message&&n.createNotice(r.status,r.message,r.options||[])})}})}},mounted(){var n,e;if(yd()&&typeof(((e=(n=window==null?void 0:window.wp)==null?void 0:n.data)==null?void 0:e.dispatch)||null)=="function"){const t=window.wp.data.dispatch("core/notices");this.maybeDisplayNotices(t)}}};function QQ(n,e,t,i,s,r){const o=x("seo-revisions-list");return v(),E(o)}const eee=Z(XQ,[["render",QQ]]),CM=n=>(om("data-v-20175fdb"),n=n(),lm(),n),tee={class:"aioseo-seo-revision-list-item"},iee={class:"aioseo-seo-revision-list-item__author"},see={class:"aioseo-seo-revision-list-item__author__avatar"},nee={class:"aioseo-seo-revision-list-item__author__name"},ree=CM(()=>A("div",{class:"aioseo-seo-revision-list-item__date"}," 1 week ago (2 Dec, 2022 @ 18:28:57) ",-1)),oee={class:"aioseo-seo-revision-list-item__action"},lee=CM(()=>A("span",{class:"aioseo-seo-revision-list-item__action__compare"}," Compare ",-1)),aee={class:"aioseo-seo-revision-list-item__action__view"},hee={class:"aioseo-seo-revision-list-item__action__delete"},cee={__name:"ListItem",setup(n){const{currentUser:e}=e9(lh());return(t,i)=>(v(),L("div",tee,[A("div",iee,[A("span",see,[m(_(YA),{src:_(e).avatar.url,size:_(e).avatar.size},null,8,["src","size"])]),A("span",nee,D(_(i9)(_(e).display_name,30)),1)]),ree,A("div",oee,[lee,A("span",aee,[m(_(pl),{width:"18"})]),A("span",hee,[m(_(gm),{width:"18"})])])]))}},dee=Z(cee,[["__scopeId","data-v-20175fdb"]]),uee={components:{SeoRevisionListItem:dee}},fee={class:"aioseo-seo-revisions-list"};function pee(n,e,t,i,s,r){const o=x("seo-revision-list-item");return v(),L("div",fee,[(v(),L(xt,null,_i(13,l=>m(o,{key:"seo-revision-list-item-"+l})),64))])}const gee=Z(uee,[["render",pee],["__scopeId","data-v-7b502c37"]]),kf="all-in-one-seo-pack",mee={setup(){return{seoRevisionsStore:lh()}},components:{CoreBlur:eo,CoreModal:Qt,CoreSettingsRow:Ce,SeoRevisionsList:gee,SeoRevisionsUpsell:WA,SvgRightArrowShort:Sm},data(){return{strings:{button:C("Open SEO Revisions",kf),description:C("With our powerful revisions feature for all your SEO data, never lose the exact SEO title or description (and more!) that helped you rank higher in search results and restore it back in a single click.",kf),seoRevisions:C("SEO Revisions",kf)}}}},Cee={key:0,class:"aioseo-seo-revisions-metabox"},yee={key:1,class:"aioseo-seo-revisions-sidebar"},bee={class:"aioseo-seo-revisions-sidebar__modal-body"},See={class:"description"};function wee(n,e,t,i,s,r){const o=x("seo-revisions-list"),l=x("core-blur"),a=x("seo-revisions-upsell"),c=x("core-modal"),h=x("svg-right-arrow-short"),d=x("base-button"),u=x("core-settings-row");return n.$root.$data.screenContext==="metabox"?(v(),L("div",Cee,[m(l,null,{default:S(()=>[m(o)]),_:1}),m(a,{"parent-component-context":"metabox"})])):n.$root.$data.screenContext==="sidebar"?(v(),L("div",yee,[m(c,{show:i.seoRevisionsStore.modalOpenSidebar,classes:[],onClose:e[0]||(e[0]=f=>i.seoRevisionsStore.modalOpenSidebar=!1)},{headerTitle:S(()=>[B(D(s.strings.seoRevisions),1)]),body:S(()=>[A("div",bee,[m(l,null,{default:S(()=>[m(o)]),_:1}),m(a,{"parent-component-context":"modal"})])]),_:1},8,["show"]),m(u,{align:""},{name:S(()=>[B(D(s.strings.seoRevisions),1)]),description:S(()=>[A("p",See,D(s.strings.description),1)]),content:S(()=>[m(d,{class:"gray small",onClick:e[1]||(e[1]=Dt(f=>i.seoRevisionsStore.modalOpenSidebar=!0,["stop","exact"]))},{default:S(()=>[m(h,{width:"10"}),B(" "+D(s.strings.button),1)]),_:1})]),_:1})])):O("",!0)}const vee=Z(mee,[["render",wee],["__scopeId","data-v-eda67d56"]]),kee={setup(){return{licenseStore:pi()}},components:{SeoRevisions:eee,SeoRevisionsLite:vee},props:{parentComponentContext:String},data(){return{license:rr}}},xee={class:"aioseo-seo-revisions aioseo-tab-content"};function Mee(n,e,t,i,s,r){const o=x("seo-revisions",!0),l=x("seo-revisions-lite");return v(),L("div",xee,[!i.licenseStore.isUnlicensed&&s.license.hasCoreFeature("seo-revisions")?(v(),E(o,{key:0,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"])):(v(),E(l,{key:1,parentComponentContext:t.parentComponentContext},null,8,["parentComponentContext"]))])}const Aee=Z(kee,[["render",Mee],["__scopeId","data-v-0313f110"]]),Dee={__name:"CountBadge",setup(n){const{itemsTotalCount:e}=e9(lh()),t=xe(()=>99<e.value?"99+":e.value);return(i,s)=>_(e)?(v(),L("span",{key:0,class:Re(["aioseo-seo-revisions-count-badge",{"aioseo-seo-revisions-count-badge--ml":i.$root.$data.screenContext==="sidebar","aioseo-seo-revisions-count-badge--mr":i.$root.$data.screenContext==="metabox","aioseo-seo-revisions-count-badge--sm":99<_(e)}])},D(t.value),3)):O("",!0)}},Tee={},_ee={viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-circle-information-solid"},Oee=A("path",{d:"M7.00016 0.833334C3.32016 0.833334 0.333496 3.82 0.333496 7.5C0.333496 11.18 3.32016 14.1667 7.00016 14.1667C10.6802 14.1667 13.6668 11.18 13.6668 7.5C13.6668 3.82 10.6802 0.833334 7.00016 0.833334ZM7.66683 10.8333H6.3335V9.5H7.66683V10.8333ZM7.66683 8.16667H6.3335V4.16667H7.66683V8.16667Z",fill:"currentColor"},null,-1),Vee=[Oee];function Eee(n,e){return v(),L("svg",_ee,Vee)}const Pee=Z(Tee,[["render",Eee]]),Lee={},Ree={viewBox:"0 0 12 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-receipt"},Bee=A("path",{d:"M11 1.83325L10 0.833252L9 1.83325L8 0.833252L7 1.83325L6 0.833252L5 1.83325L4 0.833252L3 1.83325L2 0.833252L1 1.83325L0 0.833252V14.1666L1 13.1666L2 14.1666L3 13.1666L4 14.1666L5 13.1666L6 14.1666L7 13.1666L8 14.1666L9 13.1666L10 14.1666L11 13.1666L12 14.1666V0.833252L11 1.83325ZM1.33333 12.2266V2.77328H10.6667V12.2266H1.33333ZM10 10.8333V9.49992H2V10.8333H10ZM10 6.83325V8.16659H2V6.83325H10ZM10 5.49992V4.16658H2V5.49992H10Z",fill:"currentColor"},null,-1),Hee=[Bee];function Nee(n,e){return v(),L("svg",Ree,Hee)}const Fee=Z(Lee,[["render",Nee]]),Iee={},Wee={viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-crossed-arrows"},zee=A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.26625 4.7737L1.73375 0.249954L0.5 1.4837L5.02375 6.00745L6.26625 4.7737ZM9.6875 0.249954L11.4725 2.03495L0.5 13.0162L1.73375 14.25L12.715 3.27745L14.5 5.06245V0.249954H9.6875ZM8.74251 9.71747L9.97626 8.48372L12.715 11.2225L14.5 9.43746V14.25H9.68751L11.4813 12.4562L8.74251 9.71747Z",fill:"currentColor"},null,-1),Uee=[zee];function $ee(n,e){return v(),L("svg",Wee,Uee)}const Kee=Z(Iee,[["render",$ee]]),An="all-in-one-seo-pack",Gee={setup(){const n=lh(),e=Ze(!1),t=()=>{window.wp.data.select("core/editor").isSavingPost()&&!window.wp.data.select("core/editor").isAutosavingPost()&&(e.value=!0,setTimeout(()=>{n.fetch().finally(()=>{e.value=!1})},2500))},i=async()=>{await Jn(),window.wp.data.subscribe(()=>{e.value||t()})};return{keywordRankTrackerStore:oh(),licenseStore:pi(),postEditorStore:Te(),redirectsStore:Q7(),rootStore:je(),seoRevisionsStore:n,settingsStore:os(),watchObjectRevisionsOnSavePost:i}},components:{Advanced:kD,Alert:p9,CoreMainTabs:Qi,CoreModal:Qt,General:C9,KeywordRankTracker:iV,LinkAssistant:TV,ModalContent:tE,Redirects:OE,Schema:wQ,SeoRevisions:Aee,SeoRevisionsCountBadge:Dee,Social:y9,SvgBackup:mM,SvgBuild:$A,SvgCaret:bd,SvgCircleInformationSolid:Pee,SvgClose:Sd,SvgLinkSuggestion:kd,SvgReceipt:Fee,SvgRedirectCrossedArrows:Kee,SvgSettings:a9,SvgShare:f9},data(){return{activeTab:"general",modal:!1,strings:{pageName:"General",modalTitle:C("Preview Snippet Editor",An)},activeMainSidebarTab:"",isPageBuilderEditor:Er}},watch:{"postEditorStore.currentPost":{deep:!0,handler(){PM(this.postEditorStore.savePostState,250)}},"postEditorStore.currentPost.modalOpen"(n){this.activeTab!=="general"&&this.maybeResetActiveTab(n)},"postEditorStore.currentPost.linkAssistant.modalOpen"(n){this.maybeResetActiveTab(n)},"postEditorStore.currentPost.redirects.modalOpen"(n){this.maybeResetActiveTab(n)},"seoRevisionsStore.modalOpenSidebar"(n){this.maybeResetActiveTab(n)},"settingsStore.metaBoxTabs.mainSidebar":{deep:!0,handler(n){this.$root.$data.screenContext==="sidebar"&&this.activeMainSidebarTab!==n.tab&&(this.activeMainSidebarTab=n.tab,this.processChangeTab(n.tab))}}},computed:{tabs(){var e;const n=[{slug:"general",icon:"svg-settings",name:C("General",An)},{slug:"social",icon:"svg-share",name:C("Social",An)},{slug:"schema",icon:"svg-receipt",name:C("Schema",An)},{slug:"redirects",icon:"svg-redirect-crossed-arrows",name:C("Redirects",An),warning:0<this.redirectsStore.rows.filter(t=>!!t.enabled).length,permission:"aioseo_page_redirects_manage"},{slug:"seoRevisions",icon:"svg-backup",name:C("SEO Revisions",An),badge:"seo-revisions-count-badge"},{slug:"advanced",icon:"svg-build",name:C("Advanced",An)}];return!this.rootStore.aioseo.integration&&!Er()&&this.postEditorStore.currentPost.context==="post"&&!((e=this.postEditorStore.currentPost.linkAssistant)!=null&&e.isExcludedPost)&&n.splice(3,0,{slug:"linkAssistant",icon:"svg-link-suggestion",name:C("Link Assistant",An)}),n},initTab(){return this.getTabs[0].slug},getTabs(){return this.postEditorStore.currentPost.context==="term"||this.postEditorStore.currentPost.isWooCommercePageWithoutSchema?this.tabs.filter(n=>n.slug!=="schema"&&cn(this.getTabPermission(n.slug),!0)):this.tabs.filter(n=>cn(this.getTabPermission(n.slug),!0)?!0:n.slug==="general"&&(cn("aioseo_page_analysis")||cn(this.getTabPermission(n.slug),!0)))}},methods:{async processChangeTab(n){if(n!==null&&typeof n=="object"){this.processChangeTab(n.main),this.$nextTick(()=>{this.settingsStore.changeTabSettings({setting:n.main,value:n.sub})});return}switch(this.$root.$data.screenContext){case"sidebar":document.querySelectorAll(".components-panel__header").forEach(e=>{const t=n===null?"sticky":"static";e.style.position=t});break;default:this.activeTab=n,this.settingsStore.changeTabSettings({setting:"main",value:n});break}if(this.$root.$data.screenContext==="sidebar"&&this.activeTab!==n)switch(this.activeTab=n,await this.$nextTick(),n){case"social":this.postEditorStore.currentPost.modalOpen||(this.settingsStore.changeTabSettings({setting:"modal",value:"social"}),this.postEditorStore.currentPost.modalOpen=!0);break;case"linkAssistant":this.postEditorStore.currentPost.linkAssistant&&!this.postEditorStore.currentPost.linkAssistant.modalOpen&&(this.postEditorStore.currentPost.linkAssistant.modalOpen=!0);break;case"redirects":this.postEditorStore.currentPost.redirects&&!this.postEditorStore.currentPost.redirects.modalOpen&&(this.postEditorStore.currentPost.redirects.modalOpen=!0);break;case"seoRevisions":await this.$nextTick(),!this.seoRevisionsStore.modalOpenSidebar&&(this.licenseStore.isUnlicensed||this.seoRevisionsStore.itemsLimit===0)&&(this.seoRevisionsStore.modalOpenSidebar=!0);break}},maybeResetActiveTab(n){n||this.$root.$data.screenContext==="sidebar"&&this.$nextTick(()=>{this.processChangeTab(null)})},closeModal(){this.postEditorStore.currentPost.modalOpen=!1},getTabPermission(n){const e=this.tabs.find(t=>t.slug===n);return typeof e.permission<"u"?e.permission:`aioseo_page_${e.slug}_settings`},getTabName(n){const e=this.tabs.find(t=>t.slug===n);return e==null?void 0:e.name}},created(){switch(this.modal=Da()["aioseo-modaltab"]||this.modal,this.modal&&(this.settingsStore.changeTabSettings({setting:"modal",value:this.modal}),this.postEditorStore.currentPost.modalOpen=!0,setTimeout(()=>{xf("aioseo-modaltab")},500)),this.$nextTick(()=>{this.settingsStore.metaBoxTabs.mainSidebar.tab&&this.processChangeTab(this.settingsStore.metaBoxTabs.mainSidebar.tab)}),window.aioseoBus.$on("standalone-update-post",n=>{Object.keys(n).forEach(e=>{this.postEditorStore.currentPost[e]=n[e]})}),this.$root.$data.screenContext){case"sidebar":this.activeTab=null;break;default:this.activeTab=Da()["aioseo-tab"]||this.initTab,this.settingsStore.changeTabSettings({setting:"main",value:this.activeTab}),setTimeout(()=>{xf("aioseo-tab")},500);break}},beforeMount(){const n=document.querySelector(".interface-complementary-area__pin-unpin-item");n&&n!==null&&(n.style.display="block")},mounted(){yd()&&!this.licenseStore.isUnlicensed&&this.watchObjectRevisionsOnSavePost()}},qee={class:"aioseo-app aioseo-post-settings"},Zee={key:0,class:"aioseo-sidepanel"},jee=["onClick"],Yee={class:"name"},Jee={key:0,class:"aioseo-tab-title"};function Xee(n,e,t,i,s,r){const o=x("core-main-tabs"),l=x("svg-circle-information-solid"),a=x("svg-caret"),c=x("svg-close"),h=x("alert"),d=x("modal-content"),u=x("core-modal"),f=x("keyword-rank-tracker");return v(),L("div",qee,[n.$root.$data.screenContext!=="sidebar"?(v(),E(o,{key:0,tabs:r.getTabs,showSaveButton:!1,active:s.activeTab,internal:"",disableMobile:"",onChanged:e[0]||(e[0]=p=>r.processChangeTab(p))},{"var-tab-icon":S(({tab:p})=>[(v(),E(bt(p.icon),{class:Re([{warning:p.warning}])},null,8,["class"])),(v(),E(bt(p.badge)))]),_:1},8,["tabs","active"])):O("",!0),m(Aa,{name:"route-fade",mode:"out-in"},{default:S(()=>[n.$root.$data.screenContext==="sidebar"&&s.activeTab===null?(v(),L("div",Zee,[(v(!0),L(xt,null,_i(r.getTabs,(p,g)=>(v(),L("a",{key:g,class:"aioseo-sidepanel-button",href:"#",onClick:Dt(b=>r.processChangeTab(p.slug),["prevent"])},[(v(),E(bt(p.icon),{class:"icon"})),A("div",Yee,D(p.name),1),(v(),E(bt(p.badge))),p.warning?(v(),E(l,{key:0,width:"15",height:"15"})):O("",!0),m(a)],8,jee))),128))])):O("",!0)]),_:1}),m(Aa,{name:"route-fade",mode:"out-in"},{default:S(()=>[s.activeTab?(v(),L("div",{key:s.activeTab,class:Re(["aioseo-tab",{"is-page-builder":!!i.rootStore.aioseo.integration}])},[n.$root.$data.screenContext==="sidebar"?(v(),L("div",Jee,[A("span",null,D(r.getTabName(s.activeTab)),1),m(c,{onClick:e[1]||(e[1]=p=>r.processChangeTab(null))})])):O("",!0),n.$root.$data.screenContext==="sidebar"?(v(),E(h,{key:1})):O("",!0),(v(),E(bt(s.activeTab),{parentComponentContext:"metabox",onChangeTab:e[2]||(e[2]=p=>r.processChangeTab(p))},null,32))],2)):O("",!0)]),_:1}),m(u,{show:i.postEditorStore.currentPost.modalOpen&&n.$root.$data.screenContext==="sidebar",onClose:r.closeModal,classes:["aioseo-post-settings-modal"],"modal-name":"preview-snippet-editor"},{headerTitle:S(()=>[B(D(s.strings.modalTitle),1)]),body:S(()=>[m(d)]),_:1},8,["show","onClose"]),m(f,{"modal-open":i.keywordRankTrackerStore.modalOpenPostEdit,"onUpdate:modalOpen":e[3]||(e[3]=p=>i.keywordRankTrackerStore.toggleModal({modal:"modalOpenPostEdit",open:p}))},null,8,["modal-open"])])}const Qee=Z(Gee,[["render",Xee]]),rre={__name:"App",setup(n){VM({scrollTimeout:1e3,scrollAndHighlightTimeout:2e3});const e=Te();return(t,i)=>(v(),L("div",{onClick:i[0]||(i[0]=Dt(()=>{},["stop"])),id:"main-settings-cont"},[t.$root.$data.screenContext!=="sidebar"?(v(),E(_(p9),{key:0})):O("",!0),_(e).currentPost.id?(v(),E(_(Qee),{key:1})):O("",!0)]))}};export{rre as _};
Save File
Cancel