/* @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,r){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=re,c=oe,s=[],l="",p={},h=0,f=e.length;h2;u++)n=(e=i.slice()).splice(0,2*u),r=z,z={parse:"",context:"",help:"",path:"",rule:null,source:"",type:"g",options:{sort:"aA_"}},o=q(e)&&z.path,z=r,k(o)&&(e=n.concat(w(o)),r=z,z={parse:"",context:"",help:"",path:"",rule:null,source:"",type:"g",options:{sort:"aA_"}},K(e,t)?a=!0:z=r,z.help=A(e));return a}function q(e){return I(e,{match:Ce,object:typelib.env.win[ie],names:P,INIRules:E})}function F(e){function t(e){var t,r=$(e);return n(r)&&(e.stepForward(),r=$(e=ke(e,Q))),G(r)&&r.value.endsWith(Q)&&(e.stepBackward(),x(e,t=[])),t}function r(e){var t;return b($(e))&&(e.stepBackward(),x(e,t=[])),t}function o(e){var t,n=$(e);return a(n)&&(e.stepBackward(),(n=ue(e))&&j(e,t=[n])),t}var i,u=Z(this.session,e.row,e.column,!0),c=$(u),s=J,l=te,p=!0;if(_(c)&&(c=u.stepBackward()),c=ue(u))for(n(c)&&(c=$(u=ke(u,s)));p&&C(c,s);){var h,f=be(u,s);if((p=f)&&(f.row>e.row||f.row==e.row&&f.column>=e.column)){if(p=!1,c=u.stepBackward()){for(c=ue(u);c&&n(c);)h||(h=X(u)),c=u.stepBackward(),c=$(u=ae(u,!0).iterator);C(c,l)?(c=u.stepBackward(),c=ue(u)):h&&(c=$(u=Z(this.session,h.row,h.column+1))),c&&(i=t(u)||r(u)||o(u))}}else p&&((c=u.stepBackward())&&(c=$(u=ke(u,s))),p=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||we,c=this.$brackets[e],s=Z(this,t.row,t.column),l=$(s)||s.stepForward(),p=1,h=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,oe)&&(h=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,oe)?h+=i.length:r(i,re)&&(h-=i.length);do{if(n(l,h))return;l=s.stepBackward()}while(l&&!u.test(l.type));if(!l)break;o=(i=l.value).length-1}}}.call(u,ee,e,function(e,t){if(t<0)return!0;!t&&n(e)&&(c+=e.value.length)}))&&G($(t=Z(u,o.row,o.column+1)))&&(!(i=be(t,Q))||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",N)],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_"}},V=function(e){var n,r,o=Z(this.session,e.row,e.column);return _(r=$(o))&&(r=o.stepBackward()),t(r)&&(n=[r],(r=o.stepBackward())&&(S(r)||O(r)?n.push(r):o=x(o,n))),n}.call(this,e);return V?V.length>1&&(function(e){var n=t(e[0])&&S(e[1]);return n&&(z.type="s",z.options.asObject=!0),n}(V)||function(e){var n=t(e[0])&&O(e[1]);return n&&(z.source=[],z.type="a",z.score=ge+1,z.options.asObject=!0),n}(V)||function(e){function t(e){function t(e){return typelib.toObject(e,function(e,t){return t==ie||Me(e)})}return t(e)||t(f(e))||t(m(e))}var n,r,o,i,a,u="",s=B(e[0]),h=0!=s;if(h){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(ke).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(q).forEach(function(e){e=e.trim(),t.push({group:a.get(e)||a.set(e,{}).get(e),prefix:i?"":e.trim()+W})})),n.lastIndex=0}},this),this},C.prototype.init=function(){this.rule=[]},C.prototype.parse=function(e,t){t=t||{};var n=/\s*(?:^(\S+)\s*->\s*((?:"[^"]*"|\S+))|\b(val|cap|filter|meta)\s+((?:\[[^\]]*\]|[^\s\[\]]+)+)|(\|.*))/g;return a(e,function(e){e=$.apply(e);var r,o,i,a,u=[];for(n.lastIndex=0;r=n.exec(e);)o=o||r[1].trim(),i=i||r[2].trim(),r[3]&&r[4]&&u.push({field:r[3].trim(),value:r[4].trim()});o&&i&&(a={original:o,pattern:new RegExp(o,t.flags),replace:i},u.forEach(function(e){a[e.field]=e.value}),null!=a.filter&&(a.filter=new RegExp(a.filter)),this.rule.push(a))},this),this},C.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