import{p as s}from"./vendor-lezer-php-_DHrbsZG.js";import{p as i}from"./vendor-lezer-common-B3-cUCR_.js";import{html as p}from"./vendor-codemirror-lang-html-CfgK872x.js";import{L as l,b as m,c as u,d as a,e as d,g as c,h as f}from"./vendor-codemirror-language-BgPj_McA.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-lezer-highlight-CDMHUZ74.js";import"./vendor-lezer-html-C0I1p52t.js";import"./vendor-codemirror-lang-css-O0cZX78y.js";import"./vendor-lezer-css-C5xB6jxd.js";import"./vendor-codemirror-state-C9awkmn-.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-CiLROUVV.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-codemirror-lang-javascript-Cc2ZYbgX.js";import"./vendor-lezer-javascript-D7Tj24ot.js";import"./vendor-codemirror-autocomplete-DzPz9Wgq.js";const g=m.define({name:"php",parser:s.configure({props:[u.add({IfStatement:a({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:a({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:e=>{let r=e.textAfter,t=/^\s*\}/.test(r),o=/^\s*(case|default)\b/.test(r);return e.baseIndent+(t?0:o?1:2)*e.unit},ColonBlock:e=>e.baseIndent+e.unit,"Block EnumBody DeclarationList":d({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"String BlockComment":()=>null,Statement:a({except:/^({|end(for|foreach|switch|while)\b)/})}),c.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":f,ColonBlock(e){return{from:e.from+1,to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function v(e={}){let r=[],t;if(e.baseLanguage!==null)if(e.baseLanguage)t=e.baseLanguage;else{let o=p({matchClosingTags:!1});r.push(o.support),t=o.language}return new l(g.configure({wrap:t&&i(o=>o.type.isTop?{parser:t.parser,overlay:n=>n.name=="Text"}:null),top:e.plain?"Program":"Template"}),r)}export{v as php,g as phpLanguage};
