CodeMirror.defineMode("htmlmixed",function(t){function e(t,e){var n=r.token(t,e.htmlState);return/(?:^|\s)tag(?:\s|$)/.test(n)&&">"==t.current()&&e.htmlState.context&&(/^script$/i.test(e.htmlState.context.tagName)?(e.token=a,e.localState=l.startState(r.indent(e.htmlState,""))):/^style$/i.test(e.htmlState.context.tagName)&&(e.token=o,e.localState=c.startState(r.indent(e.htmlState,"")))),n}function n(t,e,n){var a=t.current(),o=a.search(e);return o>-1?t.backUp(a.length-o):a.match(/<\/?$/)&&(t.backUp(a.length),t.match(e,!1)||t.match(a[0])),n}function a(t,a){return t.match(/^<\/\s*script\s*>/i,!1)?(a.token=e,a.localState=null,e(t,a)):n(t,/<\/\s*script\s*>/,l.token(t,a.localState))}function o(t,a){return t.match(/^<\/\s*style\s*>/i,!1)?(a.token=e,a.localState=null,e(t,a)):n(t,/<\/\s*style\s*>/,c.token(t,a.localState))}var r=CodeMirror.getMode(t,{name:"xml",htmlMode:!0}),l=CodeMirror.getMode(t,"javascript"),c=CodeMirror.getMode(t,"css");return{startState:function(){return{token:e,localState:null,mode:"html",htmlState:r.startState()}},copyState:function(t){if(t.localState)var e=CodeMirror.copyState(t.token==o?c:l,t.localState);return{token:t.token,localState:e,mode:t.mode,htmlState:CodeMirror.copyState(r,t.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(t,n){return t.token==e||/^\s*<\//.test(n)?r.indent(t.htmlState,n):t.token==a?l.indent(t.localState,n):c.indent(t.localState,n)},electricChars:"/{}:",innerMode:function(t){var n=t.token==e?r:t.token==a?l:c;return{state:t.localState||t.htmlState,mode:n}}}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed");