import{p as s}from"./vendor-lezer-php-CJlwwq4M.js";import{p as i}from"./vendor-lezer-common-tVQBIsvN.js";import{html as p}from"./cm-lang-html-BwlfE-a6.js";import{L as l,c as m,d as u,f as d,e as a,h as f,k as c}from"./cm-language-CDsY7zq0.js";import"./vendor-lezer-lr-eZ5kYecM.js";import"./vendor-lezer-highlight-DuEf3ZFH.js";import"./vendor-lezer-html-D-6QB8dd.js";import"./cm-lang-css-NVaY7c0M.js";import"./vendor-lezer-css-BMlSRxbI.js";import"./cm-state-X9WpHEQO.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./cm-view-CiSFjroV.js";import"./vendor-style-mod-Bs6eFhZE.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./cm-lang-javascript-E0JyLAes.js";import"./vendor-lezer-javascript-BsA5KTFy.js";import"./cm-autocomplete-t9rzw_D0.js";const g=l.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":f({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"String BlockComment":()=>null,Statement:a({except:/^({|end(for|foreach|switch|while)\b)/})}),d.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":c,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 m(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};
