/* @license Copyright (C) Exontrol. All rights reserved. */ var acelib=acelib||function(){"use strict";function e(e,t){var n=document.createElement(e.tagName);e.set&&e.set(n),t&&(n.onload=t,n.onerror=function(e){t(e)}),document.head.appendChild(n)}function t(t,n){e({tagName:"script",set:function(e){e.src=t}},n)}function n(e,t){if(t)try{var n=new XMLHttpRequest;n.onreadystatechange=function(){this.readyState==(XMLHttpRequest.DONE||4)&&t(n.responseText)},n.open("GET",e),n.send(null)}catch(e){}}function r(e,t){if(e&&t)for(var n,r=0,o=e.length;r0)return!1;return!0}function n(e){var t=c.indexOf(e);return~t&&u.charAt(t)||null}for(var r,i,a,u=ue,c=ce,s=[],l="",p={},f=0,h=e.length;f3;c++)r=(e=a.slice()).splice(0,2*c),o=z,z={parse:"",context:"",help:"",path:"",rule:null,source:"",type:"g",options:{sort:"aA_"}},i=W(e)&&z.path,z=o,k(i)&&(e=r.concat(w(i)),o=z,z={parse:"",context:"",help:"",path:"",rule:null,source:"",type:"g",options:{sort:"aA_"}},I(e,n)?u=!0:z=o,z.help=j(e));return u}function W(e){return K(e,{match:Le,object:typelib.env.win[se],names:T,INIRules:M})}function q(e){function t(e){var t,r=D(e);return n(r)&&(e.stepForward(),r=D(e=le(e,re))),C(r,re)&&(e.stepBackward(),x(e,t=[])),t}function r(e){var t;return _(D(e))&&(e.stepBackward(),x(e,t=[])),t}function o(e){var t,n=D(e);return a(n)&&(e.stepBackward(),(n=te(e))&&b(e,t=[n])),t}var i,u=Z(this.session,e.row,e.column,!0),c=D(u),s=ne,l=!0;if(S(c)&&(c=u.stepBackward()),c=te(u))for(n(c)&&(c=D(u=le(u,s)));l&&C(c,s);){var p,f=pe(u,s);if((l=f)&&(f.row>e.row||f.row==e.row&&f.column>=e.column)){if(l=!1,c=u.stepBackward()){for(c=te(u);c&&n(c);)p||(p=X(u)),c=u.stepBackward(),c=D(u=ee(u,!0));C(c,ie)?1==c.value.length&&(c=u.stepBackward(),c=te(u)):p&&(c=D(u=Z(this.session,p.row,p.column+1))),c&&(i=t(u)||r(u)||o(u))}}else l&&((c=u.stepBackward())&&(c=D(u=le(u,s))),l=c)}return i}function H(e){var t,o,i,a,u=this.session,c=0;return(o=function(e,t,n){var o,i,a,u=u||Se,c=this.$brackets[e],s=Z(this,t.row,t.column),l=D(s)||s.stepForward(),p=1,f=0;if(l){if(G(l))return{row:t.row,column:t.column-1};for(o=t.column-s.getCurrentTokenColumn()-2,r(i=l.value,ce)&&(f=t.column-l.start-i.length);;){for(;o>=0;){if((a=i.charAt(o))==c){if(0==--p)return X(s,o)}else a==e&&p++;o--}r(i,ce)?f+=i.length:r(i,ue)&&(f-=i.length);do{if(n(l,f))return;l=s.stepBackward()}while(l&&!u.test(l.type));if(!l)break;o=(i=l.value).length-1}}}.call(u,oe,e,function(e,t){if(t<0)return!0;!t&&n(e)&&(c+=e.value.length)}))&&G(D(t=Z(u,o.row,o.column+1)))&&(!(i=pe(t,re))||i.row>e.row||i.row==e.row&&i.column>=e.column)&&(a=[function(e){return v("constant.numeric",e)}(c+1),v("keyword.operator",U)],t.stepBackward(),x(t,a),2==a.length&&(a=null)),a}var z={parse:"",context:"",help:"",path:"",rule:null,source:"",type:"g",options:{sort:"aA_"}},N=function(e){var n,r,o=Z(this.session,e.row,e.column);return S(r=D(o))&&(r=o.stepBackward()),t(r)&&(n=[r],(r=o.stepBackward())&&(O(r)||E(r)?n.push(r):o=x(o,n))),n}.call(this,e);return N?N.length>1&&(function(e){var n=t(e[0])&&O(e[1]);return n&&(z.type="s",z.options.asObject=!0),n}(N)||function(e){var n=t(e[0])&&E(e[1]);return n&&(z.source=[],z.type="a",z.score=be+1,z.options.asObject=!0),n}(N)||function(e){function t(e){function t(e){return typelib.toObject(e,function(e,t){return t==se||Te(e)})}return t(e)||t(h(e))||t(m(e))}var n,r,o,i,a,u="",s=B(e[0]),f=0!=s;if(f){for(var g,v=1,y=e.length;v");~t&&this.set(e.substring(0,t).trim(),e.substring(t+"->".length).trim())},this),this},x.prototype.apply=function(e){for(var t=this,n=!0;n;)n=!1,e=e.replace(/<<([\w-]+)>>/g,function(e,r){return n=!0,t.get(r)||""});return e},b.prototype.init=function(){this.type=new Map,this.rest=new Map,this.retn=new Map},b.prototype.parse=function(e){var t,n=/^\s*([^\s-]+)(-(\S+))?(?:\s+'([^']*)')?(?:\s+'([^']*)')?(\s->\s(\S+))?\s*$/gm;return e.split(Be).forEach(function(e){if(e=e.trim()){var r,i,a,u,c=n.exec(e);t&&c&&((r=c[4]&&c[5])||c[7])?t.forEach(function(e){r&&(e.group[c[1]]={meta:c[3],value:c[4],snippet:o(c[5])}),c[7]&&this.retn.set(e.prefix+c[1],c[7])},this):(u=e.indexOf("-"),a=this.rest,(i=~u)&&(e=e.slice(0,u).trim(),a=this.type),t=[],e.split(H).forEach(function(e){e=e.trim(),t.push({group:a.get(e)||a.set(e,{}).get(e),prefix:i?"":e.trim()+F})})),n.lastIndex=0}},this),this.rest=function(e){return new Map(Array.from(e.entries()).sort(function(e,t){return t[0].length-e[0].length}))}(this.rest),this},_.prototype.init=function(){this.rule=[]},_.prototype.parse=function(e,t){t=t||{};var n=/\s*(?:^(\S+)\s*->\s*((?:"[^"]*"|\S+)))\s*(.*)/g,r=/(?:\s*(val|cap|filter|meta)\s+(.+?)(?=$|\s+(?:(?:val|cap|filter|meta)\s+|\|)))(?:\s*\|(.*))?/g;return a(e,function(e){e=D.apply(e);var o,i,a,u,c,s=[];if(n.lastIndex=0,(o=n.exec(e))&&(i=o[1].trim(),a=o[2].trim(),u=o[3],i&&a))for(r.lastIndex=0;o=r.exec(u);)o[1]&&o[2]&&s.push({field:o[1].trim(),value:o[2].trim()});i&&a&&(c={original:i,pattern:new RegExp(i,t.flags),replace:a},s.forEach(function(e){c[e.field]=e.value}),null!=c.filter&&(c.filter=new RegExp(c.filter)),this.rule.push(c))},this),this},_.prototype.feU=function(e,t){function n(e,t){return e.replace(/\{(\d+)\}/g,function(e,n){return t[n]||""})}for(var r,o,i,a=0,u=this.rule.length;!r&&a