!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(m){"use strict";m.multiplexingMode=function(d){var v=Array.prototype.slice.call(arguments,1);function f(e,n,t,i){if("string"==typeof n)return r=e.indexOf(n,t),i&&-1<r?r+n.length:r;var r=n.exec(t?e.slice(t):e);return r?r.index+t+(i?r[0].length:0):-1}return{startState:function(){return{outer:m.startState(d),innerActive:null,inner:null,startingInner:!1}},copyState:function(e){return{outer:m.copyState(d,e.outer),innerActive:e.innerActive,inner:e.innerActive&&m.copyState(e.innerActive.mode,e.inner),startingInner:e.startingInner}},token:function(e,n){if(n.innerActive){var t=n.innerActive,i=e.string;if(!t.close&&e.sol())return n.innerActive=n.inner=null,this.token(e,n);if((c=t.close&&!n.startingInner?f(i,t.close,e.pos,t.parseDelimiters):-1)==e.pos&&!t.parseDelimiters)return e.match(t.close),n.innerActive=n.inner=null,t.delimStyle&&t.delimStyle+" "+t.delimStyle+"-close";-1<c&&(e.string=i.slice(0,c));var r=t.mode.token(e,n.inner);return-1<c?e.string=i:e.pos>e.start&&(n.startingInner=!1),c==e.pos&&t.parseDelimiters&&(n.innerActive=n.inner=null),r=t.innerStyle?r?r+" "+t.innerStyle:t.innerStyle:r}for(var o=1/0,i=e.string,l=0;l<v.length;++l){var c,s,a,u=v[l];if((c=f(i,u.open,e.pos))==e.pos)return u.parseDelimiters||e.match(u.open),n.startingInner=!!u.parseDelimiters,n.innerActive=u,s=0,d.indent&&(a=d.indent(n.outer,"",""))!==m.Pass&&(s=a),n.inner=m.startState(u.mode,s),u.delimStyle&&u.delimStyle+" "+u.delimStyle+"-open";-1!=c&&c<o&&(o=c)}o!=1/0&&(e.string=i.slice(0,o));t=d.token(e,n.outer);return o!=1/0&&(e.string=i),t},indent:function(e,n,t){var i=e.innerActive?e.innerActive.mode:d;return i.indent?i.indent(e.innerActive?e.inner:e.outer,n,t):m.Pass},blankLine:function(e){var n=e.innerActive?e.innerActive.mode:d;if(n.blankLine&&n.blankLine(e.innerActive?e.inner:e.outer),e.innerActive)"\n"===e.innerActive.close&&(e.innerActive=e.inner=null);else for(var t=0;t<v.length;++t){var i=v[t];"\n"===i.open&&(e.innerActive=i,e.inner=m.startState(i.mode,n.indent?n.indent(e.outer,"",""):0))}},electricChars:d.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:d}}}}});