From c35a61f524ab4434d73cb11fc366a7c6b9899cd6 Mon Sep 17 00:00:00 2001 From: Futago-za Ryuu Date: Wed, 13 Feb 2019 03:13:38 +0000 Subject: [PATCH] Commit bundled web ci files --- .gitignore | 1 - docs/.vuepress/public/benchmark-bundle.min.js | 1 + docs/.vuepress/public/test-bundle.min.js | 569 ++++++++++++++++++ 3 files changed, 570 insertions(+), 1 deletion(-) create mode 100644 docs/.vuepress/public/benchmark-bundle.min.js create mode 100644 docs/.vuepress/public/test-bundle.min.js diff --git a/.gitignore b/.gitignore index 7f43973..0e9dcc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ /.idea /packages/pegjs/dist /docs/.vuepress/dist -/docs/.vuepress/public /dist /examples/*.js node_modules diff --git a/docs/.vuepress/public/benchmark-bundle.min.js b/docs/.vuepress/public/benchmark-bundle.min.js new file mode 100644 index 0000000..43e0aa9 --- /dev/null +++ b/docs/.vuepress/public/benchmark-bundle.min.js @@ -0,0 +1 @@ +!function(u,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t=e();for(var n in t)("object"==typeof exports?exports:u)[n]=t[n]}}("undefined"!=typeof self?self:window,function(){return function(u){var e={};function t(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return u[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=u,t.c=e,t.d=function(u,e,n){t.o(u,e)||Object.defineProperty(u,e,{enumerable:!0,get:n})},t.r=function(u){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},t.t=function(u,e){if(1&e&&(u=t(u)),8&e)return u;if(4&e&&"object"==typeof u&&u&&u.__esModule)return u;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:u}),2&e&&"string"!=typeof u)for(var r in u)t.d(n,r,function(e){return u[e]}.bind(null,r));return n},t.n=function(u){var e=u&&u.__esModule?function(){return u.default}:function(){return u};return t.d(e,"a",e),e},t.o=function(u,e){return Object.prototype.hasOwnProperty.call(u,e)},t.p="",t(t.s=48)}([function(u,e,t){"use strict";var n=t(9),r=t(5),o=t(23),i=t(14),a=t(1),s={VERSION:t(13).version,GrammarError:n,ast:r,parser:i,compiler:o,util:a,generate:function(u){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=new o.Session({passes:a.convertPasses(o.passes)});return Array.isArray(e.plugins)&&e.plugins.forEach(function(u){"function"==typeof u.use&&u.use(t,e)}),o.compile(t.parse(u,e.parser||{}),t,e)}};u.exports=s},function(u,e,t){"use strict";var n=t(19),r=t(20),o=t(21),i=t(11),a=function(){function u(u){return Array.isArray(u)?u:o.values(u)}return function(e){return o.map(e,u)}}();u.exports={find:n.find,findIndex:n.findIndex,stringEscape:r.stringEscape,regexpEscape:r.regexpEscape,reservedWords:r.reservedWords,clone:o.clone,each:o.each,extend:o.extend,map:o.map,values:o.values,enforceFastProperties:o.enforceFastProperties,evalModule:i.evalModule,convertPasses:a,processOptions:function(u,e){var t={};return o.extend(t,u),o.extend(t,e),t},noop:function(){}}},,,,function(u,e,t){"use strict";e.visitor=t(10),e.Node=t(12),e.Grammar=t(22)},,,,function(u,e,t){"use strict";u.exports=function u(e,t){!function(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),this.name="GrammarError",this.message=e,this.location=t,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,u)}},function(u,e,t){"use strict";function n(u,e){for(var t=0;t1?n-1:0),o=1;o1?t-1:0),r=1;r1?t-1:0),r=1;r (https://majda.cz/)","Futago-za Ryuu "],types:"typings/pegjs.d.ts",main:"lib/peg.js",bin:"bin/peg.js",engines:{node:">= 6"}}},function(u,e,t){"use strict";var n=t(5),r=t(1);function o(u,e,t,n){this.message=u,this.expected=e,this.found=t,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,o)}!function(u,e){function t(){this.constructor=u}t.prototype=e.prototype,u.prototype=new t}(o,Error),o.buildMessage=function(u,e){var t={literal:function(u){return'"'+r(u.text)+'"'},class:function(u){var e=u.parts.map(function(u){return Array.isArray(u)?o(u[0])+"-"+o(u[1]):o(u)});return"["+(u.inverted?"^":"")+e+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(u){return u.description},not:function(u){return"not "+i(u.expected)}};function n(u){return u.charCodeAt(0).toString(16).toUpperCase()}function r(u){return u.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+n(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+n(u)})}function o(u){return u.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+n(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+n(u)})}function i(u){return t[u.type](u)}return"Expected "+function(u){var e,t,n=u.map(i);if(n.sort(),n.length>0){for(e=1,t=1;et.charCodeAt(0)&&Le("Invalid character range: "+u.substring(je,Oe)+"."),[e,t]},Be=function(){return""},me=function(){return"\0"},xe=function(){return"\b"},be=function(){return"\f"},Pe=function(){return"\n"},ye=function(){return"\r"},_e=function(){return"\t"},$e=function(){return"\v"},Se=function(u){return String.fromCharCode(parseInt(u,16))},ke=function(){return St("any")},Re=function(){Le("Unbalanced brace.")},Oe=0,je=0,Te=[{line:1,column:1}],Ie=[],Ne=0;if("startRule"in e){if(!(e.startRule in a))throw new Error("Can't start parsing from rule \""+e.startRule+'".');s=a[e.startRule]}function we(){return Ve(je,Oe)}function Le(u,e){throw function(u,e){return new o(u,null,null,e)}(u,e=void 0!==e?e:Ve(je,Oe))}function Ue(u,e){return{type:"literal",text:u,ignoreCase:e}}function He(u){return{type:"other",description:u}}function ze(e){var t,n=Te[e];if(n)return n;for(t=e-1;!Te[t];)t--;for(n={line:(n=Te[t]).line,column:n.column};t0;function Ve(u,t){var n={};Me&&(n.filename=e.filename);var r=ze(u);n.start={offset:u,line:r.line,column:r.column};var o=ze(t);return n.end={offset:t,line:o.line,column:o.column},n}function Ge(){Ie.push({pos:Oe,variants:[]})}function Xe(u){var e=Ie[Ie.length-1];Oee.pos&&(e.pos=Oe,e.variants=[]),e.variants.push(u))}function Ye(u){var e=Ie.pop(),t=Ie[Ie.length-1],n=e.variants;t.pos===e.pos&&(u&&(n=n.map(function(u){return"not"===u.type?u.expected:{type:"not",expected:u}})),Array.prototype.push.apply(t.variants,n))}function We(){var u,e,t,n,r;if(u=Oe,bt(),e=Oe,(t=function(){var u,e;return u=Oe,(e=xt())!==i&&Pt()!==i?(je=u,u=Wu(e)):(Oe=u,u=i),u}())!==i?(n=bt(),e=t):(Oe=e,e=i),e===i&&(e=null),t=[],n=Oe,(r=qe())!==i?(bt(),n=r):(Oe=n,n=i),n!==i)for(;n!==i;)t.push(n),n=Oe,(r=qe())!==i?(bt(),n=r):(Oe=n,n=i);else t=i;return t!==i?(je=u,u=Yu(e,t)):(Oe=u,u=i),u}function qe(){var e,t,n,r,o,a;return e=Oe,(t=pt())!==i?(bt(),n=Oe,(r=ft())!==i?(bt(),n=r):(Oe=n,n=i),n===i&&(n=null),a=vu,0===Ne&&Xe(a),61===u.charCodeAt(Oe)?(r=c,Oe++):r=i,r!==i?(bt(),(o=Je())!==i&&Pt()!==i?(je=e,e=qu(t,n,o)):(Oe=e,e=i)):(Oe=e,e=i)):(Oe=e,e=i),e}function Je(){var e,t,n,r,o,a,s=function(u){0===Ne&&Xe(u)};if(e=Oe,(t=Ke())!==i){for(n=[],r=Oe,bt(),s(Du),47===u.charCodeAt(Oe)?(o=p,Oe++):o=i,o!==i?(bt(),(a=Ke())!==i?r=a:(Oe=r,r=i)):(Oe=r,r=i);r!==i;)n.push(r),r=Oe,bt(),s(Du),47===u.charCodeAt(Oe)?(o=p,Oe++):o=i,o!==i?(bt(),(a=Ke())!==i?r=a:(Oe=r,r=i)):(Oe=r,r=i);je=e,e=Ju(t,n)}else Oe=e,e=i;return e}function Ke(){var u,e,t,n;return u=Oe,(e=function(){var u,e,t,n,r;if(u=Oe,(e=Ze())!==i){for(t=[],n=Oe,bt(),(r=Ze())!==i?n=r:(Oe=n,n=i);n!==i;)t.push(n),n=Oe,bt(),(r=Ze())!==i?n=r:(Oe=n,n=i);je=u,u=Zu(e,t)}else Oe=u,u=i;return u}())!==i?(t=Oe,bt(),(n=xt())!==i?t=n:(Oe=t,t=i),t===i&&(t=null),je=u,u=Ku(e,t)):(Oe=u,u=i),u}function Ze(){var e,t,n,r,o,a;return e=Oe,a=Bu,0===Ne&&Xe(a),64===u.charCodeAt(Oe)?(t=l,Oe++):t=i,t!==i?((n=Qe())===i&&(n=null),r=bt(),(o=ut())!==i?(je=e,e=Qu(n,o)):(Oe=e,e=i)):(Oe=e,e=i),e===i&&(e=Oe,(t=Qe())!==i?(n=bt(),(r=ut())!==i?(je=e,e=ue(t,r)):(Oe=e,e=i)):(Oe=e,e=i),e===i&&(e=ut())),e}function Qe(){var e,t,n,r;return e=Oe,(t=pt())!==i?(bt(),r=mu,0===Ne&&Xe(r),58===u.charCodeAt(Oe)?(n=A,Oe++):n=i,n!==i?(je=e,e=ee(t)):(Oe=e,e=i)):(Oe=e,e=i),e}function ut(){var e,t,n;return e=Oe,(t=function(){var e,t,n=function(u){0===Ne&&Xe(u)};return e=Oe,n(xu),36===u.charCodeAt(Oe)?(t=f,Oe++):t=i,t!==i&&(je=e,t=ne()),(e=t)===i&&(e=Oe,n(bu),38===u.charCodeAt(Oe)?(t=E,Oe++):t=i,t!==i&&(je=e,t=re()),(e=t)===i&&(e=Oe,n(Pu),33===u.charCodeAt(Oe)?(t=C,Oe++):t=i,t!==i&&(je=e,t=oe()),e=t)),e}())!==i?(bt(),(n=et())!==i?(je=e,e=te(t,n)):(Oe=e,e=i)):(Oe=e,e=i),e===i&&(e=et()),e}function et(){var e,t,n;return e=Oe,(t=tt())!==i?(bt(),(n=function(){var e,t,n=function(u){0===Ne&&Xe(u)};return e=Oe,n(yu),63===u.charCodeAt(Oe)?(t=h,Oe++):t=i,t!==i&&(je=e,t=ae()),(e=t)===i&&(e=Oe,n(_u),42===u.charCodeAt(Oe)?(t=F,Oe++):t=i,t!==i&&(je=e,t=se()),(e=t)===i&&(e=Oe,n($u),43===u.charCodeAt(Oe)?(t=d,Oe++):t=i,t!==i&&(je=e,t=ce()),e=t)),e}())!==i?(je=e,e=ie(t,n)):(Oe=e,e=i)):(Oe=e,e=i),e===i&&(e=tt()),e}function tt(){var e,t,n,r,o=function(u){0===Ne&&Xe(u)};return(e=function(){var e,t,n,r;return r=Hu,0===Ne&&Xe(r),Ne++,e=Oe,(t=ft())!==i?(105===u.charCodeAt(Oe)?(n=L,Oe++):n=i,n===i&&(n=null),je=e,e=de(t,n)):(Oe=e,e=i),Ne--,e}())===i&&(e=function(){var e,t,n,r,o,a,s;if(s=Mu,0===Ne&&Xe(s),Ne++,e=Oe,91===u.charCodeAt(Oe)?(t=z,Oe++):t=i,t!==i){for(94===u.charCodeAt(Oe)?(n=M,Oe++):n=i,n===i&&(n=null),r=[],o=ht();o!==i;)r.push(o),o=ht();93===u.charCodeAt(Oe)?(o=V,Oe++):o=i,o!==i?(105===u.charCodeAt(Oe)?(a=L,Oe++):a=i,a===i&&(a=null),je=e,e=ve(n,r,a)):(Oe=e,e=i)}else Oe=e,e=i;return Ne--,e}())===i&&(e=function(){var e,t,n;return e=Oe,n=Vu,0===Ne&&Xe(n),46===u.charCodeAt(Oe)?(t=eu,Oe++):t=i,t!==i&&(je=e,t=ke()),e=t}())===i&&(e=function(){var e,t,n,r,o,a,s,p,l;return e=Oe,(t=pt())!==i?(n=Oe,Ge(),r=Oe,o=bt(),a=Oe,(s=ft())!==i?(p=bt(),a=s=[s,p]):(Oe=a,a=i),a===i&&(a=null),l=vu,0===Ne&&Xe(l),61===u.charCodeAt(Oe)?(s=c,Oe++):s=i,s!==i?r=o=[o,a,s]:(Oe=r,r=i),Ye(!0),r===i?n=void 0:(Oe=n,n=i),n!==i?(je=e,e=le(t)):(Oe=e,e=i)):(Oe=e,e=i),e}())===i&&(e=function(){var e,t,n;return e=Oe,(t=function(){var e,t,n=function(u){0===Ne&&Xe(u)};return e=Oe,n(bu),38===u.charCodeAt(Oe)?(t=E,Oe++):t=i,t!==i&&(je=e,t=fe()),(e=t)===i&&(e=Oe,n(Pu),33===u.charCodeAt(Oe)?(t=C,Oe++):t=i,t!==i&&(je=e,t=Ee()),e=t),e}())!==i?(bt(),(n=xt())!==i?(je=e,e=Ae(t,n)):(Oe=e,e=i)):(Oe=e,e=i),e}())===i&&(e=Oe,o(Su),40===u.charCodeAt(Oe)?(t=g,Oe++):t=i,t!==i?(bt(),(n=Je())!==i?(bt(),o(ku),41===u.charCodeAt(Oe)?(r=v,Oe++):r=i,r!==i?(je=e,e=pe(n)):(Oe=e,e=i)):(Oe=e,e=i)):(Oe=e,e=i)),e}function nt(){var e,t;return t=Ru,0===Ne&&Xe(t),u.length>Oe?(e=u.charAt(Oe),Oe++):e=i,e}function rt(){var e,t;return t=Ou,0===Ne&&Xe(t),Ne++,9===u.charCodeAt(Oe)?(e=D,Oe++):e=i,e===i&&(11===u.charCodeAt(Oe)?(e=B,Oe++):e=i,e===i&&(12===u.charCodeAt(Oe)?(e=m,Oe++):e=i,e===i&&(32===u.charCodeAt(Oe)?(e=x,Oe++):e=i,e===i&&(160===u.charCodeAt(Oe)?(e=b,Oe++):e=i,e===i&&(65279===u.charCodeAt(Oe)?(e=P,Oe++):e=i,e===i&&(e=function(){var e;return gu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}())))))),Ne--,e}function ot(){var e,t;return t=ju,0===Ne&&Xe(t),ou.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}function it(){var e,t;return t=Tu,0===Ne&&Xe(t),Ne++,10===u.charCodeAt(Oe)?(e=y,Oe++):e=i,e===i&&(u.substr(Oe,2)===_?(e=_,Oe+=2):e=i,e===i&&(13===u.charCodeAt(Oe)?(e=$,Oe++):e=i,e===i&&(8232===u.charCodeAt(Oe)?(e=S,Oe++):e=i,e===i&&(8233===u.charCodeAt(Oe)?(e=k,Oe++):e=i)))),Ne--,e}function at(){var e,t;return t=Iu,0===Ne&&Xe(t),Ne++,(e=function(){var e,t,n,r,o,a,s;if(e=Oe,u.substr(Oe,2)===R?(t=R,Oe+=2):t=i,t!==i){for(n=Oe,r=[],o=Oe,a=Oe,Ge(),u.substr(Oe,2)===O?(s=O,Oe+=2):s=i,Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i);o!==i;)r.push(o),o=Oe,a=Oe,Ge(),u.substr(Oe,2)===O?(s=O,Oe+=2):s=i,Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i);n=u.substring(n,Oe),u.substr(Oe,2)===O?(r=O,Oe+=2):r=i,r!==i?(je=e,e=Ce(n)):(Oe=e,e=i)}else Oe=e,e=i;return e}())===i&&(e=ct()),Ne--,e}function st(){var e,t,n,r,o,a,s,c=function(u){0===Ne&&Xe(u)};if(e=Oe,c(Nu),u.substr(Oe,2)===R?(t=R,Oe+=2):t=i,t!==i){for(n=Oe,r=[],o=Oe,a=Oe,Ge(),c(wu),u.substr(Oe,2)===O?(s=O,Oe+=2):s=i,s===i&&(s=ot()),Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i);o!==i;)r.push(o),o=Oe,a=Oe,Ge(),c(wu),u.substr(Oe,2)===O?(s=O,Oe+=2):s=i,s===i&&(s=ot()),Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i);n=u.substring(n,Oe),c(wu),u.substr(Oe,2)===O?(r=O,Oe+=2):r=i,r!==i?(je=e,e=Ce(n)):(Oe=e,e=i)}else Oe=e,e=i;return e}function ct(){var e,t,n,r,o,a,s,c;if(e=Oe,c=Lu,0===Ne&&Xe(c),u.substr(Oe,2)===j?(t=j,Oe+=2):t=i,t!==i){for(n=Oe,r=[],o=Oe,a=Oe,Ge(),s=ot(),Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i);o!==i;)r.push(o),o=Oe,a=Oe,Ge(),s=ot(),Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i);n=u.substring(n,Oe),je=e,e=he(n)}else Oe=e,e=i;return e}function pt(){var u,e,t,n,r;if(r=Uu,0===Ne&&Xe(r),Ne++,u=Oe,(e=lt())!==i){for(t=[],n=At();n!==i;)t.push(n),n=At();je=u,u=Fe(e,t)}else Oe=u,u=i;return Ne--,u}function lt(){var e,t,n;return(e=function(){var e;return(e=function(){var e;return fu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}())===i&&(e=function(){var e;return cu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}())===i&&(e=function(){var e;return Au.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}())===i&&(e=function(){var e;return pu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}())===i&&(e=function(){var e;return lu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}())===i&&(e=function(){var e;return Fu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}()),e}())===i&&(36===u.charCodeAt(Oe)?(e=f,Oe++):e=i,e===i&&(95===u.charCodeAt(Oe)?(e=T,Oe++):e=i,e===i&&(e=Oe,92===u.charCodeAt(Oe)?(t=I,Oe++):t=i,t!==i&&(n=Dt())!==i?e=n:(Oe=e,e=i)))),e}function At(){var e;return(e=lt())===i&&(e=function(){var e;return(e=function(){var e;return Cu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}())===i&&(e=function(){var e;return Eu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}()),e}())===i&&(e=function(){var e;return hu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}())===i&&(e=function(){var e;return du.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}())===i&&(8204===u.charCodeAt(Oe)?(e=N,Oe++):e=i,e===i&&(8205===u.charCodeAt(Oe)?(e=w,Oe++):e=i)),e}function ft(){var e,t,n,r,o;if(o=zu,0===Ne&&Xe(o),Ne++,e=Oe,34===u.charCodeAt(Oe)?(t=U,Oe++):t=i,t!==i){for(n=[],r=Et();r!==i;)n.push(r),r=Et();34===u.charCodeAt(Oe)?(r=U,Oe++):r=i,r!==i?(je=e,e=ge(n)):(Oe=e,e=i)}else Oe=e,e=i;if(e===i)if(e=Oe,39===u.charCodeAt(Oe)?(t=H,Oe++):t=i,t!==i){for(n=[],r=Ct();r!==i;)n.push(r),r=Ct();39===u.charCodeAt(Oe)?(r=H,Oe++):r=i,r!==i?(je=e,e=ge(n)):(Oe=e,e=i)}else Oe=e,e=i;return Ne--,e}function Et(){var e,t,n;return e=Oe,t=Oe,Ge(),34===u.charCodeAt(Oe)?(n=U,Oe++):n=i,n===i&&(92===u.charCodeAt(Oe)?(n=I,Oe++):n=i,n===i&&(n=ot())),Ye(!0),n===i?t=void 0:(Oe=t,t=i),t!==i&&(n=nt())!==i?e=n:(Oe=e,e=i),e===i&&(e=Oe,92===u.charCodeAt(Oe)?(t=I,Oe++):t=i,t!==i&&(n=gt())!==i?e=n:(Oe=e,e=i),e===i&&(e=dt())),e}function Ct(){var e,t,n;return e=Oe,t=Oe,Ge(),39===u.charCodeAt(Oe)?(n=H,Oe++):n=i,n===i&&(92===u.charCodeAt(Oe)?(n=I,Oe++):n=i,n===i&&(n=ot())),Ye(!0),n===i?t=void 0:(Oe=t,t=i),t!==i&&(n=nt())!==i?e=n:(Oe=e,e=i),e===i&&(e=Oe,92===u.charCodeAt(Oe)?(t=I,Oe++):t=i,t!==i&&(n=gt())!==i?e=n:(Oe=e,e=i),e===i&&(e=dt())),e}function ht(){var e;return(e=function(){var e,t,n,r;return e=Oe,(t=Ft())!==i?(45===u.charCodeAt(Oe)?(n=G,Oe++):n=i,n!==i&&(r=Ft())!==i?(je=e,e=De(t,r)):(Oe=e,e=i)):(Oe=e,e=i),e}())===i&&(e=Ft()),e}function Ft(){var e,t,n;return e=Oe,t=Oe,Ge(),93===u.charCodeAt(Oe)?(n=V,Oe++):n=i,n===i&&(92===u.charCodeAt(Oe)?(n=I,Oe++):n=i,n===i&&(n=ot())),Ye(!0),n===i?t=void 0:(Oe=t,t=i),t!==i&&(n=nt())!==i?e=n:(Oe=e,e=i),e===i&&(e=Oe,92===u.charCodeAt(Oe)?(t=I,Oe++):t=i,t!==i&&(n=gt())!==i?e=n:(Oe=e,e=i),e===i&&(e=dt())),e}function dt(){var e,t;return e=Oe,92===u.charCodeAt(Oe)?(t=I,Oe++):t=i,t!==i&&it()!==i?(je=e,e=Be()):(Oe=e,e=i),e}function gt(){var e,t,n,r;return(e=function(){var e;return(e=vt())===i&&(e=function(){var e,t,n;return e=Oe,t=Oe,Ge(),(n=function(){var e;return(e=vt())===i&&(e=Bt())===i&&(120===u.charCodeAt(Oe)?(e=Q,Oe++):e=i,e===i&&(117===u.charCodeAt(Oe)?(e=uu,Oe++):e=i)),e}())===i&&(n=ot()),Ye(!0),n===i?t=void 0:(Oe=t,t=i),t!==i&&(n=nt())!==i?e=n:(Oe=e,e=i),e}()),e}())===i&&(e=Oe,48===u.charCodeAt(Oe)?(t=X,Oe++):t=i,t!==i?(n=Oe,Ge(),r=Bt(),Ye(!0),r===i?n=void 0:(Oe=n,n=i),n!==i?(je=e,e=me()):(Oe=e,e=i)):(Oe=e,e=i),e===i&&(e=function(){var e,t,n,r,o,a;return e=Oe,120===u.charCodeAt(Oe)?(t=Q,Oe++):t=i,t!==i?(n=Oe,r=Oe,(o=mt())!==i&&(a=mt())!==i?r=o=[o,a]:(Oe=r,r=i),(n=r!==i?u.substring(n,Oe):r)!==i?(je=e,e=Se(n)):(Oe=e,e=i)):(Oe=e,e=i),e}())===i&&(e=Dt())),e}function vt(){var e,t;return 39===u.charCodeAt(Oe)?(e=H,Oe++):e=i,e===i&&(34===u.charCodeAt(Oe)?(e=U,Oe++):e=i,e===i&&(92===u.charCodeAt(Oe)?(e=I,Oe++):e=i,e===i&&(e=Oe,98===u.charCodeAt(Oe)?(t=Y,Oe++):t=i,t!==i&&(je=e,t=xe()),(e=t)===i&&(e=Oe,102===u.charCodeAt(Oe)?(t=W,Oe++):t=i,t!==i&&(je=e,t=be()),(e=t)===i&&(e=Oe,110===u.charCodeAt(Oe)?(t=q,Oe++):t=i,t!==i&&(je=e,t=Pe()),(e=t)===i&&(e=Oe,114===u.charCodeAt(Oe)?(t=J,Oe++):t=i,t!==i&&(je=e,t=ye()),(e=t)===i&&(e=Oe,116===u.charCodeAt(Oe)?(t=K,Oe++):t=i,t!==i&&(je=e,t=_e()),(e=t)===i&&(e=Oe,118===u.charCodeAt(Oe)?(t=Z,Oe++):t=i,t!==i&&(je=e,t=$e()),e=t)))))))),e}function Dt(){var e,t,n,r,o,a,s,c;return e=Oe,117===u.charCodeAt(Oe)?(t=uu,Oe++):t=i,t!==i?(n=Oe,r=Oe,(o=mt())!==i&&(a=mt())!==i&&(s=mt())!==i&&(c=mt())!==i?r=o=[o,a,s,c]:(Oe=r,r=i),(n=r!==i?u.substring(n,Oe):r)!==i?(je=e,e=Se(n)):(Oe=e,e=i)):(Oe=e,e=i),e}function Bt(){var e;return iu.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}function mt(){var e;return au.test(u.charAt(Oe))?(e=u.charAt(Oe),Oe++):e=i,e}function xt(){var e,t,n,r,o;return o=Gu,0===Ne&&Xe(o),Ne++,e=Oe,123===u.charCodeAt(Oe)?(t=tu,Oe++):t=i,t!==i?(n=function e(){var t,n,r,o,a,s;if(t=Oe,n=[],r=[],o=Oe,a=Oe,Ge(),su.test(u.charAt(Oe))?(s=u.charAt(Oe),Oe++):s=i,Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i),o!==i)for(;o!==i;)r.push(o),o=Oe,a=Oe,Ge(),su.test(u.charAt(Oe))?(s=u.charAt(Oe),Oe++):s=i,Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i);else r=i;for(r===i&&(r=Oe,123===u.charCodeAt(Oe)?(o=tu,Oe++):o=i,o!==i?(a=e(),125===u.charCodeAt(Oe)?(s=nu,Oe++):s=i,s!==i?r=o=[o,a,s]:(Oe=r,r=i)):(Oe=r,r=i));r!==i;){if(n.push(r),r=[],o=Oe,a=Oe,Ge(),su.test(u.charAt(Oe))?(s=u.charAt(Oe),Oe++):s=i,Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i),o!==i)for(;o!==i;)r.push(o),o=Oe,a=Oe,Ge(),su.test(u.charAt(Oe))?(s=u.charAt(Oe),Oe++):s=i,Ye(!0),s===i?a=void 0:(Oe=a,a=i),a!==i&&(s=nt())!==i?o=a=[a,s]:(Oe=o,o=i);else r=i;r===i&&(r=Oe,123===u.charCodeAt(Oe)?(o=tu,Oe++):o=i,o!==i?(a=e(),125===u.charCodeAt(Oe)?(s=nu,Oe++):s=i,s!==i?r=o=[o,a,s]:(Oe=r,r=i)):(Oe=r,r=i))}return t=u.substring(t,Oe)}(),125===u.charCodeAt(Oe)?(r=nu,Oe++):r=i,r!==i?e=n:(Oe=e,e=i)):(Oe=e,e=i),e===i&&(e=Oe,123===u.charCodeAt(Oe)?(t=tu,Oe++):t=i,t!==i&&(je=e,t=Re()),e=t),Ne--,e}function bt(){var u,e;for(u=[],(e=rt())===i&&(e=it())===i&&(e=at());e!==i;)u.push(e),(e=rt())===i&&(e=it())===i&&(e=at());return u}function Pt(){var e,t,n,r,o;return e=Oe,t=bt(),o=Xu,0===Ne&&Xe(o),59===u.charCodeAt(Oe)?(n=ru,Oe++):n=i,n!==i?e=t=[t,n]:(Oe=e,e=i),e===i&&(e=Oe,t=function(){var u,e;for(u=[],(e=rt())===i&&(e=st());e!==i;)u.push(e),(e=rt())===i&&(e=st());return u}(),(n=ct())===i&&(n=null),(r=it())!==i?e=t=[t,n,r]:(Oe=e,e=i),e===i&&(e=Oe,t=bt(),(n=function(){var e,t,n;return e=Oe,Ge(),n=Ru,0===Ne&&Xe(n),u.length>Oe?(t=u.charAt(Oe),Oe++):t=i,Ye(!0),t===i?e=void 0:(Oe=e,e=i),e}())!==i?e=t=[t,n]:(Oe=e,e=i))),e}var yt=!0,_t={},$t=e.reservedWords||r.reservedWords;function St(u,e){var t=new n.Node(u,we());return null===e?t:(r.extend(t,e),r.enforceFastProperties(t))}Array.isArray($t)&&$t.forEach(function(u){_t[u]=!0});var kt,Rt,Ot=e.extractComments?{}:null;function jt(u,t){if(e.extractComments){var n=we();Ot[n.start.offset]={text:u,multiline:t,location:n}}return u}if(Ge(),(t=s())!==i&&Oe===u.length)return t;throw t!==i&&Oe2&&void 0!==arguments[2]?arguments[2]:{};switch("parser"===(t=h.processOptions(t,{allowedStartRules:[u.rules[0].name],cache:!1,context:{},dependencies:{},exportVar:null,features:null,format:"bare",header:null,optimize:"speed",output:"parser",trace:!1})).output&&(t.format="umd"),h.each(e.passes,function(n){n.forEach(function(n){n(u,e,t)})}),t.output){case"parser":return e.vm.evalModule(u.code,t.context);case"source":return u.code;default:e.error("Invalid output format: ".concat(t.output,"."))}}};u.exports=F},function(u,e,t){"use strict";u.exports=function(u,e,t){u.rules.forEach(function(u){u.reportFailures=!1});for(var n=t.allowedStartRules.map(function(e){var t=u.findRule(e);return t.reportFailures=!0,t}),r=e.buildVisitor({rule:function(u){r(u.expression)},named:function(){},rule_ref:function(e){var t=u.findRule(e.name);t.reportFailures||(t.reportFailures=!0,n.push(t))}});n.length>0;)r(n.pop())}},function(u,e,t){"use strict";var n=t(1);u.exports=function(u,e){var t,r=e.opcodes,o=[],i=[],a=[],s=[];function c(u){var e=JSON.stringify(u),t=n.findIndex(a,function(u){return JSON.stringify(u)===e});return-1===t?a.push(u)-1:t}function p(u,e,t){var r={predicate:u,params:e,body:t},o=JSON.stringify(r),i=n.findIndex(s,function(u){return JSON.stringify(u)===o});return-1===i?s.push(r)-1:i}var l=function(){var u;return(u=[]).concat.apply(u,arguments)};function A(u,e,t,n){return u>0?t:u<0?n:e.concat([t.length,n.length],t,n)}function f(u,e,t,o){var i=n.values(t,function(u){return o-u});return[r.CALL,u,e,i.length].concat(i)}function E(u,e,o){var i=0|u.match;return l([r.PUSH_CURR_POS],[r.EXPECT_NS_BEGIN],t(u,{sp:o.sp+1,env:n.clone(o.env),action:null,reportFailures:o.reportFailures}),[r.EXPECT_NS_END,e?1:0],A(e?-i:i,[e?r.IF_ERROR:r.IF_NOT_ERROR],l([r.POP],[e?r.POP:r.POP_CURR_POS],[r.PUSH_UNDEFINED]),l([r.POP],[e?r.POP_CURR_POS:r.POP],[r.PUSH_FAILED])))}function C(u,e,t){var n=p(!0,Object.keys(t.env),u.code);return l([r.UPDATE_SAVED_POS],f(n,0,t.env,t.sp),A(0|u.match,[r.IF],l([r.POP],e?[r.PUSH_FAILED]:[r.PUSH_UNDEFINED]),l([r.POP],e?[r.PUSH_UNDEFINED]:[r.PUSH_FAILED])))}function h(u){return e=[r.WHILE_NOT_ERROR],t=l([r.APPEND],u),e.concat([t.length],t);var e,t}(t=e.buildVisitor({grammar:function(u){u.rules.forEach(t),u.literals=o,u.classes=i,u.expectations=a,u.functions=s},rule:function(u){u.bytecode=t(u.expression,{sp:-1,env:{},action:null,reportFailures:u.reportFailures})},named:function(u,e){var n=e.reportFailures?c({type:"rule",value:u.name}):null,o=t(u.expression,{sp:e.sp,env:e.env,action:e.action,reportFailures:!1});return e.reportFailures?l([r.EXPECT,n],[r.SILENT_FAILS_ON],o,[r.SILENT_FAILS_OFF]):o},choice:function(u,e){return function u(e,o){return l(t(e[0],{sp:o.sp,env:n.clone(o.env),action:null,reportFailures:o.reportFailures}),e.length<2?[]:A(-(0|e[0].match),[r.IF_ERROR],l([r.POP],u(e.slice(1),o)),[]))}(u.alternatives,e)},action:function(u,e){var o=n.clone(e.env),i="sequence"!==u.expression.type||0===u.expression.elements.length,a=t(u.expression,{sp:e.sp+(i?1:0),env:o,action:u,reportFailures:e.reportFailures}),s=0|u.expression.match,c=i&&s>=0?p(!1,Object.keys(o),u.code):null;return!1===i?a:l([r.PUSH_CURR_POS],a,A(s,[r.IF_NOT_ERROR],l([r.LOAD_SAVED_POS,1],f(c,1,o,e.sp+2)),[]),[r.NIP])},sequence:function(u,e){var n=u.elements.length;return l([r.PUSH_CURR_POS],function u(e,o){if(e.length>0){var i=n-e.slice(1).length;return l(t(e[0],{sp:o.sp,env:o.env,pluck:o.pluck,action:null,reportFailures:o.reportFailures}),A(0|e[0].match,[r.IF_NOT_ERROR],u(e.slice(1),{sp:o.sp+1,env:o.env,pluck:o.pluck,action:o.action,reportFailures:o.reportFailures}),l(i>1?[r.POP_N,i]:[r.POP],[r.POP_CURR_POS],[r.PUSH_FAILED])))}return o.pluck.length>0?l([r.PLUCK,n+1,o.pluck.length],o.pluck.map(function(u){return o.sp-u})):o.action?l([r.LOAD_SAVED_POS,n],f(p(!1,Object.keys(o.env),o.action.code),n+1,o.env,o.sp)):l([r.WRAP,n],[r.NIP])}(u.elements,{sp:e.sp+1,env:e.env,pluck:[],action:e.action,reportFailures:e.reportFailures}))},labeled:function(u,e){var r=e.env,o=u.label,i=e.sp+1;return null!==o&&(r=n.clone(e.env),e.env[o]=i),e.pluck&&u.pick&&e.pluck.push(i),t(u.expression,{sp:e.sp,env:r,action:null,reportFailures:e.reportFailures})},text:function(u,e){return l([r.PUSH_CURR_POS],t(u.expression,{sp:e.sp+1,env:n.clone(e.env),action:null,reportFailures:e.reportFailures}),A(0|u.expression.match,[r.IF_NOT_ERROR],l([r.POP],[r.TEXT]),[r.NIP]))},simple_and:function(u,e){return E(u.expression,!1,e)},simple_not:function(u,e){return E(u.expression,!0,e)},optional:function(u,e){return l(t(u.expression,{sp:e.sp,env:n.clone(e.env),action:null,reportFailures:e.reportFailures}),A(-(0|u.expression.match),[r.IF_ERROR],l([r.POP],[r.PUSH_NULL]),[]))},zero_or_more:function(u,e){var o=t(u.expression,{sp:e.sp+1,env:n.clone(e.env),action:null,reportFailures:e.reportFailures});return l([r.PUSH_EMPTY_ARRAY],o,h(o),[r.POP])},one_or_more:function(u,e){var o=t(u.expression,{sp:e.sp+1,env:n.clone(e.env),action:null,reportFailures:e.reportFailures});return l([r.PUSH_EMPTY_ARRAY],o,A(0|u.expression.match,[r.IF_NOT_ERROR],l(h(o),[r.POP]),l([r.POP],[r.POP],[r.PUSH_FAILED])))},group:function(u,e){return t(u.expression,{sp:e.sp,env:n.clone(e.env),action:null,reportFailures:e.reportFailures})},semantic_and:function(u,e){return C(u,!1,e)},semantic_not:function(u,e){return C(u,!0,e)},rule_ref:function(e){return[r.RULE,u.indexOfRule(e.name)]},literal:function(u,e){if(u.value.length>0){var t=0|u.match,n=0===t||t>0&&!u.ignoreCase?(a=u.ignoreCase?u.value.toLowerCase():u.value,-1===(s=o.indexOf(a))?o.push(a)-1:s):null,i=e.reportFailures?c({type:"literal",value:u.value,ignoreCase:u.ignoreCase}):null;return l(e.reportFailures?[r.EXPECT,i]:[],A(t,u.ignoreCase?[r.MATCH_STRING_IC,n]:[r.MATCH_STRING,n],u.ignoreCase?[r.ACCEPT_N,u.value.length]:[r.ACCEPT_STRING,n],[r.PUSH_FAILED]))}var a,s;return[r.PUSH_EMPTY_STRING]},class:function(u,e){var t=0|u.match,o=0===t?function(u){var e={value:u.parts,inverted:u.inverted,ignoreCase:u.ignoreCase},t=JSON.stringify(e),r=n.findIndex(i,function(u){return JSON.stringify(u)===t});return-1===r?i.push(e)-1:r}(u):null,a=e.reportFailures?c({type:"class",value:u.parts,inverted:u.inverted,ignoreCase:u.ignoreCase}):null;return l(e.reportFailures?[r.EXPECT,a]:[],A(t,[r.MATCH_CLASS,o],[r.ACCEPT_N,1],[r.PUSH_FAILED]))},any:function(u,e){var t=e.reportFailures?c({type:"any"}):null;return l(e.reportFailures?[r.EXPECT,t]:[],A(0|u.match,[r.MATCH_ANY],[r.ACCEPT_N,1],[r.PUSH_FAILED]))}}))(u)}},function(u,e,t){"use strict";var n=t(1),r=t(13).version;u.exports=function(u,e,t){var o=e.opcodes,i=t.features||{};function a(u,e){return u in i?!!i[u]:null==e||!!e}var s=/^([^`\r\n]+?(?:`[^`]*?`[^\r\n]*?)?)$/gm;function c(u){return u.replace(s," $1")}function p(u){return u.replace(s," $1")}var l=function(u){return"peg$c"+u},A=function(u){return"peg$r"+u},f=function(u){return"peg$e"+u},E=function(u){return"peg$f"+u};function C(e,n){var r=[];return r.push(["","var rule$expects = function (expected) {"," if (peg$silentFails === 0) peg$expect(expected);","}",""].join("\n")),t.trace&&r.push(["peg$tracer.trace({",' type: "rule.enter",'," rule: "+e+","," location: peg$computeLocation(startPos, startPos)","});",""].join("\n")),t.cache&&(r.push(["var key = peg$currPos * "+u.rules.length+" + "+n+";","var cached = peg$resultsCache[key];","var rule$expectations = [];","","rule$expects = function (expected) {"," if (peg$silentFails === 0) peg$expect(expected);"," rule$expectations.push(expected);","}","","if (cached) {"," peg$currPos = cached.nextPos;",""," rule$expectations = cached.expectations;"," if (peg$silentFails === 0) {"," rule$expectations.forEach(peg$expect);"," }",""].join("\n")),t.trace&&r.push(["if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+e+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+e+","," location: peg$computeLocation(startPos, startPos)"," });","}",""].join("\n")),r.push([" return cached.result;","}",""].join("\n"))),r.join("\n")}function h(u,e){var n=[];return t.cache&&n.push(["","peg$resultsCache[key] = {"," nextPos: peg$currPos,"," result: "+e+","," expectations: rule$expectations","};"].join("\n")),t.trace&&n.push(["","if ("+e+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+u+","," result: "+e+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+u+","," location: peg$computeLocation(startPos, startPos)"," });","}"].join("\n")),n.push(["","return "+e+";"].join("\n")),n.join("\n")}u.code=function(u){function e(){var u="// Generated by PEG.js v".concat(r,", https://pegjs.org/"),e=t.header;return"string"==typeof e?u+="\n\n"+e:Array.isArray(e)&&(u+="\n\n",e.forEach(function(e){u+="// "+e})),u}function o(){return t.trace&&a("DefaultTracer")?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}return{bare:function(){return[e(),"(function() {",' "use strict";',"",c(u),"",c("return "+o()+";"),"})()"].join("\n")},commonjs:function(){var r=[],i=Object.keys(t.dependencies);return r.push([e(),"",'"use strict";',""].join("\n")),i.length>0&&(i.forEach(function(u){r.push("var "+u+' = require("'+n.stringEscape(t.dependencies[u])+'");')}),r.push("")),r.push([u,"","module.exports = "+o()+";",""].join("\n")),r.join("\n")},es:function(){var r=[],i=Object.keys(t.dependencies);return r.push(e(),""),i.length>0&&(i.forEach(function(u){r.push("import "+u+' from "'+n.stringEscape(t.dependencies[u])+'";')}),r.push("")),r.push(u,"","export "+(t.trace&&a("DefaultTracer")?["{"," peg$SyntaxError as SyntaxError,"," peg$DefaultTracer as DefaultTracer,"," peg$parse as parse","}"].join("\n"):["{"," peg$SyntaxError as SyntaxError,"," peg$parse as parse","}"].join("\n"))+";","","export default "+o()+";",""),r.join("\n")},amd:function(){var r=Object.keys(t.dependencies),i="["+r.map(function(u){return t.dependencies[u]}).map(function(u){return'"'.concat(n.stringEscape(u),'"')}).join(", ")+"]",a=r.join(", ");return[e(),"define("+i+", function("+a+") {",' "use strict";',"",c(u),"",c("return "+o()+";"),"});",""].join("\n")},globals:function(){return[e(),"(function(root) {",' "use strict";',"",c(u),"",c("root."+t.exportVar+" = "+o()+";"),"})(this);",""].join("\n")},umd:function(){var r=[],i=Object.keys(t.dependencies),a=i.map(function(u){return t.dependencies[u]}),s="["+a.map(function(u){return'"'.concat(n.stringEscape(u),'"')}).join(", ")+"]",p=a.map(function(u){return'require("'.concat(n.stringEscape(u),'")')}).join(", "),l=i.map(function(u){return"root."+u}).join(", "),A=i.join(", ");return r.push([e(),"(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+s+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+p+");"].join("\n")),null!==t.exportVar&&r.push([" } else {"," root."+t.exportVar+" = factory("+l+");"].join("\n")),r.push([" }","})(this, function("+A+") {",' "use strict";',"",c(u),"",c("return "+o()+";"),"});",""].join("\n")),r.join("\n")}}[t.format]()}(function(){var r=[];if(r.push(["function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," this.message = message;"," this.expected = expected;"," this.found = found;"," this.location = location;",' this.name = "SyntaxError";',""," // istanbul ignore next",' if (typeof Error.captureStackTrace === "function") {'," Error.captureStackTrace(this, peg$SyntaxError);"," }","}","","peg$subclass(peg$SyntaxError, Error);","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," },",""," not: function(expectation) {",' return "not " + describeExpectation(expectation.expected);'," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""].join("\n")),t.trace&&(a("DefaultTracer")?r.push(["function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," // istanbul ignore next"," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};",""].join("\n")):r.push(["var peg$FauxTracer = {"," trace: function(event) { }","};",""].join("\n"))),r.push(["function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};",""].join("\n")),"size"===t.optimize){var i="{ "+t.allowedStartRules.map(function(e){return e+": "+u.indexOfRule(e)}).join(", ")+" }",s=u.indexOfRule(t.allowedStartRules[0]);r.push([" var peg$startRuleIndices = "+i+";"," var peg$startRuleIndex = "+s+";"].join("\n"))}else{var F="{ "+t.allowedStartRules.map(function(u){return u+": peg$parse"+u}).join(", ")+" }",d="peg$parse"+t.allowedStartRules[0];r.push([" var peg$startRuleFunctions = "+F+";"," var peg$startRuleFunction = "+d+";"].join("\n"))}if(r.push(""),r.push(c(function(){function r(u){return'"'.concat(n.stringEscape(u),'"')}function o(u){return"/^["+(u.inverted?"^":"")+u.value.map(function(u){return Array.isArray(u)?n.regexpEscape(u[0])+"-"+n.regexpEscape(u[1]):n.regexpEscape(u)}).join("")+"]/"+(u.ignoreCase?"i":"")}function i(u){switch(u.type){case"rule":return'peg$otherExpectation("'.concat(n.stringEscape(u.value),'")');case"literal":return'peg$literalExpectation("'+n.stringEscape(u.value)+'", '+u.ignoreCase+")";case"class":return"peg$classExpectation(["+u.value.map(function(u){return Array.isArray(u)?'["'.concat(n.stringEscape(u[0]),'", "').concat(n.stringEscape(u[1]),'"]'):'"'.concat(n.stringEscape(u),'"')}).join(", ")+"], "+u.inverted+", "+u.ignoreCase+")";case"any":return"peg$anyExpectation()";default:e.fatal("Unknown expectation type (".concat(JSON.stringify(u),")"))}}function a(u){return"function(".concat(u.params.join(", "),") {").concat(u.body,"}")}return"size"===t.optimize?["var peg$literals = [",c(u.literals.map(r).join(",\n")),"];","var peg$regexps = [",c(u.classes.map(o).join(",\n")),"];","var peg$expectations = [",c(u.expectations.map(i).join(",\n")),"];","var peg$functions = [",c(u.functions.map(a).join(",\n")),"];","","var peg$bytecode = [",c(u.rules.map(function(u){return'peg$decode("'.concat(n.stringEscape(u.bytecode.map(function(u){return String.fromCharCode(u+32)}).join("")),'")')}).join(",\n")),"];"].join("\n"):u.literals.map(function(u,e){return"var "+l(e)+" = "+r(u)+";"}).concat("",u.classes.map(function(u,e){return"var "+A(e)+" = "+o(u)+";"})).concat("",u.expectations.map(function(u,e){return"var "+f(e)+" = "+i(u)+";"})).concat("",u.functions.map(function(u,e){return"var "+E(e)+" = "+a(u)+";"})).join("\n")}())),r.push([""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$expected = [];"," var peg$silentFails = 0;",""].join("\n")),t.cache&&r.push([" var peg$resultsCache = {};",""].join("\n")),t.trace){if("size"===t.optimize){var g="["+u.rules.map(function(u){return'"'.concat(n.stringEscape(u.name),'"')}).join(", ")+"]";r.push([" var peg$ruleNames = "+g+";",""].join("\n"))}a("DefaultTracer")?r.push([' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""].join("\n")):r.push([' var peg$tracer = "tracer" in options ? options.tracer : peg$FauxTracer;',""].join("\n"))}return r.push([" var peg$result;",""].join("\n")),"size"===t.optimize?r.push([' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleIndices)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleIndex = peg$startRuleIndices[options.startRule];"," }"].join("\n")):r.push([' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }"].join("\n")),a("text")&&r.push([""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }"].join("\n")),a("offset")&&r.push([""," function offset() {"," return peg$savedPos;"," }"].join("\n")),a("range")&&r.push([""," function range() {"," return [peg$savedPos, peg$currPos];"," }"].join("\n")),a("location")&&r.push([""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }"].join("\n")),a("expected")&&r.push([""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }"].join("\n")),a("error")&&r.push([""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }"].join("\n")),r.push([""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }","",a("filename")?' var peg$VALIDFILENAME = typeof options.filename === "string" && options.filename.length > 0;':""," function peg$computeLocation(startPos, endPos) {"," var loc = {};","",a("filename")?" if ( peg$VALIDFILENAME ) loc.filename = options.filename;":"",""," var startPosDetails = peg$computePosDetails(startPos);"," loc.start = {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," };",""," var endPosDetails = peg$computePosDetails(endPos);"," loc.end = {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," };",""," return loc;"," }",""," function peg$begin() {"," peg$expected.push({ pos: peg$currPos, variants: [] });"," }",""," function peg$expect(expected) {"," var top = peg$expected[peg$expected.length - 1];",""," if (peg$currPos < top.pos) { return; }",""," if (peg$currPos > top.pos) {"," top.pos = peg$currPos;"," top.variants = [];"," }",""," top.variants.push(expected);"," }",""," function peg$end(invert) {"," var expected = peg$expected.pop();"," var top = peg$expected[peg$expected.length - 1];"," var variants = expected.variants;",""," if (top.pos !== expected.pos) { return; }",""," if (invert) {"," variants = variants.map(function(e) {",' return e.type === "not" ? e.expected : { type: "not", expected: e };'," });"," }",""," Array.prototype.push.apply(top.variants, variants);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""," function peg$buildError() {"," var expected = peg$expected[0];"," var failPos = expected.pos;",""," return peg$buildStructuredError("," expected.variants,"," failPos < input.length ? input.charAt(failPos) : null,"," failPos < input.length"," ? peg$computeLocation(failPos, failPos + 1)"," : peg$computeLocation(failPos, failPos)"," );"," }",""].join("\n")),"size"===t.optimize?(r.push(c(function(){var u,e=[];function n(u,e){var t=e+3,n="bc[ip + "+(t-2)+"]",r="bc[ip + "+(t-1)+"]";return["ends.push(end);","ips.push(ip + "+t+" + "+n+" + "+r+");","","if ("+u+") {"," end = ip + "+t+" + "+n+";"," ip += "+t+";","} else {"," end = ip + "+t+" + "+n+" + "+r+";"," ip += "+t+" + "+n+";","}","","break;"].join("\n")}return e.push(["function peg$decode(s) {",' return s.split("").map(function(ch) { return ch.charCodeAt(0) - 32; });',"}","","function peg$parseRule(index) {"].join("\n")),t.trace?e.push([" var bc = peg$bytecode[index];"," var ip = 0;"," var ips = [];"," var end = bc.length;"," var ends = [];"," var stack = [];"," var startPos = peg$currPos;"," var params, paramsLength, paramsN;"].join("\n")):e.push([" var bc = peg$bytecode[index];"," var ip = 0;"," var ips = [];"," var end = bc.length;"," var ends = [];"," var stack = [];"," var params, paramsLength, paramsN;"].join("\n")),e.push(c(C("peg$ruleNames[index]","index"))),e.push([" while (true) {"," while (ip < end) {"," switch (bc[ip]) {"," case "+o.PUSH_EMPTY_STRING+":"," stack.push('');"," ip++;"," break;",""," case "+o.PUSH_UNDEFINED+":"," stack.push(undefined);"," ip++;"," break;",""," case "+o.PUSH_NULL+":"," stack.push(null);"," ip++;"," break;",""," case "+o.PUSH_FAILED+":"," stack.push(peg$FAILED);"," ip++;"," break;",""," case "+o.PUSH_EMPTY_ARRAY+":"," stack.push([]);"," ip++;"," break;",""," case "+o.PUSH_CURR_POS+":"," stack.push(peg$currPos);"," ip++;"," break;",""," case "+o.POP+":"," stack.pop();"," ip++;"," break;",""," case "+o.POP_CURR_POS+":"," peg$currPos = stack.pop();"," ip++;"," break;",""," case "+o.POP_N+":"," stack.length -= bc[ip + 1];"," ip += 2;"," break;",""," case "+o.NIP+":"," stack.splice(-2, 1);"," ip++;"," break;",""," case "+o.APPEND+":"," stack[stack.length - 2].push(stack.pop());"," ip++;"," break;",""," case "+o.WRAP+":"," stack.push(stack.splice(stack.length - bc[ip + 1], bc[ip + 1]));"," ip += 2;"," break;",""," case "+o.TEXT+":"," stack.push(input.substring(stack.pop(), peg$currPos));"," ip++;"," break;",""," case "+o.PLUCK+":"," paramsLength = bc[ip + 2];"," paramsN = 3 + paramsLength",""," params = bc.slice(ip + 3, ip + paramsN);"," params = paramsLength === 1"," ? stack[stack.length - 1 - params[ 0 ]]"," : params.map(function(p) { return stack[stack.length - 1 - p]; });",""," stack.splice("," stack.length - bc[ip + 1],"," bc[ip + 1],"," params"," );",""," ip += paramsN;"," break;",""," case "+o.IF+":",p(n("stack[stack.length - 1]",0)),""," case "+o.IF_ERROR+":",p(n("stack[stack.length - 1] === peg$FAILED",0)),""," case "+o.IF_NOT_ERROR+":",p(n("stack[stack.length - 1] !== peg$FAILED",0)),""," case "+o.WHILE_NOT_ERROR+":",p((u="stack[stack.length - 1] !== peg$FAILED",["if ("+u+") {"," ends.push(end);"," ips.push(ip);",""," end = ip + 2 + bc[ip + 1];"," ip += 2;","} else {"," ip += 2 + bc[ip + 1];","}","","break;"].join("\n"))),""," case "+o.MATCH_ANY+":",p(n("input.length > peg$currPos",0)),""," case "+o.MATCH_STRING+":",p(n("input.substr(peg$currPos, peg$literals[bc[ip + 1]].length) === peg$literals[bc[ip + 1]]",1)),""," case "+o.MATCH_STRING_IC+":",p(n("input.substr(peg$currPos, peg$literals[bc[ip + 1]].length).toLowerCase() === peg$literals[bc[ip + 1]]",1)),""," case "+o.MATCH_CLASS+":",p(n("peg$regexps[bc[ip + 1]].test(input.charAt(peg$currPos))",1)),""," case "+o.ACCEPT_N+":"," stack.push(input.substr(peg$currPos, bc[ip + 1]));"," peg$currPos += bc[ip + 1];"," ip += 2;"," break;",""," case "+o.ACCEPT_STRING+":"," stack.push(peg$literals[bc[ip + 1]]);"," peg$currPos += peg$literals[bc[ip + 1]].length;"," ip += 2;"," break;",""," case "+o.EXPECT+":"," rule$expects(peg$expectations[bc[ip + 1]]);"," ip += 2;"," break;",""," case "+o.LOAD_SAVED_POS+":"," peg$savedPos = stack[stack.length - 1 - bc[ip + 1]];"," ip += 2;"," break;",""," case "+o.UPDATE_SAVED_POS+":"," peg$savedPos = peg$currPos;"," ip++;"," break;",""," case "+o.CALL+":",p(["params = bc.slice(ip + 4, ip + 4 + bc[ip + 3])"," .map(function(p) { return stack[stack.length - 1 - p]; });","","stack.splice("," stack.length - bc[ip + 2],"," bc[ip + 2],"," peg$functions[bc[ip + 1]].apply(null, params)",");","","ip += 4 + bc[ip + 3];","break;"].join("\n")),""," case "+o.RULE+":"," stack.push(peg$parseRule(bc[ip + 1]));"," ip += 2;"," break;",""," case "+o.SILENT_FAILS_ON+":"," peg$silentFails++;"," ip++;"," break;",""," case "+o.SILENT_FAILS_OFF+":"," peg$silentFails--;"," ip++;"," break;",""," case "+o.EXPECT_NS_BEGIN+":"," peg$begin();"," ip++;"," break;",""," case "+o.EXPECT_NS_END+":"," peg$end(bc[ip + 1]);"," ip += 2;"," break;",""," // istanbul ignore next"," default:"," throw new Error(",' "Rule #" + index + "'+(t.trace?" ('\" + peg$ruleNames[ index ] + \"')":"")+', position " + ip + ": "',' + "Invalid opcode " + bc[ip] + "."'," );"," }"," }",""," if (ends.length > 0) {"," end = ends.pop();"," ip = ips.pop();"," } else {"," break;"," }"," }"].join("\n")),e.push(c(h("peg$ruleNames[index]","stack[0]"))),e.push("}"),e.join("\n")}())),r.push("")):u.rules.forEach(function(i){r.push(c(function(r){var i=[],a=[];function s(u){return u<0&&e.fatal("Rule '"+r.name+"': Var stack underflow: attempt to use var at index "+u),"s"+u}var p={sp:-1,maxSp:-1,push:function(u){var e=s(++this.sp)+" = "+u+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),e},pop:function(u){if(void 0===u)return s(this.sp--);for(var e=Array(u),t=0;t0&&(p.sp=h,a=t(n.slice(g,g+C)),l=p.sp,g+=C,s!==l&&e.fatal("Rule '"+r.name+"', position "+A+": Branches of a condition can't move the stack pointer differently (before: "+h+", after then: "+s+", after else: "+l+").")),D.push("if ("+u+") {"),D.push(c(i)),C>0&&(D.push("} else {"),D.push(c(a))),D.push("}")}function m(){var u=n[g+4-1],e=E(n[g+1])+"("+n.slice(g+4,g+4+u).map(function(u){return p.index(u)}).join(", ")+")";p.pop(n[g+2]),D.push(p.push(e)),g+=4+u}for(;g peg$currPos",0);break;case o.MATCH_STRING:B(u.literals[n[g+1]].length>1?"input.substr(peg$currPos, "+u.literals[n[g+1]].length+") === "+l(n[g+1]):"input.charCodeAt(peg$currPos) === "+u.literals[n[g+1]].charCodeAt(0),1);break;case o.MATCH_STRING_IC:B("input.substr(peg$currPos, "+u.literals[n[g+1]].length+").toLowerCase() === "+l(n[g+1]),1);break;case o.MATCH_CLASS:B(A(n[g+1])+".test(input.charAt(peg$currPos))",1);break;case o.ACCEPT_N:D.push(p.push(n[g+1]>1?"input.substr(peg$currPos, "+n[g+1]+")":"input.charAt(peg$currPos)")),D.push(n[g+1]>1?"peg$currPos += "+n[g+1]+";":"peg$currPos++;"),g+=2;break;case o.ACCEPT_STRING:D.push(p.push(l(n[g+1]))),D.push(u.literals[n[g+1]].length>1?"peg$currPos += "+u.literals[n[g+1]].length+";":"peg$currPos++;"),g+=2;break;case o.EXPECT:D.push("rule$expects("+f(n[g+1])+");"),g+=2;break;case o.LOAD_SAVED_POS:D.push("peg$savedPos = "+p.index(n[g+1])+";"),g+=2;break;case o.UPDATE_SAVED_POS:D.push("peg$savedPos = peg$currPos;"),g++;break;case o.CALL:m();break;case o.RULE:D.push(p.push("peg$parse"+u.rules[n[g+1]].name+"()")),g+=2;break;case o.SILENT_FAILS_ON:D.push("peg$silentFails++;"),g++;break;case o.SILENT_FAILS_OFF:D.push("peg$silentFails--;"),g++;break;case o.EXPECT_NS_BEGIN:D.push("peg$begin();"),g++;break;case o.EXPECT_NS_END:D.push("peg$end("+(0!==n[g+1])+");"),g+=2;break;default:e.fatal("Rule '"+r.name+"', position "+g+": Invalid opcode "+n[g]+".")}return D.join("\n")}(r.bytecode);i.push("function peg$parse"+r.name+"() {"),t.trace&&i.push(" var startPos = peg$currPos;");for(var d=0;d<=p.maxSp;d++)a[d]=s(d);return i.push(" var "+a.join(", ")+";"),i.push(c(C('"'+n.stringEscape(r.name)+'"',u.indexOfRule(r.name)))),i.push(c(F)),i.push(c(h('"'+n.stringEscape(r.name)+'"',s(0)))),i.push("}"),i.join("\n")}(i))),r.push("")}),u.initializer&&(r.push(c(u.initializer.code)),r.push("")),r.push(" peg$begin();"),"size"===t.optimize?r.push(" peg$result = peg$parseRule(peg$startRuleIndex);"):r.push(" peg$result = peg$startRuleFunction();"),r.push([""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$expect(peg$endExpectation());"," }",""," throw peg$buildError();"," }","}"].join("\n")),r.join("\n")}())}},function(u,e,t){"use strict";u.exports=function(u,e,t){var n=e.buildVisitor({rule_ref:function(u,e,t){u.name===e&&(u.name=t)}}),r=t.allowedStartRules,o=[];u.rules.forEach(function(e){var t;"rule"===(t=e).type&&"rule_ref"===t.expression.type&&(n(u,e.name,e.expression.name),r.indexOf(e.name)<0)||o.push(e)}),u.rules=o}},function(u,e,t){"use strict";var n=t(1),r=Object.prototype.hasOwnProperty;u.exports=function(u,e){var t;function o(u,e){t(u.expression,n.clone(e))}(t=e.buildVisitor({rule:function(u){t(u.expression,{})},choice:function(u,e){u.alternatives.forEach(function(u){t(u,n.clone(e))})},action:o,labeled:function(u,n){var o=u.label;if(o&&r.call(n,o)){var i=n[o].start;e.error('Label "'.concat(o,'" is already defined at line ').concat(i.line,", column ").concat(i.column,"."),u.location)}t(u.expression,n),o&&(n[o]=u.location)},text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o}))(u)}},function(u,e,t){"use strict";var n=Object.prototype.hasOwnProperty;u.exports=function(u,e){var t={};e.buildVisitor({rule:function(u){var r=u.name;if(n.call(t,r)){var o=t[r].start;e.error('Rule "'.concat(r,'" is already defined at line ').concat(o.line,", column ").concat(o.column,"."),u.location)}t[u.name]=u.location}})(u)}},function(u,e,t){"use strict";u.exports=function(u,e,t){var n={};function r(u){n[u.name||u]=!0}t.allowedStartRules.forEach(r),e.buildVisitor({rule_ref:r})(u),u.rules.forEach(function(u){!0!==n[u.name]&&e.warn('Rule "'.concat(u.name,'" is not referenced.'),u.location)})}},function(u,e,t){"use strict";u.exports=function(u,e){var t=[],n=e.buildVisitor({rule:function(u){t.push(u.name),n(u.expression),t.pop(u.name)},sequence:function(e){e.elements.every(function(e){return n(e),!u.alwaysConsumesOnSuccess(e)})},rule_ref:function(r){if(-1!==t.indexOf(r.name)){t.push(r.name);var o=t.join(" -> ");e.error("Possible infinite loop when parsing (left recursion: ".concat(o,")."),r.location)}n(u.findRule(r.name))}});n(u)}},function(u,e,t){"use strict";u.exports=function(u,e){e.buildVisitor({zero_or_more:function(t){u.alwaysConsumesOnSuccess(t.expression)||e.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input).",t.location)},one_or_more:function(t){u.alwaysConsumesOnSuccess(t.expression)||e.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input).",t.location)}})(u)}},function(u,e,t){"use strict";u.exports=function(u,e,t){e.buildVisitor({rule_ref:function(t){u.findRule(t.name)||e.error('Rule "'.concat(t.name,'" is not defined.'),t.location)}})(u),t.allowedStartRules.forEach(function(t){u.findRule(t)||e.error('Start rule "'.concat(t,'" is not defined.'))})}},function(u,e,t){"use strict";u.exports=function(u,e){var t;function n(u){return u.match=0,u.match}function r(u){return t(u.expression),u.match=1,u.match}function o(u){return u.match=t(u.expression),u.match}function i(u,e){for(var n=u.length,r=0,o=0,i=0;i0&&++r,a<0&&++o}return r===n?1:e?o===n?-1:0:o>0?-1:0}(t=e.buildVisitor({rule:function(u){var n,r=0;if(void 0===u.match){u.match=0;do{n=u.match,u.match=t(u.expression),++r>6&&e.error("Infinity cycle detected when trying to evaluate node match result",u.location)}while(n!==u.match)}return u.match},named:o,choice:function(u){return u.match=i(u.alternatives,!0),u.match},action:o,sequence:function(u){return u.match=i(u.elements,!1),u.match},labeled:o,text:o,simple_and:o,simple_not:function(u){return u.match=-t(u.expression),u.match},optional:r,zero_or_more:r,one_or_more:o,group:o,semantic_and:n,semantic_not:n,rule_ref:function(e){var n=u.findRule(e.name);return e.match=t(n),e.match},literal:function(u){return u.match=0===u.value.length?1:0,u.match},class:function(u){return u.match=0===u.parts.length?-1:0,u.match},any:n}))(u)}},function(u,e,t){"use strict";u.exports=function(u,e){e.buildVisitor({action:function(u){this.visit(u.expression,!0)},labeled:function(u,t){var n;!0===u.pick&&(!0===t&&e.error('"@" cannot be used with an action block.',u.location),("semantic_and"===(n=u.expression.type)||"semantic_not"===n)&&e.error('"@" cannot be used on a semantic predicate.',u.location),this.visit(u.expression))}})(u)}},function(u,e,t){"use strict";function n(u,e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};!function(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),this.opcodes=e.opcodes||i,this.parser=e.parser||a,this.passes=e.passes||{},this.visitor=e.visitor||r.visitor,this.vm=e.vm||s,"function"==typeof e.warn&&(this.warn=e.warn),"function"==typeof e.error&&(this.error=e.error),Object.defineProperty(this,"fatal",{value:c})}var e,t,o;return e=u,(t=[{key:"parse",value:function(u,e){return this.parser.parse(u,e)}},{key:"buildVisitor",value:function(u){return this.visitor.build(u)}},{key:"warn",value:function(u,e){}},{key:"error",value:function(u,e){c(u,e)}}])&&n(e.prototype,t),o&&n(e,o),u}();u.exports=p},function(u,e,t){"use strict";u.exports={PUSH_EMPTY_STRING:0,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:41,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CLASS:20,ACCEPT_N:21,ACCEPT_STRING:22,EXPECT:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29,EXPECT_NS_BEGIN:38,EXPECT_NS_END:39}},,,,,,,,,,,function(u,e,t){"use strict";var n=t(49),r=t(50);$("#run").click(function(){var u=$("#results-table");function e(e,t,n,r,o){u.append("\n \n \n ").concat(null!==n?"":"","\n ").concat(t,"\n ").concat(null!==n?"":"","\n \n \n \n ").concat((r/1024).toFixed(2),"\n \n  kB\n \n \n \n ").concat(o.toFixed(2),"\n \n  ms\n \n \n \n ").concat((r/1024/(o/1e3)).toFixed(2),"\n \n  kB/s\n \n \n "))}var t=parseInt($("#run-count").val(),10),o={cache:$("#cache").is(":checked"),optimize:$("#optimize").val()};isNaN(t)||t<=0?alert("Number of runs must be a positive integer."):n.run(r,t,o,{readFile:function(u){return $.ajax({type:"GET",url:"/"+u,dataType:"text",async:!1}).responseText},testStart:function(){},testFinish:function(u,t,n,r){e("individual",t.title,"benchmark/"+u.id+"/"+t.file,n,r)},benchmarkStart:function(e){u.append("\n \n \n ").concat(e.title,' \n \n "\n '))},benchmarkFinish:function(u,t,n){e("benchmark-total",u.title+" total",null,t,n)},start:function(){$("#run-count, #cache, #run").attr("disabled","disabled"),u.show(),$("#results-table tr").slice(1).remove()},finish:function(u,t){e("total","Total",null,u,t),$.scrollTo("max",{axis:"y",duration:500}),$("#run-count, #cache, #run").removeAttr("disabled")}})}),$(document).ready(function(){return $("#run").focus()})},function(u,e,t){"use strict";var n=t(0),r={run:function(u,e,t,r){var o={functions:[],add:function(u){this.functions.push(u)},run:function(){this.functions.length>0&&(this.functions.shift()(),setTimeout(function(){o.run()},0))}},i={};o.add(function(){r.start(),i.totalInputSize=0,i.totalParseTime=0}),u.forEach(function(u){o.add(function(u){return function(){r.benchmarkStart(u),i.parser=n.generate(r.readFile("examples/"+u.id+".pegjs"),t),i.benchmarkInputSize=0,i.benchmarkParseTime=0}}(u)),u.tests.forEach(function(t){o.add(function(u,t){return function(){r.testStart(u,t);for(var n=r.readFile("benchmark/"+u.id+"/"+t.file),o=0,a=0;a1&&void 0!==arguments[1]?arguments[1]:{},e=new r.Session({passes:a.convertPasses(r.passes)});return Array.isArray(n.plugins)&&n.plugins.forEach(function(l){"function"==typeof l.use&&l.use(e,n)}),r.compile(e.parse(l,n.parser||{}),e,n)}};l.exports=i},function(l,n,e){"use strict";var u=e(19),t=e(20),r=e(21),o=e(11),a=function(){function l(l){return Array.isArray(l)?l:r.values(l)}return function(n){return r.map(n,l)}}();l.exports={find:u.find,findIndex:u.findIndex,stringEscape:t.stringEscape,regexpEscape:t.regexpEscape,reservedWords:t.reservedWords,clone:r.clone,each:r.each,extend:r.extend,map:r.map,values:r.values,enforceFastProperties:r.enforceFastProperties,evalModule:o.evalModule,convertPasses:a,processOptions:function(l,n){var e={};return r.extend(e,l),r.extend(e,n),e},noop:function(){}}},function(l,n,e){l.exports=e(6)},function(l,n){ +/*! + * Chai - flag utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +l.exports=function(l,n,e){var u=l.__flags||(l.__flags=Object.create(null));if(3!==arguments.length)return u[n];u[n]=e}},function(l,n,e){"use strict";var u=e(82),t=e(0).compiler.Session;l.exports=function(l,n){l.use(u);var e=l.Assertion;function r(l,n,e){var u=n.parse(l);return e.allowedStartRules||(e.allowedStartRules=u.rules.length>0?[u.rules[0].name]:[]),u}e.addMethod("changeAST",function(l,u,o,a){o=void 0!==o?o:{},a=void 0!==a?a:{reportFailures:!0};var i=new t({grammar:l}),s=r(l,i,o);s.rules=s.rules.map(function(l){return Object.assign(l,a)}),n.flag(this,"object")(s,i,o),new e(s).like(u)}),e.addMethod("reportError",function(l,u,o){o=void 0!==o?o:{};var a,i,s=new t({grammar:l}),c=r(l,s,o);try{n.flag(this,"object")(c,s,o),a=!0}catch(l){i=l,a=!1}this.assert(!a,"expected #{this} to report an error but it didn't","expected #{this} to not report an error but #{act} was reported",null,i),a||void 0===u||("string"==typeof u&&(u={message:u}),Object.keys(u).forEach(function(l){new e(i).to.have.property(l).that.is.deep.equal(u[l])}))}),e.addMethod("reportWarning",function(l,e,u){var o=this;e=Array.isArray(e)?e:null==e?[]:[e],u=void 0!==u?u:{};var a=[];var i=new t({grammar:l,warn:function(l){a.push(l)}}),s=r(l,i,u);n.flag(this,"object")(s,i,u);var c=a.length,p=e.length;e.length&&this.assert(c===p,"expected #{this} to report ".concat(p," warnings, but it reported ").concat(c," warnings"),"expected #{this} to not report ".concat(p," warnings"),e,a),e.forEach(function(l){o.assert(-1!==a.indexOf(l),"expected #{this} to report the warning #{exp}, but it didn't","expected #{this} to not report the warning #{exp}",l)})})}},function(l,n,e){"use strict";n.visitor=e(10),n.Node=e(12),n.Grammar=e(22)},function(l,n,e){ +/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ +var u=[]; +/*! + * Chai version + */n.version="4.2.0", +/*! + * Assertion Error + */ +n.AssertionError=e(41); +/*! + * Utils for plugins (not exported) + */ +var t=e(53);n.use=function(l){return~u.indexOf(l)||(l(n,t),u.push(l)),n}, +/*! + * Utility Functions + */ +n.util=t; +/*! + * Configuration + */ +var r=e(8);n.config=r; +/*! + * Primary `Assertion` prototype + */ +var o=e(70);n.use(o); +/*! + * Core Assertions + */ +var a=e(71);n.use(a); +/*! + * Expect interface + */ +var i=e(72);n.use(i); +/*! + * Should interface + */ +var s=e(73);n.use(s); +/*! + * Assert interface + */ +var c=e(74);n.use(c)},function(l,n){ +/*! + * Chai - transferFlags utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +l.exports=function(l,n,e){var u=l.__flags||(l.__flags=Object.create(null));for(var t in n.__flags||(n.__flags=Object.create(null)),e=3!==arguments.length||e,u)(e||"object"!==t&&"ssfi"!==t&&"lockSsfi"!==t&&"message"!=t)&&(n.__flags[t]=u[t])}},function(l,n){l.exports={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"]}},function(l,n,e){"use strict";l.exports=function l(n,e){!function(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}(this,l),this.name="GrammarError",this.message=n,this.location=e,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,l)}},function(l,n,e){"use strict";function u(l,n){for(var e=0;e1?u-1:0),r=1;r1?e-1:0),t=1;t1?e-1:0),t=1;t (https://majda.cz/)","Futago-za Ryuu "],types:"typings/pegjs.d.ts",main:"lib/peg.js",bin:"bin/peg.js",engines:{node:">= 6"}}},function(l,n,e){"use strict";var u=e(5),t=e(1);function r(l,n,e,u){this.message=l,this.expected=n,this.found=e,this.location=u,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}!function(l,n){function e(){this.constructor=l}e.prototype=n.prototype,l.prototype=new e}(r,Error),r.buildMessage=function(l,n){var e={literal:function(l){return'"'+t(l.text)+'"'},class:function(l){var n=l.parts.map(function(l){return Array.isArray(l)?r(l[0])+"-"+r(l[1]):r(l)});return"["+(l.inverted?"^":"")+n+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description},not:function(l){return"not "+o(l.expected)}};function u(l){return l.charCodeAt(0).toString(16).toUpperCase()}function t(l){return l.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(l){return"\\x0"+u(l)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(l){return"\\x"+u(l)})}function r(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(l){return"\\x0"+u(l)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(l){return"\\x"+u(l)})}function o(l){return e[l.type](l)}return"Expected "+function(l){var n,e,u=l.map(o);if(u.sort(),u.length>0){for(n=1,e=1;ne.charCodeAt(0)&&Ln("Invalid character range: "+l.substring(Bn,$n)+"."),[n,e]},xn=function(){return""},Cn=function(){return"\0"},_n=function(){return"\b"},Tn=function(){return"\f"},Sn=function(){return"\n"},kn=function(){return"\r"},Pn=function(){return"\t"},Fn=function(){return"\v"},jn=function(l){return String.fromCharCode(parseInt(l,16))},On=function(){return je("any")},Dn=function(){Ln("Unbalanced brace.")},$n=0,Bn=0,In=[{line:1,column:1}],Mn=[],Nn=0;if("startRule"in n){if(!(n.startRule in a))throw new Error("Can't start parsing from rule \""+n.startRule+'".');i=a[n.startRule]}function Rn(){return Wn(Bn,$n)}function Ln(l,n){throw function(l,n){return new r(l,null,null,n)}(l,n=void 0!==n?n:Wn(Bn,$n))}function qn(l,n){return{type:"literal",text:l,ignoreCase:n}}function Hn(l){return{type:"other",description:l}}function zn(n){var e,u=In[n];if(u)return u;for(e=n-1;!In[e];)e--;for(u={line:(u=In[e]).line,column:u.column};e0;function Wn(l,e){var u={};Un&&(u.filename=n.filename);var t=zn(l);u.start={offset:l,line:t.line,column:t.column};var r=zn(e);return u.end={offset:e,line:r.line,column:r.column},u}function Vn(){Mn.push({pos:$n,variants:[]})}function Gn(l){var n=Mn[Mn.length-1];$nn.pos&&(n.pos=$n,n.variants=[]),n.variants.push(l))}function Xn(l){var n=Mn.pop(),e=Mn[Mn.length-1],u=n.variants;e.pos===n.pos&&(l&&(u=u.map(function(l){return"not"===l.type?l.expected:{type:"not",expected:l}})),Array.prototype.push.apply(e.variants,u))}function Jn(){var l,n,e,u,t;if(l=$n,Te(),n=$n,(e=function(){var l,n;return l=$n,(n=_e())!==o&&Se()!==o?(Bn=l,l=Xl(n)):($n=l,l=o),l}())!==o?(u=Te(),n=e):($n=n,n=o),n===o&&(n=null),e=[],u=$n,(t=Kn())!==o?(Te(),u=t):($n=u,u=o),u!==o)for(;u!==o;)e.push(u),u=$n,(t=Kn())!==o?(Te(),u=t):($n=u,u=o);else e=o;return e!==o?(Bn=l,l=Gl(n,e)):($n=l,l=o),l}function Kn(){var n,e,u,t,r,a;return n=$n,(e=pe())!==o?(Te(),u=$n,(t=he())!==o?(Te(),u=t):($n=u,u=o),u===o&&(u=null),a=Al,0===Nn&&Gn(a),61===l.charCodeAt($n)?(t=s,$n++):t=o,t!==o?(Te(),(r=Yn())!==o&&Se()!==o?(Bn=n,n=Jl(e,u,r)):($n=n,n=o)):($n=n,n=o)):($n=n,n=o),n}function Yn(){var n,e,u,t,r,a,i=function(l){0===Nn&&Gn(l)};if(n=$n,(e=Qn())!==o){for(u=[],t=$n,Te(),i(wl),47===l.charCodeAt($n)?(r=c,$n++):r=o,r!==o?(Te(),(a=Qn())!==o?t=a:($n=t,t=o)):($n=t,t=o);t!==o;)u.push(t),t=$n,Te(),i(wl),47===l.charCodeAt($n)?(r=c,$n++):r=o,r!==o?(Te(),(a=Qn())!==o?t=a:($n=t,t=o)):($n=t,t=o);Bn=n,n=Kl(e,u)}else $n=n,n=o;return n}function Qn(){var l,n,e,u;return l=$n,(n=function(){var l,n,e,u,t;if(l=$n,(n=Zn())!==o){for(e=[],u=$n,Te(),(t=Zn())!==o?u=t:($n=u,u=o);u!==o;)e.push(u),u=$n,Te(),(t=Zn())!==o?u=t:($n=u,u=o);Bn=l,l=Ql(n,e)}else $n=l,l=o;return l}())!==o?(e=$n,Te(),(u=_e())!==o?e=u:($n=e,e=o),e===o&&(e=null),Bn=l,l=Yl(n,e)):($n=l,l=o),l}function Zn(){var n,e,u,t,r,a;return n=$n,a=El,0===Nn&&Gn(a),64===l.charCodeAt($n)?(e=p,$n++):e=o,e!==o?((u=le())===o&&(u=null),t=Te(),(r=ne())!==o?(Bn=n,n=Zl(u,r)):($n=n,n=o)):($n=n,n=o),n===o&&(n=$n,(e=le())!==o?(u=Te(),(t=ne())!==o?(Bn=n,n=ln(e,t)):($n=n,n=o)):($n=n,n=o),n===o&&(n=ne())),n}function le(){var n,e,u,t;return n=$n,(e=pe())!==o?(Te(),t=xl,0===Nn&&Gn(t),58===l.charCodeAt($n)?(u=f,$n++):u=o,u!==o?(Bn=n,n=nn(e)):($n=n,n=o)):($n=n,n=o),n}function ne(){var n,e,u;return n=$n,(e=function(){var n,e,u=function(l){0===Nn&&Gn(l)};return n=$n,u(Cl),36===l.charCodeAt($n)?(e=d,$n++):e=o,e!==o&&(Bn=n,e=un()),(n=e)===o&&(n=$n,u(_l),38===l.charCodeAt($n)?(e=h,$n++):e=o,e!==o&&(Bn=n,e=tn()),(n=e)===o&&(n=$n,u(Tl),33===l.charCodeAt($n)?(e=m,$n++):e=o,e!==o&&(Bn=n,e=rn()),n=e)),n}())!==o?(Te(),(u=ee())!==o?(Bn=n,n=en(e,u)):($n=n,n=o)):($n=n,n=o),n===o&&(n=ee()),n}function ee(){var n,e,u;return n=$n,(e=ue())!==o?(Te(),(u=function(){var n,e,u=function(l){0===Nn&&Gn(l)};return n=$n,u(Sl),63===l.charCodeAt($n)?(e=g,$n++):e=o,e!==o&&(Bn=n,e=an()),(n=e)===o&&(n=$n,u(kl),42===l.charCodeAt($n)?(e=y,$n++):e=o,e!==o&&(Bn=n,e=sn()),(n=e)===o&&(n=$n,u(Pl),43===l.charCodeAt($n)?(e=b,$n++):e=o,e!==o&&(Bn=n,e=cn()),n=e)),n}())!==o?(Bn=n,n=on(e,u)):($n=n,n=o)):($n=n,n=o),n===o&&(n=ue()),n}function ue(){var n,e,u,t,r=function(l){0===Nn&&Gn(l)};return(n=function(){var n,e,u,t;return t=ql,0===Nn&&Gn(t),Nn++,n=$n,(e=he())!==o?(105===l.charCodeAt($n)?(u=R,$n++):u=o,u===o&&(u=null),Bn=n,n=vn(e,u)):($n=n,n=o),Nn--,n}())===o&&(n=function(){var n,e,u,t,r,a,i;if(i=zl,0===Nn&&Gn(i),Nn++,n=$n,91===l.charCodeAt($n)?(e=H,$n++):e=o,e!==o){for(94===l.charCodeAt($n)?(u=z,$n++):u=o,u===o&&(u=null),t=[],r=ye();r!==o;)t.push(r),r=ye();93===l.charCodeAt($n)?(r=U,$n++):r=o,r!==o?(105===l.charCodeAt($n)?(a=R,$n++):a=o,a===o&&(a=null),Bn=n,n=wn(u,t,a)):($n=n,n=o)}else $n=n,n=o;return Nn--,n}())===o&&(n=function(){var n,e,u;return n=$n,u=Ul,0===Nn&&Gn(u),46===l.charCodeAt($n)?(e=nl,$n++):e=o,e!==o&&(Bn=n,e=On()),n=e}())===o&&(n=function(){var n,e,u,t,r,a,i,c,p;return n=$n,(e=pe())!==o?(u=$n,Vn(),t=$n,r=Te(),a=$n,(i=he())!==o?(c=Te(),a=i=[i,c]):($n=a,a=o),a===o&&(a=null),p=Al,0===Nn&&Gn(p),61===l.charCodeAt($n)?(i=s,$n++):i=o,i!==o?t=r=[r,a,i]:($n=t,t=o),Xn(!0),t===o?u=void 0:($n=u,u=o),u!==o?(Bn=n,n=fn(e)):($n=n,n=o)):($n=n,n=o),n}())===o&&(n=function(){var n,e,u;return n=$n,(e=function(){var n,e,u=function(l){0===Nn&&Gn(l)};return n=$n,u(_l),38===l.charCodeAt($n)?(e=h,$n++):e=o,e!==o&&(Bn=n,e=hn()),(n=e)===o&&(n=$n,u(Tl),33===l.charCodeAt($n)?(e=m,$n++):e=o,e!==o&&(Bn=n,e=mn()),n=e),n}())!==o?(Te(),(u=_e())!==o?(Bn=n,n=dn(e,u)):($n=n,n=o)):($n=n,n=o),n}())===o&&(n=$n,r(Fl),40===l.charCodeAt($n)?(e=v,$n++):e=o,e!==o?(Te(),(u=Yn())!==o?(Te(),r(jl),41===l.charCodeAt($n)?(t=A,$n++):t=o,t!==o?(Bn=n,n=pn(u)):($n=n,n=o)):($n=n,n=o)):($n=n,n=o)),n}function te(){var n,e;return e=Ol,0===Nn&&Gn(e),l.length>$n?(n=l.charAt($n),$n++):n=o,n}function re(){var n,e;return e=Dl,0===Nn&&Gn(e),Nn++,9===l.charCodeAt($n)?(n=w,$n++):n=o,n===o&&(11===l.charCodeAt($n)?(n=E,$n++):n=o,n===o&&(12===l.charCodeAt($n)?(n=x,$n++):n=o,n===o&&(32===l.charCodeAt($n)?(n=C,$n++):n=o,n===o&&(160===l.charCodeAt($n)?(n=_,$n++):n=o,n===o&&(65279===l.charCodeAt($n)?(n=T,$n++):n=o,n===o&&(n=function(){var n;return vl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}())))))),Nn--,n}function oe(){var n,e;return e=$l,0===Nn&&Gn(e),rl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}function ae(){var n,e;return e=Bl,0===Nn&&Gn(e),Nn++,10===l.charCodeAt($n)?(n=S,$n++):n=o,n===o&&(l.substr($n,2)===k?(n=k,$n+=2):n=o,n===o&&(13===l.charCodeAt($n)?(n=P,$n++):n=o,n===o&&(8232===l.charCodeAt($n)?(n=F,$n++):n=o,n===o&&(8233===l.charCodeAt($n)?(n=j,$n++):n=o)))),Nn--,n}function ie(){var n,e;return e=Il,0===Nn&&Gn(e),Nn++,(n=function(){var n,e,u,t,r,a,i;if(n=$n,l.substr($n,2)===O?(e=O,$n+=2):e=o,e!==o){for(u=$n,t=[],r=$n,a=$n,Vn(),l.substr($n,2)===D?(i=D,$n+=2):i=o,Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o);r!==o;)t.push(r),r=$n,a=$n,Vn(),l.substr($n,2)===D?(i=D,$n+=2):i=o,Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o);u=l.substring(u,$n),l.substr($n,2)===D?(t=D,$n+=2):t=o,t!==o?(Bn=n,n=gn(u)):($n=n,n=o)}else $n=n,n=o;return n}())===o&&(n=ce()),Nn--,n}function se(){var n,e,u,t,r,a,i,s=function(l){0===Nn&&Gn(l)};if(n=$n,s(Ml),l.substr($n,2)===O?(e=O,$n+=2):e=o,e!==o){for(u=$n,t=[],r=$n,a=$n,Vn(),s(Nl),l.substr($n,2)===D?(i=D,$n+=2):i=o,i===o&&(i=oe()),Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o);r!==o;)t.push(r),r=$n,a=$n,Vn(),s(Nl),l.substr($n,2)===D?(i=D,$n+=2):i=o,i===o&&(i=oe()),Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o);u=l.substring(u,$n),s(Nl),l.substr($n,2)===D?(t=D,$n+=2):t=o,t!==o?(Bn=n,n=gn(u)):($n=n,n=o)}else $n=n,n=o;return n}function ce(){var n,e,u,t,r,a,i,s;if(n=$n,s=Rl,0===Nn&&Gn(s),l.substr($n,2)===$?(e=$,$n+=2):e=o,e!==o){for(u=$n,t=[],r=$n,a=$n,Vn(),i=oe(),Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o);r!==o;)t.push(r),r=$n,a=$n,Vn(),i=oe(),Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o);u=l.substring(u,$n),Bn=n,n=yn(u)}else $n=n,n=o;return n}function pe(){var l,n,e,u,t;if(t=Ll,0===Nn&&Gn(t),Nn++,l=$n,(n=fe())!==o){for(e=[],u=de();u!==o;)e.push(u),u=de();Bn=l,l=bn(n,e)}else $n=l,l=o;return Nn--,l}function fe(){var n,e,u;return(n=function(){var n;return(n=function(){var n;return dl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}())===o&&(n=function(){var n;return sl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}())===o&&(n=function(){var n;return fl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}())===o&&(n=function(){var n;return cl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}())===o&&(n=function(){var n;return pl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}())===o&&(n=function(){var n;return yl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}()),n}())===o&&(36===l.charCodeAt($n)?(n=d,$n++):n=o,n===o&&(95===l.charCodeAt($n)?(n=B,$n++):n=o,n===o&&(n=$n,92===l.charCodeAt($n)?(e=I,$n++):e=o,e!==o&&(u=Ee())!==o?n=u:($n=n,n=o)))),n}function de(){var n;return(n=fe())===o&&(n=function(){var n;return(n=function(){var n;return ml.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}())===o&&(n=function(){var n;return hl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}()),n}())===o&&(n=function(){var n;return gl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}())===o&&(n=function(){var n;return bl.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}())===o&&(8204===l.charCodeAt($n)?(n=M,$n++):n=o,n===o&&(8205===l.charCodeAt($n)?(n=N,$n++):n=o)),n}function he(){var n,e,u,t,r;if(r=Hl,0===Nn&&Gn(r),Nn++,n=$n,34===l.charCodeAt($n)?(e=L,$n++):e=o,e!==o){for(u=[],t=me();t!==o;)u.push(t),t=me();34===l.charCodeAt($n)?(t=L,$n++):t=o,t!==o?(Bn=n,n=An(u)):($n=n,n=o)}else $n=n,n=o;if(n===o)if(n=$n,39===l.charCodeAt($n)?(e=q,$n++):e=o,e!==o){for(u=[],t=ge();t!==o;)u.push(t),t=ge();39===l.charCodeAt($n)?(t=q,$n++):t=o,t!==o?(Bn=n,n=An(u)):($n=n,n=o)}else $n=n,n=o;return Nn--,n}function me(){var n,e,u;return n=$n,e=$n,Vn(),34===l.charCodeAt($n)?(u=L,$n++):u=o,u===o&&(92===l.charCodeAt($n)?(u=I,$n++):u=o,u===o&&(u=oe())),Xn(!0),u===o?e=void 0:($n=e,e=o),e!==o&&(u=te())!==o?n=u:($n=n,n=o),n===o&&(n=$n,92===l.charCodeAt($n)?(e=I,$n++):e=o,e!==o&&(u=Ae())!==o?n=u:($n=n,n=o),n===o&&(n=ve())),n}function ge(){var n,e,u;return n=$n,e=$n,Vn(),39===l.charCodeAt($n)?(u=q,$n++):u=o,u===o&&(92===l.charCodeAt($n)?(u=I,$n++):u=o,u===o&&(u=oe())),Xn(!0),u===o?e=void 0:($n=e,e=o),e!==o&&(u=te())!==o?n=u:($n=n,n=o),n===o&&(n=$n,92===l.charCodeAt($n)?(e=I,$n++):e=o,e!==o&&(u=Ae())!==o?n=u:($n=n,n=o),n===o&&(n=ve())),n}function ye(){var n;return(n=function(){var n,e,u,t;return n=$n,(e=be())!==o?(45===l.charCodeAt($n)?(u=W,$n++):u=o,u!==o&&(t=be())!==o?(Bn=n,n=En(e,t)):($n=n,n=o)):($n=n,n=o),n}())===o&&(n=be()),n}function be(){var n,e,u;return n=$n,e=$n,Vn(),93===l.charCodeAt($n)?(u=U,$n++):u=o,u===o&&(92===l.charCodeAt($n)?(u=I,$n++):u=o,u===o&&(u=oe())),Xn(!0),u===o?e=void 0:($n=e,e=o),e!==o&&(u=te())!==o?n=u:($n=n,n=o),n===o&&(n=$n,92===l.charCodeAt($n)?(e=I,$n++):e=o,e!==o&&(u=Ae())!==o?n=u:($n=n,n=o),n===o&&(n=ve())),n}function ve(){var n,e;return n=$n,92===l.charCodeAt($n)?(e=I,$n++):e=o,e!==o&&ae()!==o?(Bn=n,n=xn()):($n=n,n=o),n}function Ae(){var n,e,u,t;return(n=function(){var n;return(n=we())===o&&(n=function(){var n,e,u;return n=$n,e=$n,Vn(),(u=function(){var n;return(n=we())===o&&(n=xe())===o&&(120===l.charCodeAt($n)?(n=Z,$n++):n=o,n===o&&(117===l.charCodeAt($n)?(n=ll,$n++):n=o)),n}())===o&&(u=oe()),Xn(!0),u===o?e=void 0:($n=e,e=o),e!==o&&(u=te())!==o?n=u:($n=n,n=o),n}()),n}())===o&&(n=$n,48===l.charCodeAt($n)?(e=V,$n++):e=o,e!==o?(u=$n,Vn(),t=xe(),Xn(!0),t===o?u=void 0:($n=u,u=o),u!==o?(Bn=n,n=Cn()):($n=n,n=o)):($n=n,n=o),n===o&&(n=function(){var n,e,u,t,r,a;return n=$n,120===l.charCodeAt($n)?(e=Z,$n++):e=o,e!==o?(u=$n,t=$n,(r=Ce())!==o&&(a=Ce())!==o?t=r=[r,a]:($n=t,t=o),(u=t!==o?l.substring(u,$n):t)!==o?(Bn=n,n=jn(u)):($n=n,n=o)):($n=n,n=o),n}())===o&&(n=Ee())),n}function we(){var n,e;return 39===l.charCodeAt($n)?(n=q,$n++):n=o,n===o&&(34===l.charCodeAt($n)?(n=L,$n++):n=o,n===o&&(92===l.charCodeAt($n)?(n=I,$n++):n=o,n===o&&(n=$n,98===l.charCodeAt($n)?(e=G,$n++):e=o,e!==o&&(Bn=n,e=_n()),(n=e)===o&&(n=$n,102===l.charCodeAt($n)?(e=X,$n++):e=o,e!==o&&(Bn=n,e=Tn()),(n=e)===o&&(n=$n,110===l.charCodeAt($n)?(e=J,$n++):e=o,e!==o&&(Bn=n,e=Sn()),(n=e)===o&&(n=$n,114===l.charCodeAt($n)?(e=K,$n++):e=o,e!==o&&(Bn=n,e=kn()),(n=e)===o&&(n=$n,116===l.charCodeAt($n)?(e=Y,$n++):e=o,e!==o&&(Bn=n,e=Pn()),(n=e)===o&&(n=$n,118===l.charCodeAt($n)?(e=Q,$n++):e=o,e!==o&&(Bn=n,e=Fn()),n=e)))))))),n}function Ee(){var n,e,u,t,r,a,i,s;return n=$n,117===l.charCodeAt($n)?(e=ll,$n++):e=o,e!==o?(u=$n,t=$n,(r=Ce())!==o&&(a=Ce())!==o&&(i=Ce())!==o&&(s=Ce())!==o?t=r=[r,a,i,s]:($n=t,t=o),(u=t!==o?l.substring(u,$n):t)!==o?(Bn=n,n=jn(u)):($n=n,n=o)):($n=n,n=o),n}function xe(){var n;return ol.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}function Ce(){var n;return al.test(l.charAt($n))?(n=l.charAt($n),$n++):n=o,n}function _e(){var n,e,u,t,r;return r=Wl,0===Nn&&Gn(r),Nn++,n=$n,123===l.charCodeAt($n)?(e=el,$n++):e=o,e!==o?(u=function n(){var e,u,t,r,a,i;if(e=$n,u=[],t=[],r=$n,a=$n,Vn(),il.test(l.charAt($n))?(i=l.charAt($n),$n++):i=o,Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o),r!==o)for(;r!==o;)t.push(r),r=$n,a=$n,Vn(),il.test(l.charAt($n))?(i=l.charAt($n),$n++):i=o,Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o);else t=o;for(t===o&&(t=$n,123===l.charCodeAt($n)?(r=el,$n++):r=o,r!==o?(a=n(),125===l.charCodeAt($n)?(i=ul,$n++):i=o,i!==o?t=r=[r,a,i]:($n=t,t=o)):($n=t,t=o));t!==o;){if(u.push(t),t=[],r=$n,a=$n,Vn(),il.test(l.charAt($n))?(i=l.charAt($n),$n++):i=o,Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o),r!==o)for(;r!==o;)t.push(r),r=$n,a=$n,Vn(),il.test(l.charAt($n))?(i=l.charAt($n),$n++):i=o,Xn(!0),i===o?a=void 0:($n=a,a=o),a!==o&&(i=te())!==o?r=a=[a,i]:($n=r,r=o);else t=o;t===o&&(t=$n,123===l.charCodeAt($n)?(r=el,$n++):r=o,r!==o?(a=n(),125===l.charCodeAt($n)?(i=ul,$n++):i=o,i!==o?t=r=[r,a,i]:($n=t,t=o)):($n=t,t=o))}return e=l.substring(e,$n)}(),125===l.charCodeAt($n)?(t=ul,$n++):t=o,t!==o?n=u:($n=n,n=o)):($n=n,n=o),n===o&&(n=$n,123===l.charCodeAt($n)?(e=el,$n++):e=o,e!==o&&(Bn=n,e=Dn()),n=e),Nn--,n}function Te(){var l,n;for(l=[],(n=re())===o&&(n=ae())===o&&(n=ie());n!==o;)l.push(n),(n=re())===o&&(n=ae())===o&&(n=ie());return l}function Se(){var n,e,u,t,r;return n=$n,e=Te(),r=Vl,0===Nn&&Gn(r),59===l.charCodeAt($n)?(u=tl,$n++):u=o,u!==o?n=e=[e,u]:($n=n,n=o),n===o&&(n=$n,e=function(){var l,n;for(l=[],(n=re())===o&&(n=se());n!==o;)l.push(n),(n=re())===o&&(n=se());return l}(),(u=ce())===o&&(u=null),(t=ae())!==o?n=e=[e,u,t]:($n=n,n=o),n===o&&(n=$n,e=Te(),(u=function(){var n,e,u;return n=$n,Vn(),u=Ol,0===Nn&&Gn(u),l.length>$n?(e=l.charAt($n),$n++):e=o,Xn(!0),e===o?n=void 0:($n=n,n=o),n}())!==o?n=e=[e,u]:($n=n,n=o))),n}var ke=!0,Pe={},Fe=n.reservedWords||t.reservedWords;function je(l,n){var e=new u.Node(l,Rn());return null===n?e:(t.extend(e,n),t.enforceFastProperties(e))}Array.isArray(Fe)&&Fe.forEach(function(l){Pe[l]=!0});var Oe,De,$e=n.extractComments?{}:null;function Be(l,e){if(n.extractComments){var u=Rn();$e[u.start.offset]={text:l,multiline:e,location:u}}return l}if(Vn(),(e=i())!==o&&$n===l.length)return e;throw e!==o&&$n + * MIT Licensed + */l.exports=function(){return u.useProxy&&"undefined"!=typeof Proxy&&"undefined"!=typeof Reflect}},function(l,n){var e=Object.getOwnPropertyDescriptor(function(){},"length"); +/*! + * Chai - addLengthGuard utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */l.exports=function(l,n,u){return e.configurable?(Object.defineProperty(l,"length",{get:function(){if(u)throw Error("Invalid Chai property: "+n+'.length. Due to a compatibility issue, "length" cannot directly follow "'+n+'". Use "'+n+'.lengthOf" instead.');throw Error("Invalid Chai property: "+n+'.length. See docs for proper usage of "'+n+'".')}}),l):l}},function(l,n,e){var u=e(8),t=e(3),r=e(45),o=e(16),a=["__flags","__methods","_obj","assert"];l.exports=function(l,n){return o()?new Proxy(l,{get:function l(e,o){if("string"==typeof o&&-1===u.proxyExcludedKeys.indexOf(o)&&!Reflect.has(e,o)){if(n)throw Error("Invalid Chai property: "+n+"."+o+'. See docs for proper usage of "'+n+'".');var i=null,s=4;throw r(e).forEach(function(l){if(!Object.prototype.hasOwnProperty(l)&&-1===a.indexOf(l)){var n=function(l,n,e){if(Math.abs(l.length-n.length)>=e)return e;for(var u=[],t=0;t<=l.length;t++)u[t]=Array(n.length+1).fill(0),u[t][0]=t;for(var r=0;r=e?u[t][r]=e:u[t][r]=Math.min(u[t-1][r]+1,u[t][r-1]+1,u[t-1][r-1]+(o===n.charCodeAt(r-1)?0:1));return u[l.length][n.length]}(o,l,s);n2&&void 0!==arguments[2]?arguments[2]:{};switch("parser"===(e=g.processOptions(e,{allowedStartRules:[l.rules[0].name],cache:!1,context:{},dependencies:{},exportVar:null,features:null,format:"bare",header:null,optimize:"speed",output:"parser",trace:!1})).output&&(e.format="umd"),g.each(n.passes,function(u){u.forEach(function(u){u(l,n,e)})}),e.output){case"parser":return n.vm.evalModule(l.code,e.context);case"source":return l.code;default:n.error("Invalid output format: ".concat(e.output,"."))}}};l.exports=y},function(l,n,e){"use strict";l.exports=function(l,n,e){l.rules.forEach(function(l){l.reportFailures=!1});for(var u=e.allowedStartRules.map(function(n){var e=l.findRule(n);return e.reportFailures=!0,e}),t=n.buildVisitor({rule:function(l){t(l.expression)},named:function(){},rule_ref:function(n){var e=l.findRule(n.name);e.reportFailures||(e.reportFailures=!0,u.push(e))}});u.length>0;)t(u.pop())}},function(l,n,e){"use strict";var u=e(1);l.exports=function(l,n){var e,t=n.opcodes,r=[],o=[],a=[],i=[];function s(l){var n=JSON.stringify(l),e=u.findIndex(a,function(l){return JSON.stringify(l)===n});return-1===e?a.push(l)-1:e}function c(l,n,e){var t={predicate:l,params:n,body:e},r=JSON.stringify(t),o=u.findIndex(i,function(l){return JSON.stringify(l)===r});return-1===o?i.push(t)-1:o}var p=function(){var l;return(l=[]).concat.apply(l,arguments)};function f(l,n,e,u){return l>0?e:l<0?u:n.concat([e.length,u.length],e,u)}function d(l,n,e,r){var o=u.values(e,function(l){return r-l});return[t.CALL,l,n,o.length].concat(o)}function h(l,n,r){var o=0|l.match;return p([t.PUSH_CURR_POS],[t.EXPECT_NS_BEGIN],e(l,{sp:r.sp+1,env:u.clone(r.env),action:null,reportFailures:r.reportFailures}),[t.EXPECT_NS_END,n?1:0],f(n?-o:o,[n?t.IF_ERROR:t.IF_NOT_ERROR],p([t.POP],[n?t.POP:t.POP_CURR_POS],[t.PUSH_UNDEFINED]),p([t.POP],[n?t.POP_CURR_POS:t.POP],[t.PUSH_FAILED])))}function m(l,n,e){var u=c(!0,Object.keys(e.env),l.code);return p([t.UPDATE_SAVED_POS],d(u,0,e.env,e.sp),f(0|l.match,[t.IF],p([t.POP],n?[t.PUSH_FAILED]:[t.PUSH_UNDEFINED]),p([t.POP],n?[t.PUSH_UNDEFINED]:[t.PUSH_FAILED])))}function g(l){return n=[t.WHILE_NOT_ERROR],e=p([t.APPEND],l),n.concat([e.length],e);var n,e}(e=n.buildVisitor({grammar:function(l){l.rules.forEach(e),l.literals=r,l.classes=o,l.expectations=a,l.functions=i},rule:function(l){l.bytecode=e(l.expression,{sp:-1,env:{},action:null,reportFailures:l.reportFailures})},named:function(l,n){var u=n.reportFailures?s({type:"rule",value:l.name}):null,r=e(l.expression,{sp:n.sp,env:n.env,action:n.action,reportFailures:!1});return n.reportFailures?p([t.EXPECT,u],[t.SILENT_FAILS_ON],r,[t.SILENT_FAILS_OFF]):r},choice:function(l,n){return function l(n,r){return p(e(n[0],{sp:r.sp,env:u.clone(r.env),action:null,reportFailures:r.reportFailures}),n.length<2?[]:f(-(0|n[0].match),[t.IF_ERROR],p([t.POP],l(n.slice(1),r)),[]))}(l.alternatives,n)},action:function(l,n){var r=u.clone(n.env),o="sequence"!==l.expression.type||0===l.expression.elements.length,a=e(l.expression,{sp:n.sp+(o?1:0),env:r,action:l,reportFailures:n.reportFailures}),i=0|l.expression.match,s=o&&i>=0?c(!1,Object.keys(r),l.code):null;return!1===o?a:p([t.PUSH_CURR_POS],a,f(i,[t.IF_NOT_ERROR],p([t.LOAD_SAVED_POS,1],d(s,1,r,n.sp+2)),[]),[t.NIP])},sequence:function(l,n){var u=l.elements.length;return p([t.PUSH_CURR_POS],function l(n,r){if(n.length>0){var o=u-n.slice(1).length;return p(e(n[0],{sp:r.sp,env:r.env,pluck:r.pluck,action:null,reportFailures:r.reportFailures}),f(0|n[0].match,[t.IF_NOT_ERROR],l(n.slice(1),{sp:r.sp+1,env:r.env,pluck:r.pluck,action:r.action,reportFailures:r.reportFailures}),p(o>1?[t.POP_N,o]:[t.POP],[t.POP_CURR_POS],[t.PUSH_FAILED])))}return r.pluck.length>0?p([t.PLUCK,u+1,r.pluck.length],r.pluck.map(function(l){return r.sp-l})):r.action?p([t.LOAD_SAVED_POS,u],d(c(!1,Object.keys(r.env),r.action.code),u+1,r.env,r.sp)):p([t.WRAP,u],[t.NIP])}(l.elements,{sp:n.sp+1,env:n.env,pluck:[],action:n.action,reportFailures:n.reportFailures}))},labeled:function(l,n){var t=n.env,r=l.label,o=n.sp+1;return null!==r&&(t=u.clone(n.env),n.env[r]=o),n.pluck&&l.pick&&n.pluck.push(o),e(l.expression,{sp:n.sp,env:t,action:null,reportFailures:n.reportFailures})},text:function(l,n){return p([t.PUSH_CURR_POS],e(l.expression,{sp:n.sp+1,env:u.clone(n.env),action:null,reportFailures:n.reportFailures}),f(0|l.expression.match,[t.IF_NOT_ERROR],p([t.POP],[t.TEXT]),[t.NIP]))},simple_and:function(l,n){return h(l.expression,!1,n)},simple_not:function(l,n){return h(l.expression,!0,n)},optional:function(l,n){return p(e(l.expression,{sp:n.sp,env:u.clone(n.env),action:null,reportFailures:n.reportFailures}),f(-(0|l.expression.match),[t.IF_ERROR],p([t.POP],[t.PUSH_NULL]),[]))},zero_or_more:function(l,n){var r=e(l.expression,{sp:n.sp+1,env:u.clone(n.env),action:null,reportFailures:n.reportFailures});return p([t.PUSH_EMPTY_ARRAY],r,g(r),[t.POP])},one_or_more:function(l,n){var r=e(l.expression,{sp:n.sp+1,env:u.clone(n.env),action:null,reportFailures:n.reportFailures});return p([t.PUSH_EMPTY_ARRAY],r,f(0|l.expression.match,[t.IF_NOT_ERROR],p(g(r),[t.POP]),p([t.POP],[t.POP],[t.PUSH_FAILED])))},group:function(l,n){return e(l.expression,{sp:n.sp,env:u.clone(n.env),action:null,reportFailures:n.reportFailures})},semantic_and:function(l,n){return m(l,!1,n)},semantic_not:function(l,n){return m(l,!0,n)},rule_ref:function(n){return[t.RULE,l.indexOfRule(n.name)]},literal:function(l,n){if(l.value.length>0){var e=0|l.match,u=0===e||e>0&&!l.ignoreCase?(a=l.ignoreCase?l.value.toLowerCase():l.value,-1===(i=r.indexOf(a))?r.push(a)-1:i):null,o=n.reportFailures?s({type:"literal",value:l.value,ignoreCase:l.ignoreCase}):null;return p(n.reportFailures?[t.EXPECT,o]:[],f(e,l.ignoreCase?[t.MATCH_STRING_IC,u]:[t.MATCH_STRING,u],l.ignoreCase?[t.ACCEPT_N,l.value.length]:[t.ACCEPT_STRING,u],[t.PUSH_FAILED]))}var a,i;return[t.PUSH_EMPTY_STRING]},class:function(l,n){var e=0|l.match,r=0===e?function(l){var n={value:l.parts,inverted:l.inverted,ignoreCase:l.ignoreCase},e=JSON.stringify(n),t=u.findIndex(o,function(l){return JSON.stringify(l)===e});return-1===t?o.push(n)-1:t}(l):null,a=n.reportFailures?s({type:"class",value:l.parts,inverted:l.inverted,ignoreCase:l.ignoreCase}):null;return p(n.reportFailures?[t.EXPECT,a]:[],f(e,[t.MATCH_CLASS,r],[t.ACCEPT_N,1],[t.PUSH_FAILED]))},any:function(l,n){var e=n.reportFailures?s({type:"any"}):null;return p(n.reportFailures?[t.EXPECT,e]:[],f(0|l.match,[t.MATCH_ANY],[t.ACCEPT_N,1],[t.PUSH_FAILED]))}}))(l)}},function(l,n,e){"use strict";var u=e(1),t=e(13).version;l.exports=function(l,n,e){var r=n.opcodes,o=e.features||{};function a(l,n){return l in o?!!o[l]:null==n||!!n}var i=/^([^`\r\n]+?(?:`[^`]*?`[^\r\n]*?)?)$/gm;function s(l){return l.replace(i," $1")}function c(l){return l.replace(i," $1")}var p=function(l){return"peg$c"+l},f=function(l){return"peg$r"+l},d=function(l){return"peg$e"+l},h=function(l){return"peg$f"+l};function m(n,u){var t=[];return t.push(["","var rule$expects = function (expected) {"," if (peg$silentFails === 0) peg$expect(expected);","}",""].join("\n")),e.trace&&t.push(["peg$tracer.trace({",' type: "rule.enter",'," rule: "+n+","," location: peg$computeLocation(startPos, startPos)","});",""].join("\n")),e.cache&&(t.push(["var key = peg$currPos * "+l.rules.length+" + "+u+";","var cached = peg$resultsCache[key];","var rule$expectations = [];","","rule$expects = function (expected) {"," if (peg$silentFails === 0) peg$expect(expected);"," rule$expectations.push(expected);","}","","if (cached) {"," peg$currPos = cached.nextPos;",""," rule$expectations = cached.expectations;"," if (peg$silentFails === 0) {"," rule$expectations.forEach(peg$expect);"," }",""].join("\n")),e.trace&&t.push(["if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+n+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+n+","," location: peg$computeLocation(startPos, startPos)"," });","}",""].join("\n")),t.push([" return cached.result;","}",""].join("\n"))),t.join("\n")}function g(l,n){var u=[];return e.cache&&u.push(["","peg$resultsCache[key] = {"," nextPos: peg$currPos,"," result: "+n+","," expectations: rule$expectations","};"].join("\n")),e.trace&&u.push(["","if ("+n+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+l+","," result: "+n+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+l+","," location: peg$computeLocation(startPos, startPos)"," });","}"].join("\n")),u.push(["","return "+n+";"].join("\n")),u.join("\n")}l.code=function(l){function n(){var l="// Generated by PEG.js v".concat(t,", https://pegjs.org/"),n=e.header;return"string"==typeof n?l+="\n\n"+n:Array.isArray(n)&&(l+="\n\n",n.forEach(function(n){l+="// "+n})),l}function r(){return e.trace&&a("DefaultTracer")?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}return{bare:function(){return[n(),"(function() {",' "use strict";',"",s(l),"",s("return "+r()+";"),"})()"].join("\n")},commonjs:function(){var t=[],o=Object.keys(e.dependencies);return t.push([n(),"",'"use strict";',""].join("\n")),o.length>0&&(o.forEach(function(l){t.push("var "+l+' = require("'+u.stringEscape(e.dependencies[l])+'");')}),t.push("")),t.push([l,"","module.exports = "+r()+";",""].join("\n")),t.join("\n")},es:function(){var t=[],o=Object.keys(e.dependencies);return t.push(n(),""),o.length>0&&(o.forEach(function(l){t.push("import "+l+' from "'+u.stringEscape(e.dependencies[l])+'";')}),t.push("")),t.push(l,"","export "+(e.trace&&a("DefaultTracer")?["{"," peg$SyntaxError as SyntaxError,"," peg$DefaultTracer as DefaultTracer,"," peg$parse as parse","}"].join("\n"):["{"," peg$SyntaxError as SyntaxError,"," peg$parse as parse","}"].join("\n"))+";","","export default "+r()+";",""),t.join("\n")},amd:function(){var t=Object.keys(e.dependencies),o="["+t.map(function(l){return e.dependencies[l]}).map(function(l){return'"'.concat(u.stringEscape(l),'"')}).join(", ")+"]",a=t.join(", ");return[n(),"define("+o+", function("+a+") {",' "use strict";',"",s(l),"",s("return "+r()+";"),"});",""].join("\n")},globals:function(){return[n(),"(function(root) {",' "use strict";',"",s(l),"",s("root."+e.exportVar+" = "+r()+";"),"})(this);",""].join("\n")},umd:function(){var t=[],o=Object.keys(e.dependencies),a=o.map(function(l){return e.dependencies[l]}),i="["+a.map(function(l){return'"'.concat(u.stringEscape(l),'"')}).join(", ")+"]",c=a.map(function(l){return'require("'.concat(u.stringEscape(l),'")')}).join(", "),p=o.map(function(l){return"root."+l}).join(", "),f=o.join(", ");return t.push([n(),"(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+i+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+c+");"].join("\n")),null!==e.exportVar&&t.push([" } else {"," root."+e.exportVar+" = factory("+p+");"].join("\n")),t.push([" }","})(this, function("+f+") {",' "use strict";',"",s(l),"",s("return "+r()+";"),"});",""].join("\n")),t.join("\n")}}[e.format]()}(function(){var t=[];if(t.push(["function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," this.message = message;"," this.expected = expected;"," this.found = found;"," this.location = location;",' this.name = "SyntaxError";',""," // istanbul ignore next",' if (typeof Error.captureStackTrace === "function") {'," Error.captureStackTrace(this, peg$SyntaxError);"," }","}","","peg$subclass(peg$SyntaxError, Error);","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," },",""," not: function(expectation) {",' return "not " + describeExpectation(expectation.expected);'," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""].join("\n")),e.trace&&(a("DefaultTracer")?t.push(["function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," // istanbul ignore next"," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};",""].join("\n")):t.push(["var peg$FauxTracer = {"," trace: function(event) { }","};",""].join("\n"))),t.push(["function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};",""].join("\n")),"size"===e.optimize){var o="{ "+e.allowedStartRules.map(function(n){return n+": "+l.indexOfRule(n)}).join(", ")+" }",i=l.indexOfRule(e.allowedStartRules[0]);t.push([" var peg$startRuleIndices = "+o+";"," var peg$startRuleIndex = "+i+";"].join("\n"))}else{var y="{ "+e.allowedStartRules.map(function(l){return l+": peg$parse"+l}).join(", ")+" }",b="peg$parse"+e.allowedStartRules[0];t.push([" var peg$startRuleFunctions = "+y+";"," var peg$startRuleFunction = "+b+";"].join("\n"))}if(t.push(""),t.push(s(function(){function t(l){return'"'.concat(u.stringEscape(l),'"')}function r(l){return"/^["+(l.inverted?"^":"")+l.value.map(function(l){return Array.isArray(l)?u.regexpEscape(l[0])+"-"+u.regexpEscape(l[1]):u.regexpEscape(l)}).join("")+"]/"+(l.ignoreCase?"i":"")}function o(l){switch(l.type){case"rule":return'peg$otherExpectation("'.concat(u.stringEscape(l.value),'")');case"literal":return'peg$literalExpectation("'+u.stringEscape(l.value)+'", '+l.ignoreCase+")";case"class":return"peg$classExpectation(["+l.value.map(function(l){return Array.isArray(l)?'["'.concat(u.stringEscape(l[0]),'", "').concat(u.stringEscape(l[1]),'"]'):'"'.concat(u.stringEscape(l),'"')}).join(", ")+"], "+l.inverted+", "+l.ignoreCase+")";case"any":return"peg$anyExpectation()";default:n.fatal("Unknown expectation type (".concat(JSON.stringify(l),")"))}}function a(l){return"function(".concat(l.params.join(", "),") {").concat(l.body,"}")}return"size"===e.optimize?["var peg$literals = [",s(l.literals.map(t).join(",\n")),"];","var peg$regexps = [",s(l.classes.map(r).join(",\n")),"];","var peg$expectations = [",s(l.expectations.map(o).join(",\n")),"];","var peg$functions = [",s(l.functions.map(a).join(",\n")),"];","","var peg$bytecode = [",s(l.rules.map(function(l){return'peg$decode("'.concat(u.stringEscape(l.bytecode.map(function(l){return String.fromCharCode(l+32)}).join("")),'")')}).join(",\n")),"];"].join("\n"):l.literals.map(function(l,n){return"var "+p(n)+" = "+t(l)+";"}).concat("",l.classes.map(function(l,n){return"var "+f(n)+" = "+r(l)+";"})).concat("",l.expectations.map(function(l,n){return"var "+d(n)+" = "+o(l)+";"})).concat("",l.functions.map(function(l,n){return"var "+h(n)+" = "+a(l)+";"})).join("\n")}())),t.push([""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$expected = [];"," var peg$silentFails = 0;",""].join("\n")),e.cache&&t.push([" var peg$resultsCache = {};",""].join("\n")),e.trace){if("size"===e.optimize){var v="["+l.rules.map(function(l){return'"'.concat(u.stringEscape(l.name),'"')}).join(", ")+"]";t.push([" var peg$ruleNames = "+v+";",""].join("\n"))}a("DefaultTracer")?t.push([' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""].join("\n")):t.push([' var peg$tracer = "tracer" in options ? options.tracer : peg$FauxTracer;',""].join("\n"))}return t.push([" var peg$result;",""].join("\n")),"size"===e.optimize?t.push([' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleIndices)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleIndex = peg$startRuleIndices[options.startRule];"," }"].join("\n")):t.push([' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }"].join("\n")),a("text")&&t.push([""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }"].join("\n")),a("offset")&&t.push([""," function offset() {"," return peg$savedPos;"," }"].join("\n")),a("range")&&t.push([""," function range() {"," return [peg$savedPos, peg$currPos];"," }"].join("\n")),a("location")&&t.push([""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }"].join("\n")),a("expected")&&t.push([""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }"].join("\n")),a("error")&&t.push([""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }"].join("\n")),t.push([""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }","",a("filename")?' var peg$VALIDFILENAME = typeof options.filename === "string" && options.filename.length > 0;':""," function peg$computeLocation(startPos, endPos) {"," var loc = {};","",a("filename")?" if ( peg$VALIDFILENAME ) loc.filename = options.filename;":"",""," var startPosDetails = peg$computePosDetails(startPos);"," loc.start = {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," };",""," var endPosDetails = peg$computePosDetails(endPos);"," loc.end = {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," };",""," return loc;"," }",""," function peg$begin() {"," peg$expected.push({ pos: peg$currPos, variants: [] });"," }",""," function peg$expect(expected) {"," var top = peg$expected[peg$expected.length - 1];",""," if (peg$currPos < top.pos) { return; }",""," if (peg$currPos > top.pos) {"," top.pos = peg$currPos;"," top.variants = [];"," }",""," top.variants.push(expected);"," }",""," function peg$end(invert) {"," var expected = peg$expected.pop();"," var top = peg$expected[peg$expected.length - 1];"," var variants = expected.variants;",""," if (top.pos !== expected.pos) { return; }",""," if (invert) {"," variants = variants.map(function(e) {",' return e.type === "not" ? e.expected : { type: "not", expected: e };'," });"," }",""," Array.prototype.push.apply(top.variants, variants);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""," function peg$buildError() {"," var expected = peg$expected[0];"," var failPos = expected.pos;",""," return peg$buildStructuredError("," expected.variants,"," failPos < input.length ? input.charAt(failPos) : null,"," failPos < input.length"," ? peg$computeLocation(failPos, failPos + 1)"," : peg$computeLocation(failPos, failPos)"," );"," }",""].join("\n")),"size"===e.optimize?(t.push(s(function(){var l,n=[];function u(l,n){var e=n+3,u="bc[ip + "+(e-2)+"]",t="bc[ip + "+(e-1)+"]";return["ends.push(end);","ips.push(ip + "+e+" + "+u+" + "+t+");","","if ("+l+") {"," end = ip + "+e+" + "+u+";"," ip += "+e+";","} else {"," end = ip + "+e+" + "+u+" + "+t+";"," ip += "+e+" + "+u+";","}","","break;"].join("\n")}return n.push(["function peg$decode(s) {",' return s.split("").map(function(ch) { return ch.charCodeAt(0) - 32; });',"}","","function peg$parseRule(index) {"].join("\n")),e.trace?n.push([" var bc = peg$bytecode[index];"," var ip = 0;"," var ips = [];"," var end = bc.length;"," var ends = [];"," var stack = [];"," var startPos = peg$currPos;"," var params, paramsLength, paramsN;"].join("\n")):n.push([" var bc = peg$bytecode[index];"," var ip = 0;"," var ips = [];"," var end = bc.length;"," var ends = [];"," var stack = [];"," var params, paramsLength, paramsN;"].join("\n")),n.push(s(m("peg$ruleNames[index]","index"))),n.push([" while (true) {"," while (ip < end) {"," switch (bc[ip]) {"," case "+r.PUSH_EMPTY_STRING+":"," stack.push('');"," ip++;"," break;",""," case "+r.PUSH_UNDEFINED+":"," stack.push(undefined);"," ip++;"," break;",""," case "+r.PUSH_NULL+":"," stack.push(null);"," ip++;"," break;",""," case "+r.PUSH_FAILED+":"," stack.push(peg$FAILED);"," ip++;"," break;",""," case "+r.PUSH_EMPTY_ARRAY+":"," stack.push([]);"," ip++;"," break;",""," case "+r.PUSH_CURR_POS+":"," stack.push(peg$currPos);"," ip++;"," break;",""," case "+r.POP+":"," stack.pop();"," ip++;"," break;",""," case "+r.POP_CURR_POS+":"," peg$currPos = stack.pop();"," ip++;"," break;",""," case "+r.POP_N+":"," stack.length -= bc[ip + 1];"," ip += 2;"," break;",""," case "+r.NIP+":"," stack.splice(-2, 1);"," ip++;"," break;",""," case "+r.APPEND+":"," stack[stack.length - 2].push(stack.pop());"," ip++;"," break;",""," case "+r.WRAP+":"," stack.push(stack.splice(stack.length - bc[ip + 1], bc[ip + 1]));"," ip += 2;"," break;",""," case "+r.TEXT+":"," stack.push(input.substring(stack.pop(), peg$currPos));"," ip++;"," break;",""," case "+r.PLUCK+":"," paramsLength = bc[ip + 2];"," paramsN = 3 + paramsLength",""," params = bc.slice(ip + 3, ip + paramsN);"," params = paramsLength === 1"," ? stack[stack.length - 1 - params[ 0 ]]"," : params.map(function(p) { return stack[stack.length - 1 - p]; });",""," stack.splice("," stack.length - bc[ip + 1],"," bc[ip + 1],"," params"," );",""," ip += paramsN;"," break;",""," case "+r.IF+":",c(u("stack[stack.length - 1]",0)),""," case "+r.IF_ERROR+":",c(u("stack[stack.length - 1] === peg$FAILED",0)),""," case "+r.IF_NOT_ERROR+":",c(u("stack[stack.length - 1] !== peg$FAILED",0)),""," case "+r.WHILE_NOT_ERROR+":",c((l="stack[stack.length - 1] !== peg$FAILED",["if ("+l+") {"," ends.push(end);"," ips.push(ip);",""," end = ip + 2 + bc[ip + 1];"," ip += 2;","} else {"," ip += 2 + bc[ip + 1];","}","","break;"].join("\n"))),""," case "+r.MATCH_ANY+":",c(u("input.length > peg$currPos",0)),""," case "+r.MATCH_STRING+":",c(u("input.substr(peg$currPos, peg$literals[bc[ip + 1]].length) === peg$literals[bc[ip + 1]]",1)),""," case "+r.MATCH_STRING_IC+":",c(u("input.substr(peg$currPos, peg$literals[bc[ip + 1]].length).toLowerCase() === peg$literals[bc[ip + 1]]",1)),""," case "+r.MATCH_CLASS+":",c(u("peg$regexps[bc[ip + 1]].test(input.charAt(peg$currPos))",1)),""," case "+r.ACCEPT_N+":"," stack.push(input.substr(peg$currPos, bc[ip + 1]));"," peg$currPos += bc[ip + 1];"," ip += 2;"," break;",""," case "+r.ACCEPT_STRING+":"," stack.push(peg$literals[bc[ip + 1]]);"," peg$currPos += peg$literals[bc[ip + 1]].length;"," ip += 2;"," break;",""," case "+r.EXPECT+":"," rule$expects(peg$expectations[bc[ip + 1]]);"," ip += 2;"," break;",""," case "+r.LOAD_SAVED_POS+":"," peg$savedPos = stack[stack.length - 1 - bc[ip + 1]];"," ip += 2;"," break;",""," case "+r.UPDATE_SAVED_POS+":"," peg$savedPos = peg$currPos;"," ip++;"," break;",""," case "+r.CALL+":",c(["params = bc.slice(ip + 4, ip + 4 + bc[ip + 3])"," .map(function(p) { return stack[stack.length - 1 - p]; });","","stack.splice("," stack.length - bc[ip + 2],"," bc[ip + 2],"," peg$functions[bc[ip + 1]].apply(null, params)",");","","ip += 4 + bc[ip + 3];","break;"].join("\n")),""," case "+r.RULE+":"," stack.push(peg$parseRule(bc[ip + 1]));"," ip += 2;"," break;",""," case "+r.SILENT_FAILS_ON+":"," peg$silentFails++;"," ip++;"," break;",""," case "+r.SILENT_FAILS_OFF+":"," peg$silentFails--;"," ip++;"," break;",""," case "+r.EXPECT_NS_BEGIN+":"," peg$begin();"," ip++;"," break;",""," case "+r.EXPECT_NS_END+":"," peg$end(bc[ip + 1]);"," ip += 2;"," break;",""," // istanbul ignore next"," default:"," throw new Error(",' "Rule #" + index + "'+(e.trace?" ('\" + peg$ruleNames[ index ] + \"')":"")+', position " + ip + ": "',' + "Invalid opcode " + bc[ip] + "."'," );"," }"," }",""," if (ends.length > 0) {"," end = ends.pop();"," ip = ips.pop();"," } else {"," break;"," }"," }"].join("\n")),n.push(s(g("peg$ruleNames[index]","stack[0]"))),n.push("}"),n.join("\n")}())),t.push("")):l.rules.forEach(function(o){t.push(s(function(t){var o=[],a=[];function i(l){return l<0&&n.fatal("Rule '"+t.name+"': Var stack underflow: attempt to use var at index "+l),"s"+l}var c={sp:-1,maxSp:-1,push:function(l){var n=i(++this.sp)+" = "+l+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),n},pop:function(l){if(void 0===l)return i(this.sp--);for(var n=Array(l),e=0;e0&&(c.sp=g,a=e(u.slice(v,v+m)),p=c.sp,v+=m,i!==p&&n.fatal("Rule '"+t.name+"', position "+f+": Branches of a condition can't move the stack pointer differently (before: "+g+", after then: "+i+", after else: "+p+").")),w.push("if ("+l+") {"),w.push(s(o)),m>0&&(w.push("} else {"),w.push(s(a))),w.push("}")}function x(){var l=u[v+4-1],n=h(u[v+1])+"("+u.slice(v+4,v+4+l).map(function(l){return c.index(l)}).join(", ")+")";c.pop(u[v+2]),w.push(c.push(n)),v+=4+l}for(;v peg$currPos",0);break;case r.MATCH_STRING:E(l.literals[u[v+1]].length>1?"input.substr(peg$currPos, "+l.literals[u[v+1]].length+") === "+p(u[v+1]):"input.charCodeAt(peg$currPos) === "+l.literals[u[v+1]].charCodeAt(0),1);break;case r.MATCH_STRING_IC:E("input.substr(peg$currPos, "+l.literals[u[v+1]].length+").toLowerCase() === "+p(u[v+1]),1);break;case r.MATCH_CLASS:E(f(u[v+1])+".test(input.charAt(peg$currPos))",1);break;case r.ACCEPT_N:w.push(c.push(u[v+1]>1?"input.substr(peg$currPos, "+u[v+1]+")":"input.charAt(peg$currPos)")),w.push(u[v+1]>1?"peg$currPos += "+u[v+1]+";":"peg$currPos++;"),v+=2;break;case r.ACCEPT_STRING:w.push(c.push(p(u[v+1]))),w.push(l.literals[u[v+1]].length>1?"peg$currPos += "+l.literals[u[v+1]].length+";":"peg$currPos++;"),v+=2;break;case r.EXPECT:w.push("rule$expects("+d(u[v+1])+");"),v+=2;break;case r.LOAD_SAVED_POS:w.push("peg$savedPos = "+c.index(u[v+1])+";"),v+=2;break;case r.UPDATE_SAVED_POS:w.push("peg$savedPos = peg$currPos;"),v++;break;case r.CALL:x();break;case r.RULE:w.push(c.push("peg$parse"+l.rules[u[v+1]].name+"()")),v+=2;break;case r.SILENT_FAILS_ON:w.push("peg$silentFails++;"),v++;break;case r.SILENT_FAILS_OFF:w.push("peg$silentFails--;"),v++;break;case r.EXPECT_NS_BEGIN:w.push("peg$begin();"),v++;break;case r.EXPECT_NS_END:w.push("peg$end("+(0!==u[v+1])+");"),v+=2;break;default:n.fatal("Rule '"+t.name+"', position "+v+": Invalid opcode "+u[v]+".")}return w.join("\n")}(t.bytecode);o.push("function peg$parse"+t.name+"() {"),e.trace&&o.push(" var startPos = peg$currPos;");for(var b=0;b<=c.maxSp;b++)a[b]=i(b);return o.push(" var "+a.join(", ")+";"),o.push(s(m('"'+u.stringEscape(t.name)+'"',l.indexOfRule(t.name)))),o.push(s(y)),o.push(s(g('"'+u.stringEscape(t.name)+'"',i(0)))),o.push("}"),o.join("\n")}(o))),t.push("")}),l.initializer&&(t.push(s(l.initializer.code)),t.push("")),t.push(" peg$begin();"),"size"===e.optimize?t.push(" peg$result = peg$parseRule(peg$startRuleIndex);"):t.push(" peg$result = peg$startRuleFunction();"),t.push([""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$expect(peg$endExpectation());"," }",""," throw peg$buildError();"," }","}"].join("\n")),t.join("\n")}())}},function(l,n,e){"use strict";l.exports=function(l,n,e){var u=n.buildVisitor({rule_ref:function(l,n,e){l.name===n&&(l.name=e)}}),t=e.allowedStartRules,r=[];l.rules.forEach(function(n){var e;"rule"===(e=n).type&&"rule_ref"===e.expression.type&&(u(l,n.name,n.expression.name),t.indexOf(n.name)<0)||r.push(n)}),l.rules=r}},function(l,n,e){"use strict";var u=e(1),t=Object.prototype.hasOwnProperty;l.exports=function(l,n){var e;function r(l,n){e(l.expression,u.clone(n))}(e=n.buildVisitor({rule:function(l){e(l.expression,{})},choice:function(l,n){l.alternatives.forEach(function(l){e(l,u.clone(n))})},action:r,labeled:function(l,u){var r=l.label;if(r&&t.call(u,r)){var o=u[r].start;n.error('Label "'.concat(r,'" is already defined at line ').concat(o.line,", column ").concat(o.column,"."),l.location)}e(l.expression,u),r&&(u[r]=l.location)},text:r,simple_and:r,simple_not:r,optional:r,zero_or_more:r,one_or_more:r,group:r}))(l)}},function(l,n,e){"use strict";var u=Object.prototype.hasOwnProperty;l.exports=function(l,n){var e={};n.buildVisitor({rule:function(l){var t=l.name;if(u.call(e,t)){var r=e[t].start;n.error('Rule "'.concat(t,'" is already defined at line ').concat(r.line,", column ").concat(r.column,"."),l.location)}e[l.name]=l.location}})(l)}},function(l,n,e){"use strict";l.exports=function(l,n,e){var u={};function t(l){u[l.name||l]=!0}e.allowedStartRules.forEach(t),n.buildVisitor({rule_ref:t})(l),l.rules.forEach(function(l){!0!==u[l.name]&&n.warn('Rule "'.concat(l.name,'" is not referenced.'),l.location)})}},function(l,n,e){"use strict";l.exports=function(l,n){var e=[],u=n.buildVisitor({rule:function(l){e.push(l.name),u(l.expression),e.pop(l.name)},sequence:function(n){n.elements.every(function(n){return u(n),!l.alwaysConsumesOnSuccess(n)})},rule_ref:function(t){if(-1!==e.indexOf(t.name)){e.push(t.name);var r=e.join(" -> ");n.error("Possible infinite loop when parsing (left recursion: ".concat(r,")."),t.location)}u(l.findRule(t.name))}});u(l)}},function(l,n,e){"use strict";l.exports=function(l,n){n.buildVisitor({zero_or_more:function(e){l.alwaysConsumesOnSuccess(e.expression)||n.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input).",e.location)},one_or_more:function(e){l.alwaysConsumesOnSuccess(e.expression)||n.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input).",e.location)}})(l)}},function(l,n,e){"use strict";l.exports=function(l,n,e){n.buildVisitor({rule_ref:function(e){l.findRule(e.name)||n.error('Rule "'.concat(e.name,'" is not defined.'),e.location)}})(l),e.allowedStartRules.forEach(function(e){l.findRule(e)||n.error('Start rule "'.concat(e,'" is not defined.'))})}},function(l,n,e){"use strict";l.exports=function(l,n){var e;function u(l){return l.match=0,l.match}function t(l){return e(l.expression),l.match=1,l.match}function r(l){return l.match=e(l.expression),l.match}function o(l,n){for(var u=l.length,t=0,r=0,o=0;o0&&++t,a<0&&++r}return t===u?1:n?r===u?-1:0:r>0?-1:0}(e=n.buildVisitor({rule:function(l){var u,t=0;if(void 0===l.match){l.match=0;do{u=l.match,l.match=e(l.expression),++t>6&&n.error("Infinity cycle detected when trying to evaluate node match result",l.location)}while(u!==l.match)}return l.match},named:r,choice:function(l){return l.match=o(l.alternatives,!0),l.match},action:r,sequence:function(l){return l.match=o(l.elements,!1),l.match},labeled:r,text:r,simple_and:r,simple_not:function(l){return l.match=-e(l.expression),l.match},optional:t,zero_or_more:t,one_or_more:r,group:r,semantic_and:u,semantic_not:u,rule_ref:function(n){var u=l.findRule(n.name);return n.match=e(u),n.match},literal:function(l){return l.match=0===l.value.length?1:0,l.match},class:function(l){return l.match=0===l.parts.length?-1:0,l.match},any:u}))(l)}},function(l,n,e){"use strict";l.exports=function(l,n){n.buildVisitor({action:function(l){this.visit(l.expression,!0)},labeled:function(l,e){var u;!0===l.pick&&(!0===e&&n.error('"@" cannot be used with an action block.',l.location),("semantic_and"===(u=l.expression.type)||"semantic_not"===u)&&n.error('"@" cannot be used on a semantic predicate.',l.location),this.visit(l.expression))}})(l)}},function(l,n,e){"use strict";function u(l,n){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{};!function(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}(this,l),this.opcodes=n.opcodes||o,this.parser=n.parser||a,this.passes=n.passes||{},this.visitor=n.visitor||t.visitor,this.vm=n.vm||i,"function"==typeof n.warn&&(this.warn=n.warn),"function"==typeof n.error&&(this.error=n.error),Object.defineProperty(this,"fatal",{value:s})}var n,e,r;return n=l,(e=[{key:"parse",value:function(l,n){return this.parser.parse(l,n)}},{key:"buildVisitor",value:function(l){return this.visitor.build(l)}},{key:"warn",value:function(l,n){}},{key:"error",value:function(l,n){s(l,n)}}])&&u(n.prototype,e),r&&u(n,r),l}();l.exports=c},function(l,n,e){"use strict";l.exports={PUSH_EMPTY_STRING:0,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:41,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CLASS:20,ACCEPT_N:21,ACCEPT_STRING:22,EXPECT:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29,EXPECT_NS_BEGIN:38,EXPECT_NS_END:39}},function(l,n,e){(function(n){var e;e=function(){"use strict";var l="function"==typeof Promise,e="object"==typeof self?self:n,u="undefined"!=typeof Symbol,t="undefined"!=typeof Map,r="undefined"!=typeof Set,o="undefined"!=typeof WeakMap,a="undefined"!=typeof WeakSet,i="undefined"!=typeof DataView,s=u&&void 0!==Symbol.iterator,c=u&&void 0!==Symbol.toStringTag,p=r&&"function"==typeof Set.prototype.entries,f=t&&"function"==typeof Map.prototype.entries,d=p&&Object.getPrototypeOf((new Set).entries()),h=f&&Object.getPrototypeOf((new Map).entries()),m=s&&"function"==typeof Array.prototype[Symbol.iterator],g=m&&Object.getPrototypeOf([][Symbol.iterator]()),y=s&&"function"==typeof String.prototype[Symbol.iterator],b=y&&Object.getPrototypeOf(""[Symbol.iterator]()),v=8,A=-1;return function(n){var u=typeof n;if("object"!==u)return u;if(null===n)return"null";if(n===e)return"global";if(Array.isArray(n)&&(!1===c||!(Symbol.toStringTag in n)))return"Array";if("object"==typeof window&&null!==window){if("object"==typeof window.location&&n===window.location)return"Location";if("object"==typeof window.document&&n===window.document)return"Document";if("object"==typeof window.navigator){if("object"==typeof window.navigator.mimeTypes&&n===window.navigator.mimeTypes)return"MimeTypeArray";if("object"==typeof window.navigator.plugins&&n===window.navigator.plugins)return"PluginArray"}if(("function"==typeof window.HTMLElement||"object"==typeof window.HTMLElement)&&n instanceof window.HTMLElement){if("BLOCKQUOTE"===n.tagName)return"HTMLQuoteElement";if("TD"===n.tagName)return"HTMLTableDataCellElement";if("TH"===n.tagName)return"HTMLTableHeaderCellElement"}}var s=c&&n[Symbol.toStringTag];if("string"==typeof s)return s;var p=Object.getPrototypeOf(n);return p===RegExp.prototype?"RegExp":p===Date.prototype?"Date":l&&p===Promise.prototype?"Promise":r&&p===Set.prototype?"Set":t&&p===Map.prototype?"Map":a&&p===WeakSet.prototype?"WeakSet":o&&p===WeakMap.prototype?"WeakMap":i&&p===DataView.prototype?"DataView":t&&p===h?"Map Iterator":r&&p===d?"Set Iterator":m&&p===g?"Array Iterator":y&&p===b?"String Iterator":null===p?"Object":Object.prototype.toString.call(n).slice(v,A)}},l.exports=e()}).call(this,e(15))},function(l,n,e){var u=e(44),t=e(45),r=e(58),o=e(8);l.exports=function(l,n,e,u){return i({showHidden:n,seen:[],stylize:function(l){return l}},l,void 0===e?2:e)};var a=function(l){return"object"==typeof HTMLElement?l instanceof HTMLElement:l&&"object"==typeof l&&"nodeType"in l&&1===l.nodeType&&"string"==typeof l.nodeName};function i(l,e,m){if(e&&"function"==typeof e.inspect&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var g=e.inspect(m,l);return"string"!=typeof g&&(g=i(l,g,m)),g}var y=function(l,n){switch(typeof n){case"undefined":return l.stylize("undefined","undefined");case"string":var e="'"+JSON.stringify(n).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return l.stylize(e,"string");case"number":return 0===n&&1/n==-1/0?l.stylize("-0","number"):l.stylize(""+n,"number");case"boolean":return l.stylize(""+n,"boolean");case"symbol":return l.stylize(n.toString(),"symbol")}if(null===n)return l.stylize("null","null")}(l,e);if(y)return y;if(a(e)){if("outerHTML"in e)return e.outerHTML;try{if(document.xmlVersion)return(new XMLSerializer).serializeToString(e);var b=document.createElementNS("http://www.w3.org/1999/xhtml","_");b.appendChild(e.cloneNode(!1));var v=b.innerHTML.replace("><",">"+e.innerHTML+"<");return b.innerHTML="",v}catch(l){}}var A,w,E=r(e),x=l.showHidden?t(e):E;if(0===x.length||d(e)&&(1===x.length&&"stack"===x[0]||2===x.length&&"description"===x[0]&&"stack"===x[1])){if("function"==typeof e)return w=(A=u(e))?": "+A:"",l.stylize("[Function"+w+"]","special");if(p(e))return l.stylize(RegExp.prototype.toString.call(e),"regexp");if(f(e))return l.stylize(Date.prototype.toUTCString.call(e),"date");if(d(e))return s(e)}var C,_,T="",S=!1,k=!1,P=["{","}"];if("object"==typeof(C=e)&&/\w+Array]$/.test(h(C))&&(k=!0,P=["[","]"]),function(l){return Array.isArray(l)||"object"==typeof l&&"[object Array]"===h(l)}(e)&&(S=!0,P=["[","]"]),"function"==typeof e&&(T=" [Function"+(w=(A=u(e))?": "+A:"")+"]"),p(e)&&(T=" "+RegExp.prototype.toString.call(e)),f(e)&&(T=" "+Date.prototype.toUTCString.call(e)),d(e))return s(e);if(0===x.length&&(!S||0==e.length))return P[0]+T+P[1];if(m<0)return p(e)?l.stylize(RegExp.prototype.toString.call(e),"regexp"):l.stylize("[Object]","special");if(l.seen.push(e),S)_=function(l,n,e,u,t){for(var r=[],o=0,a=n.length;o=o.truncateThreshold-7){n+="...";break}n+=l[e]+", "}-1!==(n+=" ]").indexOf(", ]")&&(n=n.replace(", ]"," ]"));return n}(e);_=x.map(function(n){return c(l,e,m,E,n,S)})}return l.seen.pop(),function(l,n,e){if(l.reduce(function(l,n){return l+n.length+1},0)>60)return e[0]+(""===n?"":n+"\n ")+" "+l.join(",\n ")+" "+e[1];return e[0]+n+" "+l.join(", ")+" "+e[1]}(_,T,P)}function s(l){return"["+Error.prototype.toString.call(l)+"]"}function c(l,n,e,u,t,r){var o,a,s=Object.getOwnPropertyDescriptor(n,t);if(s&&(s.get?a=s.set?l.stylize("[Getter/Setter]","special"):l.stylize("[Getter]","special"):s.set&&(a=l.stylize("[Setter]","special"))),u.indexOf(t)<0&&(o="["+t+"]"),a||(l.seen.indexOf(n[t])<0?(a=i(l,n[t],null===e?null:e-1)).indexOf("\n")>-1&&(a=r?a.split("\n").map(function(l){return" "+l}).join("\n").substr(2):"\n"+a.split("\n").map(function(l){return" "+l}).join("\n")):a=l.stylize("[Circular]","special")),void 0===o){if(r&&t.match(/^\d+$/))return a;(o=JSON.stringify(""+t)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=l.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=l.stylize(o,"string"))}return o+": "+a}function p(l){return"object"==typeof l&&"[object RegExp]"===h(l)}function f(l){return"object"==typeof l&&"[object Date]"===h(l)}function d(l){return"object"==typeof l&&"[object Error]"===h(l)}function h(l){return Object.prototype.toString.call(l)}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),function(global,setImmediate,clearImmediate){__webpack_require__.d(__webpack_exports__,"serverPrototype",function(){return _serverPrototype}),__webpack_require__.d(__webpack_exports__,"getFakes",function(){return _getFakes}),__webpack_require__.d(__webpack_exports__,"getRestorers",function(){return _getRestorers}),__webpack_require__.d(__webpack_exports__,"createStubInstance",function(){return _createStubInstance}),__webpack_require__.d(__webpack_exports__,"inject",function(){return _inject}),__webpack_require__.d(__webpack_exports__,"mock",function(){return _mock}),__webpack_require__.d(__webpack_exports__,"reset",function(){return _reset}),__webpack_require__.d(__webpack_exports__,"resetBehavior",function(){return _resetBehavior}),__webpack_require__.d(__webpack_exports__,"resetHistory",function(){return _resetHistory}),__webpack_require__.d(__webpack_exports__,"restore",function(){return _restore}),__webpack_require__.d(__webpack_exports__,"restoreContext",function(){return _restoreContext}),__webpack_require__.d(__webpack_exports__,"replace",function(){return _replace}),__webpack_require__.d(__webpack_exports__,"replaceGetter",function(){return _replaceGetter}),__webpack_require__.d(__webpack_exports__,"replaceSetter",function(){return _replaceSetter}),__webpack_require__.d(__webpack_exports__,"spy",function(){return _spy}),__webpack_require__.d(__webpack_exports__,"stub",function(){return _stub}),__webpack_require__.d(__webpack_exports__,"fake",function(){return _fake}),__webpack_require__.d(__webpack_exports__,"useFakeTimers",function(){return _useFakeTimers}),__webpack_require__.d(__webpack_exports__,"verify",function(){return _verify}),__webpack_require__.d(__webpack_exports__,"verifyAndRestore",function(){return _verifyAndRestore}),__webpack_require__.d(__webpack_exports__,"useFakeServer",function(){return _useFakeServer}),__webpack_require__.d(__webpack_exports__,"useFakeXMLHttpRequest",function(){return _useFakeXMLHttpRequest}),__webpack_require__.d(__webpack_exports__,"usingPromise",function(){return _usingPromise}),__webpack_require__.d(__webpack_exports__,"sandbox",function(){return _sandbox}),__webpack_require__.d(__webpack_exports__,"createSandbox",function(){return _createSandbox}),__webpack_require__.d(__webpack_exports__,"assert",function(){return _assert}),__webpack_require__.d(__webpack_exports__,"match",function(){return _match}),__webpack_require__.d(__webpack_exports__,"spyCall",function(){return _spyCall}),__webpack_require__.d(__webpack_exports__,"expectation",function(){return _expectation}),__webpack_require__.d(__webpack_exports__,"defaultConfig",function(){return _defaultConfig}),__webpack_require__.d(__webpack_exports__,"setFormatter",function(){return _setFormatter}),__webpack_require__.d(__webpack_exports__,"timers",function(){return _timers}),__webpack_require__.d(__webpack_exports__,"xhr",function(){return _xhr}),__webpack_require__.d(__webpack_exports__,"FakeXMLHttpRequest",function(){return _FakeXMLHttpRequest}),__webpack_require__.d(__webpack_exports__,"fakeServer",function(){return _fakeServer}),__webpack_require__.d(__webpack_exports__,"fakeServerWithClock",function(){return _fakeServerWithClock}),__webpack_require__.d(__webpack_exports__,"createFakeServer",function(){return _createFakeServer}),__webpack_require__.d(__webpack_exports__,"createFakeServerWithClock",function(){return _createFakeServerWithClock}),__webpack_require__.d(__webpack_exports__,"addBehavior",function(){return _addBehavior});var call=Function.call,copyPrototype=function(l){return Object.getOwnPropertyNames(l).reduce(function(n,e){return"size"!==e&&"caller"!==e&&"callee"!==e&&"arguments"!==e&&"function"==typeof l[e]&&(n[e]=call.bind(l[e])),n},Object.create(null))},array=copyPrototype(Array.prototype),every=array.every;function hasCallsLeft(l,n){return void 0===l[n.id]&&(l[n.id]=0),l[n.id]1?arguments:l;return every(n,checkAdjacentCalls.bind(null,{}))},functionName=function(l){return l.displayName||l.name||(String(l).match(/function ([^\s(]+)/)||[])[1]},className=function(l){return l.constructor&&l.constructor.name||"function"==typeof l.constructor&&functionName(l.constructor)||null},every$1=function(l,n){var e=!0;try{l.forEach(function(){if(!n.apply(this,arguments))throw new Error})}catch(l){e=!1}return e},sort=array.sort,slice=array.slice;function comparator(l,n){var e=l.getCall(0),u=n.getCall(0);return(e&&e.callId||-1)<(u&&u.callId||-1)?-1:1}var orderByFirstCall=function(l){return sort(slice(l),comparator)},_function=copyPrototype(Function.prototype),object=copyPrototype(Object.prototype),string=copyPrototype(String.prototype),prototypes={array:array,function:_function,object:object,string:string},commonjsGlobal="undefined"!=typeof window?window:void 0!==global?global:"undefined"!=typeof self?self:{};function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function unwrapExports(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function createCommonjsModule(l,n){return l(n={exports:{}},n.exports),n.exports}var typeDetect=createCommonjsModule(function(l,n){var e,u,t,r,o,a,i,s,c,p,f,d,h,m,g,y,b,v,A,w;l.exports=(e="function"==typeof Promise,u="object"==typeof self?self:commonjsGlobal,t="undefined"!=typeof Symbol,r="undefined"!=typeof Map,o="undefined"!=typeof Set,a="undefined"!=typeof WeakMap,i="undefined"!=typeof WeakSet,s="undefined"!=typeof DataView,c=t&&void 0!==Symbol.iterator,p=t&&void 0!==Symbol.toStringTag,f=o&&"function"==typeof Set.prototype.entries,d=r&&"function"==typeof Map.prototype.entries,h=f&&Object.getPrototypeOf((new Set).entries()),m=d&&Object.getPrototypeOf((new Map).entries()),g=c&&"function"==typeof Array.prototype[Symbol.iterator],y=g&&Object.getPrototypeOf([][Symbol.iterator]()),b=c&&"function"==typeof String.prototype[Symbol.iterator],v=b&&Object.getPrototypeOf(""[Symbol.iterator]()),A=8,w=-1,function(l){var n=typeof l;if("object"!==n)return n;if(null===l)return"null";if(l===u)return"global";if(Array.isArray(l)&&(!1===p||!(Symbol.toStringTag in l)))return"Array";if("object"==typeof window&&null!==window){if("object"==typeof window.location&&l===window.location)return"Location";if("object"==typeof window.document&&l===window.document)return"Document";if("object"==typeof window.navigator){if("object"==typeof window.navigator.mimeTypes&&l===window.navigator.mimeTypes)return"MimeTypeArray";if("object"==typeof window.navigator.plugins&&l===window.navigator.plugins)return"PluginArray"}if(("function"==typeof window.HTMLElement||"object"==typeof window.HTMLElement)&&l instanceof window.HTMLElement){if("BLOCKQUOTE"===l.tagName)return"HTMLQuoteElement";if("TD"===l.tagName)return"HTMLTableDataCellElement";if("TH"===l.tagName)return"HTMLTableHeaderCellElement"}}var t=p&&l[Symbol.toStringTag];if("string"==typeof t)return t;var c=Object.getPrototypeOf(l);return c===RegExp.prototype?"RegExp":c===Date.prototype?"Date":e&&c===Promise.prototype?"Promise":o&&c===Set.prototype?"Set":r&&c===Map.prototype?"Map":i&&c===WeakSet.prototype?"WeakSet":a&&c===WeakMap.prototype?"WeakMap":s&&c===DataView.prototype?"DataView":r&&c===m?"Map Iterator":o&&c===h?"Set Iterator":g&&c===y?"Array Iterator":b&&c===v?"String Iterator":null===c?"Object":Object.prototype.toString.call(l).slice(A,w)})}),typeOf=function(l){return typeDetect(l).toLowerCase()};function valueToString(l){return l&&l.toString?l.toString():String(l)}var valueToString_1=valueToString,lib={calledInOrder:calledInOrder,className:className,every:every$1,functionName:functionName,orderByFirstCall:orderByFirstCall,prototypes:prototypes,typeOf:typeOf,valueToString:valueToString_1},arrayProto=lib.prototypes.array,hasOwnProperty=lib.prototypes.object.hasOwnProperty,join=arrayProto.join,push=arrayProto.push,slice$1=arrayProto.slice,hasDontEnumBug=function(){var l={constructor:function(){return"0"},toString:function(){return"1"},valueOf:function(){return"2"},toLocaleString:function(){return"3"},prototype:function(){return"4"},isPrototypeOf:function(){return"5"},propertyIsEnumerable:function(){return"6"},hasOwnProperty:function(){return"7"},length:function(){return"8"},unique:function(){return"9"}},n=[];for(var e in l)hasOwnProperty(l,e)&&push(n,l[e]());return"0123456789"!==join(n,"")}();function extendCommon(l,n,e){var u,t,r;for(t=0;t=0)return n[u];u===useLeftMostCallback&&(e=n),u===useRightMostCallback&&(e=reverse(slice$2(n)));for(var t=l.callArgProp,r=0,o=e.length;r0&&(u+=" Received ["+join$1(e,", ")+"]"),u):"argument at index "+l.callArgAt+" is not a function: "+n}function ensureArgs(l,n,e){var u=n[l.replace(/sArg/,"ArgAt")];if(u>=e.length)throw new TypeError(l+" failed: "+(u+1)+" arguments required but only "+e.length+" present")}function callCallback(l,n){if("number"==typeof l.callArgAt){ensureArgs("callsArg",l,n);var e=getCallback(l,n);if("function"!=typeof e)throw new TypeError(getCallbackError(l,e,n));if(!l.callbackAsync)return e.apply(l.callbackContext,l.callbackArguments);nextTick$1(function(){e.apply(l.callbackContext,l.callbackArguments)})}}var proto={create:function(l){var n=extend({},proto);return delete n.create,delete n.addBehavior,delete n.createBehavior,n.stub=l,l.defaultBehavior&&l.defaultBehavior.promiseLibrary&&(n.promiseLibrary=l.defaultBehavior.promiseLibrary),n},isPresent:function(){return"number"==typeof this.callArgAt||this.exception||this.exceptionCreator||"number"==typeof this.returnArgAt||this.returnThis||"number"==typeof this.resolveArgAt||this.resolveThis||"number"==typeof this.throwArgAt||this.fakeFn||this.returnValueDefined},invoke:function(l,n){var e=callCallback(this,n);if(this.exception)throw this.exception;if(this.exceptionCreator)throw this.exception=this.exceptionCreator(),this.exceptionCreator=void 0,this.exception;if("number"==typeof this.returnArgAt)return ensureArgs("returnsArg",this,n),n[this.returnArgAt];if(this.returnThis)return l;if("number"==typeof this.throwArgAt)throw ensureArgs("throwsArg",this,n),n[this.throwArgAt];return this.fakeFn?this.fakeFn.apply(l,n):"number"==typeof this.resolveArgAt?(ensureArgs("resolvesArg",this,n),(this.promiseLibrary||Promise).resolve(n[this.resolveArgAt])):this.resolveThis?(this.promiseLibrary||Promise).resolve(l):this.resolve?(this.promiseLibrary||Promise).resolve(this.returnValue):this.reject?(this.promiseLibrary||Promise).reject(this.returnValue):this.callsThrough?this.stub.wrappedMethod.apply(l,n):void 0!==this.returnValue?this.returnValue:"number"==typeof this.callArgAt?e:this.returnValue},onCall:function(l){return this.stub.onCall(l)},onFirstCall:function(){return this.stub.onFirstCall()},onSecondCall:function(){return this.stub.onSecondCall()},onThirdCall:function(){return this.stub.onThirdCall()},withArgs:function(){throw new Error('Defining a stub by invoking "stub.onCall(...).withArgs(...)" is not supported. Use "stub.withArgs(...).onCall(...)" to define sequential behavior for calls with certain arguments.')}};function createBehavior(l){return function(){return this.defaultBehavior=this.defaultBehavior||proto.create(this),this.defaultBehavior[l].apply(this.defaultBehavior,arguments),this}}function addBehavior(l,n,e){proto[n]=function(){return e.apply(this,concat([this],slice$2(arguments))),this.stub||this},l[n]=createBehavior(n)}proto.addBehavior=addBehavior,proto.createBehavior=createBehavior;var asyncBehaviors=exportAsyncBehaviors(proto),behavior=extend({},proto,asyncBehaviors),forEach=lib.prototypes.array.forEach;function walkInternal(l,n,e,u,t){var r,o;if("function"==typeof Object.getOwnPropertyNames)forEach(Object.getOwnPropertyNames(l),function(r){if(!0!==t[r]){t[r]=!0;var o="function"==typeof Object.getOwnPropertyDescriptor(l,r).get?u:l;n.call(e,r,o)}}),(r=Object.getPrototypeOf(l))&&walkInternal(r,n,e,u,t);else for(o in l)n.call(e,l[o],o,l)}var walk=function(l,n,e){return walkInternal(l,n,e,l,{})},getPropertyDescriptor=function(l,n){for(var e,u=l;u&&!(e=Object.getOwnPropertyDescriptor(u,n));)u=Object.getPrototypeOf(u);return e},hasOwnProperty$1=lib.prototypes.object.hasOwnProperty,push$1=lib.prototypes.array.push;function collectMethod(l,n,e,u){"function"==typeof getPropertyDescriptor(u,e).value&&hasOwnProperty$1(n,e)&&push$1(l,n[e])}function collectOwnMethods(l){var n=[];return walk(l,collectMethod.bind(null,n,l)),n}var collectOwnMethods_1=collectOwnMethods,isEsModule=function(l){return l&&"undefined"!=typeof Symbol&&"Module"===l[Symbol.toStringTag]&&Object.isSealed(l)};function isPropertyConfigurable(l,n){var e=getPropertyDescriptor(l,n);return!e||e.configurable}var isPropertyConfigurable_1=isPropertyConfigurable;function isNonExistentOwnProperty(l,n){return l&&void 0!==n&&!(n in l)}var isNonExistentOwnProperty_1=isNonExistentOwnProperty;function isNaN$1(l){return"number"==typeof l&&l!==l}var isNan=isNaN$1;function isNegZero(l){return 0===l&&1/l==-1/0}var isNegZero_1=isNegZero;function identical(l,n){return!!(l===n||isNan(l)&&isNan(n))&&(0!==l||isNegZero_1(l)===isNegZero_1(n))}var identical_1=identical,o=Object.prototype;function getClass(l){return o.toString.call(l).split(/[ \]]/)[1]}var getClass_1=getClass;function isArguments(l){if("Arguments"===getClass_1(l))return!0;if("object"!=typeof l||"number"!=typeof l.length||"Array"===getClass_1(l))return!1;if("function"==typeof l.callee)return!0;try{l[l.length]=6,delete l[l.length]}catch(l){return!0}return!1}var isArguments_1=isArguments,div="undefined"!=typeof document&&document.createElement("div");function isElement(l){if(!l||1!==l.nodeType||!div)return!1;try{l.appendChild(div),l.removeChild(div)}catch(l){return!1}return!0}var isElement_1=isElement;function isDate(l){return l instanceof Date}var isDate_1=isDate;function isObject(l){return!("object"!=typeof l||null===l||l instanceof Boolean||l instanceof Date||l instanceof Error||l instanceof Number||l instanceof RegExp||l instanceof String)}var isObject_1=isObject;function isSet(l){return"undefined"!=typeof Set&&l instanceof Set||!1}var isSet_1=isSet;function isSubset(l,n,e){var u=!0;return l.forEach(function(l){var t=!1;n.forEach(function(n){e(n,l)&&(t=!0)}),u=u&&t}),u}var isSubset_1=isSubset,re=/function (\w+)\s*\(/;function getClassName(l){if(l.constructor&&"name"in l.constructor)return l.constructor.name;if("function"==typeof l.constructor){var n=l.constructor.toString().match(re);if(n.length>1)return n[1]}return null}var getClassName_1=getClassName,every$2=Array.prototype.every,getTime=Date.prototype.getTime,hasOwnProperty$2=Object.prototype.hasOwnProperty,indexOf=Array.prototype.indexOf,keys=Object.keys;function deepEqualCyclic(l,n,e){var u=[],t=[],r=[],o=[],a={};return function l(n,i,s,c){if(e&&e.isMatcher(i))return e.isMatcher(n)?n===i:i.test(n);var p=typeof n,f=typeof i;if(n===i||isNan(n)||isNan(i)||null==n||null==i||"object"!==p||"object"!==f)return identical_1(n,i);if(isElement_1(n)||isElement_1(i))return!1;var d=isDate_1(n),h=isDate_1(i);if((d||h)&&(!d||!h||getTime.call(n)!==getTime.call(i)))return!1;if(n instanceof RegExp&&i instanceof RegExp&&n.toString()!==i.toString())return!1;if(n instanceof Error&&i instanceof Error)return n===i;var m=getClass_1(n),g=getClass_1(i),y=keys(n),b=keys(i),v=getClassName_1(n),A=getClassName_1(i);if(isArguments_1(n)||isArguments_1(i)){if(n.length!==i.length)return!1}else if(p!==f||m!==g||y.length!==b.length||v&&A&&v!==A)return!1;return isSet_1(n)||isSet_1(i)?!(!isSet_1(n)||!isSet_1(i)||n.size!==i.size)&&isSubset_1(n,i,l):every$2.call(y,function(e){if(!hasOwnProperty$2.call(i,e))return!1;var p=n[e],f=i[e],d=isObject_1(p),h=isObject_1(f),m=d?indexOf.call(u,p):-1,g=h?indexOf.call(t,f):-1,y=-1!==m?r[m]:s+"["+JSON.stringify(e)+"]",b=-1!==g?o[g]:c+"["+JSON.stringify(e)+"]",v=y+b;return!!a[v]||(-1===m&&d&&(u.push(p),r.push(y)),-1===g&&h&&(t.push(f),o.push(b)),d&&h&&(a[v]=!0),l(p,f,y,b))})}(l,n,"$1","$2")}deepEqualCyclic.use=function(l){return function(n,e){return deepEqualCyclic(n,e,l)}};var deepEqual=deepEqualCyclic,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reEscapeChar=/\\(\\)?/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root$1=freeGlobal||freeSelf||Function("return this")();function getValue(l,n){return null==l?void 0:l[n]}function isHostObject(l){var n=!1;if(null!=l&&"function"!=typeof l.toString)try{n=!!(l+"")}catch(l){}return n}var arrayProto$3=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root$1["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid,funcToString=funcProto.toString,hasOwnProperty$3=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$3).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol$1=root$1.Symbol,splice=arrayProto$3.splice,Map$1=getNative(root$1,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function Hash(l){var n=-1,e=l?l.length:0;for(this.clear();++n-1}function listCacheSet(l,n){var e=this.__data__,u=assocIndexOf(e,l);return u<0?e.push([l,n]):e[u][1]=n,this}function MapCache(l){var n=-1,e=l?l.length:0;for(this.clear();++n=t)return!1;if(!e(l[u+r],n[r]))return!1}return!0}return!1}function match$1(l,n){if(n&&"function"==typeof n.test)return n.test(l);if("function"==typeof n)return!0===n(l);if("string"==typeof n)return n=n.toLowerCase(),("string"==typeof l||!!l)&&String(l).toLowerCase().indexOf(n)>=0;if("number"==typeof n)return n===l;if("boolean"==typeof n)return n===l;if(void 0===n)return void 0===l;if(null===n)return null===l;if(null===l)return!1;if(isSet_1(l))return isSubset_1(n,l,match$1);if("Array"===getClass_1(l)&&"Array"===getClass_1(n))return arrayContains(l,n,match$1);if(isDate_1(n))return isDate_1(l)&&l.getTime()===n.getTime();if(n&&"object"==typeof n){if(n===l)return!0;if("object"!=typeof l)return!1;var e;for(e in n){var u=l[e];if(void 0===u&&"function"==typeof l.getAttribute&&(u=l.getAttribute(e)),null===n[e]||void 0===n[e]){if(u!==n[e])return!1}else if(void 0===u||!deepEqual$2(u,n[e]))return!1}return!0}throw new Error("Matcher was not a string, a number, a function, a boolean or an object")}Object.keys(matcher_1).forEach(function(l){match$1[l]=matcher_1[l]});var match_1=match$1,deepEqualCyclic$1=deepEqual.use(match_1),samsam={createMatcher:matcher_1,deepEqual:deepEqualCyclic$1,isArguments:isArguments_1,isElement:isElement_1,isNegZero:isNegZero_1,identical:identical_1,match:match_1},array$1=[null,"once","twice","thrice"],timesInWords=function(l){return array$1[l]||(l||0)+" times"},formatio={excludeConstructors:["Object",/^.$/],quoteStrings:!0,limitChildrenCount:0},specialObjects=[];function functionName$3(l){if(!l)return"";if(l.displayName)return l.displayName;if(l.name)return l.name;var n=l.toString().match(/function\s+([^\(]+)/m);return n&&n[1]||""}function constructorName(l,n){var e,u,t=functionName$3(n&&n.constructor),r=l.excludeConstructors||formatio.excludeConstructors||[];for(e=0,u=r.length;e0?Math.min(this.limitChildrenCount,l.length):l.length,u=0;u0?Math.min(this.limitChildrenCount,c.length):c.length,o=0;o80?d+"{\n "+h+s.join(",\n "+h)+"\n"+h+"}":d+"{ "+s.join(", ")+" }"},ascii.element=function(l){var n,e,u,t,r,o=l.tagName.toLowerCase(),a=l.attributes,i=[];for(u=0,t=a.length;u0?" ":""),c=l.innerHTML||"";return c.length>20&&(c=c.substr(0,20)+"[...]"),(s+i.join(" ")+">"+c+"").replace(/ contentEditable="inherit"/,"")},Formatio.prototype={functionName:functionName$3,configure:function(l){return new Formatio(l)},constructorName:function(l){return constructorName(this,l)},ascii:function(l,n,e){return ascii(this,l,n,e)}};var formatio_1=Formatio.prototype,formatter=formatio_1.configure({quoteStrings:!1,limitChildrenCount:250}),customFormatter;function format(){return customFormatter?customFormatter.apply(null,arguments):formatter.ascii.apply(formatter,arguments)}format.setFormatter=function(l){if("function"!=typeof l)throw new Error("format.setFormatter must be called with a function");customFormatter=l};var format_1=format,arrayProto$5=lib.prototypes.array,calledInOrder$1=lib.calledInOrder,createMatcher=samsam.createMatcher,orderByFirstCall$1=lib.orderByFirstCall,stringSlice=lib.prototypes.string.slice,arraySlice=arrayProto$5.slice,concat$1=arrayProto$5.concat,forEach$1=arrayProto$5.forEach,join$3=arrayProto$5.join,splice$1=arrayProto$5.splice,assert;function verifyIsStub(){var l=arraySlice(arguments);forEach$1(l,function(l){l||assert.fail("fake is not a spy"),l.proxy&&l.proxy.isSinonProxy?verifyIsStub(l.proxy):("function"!=typeof l&&assert.fail(l+" is not a function"),"function"!=typeof l.getCall&&assert.fail(l+" is not stubbed"))})}function verifyIsValidAssertion(l,n){switch(l){case"notCalled":case"called":case"calledOnce":case"calledTwice":case"calledThrice":0!==n.length&&assert.fail(l+" takes 1 argument but was called with "+(n.length+1)+" arguments")}}function failAssertion(l,n){var e=l||commonjsGlobal;(e.fail||assert.fail).call(e,n)}function mirrorPropAsAssertion(l,n,e){var u=e,t=n;2===arguments.length&&(u=n,t=l),assert[l]=function(n){verifyIsStub(n);var e=arraySlice(arguments,1);verifyIsValidAssertion(l,e),("function"==typeof t?!t(n):"function"==typeof n[t]?!n[t].apply(n,e):!n[t])?failAssertion(this,(n.printf||n.proxy.printf).apply(n,concat$1([u],e))):assert.pass(l)}}function exposedName(l,n){return!l||/^fail/.test(n)?n:l+stringSlice(n,0,1).toUpperCase()+stringSlice(n,1)}assert={failException:"AssertError",fail:function(l){var n=new Error(l);throw n.name=this.failException||assert.failException,n},pass:function(){},callOrder:function(){verifyIsStub.apply(null,arguments);var l="",n="";if(calledInOrder$1(arguments))assert.pass("callOrder");else{try{l=join$3(arguments,", ");for(var e=arraySlice(arguments),u=e.length;u;)e[--u].called||splice$1(e,u,1);n=join$3(orderByFirstCall$1(e),", ")}catch(l){}failAssertion(this,"expected "+l+" to be called in order but were called as "+n)}},callCount:function(l,n){if(verifyIsStub(l),l.callCount!==n){var e="expected %n to be called "+timesInWords(n)+" but was called %c%C";failAssertion(this,l.printf(e))}else assert.pass("callCount")},expose:function(l,n){if(!l)throw new TypeError("target is null or undefined");var e=n||{},u=void 0===e.prefix?"assert":e.prefix,t=void 0===e.includeFail||Boolean(e.includeFail),r=this;return forEach$1(Object.keys(r),function(n){"expose"===n||!t&&/^(fail)/.test(n)||(l[exposedName(u,n)]=r[n])}),l},match:function(l,n){if(createMatcher(n).test(l))assert.pass("match");else{var e=["expected value to match"," expected = "+format_1(n)," actual = "+format_1(l)];failAssertion(this,join$3(e,"\n"))}}},mirrorPropAsAssertion("called","expected %n to have been called at least once but was never called"),mirrorPropAsAssertion("notCalled",function(l){return!l.called},"expected %n to not have been called but was called %c%C"),mirrorPropAsAssertion("calledOnce","expected %n to be called once but was called %c%C"),mirrorPropAsAssertion("calledTwice","expected %n to be called twice but was called %c%C"),mirrorPropAsAssertion("calledThrice","expected %n to be called thrice but was called %c%C"),mirrorPropAsAssertion("calledOn","expected %n to be called with %1 as this but was called with %t"),mirrorPropAsAssertion("alwaysCalledOn","expected %n to always be called with %1 as this but was called with %t"),mirrorPropAsAssertion("calledWithNew","expected %n to be called with new"),mirrorPropAsAssertion("alwaysCalledWithNew","expected %n to always be called with new"),mirrorPropAsAssertion("calledWith","expected %n to be called with arguments %D"),mirrorPropAsAssertion("calledWithMatch","expected %n to be called with match %D"),mirrorPropAsAssertion("alwaysCalledWith","expected %n to always be called with arguments %D"),mirrorPropAsAssertion("alwaysCalledWithMatch","expected %n to always be called with match %D"),mirrorPropAsAssertion("calledWithExactly","expected %n to be called with exact arguments %D"),mirrorPropAsAssertion("alwaysCalledWithExactly","expected %n to always be called with exact arguments %D"),mirrorPropAsAssertion("neverCalledWith","expected %n to never be called with arguments %*%C"),mirrorPropAsAssertion("neverCalledWithMatch","expected %n to never be called with match %*%C"),mirrorPropAsAssertion("threw","%n did not throw exception%C"),mirrorPropAsAssertion("alwaysThrew","%n did not always throw exception%C");var assert_1=assert,lolex=createCommonjsModule(function(module,exports){var f;f=function(){return function(){return function l(n,e,u){function t(o,a){if(!e[o]){if(!n[o]){var i="function"==typeof commonjsRequire&&commonjsRequire;if(!a&&i)return i(o,!0);if(r)return r(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var c=e[o]={exports:{}};n[o][0].call(c.exports,function(l){return t(n[o][1][l]||l)},c,c.exports,l,n,e,u)}return e[o].exports}for(var r="function"==typeof commonjsRequire&&commonjsRequire,o=0;o-1,maxTimeout=Math.pow(2,31)-1;isRunningInIE&&(_global.setTimeout=_global.setTimeout,_global.clearTimeout=_global.clearTimeout,_global.setInterval=_global.setInterval,_global.clearInterval=_global.clearInterval,_global.Date=_global.Date),void 0!==_global.setImmediate&&(_global.setImmediate=_global.setImmediate,_global.clearImmediate=_global.clearImmediate);var NOOP=function(){},timeoutResult=_global.setTimeout(NOOP,0),addTimerReturnsObject="object"==typeof timeoutResult,hrtimePresent=_global.process&&"function"==typeof _global.process.hrtime,nextTickPresent=_global.process&&"function"==typeof _global.process.nextTick,performancePresent=_global.performance&&"function"==typeof _global.performance.now,hasPerformancePrototype=_global.Performance&&(typeof _global.Performance).match(/^(function|object)$/),requestAnimationFramePresent=_global.requestAnimationFrame&&"function"==typeof _global.requestAnimationFrame,cancelAnimationFramePresent=_global.cancelAnimationFrame&&"function"==typeof _global.cancelAnimationFrame;_global.clearTimeout(timeoutResult);var NativeDate=_global.Date,uniqueTimerId=1;function isNumberFinite(l){return Number.isFinite?Number.isFinite(l):"number"==typeof l&&isFinite(l)}function parseTime(l){if(!l)return 0;var n,e=l.split(":"),u=e.length,t=u,r=0;if(u>3||!/^(\d\d:){0,2}\d\d?$/.test(l))throw new Error("tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits");for(;t--;){if((n=parseInt(e[t],10))>=60)throw new Error("Invalid time "+l);r+=n*Math.pow(60,u-t-1)}return 1e3*r}function nanoRemainder(l){var n=1e6*l%1e6,e=n<0?n+1e6:n;return Math.floor(e)}function getEpoch(l){if(!l)return 0;if("function"==typeof l.getTime)return l.getTime();if("number"==typeof l)return l;throw new TypeError("now should be milliseconds since UNIX epoch")}function inRange(l,n,e){return e&&e.callAt>=l&&e.callAt<=n}function mirrorDateProperties(l,n){var e;for(e in n)n.hasOwnProperty(e)&&(l[e]=n[e]);return n.now?l.now=function(){return l.clock.now}:delete l.now,n.toSource?l.toSource=function(){return n.toSource()}:delete l.toSource,l.toString=function(){return n.toString()},l.prototype=n.prototype,l.parse=n.parse,l.UTC=n.UTC,l.prototype.toUTCString=n.prototype.toUTCString,l}function createDate(){return mirrorDateProperties(function l(n,e,u,t,r,o,a){switch(arguments.length){case 0:return new NativeDate(l.clock.now);case 1:return new NativeDate(n);case 2:return new NativeDate(n,e);case 3:return new NativeDate(n,e,u);case 4:return new NativeDate(n,e,u,t);case 5:return new NativeDate(n,e,u,t,r);case 6:return new NativeDate(n,e,u,t,r,o);default:return new NativeDate(n,e,u,t,r,o,a)}},NativeDate)}function enqueueJob(l,n){l.jobs||(l.jobs=[]),l.jobs.push(n)}function runJobs(l){if(l.jobs){for(var n=0;nl.loopLimit)throw new Error("Aborting after running "+l.loopLimit+" timers, assuming an infinite loop!")}l.jobs=[]}}function addTimer(l,n){if(void 0===n.func)throw new Error("Callback must be provided to timer calls");if(n.type=n.immediate?"Immediate":"Timeout",n.hasOwnProperty("delay")&&(isNumberFinite(n.delay)||(n.delay=0),n.delay=n.delay>maxTimeout?1:n.delay,n.delay=Math.max(0,n.delay)),n.hasOwnProperty("interval")&&(n.type="Interval",n.interval=n.interval>maxTimeout?1:n.interval),n.hasOwnProperty("animation")&&(n.type="AnimationFrame",n.animation=!0),l.timers||(l.timers={}),n.id=uniqueTimerId++,n.createdAt=l.now,n.callAt=l.now+(parseInt(n.delay)||(l.duringTick?1:0)),l.timers[n.id]=n,addTimerReturnsObject){var e={id:n.id,ref:function(){return e},unref:function(){return e},refresh:function(){return e}};return e}return n.id}function compareTimers(l,n){return l.callAtn.callAt?1:l.immediate&&!n.immediate?-1:!l.immediate&&n.immediate?1:l.createdAtn.createdAt?1:l.idn.id?1:void 0}function firstTimerInRange(l,n,e){var u,t=l.timers,r=null;for(u in t)t.hasOwnProperty(u)&&(!inRange(n,e,t[u])||r&&1!==compareTimers(r,t[u])||(r=t[u]));return r}function firstTimer(l){var n,e=l.timers,u=null;for(n in e)e.hasOwnProperty(n)&&(u&&1!==compareTimers(u,e[n])||(u=e[n]));return u}function lastTimer(l){var n,e=l.timers,u=null;for(n in e)e.hasOwnProperty(n)&&(u&&-1!==compareTimers(u,e[n])||(u=e[n]));return u}function callTimer(clock,timer){"number"==typeof timer.interval?clock.timers[timer.id].callAt+=timer.interval:delete clock.timers[timer.id],"function"==typeof timer.func?timer.func.apply(null,timer.args):eval(timer.func)}function clearTimer(l,n,e){if(n&&(l.timers||(l.timers={}),"object"==typeof n&&(n=n.id),l.timers.hasOwnProperty(n))){var u=l.timers[n];if(u.type!==e){var t="AnimationFrame"===e?"cancelAnimationFrame":"clear"+e,r="AnimationFrame"===u.type?"requestAnimationFrame":"set"+u.type;throw new Error("Cannot clear timer: timer created with "+r+"() but cleared with "+t+"()")}delete l.timers[n]}}function uninstall(l,n,e){var u,t,r;for(t=0,r=l.methods.length;t1e9)throw new TypeError("Number of nanoseconds can't exceed a billion");var i=n[0],s=a-n[1],c=o-i;return s<0&&(s+=1e9,c-=1),[c,s]}return[o,a]}if(t.Date.clock=t,t.setTimeout=function(l,n){return addTimer(t,{func:l,args:Array.prototype.slice.call(arguments,2),delay:n})},t.clearTimeout=function(l){return clearTimer(t,l,"Timeout")},t.nextTick=function(l){return enqueueJob(t,{func:l,args:Array.prototype.slice.call(arguments,1)})},t.setInterval=function(l,n){return n=parseInt(n,10),addTimer(t,{func:l,args:Array.prototype.slice.call(arguments,2),delay:n,interval:n})},t.clearInterval=function(l){return clearTimer(t,l,"Interval")},t.setImmediate=function(l){return addTimer(t,{func:l,args:Array.prototype.slice.call(arguments,1),immediate:!0})},t.clearImmediate=function(l){return clearTimer(t,l,"Immediate")},t.countTimers=function(){return Object.keys(t.timers||{}).length},t.requestAnimationFrame=function(l){var n=addTimer(t,{func:l,delay:r(),args:[t.now+r()],animation:!0});return n.id||n},t.cancelAnimationFrame=function(l){return clearTimer(t,l,"AnimationFrame")},t.runMicrotasks=function(){runJobs(t)},t.tick=function(l){var n="number"==typeof l?l:parseTime(l),u=Math.floor(n),r=nanoRemainder(n),o=e+r,a=t.now+u;if(n<0)throw new TypeError("Negative ticks are not supported");o>=1e6&&(a+=1,o-=1e6),e=o;var i,s,c,p=t.now,f=t.now;for(t.duringTick=!0,c=t.now,runJobs(t),c!==t.now&&(p+=t.now-c,a+=t.now-c),i=firstTimerInRange(t,p,a);i&&p<=a;){if(t.timers[i.id]){p=i.callAt,t.now=i.callAt,c=t.now;try{runJobs(t),callTimer(t,i)}catch(l){s=s||l}c!==t.now&&(p+=t.now-c,a+=t.now-c,f+=t.now-c)}i=firstTimerInRange(t,f,a),f=p}if(c=t.now,runJobs(t),c!==t.now&&(p+=t.now-c,a+=t.now-c),t.duringTick=!1,i=firstTimerInRange(t,p,a))try{t.tick(a-t.now)}catch(l){s=s||l}else t.now=a,e=o;if(s)throw s;return t.now},t.next=function(){runJobs(t);var l=firstTimer(t);if(!l)return t.now;t.duringTick=!0;try{return t.now=l.callAt,callTimer(t,l),runJobs(t),t.now}finally{t.duringTick=!1}},t.runAll=function(){var l;for(runJobs(t),l=0;l1||l instanceof Date||Array.isArray(l)||"number"==typeof l)throw new TypeError("lolex.install called with "+String(l)+" lolex 2.0+ requires an object parameter - see https://github.com/sinonjs/lolex");var n,e;(l=void 0!==l?l:{}).shouldAdvanceTime=l.shouldAdvanceTime||!1,l.advanceTimeDelta=l.advanceTimeDelta||20;var u=l.target||_global,t=createClock(l.now,l.loopLimit);for(t.uninstall=function(){return uninstall(t,u,l)},t.methods=l.toFake||[],0===t.methods.length&&(t.methods=keys(timers).filter(function(l){return"nextTick"!==l})),n=0,e=t.methods.length;nl.args.length)&&reduce$1(n,function(n,e,u){return n&&deepEqual$3(l.args[u],e)},!0)},calledWithMatch:function(){var l=this,n=slice$4(arguments);return!(n.length>l.args.length)&&reduce$1(n,function(n,e,u){var t=l.args[u];return n&&match$2(e).test(t)},!0)},calledWithExactly:function(){return arguments.length===this.args.length&&this.calledWith.apply(this,arguments)},notCalledWith:function(){return!this.calledWith.apply(this,arguments)},notCalledWithMatch:function(){return!this.calledWithMatch.apply(this,arguments)},returned:function(l){return deepEqual$3(this.returnValue,l)},threw:function(l){return void 0!==l&&this.exception?this.exception===l||this.exception.name===l:Boolean(this.exception)},calledWithNew:function(){return this.proxy.prototype&&this.thisValue instanceof this.proxy},calledBefore:function(l){return this.callIdl.callId},calledImmediatelyBefore:function(l){return this.callId===l.callId-1},calledImmediatelyAfter:function(l){return this.callId===l.callId+1},callArg:function(l){return this.ensureArgIsAFunction(l),this.args[l]()},callArgOn:function(l,n){return this.ensureArgIsAFunction(l),this.args[l].apply(n)},callArgWith:function(l){return this.callArgOnWith.apply(this,concat$2([l,null],slice$4(arguments,1)))},callArgOnWith:function(l,n){this.ensureArgIsAFunction(l);var e=slice$4(arguments,2);return this.args[l].apply(n,e)},throwArg:function(l){if(l>this.args.length)throw new TypeError("Not enough arguments: "+l+" required but only "+this.args.length+" present");throw this.args[l]},yield:function(){return this.yieldOn.apply(this,concat$2([null],slice$4(arguments,0)))},yieldOn:function(l){var n=slice$4(this.args),e=filter(n,function(l){return"function"==typeof l})[0];return e||throwYieldError(this.proxy," cannot yield since no callback was passed.",n),e.apply(l,slice$4(arguments,1))},yieldTo:function(l){return this.yieldToOn.apply(this,concat$2([l,null],slice$4(arguments,1)))},yieldToOn:function(l,n){var e=slice$4(this.args),u=filter(e,function(n){return n&&"function"==typeof n[l]})[0],t=u&&u[l];return t||throwYieldError(this.proxy," cannot yield to '"+valueToString$3(l)+"' since no callback was passed.",e),t.apply(n,slice$4(arguments,2))},toString:function(){var l,n=this.proxy?String(this.proxy)+"(":"";return this.args?(l=map$1(this.args,function(l){return format_1(l)}),n=n+join$4(l,", ")+")",void 0!==this.returnValue&&(n+=" => "+format_1(this.returnValue)),this.exception&&(n+=" !"+this.exception.name,this.exception.message&&(n+="("+this.exception.message+")")),this.stack&&(n+=(this.stack.split("\n")[3]||"unknown").replace(/^\s*(?:at\s+|@)?/," at ")),n):":("},ensureArgIsAFunction:function(l){if("function"!=typeof this.args[l])throw new TypeError("Expected argument at position "+l+" to be a Function, but was "+typeof this.args[l])}};function createSpyCall(l,n,e,u,t,r,o){if("number"!=typeof r)throw new TypeError("Call id is not a number");var a=Object.create(callProto),i=e.length>0&&e[e.length-1]||void 0,s=i&&"function"==typeof i?i:void 0;return a.proxy=l,a.thisValue=n,a.args=e,a.lastArg=i,a.callback=s,a.returnValue=u,a.exception=t,a.callId=r,a.errorWithCallStack=o,a}Object.defineProperty(callProto,"stack",{enumerable:!0,configurable:!0,get:function(){return this.errorWithCallStack&&this.errorWithCallStack.stack||""}}),callProto.invokeCallback=callProto.yield,createSpyCall.toString=callProto.toString;var call$1=createSpyCall,hasOwnProperty$5=lib.prototypes.object.hasOwnProperty,valueToString$4=lib.valueToString;function isFunction$1(l){return"function"==typeof l||Boolean(l&&l.constructor&&l.call&&l.apply)}function mirrorProperties(l,n){for(var e in n)hasOwnProperty$5(l,e)||(l[e]=n[e])}var hasES5Support="keys"in Object,wrapMethod=function(l,n,e){if(!l)throw new TypeError("Should wrap property of object");if("function"!=typeof e&&"object"!=typeof e)throw new TypeError("Method wrapper should be a function or a property descriptor");function u(l){var e;if(isFunction$1(l)){if(l.restore&&l.restore.sinon)e=new TypeError("Attempted to wrap "+valueToString$4(n)+" which is already wrapped");else if(l.calledBefore){var u=l.returns?"stubbed":"spied on";e=new TypeError("Attempted to wrap "+valueToString$4(n)+" which is already "+u)}}else e=new TypeError("Attempted to wrap "+typeof l+" property "+valueToString$4(n)+" as function");if(e)throw l&&l.stackTraceError&&(e.stack+="\n--------------\n"+l.stackTraceError.stack),e}var t,r,o,a;function i(){u(r=l[n]),l[n]=e,e.displayName=n}var s=l.hasOwnProperty?l.hasOwnProperty(n):hasOwnProperty$5(l,n);if(hasES5Support){var c="function"==typeof e?{value:e}:e;if((a=getPropertyDescriptor(l,n))?a.restore&&a.restore.sinon&&(t=new TypeError("Attempted to wrap "+n+" which is already wrapped")):t=new TypeError("Attempted to wrap "+typeof r+" property "+n+" as function"),t)throw a&&a.stackTraceError&&(t.stack+="\n--------------\n"+a.stackTraceError.stack),t;var p=Object.keys(c);for(o=0;o1)for(var e=1;e{n=n||process.argv;const e=l.startsWith("-")?"":1===l.length?"-":"--",u=n.indexOf(e+l),t=n.indexOf("--");return-1!==u&&(-1===t||u=2,has16m:l>=3}}function supportsColor(l){if(!1===forceColor)return 0;if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor"))return 3;if(hasFlag("color=256"))return 2;if(l&&!l.isTTY&&!0!==forceColor)return 0;const n=forceColor?1:0;if("CI"in env$1)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(l=>l in env$1)||"codeship"===env$1.CI_NAME?1:n;if("TEAMCITY_VERSION"in env$1)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env$1.TEAMCITY_VERSION)?1:0;if("truecolor"===env$1.COLORTERM)return 3;if("TERM_PROGRAM"in env$1){const l=parseInt((env$1.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(env$1.TERM_PROGRAM){case"iTerm.app":return l>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(env$1.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env$1.TERM)?1:"COLORTERM"in env$1?1:(env$1.TERM,n)}function getSupportLevel(l){return translateLevel(supportsColor(l))}hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")?forceColor=!1:(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always"))&&(forceColor=!0),"FORCE_COLOR"in env$1&&(forceColor=0===env$1.FORCE_COLOR.length||0!==parseInt(env$1.FORCE_COLOR,10));var supportsColor_1={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)};function colorize(l,n){return!1===supportsColor_1.stdout?l:"["+n+"m"+l+""}var red=function(l){return colorize(l,31)},green=function(l){return colorize(l,32)},cyan=function(l){return colorize(l,96)},white=function(l){return colorize(l,39)},bold=function(l){return colorize(l,1)},color={red:red,green:green,cyan:cyan,white:white,bold:bold},base=createCommonjsModule(function(l,n){function e(){}function u(l,n,e,u,t){for(var r=0,o=n.length,a=0,i=0;rl.length?e:l}),s.value=l.join(p)}else s.value=l.join(e.slice(a,a+s.count));a+=s.count,s.added||(i+=s.count)}}var f=n[o-1];return o>1&&"string"==typeof f.value&&(f.added||f.removed)&&l.equals("",f.value)&&(n[o-2].value+=f.value,n.pop()),n}n.__esModule=!0,n.default=e,e.prototype={diff:function(l,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=e.callback;"function"==typeof e&&(t=e,e={}),this.options=e;var r=this;function o(l){return t?(setTimeout(function(){t(void 0,l)},0),!0):l}l=this.castInput(l),n=this.castInput(n),l=this.removeEmpty(this.tokenize(l));var a=(n=this.removeEmpty(this.tokenize(n))).length,i=l.length,s=1,c=a+i,p=[{newPos:-1,components:[]}],f=this.extractCommon(p[0],n,l,0);if(p[0].newPos+1>=a&&f+1>=i)return o([{value:this.join(n),count:n.length}]);function d(){for(var e=-1*s;e<=s;e+=2){var t=void 0,c=p[e-1],f=p[e+1],d=(f?f.newPos:0)-e;c&&(p[e-1]=void 0);var h=c&&c.newPos+1=a&&d+1>=i)return o(u(r,t.components,n,l,r.useLongestToken));p[e]=t}else p[e]=void 0}var g;s++}if(t)!function l(){setTimeout(function(){if(s>c)return t();d()||l()},0)}();else for(;s<=c;){var h=d();if(h)return h}},pushComponent:function(l,n,e){var u=l[l.length-1];u&&u.added===n&&u.removed===e?l[l.length-1]={count:u.count+1,added:n,removed:e}:l.push({count:1,added:n,removed:e})},extractCommon:function(l,n,e,u){for(var t=n.length,r=e.length,o=l.newPos,a=o-u,i=0;o+11&&void 0!==arguments[1]?arguments[1]:{},e=l.split(/\r\n|[\n\v\f\r\x85]/),u=l.match(/\r\n|[\n\v\f\r\x85]/g)||[],t=[],r=0;function o(){var l={};for(t.push(l);r2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n&&(n=(0,parse.parsePatch)(n)),Array.isArray(n)){if(n.length>1)throw new Error("applyPatch only works with a single input.");n=n[0]}var t=l.split(/\r\n|[\n\v\f\r\x85]/),r=l.match(/\r\n|[\n\v\f\r\x85]/g)||[],o=n.hunks,a=e.compareLine||function(l,n,e,u){return n===u},i=0,s=e.fuzzFactor||0,c=0,p=0,f=void 0,d=void 0;function h(l,n){for(var e=0;e0?u[0]:" ",o=u.length>0?u.substr(1):u;if(" "===r||"-"===r){if(!a(n+1,t[n],r,o)&&++i>s)return!1;n++}}return!0}for(var m=0;m0?T[0]:" ",k=T.length>0?T.substr(1):T,P=x.linedelimiters[_];if(" "===S)C++;else if("-"===S)t.splice(C,1),r.splice(C,1);else if("+"===S)t.splice(C,0,k),r.splice(C,0,P),C++;else if("\\"===S){var F=x.lines[_-1]?x.lines[_-1][0]:null;"+"===F?f=!0:"-"===F&&(d=!0)}}}if(f)for(;!t[t.length-1];)t.pop(),r.pop();else d&&(t.push(""),r.push("\n"));for(var j=0;j0?s(g.lines.slice(-a.context)):[],p-=d.length,f-=d.length)}(o=d).push.apply(o,e(r.map(function(l){return(n.added?"+":"-")+l}))),n.added?m+=r.length:h+=r.length}else{if(p)if(r.length<=2*a.context&&l=i.length-2&&r.length<=a.context){var w=/\n$/.test(u),E=/\n$/.test(t);0!=r.length||w?w&&E||d.push("\\ No newline at end of file"):d.splice(A.oldLines,0,"\\ No newline at end of file")}c.push(A),p=0,f=0,d=[]}h+=r.length,m+=r.length}},y=0;yl.length)return!1;for(var e=0;e/g,">")).replace(/"/g,""")}n.__esModule=!0,n.convertChangesToXML=function(l){for(var n=[],u=0;u"):t.removed&&n.push(""),n.push(e(t.value)),t.added?n.push(""):t.removed&&n.push("")}return n.join("")}});unwrapExports(xml);var xml_1=xml.convertChangesToXML,lib$1=createCommonjsModule(function(l,n){n.__esModule=!0,n.canonicalize=n.convertChangesToXML=n.convertChangesToDMP=n.merge=n.parsePatch=n.applyPatches=n.applyPatch=n.createPatch=n.createTwoFilesPatch=n.structuredPatch=n.diffArrays=n.diffJson=n.diffCss=n.diffSentences=n.diffTrimmedLines=n.diffLines=n.diffWordsWithSpace=n.diffWords=n.diffChars=n.Diff=void 0;var e,u=(e=base)&&e.__esModule?e:{default:e};n.Diff=u.default,n.diffChars=character.diffChars,n.diffWords=word.diffWords,n.diffWordsWithSpace=word.diffWordsWithSpace,n.diffLines=line.diffLines,n.diffTrimmedLines=line.diffTrimmedLines,n.diffSentences=sentence.diffSentences,n.diffCss=css.diffCss,n.diffJson=json.diffJson,n.diffArrays=array$2.diffArrays,n.structuredPatch=create.structuredPatch,n.createTwoFilesPatch=create.createTwoFilesPatch,n.createPatch=create.createPatch,n.applyPatch=apply.applyPatch,n.applyPatches=apply.applyPatches,n.parsePatch=parse.parsePatch,n.merge=merge_1.merge,n.convertChangesToDMP=dmp.convertChangesToDMP,n.convertChangesToXML=xml.convertChangesToXML,n.canonicalize=json.canonicalize});unwrapExports(lib$1);var lib_1$1=lib$1.canonicalize,lib_2$1=lib$1.convertChangesToXML,lib_3$1=lib$1.convertChangesToDMP,lib_4$1=lib$1.merge,lib_5$1=lib$1.parsePatch,lib_6$1=lib$1.applyPatches,lib_7$1=lib$1.applyPatch,lib_8$1=lib$1.createPatch,lib_9=lib$1.createTwoFilesPatch,lib_10=lib$1.structuredPatch,lib_11=lib$1.diffArrays,lib_12=lib$1.diffJson,lib_13=lib$1.diffCss,lib_14=lib$1.diffSentences,lib_15=lib$1.diffTrimmedLines,lib_16=lib$1.diffLines,lib_17=lib$1.diffWordsWithSpace,lib_18=lib$1.diffWords,lib_19=lib$1.diffChars,lib_20=lib$1.Diff,arrayProto$7=lib.prototypes.array,match$3=samsam.createMatcher,join$5=arrayProto$7.join,map$2=arrayProto$7.map,push$2=arrayProto$7.push;function colorSinonMatchText(l,n,e){var u=e;return l.test(n)||(l.message=color.red(l.message),u&&(u=color.green(u))),u+" "+l.message}function colorDiffText(l){var n=map$2(l,function(n){var e=n.value;return n.added?e=color.green(e):n.removed&&(e=color.red(e)),2===l.length&&(e+=" "),e});return join$5(n,"")}var spyFormatters={c:function(l){return timesInWords(l.callCount)},n:function(l){return l.toString()},D:function(l,n){for(var e="",u=0,t=l.callCount;u1&&(e+="\nCall "+(u+1)+":");for(var r=l.getCall(u).args,o=0;o0?"\n"+join$5(n,"\n"):""},t:function(l){for(var n=[],e=0,u=l.callCount;e=this.callCount?null:call$1(this,this.thisValues[l],this.args[l],this.returnValues[l],this.exceptions[l],this.callIds[l],this.errorsWithCallStack[l])},getCalls:function(){var l,n=[];for(l=0;ll.callIds[0]},calledImmediatelyBefore:function(l){return!(!this.called||!l.called)&&this.callIds[this.callCount-1]===l.callIds[l.callCount-1]-1},calledImmediatelyAfter:function(l){return!(!this.called||!l.called)&&this.callIds[this.callCount-1]===l.callIds[l.callCount-1]+1},withArgs:function(){var l=slice$5(arguments);if(this.fakes){var n=pop(this.matchingFakes(l,!0));if(n)return n}else this.fakes=[];var e=this,u=this.instantiateFake();return u.matchingArguments=l,u.parent=this,push$3(this.fakes,u),e.defaultBehavior&&e.defaultBehavior.promiseLibrary&&(u.defaultBehavior=u.defaultBehavior||createBehavior$1(u),u.defaultBehavior.promiseLibrary=e.defaultBehavior.promiseLibrary),u.withArgs=function(){return e.withArgs.apply(e,arguments)},forEach$2(e.args,function(l,n){u.matches(l)&&(incrementCallCount.call(u),push$3(u.thisValues,e.thisValues[n]),push$3(u.args,l),push$3(u.returnValues,e.returnValues[n]),push$3(u.exceptions,e.exceptions[n]),push$3(u.callIds,e.callIds[n]))}),createCallProperties.call(u),u},matchingFakes:function(l,n){return filter$1.call(this.fakes||[],function(e){return e.matches(l,n)})},matches:function(l,n){var e=this.matchingArguments;if(e.length<=l.length&&deepEqual$4(slice$5(l,0,e.length),e))return!n||e.length===l.length},printf:function(l){var n,e=this,u=slice$5(arguments,1);return(l||"").replace(/%(.)/g,function(l,t){return"function"==typeof(n=spyApi.formatters[t])?String(n(e,u)):isNaN(parseInt(t,10))?"%"+t:format_1(u[t-1])})}};function delegateToCalls(l,n,e,u,t,r){spyApi[l]=function(){if(!this.called)return!!t&&t.apply(this,arguments);if(void 0!==r&&this.callCount!==r)return!1;for(var o,a=0,i=[],s=0,c=this.callCount;s2)throw new TypeError("stub(obj, 'meth', fn) has been removed, see documentation");if(isEsModule(l))throw new TypeError("ES Modules cannot be stubbed");if(throwOnFalsyObject_1.apply(null,arguments),isNonExistentOwnProperty_1(l,n))throw new TypeError("Cannot stub non-existent own property "+valueToString$7(n));var e=getPropertyDescriptor(l,n),u="object"==typeof l||"function"==typeof l,t=void 0===n&&u,r=!l&&void 0===n,o=u&&void 0!==n&&(void 0===e||"function"!=typeof e.value)&&"undefined"==typeof descriptor,a="object"==typeof l&&void 0!==e&&"function"==typeof e.value?l[n].length:0;if(t)return stubEntireObject_1(stub,l);if(r)return stub.create();var i=stub.create(a);return i.rootObj=l,i.propName=n,i.restore=function(){void 0===e?delete l[n]:Object.defineProperty(l,n,e)},o?i:wrapMethod(l,n,i)}function getParentBehaviour(l){return l.parent&&getCurrentBehavior(l.parent)}function getDefaultBehavior(l){return l.defaultBehavior||getParentBehaviour(l)||behavior.create(l)}function getCurrentBehavior(l){var n=l.behaviors[l.callCount-1];return n&&n.isPresent()?n:getDefaultBehavior(l)}stub.createStubInstance=function(l,n){if("function"!=typeof l)throw new TypeError("The constructor should be a function.");var e=stub(Object.create(l.prototype));return forEach$3(Object.keys(n||{}),function(l){if(!(l in e))throw new Error("Cannot stub "+l+". Property does not exist!");var u=n[l];u&&u.createStubInstance?e[l]=u:e[l].returns(u)}),e};var uuid$1=0,proto$1={create:function(l){var n=function(){var l=slice$7(arguments),e=n.matchingFakes(l);return getCurrentBehavior(pop$1(sort$1(e,function(l,n){return l.matchingArguments.length-n.matchingArguments.length}))||n).invoke(this,arguments)},e=n;return(n=spy_1.create(n,l)).id="stub#"+uuid$1++,n.func=e,extend(n,stub),n.instantiateFake=stub.create,n.displayName="stub",n.toString=functionToString,n.defaultBehavior=null,n.behaviors=[],n},resetBehavior:function(){var l=this.fakes||[];this.defaultBehavior=null,this.behaviors=[],delete this.returnValue,delete this.returnArgAt,delete this.throwArgAt,delete this.resolveArgAt,delete this.fakeFn,this.returnThis=!1,this.resolveThis=!1,forEach$3(l,function(l){l.resetBehavior()})},resetHistory:spy_1.resetHistory,reset:function(){this.resetHistory(),this.resetBehavior()},onCall:function(l){return this.behaviors[l]||(this.behaviors[l]=behavior.create(this)),this.behaviors[l]},onFirstCall:function(){return this.onCall(0)},onSecondCall:function(){return this.onCall(1)},onThirdCall:function(){return this.onCall(2)}};forEach$3(Object.keys(behavior),function(l){hasOwnProperty$6(behavior,l)&&!hasOwnProperty$6(proto$1,l)&&"create"!==l&&"withArgs"!==l&&"invoke"!==l&&(proto$1[l]=behavior.createBehavior(l))}),forEach$3(Object.keys(defaultBehaviors_1),function(l){hasOwnProperty$6(defaultBehaviors_1,l)&&!hasOwnProperty$6(proto$1,l)&&behavior.addBehavior(stub,l,defaultBehaviors_1[l])}),extend(stub,proto$1);var stub_1=stub,arrayProto$b=lib.prototypes.array,spyInvoke=spy_1.invoke,spyCallToString=call$1.toString,match$4=samsam.createMatcher,deepEqual$5=samsam.deepEqual,valueToString$8=lib.valueToString,every$4=arrayProto$b.every,forEach$4=arrayProto$b.forEach,push$4=arrayProto$b.push,slice$8=arrayProto$b.slice;function callCountInWords(l){return 0===l?"never called":"called "+timesInWords(l)}function expectedCallCountInWords(l){var n=l.minCalls,e=l.maxCalls;if("number"==typeof n&&"number"==typeof e){var u=timesInWords(n);return n!==e&&(u="at least "+u+" and at most "+timesInWords(e)),u}return"number"==typeof n?"at least "+timesInWords(n):"at most "+timesInWords(e)}function receivedMinCalls(l){return!("number"==typeof l.minCalls)||l.callCount>=l.minCalls}function receivedMaxCalls(l){return"number"==typeof l.maxCalls&&l.callCount===l.maxCalls}function verifyMatcher(l,n){return match$4.isMatcher(l)&&l.test(n)||!0}var mockExpectation={minCalls:1,maxCalls:1,create:function(l){var n=extend(stub_1.create(),mockExpectation);return delete n.create,n.method=l,n},invoke:function(l,n,e){return this.verifyCallAllowed(n,e),spyInvoke.apply(this,arguments)},atLeast:function(l){if("number"!=typeof l)throw new TypeError("'"+valueToString$8(l)+"' is not number");return this.limitsSet||(this.maxCalls=null,this.limitsSet=!0),this.minCalls=l,this},atMost:function(l){if("number"!=typeof l)throw new TypeError("'"+valueToString$8(l)+"' is not number");return this.limitsSet||(this.minCalls=null,this.limitsSet=!0),this.maxCalls=l,this},never:function(){return this.exactly(0)},once:function(){return this.exactly(1)},twice:function(){return this.exactly(2)},thrice:function(){return this.exactly(3)},exactly:function(l){if("number"!=typeof l)throw new TypeError("'"+valueToString$8(l)+"' is not a number");return this.atLeast(l),this.atMost(l)},met:function(){return!this.failed&&receivedMinCalls(this)},verifyCallAllowed:function(l,n){var e=this.expectedArguments;receivedMaxCalls(this)&&(this.failed=!0,mockExpectation.fail(this.method+" already called "+timesInWords(this.maxCalls))),"expectedThis"in this&&this.expectedThis!==l&&mockExpectation.fail(this.method+" called with "+valueToString$8(l)+" as thisValue, expected "+valueToString$8(this.expectedThis)),"expectedArguments"in this&&(n||mockExpectation.fail(this.method+" received no arguments, expected "+format_1(e)),n.length0?mockExpectation_1.fail(join$6(concat$4(n,e),"\n")):e.length>0&&mockExpectation_1.pass(join$6(concat$4(n,e),"\n")),!0},usingPromise:function(l){return this.promiseLibrary=l,this},invokeMethod:function(l,n,e){var u,t=this.expectations&&this.expectations[l]?this.expectations[l]:[],r=e||[],o=filter$2(t,function(l){return arrayEquals(l.expectedArguments||[],r,l.expectsExactArgCount)}),a=filter$2(o,function(l){return!l.met()&&l.allowsCall(n,e)});if(a.length>0)return a[0].apply(n,e);var i=[],s=0;if(forEach$6(o,function(l){l.allowsCall(n,e)?u=u||l:s+=1}),u&&0===s)return u.apply(n,e);forEach$6(t,function(l){push$5(i," "+String(l))}),unshift(i,"Unexpected call: "+spyCallToString$1.call({proxy:l,args:e}));var c=new Error;if(!c.stack)try{throw c}catch(l){}push$5(this.failures,"Unexpected call: "+spyCallToString$1.call({proxy:l,args:e,stack:c.stack})),mockExpectation_1.fail(join$6(i,"\n"))}});var mock_1=mock,arrayProto$d=lib.prototypes.array,forEach$7=arrayProto$d.forEach,slice$a=arrayProto$d.slice;function getError(l){return l instanceof Error?l:new Error(l)}function cleanProxy(l){return forEach$7(["instantiateFake","callArg","callArgOn","callArgOnWith","callArgWith","invokeCallback","throwArg","withArgs","yield","yieldOn","yieldTo","yieldToOn"],function(n){delete l[n]}),l}var uuid$2=0;function wrapFunc(l){var n=cleanProxy(spy_1(function(){var e=arguments.length>0&&arguments[arguments.length-1]||void 0,u=e&&"function"==typeof e?e:void 0;return n.lastArg=e,n.callback=u,l&&l.apply(this,arguments)}));return n.displayName="fake",n.id="fake#"+uuid$2++,n}function fake(l){if(arguments.length>0&&"function"!=typeof l)throw new TypeError("Expected f argument to be a Function");return wrapFunc(l)}function yieldInternal(l,n){return wrapFunc(function(){var e=arguments[arguments.length-1];if("function"!=typeof e)throw new TypeError("Expected last argument to be a function");l?nextTick$1(function(){e.apply(null,n)}):e.apply(null,n)})}fake.returns=function(l){return wrapFunc(function(){return l})},fake.throws=function(l){return wrapFunc(function(){throw getError(l)})},fake.resolves=function(l){return wrapFunc(function(){return Promise.resolve(l)})},fake.rejects=function(l){return wrapFunc(function(){return Promise.reject(getError(l))})},fake.yields=function(){return yieldInternal(!1,slice$a(arguments))},fake.yieldsAsync=function(){return yieldInternal(!0,slice$a(arguments))};var fake_1=fake,nise=createCommonjsModule(function(module,exports){var f;f=function(){var define;return function(){return function l(n,e,u){function t(o,a){if(!e[o]){if(!n[o]){var i="function"==typeof commonjsRequire&&commonjsRequire;if(!a&&i)return i(o,!0);if(r)return r(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var c=e[o]={exports:{}};n[o][0].call(c.exports,function(l){var e=n[o][1][l];return t(e||l)},c,c.exports,l,n,e,u)}return e[o].exports}for(var r="function"==typeof commonjsRequire&&commonjsRequire,o=0;o0&&this.respondWith.apply(this,arguments);var l=this.queue||[],n=l.splice(0,l.length),e=this;n.forEach(function(l){e.processRequest(l)})},processRequest:function(l){try{if(l.aborted)return;var n=this.response||[404,{},""];if(this.responses)for(var e=this.responses.length-1;e>=0;e--)if(c.call(this,this.responses[e],l)){n=this.responses[e].response;break}4!==l.readyState&&(this.log(n,l),l.respond(n[0],n[1],n[2]))}catch(l){this.logError("Fake server request processing",l)}},restore:function(){return this.xhr.restore&&this.xhr.restore.apply(this.xhr,arguments)},getRequest:function(l){return this.requests[l]||null},reset:function(){this.resetBehavior(),this.resetHistory()},resetBehavior:function(){this.responses.length=this.queue.length=0},resetHistory:function(){this.requests.length=this.requestCount=0,this.requestedOnce=this.requestedTwice=this.requestedThrice=this.requested=!1,this.firstRequest=this.secondRequest=this.thirdRequest=this.lastRequest=null}};n.exports=p},{"../configure-logger":1,"../fake-xhr":11,"./format":8,"path-to-regexp":45}],10:[function(l,n,e){e.isSupported=function(){try{return!!new Blob}catch(l){return!1}}()},{}],11:[function(l,n,e){(function(e){var u=l("text-encoding").TextEncoder,t=l("../configure-logger"),r=l("../event"),o=l("just-extend");var a,i="undefined"!=typeof ProgressEvent,s="undefined"!=typeof CustomEvent,c="undefined"!=typeof FormData,p="undefined"!=typeof ArrayBuffer,f=l("./blob").isSupported,d=e.navigator&&"ReactNative"===e.navigator.product,h={XMLHttpRequest:e.XMLHttpRequest};h.GlobalXMLHttpRequest=e.XMLHttpRequest,h.GlobalActiveXObject=e.ActiveXObject,h.supportsActiveX=void 0!==h.GlobalActiveXObject,h.supportsXHR=void 0!==h.GlobalXMLHttpRequest,h.workingXHR=void 0!==(a=e).XMLHttpRequest?a.XMLHttpRequest:!(void 0===a.ActiveXObject)&&function(){return new a.ActiveXObject("MSXML2.XMLHTTP.3.0")},h.supportsTimeout=h.supportsXHR&&"timeout"in new h.GlobalXMLHttpRequest,h.supportsCORS=d||h.supportsXHR&&"withCredentials"in new h.GlobalXMLHttpRequest;var m={"Accept-Charset":!0,"Access-Control-Request-Headers":!0,"Access-Control-Request-Method":!0,"Accept-Encoding":!0,Connection:!0,"Content-Length":!0,Cookie:!0,Cookie2:!0,"Content-Transfer-Encoding":!0,Date:!0,DNT:!0,Expect:!0,Host:!0,"Keep-Alive":!0,Origin:!0,Referer:!0,TE:!0,Trailer:!0,"Transfer-Encoding":!0,Upgrade:!0,"User-Agent":!0,Via:!0};function g(){var l=this;["loadstart","progress","abort","error","load","timeout","loadend"].forEach(function(n){l.addEventListener(n,function(e){var u=l["on"+n];u&&"function"==typeof u&&u.call(this,e)})})}function y(l){g.call(this),this.readyState=y.UNSENT,this.requestHeaders={},this.requestBody=null,this.status=0,this.statusText="",this.upload=new g,this.responseType="",this.response="",this.logError=t(l),h.supportsTimeout&&(this.timeout=0),h.supportsCORS&&(this.withCredentials=!1),"function"==typeof y.onCreate&&y.onCreate(this)}function b(l){if(l.readyState!==y.OPENED)throw new Error("INVALID_STATE_ERR");if(l.sendFlag)throw new Error("INVALID_STATE_ERR")}function v(l,n){return Object.keys(l).filter(function(l){return l.toLowerCase()===n.toLowerCase()})[0]||null}function A(l){return!/^Set-Cookie2?$/i.test(l)}g.prototype=r.EventTarget;var w=function(l,n,e){switch(e.length){case 0:return l[n]();case 1:return l[n](e[0]);case 2:return l[n](e[0],e[1]);case 3:return l[n](e[0],e[1],e[2]);case 4:return l[n](e[0],e[1],e[2],e[3]);case 5:return l[n](e[0],e[1],e[2],e[3],e[4]);default:throw new Error("Unhandled case")}};function E(l){if(l.readyState!==y.OPENED)throw new Error("INVALID_STATE_ERR - "+l.readyState)}function x(l,n){return l instanceof ArrayBuffer?l:new u(n||"utf-8").encode(l).buffer}function C(l){return!l||/(text\/xml)|(application\/xml)|(\+xml)/.test(l)}function _(l){""===l.responseType||"text"===l.responseType?l.response=l.responseText="":l.response=l.responseText=null,l.responseXML=null}function T(l){_(l),l.errorFlag=!0,l.requestHeaders={},l.responseHeaders={},l.readyState!==y.UNSENT&&l.sendFlag&&l.readyState!==y.DONE&&(l.readyStateChange(y.DONE),l.sendFlag=!1)}y.filters=[],y.addFilter=function(l){this.filters.push(l)},y.defake=function(l,n){var e=new h.workingXHR;["open","setRequestHeader","abort","getResponseHeader","getAllResponseHeaders","addEventListener","overrideMimeType","removeEventListener"].forEach(function(n){l[n]=function(){return w(e,n,arguments)}}),l.send=function(){return e.responseType!==l.responseType&&(e.responseType=l.responseType),w(e,"send",arguments)};var u=function(n){n.forEach(function(n){l[n]=e[n]})},t=function(){l.readyState=e.readyState,e.readyState>=y.HEADERS_RECEIVED&&u(["status","statusText"]),e.readyState>=y.LOADING&&(u(["response"]),""!==e.responseType&&"text"!==e.responseType||u(["responseText"])),e.readyState!==y.DONE||""!==e.responseType&&"document"!==e.responseType||u(["responseXML"])},r=function(){l.onreadystatechange&&l.onreadystatechange.call(l,{target:l,currentTarget:l})};e.addEventListener?(e.addEventListener("readystatechange",t),Object.keys(l.eventListeners).forEach(function(n){l.eventListeners[n].forEach(function(l){e.addEventListener(n,l.listener,{capture:l.capture,once:l.once})})}),e.addEventListener("readystatechange",r)):e.onreadystatechange=function(){t(),r()},w(e,"open",n)},y.useFilters=!1,y.parseXML=function(l){if(""!==l)try{if("undefined"!=typeof DOMParser){var n,e=new DOMParser,u="";try{var t=e.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror");t.length&&(u=t[0].namespaceURI)}catch(l){}try{n=e.parseFromString(l,"text/xml")}catch(l){return null}return n.getElementsByTagNameNS(u,"parsererror").length?null:n}var r=new window.ActiveXObject("Microsoft.XMLDOM");return r.async="false",r.loadXML(l),0!==r.parseError.errorCode?null:r}catch(l){}return null},y.statusCodes={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choice",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},o(y.prototype,r.EventTarget,{async:!0,open:function(l,n,e,u,t){if(this.method=l,this.url=n,this.async="boolean"!=typeof e||e,this.username=u,this.password=t,_(this),this.requestHeaders={},this.sendFlag=!1,!0===y.useFilters){var r=arguments;if(y.filters.some(function(l){return l.apply(this,r)}))return void y.defake(this,arguments)}this.readyStateChange(y.OPENED)},readyStateChange:function(l){this.readyState=l;var n,e,u=new r.Event("readystatechange",!1,!1,this);if("function"==typeof this.onreadystatechange)try{this.onreadystatechange(u)}catch(l){this.logError("Fake XHR onreadystatechange handler",l)}this.readyState===y.DONE&&(this.timedOut||this.aborted||0===this.status?(e={loaded:0,total:0},n=(this.timedOut?"timeout":this.aborted&&"abort")||"error"):(e={loaded:100,total:100},n="load"),i&&(this.upload.dispatchEvent(new r.ProgressEvent("progress",e,this)),this.upload.dispatchEvent(new r.ProgressEvent(n,e,this)),this.upload.dispatchEvent(new r.ProgressEvent("loadend",e,this))),this.dispatchEvent(new r.ProgressEvent("progress",e,this)),this.dispatchEvent(new r.ProgressEvent(n,e,this)),this.dispatchEvent(new r.ProgressEvent("loadend",e,this))),this.dispatchEvent(u)},setRequestHeader:function(l,n){if("string"!=typeof n)throw new TypeError("By RFC7230, section 3.2.4, header values should be strings. Got "+typeof n);b(this);var e=!0;if("function"==typeof this.unsafeHeadersEnabled&&(e=this.unsafeHeadersEnabled()),e&&(null!==v(m,l)||/^(Sec-|Proxy-)/i.test(l)))throw new Error('Refused to set unsafe header "'+l+'"');n=function(l){return l.replace(/^[\x09\x0A\x0D\x20]+|[\x09\x0A\x0D\x20]+$/g,"")}(n);var u=v(this.requestHeaders,l);u?this.requestHeaders[u]+=", "+n:this.requestHeaders[l]=n},setStatus:function(l){var n="number"==typeof l?l:200;E(this),this.status=n,this.statusText=y.statusCodes[n]},setResponseHeaders:function(l){E(this);var n=this.responseHeaders={};Object.keys(l).forEach(function(e){n[e]=l[e]}),this.async?this.readyStateChange(y.HEADERS_RECEIVED):this.readyState=y.HEADERS_RECEIVED},send:function(l){if(b(this),!/^(head)$/i.test(this.method)){var n=v(this.requestHeaders,"Content-Type");if(this.requestHeaders[n]){var e=this.requestHeaders[n].split(";");this.requestHeaders[n]=e[0]+";charset=utf-8"}else!c||l instanceof FormData||(this.requestHeaders["Content-Type"]="text/plain;charset=utf-8");this.requestBody=l}if(this.errorFlag=!1,this.sendFlag=this.async,_(this),this.readyStateChange(y.OPENED),"function"==typeof this.onSend&&this.onSend(this),h.supportsTimeout&&"object"==typeof setInterval.clock&&"object"==typeof Date.clock)var u=Date.now(),t=this,o=setInterval(function(){t.readyState===y.UNSENT||t.readyState===y.DONE?clearInterval(o):"number"==typeof t.timeout&&t.timeout>0&&Date.now()>=u+t.timeout&&(t.triggerTimeout(),clearInterval(o))},1);this.dispatchEvent(new r.Event("loadstart",!1,!1,this))},abort:function(){this.aborted=!0,T(this),this.readyState=y.UNSENT},error:function(){_(this),this.errorFlag=!0,this.requestHeaders={},this.responseHeaders={},this.readyStateChange(y.DONE)},triggerTimeout:function(){h.supportsTimeout&&(this.timedOut=!0,T(this))},getResponseHeader:function(l){return this.readyState=y.LOADING)throw new Error("INVALID_STATE_ERR");this.overriddenMimeType=l}});var S={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};o(y,S),o(y.prototype,S),n.exports={xhr:h,FakeXMLHttpRequest:y,useFakeXMLHttpRequest:function(){return y.restore=function(l){h.supportsXHR&&(e.XMLHttpRequest=h.GlobalXMLHttpRequest),h.supportsActiveX&&(e.ActiveXObject=h.GlobalActiveXObject),delete y.restore,!0!==l&&delete y.onCreate},h.supportsXHR&&(e.XMLHttpRequest=y),h.supportsActiveX&&(e.ActiveXObject=function(l){return"Microsoft.XMLHTTP"===l||/^Msxml2\.XMLHTTP/i.test(l)?new y:new h.GlobalActiveXObject(l)}),y}}}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../configure-logger":1,"../event":5,"./blob":10,"just-extend":42,"text-encoding":46}],12:[function(l,n,e){n.exports={fakeServer:l("./fake-server"),fakeServerWithClock:l("./fake-server/fake-server-with-clock"),fakeXhr:l("./fake-xhr")}},{"./fake-server":9,"./fake-server/fake-server-with-clock":7,"./fake-xhr":11}],13:[function(l,n,e){n.exports=function(l,n){var e=!0;try{l.forEach(function(){if(!n.apply(this,arguments))throw new Error})}catch(l){e=!1}return e}},{}],14:[function(l,n,e){n.exports=function(l){return l.displayName||l.name||(String(l).match(/function ([^\s\(]+)/)||[])[1]}},{}],15:[function(l,n,e){n.exports={every:l("./every"),functionName:l("./function-name"),prototypes:l("./prototypes"),typeOf:l("./type-of"),valueToString:l("./value-to-string")}},{"./every":13,"./function-name":14,"./prototypes":19,"./type-of":22,"./value-to-string":23}],16:[function(l,n,e){var u=l("./copy-prototype");n.exports=u(Array.prototype)},{"./copy-prototype":17}],17:[function(l,n,e){var u=Function.call;n.exports=function(l){return Object.getOwnPropertyNames(l).reduce(function(n,e){return"size"!==e&&"caller"!==e&&"callee"!==e&&"arguments"!==e&&"function"==typeof l[e]&&(n[e]=u.bind(l[e])),n},Object.create(null))}},{}],18:[function(l,n,e){var u=l("./copy-prototype");n.exports=u(Function.prototype)},{"./copy-prototype":17}],19:[function(l,n,e){n.exports={array:l("./array"),function:l("./function"),object:l("./object"),string:l("./string")}},{"./array":16,"./function":18,"./object":20,"./string":21}],20:[function(l,n,e){var u=l("./copy-prototype");n.exports=u(Object.prototype)},{"./copy-prototype":17}],21:[function(l,n,e){var u=l("./copy-prototype");n.exports=u(String.prototype)},{"./copy-prototype":17}],22:[function(l,n,e){var u=l("type-detect");n.exports=function(l){return u(l).toLowerCase()}},{"type-detect":49}],23:[function(l,n,e){n.exports=function(l){return l&&l.toString?l.toString():String(l)}},{}],24:[function(l,n,e){(function(e){var u=l("@sinonjs/samsam"),t={excludeConstructors:["Object",/^.$/],quoteStrings:!0,limitChildrenCount:0},r=[];function o(l){if(!l)return"";if(l.displayName)return l.displayName;if(l.name)return l.name;var n=l.toString().match(/function\s+([^\(]+)/m);return n&&n[1]||""}function a(l,n){var e,u,r=o(n&&n.constructor),a=l.excludeConstructors||t.excludeConstructors||[];for(e=0,u=a.length;e0?Math.min(this.limitChildrenCount,l.length):l.length,u=0;u0?Math.min(this.limitChildrenCount,d.length):d.length,o=0;o80?g+"{\n "+y+f.join(",\n "+y)+"\n"+y+"}":g+"{ "+f.join(", ")+" }"},s.element=function(l){var n,e,u,t,r,o=l.tagName.toLowerCase(),a=l.attributes,i=[];for(u=0,t=a.length;u0?" ":""),c=l.innerHTML||"";return c.length>20&&(c=c.substr(0,20)+"[...]"),(s+i.join(" ")+">"+c+"").replace(/ contentEditable="inherit"/,"")},c.prototype={functionName:o,configure:function(l){return new c(l)},constructorName:function(l){return a(this,l)},ascii:function(l,n,e){return s(this,l,n,e)}},n.exports=c.prototype}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"@sinonjs/samsam":40}],25:[function(l,n,e){var u=l("./get-class"),t=l("./identical"),r=l("./is-arguments"),o=l("./is-date"),a=l("./is-element"),i=l("./is-nan"),s=l("./is-object"),c=l("./is-set"),p=l("./is-subset"),f=l("./get-class-name"),d=Array.prototype.every,h=Date.prototype.getTime,m=Object.prototype.hasOwnProperty,g=Array.prototype.indexOf,y=Object.keys;function b(l,n,e){var b=[],v=[],A=[],w=[],E={};return function l(n,x,C,_){if(e&&e.isMatcher(x))return e.isMatcher(n)?n===x:x.test(n);var T=typeof n,S=typeof x;if(n===x||i(n)||i(x)||null==n||null==x||"object"!==T||"object"!==S)return t(n,x);if(a(n)||a(x))return!1;var k=o(n),P=o(x);if((k||P)&&(!k||!P||h.call(n)!==h.call(x)))return!1;if(n instanceof RegExp&&x instanceof RegExp&&n.toString()!==x.toString())return!1;if(n instanceof Error&&x instanceof Error&&(n.constructor!==x.constructor||n.message!==x.message||n.stack!==x.stack))return!1;var F=u(n),j=u(x),O=y(n),D=y(x),$=f(n),B=f(x);if(r(n)||r(x)){if(n.length!==x.length)return!1}else if(T!==S||F!==j||O.length!==D.length||$&&B&&$!==B)return!1;return c(n)||c(x)?!(!c(n)||!c(x)||n.size!==x.size)&&p(n,x,l):d.call(O,function(e){if(!m.call(x,e))return!1;var u=n[e],t=x[e],r=s(u),o=s(t),a=r?g.call(b,u):-1,i=o?g.call(v,t):-1,c=-1!==a?A[a]:C+"["+JSON.stringify(e)+"]",p=-1!==i?w[i]:_+"["+JSON.stringify(e)+"]",f=c+p;return!!E[f]||(-1===a&&r&&(b.push(u),A.push(c)),-1===i&&o&&(v.push(t),w.push(p)),r&&o&&(E[f]=!0),l(u,t,c,p))})}(l,n,"$1","$2")}b.use=function(l){return function(n,e){return b(n,e,l)}},n.exports=b},{"./get-class":27,"./get-class-name":26,"./identical":28,"./is-arguments":29,"./is-date":30,"./is-element":31,"./is-nan":32,"./is-object":34,"./is-set":35,"./is-subset":36}],26:[function(l,n,e){var u=/function (\w+)\s*\(/;n.exports=function(l){if(l.constructor&&"name"in l.constructor)return l.constructor.name;if("function"==typeof l.constructor){var n=l.constructor.toString().match(u);if(n.length>1)return n[1]}return null}},{}],27:[function(l,n,e){var u=Object.prototype;n.exports=function(l){return u.toString.call(l).split(/[ \]]/)[1]}},{}],28:[function(l,n,e){var u=l("./is-nan"),t=l("./is-neg-zero");n.exports=function(l,n){return!!(l===n||u(l)&&u(n))&&(0!==l||t(l)===t(n))}},{"./is-nan":32,"./is-neg-zero":33}],29:[function(l,n,e){var u=l("./get-class");n.exports=function(l){if("Arguments"===u(l))return!0;if("object"!=typeof l||"number"!=typeof l.length||"Array"===u(l))return!1;if("function"==typeof l.callee)return!0;try{l[l.length]=6,delete l[l.length]}catch(l){return!0}return!1}},{"./get-class":27}],30:[function(l,n,e){n.exports=function(l){return l instanceof Date}},{}],31:[function(l,n,e){var u="undefined"!=typeof document&&document.createElement("div");n.exports=function(l){if(!l||1!==l.nodeType||!u)return!1;try{l.appendChild(u),l.removeChild(u)}catch(l){return!1}return!0}},{}],32:[function(l,n,e){n.exports=function(l){return"number"==typeof l&&l!=l}},{}],33:[function(l,n,e){n.exports=function(l){return 0===l&&1/l==-1/0}},{}],34:[function(l,n,e){n.exports=function(l){return!("object"!=typeof l||null===l||l instanceof Boolean||l instanceof Date||l instanceof Error||l instanceof Number||l instanceof RegExp||l instanceof String)}},{}],35:[function(l,n,e){n.exports=function(l){return"undefined"!=typeof Set&&l instanceof Set||!1}},{}],36:[function(l,n,e){n.exports=function(l,n,e){var u=!0;return l.forEach(function(l){var t=!1;n.forEach(function(n){e(n,l)&&(t=!0)}),u=u&&t}),u}},{}],37:[function(l,n,e){var u=l("@sinonjs/commons").prototypes.string.slice,t=l("@sinonjs/commons").typeOf;n.exports=function(l){var n="";function e(l){return"string"==typeof l?"'"+l+"'":String(l)}return"map"===t(l)?(l.forEach(function(l,u){n+="["+e(u)+","+e(l)+"],"}),n=u(n,0,-1)):(l.forEach(function(l){n+=e(l)+","}),n=u(n,0,-1))}},{"@sinonjs/commons":15}],38:[function(l,n,e){var u=l("./deep-equal").use(s),t=l("./get-class"),r=l("./is-date"),o=l("./is-set"),a=l("./is-subset"),i=l("./matcher");function s(l,n){if(n&&"function"==typeof n.test)return n.test(l);if("function"==typeof n)return!0===n(l);if("string"==typeof n)return n=n.toLowerCase(),("string"==typeof l||!!l)&&String(l).toLowerCase().indexOf(n)>=0;if("number"==typeof n)return n===l;if("boolean"==typeof n)return n===l;if(void 0===n)return void 0===l;if(null===n)return null===l;if(null===l)return!1;if(o(l))return a(n,l,s);if("Array"===t(l)&&"Array"===t(n))return function(l,n,e){if(0===n.length)return!0;var u,t,r,o;for(u=0,t=l.length;u=t)return!1;if(!e(l[u+r],n[r]))return!1}return!0}return!1}(l,n,s);if(r(n))return r(l)&&l.getTime()===n.getTime();if(n&&"object"==typeof n){if(n===l)return!0;if("object"!=typeof l)return!1;var e;for(e in n){var i=l[e];if(void 0===i&&"function"==typeof l.getAttribute&&(i=l.getAttribute(e)),null===n[e]||void 0===n[e]){if(i!==n[e])return!1}else if(void 0===i||!u(i,n[e]))return!1}return!0}throw new Error("Matcher was not a string, a number, a function, a boolean or an object")}Object.keys(i).forEach(function(l){s[l]=i[l]}),n.exports=s},{"./deep-equal":25,"./get-class":27,"./is-date":30,"./is-set":35,"./is-subset":36,"./matcher":39}],39:[function(l,n,e){var u=l("@sinonjs/commons").prototypes.array,t=l("./deep-equal").use(_),r=l("@sinonjs/commons").every,o=l("@sinonjs/commons").functionName,a=l("lodash.get"),i=l("./iterable-to-string"),s=l("@sinonjs/commons").prototypes.object,c=l("@sinonjs/commons").prototypes.string,p=l("@sinonjs/commons").typeOf,f=l("@sinonjs/commons").valueToString,d=u.indexOf,h=u.every,m=u.join,g=u.map,y=u.some,b=s.hasOwnProperty,v=s.isPrototypeOf,A=c.indexOf;function w(l,n,e){var u=p(l);if(u!==n)throw new TypeError("Expected type of "+e+" to be "+n+", but was "+u)}var E={toString:function(){return this.message}};function x(l){return v(E,l)}var C={function:function(l,n,e){l.test=n,l.message=e||"match("+o(n)+")"},number:function(l,n){l.test=function(l){return n==l}},object:function(l,n){var e;return"function"==typeof n.test?(l.test=function(l){return!0===n.test(l)},l.message="match("+o(n.test)+")",l):(e=g(Object.keys(n),function(l){return l+": "+f(n[l])}),l.test=function(l){return function l(n,e){return null!=n&&h(Object.keys(e),function(u){var r=e[u],o=n[u];if(x(r)){if(!r.test(o))return!1}else if("object"===p(r)){if(!l(o,r))return!1}else if(!t(o,r))return!1;return!0})}(l,n)},l.message="match("+m(e,", ")+")",l)},regexp:function(l,n){l.test=function(l){return"string"==typeof l&&n.test(l)}},string:function(l,n){l.test=function(l){return"string"==typeof l&&-1!==A(l,n)},l.message='match("'+n+'")'}};function _(l,n){var e=Object.create(E),u=p(l);return u in C?C[u](e,l,n):e.test=function(n){return t(n,l)},e.message||(e.message="match("+f(l)+")"),e}function T(l,n){return function(e,u){w(e,"string","property");var r=1===arguments.length,o=n+'("'+e+'"';return r||(o+=", "+f(u)),_(function(n){return!(null==n||!l(n,e))&&(r||t(n[e],u))},o+=")")}}E.or=function(l){if(!arguments.length)throw new TypeError("Matcher expected");x(l)||(l=_(l));var n=this,e=Object.create(E);return e.test=function(e){return n.test(e)||l.test(e)},e.message=n.message+".or("+l.message+")",e},E.and=function(l){if(!arguments.length)throw new TypeError("Matcher expected");x(l)||(l=_(l));var n=this,e=Object.create(E);return e.test=function(e){return n.test(e)&&l.test(e)},e.message=n.message+".and("+l.message+")",e},_.isMatcher=x,_.any=_(function(){return!0},"any"),_.defined=_(function(l){return null!=l},"defined"),_.truthy=_(function(l){return!!l},"truthy"),_.falsy=_(function(l){return!l},"falsy"),_.same=function(l){return _(function(n){return l===n},"same("+f(l)+")")},_.in=function(l){if(!Array.isArray(l))throw new TypeError("array expected");return _(function(n){return y(l,function(l){return l===n})},"in("+f(l)+")")},_.typeOf=function(l){return w(l,"string","type"),_(function(n){return p(n)===l},'typeOf("'+l+'")')},_.instanceOf=function(l){return"undefined"==typeof Symbol||void 0===Symbol.hasInstance?w(l,"function","type"):function(l,n,e,u){if(null==l[n])throw new TypeError("Expected "+e+" to have method "+u)}(l,Symbol.hasInstance,"type","[Symbol.hasInstance]"),_(function(n){return n instanceof l},"instanceOf("+(o(l)||Object.prototype.toString.call(l))+")")},_.has=T(function(l,n){return"object"==typeof l?n in l:void 0!==l[n]},"has"),_.hasOwn=T(function(l,n){return b(l,n)},"hasOwn"),_.hasNested=function(l,n){w(l,"string","property");var e=1===arguments.length,u='hasNested("'+l+'"';return e||(u+=", "+f(n)),_(function(u){return null!=u&&void 0!==a(u,l)&&(e||t(a(u,l),n))},u+=")")},_.every=function(l){if(!x(l))throw new TypeError("Matcher expected");return _(function(n){return"object"===p(n)?r(Object.keys(n),function(e){return l.test(n[e])}):!!n&&"function"===p(n.forEach)&&r(n,function(n){return l.test(n)})},"every("+l.message+")")},_.some=function(l){if(!x(l))throw new TypeError("Matcher expected");return _(function(n){return"object"===p(n)?!r(Object.keys(n),function(e){return!l.test(n[e])}):!!n&&"function"===p(n.forEach)&&!r(n,function(n){return!l.test(n)})},"some("+l.message+")")},_.array=_.typeOf("array"),_.array.deepEquals=function(l){return _(function(n){var e=n.length===l.length;return"array"===p(n)&&e&&r(n,function(n,e){return l[e]===n})},"deepEquals(["+i(l)+"])")},_.array.startsWith=function(l){return _(function(n){return"array"===p(n)&&r(l,function(l,e){return n[e]===l})},"startsWith(["+i(l)+"])")},_.array.endsWith=function(l){return _(function(n){var e=n.length-l.length;return"array"===p(n)&&r(l,function(l,u){return n[e+u]===l})},"endsWith(["+i(l)+"])")},_.array.contains=function(l){return _(function(n){return"array"===p(n)&&r(l,function(l){return-1!==d(n,l)})},"contains(["+i(l)+"])")},_.map=_.typeOf("map"),_.map.deepEquals=function(l){return _(function(n){var e=n.size===l.size;return"map"===p(n)&&e&&r(n,function(n,e){return l.has(e)&&l.get(e)===n})},"deepEquals(Map["+i(l)+"])")},_.map.contains=function(l){return _(function(n){return"map"===p(n)&&r(l,function(l,e){return n.has(e)&&n.get(e)===l})},"contains(Map["+i(l)+"])")},_.set=_.typeOf("set"),_.set.deepEquals=function(l){return _(function(n){var e=n.size===l.size;return"set"===p(n)&&e&&r(n,function(n){return l.has(n)})},"deepEquals(Set["+i(l)+"])")},_.set.contains=function(l){return _(function(n){return"set"===p(n)&&r(l,function(l){return n.has(l)})},"contains(Set["+i(l)+"])")},_.bool=_.typeOf("boolean"),_.number=_.typeOf("number"),_.string=_.typeOf("string"),_.object=_.typeOf("object"),_.func=_.typeOf("function"),_.regexp=_.typeOf("regexp"),_.date=_.typeOf("date"),_.symbol=_.typeOf("symbol"),n.exports=_},{"./deep-equal":25,"./iterable-to-string":37,"@sinonjs/commons":15,"lodash.get":43}],40:[function(l,n,e){var u=l("./identical"),t=l("./is-arguments"),r=l("./is-element"),o=l("./is-neg-zero"),a=l("./match"),i=l("./deep-equal").use(a),s=l("./matcher");n.exports={createMatcher:s,deepEqual:i,isArguments:t,isElement:r,isNegZero:o,identical:u,match:a}},{"./deep-equal":25,"./identical":28,"./is-arguments":29,"./is-element":31,"./is-neg-zero":33,"./match":38,"./matcher":39}],41:[function(l,n,e){n.exports=Array.isArray||function(l){return"[object Array]"==Object.prototype.toString.call(l)}},{}],42:[function(l,n,e){n.exports=function l(){var n=[].slice.call(arguments);var e=!1;"boolean"==typeof n[0]&&(e=n.shift());var u=n[0];if(!u||"object"!=typeof u&&"function"!=typeof u)throw new Error("extendee must be an object");var t=n.slice(1);var r=t.length;for(var o=0;o-1},$.prototype.set=function(l,n){var e=this.__data__,u=I(e,l);return u<0?e.push([l,n]):e[u][1]=n,this},B.prototype.clear=function(){this.__data__={hash:new D,map:new(P||$),string:new D}},B.prototype.delete=function(l){return R(this,l).delete(l)},B.prototype.get=function(l){return R(this,l).get(l)},B.prototype.has=function(l){return R(this,l).has(l)},B.prototype.set=function(l,n){return R(this,l).set(l,n),this};var q=z(function(l){var n;l=null==(n=l)?"":function(l){if("string"==typeof l)return l;if(V(l))return O?O.call(l):"";var n=l+"";return"0"==n&&1/l==-t?"-0":n}(n);var e=[];return c.test(l)&&e.push(""),l.replace(p,function(l,n,u,t){e.push(u?t.replace(f,"$1"):n||l)}),e});function H(l){if("string"==typeof l||V(l))return l;var n=l+"";return"0"==n&&1/l==-t?"-0":n}function z(l,n){if("function"!=typeof l||n&&"function"!=typeof n)throw new TypeError(e);var u=function(){var e=arguments,t=n?n.apply(this,e):e[0],r=u.cache;if(r.has(t))return r.get(t);var o=l.apply(this,e);return u.cache=r.set(t,o),o};return u.cache=new(z.Cache||B),u}z.Cache=B;var U=Array.isArray;function W(l){var n=typeof l;return!!l&&("object"==n||"function"==n)}function V(l){return"symbol"==typeof l||function(l){return!!l&&"object"==typeof l}(l)&&_.call(l)==a}n.exports=function(l,n,e){var u=null==l?void 0:M(l,n);return void 0===u?e:u}}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],44:[function(require,module,exports){(function(global){var userAgent=global.navigator&&global.navigator.userAgent,isRunningInIE=userAgent&&userAgent.indexOf("MSIE ")>-1,maxTimeout=Math.pow(2,31)-1;isRunningInIE&&(global.setTimeout=global.setTimeout,global.clearTimeout=global.clearTimeout,global.setInterval=global.setInterval,global.clearInterval=global.clearInterval,global.Date=global.Date),void 0!==global.setImmediate&&(global.setImmediate=global.setImmediate,global.clearImmediate=global.clearImmediate);var NOOP=function(){},timeoutResult=setTimeout(NOOP,0),addTimerReturnsObject="object"==typeof timeoutResult,hrtimePresent=global.process&&"function"==typeof global.process.hrtime,nextTickPresent=global.process&&"function"==typeof global.process.nextTick,performancePresent=global.performance&&"function"==typeof global.performance.now,requestAnimationFramePresent=global.requestAnimationFrame&&"function"==typeof global.requestAnimationFrame,cancelAnimationFramePresent=global.cancelAnimationFrame&&"function"==typeof global.cancelAnimationFrame;clearTimeout(timeoutResult);var NativeDate=Date,uniqueTimerId=1;function parseTime(l){if(!l)return 0;var n,e=l.split(":"),u=e.length,t=u,r=0;if(u>3||!/^(\d\d:){0,2}\d\d?$/.test(l))throw new Error("tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits");for(;t--;){if((n=parseInt(e[t],10))>=60)throw new Error("Invalid time "+l);r+=n*Math.pow(60,u-t-1)}return 1e3*r}function fixedFloor(l){return l>=0?Math.floor(l):Math.ceil(l)}function fixedModulo(l,n){return(l%n+n)%n}function getEpoch(l){if(!l)return 0;if("function"==typeof l.getTime)return l.getTime();if("number"==typeof l)return l;throw new TypeError("now should be milliseconds since UNIX epoch")}function inRange(l,n,e){return e&&e.callAt>=l&&e.callAt<=n}function mirrorDateProperties(l,n){var e;for(e in n)n.hasOwnProperty(e)&&(l[e]=n[e]);return n.now?l.now=function(){return l.clock.now}:delete l.now,n.toSource?l.toSource=function(){return n.toSource()}:delete l.toSource,l.toString=function(){return n.toString()},l.prototype=n.prototype,l.parse=n.parse,l.UTC=n.UTC,l.prototype.toUTCString=n.prototype.toUTCString,l}function createDate(){return mirrorDateProperties(function l(n,e,u,t,r,o,a){switch(arguments.length){case 0:return new NativeDate(l.clock.now);case 1:return new NativeDate(n);case 2:return new NativeDate(n,e);case 3:return new NativeDate(n,e,u);case 4:return new NativeDate(n,e,u,t);case 5:return new NativeDate(n,e,u,t,r);case 6:return new NativeDate(n,e,u,t,r,o);default:return new NativeDate(n,e,u,t,r,o,a)}},NativeDate)}function enqueueJob(l,n){l.jobs||(l.jobs=[]),l.jobs.push(n)}function runJobs(l){if(l.jobs){for(var n=0;nmaxTimeout?1:n.delay,n.delay=Math.max(0,n.delay)),n.hasOwnProperty("interval")&&(n.type="Interval",n.interval=n.interval>maxTimeout?1:n.interval),n.hasOwnProperty("animation")&&(n.type="AnimationFrame",n.animation=!0),l.timers||(l.timers={}),n.id=uniqueTimerId++,n.createdAt=l.now,n.callAt=l.now+(parseInt(n.delay)||(l.duringTick?1:0)),l.timers[n.id]=n,addTimerReturnsObject?{id:n.id,ref:NOOP,unref:NOOP}:n.id}function compareTimers(l,n){return l.callAtn.callAt?1:l.immediate&&!n.immediate?-1:!l.immediate&&n.immediate?1:l.createdAtn.createdAt?1:l.idn.id?1:void 0}function firstTimerInRange(l,n,e){var u,t=l.timers,r=null;for(u in t)t.hasOwnProperty(u)&&(!inRange(n,e,t[u])||r&&1!==compareTimers(r,t[u])||(r=t[u]));return r}function firstTimer(l){var n,e=l.timers,u=null;for(n in e)e.hasOwnProperty(n)&&(u&&1!==compareTimers(u,e[n])||(u=e[n]));return u}function lastTimer(l){var n,e=l.timers,u=null;for(n in e)e.hasOwnProperty(n)&&(u&&-1!==compareTimers(u,e[n])||(u=e[n]));return u}function callTimer(clock,timer){"number"==typeof timer.interval?clock.timers[timer.id].callAt+=timer.interval:delete clock.timers[timer.id],"function"==typeof timer.func?timer.func.apply(null,timer.args):eval(timer.func)}function clearTimer(l,n,e){if(n&&(l.timers||(l.timers=[]),"object"==typeof n&&(n=n.id),l.timers.hasOwnProperty(n))){var u=l.timers[n];if(u.type!==e){var t="AnimationFrame"===e?"cancelAnimationFrame":"clear"+e,r="AnimationFrame"===u.type?"requestAnimationFrame":"set"+u.type;throw new Error("Cannot clear timer: timer created with "+r+"() but cleared with "+t+"()")}delete l.timers[n]}}function uninstall(l,n,e){var u,t,r;for(t=0,r=l.methods.length;t1||l instanceof Date||Array.isArray(l)||"number"==typeof l)throw new TypeError("lolex.install called with "+String(l)+" lolex 2.0+ requires an object parameter - see https://github.com/sinonjs/lolex");var n,e;(l=void 0!==l?l:{}).shouldAdvanceTime=l.shouldAdvanceTime||!1,l.advanceTimeDelta=l.advanceTimeDelta||20;var u=l.target||global,t=createClock(l.now,l.loopLimit);for(t.uninstall=function(){return uninstall(t,u,l)},t.methods=l.toFake||[],0===t.methods.length&&(t.methods=keys(timers).filter(function(l){return"nextTick"!==l})),n=0,e=t.methods.length;n>6*e)+t];e>0;){var o=n>>6*(e-1);r.push(128|63&o),e-=1}return r}}function k(l,n){var e=n.fatal;this.handler=function(n,u){if(u===i)return c;if(o(u))return u;var t=l[u-128];return null===t?p(e):t}}function P(l,n){n.fatal;this.handler=function(n,e){if(e===i)return c;if(a(e))return e;var u=w(e,l);return null===u&&f(e),u+128}}function F(l){var n=l.fatal,e=0,t=0,r=0;this.handler=function(l,a){if(a===i&&0===e&&0===t&&0===r)return c;var s;if(a!==i||0===e&&0===t&&0===r||(e=0,t=0,r=0,p(n)),0!==r){s=null,u(a,48,57)&&(s=function(l){if(l>39419&&l<189e3||l>1237575)return null;if(7457===l)return 59335;var n,e=0,u=0,t=E("gb18030-ranges");for(n=0;n>8,u=255&l;return n?[e,u]:[u,e]}function z(l,n){var e=n.fatal,t=null,r=null;this.handler=function(n,o){if(o===i&&(null!==t||null!==r))return p(e);if(o===i&&null===t&&null===r)return c;if(null===t)return t=o,null;var a;if(a=l?(t<<8)+o:(o<<8)+t,t=null,null!==r){var s=r;return r=null,u(a,56320,57343)?65536+1024*(s-55296)+(a-56320):(n.prepend(H(a,l)),p(e))}return u(a,55296,56319)?(r=a,null):u(a,56320,57343)?p(e):a}}function U(l,n){n.fatal;this.handler=function(n,e){if(e===i)return c;if(u(e,0,65535))return H(e,l);var t=H(55296+(e-65536>>10),l),r=H(56320+(e-65536&1023),l);return t.concat(r)}}function W(l){l.fatal;this.handler=function(l,n){return n===i?c:o(n)?n:63360+n-128}}function V(l){l.fatal;this.handler=function(l,n){return n===i?c:a(n)?n:u(n,63360,63487)?n-63360+128:f(n)}}Object.defineProperty&&(Object.defineProperty(C.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(C.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(C.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),C.prototype.decode=function(l,n){var e;e="object"==typeof l&&l instanceof ArrayBuffer?new Uint8Array(l):"object"==typeof l&&"buffer"in l&&l.buffer instanceof ArrayBuffer?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(0),n=r(n),this._do_not_flush||(this._decoder=v[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(n.stream);for(var u,t=new s(e),o=[];;){var a=t.read();if(a===i)break;if((u=this._decoder.handler(t,a))===c)break;null!==u&&(Array.isArray(u)?o.push.apply(o,u):o.push(u))}if(!this._do_not_flush){do{if((u=this._decoder.handler(t,t.read()))===c)break;null!==u&&(Array.isArray(u)?o.push.apply(o,u):o.push(u))}while(!t.endOfStream());this._decoder=null}return function(l){var n,e;return n=["UTF-8","UTF-16LE","UTF-16BE"],e=this._encoding.name,-1===n.indexOf(e)||this._ignoreBOM||this._BOMseen||(l.length>0&&65279===l[0]?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),function(l){for(var n="",e=0;e>10),56320+(1023&u)))}return n}(l)}.call(this,o)},Object.defineProperty&&Object.defineProperty(_.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),_.prototype.encode=function(l,n){l=void 0===l?"":String(l),n=r(n),this._do_not_flush||(this._encoder=b[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(n.stream);for(var e,u=new s(function(l){for(var n=String(l),e=n.length,u=0,t=[];u57343)t.push(r);else if(56320<=r&&r<=57343)t.push(65533);else if(55296<=r&&r<=56319)if(u===e-1)t.push(65533);else{var o=n.charCodeAt(u+1);if(56320<=o&&o<=57343){var a=1023&r,i=1023&o;t.push(65536+(a<<10)+i),u+=1}else t.push(65533)}u+=1}return t}(l)),t=[];;){var o=u.read();if(o===i)break;if((e=this._encoder.handler(u,o))===c)break;Array.isArray(e)?t.push.apply(t,e):t.push(e)}if(!this._do_not_flush){for(;(e=this._encoder.handler(u,u.read()))!==c;)Array.isArray(e)?t.push.apply(t,e):t.push(e);this._encoder=null}return new Uint8Array(t)},b["UTF-8"]=function(l){return new S(l)},v["UTF-8"]=function(l){return new T(l)},"encoding-indexes"in e&&h.forEach(function(l){"Legacy single-byte encodings"===l.heading&&l.encodings.forEach(function(l){var n=l.name,e=E(n.toLowerCase());v[n]=function(l){return new k(e,l)},b[n]=function(l){return new P(e,l)}})}),v.GBK=function(l){return new F(l)},b.GBK=function(l){return new j(l,!0)},b.gb18030=function(l){return new j(l)},v.gb18030=function(l){return new F(l)},b.Big5=function(l){return new D(l)},v.Big5=function(l){return new O(l)},b["EUC-JP"]=function(l){return new B(l)},v["EUC-JP"]=function(l){return new $(l)},b["ISO-2022-JP"]=function(l){return new M(l)},v["ISO-2022-JP"]=function(l){return new I(l)},b.Shift_JIS=function(l){return new R(l)},v.Shift_JIS=function(l){return new N(l)},b["EUC-KR"]=function(l){return new q(l)},v["EUC-KR"]=function(l){return new L(l)},b["UTF-16BE"]=function(l){return new U(!0,l)},v["UTF-16BE"]=function(l){return new z(!0,l)},b["UTF-16LE"]=function(l){return new U(!1,l)},v["UTF-16LE"]=function(l){return new z(!1,l)},b["x-user-defined"]=function(l){return new V(l)},v["x-user-defined"]=function(l){return new W(l)},e.TextEncoder||(e.TextEncoder=_),e.TextDecoder||(e.TextDecoder=C),void 0!==n&&n.exports&&(n.exports={TextEncoder:e.TextEncoder,TextDecoder:e.TextDecoder,EncodingIndexes:e["encoding-indexes"]})}(this||{})},{"./encoding-indexes.js":47}],49:[function(l,n,e){(function(l){!function(l,u){"object"==typeof e&&void 0!==n?n.exports=u():"function"==typeof define&&define.amd?define(u):l.typeDetect=u()}(this,function(){var n="function"==typeof Promise,e="object"==typeof self?self:l,u="undefined"!=typeof Symbol,t="undefined"!=typeof Map,r="undefined"!=typeof Set,o="undefined"!=typeof WeakMap,a="undefined"!=typeof WeakSet,i="undefined"!=typeof DataView,s=u&&void 0!==Symbol.iterator,c=u&&void 0!==Symbol.toStringTag,p=r&&"function"==typeof Set.prototype.entries,f=t&&"function"==typeof Map.prototype.entries,d=p&&Object.getPrototypeOf((new Set).entries()),h=f&&Object.getPrototypeOf((new Map).entries()),m=s&&"function"==typeof Array.prototype[Symbol.iterator],g=m&&Object.getPrototypeOf([][Symbol.iterator]()),y=s&&"function"==typeof String.prototype[Symbol.iterator],b=y&&Object.getPrototypeOf(""[Symbol.iterator]()),v=8,A=-1;return function(l){var u=typeof l;if("object"!==u)return u;if(null===l)return"null";if(l===e)return"global";if(Array.isArray(l)&&(!1===c||!(Symbol.toStringTag in l)))return"Array";if("object"==typeof window&&null!==window){if("object"==typeof window.location&&l===window.location)return"Location";if("object"==typeof window.document&&l===window.document)return"Document";if("object"==typeof window.navigator){if("object"==typeof window.navigator.mimeTypes&&l===window.navigator.mimeTypes)return"MimeTypeArray";if("object"==typeof window.navigator.plugins&&l===window.navigator.plugins)return"PluginArray"}if(("function"==typeof window.HTMLElement||"object"==typeof window.HTMLElement)&&l instanceof window.HTMLElement){if("BLOCKQUOTE"===l.tagName)return"HTMLQuoteElement";if("TD"===l.tagName)return"HTMLTableDataCellElement";if("TH"===l.tagName)return"HTMLTableHeaderCellElement"}}var s=c&&l[Symbol.toStringTag];if("string"==typeof s)return s;var p=Object.getPrototypeOf(l);return p===RegExp.prototype?"RegExp":p===Date.prototype?"Date":n&&p===Promise.prototype?"Promise":r&&p===Set.prototype?"Set":t&&p===Map.prototype?"Map":a&&p===WeakSet.prototype?"WeakSet":o&&p===WeakMap.prototype?"WeakMap":i&&p===DataView.prototype?"DataView":t&&p===h?"Map Iterator":r&&p===d?"Set Iterator":m&&p===g?"Array Iterator":y&&p===b?"String Iterator":null===p?"Object":Object.prototype.toString.call(l).slice(v,A)}})}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[12])(12)},module.exports=f()}),arrayProto$e=lib.prototypes.array,match$5=samsam.createMatcher,valueToString$9=lib.valueToString,fakeServer=nise.fakeServer,fakeXhr=nise.fakeXhr,filter$3=arrayProto$e.filter,forEach$8=arrayProto$e.filter,push$6=arrayProto$e.push,reverse$1=arrayProto$e.reverse;function applyOnEach(l,n){var e=filter$3(l,function(l){return"function"==typeof l[n]});forEach$8(e,function(l){l[n]()})}function Sandbox(){var l,n=this,e=[],u=[];function t(l,n){var e=getPropertyDescriptor(l,n);function u(){Object.defineProperty(l,n,e)}return u.object=l,u.property=n,u}function r(l,n){forEach$8(u,function(e){if(e.object===l&&e.property===n)throw new TypeError("Attempted to replace "+n+" which is already replaced")})}n.serverPrototype=fakeServer,n.getFakes=function(){return e},n.getRestorers=function(){return u},n.createStubInstance=function(l){if("function"!=typeof l)throw new TypeError("The constructor should be a function.");return this.stub(Object.create(l.prototype))},n.inject=function(l){return l.spy=function(){return n.spy.apply(null,arguments)},l.stub=function(){return n.stub.apply(null,arguments)},l.mock=function(){return n.mock.apply(null,arguments)},n.clock&&(l.clock=n.clock),n.server&&(l.server=n.server,l.requests=n.server.requests),l.match=match$5,l},n.mock=function(){var n=mock_1.apply(null,arguments);return push$6(e,n),usePromiseLibrary_1(l,n),n},n.reset=function(){applyOnEach(e,"reset"),applyOnEach(e,"resetHistory")},n.resetBehavior=function(){applyOnEach(e,"resetBehavior")},n.resetHistory=function(){function l(l){var n=l.resetHistory||l.reset;n&&n.call(l)}forEach$8(e,function(n){if("function"!=typeof n){var e=[];n.get&&push$6(e,n.get),n.set&&push$6(e,n.set),forEach$8(e,l)}else l(n)})},n.restore=function(){if(arguments.length)throw new Error("sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()");reverse$1(e),applyOnEach(e,"restore"),e=[],forEach$8(u,function(l){l()}),u=[],n.restoreContext()},n.restoreContext=function(){var l=n.injectedKeys,e=n.injectInto;l&&(forEach$8(l,function(l){delete e[l]}),l=[])},n.replace=function(l,n,e){var o=getPropertyDescriptor(l,n);if(void 0===o)throw new TypeError("Cannot replace non-existent own property "+valueToString$9(n));if(void 0===e)throw new TypeError("Expected replacement argument to be defined");if("function"==typeof o.get)throw new Error("Use sandbox.replaceGetter for replacing getters");if("function"==typeof o.set)throw new Error("Use sandbox.replaceSetter for replacing setters");if(typeof l[n]!=typeof e)throw new TypeError("Cannot replace "+typeof l[n]+" with "+typeof e);return r(l,n),push$6(u,t(l,n)),l[n]=e,e},n.replaceGetter=function(l,n,e){var o=getPropertyDescriptor(l,n);if(void 0===o)throw new TypeError("Cannot replace non-existent own property "+valueToString$9(n));if("function"!=typeof e)throw new TypeError("Expected replacement argument to be a function");if("function"!=typeof o.get)throw new Error("`object.property` is not a getter");return r(l,n),push$6(u,t(l,n)),Object.defineProperty(l,n,{get:e,configurable:isPropertyConfigurable_1(l,n)}),e},n.replaceSetter=function(l,n,e){var o=getPropertyDescriptor(l,n);if(void 0===o)throw new TypeError("Cannot replace non-existent own property "+valueToString$9(n));if("function"!=typeof e)throw new TypeError("Expected replacement argument to be a function");if("function"!=typeof o.set)throw new Error("`object.property` is not a setter");return r(l,n),push$6(u,t(l,n)),Object.defineProperty(l,n,{set:e,configurable:isPropertyConfigurable_1(l,n)}),e},n.spy=function(){var l=spy_1.apply(spy_1,arguments);return push$6(e,l),l},n.stub=function(n,u){if(isEsModule(n))throw new TypeError("ES Modules cannot be stubbed");if(isNonExistentOwnProperty_1(n,u))throw new TypeError("Cannot stub non-existent own property "+valueToString$9(u));var t=stub_1.apply(null,arguments);if(void 0===u&&"object"==typeof n){var r=collectOwnMethods_1(t);forEach$8(r,function(l){push$6(e,l)}),usePromiseLibrary_1(l,r)}else push$6(e,t),usePromiseLibrary_1(l,t);return t},n.fake=function(l){var n=fake_1.apply(fake_1,arguments);return push$6(e,n),n},forEach$8(Object.keys(fake_1),function(l){var u=fake_1[l];"function"==typeof u&&(n.fake[l]=function(){var l=u.apply(u,arguments);return push$6(e,l),l})}),n.useFakeTimers=function(l){var u=fakeTimers.useFakeTimers.call(null,l);return n.clock=u,push$6(e,u),u},n.verify=function(){applyOnEach(e,"verify")},n.verifyAndRestore=function(){var l;try{n.verify()}catch(n){l=n}if(n.restore(),l)throw l},n.useFakeServer=function(){var l=n.serverPrototype||fakeServer;return l&&l.create?(n.server=l.create(),push$6(e,n.server),n.server):null},n.useFakeXMLHttpRequest=function(){var l=fakeXhr.useFakeXMLHttpRequest();return push$6(e,l),l},n.usingPromise=function(u){return l=u,e.promiseLibrary=u,n}}Sandbox.prototype.assert=assert_1,Sandbox.prototype.match=match$5;var sandbox=Sandbox,arrayProto$f=lib.prototypes.array,forEach$9=arrayProto$f.forEach,push$7=arrayProto$f.push;function prepareSandboxFromConfig(l){var n=new sandbox;return l.useFakeServer&&("object"==typeof l.useFakeServer&&(n.serverPrototype=l.useFakeServer),n.useFakeServer()),l.useFakeTimers&&("object"==typeof l.useFakeTimers?n.useFakeTimers(l.useFakeTimers):n.useFakeTimers()),n}function exposeValue(l,n,e,u){u&&(!n.injectInto||e in n.injectInto?push$7(l.args,u):(n.injectInto[e]=u,push$7(l.injectedKeys,e)))}function createSandbox(l){if(!l)return new sandbox;var n=prepareSandboxFromConfig(l);n.args=n.args||[],n.injectedKeys=[],n.injectInto=l.injectInto;var e=n.inject({});return l.properties?forEach$9(l.properties,function(u){var t=e[u]||"sandbox"===u&&n;exposeValue(n,l,u,t)}):exposeValue(n,l,"sandbox"),n}var createSandbox_1=createSandbox,deprecated=createCommonjsModule(function(l,n){n.wrap=function(l,e){var u=function(){return n.printWarning(e),l.apply(this,arguments)};return l.prototype&&(u.prototype=l.prototype),u},n.defaultMsg=function(l){return"sinon."+l+" is deprecated and will be removed from the public API in a future version of sinon."},n.printWarning=function(l){"undefined"!=typeof console&&(console.info?console.info(l):console.log(l))}}),deprecated_1=deprecated.wrap,deprecated_2=deprecated.defaultMsg,deprecated_3=deprecated.printWarning,defaultConfig={injectIntoThis:!0,injectInto:null,properties:["spy","stub","mock","clock","server","requests"],useFakeTimers:!0,useFakeServer:!0},apiMethods={createSandbox:createSandbox_1,assert:assert_1,match:samsam.createMatcher,spyCall:call$1,expectation:mockExpectation_1,createStubInstance:stub_1.createStubInstance,defaultConfig:defaultConfig,setFormatter:format_1.setFormatter,timers:fakeTimers.timers,xhr:nise.fakeXhr.xhr,FakeXMLHttpRequest:nise.fakeXhr.FakeXMLHttpRequest,fakeServer:nise.fakeServer,fakeServerWithClock:nise.fakeServerWithClock,createFakeServer:nise.fakeServer.create.bind(nise.fakeServer),createFakeServerWithClock:nise.fakeServerWithClock.create.bind(nise.fakeServerWithClock),addBehavior:function(l,n){behavior.addBehavior(stub_1,l,n)}},legacySandboxAPI={sandbox:{create:deprecated.wrap(createSandbox_1,"`sandbox.create()` is deprecated. Use default sandbox at `sinon.sandbox` or create new sandboxes with `sinon.createSandbox()`")}},sandbox$1=new sandbox,api=extend(sandbox$1,legacySandboxAPI,apiMethods),sinon=api;__webpack_exports__.default=sinon;const _serverPrototype=sinon.serverPrototype,_getFakes=sinon.getFakes,_getRestorers=sinon.getRestorers,_createStubInstance=sinon.createStubInstance,_inject=sinon.inject,_mock=sinon.mock,_reset=sinon.reset,_resetBehavior=sinon.resetBehavior,_resetHistory=sinon.resetHistory,_restore=sinon.restore,_restoreContext=sinon.restoreContext,_replace=sinon.replace,_replaceGetter=sinon.replaceGetter,_replaceSetter=sinon.replaceSetter,_spy=sinon.spy,_stub=sinon.stub,_fake=sinon.fake,_useFakeTimers=sinon.useFakeTimers,_verify=sinon.verify,_verifyAndRestore=sinon.verifyAndRestore,_useFakeServer=sinon.useFakeServer,_useFakeXMLHttpRequest=sinon.useFakeXMLHttpRequest,_usingPromise=sinon.usingPromise,_sandbox=sinon.sandbox,_createSandbox=sinon.createSandbox,_assert=sinon.assert,_match=sinon.match,_spyCall=sinon.spyCall,_expectation=sinon.expectation,_defaultConfig=sinon.defaultConfig,_setFormatter=sinon.setFormatter,_timers=sinon.timers,_xhr=sinon.xhr,_FakeXMLHttpRequest=sinon.FakeXMLHttpRequest,_fakeServer=sinon.fakeServer,_fakeServerWithClock=sinon.fakeServerWithClock,_createFakeServer=sinon.createFakeServer,_createFakeServerWithClock=sinon.createFakeServerWithClock,_addBehavior=sinon.addBehavior}.call(this,__webpack_require__(15),__webpack_require__(47).setImmediate,__webpack_require__(47).clearImmediate)},function(l,n){ +/*! + * assertion-error + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */ +/*! + * Return a function that will copy properties from + * one object to another excluding any originally + * listed. Returned function will create a new `{}`. + * + * @param {String} excluded properties ... + * @return {Function} + */ +function e(){var l=[].slice.call(arguments);function n(n,e){Object.keys(e).forEach(function(u){~l.indexOf(u)||(n[u]=e[u])})}return function(){for(var l=[].slice.call(arguments),e=0,u={};e + * MIT Licensed + */ +l.exports=function(l,n){return n.length>4?n[4]:l._obj}},function(l,n,e){ +/*! + * Chai - flag utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +/*! + * Module dependencies + */ +var u=e(39),t=e(8);l.exports=function(l){var n=u(l),e=Object.prototype.toString.call(l);if(t.truncateThreshold&&n.length>=t.truncateThreshold){if("[object Function]"===e)return l.name&&""!==l.name?"[Function: "+l.name+"]":"[Function]";if("[object Array]"===e)return"[ Array("+l.length+") ]";if("[object Object]"===e){var r=Object.keys(l);return"{ Object ("+(r.length>2?r.splice(0,2).join(", ")+", ...":r.join(", "))+") }"}return n}return n}},function(l,n,e){"use strict";var u=Function.prototype.toString,t=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;l.exports=function(l){if("function"!=typeof l)return null;var n="";if(void 0===Function.prototype.name&&void 0===l.name){var e=u.call(l).match(t);e&&(n=e[1])}else n=l.name;return n}},function(l,n){ +/*! + * Chai - getProperties utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +l.exports=function(l){var n=Object.getOwnPropertyNames(l);function e(l){-1===n.indexOf(l)&&n.push(l)}for(var u=Object.getPrototypeOf(l);null!==u;)Object.getOwnPropertyNames(u).forEach(e),u=Object.getPrototypeOf(u);return n}},function(l,n){ +/*! + * Chai - getOwnEnumerablePropertySymbols utility + * Copyright(c) 2011-2016 Jake Luer + * MIT Licensed + */ +l.exports=function(l){return"function"!=typeof Object.getOwnPropertySymbols?[]:Object.getOwnPropertySymbols(l).filter(function(n){return Object.getOwnPropertyDescriptor(l,n).enumerable})}},function(l,n,e){(function(l){var u=void 0!==l&&l||"undefined"!=typeof self&&self||window,t=Function.prototype.apply;function r(l,n){this._id=l,this._clearFn=n}n.setTimeout=function(){return new r(t.call(setTimeout,u,arguments),clearTimeout)},n.setInterval=function(){return new r(t.call(setInterval,u,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(l){l&&l.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(u,this._id)},n.enroll=function(l,n){clearTimeout(l._idleTimeoutId),l._idleTimeout=n},n.unenroll=function(l){clearTimeout(l._idleTimeoutId),l._idleTimeout=-1},n._unrefActive=n.active=function(l){clearTimeout(l._idleTimeoutId);var n=l._idleTimeout;n>=0&&(l._idleTimeoutId=setTimeout(function(){l._onTimeout&&l._onTimeout()},n))},e(75),n.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==l&&l.setImmediate||this&&this.setImmediate,n.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==l&&l.clearImmediate||this&&this.clearImmediate}).call(this,e(15))},,,,function(l,n,e){e(52),e(77),e(78),e(79),e(80),e(81),e(84),e(85),e(86),e(87),e(88),e(89),e(90),e(91),e(92),l.exports=e(93)},function(l,n,e){"use strict";function u(l){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(l){return typeof l}:function(l){return l&&"function"==typeof Symbol&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l})(l)}var t=e(2),r=e(0),o=e(40),a=t.expect;describe("generated parser API",function(){describe("parse",function(){it("parses input",function(){var l=r.generate("start = 'a'");a(l.parse("a")).to.equal("a")}),it("throws an exception on syntax error",function(){var l=r.generate("start = 'a'");a(function(){l.parse("b")}).to.throw()}),describe("start rule",function(){var l=r.generate("\n\n a = 'x' { return 'a'; }\n b = 'x' { return 'b'; }\n c = 'x' { return 'c'; }\n\n ",{allowedStartRules:["b","c"]});describe("when |startRule| is not set",function(){it("starts parsing from the first allowed rule",function(){a(l.parse("x")).to.equal("b")})}),describe("when |startRule| is set to an allowed rule",function(){it("starts parsing from specified rule",function(){a(l.parse("x",{startRule:"b"})).to.equal("b"),a(l.parse("x",{startRule:"c"})).to.equal("c")})}),describe("when |startRule| is set to a disallowed start rule",function(){it("throws an exception",function(){a(function(){l.parse("x",{startRule:"a"})}).to.throw()})})}),describe("tracing",function(){var l=r.generate("\n\n start = a / b\n a = 'a'\n b = 'b'\n\n ",{trace:!0});describe("default tracer",function(){it("traces using console.log (if console is defined)",function(){var n=["1:1-1:1 rule.enter start","1:1-1:1 rule.enter a","1:1-1:1 rule.fail a","1:1-1:1 rule.enter b","1:1-1:2 rule.match b","1:1-1:2 rule.match start"];"object"===("undefined"==typeof console?"undefined":u(console))&&o.stub(console,"log");try{l.parse("b"),"object"===("undefined"==typeof console?"undefined":u(console))&&(a(console.log.callCount).to.equal(n.length),n.forEach(function(l,n){var e=console.log.getCall(n);a(e.calledWithExactly(l)).to.equal(!0)}))}finally{"object"===("undefined"==typeof console?"undefined":u(console))&&console.log.restore()}})}),describe("custom tracers",function(){describe("trace",function(){it("receives tracing events",function(){var n=[{type:"rule.enter",rule:"start",location:{start:{offset:0,line:1,column:1},end:{offset:0,line:1,column:1}}},{type:"rule.enter",rule:"a",location:{start:{offset:0,line:1,column:1},end:{offset:0,line:1,column:1}}},{type:"rule.fail",rule:"a",location:{start:{offset:0,line:1,column:1},end:{offset:0,line:1,column:1}}},{type:"rule.enter",rule:"b",location:{start:{offset:0,line:1,column:1},end:{offset:0,line:1,column:1}}},{type:"rule.match",rule:"b",result:"b",location:{start:{offset:0,line:1,column:1},end:{offset:1,line:1,column:2}}},{type:"rule.match",rule:"start",result:"b",location:{start:{offset:0,line:1,column:1},end:{offset:1,line:1,column:2}}}],e={trace:o.spy()};l.parse("b",{tracer:e}),a(e.trace.callCount).to.equal(n.length),n.forEach(function(l,n){var u=e.trace.getCall(n);a(u.calledWithExactly(l)).to.equal(!0)})})})})}),it("accepts custom options",function(){r.generate("start = 'a'").parse("a",{foo:42})})})})},function(l,n,e){ +/*! + * chai + * Copyright(c) 2011 Jake Luer + * MIT Licensed + */ +/*! + * Dependencies that are used for multiple exports are required here only once + */ +var u=e(54); +/*! + * test utility + */n.test=e(55), +/*! + * type utility + */ +n.type=e(38), +/*! + * expectTypes utility + */ +n.expectTypes=e(56), +/*! + * message utility + */ +n.getMessage=e(57), +/*! + * actual utility + */ +n.getActual=e(42), +/*! + * Inspect util + */ +n.inspect=e(39), +/*! + * Object Display util + */ +n.objDisplay=e(43), +/*! + * Flag utility + */ +n.flag=e(3), +/*! + * Flag transferring utility + */ +n.transferFlags=e(7), +/*! + * Deep equal utility + */ +n.eql=e(59), +/*! + * Deep path info + */ +n.getPathInfo=u.getPathInfo, +/*! + * Check if a property exists + */ +n.hasProperty=u.hasProperty, +/*! + * Function name + */ +n.getName=e(44), +/*! + * add Property + */ +n.addProperty=e(60), +/*! + * add Method + */ +n.addMethod=e(61), +/*! + * overwrite Property + */ +n.overwriteProperty=e(62), +/*! + * overwrite Method + */ +n.overwriteMethod=e(63), +/*! + * Add a chainable method + */ +n.addChainableMethod=e(64), +/*! + * Overwrite chainable method + */ +n.overwriteChainableMethod=e(65), +/*! + * Compare by inspect method + */ +n.compareByInspect=e(66), +/*! + * Get own enumerable property symbols method + */ +n.getOwnEnumerablePropertySymbols=e(46), +/*! + * Get own enumerable properties method + */ +n.getOwnEnumerableProperties=e(67), +/*! + * Checks error against a given set of criteria + */ +n.checkError=e(68), +/*! + * Proxify util + */ +n.proxify=e(18), +/*! + * addLengthGuard util + */ +n.addLengthGuard=e(17), +/*! + * isProxyEnabled helper + */ +n.isProxyEnabled=e(16), +/*! + * isNaN method + */ +n.isNaN=e(69)},function(l,n,e){"use strict";function u(l,n){return null!=l&&n in Object(l)}function t(l){return l.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(function(l){var n=/^\[(\d+)\]$/.exec(l);return n?{i:parseFloat(n[1])}:{p:l.replace(/\\([.\[\]])/g,"$1")}})}function r(l,n,e){var u=l,t=null;e=void 0===e?n.length:e;for(var r=0;r1?r(l,e,e.length-1):l,name:o.p||o.i,value:r(l,e)};return a.exists=u(a.parent,a.name),a}l.exports={hasProperty:u,getPathInfo:o,getPathValue:function(l,n){return o(l,n).value},setPathValue:function(l,n,e){return function(l,n,e){for(var u=l,t=e.length,r=null,o=0;o + * MIT Licensed + */ +/*! + * Module dependencies + */ +var u=e(3);l.exports=function(l,n){var e=u(l,"negate"),t=n[0];return e?!t:t}},function(l,n,e){ +/*! + * Chai - expectTypes utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +var u=e(41),t=e(3),r=e(38);l.exports=function(l,n){var e=t(l,"message"),o=t(l,"ssfi");e=e?e+": ":"",l=t(l,"object"),(n=n.map(function(l){return l.toLowerCase()})).sort();var a=n.map(function(l,e){var u=~["a","e","i","o","u"].indexOf(l.charAt(0))?"an":"a";return(n.length>1&&e===n.length-1?"or ":"")+u+" "+l}).join(", "),i=r(l).toLowerCase();if(!n.some(function(l){return i===l}))throw new u(e+"object tested must be "+a+", but "+i+" given",void 0,o)}},function(l,n,e){ +/*! + * Chai - message composition utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +/*! + * Module dependencies + */ +var u=e(3),t=e(42),r=e(43);l.exports=function(l,n){var e=u(l,"negate"),o=u(l,"object"),a=n[3],i=t(l,n),s=e?n[2]:n[1],c=u(l,"message");return"function"==typeof s&&(s=s()),s=(s=s||"").replace(/#\{this\}/g,function(){return r(o)}).replace(/#\{act\}/g,function(){return r(i)}).replace(/#\{exp\}/g,function(){return r(a)}),c?c+": "+s:s}},function(l,n){ +/*! + * Chai - getEnumerableProperties utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +l.exports=function(l){var n=[];for(var e in l)n.push(e);return n}},function(l,n,e){"use strict"; +/*! + * deep-eql + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */var u=e(38);function t(){this._key="chai/deep-eql__"+Math.random()+Date.now()}t.prototype={get:function(l){return l[this._key]},set:function(l,n){Object.isExtensible(l)&&Object.defineProperty(l,this._key,{value:n,configurable:!0})}};var r="function"==typeof WeakMap?WeakMap:t; +/*! + * Check to see if the MemoizeMap has recorded a result of the two operands + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {MemoizeMap} memoizeMap + * @returns {Boolean|null} result +*/function o(l,n,e){if(!e||g(l)||g(n))return null;var u=e.get(l);if(u){var t=u.get(n);if("boolean"==typeof t)return t}return null} +/*! + * Set the result of the equality into the MemoizeMap + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {MemoizeMap} memoizeMap + * @param {Boolean} result +*/function a(l,n,e,u){if(e&&!g(l)&&!g(n)){var t=e.get(l);t?t.set(n,u):((t=new r).set(n,u),e.set(l,t))}} +/*! + * Primary Export + */function i(l,n,e){if(e&&e.comparator)return c(l,n,e);var u=s(l,n);return null!==u?u:c(l,n,e)}function s(l,n){return l===n?0!==l||1/l==1/n:l!=l&&n!=n||!g(l)&&!g(n)&&null} +/*! + * The main logic of the `deepEqual` function. + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Object} [options] (optional) Additional options + * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. + * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of + complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular + references to blow the stack. + * @return {Boolean} equal match +*/function c(l,n,e){(e=e||{}).memoize=!1!==e.memoize&&(e.memoize||new r);var t=e&&e.comparator,c=o(l,n,e.memoize);if(null!==c)return c;var g=o(n,l,e.memoize);if(null!==g)return g;if(t){var y=t(l,n);if(!1===y||!0===y)return a(l,n,e.memoize,y),y;var b=s(l,n);if(null!==b)return b}var v=u(l);if(v!==u(n))return a(l,n,e.memoize,!1),!1;a(l,n,e.memoize,!0);var A=function(l,n,e,u){switch(e){case"String":case"Number":case"Boolean":case"Date":return i(l.valueOf(),n.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":case"Error":return l===n;case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return f(l,n,u);case"RegExp": +/*! + * Compare two Regular Expressions for equality. + * + * @param {RegExp} leftHandOperand + * @param {RegExp} rightHandOperand + * @return {Boolean} result + */ +return function(l,n){return l.toString()===n.toString()} +/*! + * Compare two Sets/Maps for equality. Faster than other equality functions. + * + * @param {Set} leftHandOperand + * @param {Set} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */(l,n);case"Generator": +/*! + * Simple equality for generator objects such as those returned by generator functions. + * + * @param {Iterable} leftHandOperand + * @param {Iterable} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */ +return function(l,n,e){return f(h(l),h(n),e)} +/*! + * Determine if the given object has an @@iterator function. + * + * @param {Object} target + * @return {Boolean} `true` if the object has an @@iterator function. + */(l,n,u);case"DataView":return f(new Uint8Array(l.buffer),new Uint8Array(n.buffer),u);case"ArrayBuffer":return f(new Uint8Array(l),new Uint8Array(n),u);case"Set":case"Map":return p(l,n,u);default: +/*! + * Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual` + * for each enumerable key in the object. + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */ +return function(l,n,e){var u=m(l),t=m(n);if(u.length&&u.length===t.length)return u.sort(),t.sort(),!1!==f(u,t)&& +/*! + * Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of + * each key. If any value of the given key is not equal, the function will return false (early). + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against + * @param {Object} [options] (Optional) + * @return {Boolean} result + */ +function(l,n,e,u){var t=e.length;if(0===t)return!0;for(var r=0;r + * MIT Licensed + */ +var u=e(6),t=e(3),r=e(16),o=e(7);l.exports=function(l,n,e){e=void 0===e?function(){}:e,Object.defineProperty(l,n,{get:function l(){r()||t(this,"lockSsfi")||t(this,"ssfi",l);var n=e.call(this);if(void 0!==n)return n;var a=new u.Assertion;return o(this,a),a},configurable:!0})}},function(l,n,e){ +/*! + * Chai - addMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +var u=e(17),t=e(6),r=e(3),o=e(18),a=e(7);l.exports=function(l,n,e){var i=function(){r(this,"lockSsfi")||r(this,"ssfi",i);var l=e.apply(this,arguments);if(void 0!==l)return l;var n=new t.Assertion;return a(this,n),n};u(i,n,!1),l[n]=o(i,n)}},function(l,n,e){ +/*! + * Chai - overwriteProperty utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +var u=e(6),t=e(3),r=e(16),o=e(7);l.exports=function(l,n,e){var a=Object.getOwnPropertyDescriptor(l,n),i=function(){};a&&"function"==typeof a.get&&(i=a.get),Object.defineProperty(l,n,{get:function l(){r()||t(this,"lockSsfi")||t(this,"ssfi",l);var n=t(this,"lockSsfi");t(this,"lockSsfi",!0);var a=e(i).call(this);if(t(this,"lockSsfi",n),void 0!==a)return a;var s=new u.Assertion;return o(this,s),s},configurable:!0})}},function(l,n,e){ +/*! + * Chai - overwriteMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +var u=e(17),t=e(6),r=e(3),o=e(18),a=e(7);l.exports=function(l,n,e){var i=l[n],s=function(){throw new Error(n+" is not a function")};i&&"function"==typeof i&&(s=i);var c=function(){r(this,"lockSsfi")||r(this,"ssfi",c);var l=r(this,"lockSsfi");r(this,"lockSsfi",!0);var n=e(s).apply(this,arguments);if(r(this,"lockSsfi",l),void 0!==n)return n;var u=new t.Assertion;return a(this,u),u};u(c,n,!1),l[n]=o(c,n)}},function(l,n,e){ +/*! + * Chai - addChainingMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +/*! + * Module dependencies + */ +var u=e(17),t=e(6),r=e(3),o=e(18),a=e(7),i="function"==typeof Object.setPrototypeOf,s=function(){},c=Object.getOwnPropertyNames(s).filter(function(l){var n=Object.getOwnPropertyDescriptor(s,l);return"object"!=typeof n||!n.configurable}),p=Function.prototype.call,f=Function.prototype.apply;l.exports=function(l,n,e,s){"function"!=typeof s&&(s=function(){});var d={method:e,chainingBehavior:s};l.__methods||(l.__methods={}),l.__methods[n]=d,Object.defineProperty(l,n,{get:function(){d.chainingBehavior.call(this);var e=function(){r(this,"lockSsfi")||r(this,"ssfi",e);var l=d.method.apply(this,arguments);if(void 0!==l)return l;var n=new t.Assertion;return a(this,n),n};if(u(e,n,!0),i){var s=Object.create(this);s.call=p,s.apply=f,Object.setPrototypeOf(e,s)}else{Object.getOwnPropertyNames(l).forEach(function(n){if(-1===c.indexOf(n)){var u=Object.getOwnPropertyDescriptor(l,n);Object.defineProperty(e,n,u)}})}return a(this,e),o(e)},configurable:!0})}},function(l,n,e){ +/*! + * Chai - overwriteChainableMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ +var u=e(6),t=e(7);l.exports=function(l,n,e,r){var o=l.__methods[n],a=o.chainingBehavior;o.chainingBehavior=function(){var l=r(a).call(this);if(void 0!==l)return l;var n=new u.Assertion;return t(this,n),n};var i=o.method;o.method=function(){var l=e(i).apply(this,arguments);if(void 0!==l)return l;var n=new u.Assertion;return t(this,n),n}}},function(l,n,e){ +/*! + * Chai - compareByInspect utility + * Copyright(c) 2011-2016 Jake Luer + * MIT Licensed + */ +/*! + * Module dependencies + */ +var u=e(39);l.exports=function(l,n){return u(l) + * MIT Licensed + */ +/*! + * Module dependencies + */ +var u=e(46);l.exports=function(l){return Object.keys(l).concat(u(l))}},function(l,n,e){"use strict";var u=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\(\/]+)/;function t(l){var n="";if(void 0===l.name){var e=String(l).match(u);e&&(n=e[1])}else n=l.name;return n}l.exports={compatibleInstance:function(l,n){return n instanceof Error&&l===n},compatibleConstructor:function(l,n){return n instanceof Error?l.constructor===n.constructor||l instanceof n.constructor:(n.prototype instanceof Error||n===Error)&&(l.constructor===n||l instanceof n)},compatibleMessage:function(l,n){var e="string"==typeof l?l:l.message;return n instanceof RegExp?n.test(e):"string"==typeof n&&-1!==e.indexOf(n)},getMessage:function(l){var n="";return l&&l.message?n=l.message:"string"==typeof l&&(n=l),n},getConstructorName:function(l){var n=l;return l instanceof Error?n=t(l.constructor):"function"==typeof l&&(n=t(l).trim()||t(new l)),n}}},function(l,n){l.exports=Number.isNaN|| +/*! + * Chai - isNaN utility + * Copyright(c) 2012-2015 Sakthipriyan Vairamani + * MIT Licensed + */ +function(l){return l!=l}},function(l,n,e){ +/*! + * chai + * http://chaijs.com + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ +var u=e(8);l.exports=function(l,n){ +/*! + * Module dependencies. + */ +var e=l.AssertionError,t=n.flag; +/*! + * Module export. + */ +/*! + * Assertion Constructor + * + * Creates object for chaining. + * + * `Assertion` objects contain metadata in the form of flags. Three flags can + * be assigned during instantiation by passing arguments to this constructor: + * + * - `object`: This flag contains the target of the assertion. For example, in + * the assertion `expect(numKittens).to.equal(7);`, the `object` flag will + * contain `numKittens` so that the `equal` assertion can reference it when + * needed. + * + * - `message`: This flag contains an optional custom error message to be + * prepended to the error message that's generated by the assertion when it + * fails. + * + * - `ssfi`: This flag stands for "start stack function indicator". It + * contains a function reference that serves as the starting point for + * removing frames from the stack trace of the error that's created by the + * assertion when it fails. The goal is to provide a cleaner stack trace to + * end users by removing Chai's internal functions. Note that it only works + * in environments that support `Error.captureStackTrace`, and only when + * `Chai.config.includeStack` hasn't been set to `false`. + * + * - `lockSsfi`: This flag controls whether or not the given `ssfi` flag + * should retain its current value, even as assertions are chained off of + * this object. This is usually set to `true` when creating a new assertion + * from within another assertion. It's also temporarily set to `true` before + * an overwritten assertion gets called by the overwriting assertion. + * + * @param {Mixed} obj target of the assertion + * @param {String} msg (optional) custom error message + * @param {Function} ssfi (optional) starting point for removing stack frames + * @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked + * @api private + */ +function r(l,e,u,o){return t(this,"ssfi",u||r),t(this,"lockSsfi",o),t(this,"object",l),t(this,"message",e),n.proxify(this)}l.Assertion=r,Object.defineProperty(r,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),u.includeStack},set:function(l){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),u.includeStack=l}}),Object.defineProperty(r,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),u.showDiff},set:function(l){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),u.showDiff=l}}),r.addProperty=function(l,e){n.addProperty(this.prototype,l,e)},r.addMethod=function(l,e){n.addMethod(this.prototype,l,e)},r.addChainableMethod=function(l,e,u){n.addChainableMethod(this.prototype,l,e,u)},r.overwriteProperty=function(l,e){n.overwriteProperty(this.prototype,l,e)},r.overwriteMethod=function(l,e){n.overwriteMethod(this.prototype,l,e)},r.overwriteChainableMethod=function(l,e,u){n.overwriteChainableMethod(this.prototype,l,e,u)},r.prototype.assert=function(l,r,o,a,i,s){var c=n.test(this,arguments);if(!1!==s&&(s=!0),void 0===a&&void 0===i&&(s=!1),!0!==u.showDiff&&(s=!1),!c){r=n.getMessage(this,arguments);var p=n.getActual(this,arguments);throw new e(r,{actual:p,expected:a,showDiff:s},u.includeStack?this.assert:t(this,"ssfi"))}}, +/*! + * ### ._obj + * + * Quick reference to stored `actual` value for plugin developers. + * + * @api private + */ +Object.defineProperty(r.prototype,"_obj",{get:function(){return t(this,"object")},set:function(l){t(this,"object",l)}})}},function(l,n){ +/*! + * chai + * http://chaijs.com + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ +l.exports=function(l,n){var e=l.Assertion,u=l.AssertionError,t=n.flag;function r(l,e){e&&t(this,"message",e),l=l.toLowerCase();var u=t(this,"object"),r=~["a","e","i","o","u"].indexOf(l.charAt(0))?"an ":"a ";this.assert(l===n.type(u).toLowerCase(),"expected #{this} to be "+r+l,"expected #{this} not to be "+r+l)}function o(l,e){return n.isNaN(l)&&n.isNaN(e)||l===e}function a(){t(this,"contains",!0)}function i(l,r){r&&t(this,"message",r);var a=t(this,"object"),i=n.type(a).toLowerCase(),s=t(this,"message"),c=t(this,"negate"),p=t(this,"ssfi"),f=t(this,"deep"),d=f?"deep ":"";s=s?s+": ":"";var h=!1;switch(i){case"string":h=-1!==a.indexOf(l);break;case"weakset":if(f)throw new u(s+"unable to use .deep.include with WeakSet",void 0,p);h=a.has(l);break;case"map":var m=f?n.eql:o;a.forEach(function(n){h=h||m(n,l)});break;case"set":f?a.forEach(function(e){h=h||n.eql(e,l)}):h=a.has(l);break;case"array":h=f?a.some(function(e){return n.eql(e,l)}):-1!==a.indexOf(l);break;default:if(l!==Object(l))throw new u(s+"object tested must be an array, a map, an object, a set, a string, or a weakset, but "+i+" given",void 0,p);var g=Object.keys(l),y=null,b=0;if(g.forEach(function(r){var o=new e(a);if(n.transferFlags(this,o,!0),t(o,"lockSsfi",!0),c&&1!==g.length)try{o.property(r,l[r])}catch(l){if(!n.checkError.compatibleConstructor(l,u))throw l;null===y&&(y=l),b++}else o.property(r,l[r])},this),c&&g.length>1&&b===g.length)throw y;return}this.assert(h,"expected #{this} to "+d+"include "+n.inspect(l),"expected #{this} to not "+d+"include "+n.inspect(l))}function s(){var l=t(this,"object"),e=n.type(l);this.assert("Arguments"===e,"expected #{this} to be arguments but got "+e,"expected #{this} to not be arguments")}function c(l,n){n&&t(this,"message",n);var e=t(this,"object");if(t(this,"deep")){var u=t(this,"lockSsfi");t(this,"lockSsfi",!0),this.eql(l),t(this,"lockSsfi",u)}else this.assert(l===e,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",l,this._obj,!0)}function p(l,e){e&&t(this,"message",e),this.assert(n.eql(l,t(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",l,this._obj,!0)}function f(l,r){r&&t(this,"message",r);var o,a=t(this,"object"),i=t(this,"doLength"),s=t(this,"message"),c=s?s+": ":"",p=t(this,"ssfi"),f=n.type(a).toLowerCase(),d=n.type(l).toLowerCase(),h=!0;if(i&&"map"!==f&&"set"!==f&&new e(a,s,p,!0).to.have.property("length"),i||"date"!==f||"date"===d)if("number"===d||!i&&"number"!==f)if(i||"date"===f||"number"===f)h=!1;else{o=c+"expected "+("string"===f?"'"+a+"'":a)+" to be a number or a date"}else o=c+"the argument to above must be a number";else o=c+"the argument to above must be a date";if(h)throw new u(o,void 0,p);if(i){var m,g="length";"map"===f||"set"===f?(g="size",m=a.size):m=a.length,this.assert(m>l,"expected #{this} to have a "+g+" above #{exp} but got #{act}","expected #{this} to not have a "+g+" above #{exp}",l,m)}else this.assert(a>l,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",l)}function d(l,r){r&&t(this,"message",r);var o,a=t(this,"object"),i=t(this,"doLength"),s=t(this,"message"),c=s?s+": ":"",p=t(this,"ssfi"),f=n.type(a).toLowerCase(),d=n.type(l).toLowerCase(),h=!0;if(i&&"map"!==f&&"set"!==f&&new e(a,s,p,!0).to.have.property("length"),i||"date"!==f||"date"===d)if("number"===d||!i&&"number"!==f)if(i||"date"===f||"number"===f)h=!1;else{o=c+"expected "+("string"===f?"'"+a+"'":a)+" to be a number or a date"}else o=c+"the argument to least must be a number";else o=c+"the argument to least must be a date";if(h)throw new u(o,void 0,p);if(i){var m,g="length";"map"===f||"set"===f?(g="size",m=a.size):m=a.length,this.assert(m>=l,"expected #{this} to have a "+g+" at least #{exp} but got #{act}","expected #{this} to have a "+g+" below #{exp}",l,m)}else this.assert(a>=l,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",l)}function h(l,r){r&&t(this,"message",r);var o,a=t(this,"object"),i=t(this,"doLength"),s=t(this,"message"),c=s?s+": ":"",p=t(this,"ssfi"),f=n.type(a).toLowerCase(),d=n.type(l).toLowerCase(),h=!0;if(i&&"map"!==f&&"set"!==f&&new e(a,s,p,!0).to.have.property("length"),i||"date"!==f||"date"===d)if("number"===d||!i&&"number"!==f)if(i||"date"===f||"number"===f)h=!1;else{o=c+"expected "+("string"===f?"'"+a+"'":a)+" to be a number or a date"}else o=c+"the argument to below must be a number";else o=c+"the argument to below must be a date";if(h)throw new u(o,void 0,p);if(i){var m,g="length";"map"===f||"set"===f?(g="size",m=a.size):m=a.length,this.assert(m1&&this.assert(f&&(d?n.eql(e,g):e===g),"expected #{this} to have "+y+n.inspect(l)+" of #{exp}, but got #{act}","expected #{this} to not have "+y+n.inspect(l)+" of #{act}",e,g),t(this,"object",g)}function b(l,n,e){t(this,"own",!0),y.apply(this,arguments)}function v(l,e,u){"string"==typeof e&&(u=e,e=null),u&&t(this,"message",u);var r=t(this,"object"),o=Object.getOwnPropertyDescriptor(Object(r),l);o&&e?this.assert(n.eql(e,o),"expected the own property descriptor for "+n.inspect(l)+" on #{this} to match "+n.inspect(e)+", got "+n.inspect(o),"expected the own property descriptor for "+n.inspect(l)+" on #{this} to not match "+n.inspect(e),e,o,!0):this.assert(o,"expected #{this} to have an own property descriptor for "+n.inspect(l),"expected #{this} to not have an own property descriptor for "+n.inspect(l)),t(this,"object",o)}function A(){t(this,"doLength",!0)}function w(l,u){u&&t(this,"message",u);var r,o=t(this,"object"),a=n.type(o).toLowerCase(),i=t(this,"message"),s=t(this,"ssfi"),c="length";switch(a){case"map":case"set":c="size",r=o.size;break;default:new e(o,i,s,!0).to.have.property("length"),r=o.length}this.assert(r==l,"expected #{this} to have a "+c+" of #{exp} but got #{act}","expected #{this} to not have a "+c+" of #{act}",l,r)}function E(l,n){n&&t(this,"message",n);var e=t(this,"object");this.assert(l.exec(e),"expected #{this} to match "+l,"expected #{this} not to match "+l)}function x(l){var e,r,o=t(this,"object"),a=n.type(o),i=n.type(l),s=t(this,"ssfi"),c=t(this,"deep"),p="",f=!0,d=t(this,"message"),h=(d=d?d+": ":"")+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if("Map"===a||"Set"===a)p=c?"deeply ":"",r=[],o.forEach(function(l,n){r.push(n)}),"Array"!==i&&(l=Array.prototype.slice.call(arguments));else{switch(r=n.getOwnEnumerableProperties(o),i){case"Array":if(arguments.length>1)throw new u(h,void 0,s);break;case"Object":if(arguments.length>1)throw new u(h,void 0,s);l=Object.keys(l);break;default:l=Array.prototype.slice.call(arguments)}l=l.map(function(l){return"symbol"==typeof l?l:String(l)})}if(!l.length)throw new u(d+"keys required",void 0,s);var m=l.length,g=t(this,"any"),y=t(this,"all"),b=l;if(g||y||(y=!0),g&&(f=b.some(function(l){return r.some(function(e){return c?n.eql(l,e):l===e})})),y&&(f=b.every(function(l){return r.some(function(e){return c?n.eql(l,e):l===e})}),t(this,"contains")||(f=f&&l.length==r.length)),m>1){var v=(l=l.map(function(l){return n.inspect(l)})).pop();y&&(e=l.join(", ")+", and "+v),g&&(e=l.join(", ")+", or "+v)}else e=n.inspect(l[0]);e=(m>1?"keys ":"key ")+e,e=(t(this,"contains")?"contain ":"have ")+e,this.assert(f,"expected #{this} to "+p+e,"expected #{this} to not "+p+e,b.slice(0).sort(n.compareByInspect),r.sort(n.compareByInspect),!0)}function C(l,u,r){r&&t(this,"message",r);var o,a=t(this,"object"),i=t(this,"ssfi"),s=t(this,"message"),c=t(this,"negate")||!1;new e(a,s,i,!0).is.a("function"),(l instanceof RegExp||"string"==typeof l)&&(u=l,l=null);try{a()}catch(l){o=l}var p=void 0===l&&void 0===u,f=Boolean(l&&u),d=!1,h=!1;if(p||!p&&!c){var m="an error";l instanceof Error?m="#{exp}":l&&(m=n.checkError.getConstructorName(l)),this.assert(o,"expected #{this} to throw "+m,"expected #{this} to not throw an error but #{act} was thrown",l&&l.toString(),o instanceof Error?o.toString():"string"==typeof o?o:o&&n.checkError.getConstructorName(o))}if(l&&o){if(l instanceof Error)n.checkError.compatibleInstance(o,l)===c&&(f&&c?d=!0:this.assert(c,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(o&&!c?" but #{act} was thrown":""),l.toString(),o.toString()));n.checkError.compatibleConstructor(o,l)===c&&(f&&c?d=!0:this.assert(c,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(o?" but #{act} was thrown":""),l instanceof Error?l.toString():l&&n.checkError.getConstructorName(l),o instanceof Error?o.toString():o&&n.checkError.getConstructorName(o)))}if(o&&null!=u){var g="including";u instanceof RegExp&&(g="matching"),n.checkError.compatibleMessage(o,u)===c&&(f&&c?h=!0:this.assert(c,"expected #{this} to throw error "+g+" #{exp} but got #{act}","expected #{this} to throw error not "+g+" #{exp}",u,n.checkError.getMessage(o)))}d&&h&&this.assert(c,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(o?" but #{act} was thrown":""),l instanceof Error?l.toString():l&&n.checkError.getConstructorName(l),o instanceof Error?o.toString():o&&n.checkError.getConstructorName(o)),t(this,"object",o)}function _(l,e){e&&t(this,"message",e);var u=t(this,"object"),r=t(this,"itself"),o="function"!=typeof u||r?u[l]:u.prototype[l];this.assert("function"==typeof o,"expected #{this} to respond to "+n.inspect(l),"expected #{this} to not respond to "+n.inspect(l))}function T(l,e){e&&t(this,"message",e);var u=l(t(this,"object"));this.assert(u,"expected #{this} to satisfy "+n.objDisplay(l),"expected #{this} to not satisfy"+n.objDisplay(l),!t(this,"negate"),u)}function S(l,n,r){r&&t(this,"message",r);var o=t(this,"object"),a=t(this,"message"),i=t(this,"ssfi");if(new e(o,a,i,!0).is.a("number"),"number"!=typeof l||"number"!=typeof n)throw new u((a=a?a+": ":"")+"the arguments to closeTo or approximately must be numbers",void 0,i);this.assert(Math.abs(o-l)<=n,"expected #{this} to be close to "+l+" +/- "+n,"expected #{this} not to be close to "+l+" +/- "+n)}function k(l,n,u){u&&t(this,"message",u);var r,o=t(this,"object"),a=t(this,"message"),i=t(this,"ssfi");new e(o,a,i,!0).is.a("function"),n?(new e(l,a,i,!0).to.have.property(n),r=l[n]):(new e(l,a,i,!0).is.a("function"),r=l()),o();var s=null==n?l():l[n],c=null==n?r:"."+n;t(this,"deltaMsgObj",c),t(this,"initialDeltaValue",r),t(this,"finalDeltaValue",s),t(this,"deltaBehavior","change"),t(this,"realDelta",s!==r),this.assert(r!==s,"expected "+c+" to change","expected "+c+" to not change")}function P(l,n,u){u&&t(this,"message",u);var r,o=t(this,"object"),a=t(this,"message"),i=t(this,"ssfi");new e(o,a,i,!0).is.a("function"),n?(new e(l,a,i,!0).to.have.property(n),r=l[n]):(new e(l,a,i,!0).is.a("function"),r=l()),new e(r,a,i,!0).is.a("number"),o();var s=null==n?l():l[n],c=null==n?r:"."+n;t(this,"deltaMsgObj",c),t(this,"initialDeltaValue",r),t(this,"finalDeltaValue",s),t(this,"deltaBehavior","increase"),t(this,"realDelta",s-r),this.assert(s-r>0,"expected "+c+" to increase","expected "+c+" to not increase")}function F(l,n,u){u&&t(this,"message",u);var r,o=t(this,"object"),a=t(this,"message"),i=t(this,"ssfi");new e(o,a,i,!0).is.a("function"),n?(new e(l,a,i,!0).to.have.property(n),r=l[n]):(new e(l,a,i,!0).is.a("function"),r=l()),new e(r,a,i,!0).is.a("number"),o();var s=null==n?l():l[n],c=null==n?r:"."+n;t(this,"deltaMsgObj",c),t(this,"initialDeltaValue",r),t(this,"finalDeltaValue",s),t(this,"deltaBehavior","decrease"),t(this,"realDelta",r-s),this.assert(s-r<0,"expected "+c+" to decrease","expected "+c+" to not decrease")}["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still"].forEach(function(l){e.addProperty(l)}),e.addProperty("not",function(){t(this,"negate",!0)}),e.addProperty("deep",function(){t(this,"deep",!0)}),e.addProperty("nested",function(){t(this,"nested",!0)}),e.addProperty("own",function(){t(this,"own",!0)}),e.addProperty("ordered",function(){t(this,"ordered",!0)}),e.addProperty("any",function(){t(this,"any",!0),t(this,"all",!1)}),e.addProperty("all",function(){t(this,"all",!0),t(this,"any",!1)}),e.addChainableMethod("an",r),e.addChainableMethod("a",r),e.addChainableMethod("include",i,a),e.addChainableMethod("contain",i,a),e.addChainableMethod("contains",i,a),e.addChainableMethod("includes",i,a),e.addProperty("ok",function(){this.assert(t(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),e.addProperty("true",function(){this.assert(!0===t(this,"object"),"expected #{this} to be true","expected #{this} to be false",!t(this,"negate"))}),e.addProperty("false",function(){this.assert(!1===t(this,"object"),"expected #{this} to be false","expected #{this} to be true",!!t(this,"negate"))}),e.addProperty("null",function(){this.assert(null===t(this,"object"),"expected #{this} to be null","expected #{this} not to be null")}),e.addProperty("undefined",function(){this.assert(void 0===t(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")}),e.addProperty("NaN",function(){this.assert(n.isNaN(t(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")}),e.addProperty("exist",function(){var l=t(this,"object");this.assert(null!=l,"expected #{this} to exist","expected #{this} to not exist")}),e.addProperty("empty",function(){var l,e=t(this,"object"),r=t(this,"ssfi"),o=t(this,"message");switch(o=o?o+": ":"",n.type(e).toLowerCase()){case"array":case"string":l=e.length;break;case"map":case"set":l=e.size;break;case"weakmap":case"weakset":throw new u(o+".empty was passed a weak collection",void 0,r);case"function":var a=o+".empty was passed a function "+n.getName(e);throw new u(a.trim(),void 0,r);default:if(e!==Object(e))throw new u(o+".empty was passed non-string primitive "+n.inspect(e),void 0,r);l=Object.keys(e).length}this.assert(0===l,"expected #{this} to be empty","expected #{this} not to be empty")}),e.addProperty("arguments",s),e.addProperty("Arguments",s),e.addMethod("equal",c),e.addMethod("equals",c),e.addMethod("eq",c),e.addMethod("eql",p),e.addMethod("eqls",p),e.addMethod("above",f),e.addMethod("gt",f),e.addMethod("greaterThan",f),e.addMethod("least",d),e.addMethod("gte",d),e.addMethod("below",h),e.addMethod("lt",h),e.addMethod("lessThan",h),e.addMethod("most",m),e.addMethod("lte",m),e.addMethod("within",function(l,r,o){o&&t(this,"message",o);var a,i=t(this,"object"),s=t(this,"doLength"),c=t(this,"message"),p=c?c+": ":"",f=t(this,"ssfi"),d=n.type(i).toLowerCase(),h=n.type(l).toLowerCase(),m=n.type(r).toLowerCase(),g=!0,y="date"===h&&"date"===m?l.toUTCString()+".."+r.toUTCString():l+".."+r;if(s&&"map"!==d&&"set"!==d&&new e(i,c,f,!0).to.have.property("length"),s||"date"!==d||"date"===h&&"date"===m)if("number"===h&&"number"===m||!s&&"number"!==d)if(s||"date"===d||"number"===d)g=!1;else{a=p+"expected "+("string"===d?"'"+i+"'":i)+" to be a number or a date"}else a=p+"the arguments to within must be numbers";else a=p+"the arguments to within must be dates";if(g)throw new u(a,void 0,f);if(s){var b,v="length";"map"===d||"set"===d?(v="size",b=i.size):b=i.length,this.assert(b>=l&&b<=r,"expected #{this} to have a "+v+" within "+y,"expected #{this} to not have a "+v+" within "+y)}else this.assert(i>=l&&i<=r,"expected #{this} to be within "+y,"expected #{this} to not be within "+y)}),e.addMethod("instanceof",g),e.addMethod("instanceOf",g),e.addMethod("property",y),e.addMethod("ownProperty",b),e.addMethod("haveOwnProperty",b),e.addMethod("ownPropertyDescriptor",v),e.addMethod("haveOwnPropertyDescriptor",v),e.addChainableMethod("length",w,A),e.addChainableMethod("lengthOf",w,A),e.addMethod("match",E),e.addMethod("matches",E),e.addMethod("string",function(l,u){u&&t(this,"message",u);var r=t(this,"object"),o=t(this,"message"),a=t(this,"ssfi");new e(r,o,a,!0).is.a("string"),this.assert(~r.indexOf(l),"expected #{this} to contain "+n.inspect(l),"expected #{this} to not contain "+n.inspect(l))}),e.addMethod("keys",x),e.addMethod("key",x),e.addMethod("throw",C),e.addMethod("throws",C),e.addMethod("Throw",C),e.addMethod("respondTo",_),e.addMethod("respondsTo",_),e.addProperty("itself",function(){t(this,"itself",!0)}),e.addMethod("satisfy",T),e.addMethod("satisfies",T),e.addMethod("closeTo",S),e.addMethod("approximately",S),e.addMethod("members",function(l,u){u&&t(this,"message",u);var r=t(this,"object"),o=t(this,"message"),a=t(this,"ssfi");new e(r,o,a,!0).to.be.an("array"),new e(l,o,a,!0).to.be.an("array");var i,s,c,p=t(this,"contains"),f=t(this,"ordered");p?(s="expected #{this} to be "+(i=f?"an ordered superset":"a superset")+" of #{exp}",c="expected #{this} to not be "+i+" of #{exp}"):(s="expected #{this} to have the same "+(i=f?"ordered members":"members")+" as #{exp}",c="expected #{this} to not have the same "+i+" as #{exp}");var d=t(this,"deep")?n.eql:void 0;this.assert(function(l,n,e,u,t){if(!u){if(l.length!==n.length)return!1;n=n.slice()}return l.every(function(l,r){if(t)return e?e(l,n[r]):l===n[r];if(!e){var o=n.indexOf(l);return-1!==o&&(u||n.splice(o,1),!0)}return n.some(function(t,r){return!!e(l,t)&&(u||n.splice(r,1),!0)})})}(l,r,d,p,f),s,c,l,r,!0)}),e.addMethod("oneOf",function(l,n){n&&t(this,"message",n);var u=t(this,"object"),r=t(this,"message"),o=t(this,"ssfi");new e(l,r,o,!0).to.be.an("array"),this.assert(l.indexOf(u)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",l,u)}),e.addMethod("change",k),e.addMethod("changes",k),e.addMethod("increase",P),e.addMethod("increases",P),e.addMethod("decrease",F),e.addMethod("decreases",F),e.addMethod("by",function(l,n){n&&t(this,"message",n);var e,u=t(this,"deltaMsgObj"),r=t(this,"initialDeltaValue"),o=t(this,"finalDeltaValue"),a=t(this,"deltaBehavior"),i=t(this,"realDelta");e="change"===a?Math.abs(o-r)===Math.abs(l):i===Math.abs(l),this.assert(e,"expected "+u+" to "+a+" by "+l,"expected "+u+" to not "+a+" by "+l)}),e.addProperty("extensible",function(){var l=t(this,"object"),n=l===Object(l)&&Object.isExtensible(l);this.assert(n,"expected #{this} to be extensible","expected #{this} to not be extensible")}),e.addProperty("sealed",function(){var l=t(this,"object"),n=l!==Object(l)||Object.isSealed(l);this.assert(n,"expected #{this} to be sealed","expected #{this} to not be sealed")}),e.addProperty("frozen",function(){var l=t(this,"object"),n=l!==Object(l)||Object.isFrozen(l);this.assert(n,"expected #{this} to be frozen","expected #{this} to not be frozen")}),e.addProperty("finite",function(l){var n=t(this,"object");this.assert("number"==typeof n&&isFinite(n),"expected #{this} to be a finite number","expected #{this} to not be a finite number")})}},function(l,n){ +/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ +l.exports=function(l,n){l.expect=function(n,e){return new l.Assertion(n,e)},l.expect.fail=function(n,e,u,t){throw arguments.length<2&&(u=n,n=void 0),u=u||"expect.fail()",new l.AssertionError(u,{actual:n,expected:e,operator:t},l.expect.fail)}}},function(l,n){ +/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ +l.exports=function(l,n){var e=l.Assertion;function u(){Object.defineProperty(Object.prototype,"should",{set:function(l){Object.defineProperty(this,"should",{value:l,enumerable:!0,configurable:!0,writable:!0})},get:function l(){return this instanceof String||this instanceof Number||this instanceof Boolean||"function"==typeof Symbol&&this instanceof Symbol?new e(this.valueOf(),null,l):new e(this,null,l)},configurable:!0});var n={fail:function(e,u,t,r){throw arguments.length<2&&(t=e,e=void 0),t=t||"should.fail()",new l.AssertionError(t,{actual:e,expected:u,operator:r},n.fail)},equal:function(l,n,u){new e(l,u).to.equal(n)},Throw:function(l,n,u,t){new e(l,t).to.Throw(n,u)},exist:function(l,n){new e(l,n).to.exist},not:{}};return n.not.equal=function(l,n,u){new e(l,u).to.not.equal(n)},n.not.Throw=function(l,n,u,t){new e(l,t).to.not.Throw(n,u)},n.not.exist=function(l,n){new e(l,n).to.not.exist},n.throw=n.Throw,n.not.throw=n.not.Throw,n}l.should=u,l.Should=u}},function(l,n){ +/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ +l.exports=function(l,n){ +/*! + * Chai dependencies. + */ +var e=l.Assertion,u=n.flag,t=l.assert=function(n,u){new e(null,null,l.assert,!0).assert(n,u,"[ negation message unavailable ]")}; +/*! + * Module export. + */t.fail=function(n,e,u,r){throw arguments.length<2&&(u=n,n=void 0),u=u||"assert.fail()",new l.AssertionError(u,{actual:n,expected:e,operator:r},t.fail)},t.isOk=function(l,n){new e(l,n,t.isOk,!0).is.ok},t.isNotOk=function(l,n){new e(l,n,t.isNotOk,!0).is.not.ok},t.equal=function(l,n,r){var o=new e(l,r,t.equal,!0);o.assert(n==u(o,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",n,l,!0)},t.notEqual=function(l,n,r){var o=new e(l,r,t.notEqual,!0);o.assert(n!=u(o,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",n,l,!0)},t.strictEqual=function(l,n,u){new e(l,u,t.strictEqual,!0).to.equal(n)},t.notStrictEqual=function(l,n,u){new e(l,u,t.notStrictEqual,!0).to.not.equal(n)},t.deepEqual=t.deepStrictEqual=function(l,n,u){new e(l,u,t.deepEqual,!0).to.eql(n)},t.notDeepEqual=function(l,n,u){new e(l,u,t.notDeepEqual,!0).to.not.eql(n)},t.isAbove=function(l,n,u){new e(l,u,t.isAbove,!0).to.be.above(n)},t.isAtLeast=function(l,n,u){new e(l,u,t.isAtLeast,!0).to.be.least(n)},t.isBelow=function(l,n,u){new e(l,u,t.isBelow,!0).to.be.below(n)},t.isAtMost=function(l,n,u){new e(l,u,t.isAtMost,!0).to.be.most(n)},t.isTrue=function(l,n){new e(l,n,t.isTrue,!0).is.true},t.isNotTrue=function(l,n){new e(l,n,t.isNotTrue,!0).to.not.equal(!0)},t.isFalse=function(l,n){new e(l,n,t.isFalse,!0).is.false},t.isNotFalse=function(l,n){new e(l,n,t.isNotFalse,!0).to.not.equal(!1)},t.isNull=function(l,n){new e(l,n,t.isNull,!0).to.equal(null)},t.isNotNull=function(l,n){new e(l,n,t.isNotNull,!0).to.not.equal(null)},t.isNaN=function(l,n){new e(l,n,t.isNaN,!0).to.be.NaN},t.isNotNaN=function(l,n){new e(l,n,t.isNotNaN,!0).not.to.be.NaN},t.exists=function(l,n){new e(l,n,t.exists,!0).to.exist},t.notExists=function(l,n){new e(l,n,t.notExists,!0).to.not.exist},t.isUndefined=function(l,n){new e(l,n,t.isUndefined,!0).to.equal(void 0)},t.isDefined=function(l,n){new e(l,n,t.isDefined,!0).to.not.equal(void 0)},t.isFunction=function(l,n){new e(l,n,t.isFunction,!0).to.be.a("function")},t.isNotFunction=function(l,n){new e(l,n,t.isNotFunction,!0).to.not.be.a("function")},t.isObject=function(l,n){new e(l,n,t.isObject,!0).to.be.a("object")},t.isNotObject=function(l,n){new e(l,n,t.isNotObject,!0).to.not.be.a("object")},t.isArray=function(l,n){new e(l,n,t.isArray,!0).to.be.an("array")},t.isNotArray=function(l,n){new e(l,n,t.isNotArray,!0).to.not.be.an("array")},t.isString=function(l,n){new e(l,n,t.isString,!0).to.be.a("string")},t.isNotString=function(l,n){new e(l,n,t.isNotString,!0).to.not.be.a("string")},t.isNumber=function(l,n){new e(l,n,t.isNumber,!0).to.be.a("number")},t.isNotNumber=function(l,n){new e(l,n,t.isNotNumber,!0).to.not.be.a("number")},t.isFinite=function(l,n){new e(l,n,t.isFinite,!0).to.be.finite},t.isBoolean=function(l,n){new e(l,n,t.isBoolean,!0).to.be.a("boolean")},t.isNotBoolean=function(l,n){new e(l,n,t.isNotBoolean,!0).to.not.be.a("boolean")},t.typeOf=function(l,n,u){new e(l,u,t.typeOf,!0).to.be.a(n)},t.notTypeOf=function(l,n,u){new e(l,u,t.notTypeOf,!0).to.not.be.a(n)},t.instanceOf=function(l,n,u){new e(l,u,t.instanceOf,!0).to.be.instanceOf(n)},t.notInstanceOf=function(l,n,u){new e(l,u,t.notInstanceOf,!0).to.not.be.instanceOf(n)},t.include=function(l,n,u){new e(l,u,t.include,!0).include(n)},t.notInclude=function(l,n,u){new e(l,u,t.notInclude,!0).not.include(n)},t.deepInclude=function(l,n,u){new e(l,u,t.deepInclude,!0).deep.include(n)},t.notDeepInclude=function(l,n,u){new e(l,u,t.notDeepInclude,!0).not.deep.include(n)},t.nestedInclude=function(l,n,u){new e(l,u,t.nestedInclude,!0).nested.include(n)},t.notNestedInclude=function(l,n,u){new e(l,u,t.notNestedInclude,!0).not.nested.include(n)},t.deepNestedInclude=function(l,n,u){new e(l,u,t.deepNestedInclude,!0).deep.nested.include(n)},t.notDeepNestedInclude=function(l,n,u){new e(l,u,t.notDeepNestedInclude,!0).not.deep.nested.include(n)},t.ownInclude=function(l,n,u){new e(l,u,t.ownInclude,!0).own.include(n)},t.notOwnInclude=function(l,n,u){new e(l,u,t.notOwnInclude,!0).not.own.include(n)},t.deepOwnInclude=function(l,n,u){new e(l,u,t.deepOwnInclude,!0).deep.own.include(n)},t.notDeepOwnInclude=function(l,n,u){new e(l,u,t.notDeepOwnInclude,!0).not.deep.own.include(n)},t.match=function(l,n,u){new e(l,u,t.match,!0).to.match(n)},t.notMatch=function(l,n,u){new e(l,u,t.notMatch,!0).to.not.match(n)},t.property=function(l,n,u){new e(l,u,t.property,!0).to.have.property(n)},t.notProperty=function(l,n,u){new e(l,u,t.notProperty,!0).to.not.have.property(n)},t.propertyVal=function(l,n,u,r){new e(l,r,t.propertyVal,!0).to.have.property(n,u)},t.notPropertyVal=function(l,n,u,r){new e(l,r,t.notPropertyVal,!0).to.not.have.property(n,u)},t.deepPropertyVal=function(l,n,u,r){new e(l,r,t.deepPropertyVal,!0).to.have.deep.property(n,u)},t.notDeepPropertyVal=function(l,n,u,r){new e(l,r,t.notDeepPropertyVal,!0).to.not.have.deep.property(n,u)},t.ownProperty=function(l,n,u){new e(l,u,t.ownProperty,!0).to.have.own.property(n)},t.notOwnProperty=function(l,n,u){new e(l,u,t.notOwnProperty,!0).to.not.have.own.property(n)},t.ownPropertyVal=function(l,n,u,r){new e(l,r,t.ownPropertyVal,!0).to.have.own.property(n,u)},t.notOwnPropertyVal=function(l,n,u,r){new e(l,r,t.notOwnPropertyVal,!0).to.not.have.own.property(n,u)},t.deepOwnPropertyVal=function(l,n,u,r){new e(l,r,t.deepOwnPropertyVal,!0).to.have.deep.own.property(n,u)},t.notDeepOwnPropertyVal=function(l,n,u,r){new e(l,r,t.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(n,u)},t.nestedProperty=function(l,n,u){new e(l,u,t.nestedProperty,!0).to.have.nested.property(n)},t.notNestedProperty=function(l,n,u){new e(l,u,t.notNestedProperty,!0).to.not.have.nested.property(n)},t.nestedPropertyVal=function(l,n,u,r){new e(l,r,t.nestedPropertyVal,!0).to.have.nested.property(n,u)},t.notNestedPropertyVal=function(l,n,u,r){new e(l,r,t.notNestedPropertyVal,!0).to.not.have.nested.property(n,u)},t.deepNestedPropertyVal=function(l,n,u,r){new e(l,r,t.deepNestedPropertyVal,!0).to.have.deep.nested.property(n,u)},t.notDeepNestedPropertyVal=function(l,n,u,r){new e(l,r,t.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(n,u)},t.lengthOf=function(l,n,u){new e(l,u,t.lengthOf,!0).to.have.lengthOf(n)},t.hasAnyKeys=function(l,n,u){new e(l,u,t.hasAnyKeys,!0).to.have.any.keys(n)},t.hasAllKeys=function(l,n,u){new e(l,u,t.hasAllKeys,!0).to.have.all.keys(n)},t.containsAllKeys=function(l,n,u){new e(l,u,t.containsAllKeys,!0).to.contain.all.keys(n)},t.doesNotHaveAnyKeys=function(l,n,u){new e(l,u,t.doesNotHaveAnyKeys,!0).to.not.have.any.keys(n)},t.doesNotHaveAllKeys=function(l,n,u){new e(l,u,t.doesNotHaveAllKeys,!0).to.not.have.all.keys(n)},t.hasAnyDeepKeys=function(l,n,u){new e(l,u,t.hasAnyDeepKeys,!0).to.have.any.deep.keys(n)},t.hasAllDeepKeys=function(l,n,u){new e(l,u,t.hasAllDeepKeys,!0).to.have.all.deep.keys(n)},t.containsAllDeepKeys=function(l,n,u){new e(l,u,t.containsAllDeepKeys,!0).to.contain.all.deep.keys(n)},t.doesNotHaveAnyDeepKeys=function(l,n,u){new e(l,u,t.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(n)},t.doesNotHaveAllDeepKeys=function(l,n,u){new e(l,u,t.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(n)},t.throws=function(l,n,r,o){("string"==typeof n||n instanceof RegExp)&&(r=n,n=null);var a=new e(l,o,t.throws,!0).to.throw(n,r);return u(a,"object")},t.doesNotThrow=function(l,n,u,r){("string"==typeof n||n instanceof RegExp)&&(u=n,n=null),new e(l,r,t.doesNotThrow,!0).to.not.throw(n,u)},t.operator=function(r,o,a,i){var s;switch(o){case"==":s=r==a;break;case"===":s=r===a;break;case">":s=r>a;break;case">=":s=r>=a;break;case"<":s=r1)for(var e=1;e 0; }",input:"2",output:"2"}])}),describe("when any expression doesn't match",function(){it("reports match failure",function(){var n=r.generate("start = 'a' 'b' 'c'",l);a(n).to.failToParse("dbc"),a(n).to.failToParse("adc"),a(n).to.failToParse("abd")}),it("resets parse position",function(){var n=r.generate("start = 'a' 'b' / 'a'",l);a(n).to.parse("a","a")})})}),describe("action",function(){describe("when the expression matches",function(){it("returns the value returned by the code",function(){var n=r.generate("start = 'a' { return 42; }",l);a(n).to.parse("a",42)}),describe("label variables",function(){describe("in the expression",function(){it("can access variable defined by labeled expression",function(){var n=r.generate("start = a:'a' { return a; }",l);a(n).to.parse("a","a")}),it("can access variables defined by labeled sequence elements",function(){var n=r.generate("start = a:'a' b:'b' c:'c' { return [a, b, c]; }",l);a(n).to.parse("abc",["a","b","c"])}),it("cannot access variables defined by subexpressions",function(){[{grammar:"start = (a:'a') { return a; }",input:"a"},{grammar:"start = (a:'a')? { return a; }",input:"a"},{grammar:"start = (a:'a')* { return a; }",input:"a"},{grammar:"start = (a:'a')+ { return a; }",input:"a"},{grammar:"start = $(a:'a') { return a; }",input:"a"},{grammar:"start = &(a:'a') 'a' { return a; }",input:"a"},{grammar:"start = !(a:'a') 'b' { return a; }",input:"b"},{grammar:"start = b:(a:'a') { return a; }",input:"a"},{grammar:"start = ('a' b:'b' 'c') { return b; }",input:"abc"},{grammar:"start = (a:'a' { return a; }) { return a; }",input:"a"},{grammar:"start = ('a' / b:'b' / 'c') { return b; }",input:"b"}].forEach(function(n){var e=r.generate(n.grammar,l);a(e).to.failToParse(n.input)})})}),describe("in outer sequence",function(){it("can access variables defined by preceding labeled elements",function(){var n=r.generate("start = a:'a' ('b' { return a; })",l);a(n).to.parse("ab",["a","a"])}),it("cannot access variable defined by labeled action element",function(){var n=r.generate("start = 'a' b:('b' { return b; }) c:'c'",l);a(n).to.failToParse("abc")}),it("cannot access variables defined by following labeled elements",function(){var n=r.generate("start = ('a' { return b; }) b:'b'",l);a(n).to.failToParse("ab")})})}),describe("initializer variables & functions",function(){it("can access variables defined in the initializer",function(){var n=r.generate(["{ var v = 42 }","start = 'a' { return v; }"].join("\n"),l);a(n).to.parse("a",42)}),it("can access functions defined in the initializer",function(){var n=r.generate(["{ function f() { return 42; } }","start = 'a' { return f(); }"].join("\n"),l);a(n).to.parse("a",42)})}),describe("available variables & functions",function(){it("|options| contains options",function(){var n=r.generate("start = 'a' { return options; }",l);a(n).to.parse("a",{a:42},{a:42})}),it("|text| returns text matched by the expression",function(){var n=r.generate("start = 'a' { return text(); }",l);a(n).to.parse("a","a")}),it("|location| returns location info of the expression",function(){var n=r.generate(["{ var result; }","start = line (nl+ line)* { return result; }","line = thing (' '+ thing)*","thing = digit / mark","digit = [0-9]","mark = 'x' { result = location(); }","nl = '\\r'? '\\n'"].join("\n"),l);a(n).to.parse("1\n2\n\n3\n\n\n4 5 x",{start:{offset:13,line:7,column:5},end:{offset:14,line:7,column:6}}),a(n).to.parse("1\nx",{start:{offset:2,line:2,column:1},end:{offset:3,line:2,column:2}}),a(n).to.parse("1\r\nx",{start:{offset:3,line:2,column:1},end:{offset:4,line:2,column:2}})}),describe("|expected|",function(){it("terminates parsing and throws an exception",function(){var n=r.generate("start = 'a' { expected('a'); }",l);a(n).to.failToParse("a",{message:'Expected a but "a" found.',expected:[{type:"other",description:"a"}],found:"a",location:{start:{offset:0,line:1,column:1},end:{offset:1,line:1,column:2}}})}),it("allows to set custom location info",function(){var n=r.generate(["start = 'a' {"," expected('a', {"," start: { offset: 1, line: 1, column: 2 },"," end: { offset: 2, line: 1, column: 3 }"," });","}"].join("\n"),l);a(n).to.failToParse("a",{message:'Expected a but "a" found.',expected:[{type:"other",description:"a"}],found:"a",location:{start:{offset:1,line:1,column:2},end:{offset:2,line:1,column:3}}})})}),describe("|error|",function(){it("terminates parsing and throws an exception",function(){var n=r.generate("start = 'a' { error('a'); }",l);a(n).to.failToParse("a",{message:"a",found:null,expected:null,location:{start:{offset:0,line:1,column:1},end:{offset:1,line:1,column:2}}})}),it("allows to set custom location info",function(){var n=r.generate(["start = 'a' {"," error('a', {"," start: { offset: 1, line: 1, column: 2 },"," end: { offset: 2, line: 1, column: 3 }"," });","}"].join("\n"),l);a(n).to.failToParse("a",{message:"a",expected:null,found:null,location:{start:{offset:1,line:1,column:2},end:{offset:2,line:1,column:3}}})})})})}),describe("when the expression doesn't match",function(){it("reports match failure",function(){var n=r.generate("start = 'a' { return 42; }",l);a(n).to.failToParse("b")}),it("doesn't execute the code",function(){var n=r.generate("start = 'a' { throw 'Boom!'; } / 'b'",l);a(n).to.parse("b")})})}),describe("choice",function(){describe("when any expression matches",function(){it("returns its match result",function(){var n=r.generate("start = 'a' / 'b' / 'c'",l);a(n).to.parse("a","a"),a(n).to.parse("b","b"),a(n).to.parse("c","c")})}),describe("when all expressions don't match",function(){it("reports match failure",function(){var n=r.generate("start = 'a' / 'b' / 'c'",l);a(n).to.failToParse("d")})})}),describe("error reporting",function(){describe("behavior",function(){it("reports only the rightmost error",function(){var n=r.generate("start = 'a' 'b' / 'a' 'c' 'd'",l);a(n).to.failToParse("ace",{expected:[{type:"literal",text:"d",ignoreCase:!1}]})})}),describe("expectations reporting",function(){it("reports expectations correctly with no alternative",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("ab",{expected:[{type:"end"}]})}),it("reports expectations correctly with one alternative",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("b",{expected:[{type:"literal",text:"a",ignoreCase:!1}]})}),it("reports expectations correctly with multiple alternatives",function(){var n=r.generate("start = 'a' / 'b' / 'c'",l);a(n).to.failToParse("d",{expected:[{type:"literal",text:"a",ignoreCase:!1},{type:"literal",text:"b",ignoreCase:!1},{type:"literal",text:"c",ignoreCase:!1}]})}),it("reports expectations correctly with look ahead",function(){var n=r.generate(["Statement = '{' __ !Statement Statement __ '}'","__ = [ ]*"].join("\n"),l);a(n).to.failToParse("{x}",{expected:[{type:"class",parts:[" "],inverted:!1,ignoreCase:!1},{type:"not",expected:{type:"literal",text:"{",ignoreCase:!1}},{type:"literal",text:"{",ignoreCase:!1}]}),n=r.generate(["Start = Char+ End","End = 'e'","Char = !End [a-z]"].join("\n"),l),a(n).to.failToParse("a",{expected:[{type:"class",parts:[["a","z"]],inverted:!1,ignoreCase:!1},{type:"literal",text:"e",ignoreCase:!1}]})}),it("reports expectations correctly with look ahead + grouped names",function(){var n=r.generate(["Start = Char+ End","End 'end' = 'e'","Char = !End [a-z]"].join("\n"),l);a(n).to.failToParse("a",{expected:[{type:"class",parts:[["a","z"]],inverted:!1,ignoreCase:!1},{type:"other",description:"end"}]})})}),describe("found string reporting",function(){it("reports found string correctly at the end of input",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("",{found:null})}),it("reports found string correctly in the middle of input",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("b",{found:"b"})})}),describe("message building",function(){it("builds message correctly with no alternative",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("ab",{message:'Expected end of input but "b" found.'})}),it("builds message correctly with one alternative",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("b",{message:'Expected "a" but "b" found.'})}),it("builds message correctly with multiple alternatives",function(){var n=r.generate("start = 'a' / 'b' / 'c'",l);a(n).to.failToParse("d",{message:'Expected "a", "b", or "c" but "d" found.'})}),it("builds message correctly at the end of input",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("",{message:'Expected "a" but end of input found.'})}),it("builds message correctly in the middle of input",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("b",{message:'Expected "a" but "b" found.'})}),it("removes duplicates from expectations",function(){var n=r.generate("start = 'a' / 'a'",l);a(n).to.failToParse("b",{message:'Expected "a" but "b" found.'})}),it("sorts expectations",function(){var n=r.generate("start = 'c' / 'b' / 'a'",l);a(n).to.failToParse("d",{message:'Expected "a", "b", or "c" but "d" found.'})})}),describe("position reporting",function(){it("reports position correctly at the end of input",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("",{location:{start:{offset:0,line:1,column:1},end:{offset:0,line:1,column:1}}})}),it("reports position correctly in the middle of input",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("b",{location:{start:{offset:0,line:1,column:1},end:{offset:1,line:1,column:2}}})}),it("reports position correctly with trailing input",function(){var n=r.generate("start = 'a'",l);a(n).to.failToParse("aa",{location:{start:{offset:1,line:1,column:2},end:{offset:2,line:1,column:3}}})}),it("reports position correctly in complex cases",function(){var n=r.generate(["start = line (nl+ line)*","line = digit (' '+ digit)*","digit = [0-9]","nl = '\\r'? '\\n'"].join("\n"),l);a(n).to.failToParse("1\n2\n\n3\n\n\n4 5 x",{location:{start:{offset:13,line:7,column:5},end:{offset:14,line:7,column:6}}}),a(n).to.failToParse("1\nx",{location:{start:{offset:2,line:2,column:1},end:{offset:3,line:2,column:2}}}),a(n).to.failToParse("1\r\nx",{location:{start:{offset:3,line:2,column:1},end:{offset:4,line:2,column:2}}})})})}),describe("complex examples",function(){it("handles arithmetics example correctly",function(){var n=r.generate(["Expr = Sum","Sum = head:Product tail:(('+' / '-') Product)* {"," return tail.reduce(function(result, element) {"," if (element[0] === '+') { return result + element[1]; }"," if (element[0] === '-') { return result - element[1]; }"," }, head);"," }","Product = head:Value tail:(('*' / '/') Value)* {"," return tail.reduce(function(result, element) {"," if (element[0] === '*') { return result * element[1]; }"," if (element[0] === '/') { return result / element[1]; }"," }, head);"," }","Value = digits:[0-9]+ { return parseInt(digits.join(''), 10); }"," / '(' expr:Expr ')' { return expr; }"].join("\n"),l);a(n).to.parse("0",0),a(n).to.parse("123",123),a(n).to.parse("(42+43)",85),a(n).to.parse("42",42),a(n).to.parse("42*43",1806),a(n).to.parse("42*43*44*45",3575880),a(n).to.parse("42/43",42/43),a(n).to.parse("42/43/44/45",42/43/44/45),a(n).to.parse("42*43",1806),a(n).to.parse("42*43+44*45",3786),a(n).to.parse("42*43+44*45+46*47+48*49",8300),a(n).to.parse("42*43-44*45",-174),a(n).to.parse("42*43-44*45-46*47-48*49",-4688),a(n).to.parse("42+43",85),a(n).to.parse("(1+2)*(3+4)",21)}),it("handles non-context-free language correctly",function(){var n=r.generate(["S = &(A 'c') a:'a'+ B:B !('a' / 'b' / 'c') { return a.join('') + B; }","A = a:'a' A:A? b:'b' { return [a, A, b].join(''); }","B = b:'b' B:B? c:'c' { return [b, B, c].join(''); }"].join("\n"),l);a(n).to.parse("abc","abc"),a(n).to.parse("aaabbbccc","aaabbbccc"),a(n).to.failToParse("aabbbccc"),a(n).to.failToParse("aaaabbbccc"),a(n).to.failToParse("aaabbccc"),a(n).to.failToParse("aaabbbbccc"),a(n).to.failToParse("aaabbbcc"),a(n).to.failToParse("aaabbbcccc")}),it("handles nested comments example correctly",function(){var n=r.generate(["C = begin:Begin ns:N* end:End { return begin + ns.join('') + end; }","N = C"," / !Begin !End z:Z { return z; }","Z = .","Begin = '(*'","End = '*)'"].join("\n"),l);a(n).to.parse("(**)","(**)"),a(n).to.parse("(*abc*)","(*abc*)"),a(n).to.parse("(*(**)*)","(*(**)*)"),a(n).to.parse("(*abc(*def*)ghi(*(*(*jkl*)*)*)mno*)","(*abc(*def*)ghi(*(*(*jkl*)*)*)mno*)")})})},[{cache:!1,optimize:"speed",trace:!1},{cache:!1,optimize:"speed",trace:!0},{cache:!1,optimize:"size",trace:!1},{cache:!1,optimize:"size",trace:!0},{cache:!0,optimize:"speed",trace:!1},{cache:!0,optimize:"speed",trace:!0},{cache:!0,optimize:"size",trace:!1},{cache:!0,optimize:"size",trace:!0}].forEach(function(l){describe("with options "+t.util.inspect(l),function(){e(r.util.clone(l))})})})},function(l,n,e){"use strict";var u=e(2),t=e(4),r=e(0).compiler.passes.generate.generateBytecode;u.use(t);var o=u.expect;describe("compiler pass |generateBytecode|",function(){function l(l){return{rules:[{bytecode:l}]}}function n(l,n,e,u){return{literals:l,classes:n,expectations:e,functions:u}}describe("for grammar",function(){it("generates correct bytecode",function(){o(r).to.changeAST(["a = 'a'","b = 'b'","c = 'c'"].join("\n"),{rules:[{bytecode:[23,0,18,0,2,1,22,0,3]},{bytecode:[23,1,18,1,2,1,22,1,3]},{bytecode:[23,2,18,2,2,1,22,2,3]}]})}),it("defines correct constants",function(){o(r).to.changeAST(["a = 'a'","b = 'b'","c = 'c'"].join("\n"),n(["a","b","c"],[],[{type:"literal",value:"a",ignoreCase:!1},{type:"literal",value:"b",ignoreCase:!1},{type:"literal",value:"c",ignoreCase:!1}],[]))})}),describe("for rule",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'a'",l([23,0,18,0,2,1,22,0,3]))})}),describe("for named",function(){var e="start 'start' = .",u="start 'start' = 'a'",t="start 'start' = [a]";describe("when |reportFailures=true|",function(){it("generates correct bytecode",function(){o(r).to.changeAST(e,l([23,0,28,17,2,1,21,1,3,29])),o(r).to.changeAST(u,l([23,0,28,18,0,2,1,22,0,3,29])),o(r).to.changeAST(t,l([23,0,28,20,0,2,1,21,1,3,29]))}),it("defines correct constants",function(){o(r).to.changeAST(e,n([],[],[{type:"rule",value:"start"}],[])),o(r).to.changeAST(u,n(["a"],[],[{type:"rule",value:"start"}],[])),o(r).to.changeAST(t,n([],[{value:["a"],inverted:!1,ignoreCase:!1}],[{type:"rule",value:"start"}],[]))})}),describe("when |reportFailures=false|",function(){it("generates correct bytecode",function(){o(r).to.changeAST(e,l([17,2,1,21,1,3]),{},{reportFailures:!1}),o(r).to.changeAST(u,l([18,0,2,1,22,0,3]),{},{reportFailures:!1}),o(r).to.changeAST(t,l([20,0,2,1,21,1,3]),{},{reportFailures:!1})}),it("defines correct constants",function(){o(r).to.changeAST(e,n([],[],[],[]),{},{reportFailures:!1}),o(r).to.changeAST(u,n(["a"],[],[],[]),{},{reportFailures:!1}),o(r).to.changeAST(t,n([],[{value:["a"],inverted:!1,ignoreCase:!1}],[],[]),{},{reportFailures:!1})})})}),describe("for choice",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'a' / 'b' / 'c'",l([23,0,18,0,2,1,22,0,3,14,23,0,6,23,1,18,1,2,1,22,1,3,14,10,0,6,23,2,18,2,2,1,22,2,3]))})}),describe("for action",function(){describe("without labels",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'a' { code }",l([5,23,0,18,0,2,1,22,0,3,15,6,0,24,1,26,0,1,0,9]))}),it("defines correct constants",function(){o(r).to.changeAST("start = 'a' { code }",n(["a"],[],[{type:"literal",value:"a",ignoreCase:!1}],[{predicate:!1,params:[],body:" code "}]))})}),describe("with one label",function(){var e="start = a:'a' { code }";it("generates correct bytecode",function(){o(r).to.changeAST(e,l([5,23,0,18,0,2,1,22,0,3,15,7,0,24,1,26,0,1,1,0,9]))}),it("defines correct constants",function(){o(r).to.changeAST(e,n(["a"],[],[{type:"literal",value:"a",ignoreCase:!1}],[{predicate:!1,params:["a"],body:" code "}]))})}),describe("with multiple labels",function(){var e="start = a:'a' b:'b' c:'c' { code }";it("generates correct bytecode",function(){o(r).to.changeAST(e,l([5,23,0,18,0,2,1,22,0,3,15,41,3,23,1,18,1,2,1,22,1,3,15,25,4,23,2,18,2,2,1,22,2,3,15,9,4,24,3,26,0,4,3,2,1,0,8,3,7,3,8,2,7,3,6,7,3]))}),it("defines correct constants",function(){o(r).to.changeAST(e,n(["a","b","c"],[],[{type:"literal",value:"a",ignoreCase:!1},{type:"literal",value:"b",ignoreCase:!1},{type:"literal",value:"c",ignoreCase:!1}],[{predicate:!1,params:["a","b","c"],body:" code "}]))})})}),describe("for sequence",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'a' 'b' 'c'",l([5,23,0,18,0,2,1,22,0,3,15,35,3,23,1,18,1,2,1,22,1,3,15,19,4,23,2,18,2,2,1,22,2,3,15,3,4,11,3,9,8,3,7,3,8,2,7,3,6,7,3]))}),it("defines correct constants",function(){o(r).to.changeAST("start = 'a' 'b' 'c'",n(["a","b","c"],[],[{type:"literal",value:"a",ignoreCase:!1},{type:"literal",value:"b",ignoreCase:!1},{type:"literal",value:"c",ignoreCase:!1}],[]))}),it("generates correct plucking bytecode",function(){o(r).to.changeAST("start = 'a' @'b' 'c'",l([5,23,0,18,0,2,1,22,0,3,15,36,3,23,1,18,1,2,1,22,1,3,15,20,4,23,2,18,2,2,1,22,2,3,15,4,4,41,4,1,1,8,3,7,3,8,2,7,3,6,7,3])),o(r).to.changeAST("start = 'a' @'b' @'c'",l([5,23,0,18,0,2,1,22,0,3,15,37,3,23,1,18,1,2,1,22,1,3,15,21,4,23,2,18,2,2,1,22,2,3,15,5,4,41,4,2,1,0,8,3,7,3,8,2,7,3,6,7,3]))})}),describe("for labeled",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = a:'a'",l([23,0,18,0,2,1,22,0,3]))})}),describe("for text",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = $'a'",l([5,23,0,18,0,2,1,22,0,3,15,2,1,6,12,9]))})}),describe("for simple_and",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = &'a'",l([5,38,23,0,18,0,2,1,22,0,3,39,0,15,3,3,6,7,1,6,6,3]))}),it("defines correct constants",function(){o(r).to.changeAST("start = &'a'",n(["a"],[],[{type:"literal",value:"a",ignoreCase:!1}],[]))})}),describe("for simple_not",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = !'a'",l([5,38,23,0,18,0,2,1,22,0,3,39,1,14,3,3,6,6,1,6,7,3]))}),it("defines correct constants",function(){o(r).to.changeAST("start = !'a'",n(["a"],[],[{type:"literal",value:"a",ignoreCase:!1}],[]))})}),describe("for optional",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'a'?",l([23,0,18,0,2,1,22,0,3,14,2,0,6,2]))}),it("defines correct constants",function(){o(r).to.changeAST("start = 'a'?",n(["a"],[],[{type:"literal",value:"a",ignoreCase:!1}],[]))})}),describe("for zero_or_more",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'a'*",l([4,23,0,18,0,2,1,22,0,3,16,10,10,23,0,18,0,2,1,22,0,3,6]))}),it("defines correct constants",function(){o(r).to.changeAST("start = 'a'*",n(["a"],[],[{type:"literal",value:"a",ignoreCase:!1}],[]))})}),describe("for one_or_more",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'a'+",l([4,23,0,18,0,2,1,22,0,3,15,13,3,16,10,10,23,0,18,0,2,1,22,0,3,6,6,6,3]))}),it("defines correct constants",function(){o(r).to.changeAST("start = 'a'+",n(["a"],[],[{type:"literal",value:"a",ignoreCase:!1}],[]))})}),describe("for group",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = ('a')",l([23,0,18,0,2,1,22,0,3]))}),it("defines correct constants",function(){o(r).to.changeAST("start = ('a')",n(["a"],[],[{type:"literal",value:"a",ignoreCase:!1}],[]))})}),describe("for semantic_and",function(){describe("without labels",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = &{ code }",l([25,26,0,0,0,13,2,2,6,1,6,3]))}),it("defines correct constants",function(){o(r).to.changeAST("start = &{ code }",n([],[],[],[{predicate:!0,params:[],body:" code "}]))})}),describe("with labels",function(){var e="start = a:'a' b:'b' c:'c' &{ code }";it("generates correct bytecode",function(){o(r).to.changeAST(e,l([5,23,0,18,0,2,1,22,0,3,15,57,3,23,1,18,1,2,1,22,1,3,15,41,4,23,2,18,2,2,1,22,2,3,15,25,4,25,26,0,0,3,2,1,0,13,2,2,6,1,6,3,15,3,4,11,4,9,8,4,7,3,8,3,7,3,8,2,7,3,6,7,3]))}),it("defines correct constants",function(){o(r).to.changeAST(e,n(["a","b","c"],[],[{type:"literal",value:"a",ignoreCase:!1},{type:"literal",value:"b",ignoreCase:!1},{type:"literal",value:"c",ignoreCase:!1}],[{predicate:!0,params:["a","b","c"],body:" code "}]))})})}),describe("for semantic_not",function(){describe("without labels",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = !{ code }",l([25,26,0,0,0,13,2,2,6,3,6,1]))}),it("defines correct constants",function(){o(r).to.changeAST("start = !{ code }",n([],[],[],[{predicate:!0,params:[],body:" code "}]))})}),describe("with labels",function(){var e="start = a:'a' b:'b' c:'c' !{ code }";it("generates correct bytecode",function(){o(r).to.changeAST(e,l([5,23,0,18,0,2,1,22,0,3,15,57,3,23,1,18,1,2,1,22,1,3,15,41,4,23,2,18,2,2,1,22,2,3,15,25,4,25,26,0,0,3,2,1,0,13,2,2,6,3,6,1,15,3,4,11,4,9,8,4,7,3,8,3,7,3,8,2,7,3,6,7,3]))}),it("defines correct constants",function(){o(r).to.changeAST(e,n(["a","b","c"],[],[{type:"literal",value:"a",ignoreCase:!1},{type:"literal",value:"b",ignoreCase:!1},{type:"literal",value:"c",ignoreCase:!1}],[{predicate:!0,params:["a","b","c"],body:" code "}]))})})}),describe("for rule_ref",function(){it("generates correct bytecode",function(){o(r).to.changeAST(["start = other","other = 'other'"].join("\n"),{rules:[{bytecode:[27,1]},{}]})})}),describe("for literal",function(){describe("when |reportFailures=true|",function(){describe("empty",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = ''",l([0]))}),it("defines correct constants",function(){o(r).to.changeAST("start = ''",n([],[],[],[]))})}),describe("non-empty case-sensitive",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'a'",l([23,0,18,0,2,1,22,0,3]))}),it("defines correct constants",function(){o(r).to.changeAST("start = 'a'",n(["a"],[],[{type:"literal",value:"a",ignoreCase:!1}],[]))})}),describe("non-empty case-insensitive",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'A'i",l([23,0,19,0,2,1,21,1,3]))}),it("defines correct constants",function(){o(r).to.changeAST("start = 'A'i",n(["a"],[],[{type:"literal",value:"A",ignoreCase:!0}],[]))})})}),describe("when |reportFailures=false|",function(){describe("empty",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = ''",l([0]),{},{reportFailures:!1})}),it("defines correct constants",function(){o(r).to.changeAST("start = ''",n([],[],[],[]),{},{reportFailures:!1})})}),describe("non-empty case-sensitive",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'a'",l([18,0,2,1,22,0,3]),{},{reportFailures:!1})}),it("defines correct constants",function(){o(r).to.changeAST("start = 'a'",n(["a"],[],[],[]),{},{reportFailures:!1})})}),describe("non-empty case-insensitive",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = 'A'i",l([19,0,2,1,21,1,3]),{},{reportFailures:!1})}),it("defines correct constants",function(){o(r).to.changeAST("start = 'A'i",n(["a"],[],[],[]),{},{reportFailures:!1})})})})}),describe("for class",function(){describe("when |reportFailures=true|",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = [a]",l([23,0,20,0,2,1,21,1,3]))}),describe("non-inverted case-sensitive",function(){it("defines correct constants",function(){o(r).to.changeAST("start = [a]",n([],[{value:["a"],inverted:!1,ignoreCase:!1}],[{type:"class",value:["a"],inverted:!1,ignoreCase:!1}],[]))})}),describe("inverted case-sensitive",function(){it("defines correct constants",function(){o(r).to.changeAST("start = [^a]",n([],[{value:["a"],inverted:!0,ignoreCase:!1}],[{type:"class",value:["a"],inverted:!0,ignoreCase:!1}],[]))})}),describe("non-inverted case-insensitive",function(){it("defines correct constants",function(){o(r).to.changeAST("start = [a]i",n([],[{value:["a"],inverted:!1,ignoreCase:!0}],[{type:"class",value:["a"],inverted:!1,ignoreCase:!0}],[]))})}),describe("complex",function(){it("defines correct constants",function(){o(r).to.changeAST("start = [ab-def-hij-l]",n([],[{value:["a",["b","d"],"e",["f","h"],"i",["j","l"]],inverted:!1,ignoreCase:!1}],[{type:"class",value:["a",["b","d"],"e",["f","h"],"i",["j","l"]],inverted:!1,ignoreCase:!1}],[]))})})}),describe("when |reportFailures=false|",function(){it("generates correct bytecode",function(){o(r).to.changeAST("start = [a]",l([20,0,2,1,21,1,3]),{},{reportFailures:!1})}),describe("non-inverted case-sensitive",function(){it("defines correct constants",function(){o(r).to.changeAST("start = [a]",n([],[{value:["a"],inverted:!1,ignoreCase:!1}],[],[]),{},{reportFailures:!1})})}),describe("inverted case-sensitive",function(){it("defines correct constants",function(){o(r).to.changeAST("start = [^a]",n([],[{value:["a"],inverted:!0,ignoreCase:!1}],[],[]),{},{reportFailures:!1})})}),describe("non-inverted case-insensitive",function(){it("defines correct constants",function(){o(r).to.changeAST("start = [a]i",n([],[{value:["a"],inverted:!1,ignoreCase:!0}],[],[]),{},{reportFailures:!1})})}),describe("complex",function(){it("defines correct constants",function(){o(r).to.changeAST("start = [ab-def-hij-l]",n([],[{value:["a",["b","d"],"e",["f","h"],"i",["j","l"]],inverted:!1,ignoreCase:!1}],[],[]),{},{reportFailures:!1})})})})}),describe("for any",function(){describe("when |reportFailures=true|",function(){it("generates bytecode",function(){o(r).to.changeAST("start = .",l([23,0,17,2,1,21,1,3]))}),it("defines correct constants",function(){o(r).to.changeAST("start = .",n([],[],[{type:"any"}],[]))})}),describe("when |reportFailures=false|",function(){it("generates bytecode",function(){o(r).to.changeAST("start = .",l([17,2,1,21,1,3]),{},{reportFailures:!1})}),it("defines correct constants",function(){o(r).to.changeAST("start = .",n([],[],[],[]),{},{reportFailures:!1})})})})})},function(l,n,e){l.exports=e(83)},function(l,n,e){"use strict";let u=[];l.exports=function(l,n){function e(l,e){return n.type(e).toUpperCase()===l.toUpperCase()}l.Assertion.addMethod("like",function(t){let r=n.flag(this,"object");this.assert(function l(n,t){for(let l of u)if(l.match(n,t))return l.assert(n,t);if(n===t)return!0;if(e("object",t)&&e("object",n)){for(let e of Object.keys(t)){if(!(e in n))return!1;if(!l(n[e],t[e]))return!1}return!0}if(e("array",t)&&e("array",n)){if(n.length!==t.length)return!1;for(let e=0;e start).",location:{start:{offset:8,line:1,column:9},end:{offset:13,line:1,column:14}}})}),it("reports indirect left recursion",function(){o(r).to.reportError(["start = stop","stop = start"].join("\n"),{message:"Possible infinite loop when parsing (left recursion: start -> stop -> start).",location:{start:{offset:20,line:2,column:8},end:{offset:25,line:2,column:13}}})}),describe("in sequences",function(){it("reports left recursion if all preceding elements match empty string",function(){o(r).to.reportError("start = '' '' '' start")}),it("doesn't report left recursion if some preceding element doesn't match empty string",function(){o(r).to.not.reportError("start = 'a' '' '' start"),o(r).to.not.reportError("start = '' 'a' '' start"),o(r).to.not.reportError("start = '' '' 'a' start")}),it("reports left recursion when rule reference is wrapped in an expression",function(){o(r).to.reportError("start = '' start?")}),it("computes expressions that always consume input on success correctly",function(){o(r).to.reportError(["start = a start","a 'a' = ''"].join("\n")),o(r).to.not.reportError(["start = a start","a 'a' = 'a'"].join("\n")),o(r).to.reportError("start = ('' / 'a' / 'b') start"),o(r).to.reportError("start = ('a' / '' / 'b') start"),o(r).to.reportError("start = ('a' / 'b' / '') start"),o(r).to.not.reportError("start = ('a' / 'b' / 'c') start"),o(r).to.reportError("start = ('' { }) start"),o(r).to.not.reportError("start = ('a' { }) start"),o(r).to.reportError("start = ('' '' '') start"),o(r).to.not.reportError("start = ('a' '' '') start"),o(r).to.not.reportError("start = ('' 'a' '') start"),o(r).to.not.reportError("start = ('' '' 'a') start"),o(r).to.reportError("start = a:'' start"),o(r).to.not.reportError("start = a:'a' start"),o(r).to.reportError("start = $'' start"),o(r).to.not.reportError("start = $'a' start"),o(r).to.reportError("start = &'' start"),o(r).to.reportError("start = &'a' start"),o(r).to.reportError("start = !'' start"),o(r).to.reportError("start = !'a' start"),o(r).to.reportError("start = ''? start"),o(r).to.reportError("start = 'a'? start"),o(r).to.reportError("start = ''* start"),o(r).to.reportError("start = 'a'* start"),o(r).to.reportError("start = ''+ start"),o(r).to.not.reportError("start = 'a'+ start"),o(r).to.reportError("start = ('') start"),o(r).to.not.reportError("start = ('a') start"),o(r).to.reportError("start = &{ } start"),o(r).to.reportError("start = !{ } start"),o(r).to.reportError(["start = a start","a = ''"].join("\n")),o(r).to.not.reportError(["start = a start","a = 'a'"].join("\n")),o(r).to.reportError("start = '' start"),o(r).to.not.reportError("start = 'a' start"),o(r).to.not.reportError("start = [a-d] start"),o(r).to.not.reportError("start = . start")})})})},function(l,n,e){"use strict";var u=e(2),t=e(4),r=e(0).compiler.passes.check.reportInfiniteRepetition;u.use(t);var o=u.expect;describe("compiler pass |reportInfiniteRepetition|",function(){it("reports infinite loops for zero_or_more",function(){o(r).to.reportError("start = ('')*",{message:"Possible infinite loop when parsing (repetition used with an expression that may not consume any input).",location:{start:{offset:8,line:1,column:9},end:{offset:13,line:1,column:14}}})}),it("reports infinite loops for one_or_more",function(){o(r).to.reportError("start = ('')+",{message:"Possible infinite loop when parsing (repetition used with an expression that may not consume any input).",location:{start:{offset:8,line:1,column:9},end:{offset:13,line:1,column:14}}})}),it("computes expressions that always consume input on success correctly",function(){o(r).to.reportError(["start = a*","a 'a' = ''"].join("\n")),o(r).to.not.reportError(["start = a*","a 'a' = 'a'"].join("\n")),o(r).to.reportError("start = ('' / 'a' / 'b')*"),o(r).to.reportError("start = ('a' / '' / 'b')*"),o(r).to.reportError("start = ('a' / 'b' / '')*"),o(r).to.not.reportError("start = ('a' / 'b' / 'c')*"),o(r).to.reportError("start = ('' { })*"),o(r).to.not.reportError("start = ('a' { })*"),o(r).to.reportError("start = ('' '' '')*"),o(r).to.not.reportError("start = ('a' '' '')*"),o(r).to.not.reportError("start = ('' 'a' '')*"),o(r).to.not.reportError("start = ('' '' 'a')*"),o(r).to.reportError("start = (a:'')*"),o(r).to.not.reportError("start = (a:'a')*"),o(r).to.reportError("start = ($'')*"),o(r).to.not.reportError("start = ($'a')*"),o(r).to.reportError("start = (&'')*"),o(r).to.reportError("start = (&'a')*"),o(r).to.reportError("start = (!'')*"),o(r).to.reportError("start = (!'a')*"),o(r).to.reportError("start = (''?)*"),o(r).to.reportError("start = ('a'?)*"),o(r).to.reportError("start = (''*)*"),o(r).to.reportError("start = ('a'*)*"),o(r).to.reportError("start = (''+)*"),o(r).to.not.reportError("start = ('a'+)*"),o(r).to.reportError("start = ('')*"),o(r).to.not.reportError("start = ('a')*"),o(r).to.reportError("start = (&{ })*"),o(r).to.reportError("start = (!{ })*"),o(r).to.reportError(["start = a*","a = ''"].join("\n")),o(r).to.not.reportError(["start = a*","a = 'a'"].join("\n")),o(r).to.reportError("start = ''*"),o(r).to.not.reportError("start = 'a'*"),o(r).to.not.reportError("start = [a-d]*"),o(r).to.not.reportError("start = .*")})})},function(l,n,e){"use strict";var u=e(2),t=e(4),r=e(0).compiler.passes.check.reportUndefinedRules;u.use(t);var o=u.expect;describe("compiler pass |reportUndefinedRules|",function(){it("reports undefined rules",function(){o(r).to.reportError("start = undefined",{message:'Rule "undefined" is not defined.',location:{start:{offset:8,line:1,column:9},end:{offset:17,line:1,column:18}}})}),it("checks allowedStartRules",function(){o(r).to.reportError("start = 'a'",{message:'Start rule "missing" is not defined.'},{allowedStartRules:["missing"]})})})},function(l,n,e){"use strict";var u=e(2),t=e(4),r=e(0).compiler.passes.check.reportUnusedRules;u.use(t);var o=u.expect;describe("compiler pass |reportUnusedRules|",function(){it("should report rules that are not referenced",function(){o(r).to.reportWarning("\n start = .\n unused = .\n ",'Rule "unused" is not referenced.'),o(r).to.reportWarning("\n start = .\n unused = .\n used = .\n ",['Rule "used" is not referenced.','Rule "unused" is not referenced.'])}),it("does not report rules that are referenced",function(){o(r).not.to.reportWarning("start = ."),o(r).not.to.reportWarning("\n start = used\n used = .\n ")}),it("does not report any rules that the generated parser starts parsing from",function(){o(r).not.to.reportWarning('\n a = "x"\n b = a\n c = .+\n ',null,{allowedStartRules:["b","c"]})})})},function(l,n,e){"use strict";var u=e(2),t=e(0),r=t.parser,o=t.util,a=t.ast,i=u.expect;u.config.truncateThreshold=0,describe("PEG.js grammar parser",function(){var l={type:"literal",value:"abcd",ignoreCase:!1},n={type:"literal",value:"efgh",ignoreCase:!1},e={type:"literal",value:"ijkl",ignoreCase:!1},t={type:"literal",value:"mnop",ignoreCase:!1},s={type:"semantic_and",code:" code "},c={type:"semantic_not",code:" code "},p={type:"optional",expression:l},f={type:"zero_or_more",expression:l},d={type:"one_or_more",expression:l},h={type:"text",expression:p},m={type:"simple_not",expression:l},g={type:"simple_and",expression:p},y={type:"simple_not",expression:p},b={type:"labeled",label:"a",expression:l},v={type:"labeled",label:"b",expression:n},A={type:"labeled",label:"a",expression:m},w={type:"sequence",elements:[l,n,e]},E={type:"sequence",elements:[b,v]},x={type:"sequence",elements:[b,v,{type:"labeled",label:"c",expression:e},{type:"labeled",label:"d",expression:t}]},C={type:"group",expression:b},_={type:"group",expression:w},T={type:"action",expression:l,code:" code "},S={type:"action",expression:n,code:" code "},k={type:"action",expression:w,code:" code "},P={type:"choice",alternatives:[l,n,e]},F={type:"choice",alternatives:[T,S]},j={type:"choice",alternatives:[T,S,{type:"action",expression:e,code:" code "},{type:"action",expression:t,code:" code "}]},O={type:"named",name:"start rule",expression:l},D={type:"rule",name:"a",expression:l},$={type:"rule",name:"b",expression:n},B={type:"rule",name:"c",expression:e},I={type:"rule",name:"start",expression:l},M={type:"initializer",code:" code "};function N(l){return{type:"grammar",initializer:null,comments:null,rules:[{type:"rule",name:"start",expression:l}]}}function R(n){return N({type:"action",expression:l,code:n})}function L(l,n){return N({type:"literal",value:l,ignoreCase:n})}function q(l,n,e){return N({type:"class",parts:l,inverted:n,ignoreCase:e})}function H(){return N({type:"any"})}function z(l){return N({type:"rule_ref",name:l})}function U(l,n,e){return(l=o.clone(l)).comments=e.extractComments?n.reduce(function(l,n){return l[n.offset]={text:n.text,multiline:n.multiline},l},{}):null,l}var W,V=L("abcd",!1),G={type:"grammar",initializer:null,comments:null,rules:[D,$]},X=function(){var l;function n(l){delete l.location}function e(n){delete n.location,l(n.expression)}function u(n){return function(e){delete e.location,e[n].forEach(l)}}return l=a.visitor.build({grammar:function(e){delete e.location,delete e._alwaysConsumesOnSuccess,e.initializer&&l(e.initializer),e.comments&&o.each(e.comments,n),e.rules.forEach(l)},initializer:n,rule:e,named:e,choice:u("alternatives"),action:e,sequence:u("elements"),labeled:e,text:e,simple_and:e,simple_not:e,optional:e,zero_or_more:e,one_or_more:e,group:e,semantic_and:n,semantic_not:n,rule_ref:n,literal:n,class:n,any:n})}();function J(l,n){var e=l.Assertion;e.addMethod("parseAs",function(l,e){e=void 0===e?{}:e;var u=r.parse(n.flag(this,"object"),e);X(u),this.assert(n.eql(u,l),"expected #{this} to parse as #{exp} but got #{act}","expected #{this} to not parse as #{exp}",l,u,!n.flag(this,"negate"))}),e.addMethod("failToParse",function(l){var u,t;try{t=r.parse(n.flag(this,"object")),u=!0}catch(l){t=l,u=!1}u&&X(t),this.assert(!u,"expected #{this} to fail to parse but got #{act}","expected #{this} to not fail to parse but it failed with #{act}",null,t),u||void 0===l||Object.keys(l).forEach(function(n){new e(t).to.have.property(n).that.is.deep.equal(l[n])})})}beforeEach(function(){u.use(J)}),it("parses Rule+",function(){i("start = a").to.parseAs(z("a"));var l=z("a");l.initializer={type:"initializer",code:""},i("{}\nstart = a").to.parseAs(l),i("").to.failToParse(),i("{}").to.failToParse()}),it("parses Grammar",function(){i("\na = 'abcd';\n").to.parseAs({type:"grammar",comments:null,initializer:null,rules:[D]}),i("\na = 'abcd';\nb = 'efgh';\nc = 'ijkl';\n").to.parseAs({type:"grammar",comments:null,initializer:null,rules:[D,$,B]}),i("\n{ code };\na = 'abcd';\n").to.parseAs({type:"grammar",comments:null,initializer:M,rules:[D]})}),it("parses Initializer",function(){i("{ code };start = 'abcd'").to.parseAs({type:"grammar",comments:null,initializer:M,rules:[I]})}),it("parses Rule",function(){i("start\n=\n'abcd';").to.parseAs(N(l)),i("start\n'start rule'\n=\n'abcd';").to.parseAs(N(O))}),it("parses Expression",function(){i("start = 'abcd' / 'efgh' / 'ijkl'").to.parseAs(N(P))}),it("parses ChoiceExpression",function(){i("start = 'abcd' { code }").to.parseAs(N(T)),i("start = 'abcd' { code }\n/\n'efgh' { code }").to.parseAs(N(F)),i("start = 'abcd' { code }\n/\n'efgh' { code }\n/\n'ijkl' { code }\n/\n'mnop' { code }").to.parseAs(N(j))}),it("parses ActionExpression",function(){i("start = 'abcd' 'efgh' 'ijkl'").to.parseAs(N(w)),i("start = 'abcd' 'efgh' 'ijkl'\n{ code }").to.parseAs(N(k))}),it("parses SequenceExpression",function(){i("start = a:'abcd'").to.parseAs(N(b)),i("start = a:'abcd'\nb:'efgh'").to.parseAs(N(E)),i("start = a:'abcd'\nb:'efgh'\nc:'ijkl'\nd:'mnop'").to.parseAs(N(x))}),it("parses `@` (value plucking)",function(){function u(){for(var l=arguments.length,n=new Array(l),e=0;e\n'abcd'").to.failToParse()})},[{},{extractComments:!1},{extractComments:!0}].forEach(function(l){describe("with options "+u.util.inspect(l),function(){return W(l)})}),it("parses Identifier",function(){i("start = a:'abcd'").to.parseAs(N(b))}),it("parses IdentifierName",function(){i("start = a").to.parseAs(z("a")),i("start = ab").to.parseAs(z("ab")),i("start = abcd").to.parseAs(z("abcd"))}),it("parses IdentifierStart",function(){i("start = a").to.parseAs(z("a")),i("start = $").to.parseAs(z("$")),i("start = _").to.parseAs(z("_")),i("start = \\u0061").to.parseAs(z("a"))}),it("parses IdentifierPart",function(){i("start = aa").to.parseAs(z("aa")),i("start = à").to.parseAs(z("à")),i("start = a0").to.parseAs(z("a0")),i("start = a‿").to.parseAs(z("a‿")),i("start = a‌").to.parseAs(z("a‌")),i("start = a‍").to.parseAs(z("a‍"))}),it("parses LiteralMatcher",function(){i("start = 'abcd'").to.parseAs(L("abcd",!1)),i("start = 'abcd'i").to.parseAs(L("abcd",!0))}),it("parses StringLiteral",function(){i('start = ""').to.parseAs(L("",!1)),i('start = "a"').to.parseAs(L("a",!1)),i('start = "abc"').to.parseAs(L("abc",!1)),i("start = ''").to.parseAs(L("",!1)),i("start = 'a'").to.parseAs(L("a",!1)),i("start = 'abc'").to.parseAs(L("abc",!1))}),it("parses DoubleStringCharacter",function(){i('start = "a"').to.parseAs(L("a",!1)),i('start = "\\n"').to.parseAs(L("\n",!1)),i('start = "\\\n"').to.parseAs(L("",!1)),i('start = """').to.failToParse(),i('start = "\\"').to.failToParse(),i('start = "\n"').to.failToParse()}),it("parses SingleStringCharacter",function(){i("start = 'a'").to.parseAs(L("a",!1)),i("start = '\\n'").to.parseAs(L("\n",!1)),i("start = '\\\n'").to.parseAs(L("",!1)),i("start = '''").to.failToParse(),i("start = '\\'").to.failToParse(),i("start = '\n'").to.failToParse()}),it("parses CharacterClassMatcher",function(){i("start = []").to.parseAs(q([],!1,!1)),i("start = [a-d]").to.parseAs(q([["a","d"]],!1,!1)),i("start = [a]").to.parseAs(q(["a"],!1,!1)),i("start = [a-de-hi-l]").to.parseAs(q([["a","d"],["e","h"],["i","l"]],!1,!1)),i("start = [^a-d]").to.parseAs(q([["a","d"]],!0,!1)),i("start = [a-d]i").to.parseAs(q([["a","d"]],!1,!0)),i("start = [\\\n]").to.parseAs(q([],!1,!1))}),it("parses ClassCharacterRange",function(){i("start = [a-d]").to.parseAs(q([["a","d"]],!1,!1)),i("start = [a-a]").to.parseAs(q([["a","a"]],!1,!1)),i("start = [b-a]").to.failToParse({message:"Invalid character range: b-a."})}),it("parses ClassCharacter",function(){i("start = [a]").to.parseAs(q(["a"],!1,!1)),i("start = [\\n]").to.parseAs(q(["\n"],!1,!1)),i("start = [\\\n]").to.parseAs(q([],!1,!1)),i("start = []]").to.failToParse(),i("start = [\\]").to.failToParse(),i("start = [\n]").to.failToParse()}),it("parses LineContinuation",function(){i("start = '\\\r\n'").to.parseAs(L("",!1))}),it("parses EscapeSequence",function(){i("start = '\\n'").to.parseAs(L("\n",!1)),i("start = '\\0'").to.parseAs(L("\0",!1)),i("start = '\\xFF'").to.parseAs(L("ÿ",!1)),i("start = '\\uFFFF'").to.parseAs(L("￿",!1)),i("start = '\\09'").to.failToParse()}),it("parses CharacterEscapeSequence",function(){i("start = '\\n'").to.parseAs(L("\n",!1)),i("start = '\\a'").to.parseAs(L("a",!1))}),it("parses SingleEscapeCharacter",function(){i("start = '\\''").to.parseAs(L("'",!1)),i("start = '\\\"'").to.parseAs(L('"',!1)),i("start = '\\\\'").to.parseAs(L("\\",!1)),i("start = '\\b'").to.parseAs(L("\b",!1)),i("start = '\\f'").to.parseAs(L("\f",!1)),i("start = '\\n'").to.parseAs(L("\n",!1)),i("start = '\\r'").to.parseAs(L("\r",!1)),i("start = '\\t'").to.parseAs(L("\t",!1)),i("start = '\\v'").to.parseAs(L("\v",!1))}),it("parses NonEscapeCharacter",function(){i("start = '\\a'").to.parseAs(L("a",!1))}),it("parses HexEscapeSequence",function(){i("start = '\\xFF'").to.parseAs(L("ÿ",!1))}),it("parses UnicodeEscapeSequence",function(){i("start = '\\uFFFF'").to.parseAs(L("￿",!1))}),it("parses AnyMatcher",function(){i("start = .").to.parseAs(H())}),it("parses CodeBlock",function(){i("start = 'abcd' { code }").to.parseAs(R(" code "))}),it("parses Code",function(){i("start = 'abcd' {a}").to.parseAs(R("a")),i("start = 'abcd' {abc}").to.parseAs(R("abc")),i("start = 'abcd' {{a}}").to.parseAs(R("{a}")),i("start = 'abcd' {{a}{b}{c}}").to.parseAs(R("{a}{b}{c}")),i("start = 'abcd' {{}").to.failToParse(),i("start = 'abcd' {}}").to.failToParse()}),it("parses __",function(){i("start ='abcd'").to.parseAs(V),i("start = 'abcd'").to.parseAs(V),i("start =\r\n'abcd'").to.parseAs(V),i("start =/* comment */'abcd'").to.parseAs(V),i("start = 'abcd'").to.parseAs(V)}),it("parses _",function(){i("a = 'abcd'\r\nb = 'efgh'").to.parseAs(G),i("a = 'abcd' \r\nb = 'efgh'").to.parseAs(G),i("a = 'abcd'/* comment */\r\nb = 'efgh'").to.parseAs(G),i("a = 'abcd' \r\nb = 'efgh'").to.parseAs(G)}),it("parses EOS",function(){i("a = 'abcd'\n;b = 'efgh'").to.parseAs(G),i("a = 'abcd' \r\nb = 'efgh'").to.parseAs(G),i("a = 'abcd' // comment\r\nb = 'efgh'").to.parseAs(G),i("a = 'abcd'\nb = 'efgh'").to.parseAs(G)}),it("parses EOF",function(){i("start = 'abcd'\n").to.parseAs(V)}),it("reports unmatched brace",function(){i(function(){return r.parse("rule = \n 'x' { y \n z")}).to.throw("Unbalanced brace.").with.property("location").that.deep.equals({start:{offset:13,line:2,column:6},end:{offset:14,line:2,column:7}})})})}])}); \ No newline at end of file