UNPKG

260 kBJavaScriptView Raw
1/*!
2 * Copyright (c) 2013 Sune Simonsen <sune@we-knowhow.dk>
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the 'Software'), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("os")):"function"==typeof define&&define.amd?define(["os"],e):((t=t||self).weknowhow=t.weknowhow||{},t.weknowhow.expect=e(t.os))}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e=function(t){this.text=t},n=function(t,n,r,i,o){void 0===o&&(o={});var s=t.clone();n&&n.call(s,s);var a=t.clone();if("function"==typeof i)i.call(a,a);else if(i.length>0){var u=!1;i.forEach((function(t,n){var r=t&&"object"==typeof t&&t instanceof e;n>0&&(r||u||a.text(","),a.sp()),r?a.error(t.text):t.call(a,a),u=r}))}var c=s.size(),l=a.size(),f="expected".length+c.width+l.width+r.length,h=Math.max(c.height,l.height);if("omitSubject"in t&&t.omitSubject===o.subject){var p=/^(not )?to (.*)/.exec(r);p?(t.error("should "),p[1]&&t.error("not "),r=p[2]):r="expected: "+r}else o.compact&&o.compactSubject&&(c.height>1||c.width>(o.compactWidth||35))?(t.error("expected").sp(),o.compactSubject.call(t,t),t.sp()):(t.error("expected"),c.height>1?t.nl():t.sp(),t.append(s),c.height>1||1===h&&f>t.preferredWidth?t.nl():t.sp());return t.error(r),l.height>1?t.nl():l.width>0&&t.sp(),t.append(a),t},r="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}var s=i,a=o;function u(t){if(s===setTimeout)return setTimeout(t,0);if((s===i||!s)&&setTimeout)return s=setTimeout,setTimeout(t,0);try{return s(t,0)}catch(e){try{return s.call(null,t,0)}catch(e){return s.call(this,t,0)}}}"function"==typeof r.setTimeout&&(s=setTimeout),"function"==typeof r.clearTimeout&&(a=clearTimeout);var c,l=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?l=c.concat(l):h=-1,l.length&&d())}function d(){if(!f){var t=u(p);f=!0;for(var e=l.length;e;){for(c=l,l=[];++h<e;)c&&c[h].run();h=-1,e=l.length}c=null,f=!1,function(t){if(a===clearTimeout)return clearTimeout(t);if((a===o||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(t);try{a(t)}catch(e){try{return a.call(null,t)}catch(e){return a.call(this,t)}}}(t)}}function y(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new g(t,e)),1!==l.length||f||u(d)}function g(t,e){this.fun=t,this.array=e}g.prototype.run=function(){this.fun.apply(null,this.array)};function v(){}var m=v,b=v,_=v,w=v,E=v,x=v,A=v;var F=r.performance||{},j=F.now||F.mozNow||F.msNow||F.oNow||F.webkitNow||function(){return(new Date).getTime()};var k=new Date;var C={nextTick:y,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:m,addListener:b,once:_,off:w,removeListener:E,removeAllListeners:x,emit:A,binding:function(t){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(t){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*j.call(F),n=Math.floor(e),r=Math.floor(e%1*1e9);return t&&(n-=t[0],(r-=t[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-k)/1e3}},T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(t,e){return t(e={exports:{}},e.exports),e.exports}for(var O={intersects:function(t,e){return t.start<e.end&&e.start<t.end||t.start===e.start},intersectsWithSome:function(t,e){return t.some((function(t){return O.intersects(e,t)}))}},P=function(t,e){var n=e.start-t.start;return 0!==n?n:t.end-t.start-(e.end-e.start)},R=O.intersectsWithSome,D=S((function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array,n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r=t.exports={objectIs:Object.is||function(t,e){return 0===t&&0===e?1/t==1/e:t!=t?e!=e:t===e},checkObjectEqualityUsingType:function(t,e,n,r){if(t===e)return!0;if(e.constructor!==t.constructor)return!1;var i=n.getKeys(t).filter((function(e){return void 0!==n.valueForKey(t,e)})),o=n.getKeys(e).filter((function(t){return void 0!==n.valueForKey(e,t)}));if(i.length!==o.length)return!1;i.sort(n.keyComparator),o.sort(n.keyComparator);for(var s=0;s<i.length;s+=1)if(i[s]!==o[s])return!1;for(var a=0;a<i.length;a+=1){var u=i[a];if(!r(n.valueForKey(t,u),n.valueForKey(e,u)))return!1}return!0},duplicateArrayLikeUsingType:function(t,e){var n=e.getKeys(t),i=n.length;if(!e.numericalPropertiesOnly){for(var o=0,s=n.length-1;s>-1;s-=1){var a=n[s];if("symbol"!=typeof a&&r.numericalRegExp.test(a))break;o+=1}i-=o}var u=new Array(i);return n.forEach((function(n,r){r>=i&&!e.hasKey(t,n)||(u[n]=e.hasKey(t,n)?e.valueForKey(t,n):void 0)})),u},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},isPromise:function(t){return t&&"function"==typeof t.then},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},isError:function(t){return"object"==typeof t&&("[object Error]"===Object.prototype.toString.call(t)||t instanceof Error)},extend:function(t){for(var e=arguments,n=function(n){var r=e[n];r&&Object.keys(r).forEach((function(e){t[e]=r[e]}))},r=1;r<arguments.length;r+=1)n(r);return t},findFirst:function(t,e){for(var n=0;n<t.length;n+=1)if(e(t[n]))return t[n];return null},leftPad:function(t,e,n){for(void 0===n&&(n=" ");t.length<e;)t=n+t;return t},escapeRegExpMetaChars:function(t){return t.replace(/[[\]{}()*+?.\\^$|]/g,"\\$&")},escapeChar:function(t){if("\t"===t)return"\\t";if("\r"===t)return"\\r";var e=t.charCodeAt(0),n=e.toString(16).toUpperCase();return e<256?"\\x"+r.leftPad(n,2,"0"):"\\u"+r.leftPad(n,4,"0")},getFunctionName:function(t){if("string"==typeof t.name)return t.name;var e=Function.prototype.toString.call(t).match(/function ([^(]+)/);return e?e[1]:t===Object?"Object":t===Function?"Function":""},wrapConstructorNameAroundOutput:function(t,e){var n=e.constructor,i=n&&n!==Object&&r.getFunctionName(n);return i&&"Object"!==i?t.clone().text(i+"(").append(t).text(")"):t},setPrototypeOfOrExtend:e?n:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},uniqueStringsAndSymbols:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];"function"==typeof e[0]&&(t=e[0]);var r={},i=[];function o(e){Array.isArray(e)?e.forEach(o):Object.prototype.hasOwnProperty.call(r,e)||t&&!t(e)||(r[e]=!0,i.push(e))}for(var s=t?1:0;s<e.length;s+=1)o(e[s]);return i},uniqueNonNumericalStringsAndSymbols:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return r.uniqueStringsAndSymbols((function(t){return"symbol"==typeof t||!r.numericalRegExp.test(t)}),Array.prototype.slice.call(t))},forwardFlags:function(t,e){return t.replace(/\[(!?)([^\]]+)\] ?/g,(function(t,n,r){return Boolean(e[r])!==Boolean(n)?r+" ":""})).trim()},numericalRegExp:/^(?:0|[1-9][0-9]*)$/,packArrows:function(t){var e={};t.forEach((function(t,n){"moveSource"===t.type?(t.changeIndex=n,(e[t.actualIndex]=e[t.actualIndex]||{}).source=t):"moveTarget"===t.type&&(t.changeIndex=n,(e[t.actualIndex]=e[t.actualIndex]||{}).target=t)}));var n=Object.keys(e);if(n.length>0){var r=[];n.sort((function(t,n){return Math.abs(e[n].source.changeIndex-e[n].target.changeIndex)-Math.abs(e[t].source.changeIndex-e[t].target.changeIndex)})).forEach((function(t,n,i){var o=e[t],s=Math.min(o.source.changeIndex,o.target.changeIndex),a=Math.max(o.source.changeIndex,o.target.changeIndex);r.push({start:s,end:a,direction:o.source.changeIndex<o.target.changeIndex?"down":"up"})}));for(var i=function(t,e){if(e=e||{},!Array.isArray(t))throw new Error("The interval packer requires an array of objects with start and end properties.");if(0===t.length)return[];var n;t.forEach((function(t){if("object"!=typeof t||"number"!=typeof t.start||"number"!=typeof t.end||t.end<=t.start)throw new Error("Intervals must be objects with integer properties start and end where start < end.")})),t=[].concat(t).sort(P);for(var r=[],i=-1/0;t.length>0;){var o=t.pop();i<=o.start&&(n=[[]],r.push(n));for(var s=0;s<n.length&&R(n[s],o);)s+=1;(n[s]=n[s]||[]).push(o),i=Math.max(i,o.end)}return e.groupPartitions?r:r.reduce((function(t,e){return e.forEach((function(e,n){return t[n]=t[n]||[],Array.prototype.push.apply(t[n],e),t})),t}),[])}(r);i.length>3;)i.shift().forEach((function(e){var n=e.direction,r=e.start,i=e.end;t["up"===n?r:i].type="insert",t["up"===n?i:r].type="remove"}));return i}},truncateSubjectStringForBegin:function(t,e){var n=e.length+25;if(t.length<=n)return null;var r=t.indexOf(" ",e.length+1);return r>-1&&r<n?t.substring(0,r):t.substring(0,n)},truncateSubjectStringForEnd:function(t,e){var n=t.length-e.length-25;if(n<=0)return null;var r=t.lastIndexOf(" ",e.length+1);return r>-1&&r>=n?t.substring(r+1,t.length):t.substring(n,t.length)},getEnv:function(t){if("object"==typeof Deno)try{return Deno.env()[t]}catch(t){}else if("object"==typeof C&&C.env)return C.env[t]}}})),M=(D.objectIs,D.checkObjectEqualityUsingType,D.duplicateArrayLikeUsingType,D.isArray,D.isPromise,D.isRegExp,D.isError,D.extend,D.findFirst,D.leftPad,D.escapeRegExpMetaChars,D.escapeChar,D.getFunctionName,D.wrapConstructorNameAroundOutput,D.setPrototypeOfOrExtend,D.uniqueStringsAndSymbols,D.uniqueNonNumericalStringsAndSymbols,D.forwardFlags,D.numericalRegExp,D.packArrows,D.truncateSubjectStringForBegin,D.truncateSubjectStringForEnd,D.getEnv,{extend:function(t){for(var e=1;e<arguments.length;e+=1){var n=arguments[e];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},calculateOutputEntrySize:function(t){if(t.size)return t.size;var e;switch(t.style){case"text":e={width:String(t.args.content).length,height:1};break;case"block":e=M.calculateSize(t.args);break;case"raw":var n=t.args;e={width:n.width,height:n.height};break;default:e={width:0,height:0}}return t.size=e,e},calculateLineSize:function(t){var e={height:1,width:0};return t.forEach((function(t){var n=M.calculateOutputEntrySize(t);e.width+=n.width,e.height=Math.max(n.height,e.height)})),e},calculateSize:function(t){var e={height:0,width:0};return t.forEach((function(t){var n=M.calculateLineSize(t);e.height+=n.height,e.width=Math.max(e.width,n.width)})),e},arrayEquals:function(t,e){if(t===e)return!0;if(!t||t.length!==e.length)return!1;for(var n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0},escapeRegExp:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},findFirst:function(t,e,n){for(var r=n||null,i=0;i<t.length;i+=1)if(e.call(r,t[i],i,t))return t[i];return null},getFunctionName:function(t){if("string"==typeof t.name)return t.name;var e=Function.prototype.toString.call(t).match(/function ([^\(]+)/);return e?e[1]:t===Object?"Object":t===Function?"Function":void 0}}),B=M,I=[""],L=1;L<=256;L+=1)I[L]=I[L-1]+" ";var N=function(t,e){if(e<0)return"";var n="";if(" "===t){if(e<=256)return I[e];for(var r=I[256],i=Math.floor(e/256),o=0;o<i;o+=1)n+=r;n+=I[e%256]}else for(var s=0;s<e;s+=1)n+=t;return n},U=/^(?:bg)?#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,z={bold:"font-weight: bold",dim:"opacity: 0.7",italic:"font-style: italic",underline:"text-decoration: underline",inverse:"-webkit-filter: invert(%100); filter: invert(100%)",hidden:"visibility: hidden",strikeThrough:"text-decoration: line-through",black:"color: black",red:"color: red",green:"color: green",yellow:"color: yellow",blue:"color: blue",magenta:"color: magenta",cyan:"color: cyan",white:"color: white",gray:"color: gray",bgBlack:"background-color: black",bgRed:"background-color: red",bgGreen:"background-color: green",bgYellow:"background-color: yellow",bgBlue:"background-color: blue",bgMagenta:"background-color: magenta",bgCyan:"background-color: cyan",bgWhite:"background-color: white"};Object.keys(z).forEach((function(t){z[t.toLowerCase()]=z[t]}));var q,H=z,K=!(void 0===C||!C.versions||!C.versions.node),W=function(){if("undefined"!=typeof Deno){var e={};try{e=Deno.env()}catch(t){}return{argv:Deno.args,color:Deno.noColor?0:1,env:e,runtime:"deno"}}if(K){var n=t;return{argv:C.argv,env:C.env,runtime:"node",getNodeRelease:n.release}}return{argv:[],env:{},runtime:"browser"}}(),$=function(t,e){e=e||W.argv;var n=0===t.indexOf("-")?"":1===t.length?"-":"--",r=e.indexOf(n+t),i=e.indexOf("--");return-1!==r&&(-1===i||r<i)},Y=W.env;function V(t){return function(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(function(t){if(0===q)return 0;if($("color=16m")||$("color=full")||$("color=truecolor"))return 3;if($("color=256"))return 2;if(t&&!t.isTTY&&void 0===q)return 0;var e=q||0;if("dumb"===Y.TERM)return e;if("node"===W.runtime&&"win32"===C.platform){var n=W.getNodeRelease().split(".");return Number(C.versions.node.split(".")[0])>=8&&Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Y)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((function(t){return t in Y}))||"codeship"===Y.CI_NAME?1:e;if("TEAMCITY_VERSION"in Y)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Y.TEAMCITY_VERSION)?1:0;if("truecolor"===Y.COLORTERM)return 3;if("TERM_PROGRAM"in Y){var r=parseInt((Y.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Y.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Y.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Y.TERM)?1:"COLORTERM"in Y?1:e}(t))}$("no-color")||$("no-colors")||$("color=false")||$("color=never")?q=0:$("color")||$("colors")||$("color=true")||$("color=always")?q=1:"deno"===W.runtime&&(q=W.color),"FORCE_COLOR"in Y&&(q="true"===Y.FORCE_COLOR?1:"false"===Y.FORCE_COLOR?0:0===Y.FORCE_COLOR.length?1:Math.min(parseInt(Y.FORCE_COLOR,10),3));var J=V(C.stdout);V(C.stderr);function Q(t){if(0===t.length)return[[]];if(!function(t){return t.some((function(t){return"block"===t.style||"text"===t.style&&-1!==String(t.args.content).indexOf("\n")}))}(t))return[t];var e=[],n=[],r=0;return t.forEach((function(t,i){var o=function(t){switch(t.style){case"text":return String(t.args.content).split("\n").map((function(e){return""===e?[]:[{style:"text",args:{content:e,styles:t.args.styles},themes:t.themes}]}));case"block":return G(t.args);default:return[]}}(t),s=o.map((function(t){return B.calculateLineSize(t).width})),a=Math.max.apply(null,s);o.forEach((function(i,o){var a,u,c=e[o];if(c||(e[o]=c=[],n[o]=0),i.length){var l=r-n[o];c.push((a=l,u=t.themes,{style:"text",args:{content:N(" ",a),styles:[]},themes:u})),Array.prototype.push.apply(c,i),n[o]=r+s[o]}})),r+=a}),this),e}function G(t){var e=[];return t.forEach((function(t){Q(t).forEach((function(t){e.push(t)}))})),e}var X=G;function Z(){}Z.prototype.format="text",Z.prototype.serialize=function(t){return(t=X(t)).map(this.serializeLine,this).join("\n")},Z.prototype.serializeLine=function(t){return t.map((function(t){return this[t.style]?String(this[t.style](t.args,t.themes)):""}),this).join("")},Z.prototype.text=function(t){return String(t.content)},Z.prototype.block=function(t){return this.serialize(t)},Z.prototype.raw=function(t){return String(t.content(this))};var tt=Z,et=function(t,e){if(1===e.length){for(var n=0,r=[],i=e[0],o=t.styles||{};"string"==typeof i&&o[i];)if(i=o[i],(n+=1)>100){var s=r.indexOf(i);if(r.push(i),-1!==s)throw new Error("Your theme contains a loop: "+r.slice(s).join(" -> "))}return Array.isArray(i)?i:[i]}return e};function nt(){}nt.prototype.format="html",nt.prototype.serialize=function(t){return'<div style="font-family: monospace; white-space: nowrap">'+this.serializeLines(t)+"</div>"},nt.prototype.serializeLines=function(t){return t.map((function(t){return"<div>"+(this.serializeLine(t).join("")||"&nbsp;")+"</div>"}),this).join("")},nt.prototype.serializeLine=function(t){return t.map((function(t){return this[t.style]?this[t.style](t.args,t.themes):""}),this)},nt.prototype.block=function(t){return'<div style="display: inline-block; vertical-align: top">'+this.serializeLines(t)+"</div>"},nt.prototype.text=function(t,e){var n=String(t.content);if(""===n)return"";n=n.replace(/&/g,"&amp;").replace(/ /g,"&nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");var r=et(e.html||{},t.styles);if(r.length>0){for(var i=[],o=0;o<r.length;o+=1){var s=r[o];U.test(s)?"bg"===s.substring(0,2)?i.push("background-color: "+s.substring(2)):i.push("color: "+s):H[s]&&i.push(H[s])}i.length>0&&(n='<span style="'+i.join("; ")+'">'+n+"</span>")}return n},nt.prototype.raw=function(t){return String(t.content(this))};var rt=nt,it=function(t,e){var n=t.L,r=t.a,i=t.b,o=e.L,s=e.a,a=e.b,u=ot(st(r,2)+st(i,2)),c=ot(st(s,2)+st(a,2)),l=(u+c)/2,f=.5*(1-ot(st(l,7)/(st(l,7)+st(25,7)))),h=(1+f)*r,p=(1+f)*s,d=ot(st(h,2)+st(i,2)),y=ot(st(p,2)+st(a,2)),g=function(t,e){if(0==t&&0==e)return 0;var n=ut(t,e)*(180/ht);return n>=0?n:n+360},v=g(i,h),m=g(a,p),b=o-n,_=y-d,w=function(t,e,n,r){if(t*e==0)return 0;if(lt(r-n)<=180)return r-n;if(r-n>180)return r-n-360;if(r-n<-180)return r-n+360;throw new Error}(u,c,v,m),E=2*ot(d*y)*ct(pt(w)/2),x=(n+o)/2,A=(d+y)/2,F=function(t,e,n,r){if(t*e==0)return n+r;if(lt(n-r)<=180)return(n+r)/2;if(lt(n-r)>180&&n+r<360)return(n+r+360)/2;if(lt(n-r)>180&&n+r>=360)return(n+r-360)/2;throw new Error}(u,c,v,m),j=1-.17*at(pt(F-30))+.24*at(pt(2*F))+.32*at(pt(3*F+6))-.2*at(pt(4*F-63)),k=30*ft(-st((F-275)/25,2)),C=ot(st(A,7)/(st(A,7)+st(25,7))),T=1+.015*st(x-50,2)/ot(20+st(x-50,2)),S=1+.045*A,O=1+.015*A*j,P=-2*C*ct(pt(2*k));return ot(st(b/(1*T),2)+st(_/(1*S),2)+st(E/(1*O),2)+P*(_/(1*S))*(E/(1*O)))},ot=Math.sqrt,st=Math.pow,at=Math.cos,ut=Math.atan2,ct=Math.sin,lt=Math.abs,ft=Math.exp,ht=Math.PI;
25/**
26 * @author Markus Ekholm
27 * @copyright 2012-2015 (c) Markus Ekholm <markus at botten dot org >
28 * @license Copyright (c) 2012-2015, Markus Ekholm
29 * All rights reserved.
30 * Redistribution and use in source and binary forms, with or without
31 * modification, are permitted provided that the following conditions are met:
32 * * Redistributions of source code must retain the above copyright
33 * notice, this list of conditions and the following disclaimer.
34 * * Redistributions in binary form must reproduce the above copyright
35 * notice, this list of conditions and the following disclaimer in the
36 * documentation and/or other materials provided with the distribution.
37 * * Neither the name of the <organization> nor the
38 * names of its contributors may be used to endorse or promote products
39 * derived from this software without specific prior written permission.
40 *
41 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
43 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
44 * DISCLAIMED. IN NO EVENT SHALL MARKUS EKHOLM BE LIABLE FOR ANY
45 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
46 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
50 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51 */function pt(t){return t*(ht/180)}var dt={ciede2000:it},yt=function(t){return function(t){var e=t.Y/100,n=t.Z/108.883,r=t.X/95.047;r=r>.008856?gt(r,1/3):7.787*r+16/116;e=e>.008856?gt(e,1/3):7.787*e+16/116;n=n>.008856?gt(n,1/3):7.787*n+16/116;return{L:116*e-16,a:500*(r-e),b:200*(e-n)}}(function(t){var e=t.R/255,n=t.G/255,r=t.B/255;e>.04045?e=gt((e+.055)/1.055,2.4):e/=12.92;n>.04045?n=gt((n+.055)/1.055,2.4):n/=12.92;r>.04045?r=gt((r+.055)/1.055,2.4):r/=12.92;return{X:.4124*(e*=100)+.3576*(n*=100)+.1805*(r*=100),Y:.2126*e+.7152*n+.0722*r,Z:.0193*e+.1192*n+.9505*r}}(t))},gt=Math.pow;
52/**
53 * @author Markus Ekholm
54 * @copyright 2012-2015 (c) Markus Ekholm <markus at botten dot org >
55 * @license Copyright (c) 2012-2015, Markus Ekholm
56 * All rights reserved.
57 * Redistribution and use in source and binary forms, with or without
58 * modification, are permitted provided that the following conditions are met:
59 * * Redistributions of source code must retain the above copyright
60 * notice, this list of conditions and the following disclaimer.
61 * * Redistributions in binary form must reproduce the above copyright
62 * notice, this list of conditions and the following disclaimer in the
63 * documentation and/or other materials provided with the distribution.
64 * * Neither the name of the <organization> nor the
65 * names of its contributors may be used to endorse or promote products
66 * derived from this software without specific prior written permission.
67 *
68 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
69 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
70 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
71 * DISCLAIMED. IN NO EVENT SHALL MARKUS EKHOLM BE LIABLE FOR ANY
72 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
73 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
74 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
75 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
76 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
77 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
78 */var vt={rgb_to_lab:yt};
79/**
80 * @author Markus Ekholm
81 * @copyright 2012-2015 (c) Markus Ekholm <markus at botten dot org >
82 * @license Copyright (c) 2012-2015, Markus Ekholm
83 * All rights reserved.
84 * Redistribution and use in source and binary forms, with or without
85 * modification, are permitted provided that the following conditions are met:
86 * * Redistributions of source code must retain the above copyright
87 * notice, this list of conditions and the following disclaimer.
88 * * Redistributions in binary form must reproduce the above copyright
89 * notice, this list of conditions and the following disclaimer in the
90 * documentation and/or other materials provided with the distribution.
91 * * Neither the name of the <organization> nor the
92 * names of its contributors may be used to endorse or promote products
93 * derived from this software without specific prior written permission.
94 *
95 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
96 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
97 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
98 * DISCLAIMED. IN NO EVENT SHALL MARKUS EKHOLM BE LIABLE FOR ANY
99 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
100 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
101 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
102 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
103 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
104 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
105 */function mt(t){return"R"+t.R+"B"+t.B+"G"+t.G}function bt(t,e){return t=vt.rgb_to_lab(t),e=vt.rgb_to_lab(e),dt.ciede2000(t,e)}var _t={map_palette:function(t,e,n){var r={};n=n||"closest";for(var i=0;i<t.length;i+=1){for(var o=t[i],s=void 0,a=void 0,u=0;u<e.length;u+=1){var c=e[u],l=bt(o,c);null==s||"closest"===n&&l<a?(s=c,a=l):"furthest"===n&&l>a&&(s=c,a=l)}r[mt(o)]=s}return r},palette_map_key:mt},wt=S((function(t){var e=t.exports={};e.diff=dt.ciede2000,e.rgb_to_lab=vt.rgb_to_lab,e.map_palette=_t.map_palette,e.palette_map_key=_t.palette_map_key,e.closest=function(t,n){var r=e.palette_map_key(t);return e.map_palette([t],n,"closest")[r]},e.furthest=function(t,n){var r=e.palette_map_key(t);return e.map_palette([t],n,"furthest")[r]}})),Et=S((function(t){var e=t.exports={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};e.colors.grey=e.colors.gray,Object.keys(e).forEach((function(t){var n=e[t];Object.keys(n).forEach((function(t){var r=n[t];e[t]=n[t]={open:"["+r[0]+"m",close:"["+r[1]+"m"}})),Object.defineProperty(e,t,{value:n,enumerable:!1})}))})),xt=(Et.modifiers,Et.colors,Et.bgColors,0),At=B.extend({},Et);function Ft(){}Object.keys(At).forEach((function(t){At[t.toLowerCase()]=At[t]})),Ft.prototype=new tt,Ft.prototype.format="ansi";var jt={16:{"#000000":"black","#ff0000":"red","#00ff00":"green","#ffff00":"yellow","#0000ff":"blue","#ff00ff":"magenta","#00ffff":"cyan","#ffffff":"white","#808080":"gray"},256:{}},kt={};function Ct(t){t.length<6&&(t=t.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var e=t.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(e)return{R:parseInt(e[1],16),G:parseInt(e[2],16),B:parseInt(e[3],16)}}function Tt(t){var e=(65536*Math.round(t.R)+256*Math.round(t.G)+Math.round(t.B)).toString(16);return"#"+"00000".substr(0,6-e.length)+e}kt[16]=Object.keys(jt[16]).map(Ct),kt.bg16=Object.keys(jt[16]).filter((function(t){return"#808080"!==t})).map(Ct),kt[256]=[].concat(kt[16]);var St=16;function Ot(t){kt[256].push(t),jt[256][Tt(t)]=St,St+=1}for(var Pt=0;Pt<6;Pt+=1)for(var Rt=0;Rt<6;Rt+=1)for(var Dt=0;Dt<6;Dt+=1)Ot({R:Math.round(256*Pt/6),G:Math.round(256*Rt/6),B:Math.round(256*Dt/6)});[8,18,28,38,48,58,68,78,88,96,102,118,128,138,148,158,168,178,188,198,208,218,228,238].forEach((function(t){Ot({R:t,G:t,B:t})})),Ft.prototype.text=function(t,e){var n=String(t.content);if(""===n)return"";var r,i=et(e.ansi||{},t.styles);if(i.length>0)for(var o=i.length-1;o>=0;o-=1){var s=i[o];if(At[s])n=At[s].open+n+At[s].close;else if(U.test(s)){var a=s,u="bg"===s.substring(0,2),c=u?s.substring(2):s,l=Tt(wt.closest(Ct(c),kt[u?"bg16":16])),f=jt[16][l],h=Tt(wt.closest(Ct(c),kt[256])),p=jt[256][h];s=u?"bg"+((r=f).substring(0,1).toUpperCase()+r.substring(1)):f;var d=At[s].open,y=At[s].close;l!==h&&(d+="["+(u?48:38)+";5;"+p+"m"),xt<1024&&(At[a]={open:d,close:y},xt+=1),n=d+n+y}}return n};var Mt=Ft;function Bt(){}Bt.prototype.format="coloredConsole",Bt.prototype.serialize=function(t){var e="",n=[];return this.serializeLines(X(t)).forEach((function(t){t&&(e+=t[0],t.length>1&&n.push(t[1]))})),[e].concat(n)},Bt.prototype.serializeLines=function(t){var e=[];return t.forEach((function(t,n){n>0&&e.push(["%c\n ",""]),Array.prototype.push.apply(e,this.serializeLine(t))}),this),e},Bt.prototype.serializeLine=function(t){var e=[];return t.forEach((function(t){this[t.style]&&e.push(this[t.style](t.args,t.themes))}),this),e},Bt.prototype.block=function(t){return this.serializeLines(t)},Bt.prototype.text=function(t,e){var n=String(t.content);if(""===n)return"";var r=et(e.coloredConsole||{},t.styles),i=["%c"+n.replace(/%/g,"%%")],o=[];if(r.length>0)for(var s=0;s<r.length;s+=1){var a=r[s];U.test(a)?"bg"===a.substring(0,2)?o.push("background-color: "+a.substring(2)):o.push("color: "+a):H[a]&&o.push(H[a])}return i.push(o.join("; ")),i},Bt.prototype.raw=function(t){return String(t.content(this))};var It=Bt,Lt=S((function(t,e){var n=B.extend,r=["bold","dim","italic","underline","inverse","hidden","strikeThrough","black","red","green","yellow","blue","magenta","cyan","white","gray","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite"];function i(t){if(!(this instanceof i))return new i(t);"string"==typeof(t=t||{})&&(t={format:t});var e="indentationWidth"in t?t.indentationWidth:2;this.indentationWidth=Math.max(e,0),this.indentationLevel=0,this.output=[[]],this.styles=Object.create(null),this.installedPlugins=[],this._themes={},Object.keys(i.serializers).forEach((function(t){this._themes[t]={styles:{}}}),this),this.preferredWidth=80,t.format&&(this.format=t.format)}function o(t,e){return!(!t||!e||"text"!==t.style||"text"!==e.style)&&(B.arrayEquals(t.args.styles,e.args.styles)&&t.themes===e.themes)}function s(t){if(0===t.length)return t;for(var e=[t[0]],n=1;n<t.length;n+=1){var r=e[e.length-1],i=t[n];"text"===i.style&&""===i.args.content||(o(r,i)?e[e.length-1]={style:r.style,args:{content:r.args.content+i.args.content,styles:r.args.styles},themes:r.themes}:e.push(i))}return e}function a(t){return t&&"object"==typeof t&&"number"==typeof t.width&&"number"==typeof t.height&&("function"==typeof t.content||"string"==typeof t.content)}function u(t,e){var n=t[t.length-1].slice(),r=t.slice(0,-1),i=n[n.length-1];return i&&"block"===i.style?(n[n.length-1]={style:"block",args:u(i.args,e),themes:e._themes},r[t.length-1]=n):(Array.prototype.push.apply(n,e.output[0]),r[t.length-1]=s(n),r.push.apply(r,e.output.slice(1))),r}function c(t,e,n,r){var i=t;return e.forEach((function(e,o){o>0&&i.nl(),e.forEach((function(e,o){if("block"===e.style)return i.output[i.output.length-1].push({style:"block",args:c(t.clone(),e.args,n,r),themes:e.themes});if("text"!==e.style)return i.output[i.output.length-1].push(e);var s;n.global&&(n.lastIndex=0);for(var a=!0,u=0,l=e.args.content,f=e.args.styles;null!==(s=n.exec(l))&&(n.global||a);)u<s.index&&i.text.apply(i,[l.substring(u,s.index)].concat(f)),r.apply(i,[f].concat(s)),a=!1,u=s.index+s[0].length;0===u?(0===i.output.length?i.output[0]=[]:i.output[i.output.length-1]).push(e):u<l.length&&i.text.apply(i,[l.substring(u,l.length)].concat(f))}),this)}),this),i.output.map(s)}"string"!=typeof e.nodeName&&J?i.defaultFormat="ansi":"undefined"!=typeof window&&void 0!==window.navigator?window._phantom||window.mochaPhantomJS||window.__karma__&&window.__karma__.config.captureConsole?i.defaultFormat="ansi":i.defaultFormat="html":i.defaultFormat="text",i.prototype.newline=i.prototype.nl=function(t){if(void 0===t&&(t=1),0===t)return this;for(var e=0;e<t;e+=1)this.output.push([]);return this},i.serializers={},[tt,rt,Mt,It].forEach((function(t){i.serializers[t.prototype.format]=t})),i.prototype.write=function(t){if(this.styles[t.style])return this.styles[t.style].apply(this,t.args),this;var e=this.output[this.output.length-1],n=e[e.length-1];return o(n,t)?e[e.length-1]={style:n.style,args:{content:n.args.content+t.args.content,styles:n.args.styles},themes:this._themes}:e.push(t),this},i.prototype.indentLines=function(){return this.indentationLevel+=1,this},i.prototype.indent=i.prototype.i=function(){for(var t=0;t<this.indentationLevel;t+=1)this.space(this.indentationWidth);return this},i.prototype.outdentLines=function(){return this.indentationLevel=Math.max(0,this.indentationLevel-1),this},i.prototype.addStyle=function(t,e,n){if(!1===this[t]||(this.hasOwnProperty(t)||i.prototype[t])&&!Object.prototype.hasOwnProperty.call(this.styles,t)&&-1===r.indexOf(t))throw new Error('"'+t+'" style cannot be defined, it clashes with a built-in attribute');if((this.hasOwnProperty(t)||-1!==r.indexOf(t))&&("function"===typeof this[t]&&!n))throw new Error('"'+t+'" style is already defined, set 3rd arg (allowRedefinition) to true to define it anyway');return this._stylesHaveNotBeenClonedYet&&(this.styles=Object.create(this.styles),this._stylesHaveNotBeenClonedYet=!1),this.styles[t]=e,this[t]=function(){return e.apply(this,arguments),this},this},i.prototype.toString=function(t){if(t&&this.format&&t!==this.format)throw new Error("A pen with format: "+this.format+" cannot be serialized to: "+t);"auto"===(t=this.format||t||"text")&&(t=i.defaultFormat);this._themes[t];return(new i.serializers[t]).serialize(this.output)},i.prototype.text=function(){var t=arguments[0];if(""===t)return this;for(var e=new Array(arguments.length-1),n=1;n<arguments.length;n+=1)e[n-1]=arguments[n];if(-1!==(t=String(t)).indexOf("\n")){var r=t.split(/\n/);return r.forEach((function(t,n){t.length&&this.write({style:"text",args:{content:t,styles:e},themes:this._themes}),n<r.length-1&&this.nl()}),this),this}return this.write({style:"text",args:{content:t,styles:e},themes:this._themes})},i.prototype.removeFormatting=function(){var t=this.clone();return this.output.forEach((function(e,n){t.output[n]=s(e.map((function(t){return"text"===t.style?{style:"text",args:{content:t.args.content,styles:[]},themes:t.themes}:t})))})),t.indentationLevel=this.indentationLevel,t},i.prototype.getContentFromArguments=function(t){var e;if(t[0].isMagicPen)return this.ensureCompatibleFormat(t[0].format),t[0];if("function"==typeof t[0])return e=this.clone(),t[0].call(e,e),e;if("string"==typeof t[0]&&1===t.length)return(e=this.clone()).text(t[0]),e;if("string"==typeof t[0])return(e=this.clone())[t[0]].apply(e,Array.prototype.slice.call(t,1)),e;throw new Error("Requires the arguments to be:\na pen or\na callback appending content to a pen or\na style and arguments for that style or\njust a string.")},i.prototype.isMultiline=function(){return this.output.length>1||this.size().height>1},i.prototype.isAtStartOfLine=function(){return 0===this.output.length||0===this.output[this.output.length-1].length},i.prototype.isBlock=function(){return 1===this.output.length&&1===this.output[0].length&&"block"===this.output[0][0].style},i.prototype.ensureCompatibleFormat=function(t){if(t&&this.format&&t!==this.format)throw new Error("This pen is only compatible with the format: "+this.format)},i.prototype.block=function(){var t=this.getContentFromArguments(arguments),e=t.output.map((function(t){return[].concat(t)}));return this.write({style:"block",args:e,themes:this._themes})},i.prototype.alt=function(t){var e=this.format;if(!e)throw new Error("The alt method is only supported on a pen where the format has already been set");var n=t[e];return void 0===n?t.fallback?this.append(t.fallback):this:"string"==typeof n||a(n)?this.raw(n):this.append(n)},i.prototype.raw=function(t){if(!this.format)throw new Error("The raw method is only supported on a pen where the format has already been set");if("string"==typeof t)return this.write({style:"raw",args:{height:0,width:0,content:function(){return t}},themes:this._themes});if(a(t)){if("string"==typeof t.content){var e=(t=n({},t)).content;t.content=function(){return e}}return this.write({style:"raw",args:t,themes:this._themes})}throw new Error("Raw "+this.format+" content needs to adhere to one of the following forms:\na string of raw content\na function returning a string of raw content or\nan object with the following form { width: <number>, height: <number>, content: <string function() {}|string> }")},i.prototype.amend=function(){var t=this.getContentFromArguments(arguments);return t.isEmpty()?this:(this.output=u(this.output,t),this)},i.prototype.append=function(){var t=this.getContentFromArguments(arguments);if(t.isEmpty())return this;var e=this.output[this.output.length-1];return Array.prototype.push.apply(e,t.output[0]),this.output[this.output.length-1]=s(e),this.output.push.apply(this.output,t.output.slice(1)),this},i.prototype.prependLinesWith=function(){var t=this.getContentFromArguments(arguments);if(t.isEmpty())return this;if(t.output.length>1)throw new Error("PrependLinesWith only supports a pen with single line content");var e=this.size().height,n=this.clone();return n.block((function(){for(var n=0;n<e;n+=1)n>0&&this.nl(),this.append(t)})),n.block(this),this.output=n.output,this},i.prototype.space=i.prototype.sp=function(t){return 0===t?this:(void 0===t&&(t=1),this.text(N(" ",t)))},r.forEach((function(t){i.prototype[t]=i.prototype[t.toLowerCase()]=function(e){return this.text(e,t)}})),i.prototype.clone=function(t){function e(){}this.isEmpty()||this.ensureCompatibleFormat(t),e.prototype=this;var n=new e;return n.styles=this.styles,n._stylesHaveNotBeenClonedYet=!0,n.indentationLevel=0,n.output=[[]],n.installedPlugins=[],n._themes=this._themes,n._themesHaveNotBeenClonedYet=!0,n.format=t||this.format,n.parent=this,n},i.prototype.isMagicPen=!0,i.prototype.size=function(){return B.calculateSize(this.output)},i.prototype.use=function(t){var e=B.findFirst(this.installedPlugins,(function(e){if(e===t)return!0;if("function"==typeof t&&"function"==typeof e){var n=B.getFunctionName(t);return""!==n&&n===B.getFunctionName(e)}return e.name===t.name}));if(e){if(e===t||void 0!==t.version&&t.version===e.version)return this;throw new Error("Another instance of the plugin '"+t.name+"' is already installed"+(void 0!==e.version?" (version "+e.version+(void 0!==t.version?", trying to install "+t.version:"")+")":"")+". Please check your node_modules folder for unmet peerDependencies.")}if("function"!=typeof t&&("object"!=typeof t||"function"!=typeof t.installInto)||void 0!==t.name&&"string"!=typeof t.name||void 0!==t.dependencies&&!Array.isArray(t.dependencies))throw new Error("Plugins must be functions or adhere to the following interface\n{\n name: <an optional plugin name>,\n version: <an optional semver version string>,\n dependencies: <an optional list of dependencies>,\n installInto: <a function that will update the given magicpen instance>\n}");if(t.dependencies){var n=this,r=[];do{r.push(n),n=n.parent}while(n);var i=t.dependencies.filter((function(t){return!r.some((function(e){return e.installedPlugins.some((function(e){return e.name===t}))}))}));if(1===i.length)throw new Error(t.name+" requires plugin "+i[0]);if(i.length>1)throw new Error(t.name+" requires plugins "+i.slice(0,-1).join(", ")+" and "+i[i.length-1])}return this.installedPlugins.push(t),"function"==typeof t?t(this):t.installInto(this),this},i.prototype.installPlugin=i.prototype.use,i.prototype.isEmpty=function(){return 1===this.output.length&&0===this.output[0].length},i.prototype.replaceText=function(t,e){if(this.isEmpty())return this;if("string"==typeof t&&(t=new RegExp(B.escapeRegExp(t),"g")),"string"==typeof e){var n=e;e=function(t,e){var r=[n].concat(t);this.text.apply(this,r)}}return 1===arguments.length&&(e=t,t=/.*/),this.output=c(this.clone(),this.output,t,e),this},i.prototype.theme=function(t){if(!(t=t||this.format))throw new Error("Could not detect which format you want to retrieve theme information for. Set the format of the pen or provide it as an argument to the theme method.");return this._themes[t]},i.prototype.installTheme=function(t,e){var r=this;if(1===arguments.length&&(e=t,t=Object.keys(i.serializers)),"string"==typeof t&&(t=[t]),"object"!=typeof e||!Array.isArray(t)||t.some((function(t){return"string"!=typeof t})))throw new Error("Themes must be installed the following way:\nInstall theme for all formats: pen.installTheme({ comment: 'gray' })\nInstall theme for a specific format: pen.installTheme('ansi', { comment: 'gray' }) or\nInstall theme for a list of formats: pen.installTheme(['ansi', 'html'], { comment: 'gray' })");if(e.styles&&"object"==typeof e.styles||(e={styles:e}),r._themesHaveNotBeenClonedYet){var o={};Object.keys(r._themes).forEach((function(t){o[t]=Object.create(r._themes[t])})),r._themes=o,r._themesHaveNotBeenClonedYet=!1}return Object.keys(e.styles).forEach((function(t){if(U.test(t)||H[t])throw new Error("Invalid theme key: '"+t+"' you can't map build styles.");r[t]||r.addStyle(t,(function(e){this.text(e,t)}))})),t.forEach((function(t){var i=r._themes[t]||{styles:{}},o=n({},i,e);o.styles=n({},i.styles,e.styles),r._themes[t]=o})),this},t.exports=i}));var Nt,Ut=function(t,e,n){if(t===e)return 0;if(n="number"==typeof n?n:1/0,t.length>e.length){var r=t;t=e,e=r}for(var i=t.length,o=e.length;i>0&&t.charCodeAt(~-i)===e.charCodeAt(~-o);)i--,o--;if(0===i)return o<n?o:n;for(var s=0;s<i&&t.charCodeAt(s)===e.charCodeAt(s);)s++;if(o-=s,0===(i-=s))return o<n?o:n;var a=o-i;if((n=o<n?o:n)<a)return n;for(var u=2+((i<n?i:n)>>1),c=a+2*u+2,l=new Array(c),f=new Array(c),h=0;h<c;h++)l[h]=-1,f[h]=-1;for(var p=new Array(i),d=new Array(o),y=(h=0,s);h<i;h++,y++)p[h]=t.charCodeAt(y),d[h]=e.charCodeAt(y);for(;h<o;)d[h++]=e.charCodeAt(y++);h=0;var g=a+u,v=g<<1;do{var m,b;r=l;l=f,f=r;var _,w,E=-1;++h<=u?(m=1-h,_=h-2):_=l[u+(m=h-(u<<1)+1)],h<=g?(w=h,f[u+h]=-1):w=v-h;for(var x=m,A=m+u;x<w;x++,A++){for(b=E,y=(y=(y=(E=_)+1)<b?b:y)<(_=l[A+1])+1?_+1:y;y<i&&y+x<o&&p[y]===d[y+x];)y++;f[A]=y}}while(f[g]<i&&h<=n);return h-1},zt=S((function(t){var e=function(){return void 0===this}();if(e)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:e,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{var n={}.hasOwnProperty,r={}.toString,i={}.constructor.prototype,o=function(t){var e=[];for(var r in t)n.call(t,r)&&e.push(r);return e};t.exports={isArray:function(t){try{return"[object Array]"===r.call(t)}catch(t){return!1}},keys:o,names:o,defineProperty:function(t,e,n){return t[e]=n.value,t},getDescriptor:function(t,e){return{value:t[e]}},freeze:function(t){return t},getPrototypeOf:function(t){try{return Object(t).constructor.prototype}catch(t){return i}},isES5:e,propertyIsWritable:function(){return!0}}}})),qt=(zt.freeze,zt.defineProperty,zt.getDescriptor,zt.keys,zt.names,zt.getPrototypeOf,zt.isArray,zt.isES5,zt.propertyIsWritable,"undefined"==typeof navigator),Ht=function(){try{var t={};return zt.defineProperty(t,"f",{get:function(){return 3}}),3===t.f}catch(t){return!1}}(),Kt={e:{}};function Wt(){try{var t=Nt;return Nt=null,t.apply(this,arguments)}catch(t){return Kt.e=t,Kt}}function $t(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function Yt(t,e,n){if($t(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return zt.defineProperty(t,e,r),t}var Vt=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(zt.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=n(t)}catch(t){return r}for(var s=0;s<o.length;++s){var a=o[s];if(!i[a]){i[a]=!0;var u=Object.getOwnPropertyDescriptor(t,a);null!=u&&null==u.get&&null==u.set&&r.push(a)}}t=zt.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var i=[];t:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<t.length;++s)if(r.call(t[s],o))continue t;i.push(o)}return i}}(),Jt=/this\s*\.\s*\S+\s*=/;var Qt=/^[a-z$_][a-z$_0-9]*$/i;function Gt(t){try{return t+""}catch(t){return"[no string representation]"}}function Xt(t){return t instanceof Error&&zt.propertyIsWritable(t,"stack")}var Zt="stack"in new Error?function(t){return Xt(t)?t:new Error(Gt(t))}:function(t){if(Xt(t))return t;try{throw new Error(Gt(t))}catch(t){return t}};function te(t){return{}.toString.call(t)}var ee={isClass:function(t){try{if("function"==typeof t){var e=zt.names(t.prototype),n=zt.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=Jt.test(t+"")&&zt.names(t).length>0;if(n||r||i)return!0}return!1}catch(t){return!1}},isIdentifier:function(t){return Qt.test(t)},inheritedDataKeys:Vt,getDataPropertyOrDefault:function(t,e,n){if(!zt.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0},thrower:function(t){throw t},isArray:zt.isArray,haveGetters:Ht,notEnumerableProp:Yt,isPrimitive:$t,isObject:function(t){return!$t(t)},canEvaluate:qt,errorObj:Kt,tryCatch:function(t){return Nt=t,Wt},inherits:function(t,e){var n={}.hasOwnProperty;function r(){for(var r in this.constructor=t,this.constructor$=e,e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}return r.prototype=e.prototype,t.prototype=new r,t.prototype},withAppended:function(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;n<r;++n)i[n]=t[n];return i[n]=e,i},maybeWrapAsError:function(t){return $t(t)?new Error(Gt(t)):t},toFastProperties:function(t){return t},filledRange:function(t,e,n){for(var r=new Array(t),i=0;i<t;++i)r[i]=e+i+n;return r},toString:Gt,canAttachTrace:Xt,ensureErrorObject:Zt,originatesFromRejection:function(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===t.isOperational)},markAsOriginatingFromRejection:function(t){try{Yt(t,"isOperational",!0)}catch(t){}},classString:te,copyDescriptors:function(t,e,n){for(var r=zt.names(t),i=0;i<r.length;++i){var o=r[i];if(n(o))try{zt.defineProperty(e,o,zt.getDescriptor(t,o))}catch(t){}}},hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:void 0!==C&&"[object process]"===te(C).toLowerCase()};ee.isRecentNode=ee.isNode&&function(){var t=C.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}(),ee.isNode&&ee.toFastProperties(C);try{throw new Error}catch(t){ee.lastLineError=t}var ne,re=ee;if(re.isNode&&"undefined"==typeof MutationObserver){var ie=T.setImmediate,oe=y;ne=re.isRecentNode?function(t){ie.call(T,t)}:function(t){oe.call(C,t)}}else"undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?ne="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}:(ne=function(t){var e=document.createElement("div");return new MutationObserver(t).observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}}).isStatic=!0;var se=ne;function ae(t){this._capacity=t,this._length=0,this._front=0}ae.prototype._willBeOverCapacity=function(t){return this._capacity<t},ae.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1),this[this._front+e&this._capacity-1]=t,this._length=e+1},ae.prototype._unshiftOne=function(t){var e=this._capacity;this._checkCapacity(this.length()+1);var n=(this._front-1&e-1^e)-e;this[n]=t,this._front=n,this._length=this.length()+1},ae.prototype.unshift=function(t,e,n){this._unshiftOne(n),this._unshiftOne(e),this._unshiftOne(t)},ae.prototype.push=function(t,e,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(t),this._pushOne(e),void this._pushOne(n);var i=this._front+r-3;this._checkCapacity(r);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=n,this._length=r},ae.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},ae.prototype.length=function(){return this._length},ae.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},ae.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t,function(t,e,n,r,i){for(var o=0;o<i;++o)n[o+r]=t[o+e],t[o+e]=void 0}(this,0,this,e,this._front+this._length&e-1)};var ue,ce=ae;try{throw new Error}catch(t){ue=t}var le=se;function fe(){this._isTickUsed=!1,this._lateQueue=new ce(16),this._normalQueue=new ce(16),this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=le.isStatic?le(this.drainQueues):le}function he(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}function pe(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}function de(t){this._normalQueue._pushOne(t),this._queueTick()}fe.prototype.disableTrampolineIfNecessary=function(){re.hasDevTools&&(this._trampolineEnabled=!1)},fe.prototype.enableTrampoline=function(){this._trampolineEnabled||(this._trampolineEnabled=!0,this._schedule=function(t){setTimeout(t,0)})},fe.prototype.haveItemsQueued=function(){return this._normalQueue.length()>0},fe.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout((function(){t(e)}),0);else try{this._schedule((function(){t(e)}))}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},re.hasDevTools?(le.isStatic&&(le=function(t){setTimeout(t,0)}),fe.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?he.call(this,t,e,n):this._schedule((function(){setTimeout((function(){t.call(e,n)}),100)}))},fe.prototype.invoke=function(t,e,n){this._trampolineEnabled?pe.call(this,t,e,n):this._schedule((function(){t.call(e,n)}))},fe.prototype.settlePromises=function(t){this._trampolineEnabled?de.call(this,t):this._schedule((function(){t._settlePromises()}))}):(fe.prototype.invokeLater=he,fe.prototype.invoke=pe,fe.prototype.settlePromises=de),fe.prototype.invokeFirst=function(t,e,n){this._normalQueue.unshift(t,e,n),this._queueTick()},fe.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},fe.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},fe.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},fe.prototype._reset=function(){this._isTickUsed=!1};var ye=new fe,ge=ue;ye.firstLineError=ge;var ve,me,be=zt.freeze,_e=re.inherits,we=re.notEnumerableProp;function Ee(t,e){function n(r){if(!(this instanceof n))return new n(r);we(this,"message","string"==typeof r?r:e),we(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return _e(n,Error),n}var xe=Ee("Warning","warning"),Ae=Ee("CancellationError","cancellation error"),Fe=Ee("TimeoutError","timeout error"),je=Ee("AggregateError","aggregate error");try{ve=TypeError,me=RangeError}catch(t){ve=Ee("TypeError","type error"),me=Ee("RangeError","range error")}for(var ke="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),Ce=0;Ce<ke.length;++Ce)"function"==typeof Array.prototype[ke[Ce]]&&(je.prototype[ke[Ce]]=Array.prototype[ke[Ce]]);zt.defineProperty(je.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),je.prototype.isOperational=!0;var Te=0;function Se(t){if(!(this instanceof Se))return new Se(t);we(this,"name","OperationalError"),we(this,"message",t),this.cause=t,this.isOperational=!0,t instanceof Error?(we(this,"message",t.message),we(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}je.prototype.toString=function(){var t=Array(4*Te+1).join(" "),e="\n"+t+"AggregateError of:\n";Te++,t=Array(4*Te+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];e+=(r=i.join("\n"))+"\n"}return Te--,e},_e(Se,Error);var Oe=Error.__BluebirdErrorTypes__;Oe||(Oe=be({CancellationError:Ae,TimeoutError:Fe,OperationalError:Se,RejectionError:Se,AggregateError:je}),we(Error,"__BluebirdErrorTypes__",Oe));var Pe={Error:Error,TypeError:ve,RangeError:me,CancellationError:Oe.CancellationError,OperationalError:Oe.OperationalError,TimeoutError:Oe.TimeoutError,AggregateError:Oe.AggregateError,Warning:xe},Re=function(t,e){var n=re,r=n.errorObj,i=n.isObject;function o(t){return t.then}var s={}.hasOwnProperty;return function(a,u){if(i(a)){if(a instanceof t)return a;if(function(t){return s.call(t,"_promise0")}(a)){var c=new t(e);return a._then(c._fulfillUnchecked,c._rejectUncheckedCheckError,c._progressUnchecked,c,null),c}var l=n.tryCatch(o)(a);if(l===r){u&&u._pushContext();c=t.reject(l.e);return u&&u._popContext(),c}if("function"==typeof l)return function(i,o,s){var a=new t(e),u=a;s&&s._pushContext();a._captureStackTrace(),s&&s._popContext();var c=n.tryCatch(o).call(i,(function(t){if(!a)return;a._resolveCallback(t),a=null}),(function(t){if(!a)return;a._rejectCallback(t,!1,!0),a=null}),(function(t){if(!a)return;"function"==typeof a._progress&&a._progress(t)}));!1,a&&c===r&&(a._rejectCallback(c.e,!0,!0),a=null);return u}(a,l,u)}return a}},De=function(){var t,e=ye,n=re,r=/[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/,i=null,o=null,s=!1;function a(t){this._parent=t;var e=this._length=1+(void 0===t?0:t._length);d(this,a),e>32&&this.uncycle()}function u(t){for(var e=[],n=0;n<t.length;++n){var r=t[n],o=i.test(r)||" (No stack trace)"===r,a=o&&l(r);o&&!a&&(s&&" "!==r.charAt(0)&&(r=" "+r),e.push(r))}return e}function c(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){if(t.length<41)return t;return t.substr(0,38)+"..."}(e)+">, no stack trace)"}n.inherits(a,Error),a.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;for(r=(t=this._length=r)-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(r=0;r<t;++r){var s=n[e[r].stack];if(void 0!==s&&s!==r){s>0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var a=r>0?e[r-1]:this;s<t-1?(a._parent=e[s+1],a._parent.uncycle(),a._length=a._parent._length+1):(a._parent=void 0,a._length=1);for(var u=a._length+1,c=r-2;c>=0;--c)e[c]._length=u,u++;return}}}},a.prototype.parent=function(){return this._parent},a.prototype.hasParent=function(){return void 0!==this._parent},a.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=a.parseStackAndMessage(t),r=e.message,i=[e.stack],o=this;void 0!==o;)i.push(u(o.stack.split("\n"))),o=o._parent;!function(t){for(var e=t[0],n=1;n<t.length;++n){for(var r=t[n],i=e.length-1,o=e[i],s=-1,a=r.length-1;a>=0;--a)if(r[a]===o){s=a;break}for(a=s;a>=0;--a){var u=r[a];if(e[i]!==u)break;e.pop(),i--}e=r}}(i),function(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}(i),n.notEnumerableProp(t,"stack",function(t,e){for(var n=0;n<e.length-1;++n)e[n].push("From previous event:"),e[n]=e[n].join("\n");n<e.length&&(e[n]=e[n].join("\n"));return t+"\n"+e.join("\n")}(r,i)),n.notEnumerableProp(t,"__stackCleaned__",!0)}},a.parseStackAndMessage=function(t){var e=t.stack;return{message:t.toString(),stack:u(e="string"==typeof e&&e.length>0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){var r=e[n];if(" (No stack trace)"===r||i.test(r))break}return n>0&&(e=e.slice(n)),e}(t):[" (No stack trace)"])}},a.formatAndLogError=function(e,n){if("undefined"!=typeof console){var r;if("object"==typeof e||"function"==typeof e){var i=e.stack;r=n+o(i,e)}else r=n+String(e);"function"==typeof t?t(r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(r)}},a.unhandledRejection=function(t){a.formatAndLogError(t,"^--- With additional stack trace: ")},a.isSupported=function(){return"function"==typeof d},a.fireRejectionEvent=function(t,n,r,i){var o=!1;try{"function"==typeof n&&(o=!0,"rejectionHandled"===t?n(i):n(r,i))}catch(t){e.throwLater(t)}var s=!1;try{s=y(t,r,i)}catch(t){s=!0,e.throwLater(t)}var u=!1;if(p)try{u=p(t.toLowerCase(),{reason:r,promise:i})}catch(t){u=!0,e.throwLater(t)}s||o||u||"unhandledRejection"!==t||a.formatAndLogError(r,"Unhandled rejection ")};var l=function(){return!1},f=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function h(t){var e=t.match(f);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}a.setBounds=function(t,e){if(a.isSupported()){for(var n,i,o=t.stack.split("\n"),s=e.stack.split("\n"),u=-1,c=-1,f=0;f<o.length;++f){if(p=h(o[f])){n=p.fileName,u=p.line;break}}for(f=0;f<s.length;++f){var p;if(p=h(s[f])){i=p.fileName,c=p.line;break}}u<0||c<0||!n||!i||n!==i||u>=c||(l=function(t){if(r.test(t))return!0;var e=h(t);return!!(e&&e.fileName===n&&u<=e.line&&e.line<=c)})}};var p,d=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():c(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,i=t,o=e;var n=Error.captureStackTrace;return l=function(t){return r.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,n(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var a,u=new Error;if("string"==typeof u.stack&&u.stack.split("\n")[0].indexOf("stackDetection@")>=0)return i=/@/,o=e,s=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){a="stack"in t}return"stack"in u||!a||"number"!=typeof Error.stackTraceLimit?(o=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?c(e):e.toString()},null):(i=t,o=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}(),y=function(){if(n.isNode)return function(t,e,n){return"rejectionHandled"===t?C.emit(t,n):C.emit(t,e,n)};var t=!1,e=!0;try{var r=new self.CustomEvent("test");t=r instanceof CustomEvent}catch(t){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(t){e=!1}e&&(p=function(e,n){var r;return t?r=new self.CustomEvent(e,{detail:n,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(r=document.createEvent("CustomEvent")).initCustomEvent(e,!1,!0,n),!!r&&!self.dispatchEvent(r)});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,n){var r=o[t],i=self[r];return!!i&&("rejectionHandled"===t?i.call(self,n):i.call(self,e,n),!0)}}();return"undefined"!=typeof console&&void 0!==console.warn&&(t=function(t){console.warn(t)},n.isNode&&C.stderr.isTTY?t=function(t){C.stderr.write(""+t+"\n")}:n.isNode||"string"!=typeof(new Error).stack||(t=function(t){console.warn("%c"+t,"color: red")})),a},Me=re.maybeWrapAsError,Be=Pe.TimeoutError,Ie=Pe.OperationalError,Le=re.haveGetters;var Ne,Ue=/^(?:name|message|stack|cause)$/;function ze(t){var e;if(function(t){return t instanceof Error&&zt.getPrototypeOf(t)===Error.prototype}(t)){(e=new Ie(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var n=zt.keys(t),r=0;r<n.length;++r){var i=n[r];Ue.test(i)||(e[i]=t[i])}return e}return re.markAsOriginatingFromRejection(t),t}function qe(t){return function(e,n){if(null!==t){if(e){var r=ze(Me(e));t._attachExtraTrace(r),t._reject(r)}else if(arguments.length>2){for(var i=arguments.length,o=new Array(i-1),s=1;s<i;++s)o[s-1]=arguments[s];t._fulfill(o)}else t._fulfill(n);t=null}}}if(Ne=Le?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=qe(t),this.callback=this.asCallback},Le){var He={get:function(){return qe(this.promise)}};zt.defineProperty(Ne.prototype,"asCallback",He),zt.defineProperty(Ne.prototype,"callback",He)}Ne._nodebackForPromise=qe,Ne.prototype.toString=function(){return"[object PromiseResolver]"},Ne.prototype.resolve=Ne.prototype.fulfill=function(t){if(!(this instanceof Ne))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},Ne.prototype.reject=function(t){if(!(this instanceof Ne))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},Ne.prototype.progress=function(t){if(!(this instanceof Ne))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},Ne.prototype.cancel=function(t){this.promise.cancel(t)},Ne.prototype.timeout=function(){this.reject(new Be("timeout"))},Ne.prototype.isResolved=function(){return this.promise.isResolved()},Ne.prototype.toJSON=function(){return this.promise.toJSON()};var Ke=Ne,We=re.isPrimitive,$e=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValue=t._settledValue):(this._bitField=0,this._settledValue=void 0)}e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return this._settledValue},e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return this._settledValue},e.prototype.isFulfilled=t.prototype._isFulfilled=function(){return(268435456&this._bitField)>0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0==(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e},Ye=function(t,e,n,r){var i=Pe.TypeError,o=re.inherits,s=t.PromiseInspection;function a(e){for(var n=e.length,r=0;r<n;++r){var i=e[r];if(i.isRejected())return t.reject(i.error());e[r]=i._settledValue}return e}function u(t){setTimeout((function(){throw t}),0)}function c(e,r){var i=0,o=e.length,s=t.defer();return function a(){if(i>=o)return s.resolve();var c=function(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(e[i++]);if(c instanceof t&&c._isDisposable()){try{c=n(c._getDisposer().tryDispose(r),e.promise)}catch(t){return u(t)}if(c instanceof t)return c._then(a,u,null,null,null)}a()}(),s.promise}function l(t){var e=new s;return e._settledValue=t,e._bitField=268435456,c(this,e).thenReturn(t)}function f(t){var e=new s;return e._settledValue=t,e._bitField=134217728,c(this,e).thenThrow(t)}function h(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function d(t){return h.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},h.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=null!==e?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},h.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},o(p,h),p.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},t.using=function(){var r=arguments.length;if(r<2)return e("you must pass at least 2 arguments to Promise.using");var i=arguments[r-1];if("function"!=typeof i)return e("fn must be a function\n\n See http://goo.gl/916lJJ\n");r--;for(var o=new Array(r),s=0;s<r;++s){var u=arguments[s];if(h.isDisposer(u)){var c=u;(u=u.promise())._setDisposable(c)}else{var p=n(u);p instanceof t&&(u=p._then(d,null,null,{resources:o,index:s},void 0))}o[s]=u}var y=t.settle(o).then(a).then((function(t){var e;y._pushContext();try{e=i.apply(void 0,t)}finally{y._popContext()}return e}))._then(l,f,void 0,o,void 0);return o.promise=y,y},t.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},t.prototype._isDisposable=function(){return(262144&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},t.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,r());throw new i}},Ve=function(t,e,n,r){var i=Pe.TypeError,o=re,s=o.errorObj,a=o.tryCatch,u=[];function c(e,r,i,o){(this._promise=new t(n))._captureStackTrace(),this._stack=o,this._generatorFunction=e,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(u):u}c.prototype.promise=function(){return this._promise},c.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._next(void 0)},c.prototype._continue=function(e){if(e===s)return this._promise._rejectCallback(e.e,!1,!0);var n=e.value;if(!0===e.done)this._promise._resolveCallback(n);else{var o=r(n,this._promise);if(!(o instanceof t)&&null===(o=function(e,n,i){for(var o=0;o<n.length;++o){i._pushContext();var u=a(n[o])(e);if(i._popContext(),u===s){i._pushContext();var c=t.reject(s.e);return i._popContext(),c}var l=r(u,i);if(l instanceof t)return l}return null}(o,this._yieldHandlers,this._promise)))return void this._throw(new i("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/4Y4pDk\n\n".replace("%s",n)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));o._then(this._next,this._throw,void 0,this,null)}},c.prototype._throw=function(t){this._promise._attachExtraTrace(t),this._promise._pushContext();var e=a(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._next=function(t){this._promise._pushContext();var e=a(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},t.coroutine=function(t,e){if("function"!=typeof t)throw new i("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var n=Object(e).yieldHandler,r=c,o=(new Error).stack;return function(){var e=t.apply(this,arguments),i=new r(void 0,void 0,n,o);return i._generator=e,i._next(void 0),i.promise()}},t.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new i("fn must be a function\n\n See http://goo.gl/916lJJ\n");u.push(t)},t.spawn=function(n){if("function"!=typeof n)return e("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var r=new c(n,this),i=r.promise();return r._run(t.spawn),i}},Je=Object.create;if(Je){var Qe=Je(null),Ge=Je(null);Qe[" size"]=Ge[" size"]=0}var Xe,Ze=function(t,e,n,r){var i=re.isArray;function o(s,a){var u=n(s);if(u instanceof t)return function(t){return t.then((function(e){return o(e,t)}))}(u);if(!i(s))return r("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");var c=new t(e);void 0!==a&&c._propagateFrom(a,5);for(var l=c._fulfill,f=c._reject,h=0,p=s.length;h<p;++h){var d=s[h];(void 0!==d||h in s)&&t.cast(d)._then(l,f,void 0,c,null)}return c}t.race=function(t){return o(t,void 0)},t.prototype.race=function(){return o(this,void 0)}},tn=function(t,e){var n={},r=re,i=Ke._nodebackForPromise,o=r.withAppended,s=r.maybeWrapAsError,a=r.canEvaluate,u=Pe.TypeError,c={__isPromisified__:!0},l=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),f=function(t){return r.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t};function h(t){return!l.test(t)}function p(t){try{return!0===t.__isPromisified__}catch(t){return!1}}function d(t,e,n){var i=r.getDataPropertyOrDefault(t,e+n,c);return!!i&&p(i)}function y(t,e,n,i){for(var o=r.inheritedDataKeys(t),s=[],a=0;a<o.length;++a){var c=o[a],l=t[c],h=i===f||f(c);"function"!=typeof l||p(l)||d(t,c,e)||!i(c,l,t,h)||s.push(c,l)}return function(t,e,n){for(var r=0;r<t.length;r+=2){var i=t[r];if(n.test(i))for(var o=i.replace(n,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new u("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/iWrZbw\n".replace("%s",e))}}(s,e,n),s}var g=a?function(a,u,c,l){var f=Math.max(0,function(t){return"number"==typeof t.length?Math.max(Math.min(t.length,1024),0):0}(l)-1),h=function(t){for(var e=[t],n=Math.max(0,t-1-3),r=t-1;r>=n;--r)e.push(r);for(r=t+1;r<=3;++r)e.push(r);return e}(f),p="string"==typeof a||u===n;function d(t){var e,n=(e=t,r.filledRange(e,"_arg","")).join(", "),i=t>0?", ":"";return(p?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===u?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}",n).replace(", ",i)}var y="string"==typeof a?"this != null ? this['"+a+"'] : fn":"fn";return new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL","'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("Parameters",function(t){return r.filledRange(Math.max(t,3),"_arg","")}(f)).replace("[CodeForSwitchCase]",function(){for(var t="",e=0;e<h.length;++e)t+="case "+h[e]+":"+d(h[e]);return t+=" \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]",p?"ret = callback.apply(this, args);\n":"ret = callback.apply(receiver, args);\n")}()).replace("[GetFunctionCode]",y))(t,l,u,o,s,i,r.tryCatch,r.errorObj,r.notEnumerableProp,e)}:function(a,u,c,l){var f=function(){return this}(),h=a;function p(){var r=u;u===n&&(r=this);var c=new t(e);c._captureStackTrace();var l="string"==typeof h&&this!==f?this[h]:a,p=i(c);try{l.apply(r,o(arguments,p))}catch(t){c._rejectCallback(s(t),!0,!0)}return c}return"string"==typeof h&&(a=l),r.notEnumerableProp(p,"__isPromisified__",!0),p};function v(t,e,i,o){for(var s=new RegExp(e.replace(/([$])/,"\\$")+"$"),a=y(t,e,s,i),u=0,c=a.length;u<c;u+=2){var l=a[u],f=a[u+1];t[l+e]=o===g?g(l,n,l,f,e):o(f,(function(){return g(l,n,l,f,e)}))}return r.toFastProperties(t),t}function m(t,e){return g(t,e,void 0,t)}t.promisify=function(t,e){if("function"!=typeof t)throw new u("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(p(t))return t;var i=m(t,arguments.length<2?n:e);return r.copyDescriptors(t,i,h),i},t.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new u("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");var n=(e=Object(e)).suffix;"string"!=typeof n&&(n="Async");var i=e.filter;"function"!=typeof i&&(i=f);var o=e.promisifier;if("function"!=typeof o&&(o=g),!r.isIdentifier(n))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var s=r.inheritedDataKeys(t),a=0;a<s.length;++a){var c=t[s[a]];"constructor"!==s[a]&&r.isClass(c)&&(v(c.prototype,n,i,o),v(c,n,i,o))}return v(t,n,i,o)}},en=function(t,e){var n=re,r=t.TimeoutError,i=function(t){return o(+this).thenReturn(t)},o=t.delay=function(n,r){if(void 0===r){r=n,n=void 0;var o=new t(e);return setTimeout((function(){o._fulfill()}),r),o}return r=+r,t.resolve(n)._then(i,null,null,r,void 0)};function s(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function a(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}t.prototype.delay=function(t){return o(this,t)},t.prototype.timeout=function(t,e){t=+t;var i=this.then().cancellable();i._cancellationParent=this;var o=setTimeout((function(){!function(t,e){if(t.isPending()){"string"!=typeof e&&(e="operation timed out");var i=new r(e);n.markAsOriginatingFromRejection(i),t._attachExtraTrace(i),t._cancel(i)}}(i,e)}),t);return i._then(s,a,void 0,o,void 0)}};"undefined"!=typeof Promise&&(Xe=Promise);var nn=function(){var t,e=function(){return new a("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},n=function(){return new w.PromiseInspection(this._target())},r=function(t){return w.reject(new a(t))},i=re;t=i.isNode?function(){var t=C.domain;return void 0===t&&(t=null),t}:function(){return null},i.notEnumerableProp(w,"_getDomain",t);var o=ye,s=Pe,a=w.TypeError=s.TypeError;w.RangeError=s.RangeError,w.CancellationError=s.CancellationError,w.TimeoutError=s.TimeoutError,w.OperationalError=s.OperationalError,w.RejectionError=s.OperationalError,w.AggregateError=s.AggregateError;var u=function(){},c={},l={e:null},f=Re(w,u),h=function(t,e,n,r){var i=re.isArray;function o(n){var r,i=this._promise=new t(e);n instanceof t&&(r=n,i._propagateFrom(r,5)),this._values=n,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.prototype.length=function(){return this._length},o.prototype.promise=function(){return this._promise},o.prototype._init=function e(o,s){var a=n(this._values,this._promise);if(a instanceof t){if(a=a._target(),this._values=a,!a._isFulfilled())return a._isPending()?void a._then(e,this._reject,void 0,this,s):void this._reject(a._reason());if(a=a._value(),!i(a)){var u=new t.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(u)}}else if(!i(a))return void this._promise._reject(r("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0!==a.length){var c=this.getActualLength(a.length);this._length=c,this._values=this.shouldCopyValues()?new Array(c):this._values;for(var l=this._promise,f=0;f<c;++f){var h=this._isResolved(),p=n(a[f],l);p instanceof t?(p=p._target(),h?p._ignoreRejections():p._isPending()?p._proxyPromiseArray(this,f):p._isFulfilled()?this._promiseFulfilled(p._value(),f):this._promiseRejected(p._reason(),f)):h||this._promiseFulfilled(p,f)}}else-5===s?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{}}}(s))},o.prototype._isResolved=function(){return null===this._values},o.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},o.prototype.__hardReject__=o.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},o.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t,++this._totalResolved>=this._length&&this._resolve(this._values)},o.prototype._promiseRejected=function(t,e){this._totalResolved++,this._reject(t)},o.prototype.shouldCopyValues=function(){return!0},o.prototype.getActualLength=function(t){return t},o}(w,u,f,r),p=De(),d=function(t,e){var n,r,i=t._getDomain,o=ye,s=Pe.Warning,a=re,u=a.canAttachTrace,c=a.isNode&&(!!C.env.BLUEBIRD_DEBUG||"development"===C.env.NODE_ENV);return c&&o.disableTrampolineIfNecessary(),t.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled(),this._bitField=16777216|this._bitField},t.prototype._ensurePossibleRejectionHandled=function(){0==(16777216&this._bitField)&&(this._setRejectionIsUnhandled(),o.invokeLater(this._notifyUnhandledRejection,this,void 0))},t.prototype._notifyUnhandledRejectionIsHandled=function(){e.fireRejectionEvent("rejectionHandled",n,void 0,this)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),e.fireRejectionEvent("unhandledRejection",r,t,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},t.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},t.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},t.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},t.prototype._captureStackTrace=function(t){return(c||t&&e.isSupported())&&(this._traceForced=t,this._trace=new e(this._peekContext())),this},t.prototype._attachExtraTrace=function(t,n){if((c||this._traceForced)&&u(t)){var r=this._trace;if(void 0!==r&&n&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=e.parseStackAndMessage(t);a.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),a.notEnumerableProp(t,"__stackCleaned__",!0)}}},t.prototype._warn=function(t){var n=new s(t),r=this._peekContext();if(r)r.attachExtraTrace(n);else{var i=e.parseStackAndMessage(n);n.stack=i.message+"\n"+i.stack.join("\n")}e.formatAndLogError(n,"")},t.onPossiblyUnhandledRejection=function(t){var e=i();r="function"==typeof t?null===e?t:e.bind(t):void 0},t.onUnhandledRejectionHandled=function(t){var e=i();n="function"==typeof t?null===e?t:e.bind(t):void 0},t.longStackTraces=function(){if(o.haveItemsQueued()&&!1===c)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");(c=e.isSupported())&&o.disableTrampolineIfNecessary()},t.hasLongStackTraces=function(){return c&&e.isSupported()},e.isSupported()||(t.longStackTraces=function(){},c=!1),function(){return c}}(w,p),y=function(t,e,n){var r=[];function i(){this._trace=new e(o())}function o(){var t=r.length-1;if(t>=0)return r[t]}return i.prototype._pushContext=function(){n()&&void 0!==this._trace&&r.push(this._trace)},i.prototype._popContext=function(){n()&&void 0!==this._trace&&r.pop()},t.prototype._peekContext=o,t.prototype._pushContext=i.prototype._pushContext,t.prototype._popContext=i.prototype._popContext,function(){if(n())return new i}}(w,p,d),g=function(t){var e=re,n=Pe,r=e.tryCatch,i=e.errorObj,o=zt.keys,s=n.TypeError;function a(t,e,n){this._instances=t,this._callback=e,this._promise=n}function u(t,e){var n={},a=r(t).call(n,e);return a===i?a:o(n).length?(i.e=new s("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),i):a}return a.prototype.doFilter=function(e){for(var n=this._callback,o=this._promise._boundValue(),s=0,a=this._instances.length;s<a;++s){var c=this._instances[s],l=c===Error||null!=c&&c.prototype instanceof Error;if(l&&e instanceof c)return(f=r(n).call(o,e))===i?(t.e=f.e,t):f;if("function"==typeof c&&!l){var f,h=u(c,e);if(h===i){e=i.e;break}if(h)return(f=r(n).call(o,e))===i?(t.e=f.e,t):f}}return t.e=e,t},a}(l),v=Ke,m=v._nodebackForPromise,b=i.errorObj,_=i.tryCatch;function w(t){if("function"!=typeof t)throw new a("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==w)throw new a("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==u&&this._resolveFromResolver(t)}function E(t){var e=new w(u);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._progressHandler0=t,e._promise0=t,e._receiver0=t,e._settledValue=t}return w.prototype.toString=function(){return"[object Promise]"},w.prototype.caught=w.prototype.catch=function(t){var e=arguments.length;if(e>1){var n,r=new Array(e-1),i=0;for(n=0;n<e-1;++n){var o=arguments[n];if("function"!=typeof o)return w.reject(new a("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));r[i++]=o}r.length=i,t=arguments[n];var s=new g(r,t,this);return this._then(void 0,s.doFilter,void 0,s,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},w.prototype.reflect=function(){return this._then(n,n,void 0,this,void 0)},w.prototype.then=function(t,e,n){if(d()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+i.classString(t);arguments.length>1&&(r+=", "+i.classString(e)),this._warn(r)}return this._then(t,e,n,void 0,void 0)},w.prototype.done=function(t,e,n){this._then(t,e,n,void 0,void 0)._setIsFinal()},w.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,c,void 0)},w.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},w.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},w.prototype.all=function(){return new h(this).promise()},w.prototype.error=function(t){return this.caught(i.originatesFromRejection,t)},w.is=function(t){return t instanceof w},w.fromNode=function(t){var e=new w(u),n=_(t)(m(e));return n===b&&e._rejectCallback(n.e,!0,!0),e},w.all=function(t){return new h(t).promise()},w.defer=w.pending=function(){var t=new w(u);return new v(t)},w.cast=function(t){var e=f(t);if(!(e instanceof w)){var n=e;(e=new w(u))._fulfillUnchecked(n)}return e},w.resolve=w.fulfilled=w.cast,w.reject=w.rejected=function(t){var e=new w(u);return e._captureStackTrace(),e._rejectCallback(t,!0),e},w.setScheduler=function(t){if("function"!=typeof t)throw new a("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=o._schedule;return o._schedule=t,e},w.prototype._then=function(e,n,r,i,s){var a=void 0!==s,c=a?s:new w(u);a||(c._propagateFrom(this,5),c._captureStackTrace());var l=this._target();l!==this&&(void 0===i&&(i=this._boundTo),a||c._setIsMigrated());var f=l._addCallbacks(e,n,r,c,i,t());return l._isResolved()&&!l._isSettlePromisesQueued()&&o.invoke(l._settlePromiseAtPostResolution,l,f),c},w.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},w.prototype._length=function(){return 131071&this._bitField},w.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},w.prototype._isFollowing=function(){return 536870912==(536870912&this._bitField)},w.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},w.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},w.prototype._setRejected=function(){this._bitField=134217728|this._bitField},w.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},w.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},w.prototype._isFinal=function(){return(33554432&this._bitField)>0},w.prototype._cancellable=function(){return(67108864&this._bitField)>0},w.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},w.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},w.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},w.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},w.prototype._isMigrated=function(){return(4194304&this._bitField)>0},w.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return void 0===e&&this._isBound()?this._boundValue():e},w.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},w.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},w.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},w.prototype._boundValue=function(){var t=this._boundTo;return void 0!==t&&t instanceof w?t.isFulfilled()?t.value():void 0:t},w.prototype._migrateCallbacks=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._progressHandlerAt(e),o=t._promiseAt(e),s=t._receiverAt(e);o instanceof w&&o._setIsMigrated(),this._addCallbacks(n,r,i,o,s,null)},w.prototype._addCallbacks=function(t,e,n,r,i,o){var s=this._length();if(s>=131066&&(s=0,this._setLength(0)),0===s)this._promise0=r,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=null===o?t:o.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===o?e:o.bind(e)),"function"==typeof n&&(this._progressHandler0=null===o?n:o.bind(n));else{var a=5*s-5;this[a+3]=r,this[a+4]=i,"function"==typeof t&&(this[a+0]=null===o?t:o.bind(t)),"function"==typeof e&&(this[a+1]=null===o?e:o.bind(e)),"function"==typeof n&&(this[a+2]=null===o?n:o.bind(n))}return this._setLength(s+1),s},w.prototype._setProxyHandlers=function(t,e){var n=this._length();if(n>=131066&&(n=0,this._setLength(0)),0===n)this._promise0=e,this._receiver0=t;else{var r=5*n-5;this[r+3]=e,this[r+4]=t}this._setLength(n+1)},w.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},w.prototype._resolveCallback=function(t,n){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(e(),!1,!0);var r=f(t,this);if(!(r instanceof w))return this._fulfill(t);var i=1|(n?4:0);this._propagateFrom(r,i);var o=r._target();if(o._isPending()){for(var s=this._length(),a=0;a<s;++a)o._migrateCallbacks(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(o)}else o._isFulfilled()?this._fulfillUnchecked(o._value()):this._rejectUnchecked(o._reason(),o._getCarriedStackTrace())}},w.prototype._rejectCallback=function(t,e,n){n||i.markAsOriginatingFromRejection(t);var r=i.ensureErrorObject(t),o=r===t;this._attachExtraTrace(r,!!e&&o),this._reject(t,o?void 0:r)},w.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=_(t)((function(t){null!==e&&(e._resolveCallback(t),e=null)}),(function(t){null!==e&&(e._rejectCallback(t,n),e=null)}));n=!1,this._popContext(),void 0!==r&&r===b&&null!==e&&(e._rejectCallback(r.e,!0,!0),e=null)},w.prototype._settlePromiseFromHandler=function(t,n,r,i){var o;if(!i._isRejected())if(i._pushContext(),o=n!==c||this._isRejected()?_(t).call(n,r):_(t).apply(this._boundValue(),r),i._popContext(),o===b||o===i||o===l){var s=o===i?e():o.e;i._rejectCallback(s,!1,!0)}else i._resolveCallback(o)},w.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},w.prototype._followee=function(){return this._rejectionHandler0},w.prototype._setFollowee=function(t){this._rejectionHandler0=t},w.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},w.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},w.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},w.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},w.prototype._settlePromiseAt=function(t){var e=this._promiseAt(t),n=e instanceof w;if(n&&e._isMigrated())return e._unsetIsMigrated(),o.invoke(this._settlePromiseAt,this,t);var r=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),i=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,a=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof r?n?this._settlePromiseFromHandler(r,a,s,e):r.call(a,s,e):a instanceof h?a._isResolved()||(this._isFulfilled()?a._promiseFulfilled(s,e):a._promiseRejected(s,e)):n&&(this._isFulfilled()?e._fulfill(s):e._reject(s,i)),t>=4&&4==(31&t)&&o.invokeLater(this._setLength,this,0)},w.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},w.prototype._isSettlePromisesQueued=function(){return-1073741824==(-1073741824&this._bitField)},w.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},w.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},w.prototype._queueSettlePromises=function(){o.settlePromises(this),this._setSettlePromisesQueued()},w.prototype._fulfillUnchecked=function(t){if(t===this){var n=e();return this._attachExtraTrace(n),this._rejectUnchecked(n,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},w.prototype._rejectUncheckedCheckError=function(t){var e=i.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},w.prototype._rejectUnchecked=function(t,n){if(t===this){var r=e();return this._attachExtraTrace(r),this._rejectUnchecked(r)}this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?o.throwLater((function(t){throw"stack"in t&&o.invokeFirst(p.unhandledRejection,void 0,t),t}),void 0===n?t:n):(void 0!==n&&n!==t&&this._setCarriedStackTrace(n),this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled())},w.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;e<t;e++)this._settlePromiseAt(e)},i.notEnumerableProp(w,"_makeSelfResolutionError",e),function(t,e){var n=re,r=ye,i=n.tryCatch,o=n.errorObj;t.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},t.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},t.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},t.prototype._doProgressWith=function(e){var r=e.value,s=e.handler,a=e.promise,u=e.receiver,c=i(s).call(u,r);if(c===o){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof t?c._then(a._progress,null,null,a,void 0):a._progress(c)},t.prototype._progressUnchecked=function(n){for(var i=this._length(),o=this._progress,s=0;s<i;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof t)"function"==typeof a?r.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:n}):r.invoke(o,u,n);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,n,u):c instanceof e&&!c._isResolved()&&c._promiseProgressed(n,u)}}}}(w,h),function(t,e,n,r){var i=re,o=i.tryCatch;t.method=function(n){if("function"!=typeof n)throw new t.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var r=new t(e);r._captureStackTrace(),r._pushContext();var i=o(n).apply(this,arguments);return r._popContext(),r._resolveFromSyncValue(i),r}},t.attempt=t.try=function(n,s,a){if("function"!=typeof n)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new t(e);u._captureStackTrace(),u._pushContext();var c=i.isArray(s)?o(n).apply(a,s):o(n).call(a,s);return u._popContext(),u._resolveFromSyncValue(c),u},t.prototype._resolveFromSyncValue=function(t){t===i.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}(w,u,0,r),function(t,e,n){var r=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(r,r,null,this,t)},o=function(t,e){this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(r){var a=n(r),u=new t(e);u._propagateFrom(this,1);var c=this._target();if(u._setBoundTo(a),a instanceof t){var l={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:a};c._then(e,i,u._progress,u,l),a._then(o,s,u._progress,u,l)}else u._resolveCallback(c);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072==(131072&this._bitField)},t.bind=function(r,i){var o=n(r),s=new t(e);return s._setBoundTo(o),o instanceof t?o._then((function(){s._resolveCallback(i)}),s._reject,s._progress,s,null):s._resolveCallback(i),s}}(w,u,f),function(t,e,n){var r=re,i=r.isPrimitive,o=r.thrower;function s(){return this}function a(){throw this}function u(t,e,n){var r;return r=i(e)?n?function(t){return function(){return t}}(e):function(t){return function(){throw t}}(e):n?s:a,t._then(r,o,void 0,e,void 0)}function c(r){var i=this.promise,o=this.handler,s=i._isBound()?o.call(i._boundValue()):o();if(void 0!==s){var a=n(s,i);if(a instanceof t)return u(a=a._target(),r,i.isFulfilled())}return i.isRejected()?(e.e=r,e):r}function l(e){var r=this.promise,i=this.handler,o=r._isBound()?i.call(r._boundValue(),e):i(e);if(void 0!==o){var s=n(o,r);if(s instanceof t)return u(s=s._target(),e,!0)}return e}t.prototype._passThroughHandler=function(t,e){if("function"!=typeof t)return this.then();var n={promise:this,handler:t};return this._then(e?c:l,e?c:void 0,void 0,n,void 0)},t.prototype.lastly=t.prototype.finally=function(t){return this._passThroughHandler(t,!0)},t.prototype.tap=function(t){return this._passThroughHandler(t,!1)}}(w,l,f),function(t){var e=function(){return this},n=function(){throw this},r=function(){},i=function(){throw void 0},o=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype.return=t.prototype.thenReturn=function(t){return void 0===t?this.then(r):We(t)?this._then(o(t,2),void 0,void 0,void 0,void 0):this._then(e,void 0,void 0,t,void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return void 0===t?this.then(i):We(t)?this._then(o(t,1),void 0,void 0,void 0,void 0):this._then(n,void 0,void 0,t,void 0)}}(w),$e(w),function(t,e,n,r){var i=re,o=i.canEvaluate,s=i.tryCatch,a=i.errorObj;if(o){for(var u=function(t){return new Function("value","holder"," \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g,t))},c=function(t){for(var e=[],n=1;n<=t;++n)e.push("holder.p"+n);return new Function("holder"," \n 'use strict'; \n var callback = holder.fn; \n return callback(values); \n ".replace(/values/g,e.join(", ")))},l=[],f=[void 0],h=1;h<=5;++h)l.push(u(h)),f.push(c(h));var p=function(t,e){this.p1=this.p2=this.p3=this.p4=this.p5=null,this.fn=e,this.total=t,this.now=0};p.prototype.callers=f,p.prototype.checkFulfillment=function(t){var e=this.now;e++;var n=this.total;if(e>=n){var r=this.callers[n];t._pushContext();var i=s(r)(this);t._popContext(),i===a?t._rejectCallback(i.e,!1,!0):t._resolveCallback(i)}else this.now=e};var d=function(t){this._reject(t)}}t.join=function(){var i,s=arguments.length-1;if(s>0&&"function"==typeof arguments[s]&&(i=arguments[s],s<6&&o)){(v=new t(r))._captureStackTrace();for(var a=new p(s,i),u=l,c=0;c<s;++c){var f=n(arguments[c],v);f instanceof t?(f=f._target())._isPending()?f._then(u[c],d,void 0,v,a):f._isFulfilled()?u[c].call(v,f._value(),a):v._reject(f._reason()):u[c].call(v,f,a)}return v}for(var h=arguments.length,y=new Array(h),g=0;g<h;++g)y[g]=arguments[g];i&&y.pop();var v=new e(y).promise();return void 0!==i?v.spread(i):v}}(w,h,f,u),w.Promise=w,function(t,e,n,r,i){var o=t._getDomain,s=ye,a=re,u=a.tryCatch,c=a.errorObj,l={},f=[];function h(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var a=o();this._callback=null===a?e:a.bind(e),this._preservedValues=r===i?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=n>=1?[]:f,s.invoke(p,this,void 0)}function p(){this._init$(void 0,-2)}function d(t,e,n,r){var i="object"==typeof n&&null!==n?n.concurrency:0;return new h(t,e,i="number"==typeof i&&isFinite(i)&&i>=1?i:0,r)}a.inherits(h,e),h.prototype._init=function(){},h.prototype._promiseFulfilled=function(e,n){var i=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(i[n]===l){if(i[n]=e,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return i[n]=e,void this._queue.push(n);null!==s&&(s[n]=e);var f=this._callback,h=this._promise._boundValue();this._promise._pushContext();var p=u(f).call(h,e,n,o);if(this._promise._popContext(),p===c)return this._reject(p.e);var d=r(p,this._promise);if(d instanceof t){if((d=d._target())._isPending())return a>=1&&this._inFlight++,i[n]=l,d._proxyPromiseArray(this,n);if(!d._isFulfilled())return this._reject(d._reason());p=d._value()}i[n]=p}++this._totalResolved>=o&&(null!==s?this._filter(i,s):this._resolve(i))},h.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var r=t.pop();this._promiseFulfilled(n[r],r)}},h.prototype._filter=function(t,e){for(var n=e.length,r=new Array(n),i=0,o=0;o<n;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},h.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):d(this,t,e,null).promise()},t.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):d(t,e,r,i).promise()}}(w,h,r,f,u),function(t){var e=ye,n=Pe.CancellationError;t.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,n=this;void 0!==(e=n._cancellationParent)&&e.isCancellable();)n=e;this._unsetCancellable(),n._target()._rejectCallback(t,!1,!0)},t.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new n),e.invokeLater(this._cancel,this,t),this):this},t.prototype.cancellable=function(){return this._cancellable()?this:(e.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},t.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},t.prototype.fork=function(t,e,n){var r=this._then(t,e,n,void 0,void 0);return r._setCancellable(),r._cancellationParent=void 0,r}}(w),Ye(w,r,f,y),Ve(w,r,u,f),function(t){var e=re,n=ye,r=e.tryCatch,i=e.errorObj;function o(t,o){if(!e.isArray(t))return s.call(this,t,o);var a=r(o).apply(this._boundValue(),[null].concat(t));a===i&&n.throwLater(a.e)}function s(t,e){var o=this._boundValue(),s=void 0===t?r(e).call(o,null):r(e).call(o,null,t);s===i&&n.throwLater(s.e)}function a(t,e){if(!t){var o=this._target()._getCarriedStackTrace();o.cause=t,t=o}var s=r(e).call(this._boundValue(),t);s===i&&n.throwLater(s.e)}t.prototype.asCallback=t.prototype.nodeify=function(t,e){if("function"==typeof t){var n=s;void 0!==e&&Object(e).spread&&(n=o),this._then(n,a,void 0,this,t)}return this}}(w),function(t){var e,n,r=re,i=r.canEvaluate,o=r.isIdentifier,s=function(t){return new Function("ensureMethod"," \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g,t))(c)},a=function(t){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",t))},u=function(t,e,n){var r=n[t];if("function"!=typeof r){if(!o(t))return null;if(r=e(t),n[t]=r,n[" size"]++,n[" size"]>512){for(var i=Object.keys(n),s=0;s<256;++s)delete n[i[s]];n[" size"]=i.length-256}}return r};function c(e,n){var i;if(null!=e&&(i=e[n]),"function"!=typeof i){var o="Object "+r.classString(e)+" has no method '"+r.toString(n)+"'";throw new t.TypeError(o)}return i}function l(t){return c(t,this.pop()).apply(t,this)}function f(t){return t[this]}function h(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e=function(t){return u(t,s,Qe)},n=function(t){return u(t,a,Ge)},t.prototype.call=function(t){for(var n=arguments.length,r=new Array(n-1),o=1;o<n;++o)r[o-1]=arguments[o];if(i){var s=e(t);if(null!==s)return this._then(s,void 0,void 0,r,void 0)}return r.push(t),this._then(l,void 0,void 0,r,void 0)},t.prototype.get=function(t){var e;if("number"==typeof t)e=h;else if(i){var r=n(t);e=null!==r?r:f}else e=f;return this._then(e,void 0,void 0,t,void 0)}}(w),function(t,e,n,r){var i=re,o=i.isObject,s=zt;function a(t){for(var e=s.keys(t),n=e.length,r=new Array(2*n),i=0;i<n;++i){var o=e[i];r[i]=t[o],r[i+n]=o}this.constructor$(r)}function u(e){var i,s=n(e);return o(s)?(i=s instanceof t?s._then(t.props,void 0,void 0,void 0,void 0):new a(s).promise(),s instanceof t&&i._propagateFrom(s,4),i):r("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}i.inherits(a,e),a.prototype._init=function(){this._init$(void 0,-3)},a.prototype._promiseFulfilled=function(t,e){if(this._values[e]=t,++this._totalResolved>=this._length){for(var n={},r=this.length(),i=0,o=this.length();i<o;++i)n[this._values[i+r]]=this._values[i];this._resolve(n)}},a.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},a.prototype.shouldCopyValues=function(){return!1},a.prototype.getActualLength=function(t){return t>>1},t.prototype.props=function(){return u(this)},t.props=function(t){return u(t)}}(w,h,f,r),Ze(w,u,f,r),function(t,e,n,r,i){var o=t._getDomain,s=ye,a=re,u=a.tryCatch,c=a.errorObj;function l(e,n,a,u){this.constructor$(e),this._promise._captureStackTrace(),this._preservedValues=u===i?[]:null,this._zerothIsAccum=void 0===a,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var c=r(a,this._promise),l=!1,h=c instanceof t;h&&((c=c._target())._isPending()?c._proxyPromiseArray(this,-1):c._isFulfilled()?(a=c._value(),this._gotAccum=!0):(this._reject(c._reason()),l=!0)),h||this._zerothIsAccum||(this._gotAccum=!0);var p=o();this._callback=null===p?n:p.bind(n),this._accum=a,l||s.invoke(f,this,void 0)}function f(){this._init$(void 0,-5)}function h(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):new l(t,e,r,i).promise()}a.inherits(l,e),l.prototype._init=function(){},l.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},l.prototype._promiseFulfilled=function(e,n){var i=this._values;i[n]=e;var o,s=this.length(),a=this._preservedValues,l=null!==a,f=this._gotAccum,h=this._valuesPhase;if(!h)for(h=this._valuesPhase=new Array(s),o=0;o<s;++o)h[o]=0;if(o=h[n],0===n&&this._zerothIsAccum?(this._accum=e,this._gotAccum=f=!0,h[n]=0===o?1:2):-1===n?(this._accum=e,this._gotAccum=f=!0):0===o?h[n]=1:(h[n]=2,this._accum=e),f){for(var p,d=this._callback,y=this._promise._boundValue(),g=this._reducingIndex;g<s;++g)if(2!==(o=h[g])){if(1!==o)return;if(e=i[g],this._promise._pushContext(),l?(a.push(e),p=u(d).call(y,e,g,s)):p=u(d).call(y,this._accum,e,g,s),this._promise._popContext(),p===c)return this._reject(p.e);var v=r(p,this._promise);if(v instanceof t){if((v=v._target())._isPending())return h[g]=4,v._proxyPromiseArray(this,g);if(!v._isFulfilled())return this._reject(v._reason());p=v._value()}this._reducingIndex=g+1,this._accum=p}else this._reducingIndex=g+1;this._resolve(l?a:this._accum)}},t.prototype.reduce=function(t,e){return h(this,t,e,null)},t.reduce=function(t,e,n,r){return h(t,e,n,r)}}(w,h,r,f,u),function(t,e){var n=t.PromiseInspection;function r(t){this.constructor$(t)}re.inherits(r,e),r.prototype._promiseResolved=function(t,e){this._values[t]=e,++this._totalResolved>=this._length&&this._resolve(this._values)},r.prototype._promiseFulfilled=function(t,e){var r=new n;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},r.prototype._promiseRejected=function(t,e){var r=new n;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},t.settle=function(t){return new r(t).promise()},t.prototype.settle=function(){return new r(this).promise()}}(w,h),function(t,e,n){var r=re,i=Pe.RangeError,o=Pe.AggregateError,s=r.isArray;function a(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new a(t),i=r.promise();return r.setHowMany(e),r.init(),i}r.inherits(a,e),a.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},a.prototype.init=function(){this._initialized=!0,this._init()},a.prototype.setUnwrap=function(){this._unwrap=!0},a.prototype.howMany=function(){return this._howMany},a.prototype.setHowMany=function(t){this._howMany=t},a.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values))},a.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new o,n=this.length();n<this._values.length;++n)e.push(this._values[n]);this._reject(e)}},a.prototype._fulfilled=function(){return this._totalResolved},a.prototype._rejected=function(){return this._values.length-this.length()},a.prototype._addRejected=function(t){this._values.push(t)},a.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},a.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},a.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new i(e)},a.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(t,e){return u(t,e)},t.prototype.some=function(t){return u(this,t)},t._SomePromiseArray=a}(w,h,r),tn(w,u),function(t){var e=t._SomePromiseArray;function n(t){var n=new e(t),r=n.promise();return n.setHowMany(1),n.setUnwrap(),n.init(),r}t.any=function(t){return n(t)},t.prototype.any=function(){return n(this)}}(w),function(t,e){var n=t.reduce;t.prototype.each=function(t){return n(this,t,null,e)},t.each=function(t,r){return n(t,r,null,e)}}(w,u),en(w,u),function(t,e){var n=t.map;t.prototype.filter=function(t,r){return n(this,t,r,e)},t.filter=function(t,r,i){return n(t,r,i,e)}}(w,u),i.toFastProperties(w),i.toFastProperties(w.prototype),E({a:1}),E({b:2}),E({c:3}),E(1),E((function(){})),E(void 0),E(!1),E(new w(u)),p.setBounds(o.firstLineError,i.lastLineError),w}();nn.noConflict=function(){try{Promise===nn&&(Promise=Xe)}catch(t){}return nn};var rn=nn,on={queue:[],drain:function(){this.queue.forEach((function(t){t()})),this.queue=[]}},sn=rn.setScheduler((function(t){on.queue.push(t),sn((function(){on.drain()}))}));rn.prototype._notifyUnhandledRejection=function(){var t=this;sn((function(){if(t._isRejectionUnhandled()){if(!on.onUnhandledRejection)throw t.reason();on.onUnhandledRejection(t.reason())}}))};var an=on,un=!1;"undefined"!=typeof window&&void 0!==window.location&&(un=!!window.location.search.match(/[?&]full-trace=true(?:$|&)/)),D.getEnv("UNEXPECTED_FULL_TRACE")&&(rn.longStackTraces(),un=!0);var cn=un,ln=function(t){if(!t||"function"!=typeof t.then)return t;if(!t.isRejected)return t;if(t.isFulfilled())return t;if(t.isRejected())throw t.caught((function(){})),t.reason();var e,n=function(){},r=function(){},i=!1;if(t.then((function(e){i=!0,n(t)}),(function(t){i=!0,e=t,r(t)})),an.drain(),i&&e)throw e._isUnexpected&&Error.captureStackTrace&&Error.captureStackTrace(e),e;return i?t:(t._captureStackTrace&&!cn&&t._captureStackTrace(!0),new rn((function(t,e){n=t,r=e})))};var fn=function t(e){if(e&&"aggregate error"===e.message)for(var n=0;n<e.length;n+=1)t(e[n]);else if(!e||!e._isUnexpected)throw e};function hn(t){if("function"!=typeof t)throw new TypeError("expect.promise(...) requires a function argument to be supplied.\nSee http://unexpected.js.org/api/promise/ for more details.");return 2===t.length?new rn(t):new rn((function(e,n){var r,i=0,o=!1;function s(){o&&0===i&&e(r)}function a(t){void 0!==t&&void 0===r&&(r=t)}try{var u=ln(t((function(t){return i+=1,function(){for(var e,r=[],o=arguments.length;o--;)r[o]=arguments[o];i-=1;try{"function"==typeof t&&(pn(e=ln(t.apply(void 0,r)))?(i+=1,e.then((function(t){a(t),i-=1,s()}),n)):a(e))}catch(t){return n(t)}return s(),e}})));pn(u)?(i+=1,u.then((function(t){a(t),i-=1,s()}),n)):a(u)}catch(t){return n(t)}o=!0,s()}))}function pn(t){return t&&"object"==typeof t&&"function"==typeof t.then}["all","any","settle"].forEach((function(t){hn[t]=function(e){var n=rn[t](function t(e){if(pn(e))return[e];if(e&&"object"==typeof e){var n=[];return Object.keys(e).forEach((function(r){n.push.apply(n,t(e[r]))})),n}return[]}(e));return"settle"===t?n.then((function(t){return t.forEach((function(t){t.isRejected()&&fn(t.reason())})),t})):n}})),Object.keys(rn).forEach((function(t){/^_|^on|^setScheduler|ongStackTraces/.test(t)||"function"!=typeof rn[t]||void 0!==hn[t]||(hn[t]=rn[t])}));var dn=hn;var yn=function t(e,n,r){return e.and=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];function o(){return n.findTypeOf(e[0]).is("expect.it")?t(e[0](r),n,r):n.apply(void 0,[r].concat(e))}return this.isFulfilled()?o():t(this.then(o),n,r)},e},gn=function(t){return"function"!=typeof t.isPending?dn((function(){return t})):t},vn=3,mn="undefined"!=typeof window&&void 0!==window.location&&window.location.search.match(/[?&]depth=(\d+)(?:$|&)/);if(mn)vn=parseInt(mn[1],10);else{var bn=D.getEnv("UNEXPECTED_DEPTH");bn&&(vn=parseInt(bn,10))}var _n=vn,wn=["message","line","sourceId","sourceURL","stack","stackArray"].reduce((function(t,e){return t[e]=!0,t}),{});function En(t,e){this.errorMode=t&&t.errorMode||"default";var n=Error.call(this,"");if(Error.captureStackTrace)Error.captureStackTrace(this,En);else{try{throw n}catch(t){}this.stack=n.stack}Object.defineProperties(this,{expect:{enumerable:!1,value:t}}),this.parent=e||null,this.name="UnexpectedError"}En.prototype=Object.create(Error.prototype),En.prototype.useFullStackTrace=cn;En.prototype.outputFromOptions=function(t){if(!t)throw new Error("You must either provide a format or a magicpen instance");if("string"==typeof t)return this.expect.createOutput(t);if(t.isMagicPen)return t.clone();if(t.output)return t.output.clone();if(t.format)return this.expect.createOutput(t.format);throw new Error("You must either provide a format or a magicpen instance")},En.prototype._isUnexpected=!0,En.prototype.isUnexpected=!0,En.prototype.buildDiff=function(t){var e=this.outputFromOptions(t),n=this.expect;return this.createDiff&&this.createDiff(e,(function(t,r){return n.diff(t,r,e.clone())}),(function(t,n){return e.clone().appendInspected(t,(n||_n)-1)}),(function(t,e){return n.equal(t,e)}))},En.prototype.getDefaultErrorMessage=function(t){var e=this.outputFromOptions(t);this.expect.testDescription?e.append(this.expect.standardErrorMessage(e.clone(),t)):"function"==typeof this.output&&this.output.call(e,e);for(var n=this;!n.createDiff&&n.parent;)n=n.parent;if(n&&n.createDiff){var r=n.buildDiff(t);r&&e.nl(2).append(r)}return e},En.prototype.getNestedErrorMessage=function(t){var e=this.outputFromOptions(t);this.expect.testDescription?e.append(this.expect.standardErrorMessage(e.clone(),t)):"function"==typeof this.output&&this.output.call(e,e);for(var n=this.parent;"bubble"===n.getErrorMode();)n=n.parent;return"string"==typeof t?t={format:t}:t&&t.isMagicPen&&(t={output:t}),e.nl().indentLines().i().block(n.getErrorMessage(D.extend({},t||{},{compact:this.expect.subject===n.expect.subject}))),e},En.prototype.getDefaultOrNestedMessage=function(t){return this.hasDiff()?this.getDefaultErrorMessage(t):this.getNestedErrorMessage(t)},En.prototype.hasDiff=function(){return!!this.getDiffMethod()},En.prototype.getDiffMethod=function(){for(var t=this;!t.createDiff&&t.parent;)t=t.parent;return t&&t.createDiff||null},En.prototype.getDiff=function(t){for(var e=this;!e.createDiff&&e.parent;)e=e.parent;return e&&e.buildDiff(t)},En.prototype.getDiffMessage=function(t){var e=this.outputFromOptions(t),n=this.getDiff(t);return n?e.append(n):this.expect.testDescription?e.append(this.expect.standardErrorMessage(e.clone(),t)):"function"==typeof this.output&&this.output.call(e,e),e},En.prototype.getErrorMode=function(){if(this.parent)return this.errorMode;switch(this.errorMode){case"default":case"bubbleThrough":return this.errorMode;default:return"default"}},En.prototype.getErrorMessage=function(t){for(var e=this.parent;e&&"bubbleThrough"!==e.getErrorMode();)e=e.parent;if(e)return e.getErrorMessage(t);var n=this.getErrorMode();switch(n){case"nested":return this.getNestedErrorMessage(t);case"default":case"bubbleThrough":return this.getDefaultErrorMessage(t);case"bubble":return this.parent.getErrorMessage(t);case"diff":return this.getDiffMessage(t);case"defaultOrNested":return this.getDefaultOrNestedMessage(t);default:throw new Error("Unknown error mode: '"+n+"'")}},En.prototype.serializeMessage=function(t){if(!this._hasSerializedErrorMessage){var e="html"===t;if(e&&("htmlMessage"in this||(this.htmlMessage=this.getErrorMessage({format:"html"}).toString())),this.message="\n"+this.getErrorMessage({format:e?"text":t}).toString()+"\n",this.originalError&&this.originalError instanceof Error&&"string"==typeof this.originalError.stack){var n=this.originalError.stack.indexOf(this.originalError.message);this.stack=-1===n?this.message+"\n"+this.originalError.stack:this.message+this.originalError.stack.substr(n+this.originalError.message.length)}else if(/^(Unexpected)?Error:?\n/.test(this.stack)){var r=/^(?:Unexpected)?Error:?\n/.exec(this.stack);r&&(this.stack=this.message+this.stack.substr(r[0].length))}if(this.stack&&!this.useFullStackTrace){var i=this.stack.split(/\n/),o=function(t){for(var e=t.length-1;e>=0;e-=1)if(""===t[e])return e+1;return-1}(i),s=i.filter((function(t,e){return e<o||!/node_modules[/\\]unexpected(?:-[^/\\]+)?[/\\]/.test(t)&&!/executeExpect.*node_modules[/\\]unexpected[/\\]/.test(i[e+1])}));if(s.length!==i.length){var a=/^(\s*)/.exec(i[i.length-1])[1];"html"===t?s.push(a+"set the query parameter full-trace=true to see the full stack trace"):s.push(a+"set UNEXPECTED_FULL_TRACE=true to see the full stack trace")}this.stack=s.join("\n")}this._hasSerializedErrorMessage=!0}},En.prototype.clone=function(){var t=this,e=new En(this.expect);return Object.keys(t).forEach((function(n){wn[n]||(e[n]=t[n])})),e},En.prototype.getLabel=function(){for(var t=this;t&&!t.label;)t=t.parent;return t&&t.label||null},En.prototype.getParents=function(){for(var t=[],e=this.parent;e;)t.push(e),e=e.parent;return t},En.prototype.getAllErrors=function(){var t=this.getParents();return t.unshift(this),t},Object.__defineGetter__&&Object.defineProperty(En.prototype,"htmlMessage",{enumerable:!0,get:function(){return this.getErrorMessage({format:"html"}).toString()}});var xn=En,An=[],Fn=!1,jn=null;function kn(t){return!t._fulfillmentHandler0&&!t._rejectionHandler0&&!t._receiver0&&(t.isPending()||t.isRejected()&&t.reason().uncaught)}function Cn(){if("function"==typeof afterEach&&!Fn){Fn=!0;try{afterEach((function(){var t,e,n=!0;An.some(kn)&&(this.currentTest?(n="passed"===this.currentTest.state,e=this.currentTest.title):"object"==typeof jn&&(n=0===jn.failedExpectations.length,e=jn.fullName),t=new Error(e+": You have created a promise that was not returned from the it block"));if(An=[],t&&n)throw t}))}catch(t){}}}"object"==typeof jasmine&&jasmine.getEnv().addReporter({specStarted:function(t){jn=t},specDone:function(t){jn=null}}),Cn();var Tn=function(){this.level=0};Tn.prototype.child=function(){var t=Object.create(this);return t.level++,t};var Sn=Tn;var On=function(t){for(var e={"[":0,"]":0,"(":0,")":0},n=0;n<t.length;n+=1){var r=t.charAt(n);if(r in e&&(e[r]+=1),"]"===r&&e["["]>=e["]"]){if(e["["]===e["]"]+1)throw new Error("Assertion patterns must not contain flags with brackets: '"+t+"'");if(e["("]!==e[")"])throw new Error("Assertion patterns must not contain flags with parentheses: '"+t+"'");if("["===t.charAt(n-1))throw new Error("Assertion patterns must not contain empty flags: '"+t+"'")}else if(")"===r&&e["("]>=e[")"]){if(e["("]===e[")"]+1)throw new Error("Assertion patterns must not contain alternations with parentheses: '"+t+"'");if(e["["]!==e["]"])throw new Error("Assertion patterns must not contain alternations with brackets: '"+t+"'")}}if(e["["]!==e["]"])throw new Error("Assertion patterns must not contain unbalanced brackets: '"+t+"'");if(e["("]!==e[")"])throw new Error("Assertion patterns must not contain unbalanced parentheses: '"+t+"'")},Pn=D.extend;var Rn=function(t){t=t.replace(/(\[[^\]]+\]) ?/g,"$1");for(var e,n=/\[[^\]]+\]|\([^)]+\)/g,r=[],i=0;e=n.exec(t);)r.push(t.slice(i,e.index)),r.push(t.slice(e.index,n.lastIndex)),i=n.lastIndex;r.push(t.slice(i));var o=function t(e,n){if(n===e.length)return[{text:"",flags:{},alternations:[]}];var r=e[n],i=t(e,n+1);if(function(t){return"["===t.slice(0,1)&&"]"===t.slice(-1)}(r)){var o=r.slice(1,-1);return i.map((function(t){var e={};return e[o]=!0,{text:o+" "+t.text,flags:Pn(e,t.flags),alternations:t.alternations}})).concat(i.map((function(t){var e={};return e[o]=!1,{text:t.text,flags:Pn(e,t.flags),alternations:t.alternations}})))}return function(t){return"("===t.slice(0,1)&&")"===t.slice(-1)}(r)?r.substr(1,r.length-2).split(/\|/).reduce((function(t,e){return t.concat(i.map((function(t){var n=t.text,r=t.flags,i=t.alternations;return{text:e?e+n:n.replace(/^ /,""),flags:r,alternations:[e].concat(i)}})))}),[]):i.map((function(t){var e=t.text,n=t.flags,i=t.alternations;return{text:r+e,flags:n,alternations:i}}))}(r=r.filter((function(t){return""!==t})),0);return o.forEach((function(t){if(t.text=t.text.trim(),""===t.text)throw new Error("Assertion patterns must not only contain flags")})),o},Dn=S((function(t){t.exports="inspect";try{var e=function(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}();e&&"function"==typeof e.inspect&&e.inspect.custom&&(t.exports=e.inspect.custom)}catch(t){}})),Mn=D.extend;function Bn(t){return t.type.is("assertion")}var In={_unexpectedType:!0,name:"any",level:0,identify:function(){return!0},equal:D.objectIs,inspect:function(t,e,n){return n&&n.isMagicPen?n.text(t):"type: "+this.name},diff:function(t,e,n,r,i){return null},typeEqualityCache:{},is:function(t){var e;e="string"==typeof t?t:t.name;var n=this.typeEqualityCache[e];if(void 0!==n)return n;var r=!1;return this.name===e?r=!0:this.baseType&&(r=this.baseType.is(e)),this.typeEqualityCache[e]=r,r}};"inspect"!==Dn&&(In[Dn]=function(){return"type: "+this.name});var Ln={};function Nn(t,e,r){var i=function(t){var e=[[]];return t.forEach((function(t){t===Ln?e.push([]):e[e.length-1].push(t)})),e}(e);function o(e,o){if(o=o&&"object"==typeof o&&o instanceof Sn?o:new Sn,1===i.length&&1===i[0].length&&1===i[0][0].length&&"function"==typeof i[0][0][0])return ln(i[0][0][0](e));var s=[],a=[];return i.forEach((function(n){var i=function(t,e,n,r,i){return r.map((function(r){var o=Array.prototype.slice.call(r);return o.unshift(n),{expectation:o,promise:dn((function(){if("function"==typeof o[1]){if(o.length>2)throw new Error("expect.it(<function>) does not accept additional arguments");return o[1](o[0])}return t._expect(e.child(),o,i)}))}}))}(t,o,e,n,r);i.forEach((function(t){var e=t.promise;a.push(e)})),s.push(i)})),ln(dn.settle(a).then((function(){s.forEach((function(t){t.forEach((function(t){var e=t.promise;if(e.isRejected()&&"bubbleThrough"===e.reason().errorMode)throw e.reason()}))})),s.some((function(t){return t.every((function(t){return t.promise.isFulfilled()}))}))||t.fail((function(t){!function(t,e){var r=e.length>1,i=e.some((function(t){return t.length>1}));e.forEach((function(e,o){o>0&&(i?t.nl():t.sp(),t.jsComment("or").nl());var s=!1;e.forEach((function(e,o){o>0&&t.jsComment(" and").nl();var a=e.promise.isRejected();if(a&&!s){s=!0;var u=e.promise.reason();(i||r)&&t.error("⨯ "),t.block((function(t){t.append(u.getErrorMessage(t))}))}else{a?t.error("⨯ "):t.success("✓ ");var c=e.expectation;t.block((function(t){var e=c[0],r=c.slice(2).map((function(t){return function(e){e.appendInspected(t)}})),i=c[1];n(t,(function(t){t.appendInspected(e)}),i,r,{subject:e})}))}}))}))}(t,s)}))})))}return o._expectIt=!0,o._expectations=e,o._OR=Ln,o.and=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];var o=e.slice();return o.push(n),Nn(t,o,r)},o.or=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];var o=e.slice();return o.push(Ln,n),Nn(t,o,r)},o}var Un={promise:dn,notifyPendingPromise:function(t){An.push(t),Cn()},errorMode:"default"};D.setPrototypeOfOrExtend(Un,Function.prototype),Un.it=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Nn(this._topLevelExpect,[t],this.flags)},Un.equal=function(t,e,n,r){var i=this;if((n="number"==typeof n?n:100)<=0){if(-1!==(r=r||[]).indexOf(t))throw new Error("Cannot compare circular structures");r.push(t)}return this.findCommonType(t,e).equal(t,e,(function(t,e){return i.equal(t,e,n-1,r)}))},Un.inspect=function(t,e,n){var r=this,i=[],o=function(t,e,n){var s=r.findTypeOf(t);return e<=0&&s.is("object")&&!s.is("expect.it")?n.text("..."):-1!==(i=i||[]).indexOf(t)?n.text("[Circular]"):s.inspect(t,e,n,(function(r,s){return n=n.clone(),i.push(t),void 0===s&&(s=e-1),n=o(r,s,n)||n,i.pop(),n}))},s="string"==typeof n?this.createOutput(n):n;return s=s||this.createOutput(),o(t,"number"==typeof e?e:_n,s)||s},"inspect"!==Dn&&(Un[Dn]=Un.inspect),Un.expandTypeAlternations=function(t){var e=this,n=function(t,r){if(r===t.length)return[];var i=[];return t[r].forEach((function(o){var s=n(t,r+1);s.length?s.forEach((function(t){i.push([o].concat(t))})):o.type.is("assertion")?(i.push([{type:o.type,minimum:1,maximum:1},{type:e.getType("any"),minimum:0,maximum:1/0}]),i.push([{type:e.getType("expect.it"),minimum:1,maximum:1}]),0===o.minimum&&i.push([])):i.push([o])})),i},r=[];return t.subject.forEach((function(e){t.args.length?n(t.args,0).forEach((function(n){r.push(Mn({},t,{subject:e,args:n}))})):r.push(Mn({},t,{subject:e,args:[]}))})),r},Un.parseAssertion=function(t){var e,n=this,r=[],i=0,o=function(e){return e.split("|").map((function(e){var r=e.match(/^([a-z_](?:|[a-z0-9_.-]*[_a-z0-9]))([+*?]|)$/i);if(!r)throw new SyntaxError("Cannot parse type declaration:"+e);var i=n.getType(r[1]);if(!i)throw new Error("Unknown type: "+r[1]+" in "+t);var o=r[2];return{minimum:o&&"+"!==o?0:1,maximum:"*"===o||"+"===o?1/0:1,type:i}}))};function s(t){return t.some((function(t){var e=t.minimum,n=t.maximum;return 1!==e||1!==n}))}if(t.replace(/\s*<((?:[a-z_](?:|[a-z0-9_.-]*[_a-z0-9])[?*+]?)(?:\|(?:[a-z_](?:|[a-z0-9_.-]*[_a-z0-9])[?*+]?))*)>|\s*([^<]+)/gi,(function(e,n,s,a){var u=e.length;if(a!==i)throw new SyntaxError("Cannot parse token at index "+i+" in "+t);n?r.push(o(n)):r.push(s.trim()),i+=u})),1===r.length&&"string"==typeof r[0]?(this._legacyTypelessAssertionWarned||(console.warn("The typeless expect.addAssertion syntax is deprecated and will be removed in a future update\nPlease refer to http://unexpected.js.org/api/addAssertion/"),this._legacyTypelessAssertionWarned=!0),e={subject:o("any"),assertion:r[0],args:[o("any*")]}):e={subject:r[0],assertion:r[1],args:r.slice(2)},!Array.isArray(e.subject))throw new SyntaxError("Missing subject type in "+t);if("string"!=typeof e.assertion)throw new SyntaxError("Missing assertion in "+t);if(s(e.subject))throw new SyntaxError("The subject type cannot have varargs: "+t);if(e.args.some((function(t){return"string"==typeof t})))throw new SyntaxError("Only one assertion string is supported (see #225)");if(e.args.slice(0,-1).some(s))throw new SyntaxError("Only the last argument type can have varargs: "+t);if([e.subject].concat(e.args.slice(0,-1)).some((function(t){return t.some((function(t){return t.type.is("assertion")}))})))throw new SyntaxError("Only the last argument type can be <assertion>: "+t);var a=e.args[e.args.length-1]||[],u=a.filter((function(t){return t.type.is("assertion")}));if(u.length>0&&a.length>1)throw new SyntaxError("<assertion> cannot be alternated with other types: "+t);if(u.some((function(t){return 1!==t.maximum})))throw new SyntaxError("<assertion+> and <assertion*> are not allowed: "+t);return this.expandTypeAlternations(e)};var zn=/(\{(?:\d+)\})/g,qn=/\{(\d+)\}/;function Hn(t,e){for(var n=0;n<Math.min(t.length,e.length);n+=1){var r=e[n]-t[n];if(0!==r)return r}return e.length-t.length}function Kn(t){var e=t.subject,n=t.args;return[e.type.level].concat(n.map((function(t){var e=t.minimum,n=t.maximum;return(1===e&&1===n?.5:0)+t.type.level})))}function Wn(t){var e=0,n=0;return t.forEach((function(t){e+=t.minimum,n+=t.maximum})),{minimum:e,maximum:n}}function $n(t){return"function"==typeof t?D.getFunctionName(t):t.name}function Yn(t,e){for(var n=[],r=e;r;r=r.parent)r.assertions[t]&&n.push.apply(n,r.assertions[t]);return n}function Vn(t,e){if("string"!=typeof t)return null;var n=Yn(t,e);if(n.length>0)return n;for(var r=t.split(" "),i=r.length-1;i>0;i-=1){var o=Yn(r.slice(i).join(" "),e);if(Vn(r.slice(0,i).join(" "),e)&&o.length>0)return o}return null}function Jn(t){void 0===t&&(t={});var e=t.assertions;void 0===e&&(e={});var n=t.typeByName;void 0===n&&(n={any:In});var r=t.types;void 0===r&&(r=[In]);var i=t.output,o=t.format;void 0===o&&(o=Lt.defaultFormat);var s=t.installedPlugins;void 0===s&&(s=[]);var a=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return a._expect(new Sn,t)};return D.setPrototypeOfOrExtend(a,Un),i||((i=Lt()).inline=!1,i.diff=!1),Mn(a,{_topLevelExpect:a,_outputFormat:o,assertions:e,typeByName:n,installedPlugins:s,types:r,output:i})}Un._fail=function(t){var e=arguments;if(t instanceof xn)throw t._hasSerializedErrorMessage=!1,t;if(D.isError(t))throw t;var n=new xn(this);if("function"==typeof t)n.errorMode="bubble",n.output=t;else if(t&&"object"==typeof t)void 0!==t.message&&(n.errorMode="bubble"),n.output=function(e){void 0!==t.message?t.message.isMagicPen?e.append(t.message):"function"==typeof t.message?t.message.call(e,e):e.text(String(t.message)):e.error("Explicit failure")},Object.keys(t).forEach((function(e){var r=this,i=t[e];"diff"===e?"function"==typeof i&&this.parent?n.createDiff=function(t,e,n,o){var s=r.createOutput(t.format);return s.inline=t.inline,s.output=t.output,i(s,(function(t,e){return r.diff(t,e,s.clone())}),(function(t,e){return s.clone().appendInspected(t,(e||_n)-1)}),(function(t,e){return r.equal(t,e)}))}:n.createDiff=i:"message"!==e&&(n[e]=i)}),this);else{var r;if(arguments.length>0){r=new Array(arguments.length-1);for(var i=1;i<arguments.length;i+=1)r[i-1]=e[i]}n.errorMode="bubble",n.output=function(e){(t?String(t):"Explicit failure").split(zn).forEach((function(t){var n=qn.exec(t);if(n){var i=n[1];if(i in r){var o=r[i];o&&o.isMagicPen?e.append(o):e.appendInspected(o)}else e.text(n[0])}else e.error(t)}))}}throw n},Un.addAssertion=function(t,e,n){var r,i=this;if(this._frozen)throw new Error("Cannot add an assertion to a frozen instance, please run .clone() first");if(r="function"==typeof n?3:2,arguments.length>r||"function"!=typeof e||"string"!=typeof t&&!Array.isArray(t)){var o="Syntax: expect.addAssertion(<string|array[string]>, function (expect, subject, ...) { ... });";throw"string"!=typeof e&&!Array.isArray(e)||"function"!=typeof arguments[2]||(o+="\nAs of Unexpected 10, the syntax for adding assertions that apply only to specific\ntypes has changed. See http://unexpected.js.org/api/addAssertion/"),new Error(o)}var s=Array.isArray(t)?t:[t];s.forEach((function(t){if("string"!=typeof t||""===t)throw new Error("Assertion patterns must be a non-empty string");if(t!==t.trim())throw new Error("Assertion patterns can't start or end with whitespace:\n\n "+JSON.stringify(t))}));var a=this.assertions,u={},c=[],l=0;if(s.forEach((function(t){i.parseAssertion(t).forEach((function(r){var i=r.assertion,o=r.args,s=r.subject;On(i),Rn(i).forEach((function(r){var i=r.flags,a=r.alternations,f=r.text;Object.keys(i).forEach((function(t){u[t]=!1})),l=Math.max(l,o.reduce((function(t,e){var n=e.maximum;return t+(null===n?1/0:n)}),0));var h=Wn(o);c.push({handler:e,alternations:a,flags:i,subject:s,args:o,testDescriptionString:f,declaration:t,expect:n,minimum:h.minimum,maximum:h.maximum})}))}))})),e.length-2>l)throw new Error("The provided assertion handler takes "+(e.length-2)+" parameters, but the type signature specifies a maximum of "+l+":\n\n "+JSON.stringify(s));return c.forEach((function(t){t.flags=Mn({},u,t.flags);var e=a[t.testDescriptionString];if(t.specificity=Kn(t),e){for(var n=0;n<e.length&&Hn(t.specificity,e[n].specificity)>0;)n+=1;e.splice(n,0,t)}else a[t.testDescriptionString]=[t]})),this},Un.addType=function(t,e){var n,r=this;if(this._frozen)throw new Error("Cannot add a type to a frozen instance, please run .clone() first");if("string"!=typeof t.name||!/^[a-z_](?:|[a-z0-9_.-]*[_a-z0-9])$/i.test(t.name))throw new Error("A type must be given a non-empty name and must match ^[a-z_](?:|[a-z0-9_.-]*[_a-z0-9])$");if("function"!=typeof t.identify&&!1!==t.identify)throw new Error("Type "+t.name+" must specify an identify function or be declared abstract by setting identify to false");if(this.typeByName[t.name])throw new Error("The type with the name "+t.name+" already exists");if(t.base){if(!(n=this.getType(t.base)))throw new Error("Unknown base type: "+t.base)}else n=In;var i=Object.create(n);i.inspect=function(t,e,r){if(!r||!r.isMagicPen)throw new Error("You need to pass the output to baseType.inspect() as the third parameter");return n.inspect(t,e,r,(function(t,e){return r.clone().appendInspected(t,e)}))},"inspect"!==Dn&&(i[Dn]=i.inspect),i.diff=function(t,e,i){if(!i||!i.isMagicPen)throw new Error("You need to pass the output to baseType.diff() as the third parameter");return n.diff(t,e,i.clone(),(function(t,e){return r.diff(t,e,i.clone())}),(function(t,e){return i.clone().appendInspected(t,e)}),r.equal.bind(r))},i.equal=function(t,e){return n.equal(t,e,r.equal.bind(r))};var o=Mn({},n,t,{baseType:i}),s=o.inspect;if("inspect"!==Dn&&(o[Dn]=function(){return"type: "+t.name}),o.inspect=function(n,r,i,o){if(arguments.length<2||!i||!i.isMagicPen)return"type: "+t.name;if(e){var a=e.createOutput(i.format);return s.call(this,n,r,a,o)||a}return s.call(this,n,r,i,o)||i},e){o.childExpect=e;var a=o.diff;o.diff=function(t,n,r,i,o,s){var u=e.createOutput(r.format);return u.output=r.output,a.call(this,t,n,u,i,o,s)||r}}return!1===o.identify?this.types.push(o):this.types.unshift(o),o.level=n.level+1,o.typeEqualityCache={},this.typeByName[o.name]=o,this},Un.getType=function(t){return this.typeByName[t]||this.parent&&this.parent.getType(t)},Un.findTypeOf=function(t){return D.findFirst(this.types||[],(function(e){return e.identify&&e.identify(t)}))||this.parent&&this.parent.findTypeOf(t)},Un.findTypeOfWithParentType=function(t,e){return D.findFirst(this.types||[],(function(n){return n.identify&&n.identify(t)&&(!e||n.is(e))}))||this.parent&&this.parent.findTypeOfWithParentType(t,e)},Un.findCommonType=function(t,e){for(var n={},r=this.findTypeOf(t);r;)n[r.name]=r,r=r.baseType;for(r=this.findTypeOf(e);r;){if(n[r.name])return r;r=r.baseType}},Un.addStyle=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];if(this._frozen)throw new Error("Cannot add a style to a frozen instance, please run .clone() first");return(t=this.output).addStyle.apply(t,e),this},Un.installTheme=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];if(this._frozen)throw new Error("Cannot install a theme into a frozen instance, please run .clone() first");return(t=this.output).installTheme.apply(t,e),this},Un.use=function(t){if(this._assertTopLevelExpect(),this._frozen)throw new Error("Cannot install a plugin into a frozen instance, please run .clone() first");if("function"!=typeof t&&("object"!=typeof t||"function"!=typeof t.installInto)||void 0!==t.name&&"string"!=typeof t.name)throw new Error("Plugins must be functions or adhere to the following interface\n{\n name: <an optional plugin name>,\n version: <an optional semver version string>,\n installInto: <a function that will update the given expect instance>\n}");var e=$n(t),n=D.findFirst(this.installedPlugins,(function(n){return n===t||e&&e===$n(n)}));if(n){if(n===t||void 0!==t.version&&t.version===n.version)return this;throw new Error("Another instance of the plugin '"+e+"' is already installed"+(void 0!==n.version?" (version "+n.version+(void 0!==t.version?", trying to install "+t.version:"")+")":"")+". Please check your node_modules folder for unmet peerDependencies.")}if("unexpected-promise"===e)throw new Error("The unexpected-promise plugin was pulled into Unexpected as of 8.5.0. This means that the plugin is no longer supported.");return this.installedPlugins.push(t),"function"==typeof t?t(this):t.installInto(this),this},Un.withError=function(t,e){return ln(dn(t).caught((function(t){return fn(t),e(t)})))},Un.installPlugin=Un.use,Un.throwAssertionNotFoundError=function(t,e,r){for(var i=this,o=this.assertions[e],s=this;s&&!o;)o=s.assertions[e],s=s.parent;o&&this.fail({message:function(s){s.append(n(s.clone(),(function(e){e.appendInspected(t)}),e,(function(t){t.appendItems(r,", ")}))).nl().indentLines(),s.i().error("The assertion does not have a matching signature for:").nl().indentLines().i().text("<").text(i.findTypeOf(t).name).text(">").sp().text(e),r.forEach((function(t,e){s.sp().text("<").text(i.findTypeOf(t).name).text(">")})),s.outdentLines().nl().i().text("did you mean:").indentLines().nl(),Object.keys(o.reduce((function(t,e){return t[e.declaration]=!0,t}),{})).sort().forEach((function(t,e){s.nl(e>0?1:0).i().text(t)})),s.outdentLines()}});var a=[],u=[];for(s=this;s;)u.push.apply(u,Object.keys(s.assertions)),s=s.parent;u.forEach((function(t){var n=Ut(e,t);a.push({assertion:t,score:n})}));var c=a.sort((function(t,e){var n=t.score-e.score;return 0!==n?n:t.assertion<e.assertion?-1:1})).slice(0,10).filter((function(t,e,n){var r=t.score;return Math.abs(r-n[0].score)<=2})).sort((function(e,n){var o=function(e,n){var o=i.lookupAssertionRule(t,e,r),s=i.lookupAssertionRule(t,n,r);return o||s?o&&!s?-1:!o&&s?1:Hn(o.specificity,s.specificity):0}(e.assertion,n.assertion);return 0!==o?o:e.score-n.score}))[0];this.fail({errorMode:"bubbleThrough",message:function(t){t.error("Unknown assertion '").jsString(e).error("', did you mean: '").jsString(c.assertion).error("'")}})},Un.lookupAssertionRule=function(t,e,n,r){var i,o=this;if("string"!=typeof e)throw new Error("The expect function requires the second parameter to be a string or an expect.it.");for(var s=this;s;){var a=s.assertions[e];a&&(i=i?i.concat(a):a),s=s.parent}if(!i)return null;var u,c,l={},f=function(t,e,n,r){return!(!e.is("assertion")||"string"!=typeof t)||(r?!1===e.identify?o.types.some((function(n){return n.identify&&n.is(e)&&n.identify(t)})):e.identify(t):function(t,e){var n=l[e];return n||(n=o.findTypeOf(t),l[e]=n),n}(t,n).is(e))};function h(e,i){if(!f(t,e.subject.type,"subject",i))return!1;if(r&&!e.args.some(Bn))return!1;if(n.length<e.minimum||e.maximum<n.length)return!1;if(0===n.length&&0===e.maximum)return!0;var o=e.args[e.args.length-1];return n.every((function(t,n){return n<e.args.length-1?f(t,e.args[n].type,n,i):f(t,o.type,n,i)}))}for(u=0;u<i.length;u+=1)if(h(c=i[u]))return c;for(u=0;u<i.length;u+=1)if(h(c=i[u],!0))return c;return null},Un._assertTopLevelExpect=function(){if(this.flags)throw new Error("This method only works on the top level expect function")},Un._assertWrappedExpect=function(){if(!this.flags)throw new Error("This method only works on the expect function handed to an assertion")},Un.setErrorMessage=function(t){t.serializeMessage(this.outputFormat())},Un._createWrappedExpect=function(t,n,r,i,o,s){var a=Mn({},s,t.flags),u=this;function c(t,e){var n=arguments;if(0===arguments.length)throw new Error("The expect function requires at least one parameter.");if(1===arguments.length)return yn(dn.resolve(t),c,t);if("function"==typeof e)return c.errorMode="nested",c.withError((function(){return e(t)}),(function(t){c.fail(t)}));e=D.forwardFlags(e,a);for(var r=new Array(arguments.length-2),i=2;i<arguments.length;i+=1)r[i-2]=n[i];return c._callInNestedContext((function(){return u._executeExpect(o.child(),t,e,r,c.flags)}))}return D.setPrototypeOfOrExtend(c,this),c.context=o,c.execute=c,c.alternations=t.alternations,c.flags=a,c.subject=n,c.testDescription=i,c.args=r,c.assertionRule=t,c.subjectOutput=function(t){t.appendInspected(n)},c.argsOutput=r.map((function(t,n){var r=c.assertionRule.args[n];return"string"==typeof t&&(r&&r.type.is("assertion")||c._getAssertionIndices().indexOf(n)>=0)?new e(D.forwardFlags(t,a)):function(e){e.appendInspected(t)}})),c},Un._executeExpect=function(t,e,n,r,i){i&&(n=D.forwardFlags(n,i));var o=this.lookupAssertionRule(e,n,r);if(!o){var s=n.split(" ");t:for(var a=s.length-1;a>0;a-=1){var u=s.slice(0,a).join(" "),c=s.slice(a),l=[c.join(" ")].concat(r);if(o=this.lookupAssertionRule(e,u,l,!0))for(var f=1;f<c.length;f+=1)if(Object.prototype.hasOwnProperty.call(this.assertions,c.slice(0,f+1).join(" "))){n=u,r=l;break t}}o||this.throwAssertionNotFoundError(e,n,r)}if(o.expect&&o.expect!==this._topLevelExpect)return o.expect._expect(t,[e,n].concat(r));var h=this._createWrappedExpect(o,e,r,n,t,i);return ln(o.handler.apply(o,[h,e].concat(r)))},Un._expect=function(t,e,n){var r=this,i=e[0],o=e[1];if(e.length<2)throw new Error("The expect function requires at least two parameters.");if("function"==typeof o)return this.withError((function(){return o(i)}),(function(t){r.fail(t)}));try{var s=this._executeExpect(t,i,o,Array.prototype.slice.call(e,2),n);return D.isPromise(s)?(s=gn(s)).isPending()&&(s=s.then(void 0,(function(e){throw e&&e._isUnexpected&&0===t.level&&r.setErrorMessage(e),e})),this.notifyPendingPromise(s)):s=dn.resolve(s),yn(s,this,i)}catch(e){if(e&&e._isUnexpected){var a=e;throw"undefined"!=typeof mochaPhantomJS&&(a=e.clone()),0===t.level&&this.setErrorMessage(a),a}throw e}},Un.diff=function(t,e,n,r,i){var o=this;void 0===n&&(n=this.createOutput());if((r="number"==typeof r?r:100)<=0){if(-1!==(i=i||[]).indexOf(t))throw new Error("Cannot compare circular structures");i.push(t)}return this.findCommonType(t,e).diff(t,e,n,(function(t,e){return o.diff(t,e,n.clone(),r-1,i)}),(function(t,e){return n.clone().appendInspected(t,e)}),(function(t,e){return o.equal(t,e)}))},Un.toString=function(){var t=this.assertions,e={},n=[],r=Lt();return Object.keys(t).sort().forEach((function(r){t[r].forEach((function(t){var r=t.declaration;e[r]||(n.push(r),e[r]=!0)}))})),n.forEach((function(t){r.text(t).nl()})),r.toString()},Un.clone=function(){this._assertTopLevelExpect();var t={};Object.keys(this.assertions).forEach((function(e){t[e]=[].concat(this.assertions[e])}),this);var e=Jn({assertions:t,types:[].concat(this.types),typeByName:Mn({},this.typeByName),output:this.output.clone(),format:this.outputFormat(),installedPlugins:[].concat(this.installedPlugins)});return e._expect=this._expect,e.output.preferredWidth=this.output.preferredWidth,e},Un.child=function(){this._assertTopLevelExpect();var t=Jn({assertions:{},types:[],typeByName:{},output:this.output.clone(),format:this.outputFormat(),installedPlugins:[]}),e=t.parent=this;return t.exportAssertion=function(n,r){return e.addAssertion(n,r,t),this},t.exportType=function(n){return t.getType(n.name)!==n&&t.addType(n),e.addType(n,t),this},t.exportStyle=function(n,r,i){return e.addStyle(n,(function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=t.createOutput(this.format);this.append(r.call.apply(r,[i].concat(e))||i)}),i),this},t},Un.freeze=function(){return this._assertTopLevelExpect(),this._frozen=!0,this},Un.outputFormat=function(t){return this._assertTopLevelExpect(),void 0===t?this._outputFormat:(this._outputFormat=t,this)},Un.createOutput=function(t){var e=this,n=this.output.clone(t||"text");return n.addStyle("appendInspected",(function(t,n){this.append(e.inspect(t,n,this.clone()))})),n},Un.hook=function(t){if(this._assertTopLevelExpect(),this._frozen)throw new Error("Cannot install a hook into a frozen instance, please run .clone() first");this._expect=t(this._expect.bind(this))},Un.fail=function(){for(var t,e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];if(this.flags)this._callInNestedContext((function(){var t;(t=e._topLevelExpect)._fail.apply(t,n)}));else try{(t=this)._fail.apply(t,n)}catch(t){throw t&&t._isUnexpected&&this.setErrorMessage(t),t}},Un.standardErrorMessage=function(t,e){var r=this;return this._assertWrappedExpect(),e="object"==typeof e?e:{},"omitSubject"in t&&(e.subject=this.subject),e&&e.compact&&(e.compactSubject=function(t){t.jsFunctionName(r.subjectType.name)}),n(t,this.subjectOutput,this.testDescription,this.argsOutput,e)},Un._callInNestedContext=function(t){var e=this;this._assertWrappedExpect();try{var n=ln(t());return D.isPromise(n)?(n=gn(n)).isPending()&&(n=n.then(void 0,(function(t){if(t&&t._isUnexpected){var n=new xn(e,t);throw n.originalError=t.originalError,n}throw t}))):n=dn.resolve(n),yn(n,this.execute,this.subject)}catch(t){if(t&&t._isUnexpected){var r=new xn(this,t);throw r.originalError=t.originalError,r}throw t}},Un.shift=function(t,e){var n,r=this;if(this._assertWrappedExpect(),arguments.length<=1){0===arguments.length&&(t=this.subject),e=-1;for(var i=0;i<this.assertionRule.args.length;i+=1){var o=this.assertionRule.args[i].type;if(o.is("assertion")||o.is("expect.it")){e=i;break}}}else 3===arguments.length&&(t=arguments[1],e=arguments[2]);if(-1!==e){var s=this.args.slice(0,e),a=this.args.slice(e),u=this.findTypeOf(a[0]);return arguments.length>1&&(this.argsOutput=function(t){s.forEach((function(e,n){n>0&&t.text(", "),t.appendInspected(e)})),s.length>0&&t.sp(),u.is("string")?t.error(a[0]):a.length>0&&t.appendInspected(a[0]),a.length>1&&t.sp(),a.slice(1).forEach((function(e,n){n>0&&t.text(", "),t.appendInspected(e)}))}),u.is("expect.it")?this.withError((function(){return a[0](t)}),(function(t){r.fail(t)})):u.is("string")?(n=this).execute.apply(n,[t].concat(a)):t}return t},Un._getSubjectType=function(){return this._assertWrappedExpect(),this.findTypeOfWithParentType(this.subject,this.assertionRule.subject.type)},Un._getArgTypes=function(t){var e=this;this._assertWrappedExpect();var n=this.assertionRule.args.length-1;return this.args.map((function(t,r){return e.findTypeOfWithParentType(t,e.assertionRule.args[Math.min(r,n)].type)}))},Un._getAssertionIndices=function(){if(this._assertWrappedExpect(),!this._assertionIndices){var t=[],e=this.args,n=this.assertionRule,r=0;t:for(;;){if(n.args.length>1&&Bn(n.args[n.args.length-2])){t.push(r+n.args.length-2);var i=Vn(e[r+n.args.length-2],this);if(i)for(var o=0;o<i.length;o+=1)if(i[o].args.some(Bn)){r+=n.args.length-1,n=i[o];continue t}}break}this._assertionIndices=t}return this._assertionIndices},Object.defineProperty(Un,"subjectType",{enumerable:!0,get:function(){return this._assertWrappedExpect(),this._getSubjectType()}}),Object.defineProperty(Un,"argTypes",{enumerable:!0,get:function(){return this._assertWrappedExpect(),this._getArgTypes()}});var Qn=Jn;function Gn(){}function Xn(t,e,n,r,i){for(var o=0,s=e.length,a=0,u=0;o<s;o++){var c=e[o];if(c.removed){if(c.value=t.join(r.slice(u,u+c.count)),u+=c.count,o&&e[o-1].added){var l=e[o-1];e[o-1]=e[o],e[o]=l}}else{if(!c.added&&i){var f=n.slice(a,a+c.count);f=f.map((function(t,e){var n=r[u+e];return n.length>t.length?n:t})),c.value=t.join(f)}else c.value=t.join(n.slice(a,a+c.count));a+=c.count,c.added||(u+=c.count)}}var h=e[s-1];return s>1&&"string"==typeof h.value&&(h.added||h.removed)&&t.equals("",h.value)&&(e[s-2].value+=h.value,e.pop()),e}function Zn(t){return{newPos:t.newPos,components:t.components.slice(0)}}Gn.prototype={diff:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var i=this;function o(t){return r?(setTimeout((function(){r(void 0,t)}),0),!0):t}t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t));var s=(e=this.removeEmpty(this.tokenize(e))).length,a=t.length,u=1,c=s+a,l=[{newPos:-1,components:[]}],f=this.extractCommon(l[0],e,t,0);if(l[0].newPos+1>=s&&f+1>=a)return o([{value:this.join(e),count:e.length}]);function h(){for(var n=-1*u;n<=u;n+=2){var r=void 0,c=l[n-1],f=l[n+1],h=(f?f.newPos:0)-n;c&&(l[n-1]=void 0);var p=c&&c.newPos+1<s,d=f&&0<=h&&h<a;if(p||d){if(!p||d&&c.newPos<f.newPos?(r=Zn(f),i.pushComponent(r.components,void 0,!0)):((r=c).newPos++,i.pushComponent(r.components,!0,void 0)),h=i.extractCommon(r,e,t,n),r.newPos+1>=s&&h+1>=a)return o(Xn(i,r.components,e,t,i.useLongestToken));l[n]=r}else l[n]=void 0}u++}if(r)!function t(){setTimeout((function(){if(u>c)return r();h()||t()}),0)}();else for(;u<=c;){var p=h();if(p)return p}},pushComponent:function(t,e,n){var r=t[t.length-1];r&&r.added===e&&r.removed===n?t[t.length-1]={count:r.count+1,added:e,removed:n}:t.push({count:1,added:e,removed:n})},extractCommon:function(t,e,n,r){for(var i=e.length,o=n.length,s=t.newPos,a=s-r,u=0;s+1<i&&a+1<o&&this.equals(e[s+1],n[a+1]);)s++,a++,u++;return u&&t.components.push({count:u}),t.newPos=s,a},equals:function(t,e){return this.options.comparator?this.options.comparator(t,e):t===e||this.options.ignoreCase&&t.toLowerCase()===e.toLowerCase()},removeEmpty:function(t){for(var e=[],n=0;n<t.length;n++)t[n]&&e.push(t[n]);return e},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};var tr=new Gn;function er(t,e){if("function"==typeof t)e.callback=t;else if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var nr=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,rr=/\S/,ir=new Gn;ir.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!rr.test(t)&&!rr.test(e)},ir.tokenize=function(t){for(var e=t.split(/(\s+|[()[\]{}'"]|\b)/),n=0;n<e.length-1;n++)!e[n+1]&&e[n+2]&&nr.test(e[n])&&nr.test(e[n+2])&&(e[n]+=e[n+2],e.splice(n+1,2),n--);return e};var or=new Gn;function sr(t,e,n){return or.diff(t,e,n)}or.tokenize=function(t){var e=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?e[e.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),e.push(i))}return e};var ar=new Gn;ar.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};var ur=new Gn;function cr(t){return(cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}ur.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};var fr=Object.prototype.toString,hr=new Gn;function pr(t,e,n,r,i){var o,s;for(e=e||[],n=n||[],r&&(t=r(i,t)),o=0;o<e.length;o+=1)if(e[o]===t)return n[o];if("[object Array]"===fr.call(t)){for(e.push(t),s=new Array(t.length),n.push(s),o=0;o<t.length;o+=1)s[o]=pr(t[o],e,n,r,i);return e.pop(),n.pop(),s}if(t&&t.toJSON&&(t=t.toJSON()),"object"===cr(t)&&null!==t){e.push(t),s={},n.push(s);var a,u=[];for(a in t)t.hasOwnProperty(a)&&u.push(a);for(u.sort(),o=0;o<u.length;o+=1)s[a=u[o]]=pr(t[a],e,n,r,a);e.pop(),n.pop()}else s=t;return s}hr.useLongestToken=!0,hr.tokenize=or.tokenize,hr.castInput=function(t){var e=this.options,n=e.undefinedReplacement,r=e.stringifyReplacer,i=void 0===r?function(t,e){return void 0===e?n:e}:r;return"string"==typeof t?t:JSON.stringify(pr(t,null,null,i),i," ")},hr.equals=function(t,e){return Gn.prototype.equals.call(hr,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};var dr=new Gn;function yr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.split(/\r\n|[\n\v\f\r\x85]/),r=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],i=[],o=0;function s(){var t={};for(i.push(t);o<n.length;){var r=n[o];if(/^(\-\-\-|\+\+\+|@@)\s/.test(r))break;var s=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(r);s&&(t.index=s[1]),o++}for(a(t),a(t),t.hunks=[];o<n.length;){var c=n[o];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(c))break;if(/^@@/.test(c))t.hunks.push(u());else{if(c&&e.strict)throw new Error("Unknown line "+(o+1)+" "+JSON.stringify(c));o++}}}function a(t){var e=/^(---|\+\+\+)\s+(.*)$/.exec(n[o]);if(e){var r="---"===e[1]?"old":"new",i=e[2].split("\t",2),s=i[0].replace(/\\\\/g,"\\");/^".*"$/.test(s)&&(s=s.substr(1,s.length-2)),t[r+"FileName"]=s,t[r+"Header"]=(i[1]||"").trim(),o++}}function u(){for(var t=o,i=n[o++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),s={oldStart:+i[1],oldLines:+i[2]||1,newStart:+i[3],newLines:+i[4]||1,lines:[],linedelimiters:[]},a=0,u=0;o<n.length&&!(0===n[o].indexOf("--- ")&&o+2<n.length&&0===n[o+1].indexOf("+++ ")&&0===n[o+2].indexOf("@@"));o++){var c=0==n[o].length&&o!=n.length-1?" ":n[o][0];if("+"!==c&&"-"!==c&&" "!==c&&"\\"!==c)break;s.lines.push(n[o]),s.linedelimiters.push(r[o]||"\n"),"+"===c?a++:"-"===c?u++:" "===c&&(a++,u++)}if(a||1!==s.newLines||(s.newLines=0),u||1!==s.oldLines||(s.oldLines=0),e.strict){if(a!==s.newLines)throw new Error("Added line count did not match for hunk at line "+(t+1));if(u!==s.oldLines)throw new Error("Removed line count did not match for hunk at line "+(t+1))}return s}for(;o<n.length;)s();return i}function gr(t,e,n){var r=!0,i=!1,o=!1,s=1;return function a(){if(r&&!o){if(i?s++:r=!1,t+s<=n)return s;o=!0}if(!i)return o||(r=!0),e<=t-s?-s++:(i=!0,a())}}function vr(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof e&&(e=yr(e)),Array.isArray(e)){if(e.length>1)throw new Error("applyPatch only works with a single input.");e=e[0]}var r,i,o=t.split(/\r\n|[\n\v\f\r\x85]/),s=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],a=e.hunks,u=n.compareLine||function(t,e,n,r){return e===r},c=0,l=n.fuzzFactor||0,f=0,h=0;function p(t,e){for(var n=0;n<t.lines.length;n++){var r=t.lines[n],i=r.length>0?r[0]:" ",s=r.length>0?r.substr(1):r;if(" "===i||"-"===i){if(!u(e+1,o[e],i,s)&&++c>l)return!1;e++}}return!0}for(var d=0;d<a.length;d++){for(var y=a[d],g=o.length-y.oldLines,v=0,m=h+y.oldStart-1,b=gr(m,f,g);void 0!==v;v=b())if(p(y,m+v)){y.offset=h+=v;break}if(void 0===v)return!1;f=y.offset+y.oldStart+y.oldLines}for(var _=0,w=0;w<a.length;w++){var E=a[w],x=E.oldStart+E.offset+_-1;_+=E.newLines-E.oldLines,x<0&&(x=0);for(var A=0;A<E.lines.length;A++){var F=E.lines[A],j=F.length>0?F[0]:" ",k=F.length>0?F.substr(1):F,C=E.linedelimiters[A];if(" "===j)x++;else if("-"===j)o.splice(x,1),s.splice(x,1);else if("+"===j)o.splice(x,0,k),s.splice(x,0,C),x++;else if("\\"===j){var T=E.lines[A-1]?E.lines[A-1][0]:null;"+"===T?r=!0:"-"===T&&(i=!0)}}}if(r)for(;!o[o.length-1];)o.pop(),s.pop();else i&&(o.push(""),s.push("\n"));for(var S=0;S<o.length-1;S++)o[S]=o[S]+s[S];return o.join("")}function mr(t,e,n,r,i,o,s){s||(s={}),void 0===s.context&&(s.context=4);var a=sr(n,r,s);function u(t){return t.map((function(t){return" "+t}))}a.push({value:"",lines:[]});for(var c=[],l=0,f=0,h=[],p=1,d=1,y=function(t){var e=a[t],i=e.lines||e.value.replace(/\n$/,"").split("\n");if(e.lines=i,e.added||e.removed){var o;if(!l){var y=a[t-1];l=p,f=d,y&&(h=s.context>0?u(y.lines.slice(-s.context)):[],l-=h.length,f-=h.length)}(o=h).push.apply(o,lr(i.map((function(t){return(e.added?"+":"-")+t})))),e.added?d+=i.length:p+=i.length}else{if(l)if(i.length<=2*s.context&&t<a.length-2){var g;(g=h).push.apply(g,lr(u(i)))}else{var v,m=Math.min(i.length,s.context);(v=h).push.apply(v,lr(u(i.slice(0,m))));var b={oldStart:l,oldLines:p-l+m,newStart:f,newLines:d-f+m,lines:h};if(t>=a.length-2&&i.length<=s.context){var _=/\n$/.test(n),w=/\n$/.test(r),E=0==i.length&&h.length>b.oldLines;!_&&E&&h.splice(b.oldLines,0,"\\ No newline at end of file"),(_||E)&&w||h.push("\\ No newline at end of file")}c.push(b),l=0,f=0,h=[]}p+=i.length,d+=i.length}},g=0;g<a.length;g++)y(g);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:o,hunks:c}}function br(t,e,n,r,i,o,s){var a=mr(t,e,n,r,i,o,s),u=[];t==e&&u.push("Index: "+t),u.push("==================================================================="),u.push("--- "+a.oldFileName+(void 0===a.oldHeader?"":"\t"+a.oldHeader)),u.push("+++ "+a.newFileName+(void 0===a.newHeader?"":"\t"+a.newHeader));for(var c=0;c<a.hunks.length;c++){var l=a.hunks[c];u.push("@@ -"+l.oldStart+","+l.oldLines+" +"+l.newStart+","+l.newLines+" @@"),u.push.apply(u,l.lines)}return u.join("\n")+"\n"}function _r(t,e){if(e.length>t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function wr(t){var e=function t(e){var n=0,r=0;return e.forEach((function(e){if("string"!=typeof e){var i=t(e.mine),o=t(e.theirs);void 0!==n&&(i.oldLines===o.oldLines?n+=i.oldLines:n=void 0),void 0!==r&&(i.newLines===o.newLines?r+=i.newLines:r=void 0)}else void 0===r||"+"!==e[0]&&" "!==e[0]||r++,void 0===n||"-"!==e[0]&&" "!==e[0]||n++})),{oldLines:n,newLines:r}}(t.lines),n=e.oldLines,r=e.newLines;void 0!==n?t.oldLines=n:delete t.oldLines,void 0!==r?t.newLines=r:delete t.newLines}function Er(t,e){if("string"==typeof t){if(/^@@/m.test(t)||/^Index:/m.test(t))return yr(t)[0];if(!e)throw new Error("Must provide a base reference or pass in a patch");return mr(void 0,void 0,e,t)}return t}function xr(t){return t.newFileName&&t.newFileName!==t.oldFileName}function Ar(t,e,n){return e===n?e:(t.conflict=!0,{mine:e,theirs:n})}function Fr(t,e){return t.oldStart<e.oldStart&&t.oldStart+t.oldLines<e.oldStart}function jr(t,e){return{oldStart:t.oldStart,oldLines:t.oldLines,newStart:t.newStart+e,newLines:t.newLines,lines:t.lines}}function kr(t,e,n,r,i){var o={offset:e,lines:n,index:0},s={offset:r,lines:i,index:0};for(Or(t,o,s),Or(t,s,o);o.index<o.lines.length&&s.index<s.lines.length;){var a=o.lines[o.index],u=s.lines[s.index];if("-"!==a[0]&&"+"!==a[0]||"-"!==u[0]&&"+"!==u[0])if("+"===a[0]&&" "===u[0]){var c;(c=t.lines).push.apply(c,lr(Rr(o)))}else if("+"===u[0]&&" "===a[0]){var l;(l=t.lines).push.apply(l,lr(Rr(s)))}else"-"===a[0]&&" "===u[0]?Tr(t,o,s):"-"===u[0]&&" "===a[0]?Tr(t,s,o,!0):a===u?(t.lines.push(a),o.index++,s.index++):Sr(t,Rr(o),Rr(s));else Cr(t,o,s)}Pr(t,o),Pr(t,s),wr(t)}function Cr(t,e,n){var r=Rr(e),i=Rr(n);if(Dr(r)&&Dr(i)){var o,s;if(_r(r,i)&&Mr(n,r,r.length-i.length))return void(o=t.lines).push.apply(o,lr(r));if(_r(i,r)&&Mr(e,i,i.length-r.length))return void(s=t.lines).push.apply(s,lr(i))}else if(function(t,e){return t.length===e.length&&_r(t,e)}(r,i)){var a;return void(a=t.lines).push.apply(a,lr(r))}Sr(t,r,i)}function Tr(t,e,n,r){var i,o=Rr(e),s=function(t,e){var n=[],r=[],i=0,o=!1,s=!1;for(;i<e.length&&t.index<t.lines.length;){var a=t.lines[t.index],u=e[i];if("+"===u[0])break;if(o=o||" "!==a[0],r.push(u),i++,"+"===a[0])for(s=!0;"+"===a[0];)n.push(a),a=t.lines[++t.index];u.substr(1)===a.substr(1)?(n.push(a),t.index++):s=!0}"+"===(e[i]||"")[0]&&o&&(s=!0);if(s)return n;for(;i<e.length;)r.push(e[i++]);return{merged:r,changes:n}}(n,o);s.merged?(i=t.lines).push.apply(i,lr(s.merged)):Sr(t,r?s:o,r?o:s)}function Sr(t,e,n){t.conflict=!0,t.lines.push({conflict:!0,mine:e,theirs:n})}function Or(t,e,n){for(;e.offset<n.offset&&e.index<e.lines.length;){var r=e.lines[e.index++];t.lines.push(r),e.offset++}}function Pr(t,e){for(;e.index<e.lines.length;){var n=e.lines[e.index++];t.lines.push(n)}}function Rr(t){for(var e=[],n=t.lines[t.index][0];t.index<t.lines.length;){var r=t.lines[t.index];if("-"===n&&"+"===r[0]&&(n="+"),n!==r[0])break;e.push(r),t.index++}return e}function Dr(t){return t.reduce((function(t,e){return t&&"-"===e[0]}),!0)}function Mr(t,e,n){for(var r=0;r<n;r++){var i=e[e.length-n+r].substr(1);if(t.lines[t.index+r]!==" "+i)return!1}return t.index+=n,!0}function Br(t){var e=t;return e=(e=(e=(e=e.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/"/g,"&quot;")}dr.tokenize=function(t){return t.slice()},dr.join=dr.removeEmpty=function(t){return t};var Ir=Object.freeze({__proto__:null,Diff:Gn,diffChars:function(t,e,n){return tr.diff(t,e,n)},diffWords:function(t,e,n){return n=er(n,{ignoreWhitespace:!0}),ir.diff(t,e,n)},diffWordsWithSpace:function(t,e,n){return ir.diff(t,e,n)},diffLines:sr,diffTrimmedLines:function(t,e,n){var r=er(n,{ignoreWhitespace:!0});return or.diff(t,e,r)},diffSentences:function(t,e,n){return ar.diff(t,e,n)},diffCss:function(t,e,n){return ur.diff(t,e,n)},diffJson:function(t,e,n){return hr.diff(t,e,n)},diffArrays:function(t,e,n){return dr.diff(t,e,n)},structuredPatch:mr,createTwoFilesPatch:br,createPatch:function(t,e,n,r,i,o){return br(t,t,e,n,r,i,o)},applyPatch:vr,applyPatches:function(t,e){"string"==typeof t&&(t=yr(t));var n=0;!function r(){var i=t[n++];if(!i)return e.complete();e.loadFile(i,(function(t,n){if(t)return e.complete(t);var o=vr(n,i,e);e.patched(i,o,(function(t){if(t)return e.complete(t);r()}))}))}()},parsePatch:yr,merge:function(t,e,n){t=Er(t,n),e=Er(e,n);var r={};(t.index||e.index)&&(r.index=t.index||e.index),(t.newFileName||e.newFileName)&&(xr(t)?xr(e)?(r.oldFileName=Ar(r,t.oldFileName,e.oldFileName),r.newFileName=Ar(r,t.newFileName,e.newFileName),r.oldHeader=Ar(r,t.oldHeader,e.oldHeader),r.newHeader=Ar(r,t.newHeader,e.newHeader)):(r.oldFileName=t.oldFileName,r.newFileName=t.newFileName,r.oldHeader=t.oldHeader,r.newHeader=t.newHeader):(r.oldFileName=e.oldFileName||t.oldFileName,r.newFileName=e.newFileName||t.newFileName,r.oldHeader=e.oldHeader||t.oldHeader,r.newHeader=e.newHeader||t.newHeader)),r.hunks=[];for(var i=0,o=0,s=0,a=0;i<t.hunks.length||o<e.hunks.length;){var u=t.hunks[i]||{oldStart:1/0},c=e.hunks[o]||{oldStart:1/0};if(Fr(u,c))r.hunks.push(jr(u,s)),i++,a+=u.newLines-u.oldLines;else if(Fr(c,u))r.hunks.push(jr(c,a)),o++,s+=c.newLines-c.oldLines;else{var l={oldStart:Math.min(u.oldStart,c.oldStart),oldLines:0,newStart:Math.min(u.newStart+s,c.oldStart+a),newLines:0,lines:[]};kr(l,u.oldStart,u.lines,c.oldStart,c.lines),o++,i++,r.hunks.push(l)}}return r},convertChangesToDMP:function(t){for(var e,n,r=[],i=0;i<t.length;i++)n=(e=t[i]).added?1:e.removed?-1:0,r.push([n,e.value]);return r},convertChangesToXML:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];r.added?e.push("<ins>"):r.removed&&e.push("<del>"),e.push(Br(r.value)),r.added?e.push("</ins>"):r.removed&&e.push("</del>")}return e.join("")},canonicalize:pr}),Lr=/([\x00-\x09\x0B-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BA-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF])/g,Nr=[],Ur=[],zr="undefined"!=typeof Uint8Array?Uint8Array:Array,qr=!1;function Hr(){qr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,n=t.length;e<n;++e)Nr[e]=t[e],Ur[t.charCodeAt(e)]=e;Ur["-".charCodeAt(0)]=62,Ur["_".charCodeAt(0)]=63}function Kr(t,e,n){for(var r,i,o=[],s=e;s<n;s+=3)r=(t[s]<<16)+(t[s+1]<<8)+t[s+2],o.push(Nr[(i=r)>>18&63]+Nr[i>>12&63]+Nr[i>>6&63]+Nr[63&i]);return o.join("")}function Wr(t){var e;qr||Hr();for(var n=t.length,r=n%3,i="",o=[],s=0,a=n-r;s<a;s+=16383)o.push(Kr(t,s,s+16383>a?a:s+16383));return 1===r?(e=t[n-1],i+=Nr[e>>2],i+=Nr[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=Nr[e>>10],i+=Nr[e>>4&63],i+=Nr[e<<2&63],i+="="),o.push(i),o.join("")}function $r(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)}function Yr(t,e,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[n+p]=255&s,p+=d,s/=256,c-=8);t[n+p-d]|=128*y}var Vr={}.toString,Jr=Array.isArray||function(t){return"[object Array]"==Vr.call(t)};function Qr(){return Xr.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Gr(t,e){if(Qr()<e)throw new RangeError("Invalid typed array length");return Xr.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Xr.prototype:(null===t&&(t=new Xr(e)),t.length=e),t}function Xr(t,e,n){if(!(Xr.TYPED_ARRAY_SUPPORT||this instanceof Xr))return new Xr(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return ei(this,t)}return Zr(this,t,e,n)}function Zr(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);Xr.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Xr.prototype:t=ni(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!Xr.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|oi(e,n),i=(t=Gr(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(ii(e)){var n=0|ri(e.length);return 0===(t=Gr(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?Gr(t,0):ni(t,e);if("Buffer"===e.type&&Jr(e.data))return ni(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function ti(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ei(t,e){if(ti(e),t=Gr(t,e<0?0:0|ri(e)),!Xr.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function ni(t,e){var n=e.length<0?0:0|ri(e.length);t=Gr(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function ri(t){if(t>=Qr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Qr().toString(16)+" bytes");return 0|t}function ii(t){return!(null==t||!t._isBuffer)}function oi(t,e){if(ii(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Oi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Pi(t).length;default:if(r)return Oi(t).length;e=(""+e).toLowerCase(),r=!0}}function si(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return _i(this,e,n);case"utf8":case"utf-8":return vi(this,e,n);case"ascii":return mi(this,e,n);case"latin1":case"binary":return bi(this,e,n);case"base64":return gi(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wi(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function ai(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ui(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=Xr.from(e,r)),ii(e))return 0===e.length?-1:ci(t,e,n,r,i);if("number"==typeof e)return e&=255,Xr.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):ci(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function ci(t,e,n,r,i){var o,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=n;o<a;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(t,o+h)!==c(e,h)){f=!1;break}if(f)return o}return-1}function li(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function fi(t,e,n,r){return Ri(Oi(e,t.length-n),t,n,r)}function hi(t,e,n,r){return Ri(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function pi(t,e,n,r){return hi(t,e,n,r)}function di(t,e,n,r){return Ri(Pi(e),t,n,r)}function yi(t,e,n,r){return Ri(function(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function gi(t,e,n){return 0===e&&n===t.length?Wr(t):Wr(t.slice(e,n))}function vi(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,s,a,u,c=t[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}Xr.TYPED_ARRAY_SUPPORT=void 0===r.TYPED_ARRAY_SUPPORT||r.TYPED_ARRAY_SUPPORT,Xr.poolSize=8192,Xr._augment=function(t){return t.__proto__=Xr.prototype,t},Xr.from=function(t,e,n){return Zr(null,t,e,n)},Xr.TYPED_ARRAY_SUPPORT&&(Xr.prototype.__proto__=Uint8Array.prototype,Xr.__proto__=Uint8Array),Xr.alloc=function(t,e,n){return function(t,e,n,r){return ti(e),e<=0?Gr(t,e):void 0!==n?"string"==typeof r?Gr(t,e).fill(n,r):Gr(t,e).fill(n):Gr(t,e)}(null,t,e,n)},Xr.allocUnsafe=function(t){return ei(null,t)},Xr.allocUnsafeSlow=function(t){return ei(null,t)},Xr.isBuffer=Di,Xr.compare=function(t,e){if(!ii(t)||!ii(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},Xr.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Xr.concat=function(t,e){if(!Jr(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Xr.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=Xr.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!ii(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},Xr.byteLength=oi,Xr.prototype._isBuffer=!0,Xr.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)ai(this,e,e+1);return this},Xr.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)ai(this,e,e+3),ai(this,e+1,e+2);return this},Xr.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)ai(this,e,e+7),ai(this,e+1,e+6),ai(this,e+2,e+5),ai(this,e+3,e+4);return this},Xr.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?vi(this,0,t):si.apply(this,arguments)},Xr.prototype.equals=function(t){if(!ii(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Xr.compare(this,t)},Xr.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},Xr.prototype.compare=function(t,e,n,r,i){if(!ii(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(r,i),c=t.slice(e,n),l=0;l<a;++l)if(u[l]!==c[l]){o=u[l],s=c[l];break}return o<s?-1:s<o?1:0},Xr.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},Xr.prototype.indexOf=function(t,e,n){return ui(this,t,e,n,!0)},Xr.prototype.lastIndexOf=function(t,e,n){return ui(this,t,e,n,!1)},Xr.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return li(this,t,e,n);case"utf8":case"utf-8":return fi(this,t,e,n);case"ascii":return hi(this,t,e,n);case"latin1":case"binary":return pi(this,t,e,n);case"base64":return di(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return yi(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Xr.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function mi(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function bi(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function _i(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=Si(t[o]);return i}function wi(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Ei(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function xi(t,e,n,r,i,o){if(!ii(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function Ai(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Fi(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function ji(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ki(t,e,n,r,i){return i||ji(t,0,n,4),Yr(t,e,n,r,23,4),n+4}function Ci(t,e,n,r,i){return i||ji(t,0,n,8),Yr(t,e,n,r,52,8),n+8}Xr.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),Xr.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=Xr.prototype;else{var i=e-t;n=new Xr(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},Xr.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||Ei(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},Xr.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||Ei(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},Xr.prototype.readUInt8=function(t,e){return e||Ei(t,1,this.length),this[t]},Xr.prototype.readUInt16LE=function(t,e){return e||Ei(t,2,this.length),this[t]|this[t+1]<<8},Xr.prototype.readUInt16BE=function(t,e){return e||Ei(t,2,this.length),this[t]<<8|this[t+1]},Xr.prototype.readUInt32LE=function(t,e){return e||Ei(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Xr.prototype.readUInt32BE=function(t,e){return e||Ei(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Xr.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||Ei(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},Xr.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||Ei(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},Xr.prototype.readInt8=function(t,e){return e||Ei(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Xr.prototype.readInt16LE=function(t,e){e||Ei(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},Xr.prototype.readInt16BE=function(t,e){e||Ei(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},Xr.prototype.readInt32LE=function(t,e){return e||Ei(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Xr.prototype.readInt32BE=function(t,e){return e||Ei(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Xr.prototype.readFloatLE=function(t,e){return e||Ei(t,4,this.length),$r(this,t,!0,23,4)},Xr.prototype.readFloatBE=function(t,e){return e||Ei(t,4,this.length),$r(this,t,!1,23,4)},Xr.prototype.readDoubleLE=function(t,e){return e||Ei(t,8,this.length),$r(this,t,!0,52,8)},Xr.prototype.readDoubleBE=function(t,e){return e||Ei(t,8,this.length),$r(this,t,!1,52,8)},Xr.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||xi(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},Xr.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||xi(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},Xr.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,1,255,0),Xr.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Xr.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,2,65535,0),Xr.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Ai(this,t,e,!0),e+2},Xr.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,2,65535,0),Xr.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Ai(this,t,e,!1),e+2},Xr.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,4,4294967295,0),Xr.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Fi(this,t,e,!0),e+4},Xr.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,4,4294967295,0),Xr.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Fi(this,t,e,!1),e+4},Xr.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);xi(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},Xr.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);xi(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},Xr.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,1,127,-128),Xr.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Xr.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,2,32767,-32768),Xr.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Ai(this,t,e,!0),e+2},Xr.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,2,32767,-32768),Xr.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Ai(this,t,e,!1),e+2},Xr.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,4,2147483647,-2147483648),Xr.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Fi(this,t,e,!0),e+4},Xr.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||xi(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Xr.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Fi(this,t,e,!1),e+4},Xr.prototype.writeFloatLE=function(t,e,n){return ki(this,t,e,!0,n)},Xr.prototype.writeFloatBE=function(t,e,n){return ki(this,t,e,!1,n)},Xr.prototype.writeDoubleLE=function(t,e,n){return Ci(this,t,e,!0,n)},Xr.prototype.writeDoubleBE=function(t,e,n){return Ci(this,t,e,!1,n)},Xr.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!Xr.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},Xr.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Xr.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=ii(t)?t:Oi(new Xr(t,r).toString()),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this};var Ti=/[^+\/0-9A-Za-z-_]/g;function Si(t){return t<16?"0"+t.toString(16):t.toString(16)}function Oi(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Pi(t){return function(t){var e,n,r,i,o,s;qr||Hr();var a=t.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[a-2]?2:"="===t[a-1]?1:0,s=new zr(3*a/4-o),r=o>0?a-4:a;var u=0;for(e=0,n=0;e<r;e+=4,n+=3)i=Ur[t.charCodeAt(e)]<<18|Ur[t.charCodeAt(e+1)]<<12|Ur[t.charCodeAt(e+2)]<<6|Ur[t.charCodeAt(e+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=Ur[t.charCodeAt(e)]<<2|Ur[t.charCodeAt(e+1)]>>4,s[u++]=255&i):1===o&&(i=Ur[t.charCodeAt(e)]<<10|Ur[t.charCodeAt(e+1)]<<4|Ur[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Ti,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Ri(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function Di(t){return null!=t&&(!!t._isBuffer||Mi(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Mi(t.slice(0,0))}(t))}function Mi(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Bi=zi;function Ii(t,e){this.index=t,this.values=e}function Li(t,e){this.index=t,this.howMany=e}function Ni(t,e,n){this.from=t,this.to=e,this.howMany=n}function Ui(t,e){return t===e}function zi(t,e,n){n||(n=Ui);for(var r=t.length,i=e.length,o=[],s={},a={},u=0;u<r;u++)for(var c=t[u],l=0;l<i;l++)if(!a[l]&&n(c,e[l],u,l)){var f=u,h=l,p=0;do{s[u++]=a[l++]=!0,p++}while(u<r&&l<i&&n(t[u],e[l],u,l)&&!a[l]);o.push(new Ni(f,h,p)),u--;break}var d=[];for(u=0;u<r;)if(s[u])u++;else{var y=u;for(p=0;u<r&&!s[u++];)p++;d.push(new Li(y,p))}var g=[];for(l=0;l<i;)if(a[l])l++;else{for(y=l,p=0;l<i&&!a[l++];)p++;var v=e.slice(y,y+p);g.push(new Ii(y,v))}var m,b,_=g.length,w=d.length,E=o.length,x=0;for(m=0;m<w;m++){var A=d[m];for(A.index-=x,x+=A.howMany,b=0;b<E;b++){(C=o[b]).from>=A.index&&(C.from-=A.howMany)}}for(m=_;m--;){var F=g[m];p=F.values.length;for(b=E;b--;){(C=o[b]).to>=F.index&&(C.to-=p)}}for(m=E;m-- >1;){if((C=o[m]).to!==C.from)for(b=m;b--;){var j=o[b];j.to>=C.to&&(j.to-=C.howMany),j.to>=C.from&&(j.to+=C.howMany)}}var k=[];for(m=0;m<E;m++){var C;if((C=o[m]).to!==C.from)for(k.push(C),b=m+1;b<E;b++){var T=o[b];T.from>=C.from&&(T.from-=C.howMany),T.from>=C.to&&(T.from+=C.howMany)}}return d.concat(k,g)}zi.InsertDiff=Ii,zi.RemoveDiff=Li,zi.MoveDiff=Ni,Ii.prototype.type="insert",Ii.prototype.toJSON=function(){return{type:this.type,index:this.index,values:this.values}},Li.prototype.type="remove",Li.prototype.toJSON=function(){return{type:this.type,index:this.index,howMany:this.howMany}},Ni.prototype.type="move",Ni.prototype.toJSON=function(){return{type:this.type,from:this.from,to:this.to,howMany:this.howMany}};var qi=function(t,e,n,r,i){if(Array.isArray(i)||"boolean"==typeof i)throw new Error(["It looks like you are using arrayChanges includeNonNumericalProperties,","the API has changed. You need to supply it as an entry to an option object:","arrayChanges(actual, expected, equal, similar, {",' includeNonNumericalProperties: ["foo", "bar"]',"})"].join("\n"));for(var o=(i=i||{}).includeNonNumericalProperties,s=(!("fallbackToItemByItemDiff"in i)||i.fallbackToItemByItemDiff),a=new Array(t.length),u=0;u<t.length;u+=1)a[u]={type:"similar",value:t[u],actualIndex:u};n=n||function(t,e){return t===e},r=r||function(t,e){return!1};var c=Bi(Array.prototype.slice.call(t),Array.prototype.slice.call(e),(function(t,e,i,o){return n(t,e,i,o)||r(t,e,i,o)}));function l(t){var e,n=0;for(e=0;e<a.length&&n<t;e+=1)"remove"!==a[e].type&&"moveSource"!==a[e].type&&n++;return e}var f=c.filter((function(t){return"remove"===t.type})),h=0;f.forEach((function(t){var e=h+t.index;a.slice(e,t.howMany+e).forEach((function(t){t.type="remove"})),h+=t.howMany})),c.filter((function(t){return"move"===t.type})).forEach((function(t){var e=l(t.from+1)-1,n=a.slice(e,t.howMany+e),r=n.map((function(t){return function(t){for(var e=1;e<arguments.length;e+=1){var n=arguments[e];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t}({},t,{last:!1,type:"moveTarget"})}));n.forEach((function(t){t.type="moveSource"}));var i=l(t.to);Array.prototype.splice.apply(a,[i,0].concat(r))})),c.filter((function(t){return"insert"===t.type})).forEach((function(t){for(var e=new Array(t.values.length),n=0;n<t.values.length;n+=1)e[n]={type:"insert",value:t.values[n],expectedIndex:t.index};var r=l(t.index);Array.prototype.splice.apply(a,[r,0].concat(e))}));var p=0;a.forEach((function(t,n){var r=t.type;"remove"===r||"moveSource"===r?p-=1:"similar"===r&&(t.expected=e[p+n],t.expectedIndex=p+n)}));var d=a.reduce((function(t,e){return"similar"===e.type||"moveSource"===e.type||"moveTarget"===e.type?t:t+1}),0);if(s){var y,g;for(g=0,y=0;g<Math.max(t.length,e.length)&&y<=d;g+=1)(g>=t.length||g>=e.length||!n(t[g],e[g],g,g)&&!r(t[g],e[g],g,g))&&(y+=1);if(y<=d){var v;for(a=[],v=0;v<Math.min(t.length,e.length);v+=1)a.push({type:"similar",value:t[v],expected:e[v],actualIndex:v,expectedIndex:v});if(t.length<e.length)for(;v<Math.max(t.length,e.length);v+=1)a.push({type:"insert",value:e[v],expectedIndex:v});else for(;v<Math.max(t.length,e.length);v+=1)a.push({type:"remove",value:t[v],actualIndex:v})}}if(a.forEach((function(t){"similar"===t.type&&n(t.value,t.expected,t.actualIndex,t.expectedIndex)&&(t.type="equal")})),o){var m;if(Array.isArray(o))m=o;else{var b={};m=[],[t,e].forEach((function(t){Object.keys(t).forEach((function(t){/^(?:0|[1-9][0-9]*)$/.test(t)||b[t]||(b[t]=!0,m.push(t))})),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(t){b[t]||(b[t]=!0,m.push(t))}))}))}m.forEach((function(r){var i;if(r in t){var o=t[r];i=e[r],r in e&&void 0!==i?(i=e[r],a.push({type:n(o,i,r,r)?"equal":"similar",expectedIndex:r,actualIndex:r,value:o,expected:i})):void 0!==o&&a.push({type:"remove",actualIndex:r,value:o})}else void 0!==(i=e[r])&&a.push({type:"insert",expectedIndex:r,value:i})}))}return a.length>0&&(a[a.length-1].last=!0),a},Hi=Number.isFinite||function(t){return!("number"!=typeof t||t!=t||t===1/0||t===-1/0)},Ki=function(t,e){if("string"!=typeof t)throw new TypeError("Expected a string as the first argument");if(e<0||!Hi(e))throw new TypeError("Expected a finite positive number");var n="";do{1&e&&(n+=t),t+=t}while(e>>=1);return n},Wi=/^(?:( )+|\t+)/;var $i=D.isRegExp,Yi=D.leftPad,Vi=Zi;function Ji(t,e){this.index=t,this.values=e}function Qi(t,e){this.index=t,this.howMany=e}function Gi(t,e,n){this.from=t,this.to=e,this.howMany=n}function Xi(t,e,n,r,i){return i(t===e)}function Zi(t,e,n,r){n||(n=Xi);var i=t.length,o=e.length,s=[],a={},u={};!function r(c,l,f,h){l>=o&&(c++,l=0),c>=i?h():u[l]?f?r(c,l+1,f-1,h):setTimeout((function(){r(c,l+1,1e3,h)}),0):n(t[c],e[l],c,l,(function(p){if(p){var d=c,y=l;!function r(s,c,l,f){a[s++]=u[c++]=!0,l++,s<i&&c<o&&!u[c]?n(t[s],e[c],s,c,(function(t){t?setTimeout((function(){r(s,c,l,f)}),0):f(s,c,l)})):f(s,c,l)}(c,l,0,(function(t,e,n){s.push(new Gi(d,y,n)),f?r(t,0,f-1,h):setTimeout((function(){r(t,0,1e3,h)}),0)}))}else f?r(c,l+1,f-1,h):setTimeout((function(){r(c,l+1,1e3,h)}),0)}))}(0,0,1e3,(function(){for(var t=[],n=0;n<i;)if(a[n])n++;else{for(var c=n,l=0;n<i&&!a[n++];)l++;t.push(new Qi(c,l))}for(var f=[],h=0;h<o;)if(u[h])h++;else{for(c=h,l=0;h<o&&!u[h++];)l++;var p=e.slice(c,c+l);f.push(new Ji(c,p))}var d,y,g=f.length,v=t.length,m=s.length,b=0;for(d=0;d<v;d++){var _=t[d];for(_.index-=b,b+=_.howMany,y=0;y<m;y++){(A=s[y]).from>=_.index&&(A.from-=_.howMany)}}for(d=g;d--;){var w=f[d];l=w.values.length;for(y=m;y--;){(A=s[y]).to>=w.index&&(A.to-=l)}}for(d=m;d-- >1;){if((A=s[d]).to!==A.from)for(y=d;y--;){var E=s[y];E.to>=A.to&&(E.to-=A.howMany),E.to>=A.from&&(E.to+=A.howMany)}}var x=[];for(d=0;d<m;d++){var A;if((A=s[d]).to!==A.from)for(x.push(A),y=d+1;y<m;y++){var F=s[y];F.from>=A.from&&(F.from-=A.howMany),F.from>=A.to&&(F.from+=A.howMany)}}r(t.concat(x,f))}))}Zi.InsertDiff=Ji,Zi.RemoveDiff=Qi,Zi.MoveDiff=Gi,Ji.prototype.type="insert",Ji.prototype.toJSON=function(){return{type:this.type,index:this.index,values:this.values}},Qi.prototype.type="remove",Qi.prototype.toJSON=function(){return{type:this.type,index:this.index,howMany:this.howMany}},Gi.prototype.type="move",Gi.prototype.toJSON=function(){return{type:this.type,from:this.from,to:this.to,howMany:this.howMany}};var to=function(t,e,n,r,i,o){"function"==typeof i&&(o=i,i=!1);for(var s=new Array(t.length),a=0;a<t.length;a+=1)s[a]={type:"similar",actualIndex:a,value:t[a]};r=r||function(t,e,n,r,i){return i(!1)},Vi([].concat(t),[].concat(e),(function(t,e,i,o,s){n(t,e,i,o,(function(n){if(n)return s(!0);r(t,e,i,o,(function(t){return s(t)}))}))}),(function(a){function u(t){var e,n=0;for(e=0;e<s.length&&n<t;e+=1)"remove"!==s[e].type&&"moveSource"!==s[e].type&&(n+=1);return e}var c=a.filter((function(t){return"remove"===t.type})),l=0;c.forEach((function(t){var e=l+t.index;s.slice(e,t.howMany+e).forEach((function(t){t.type="remove"})),l+=t.howMany})),a.filter((function(t){return"move"===t.type})).forEach((function(t){var e=u(t.from+1)-1,n=s.slice(e,t.howMany+e),r=n.map((function(t){return function(t){for(var e=1;e<arguments.length;e+=1){var n=arguments[e];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t}({},t,{last:!1,type:"moveTarget"})}));n.forEach((function(t){t.type="moveSource"}));var i=u(t.to);Array.prototype.splice.apply(s,[i,0].concat(r))})),a.filter((function(t){return"insert"===t.type})).forEach((function(t){for(var e=new Array(t.values.length),n=0;n<t.values.length;n+=1)e[n]={type:"insert",value:t.values[n]};Array.prototype.splice.apply(s,[u(t.index),0].concat(e))}));var f=0;s.forEach((function(t,n){var r=t.type;"remove"===r||"moveSource"===r?f-=1:"similar"===r&&(t.expected=e[f+n],t.expectedIndex=f+n)}));var h=s.reduce((function(t,e){return"similar"===e.type||"moveSource"===e.type||"moveTarget"===e.type?t:t+1}),0),p=Math.max(t.length,e.length),d=function(i,o,s,a){if(i>=p||o>h)return setTimeout((function(){a(o)}),0);r(t[i],e[i],i,i,(function(r){if(!r)return o+=1,0===s?setTimeout((function(){d(i+1,o,1e3,a)})):d(i+1,o,s-1,a);n(t[i],e[i],i,i,(function(t){return t||(o+=1),0===s?setTimeout((function(){d(i+1,o,1e3,a)})):d(i+1,o,s-1,a)}))}))};d(0,0,1e3,(function(r){if(r<=h){var a;for(s=[],a=0;a<Math.min(t.length,e.length);a+=1)s.push({type:"similar",actualIndex:a,expectedIndex:a,value:t[a],expected:e[a]});if(t.length<e.length)for(;a<Math.max(t.length,e.length);a+=1)s.push({type:"insert",value:e[a]});else for(;a<Math.max(t.length,e.length);a+=1)s.push({type:"remove",value:t[a]})}var u=function(t,e,r){if(t>=s.length)return r();var i=s[t];return"similar"===i.type?n(i.value,i.expected,i.actualIndex,i.expectedIndex,(function(n){if(n&&(s[t].type="equal"),0===e)return setTimeout((function(){u(t+1,1e3,r)}));u(t+1,e-1,r)})):0===e?setTimeout((function(){u(t+1,1e3,r)})):u(t+1,e-1,r)};if(i){var c;if(Array.isArray(i))c=i;else{var l={};c=[],[t,e].forEach((function(t){Object.keys(t).forEach((function(t){/^(?:0|[1-9][0-9]*)$/.test(t)||l[t]||(l[t]=!0,c.push(t))})),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(t){l[t]||(l[t]=!0,c.push(t))}))}))}c.forEach((function(n){var r;if(n in t){var i=t[n];r=e[n],n in e&&void 0!==r?(r=e[n],s.push({type:"similar",expectedIndex:n,actualIndex:n,value:i,expected:r})):void 0!==i&&s.push({type:"remove",actualIndex:n,value:i})}else void 0!==(r=e[n])&&s.push({type:"insert",expectedIndex:n,value:r})}))}u(0,1e3,(function(){s.length>0&&(s[s.length-1].last=!0),o(s)}))}))}))},eo=D.objectIs,no=D.extend,ro=Qn().use((function(t){t.installTheme({styles:{jsBoolean:"jsPrimitive",jsNumber:"jsPrimitive",error:["red","bold"],success:["green","bold"],diffAddedLine:"green",diffAddedHighlight:["bgGreen","white"],diffAddedSpecialChar:["bgGreen","cyan","bold"],diffRemovedLine:"red",diffRemovedHighlight:["bgRed","white"],diffRemovedSpecialChar:["bgRed","cyan","bold"],partialMatchHighlight:["bgYellow"]}}),t.installTheme("html",{palette:["#993333","#669933","#314575","#337777","#710071","#319916","#BB1A53","#999933","#4311C2","#996633","#993399","#333399","#228842","#C24747","#336699","#663399"],styles:{jsComment:"#969896",jsFunctionName:"#795da3",jsKeyword:"#a71d5d",jsPrimitive:"#0086b3",jsRegexp:"#183691",jsString:"#df5000",jsKey:"#555"}}),t.installTheme("ansi",{palette:["#FF1A53","#E494FF","#1A53FF","#FF1AC6","#1AFF53","#D557FF","#81FF57","#C6FF1A","#531AFF","#AFFF94","#C61AFF","#53FF1A","#FF531A","#1AFFC6","#FFC61A","#1AC6FF"],styles:{jsComment:"gray",jsFunctionName:"jsKeyword",jsKeyword:"magenta",jsNumber:[],jsPrimitive:"cyan",jsRegexp:"green",jsString:"cyan",jsKey:"#666",diffAddedHighlight:["bgGreen","black"],diffRemovedHighlight:["bgRed","black"],partialMatchHighlight:["bgYellow","black"]}}),t.addStyle("colorByIndex",(function(t,e){var n=this.theme().palette;if(n){var r=n[e%n.length];this.text(t,r)}else this.text(t)})),t.addStyle("singleQuotedString",(function(t){t=String(t),this.jsString("'").jsString(t.replace(/[\\\x00-\x1f']/g,(function(t){if("\n"===t)return"\\n";if("\r"===t)return"\\r";if("'"===t)return"\\'";if("\\"===t)return"\\\\";if("\t"===t)return"\\t";if("\b"===t)return"\\b";if("\f"===t)return"\\f";var e=t.charCodeAt(0);return"\\x"+(e<16?"0":"")+e.toString(16)}))).jsString("'")})),t.addStyle("propertyForObject",(function(t,e,n){var r=!1;"symbol"==typeof t?this.text("[").appendInspected(t).text("]").text(":"):(t=String(t),/^[a-z$_][a-z0-9$_]*$/i.test(t)?this.text(t,"jsKey").text(":"):/^(?:0|[1-9][0-9]*)$/.test(t)?n?r=!0:this.jsNumber(t).text(":"):this.singleQuotedString(t).text(":")),e.isEmpty()||(r||(t.length>5&&e.isBlock()&&e.isMultiline()?(this.indentLines(),this.nl().i()):this.sp()),this.append(e))})),t.addStyle("code",(function(t,e){this.text(t)})),t.addStyle("annotationBlock",(function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=this.getContentFromArguments(t),r=n.size().height;this.block((function(){for(var t=0;t<r;t+=1)t>0&&this.nl(),this.error("//")})),this.sp().block(n)})),t.addStyle("commentBlock",(function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=this.getContentFromArguments(t),r=n.size().height;this.block((function(){for(var t=0;t<r;t+=1)t>0&&this.nl(),this.jsComment("//")})),this.sp().block(n)})),t.addStyle("diffLinesOmitted",(function(t){this.jsComment("... "+t+" lines omitted ...")})),t.addStyle("removedHighlight",(function(t){this.alt({text:function(){t.split(/(\n)/).forEach((function(t){this.block((function(){this.text(t.replace(/\n/g,"\\n")).nl().text(t.replace(/[\s\S]/g,"^"))})),"\n"===t&&this.nl()}),this)},fallback:function(){var e=this;t.split(/(\n)/).forEach((function(t){"\n"===t?e.diffRemovedSpecialChar("\\n").nl():e.diffRemovedHighlight(t)}))}})})),t.addStyle("match",(function(t){this.alt({text:function(){t.split(/(\n)/).forEach((function(t){"\n"===t?this.nl():this.block((function(){this.text(t).nl().text(t.replace(/[\s\S]/g,"^"))}))}),this)},fallback:function(){this.diffAddedHighlight(t)}})})),t.addStyle("partialMatch",(function(t){this.alt({text:function(){this.match(t)},fallback:function(){this.partialMatchHighlight(t)}})})),t.addStyle("shouldEqualError",(function(t){this.error(void 0===t?"should be":"should equal").sp().block((function(){this.appendInspected(t)}))})),t.addStyle("errorName",(function(t){var e=t.name,n=t.constructor;"string"==typeof e&&"Error"!==e?this.text(e):n&&"string"==typeof n.name?this.text(n.name):this.text("Error")})),t.addStyle("appendErrorMessage",(function(t,e){t&&t.isUnexpected?this.append(t.getErrorMessage(D.extend({output:this},e))):this.appendInspected(t)})),t.addStyle("appendItems",(function(t,e){var n=this;e=e||"",t.forEach((function(t,r){r>0&&n.append(e),n.appendInspected(t)}))})),t.addStyle("stringDiffFragment",(function(t,e,n,r,i){var o=e.split(/\n/);o.forEach((function(e,s){this.isAtStartOfLine()&&this.alt({text:t,fallback:function(){""!==e||" "===t||0!==s&&s===o.length-1||this["+"===t?"diffAddedSpecialChar":"diffRemovedSpecialChar"]("\\n")}});var a=(i||s<o.length-1)&&e.match(/^(.*[^ ])?( +)$/);a&&(e=a[1]||""),r?e.split(Lr).forEach((function(e){Lr.test(e)?this[{"+":"diffAddedSpecialChar","-":"diffRemovedSpecialChar"}[t]||n](D.escapeChar(e)):this[n](e)}),this):this[n](e),a&&this[{"+":"diffAddedHighlight","-":"diffRemovedHighlight"}[t]||n](a[2]),s!==o.length-1&&this.nl()}),this)})),t.addStyle("stringDiff",(function(t,e,n){void 0===n&&(n={});var r,i=n.type||"WordsWithSpace",o=[];Ir.diffLines(t,e).forEach((function(t){r&&r.removed&&t.added?(o.push({oldValue:r.value,newValue:t.value,replaced:!0}),r=null):(r&&o.push(r),r=t)})),r&&o.push(r),o.forEach((function(t,e){if(t.replaced){var r=t.oldValue,s=t.newValue,a=this.clone(),u="\n"===r.slice(-1),c="\n"===s.slice(-1);u&&(r=r.slice(0,-1)),c&&(s=s.slice(0,-1)),Ir["diff"+i](r,s).forEach((function(t,e,r){var i=t.added,o=t.value,s=t.removed,u=e===r.length-1;i?a.stringDiffFragment("+",o,"diffAddedHighlight",n.markUpSpecialCharacters,u):s?this.stringDiffFragment("-",o,"diffRemovedHighlight",n.markUpSpecialCharacters,u):(a.stringDiffFragment("+",o,"diffAddedLine",void 0,u),this.stringDiffFragment("-",o,"diffRemovedLine",void 0,u))}),this),c&&!u&&a.diffAddedSpecialChar("\\n"),u&&!c&&this.diffRemovedSpecialChar("\\n"),this.nl().append(a).nl(u&&e<o.length-1?1:0)}else{var l=/\n$/.test(t.value),f=l?t.value.slice(0,-1):t.value;if(t.added)this.stringDiffFragment("+",f,"diffAddedLine",n.markUpSpecialCharacters,l||e===o.length-1);else if(t.removed)this.stringDiffFragment("-",f,"diffRemovedLine",n.markUpSpecialCharacters,l||e===o.length-1);else{e===o.length-1&&t.count>4?this.stringDiffFragment(" ",f.split("\n").slice(0,3).join("\n"),"text").nl().diffLinesOmitted(t.count-3):0===e&&t.count>4?this.diffLinesOmitted(t.count-3).nl().stringDiffFragment(" ",f.split("\n").slice(-3).join("\n"),"text"):t.count>7?this.stringDiffFragment(" ",f.split("\n").slice(0,3).join("\n"),"text").nl().diffLinesOmitted(t.count-6).nl().stringDiffFragment(" ",f.split("\n").slice(-3).join("\n"),"text"):this.stringDiffFragment(" ",f,"text")}l&&this.nl()}}),this)})),t.addStyle("arrow",(function(t){void 0===t&&(t={});var e,n=t.styles||[];for(this.nl(t.top||0).sp(t.left||0).text("┌",n),e=1;e<t.width;e+=1)this.text(e===t.width-1&&"up"===t.direction?"▷":"─",n);for(this.nl(),e=1;e<t.height-1;e+=1)this.sp(t.left||0).text("│",n).nl();for(this.sp(t.left||0).text("└",n),e=1;e<t.width;e+=1)this.text(e===t.width-1&&"down"===t.direction?"▷":"─",n)}));var e=X;t.addStyle("merge",(function(t){for(var n=t.map((function(t){var n=t.output;return e(n)})).reverse(),r=n.reduce((function(t,e){var n=e.length;return Math.max(t,n)}),0),i=new Array(n.length),o=new Array(n.length),s=0;s<r;s+=1){s>0&&this.nl();var a=void 0;for(a=0;a<i.length;a+=1)i[a]=0,o[a]=0;var u=void 0;do{u=!1;var c=!1;for(a=0;a<n.length;a+=1){var l=n[a][s];if(l){for(;l[i[a]]&&o[a]>=l[i[a]].args.content.length;)i[a]+=1,o[a]=0;var f=l[i[a]];if(f){if(u=!0,!c){var h=f.args.content.charAt(o[a]);" "!==h&&(this.text(h,f.args.styles),c=!0)}o[a]+=1}}}!c&&u&&this.sp()}while(u)}})),t.addStyle("arrowsAlongsideChangeOutputs",(function(t,e){if(t){var n={},r=0;e.forEach((function(t,e){n[e]=r,r+=t.size().height}));var i=this,o=[];t.forEach((function(t,e,r){var s=r.length;t.forEach((function(t){var r=t.start,a=t.end,u=t.direction;o.push(i.clone().arrow({left:2*e,top:n[r],width:1+2*(s-e),height:n[a]-n[r]+1,direction:u}))}))})),1===o.length?this.block(o[0]):o.length>1&&this.block((function(){this.merge(o)}))}else this.i();this.block((function(){e.forEach((function(e,n){this.nl(n>0?1:0),e.isEmpty()||this.sp(t?1:0).append(e)}),this)}))}))})).use((function(t){t.addType({name:"wrapperObject",identify:!1,equal:function(t,e,n){return t===e||n(this.unwrap(t),this.unwrap(e))},inspect:function(t,e,n,r){return n.append(this.prefix(n.clone(),t)),n.append(r(this.unwrap(t),e)),n.append(this.suffix(n.clone(),t)),n},diff:function(t,e,n,r,i){n.inline=!0,t=this.unwrap(t),e=this.unwrap(e);var o=r(t,e),s=this.prefix(n.clone(),t),a=this.suffix(n.clone(),t);return o&&o.inline?n.append(s).append(o).append(a):n.append(s).nl().indentLines().i().block((function(){this.append(i(t)).sp().annotationBlock((function(){this.shouldEqualError(e,i),o&&this.nl(2).append(o)}))})).nl().outdentLines().append(a)}}),t.addType({name:"Symbol",identify:function(t){return"symbol"==typeof t},inspect:function(t,e,n,r){return n.jsKeyword("Symbol").text("(").singleQuotedString(t.toString().replace(/^Symbol\(|\)$/g,"")).text(")")}}),t.addType({name:"object",indent:!0,forceMultipleLines:!1,identify:function(t){return t&&"object"==typeof t},prefix:function(t,e){var n=e.constructor,r=n&&"function"==typeof n&&n!==Object&&D.getFunctionName(n);return r&&"Object"!==r&&t.text(r+"("),t.text("{")},property:function(t,e,n,r){return t.propertyForObject(e,n,r)},suffix:function(t,e){t.text("}");var n=e.constructor,r=n&&"function"==typeof n&&n!==Object&&D.getFunctionName(n);return r&&"Object"!==r&&t.text(")"),t},delimiter:function(t,e,n){return e<n-1&&t.text(","),t},getKeys:Object.getOwnPropertySymbols?function(t){var e=Object.getOwnPropertyNames(t),n=Object.getOwnPropertySymbols(t);return n.length>0?e.concat(n):e}:Object.getOwnPropertyNames,keyComparator:"function"==typeof Symbol?function(t,e){var n=t,r=e,i="symbol"==typeof e;if("symbol"==typeof t){if(!i)return 1;n=t.toString(),r=e.toString()}else if(i)return-1;return n<r?-1:n>r?1:0}:void 0,equal:function(t,e,n){return D.checkObjectEqualityUsingType(t,e,this,n)},hasKey:function(t,e,n){return n?Object.prototype.hasOwnProperty.call(t,e):e in t},inspect:function(t,e,n,r){var i=this.getKeys(t);if(0===i.length)return this.prefix(n,t),this.suffix(n,t),n;var o=this,s=i.map((function(e,s){var a,u=Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(t,e),c=u&&u.get,l=u&&u.set,f=n.clone();l&&!c&&f.text("set").sp(),a=l&&!c?l:o.valueForKey(t,e);var h=r(a);return a&&a._expectIt&&(h=n.clone().block(h)),o.property(f,e,h),f.amend(o.delimiter(n.clone(),s,i.length)),c&&l?f.sp().jsComment("/* getter/setter */"):c&&f.sp().jsComment("/* getter */"),f})),a=n.preferredWidth-2*(e===1/0?0:e)-2,u=0,c=s.length>5||s.every((function(t){return!t.isMultiline()&&(u+=t.size().width)<a})),l=n.clone();if(c){var f=0;s.forEach((function(t,e){var n=t.size();f+=n.width+1,e>0&&(1===n.height&&f<a?l.sp():(l.nl(),f=n.width),n.height>1&&(f=a)),l.append(t)}))}else s.forEach((function(t,e){e>0&&l.nl(),l.append(t)}));var h=this.prefix(n.clone(),t),p=this.suffix(n.clone(),t);return n.append(h),this.forceMultipleLines||l.isMultiline()?(h.isEmpty()||n.nl(),this.indent&&n.indentLines().i(),n.block(l),this.indent&&n.outdentLines(),p.isEmpty()||n.nl()):n.sp(h.isEmpty()?0:1).append(l).sp(p.isEmpty()?0:1),n.append(p)},diff:function(t,e,n,r,i,o){if(t.constructor!==e.constructor)return n.text("Mismatching constructors ").text(t.constructor&&D.getFunctionName(t.constructor)||t.constructor).text(" should be ").text(e.constructor&&D.getFunctionName(e.constructor)||e.constructor);n.inline=!0;var s=this.getKeys(t),a=this.getKeys(e),u=this.uniqueKeys(s,a),c=this.prefix(n.clone(),t);n.append(c).nl(c.isEmpty()?0:1),this.indent&&n.indentLines();var l=this;u.forEach((function(a,u){n.nl(u>0?1:0).i().block((function(){var c,f=l.valueForKey(t,a),h=l.valueForKey(e,a),p=n.clone(),d=!o(f,h),y=!1;if(d)if(l.hasKey(e,a))if(l.hasKey(t,a)){var g=r(f,h);!g||g&&!g.inline?(p.shouldEqualError(h),g&&p.nl(2).append(g)):(y=!0,c=g)}else this.error("// missing").sp(),c=n.clone().appendInspected(h),y=!0;else p.error("should be removed"),y=!0;else y=!0;c||(c=i(f,d?1/0:null)),c.amend(l.delimiter(n.clone(),u,s.length)),y||(c=n.clone().block(c)),l.property(this,a,c),p.isEmpty()||this.sp().annotationBlock(p)}))})),this.indent&&n.outdentLines();var f=this.suffix(n.clone(),t);return n.nl(f.isEmpty()?0:1).append(f)},similar:function(t,e){var n=this;if(null===t||null===e)return!1;var r=typeof t;if(r!==typeof e)return!1;if("string"===r)return Ut(t,e)<t.length/2;if("object"!==r||!t)return!1;if(D.isArray(t)&&D.isArray(e))return!0;var i=this.getKeys(t),o=this.getKeys(e),s=0,a=Math.round(Math.max(i.length,o.length)/2);return i.concat(o).some((function(r){return n.hasKey(t,r)&&n.hasKey(e,r)&&(s+=1),s>=a}))},uniqueKeys:D.uniqueStringsAndSymbols,valueForKey:function(t,e){return t[e]}}),t.addType({name:"type",base:"object",identify:function(t){return t&&t._unexpectedType},inspect:function(t,e,n){var r=t.name;return n.text("type: ").jsKeyword(r)}}),t.addType({name:"array-like",base:"object",identify:!1,numericalPropertiesOnly:!0,getKeys:function(t){for(var e=new Array(t.length),n=0;n<t.length;n+=1)e[n]=n;return this.numericalPropertiesOnly||e.push.apply(e,this.getKeysNonNumerical(t)),e},getKeysNonNumerical:Object.getOwnPropertySymbols?function(t){var e=[];Object.keys(t).forEach((function(t){D.numericalRegExp.test(t)||e.push(t)}));var n=Object.getOwnPropertySymbols(t);return n.length>0&&e.push.apply(e,n),e}:function(t){var e=[];return Object.keys(t).forEach((function(t){D.numericalRegExp.test(t)||e.push(t)})),e},equal:function(t,e,n){var r=this;if(t===e)return!0;if(t.constructor===e.constructor&&t.length===e.length){var i;for(i=0;i<t.length;i+=1)if(!n(this.valueForKey(t,i),this.valueForKey(e,i)))return!1;if(!this.numericalPropertiesOnly){var o=this.getKeysNonNumerical(t).filter((function(e){return void 0!==r.valueForKey(t,e)})),s=this.getKeysNonNumerical(e).filter((function(n){return void 0!==r.valueForKey(e,n)||void 0!==r.valueForKey(t,n)}));if(o.length!==s.length)return!1;for(i=0;i<o.length;i+=1)if(!n(this.valueForKey(t,o[i]),this.valueForKey(e,s[i])))return!1}return!0}return!1},prefix:function(t){return t.text("[")},suffix:function(t){return t.text("]")},inspect:function(t,e,n,r){var i=this,o=this.prefix(n.clone(),t),s=this.suffix(n.clone(),t),a=this.getKeys(t);if(0===a.length)return n.append(o).append(s);if(1===e&&t.length>10)return n.append(o).text("...").append(s);var u=a.map((function(e){var o;return o=i.hasKey(t,e)?r(i.valueForKey(t,e)):D.numericalRegExp.test(e)?n.clone():r(void 0),i.property(n.clone(),e,o,!0)})),c=_n-Math.min(_n,e),l=n.preferredWidth-20-c*n.indentationWidth-2,f=0,h=this.forceMultipleLines||u.some((function(t){if(t.isMultiline())return!0;var e=t.size();return(f+=e.width)>l}));return u.forEach((function(t,e){t.amend(i.delimiter(n.clone(),e,a.length))})),h?(n.append(o),o.isEmpty()||n.nl(),this.indent&&n.indentLines(),u.forEach((function(t,e){n.nl(e>0?1:0).i().block(t)})),this.indent&&n.outdentLines(),s.isEmpty()||n.nl(),n.append(s)):(n.append(o).sp(o.isEmpty()?0:1),u.forEach((function(t,e){n.append(t),e===u.length-1||n.sp()})),n.sp(s.isEmpty()?0:1).append(s))},diffLimit:512,diff:function(t,e,n,r,i,o){if(n.inline=!0,Math.max(t.length,e.length)>this.diffLimit)return n.jsComment("Diff suppressed due to size > "+this.diffLimit),n;if(t.constructor!==e.constructor)return this.baseType.diff(t,e,n);var s=this.prefix(n.clone(),t);n.append(s).nl(s.isEmpty()?0:1),this.indent&&n.indentLines();var a=D.duplicateArrayLikeUsingType(t,this),u=this.getKeys(t),c=D.duplicateArrayLikeUsingType(e,this),l=this.getKeys(e),f=!this.numericalPropertiesOnly&&D.uniqueNonNumericalStringsAndSymbols(u,l),h=this,p=qi(a,c,o,(function(t,e){return h.similar(t,e)}),{includeNonNumericalProperties:f}),d=p.reduce((function(t,e,n){return"insert"===e.type?t:n}),-1),y=D.packArrows(p);n.arrowsAlongsideChangeOutputs(y,p.map((function(t,e){var o=h.delimiter(n.clone(),e,d+1);return"moveTarget"===t.type?n.clone():n.clone().block((function(){if("moveSource"===t.type){var e=h.property(n.clone(),t.actualIndex,i(t.value),!0);this.amend(e).amend(o).sp().error("// should be moved")}else"insert"===t.type?this.annotationBlock((function(){this.error("missing ").block((function(){var e=void 0!==t.actualIndex?t.actualIndex:t.expectedIndex,r=h.property(n.clone(),e,i(t.value),!0);this.amend(r)}))})):"remove"===t.type?this.block((function(){var e=h.property(n.clone(),t.actualIndex,i(t.value),!0);this.amend(e).amend(o).sp().error("// should be removed")})):"equal"===t.type?this.block((function(){var e=h.property(n.clone(),t.actualIndex,i(t.value),!0);this.amend(e).amend(o)})):this.block((function(){var e=r(t.value,t.expected);if(e&&e.inline)this.append(e).append(o);else{var s=h.property(n.clone(),t.actualIndex,i(t.value),!0);this.append(s).append(o).sp().annotationBlock((function(){this.shouldEqualError(t.expected,i),e&&this.nl(2).append(e)}))}}))}))}))),this.indent&&n.outdentLines();var g=this.suffix(n.clone(),t);return n.nl(g.isEmpty()?0:1).append(g)}}),t.addType({name:"array",base:"array-like",numericalPropertiesOnly:!1,identify:function(t){return D.isArray(t)}}),t.addType({name:"arguments",base:"array-like",prefix:function(t){return t.text("arguments(","cyan")},suffix:function(t){return t.text(")","cyan")},identify:function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}});var n=["message","name","description","line","number","column","sourceId","sourceURL","stack","stackArray","__stackCleaned__","isOperational"].reduce((function(t,e){return t[e]=!0,t}),{});Object.prototype.hasOwnProperty.call(new Error,"arguments")&&(n.arguments=!0,n.type=!0),t.addType({base:"object",name:"Error",identify:function(t){return D.isError(t)},getKeys:function(t){var e=this.baseType.getKeys(t).filter((function(t){return!n[t]}));return e.unshift("message"),e},unwrap:function(t){return this.getKeys(t).reduce((function(e,n){return e[n]=t[n],e}),{})},equal:function(t,e,n){return t===e||n(t.message,e.message)&&D.checkObjectEqualityUsingType(t,e,this,n)},inspect:function(t,e,n,r){n.errorName(t).text("(");var i=this.getKeys(t);return 1===i.length&&"message"===i[0]?""!==t.message&&n.append(r(t.message)):n.append(r(this.unwrap(t),e)),n.text(")")},diff:function(t,e,n,r){return t.constructor!==e.constructor?n.text("Mismatching constructors ").errorName(t).text(" should be ").errorName(e):((n=r(this.unwrap(t),this.unwrap(e)))&&((n=n.clone().errorName(t).text("(").append(n).text(")")).inline=!1),n)}});var r=["output","_isUnexpected","htmlMessage","_hasSerializedErrorMessage","expect","assertion","originalError"].reduce((function(t,e){return t[e]=!0,t}),{});t.addType({base:"Error",name:"UnexpectedError",identify:function(t){return t&&"object"==typeof t&&t._isUnexpected&&this.baseType.identify(t)},getKeys:function(t){return this.baseType.getKeys(t).filter((function(t){return!r[t]}))},inspect:function(t,e,n){n.jsFunctionName(this.name).text("(");var r=t.getErrorMessage(n);return r.isMultiline()?n.nl().indentLines().i().block(r).nl():n.append(r),n.text(")")}}),t.addType({name:"date",identify:function(t){return"[object Date]"===Object.prototype.toString.call(t)},equal:function(t,e){return t.getTime()===e.getTime()},inspect:function(t,e,n,r){var i=t.toUTCString().replace(/UTC/,"GMT"),o=t.getUTCMilliseconds();if(o>0){for(var s=String(o);s.length<3;)s="0"+s;i=i.replace(" GMT","."+s+" GMT")}return n.jsKeyword("new").sp().text("Date(").append(r(i).text(")"))}}),t.addType({base:"object",name:"function",identify:function(t){return"function"==typeof t},getKeys:Object.keys,equal:function(t,e){return t===e},inspect:function(t,e,n,r){var i,o,s,a=Function.prototype.toString.call(t).replace(/\r\n?|\n\r?/g,"\n"),u=D.getFunctionName(t)||"",c=a.match(/^\s*((?:async )?\s*(?:\S+\s*=>|\([^)]*\)\s*=>|class|function\s?(?:\*\s*)?\w*\s*\([^)]*\)))([\s\S]*)$/);if(c){"function ()"===(i=c[1].replace(/function(\S)/,"function $1").replace(/\* /,"*"))&&u&&(i="function "+u+"()");var l,f=(o=c[2]).match(/^(\s*\{)([\s\S]*?)([ ]*)\}\s*$/),h=!0,p="}",d=0;if(f)l=f[1],o=f[2],1===(s=f[3]||"").length&&(p=" }");else if(f=o.match(/^(\s*)([\s\S]*?)([ ]*)\s*$/)){l=f[1],h=!1,o=f[2];var y=l.match(/^\n( +)/);y?(l="\n",/\n/.test(o)?(s=y[1],d=1):o=o.replace(/^\s*/," ")):s=f[3]||"",p=""}if(/\n/.test(o)&&!/\\\n/.test(o)){var g=function(t){if("string"!=typeof t)throw new TypeError("Expected a string");var e,n,r=0,i=0,o=0,s={};t.split(/\n/g).forEach((function(t){if(t){var a,u=t.match(Wi);u?(a=u[0].length,u[1]?i++:r++):a=0;var c=a-o;o=a,c?(e=s[(n=c>0)?c:-c])?e[0]++:e=s[c]=[1,0]:e&&(e[1]+=+n)}}));var a,u,c=function(t){var e=0,n=0,r=0;for(var i in t){var o=t[i],s=o[0],a=o[1];(s>n||s===n&&a>r)&&(n=s,r=a,e=+i)}return e}(s);return c?i>=r?(a="space",u=Ki(" ",c)):(a="tab",u=Ki("\t",c)):(a=null,u=""),{amount:c,type:a,indent:u}}(o=o.replace(new RegExp("^ {"+s.length+"}","mg"),""));o=o.replace(new RegExp("^(?:"+g.indent+")*","mg"),(function(t){var e=t.length;return D.leftPad("",(e/g.amount+d)*n.indentationWidth," ")}))}u&&"anonymous"!==u||(u=""),/^\s*\[native code\]\s*$/.test(o)?(o=" /* native code */ ",p="}"):/^\s*$/.test(o)?o="":/^\s*[^\r\n]{1,30}\s*$/.test(o)&&-1===o.indexOf("//")&&h?(o=" "+o.trim()+" ",p="}"):o=o.replace(/^((?:.*\n){3}( *).*\n)[\s\S]*?\n[\s\S]*?\n((?:.*\n){3})$/,"$1$2// ... lines removed ...\n$3"),o=f?l+o+p:o.replace(/[ ]*$/,"")}else i="function "+u+"( /*...*/ ) ",o="{ /*...*/ }";return n.code(i+o,"javascript")},diff:function(t,e,n){if("function"!=typeof t||"function"!=typeof e)return this.baseType.diff(t,e,n)}}),t.addType({base:"function",name:"expect.it",identify:function(t){return"function"==typeof t&&t._expectIt},inspect:function(t,e,n,r){var i=t._expectations,o=t._OR;n.text("expect.it(");var s=!1;return i.forEach((function(t,e){t!==o?(s?n.text(")\n .or("):e>0&&n.text(")\n .and("),Array.prototype.slice.call(t).forEach((function(t,e){e>0&&n.text(", "),n.append(r(t))})),s=!1):s=!0})),n.amend(")")}}),t.addType({name:"Promise",base:"object",identify:function(t){return t&&this.baseType.identify(t)&&"function"==typeof t.then},inspect:function(t,e,n,r){if(n.jsFunctionName("Promise"),t.isPending&&t.isPending())n.sp().yellow("(pending)");else if(t.isFulfilled&&t.isFulfilled()){if(n.sp().green("(fulfilled)"),t.value){var i=t.value();void 0!==i&&n.sp().text("=>").sp().append(r(i))}}else if(t.isRejected&&t.isRejected()){n.sp().red("(rejected)"),void 0!==t.reason()&&n.sp().text("=>").sp().append(r(t.reason()))}return n}}),t.addType({name:"regexp",base:"object",identify:$i,equal:function(t,e){return t===e||t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline},inspect:function(t,e,n){return n.jsRegexp(t)},diff:function(t,e,n,r,i){return n.inline=!1,n.stringDiff(String(t),String(e),{type:"Chars",markUpSpecialCharacters:!0})}}),t.addType({name:"binaryArray",base:"array-like",digitWidth:2,hexDumpWidth:16,identify:!1,prefix:function(t){return t.code(this.name+"([","javascript")},suffix:function(t){return t.code("])","javascript")},equal:function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0},hexDump:function(t,e){var n="";"number"==typeof e&&0!==e||(e=t.length);for(var r=0;r<e;r+=this.hexDumpWidth){n.length>0&&(n+="\n");for(var i="",o=" │",s=0;s<this.hexDumpWidth;s+=1)if(r+s<e){var a=t[r+s];i+=Yi(a.toString(16).toUpperCase(),this.digitWidth,"0")+" ",o+=String.fromCharCode(a).replace(/\n/g,"␊").replace(/\r/g,"␍")}else 2===this.digitWidth&&(i+=" ");2===this.digitWidth?n+=i+o+"│":n+=i.replace(/\s+$/,"")}return n},inspect:function(t,e,n){this.prefix(n,t);for(var r="",i=0;i<Math.min(this.hexDumpWidth,t.length);i+=1){i>0&&(r+=", ");var o=t[i];r+="0x"+Yi(o.toString(16).toUpperCase(),this.digitWidth,"0")}return t.length>this.hexDumpWidth&&(r+=" /* "+(t.length-this.hexDumpWidth)+" more */ "),n.code(r,"javascript"),this.suffix(n,t),n},diffLimit:512,diff:function(t,e,n,r,i){return n.inline=!1,Math.max(t.length,e.length)>this.diffLimit?n.jsComment("Diff suppressed due to size > "+this.diffLimit):n.stringDiff(this.hexDump(t),this.hexDump(e),{type:"Chars",markUpSpecialCharacters:!1}).replaceText(/[\x00-\x1f\x7f-\xff␊␍]/g,".").replaceText(/[│ ]/g,(function(t,e){this.text(e)})),n}}),[8,16,32].forEach((function(e){["Int","Uint"].forEach((function(n){var r=n+e+"Array",i=T[r];t.addType({name:r,base:"binaryArray",hexDumpWidth:128/e,digitWidth:e/4,identify:"undefined"!==i&&function(t){return t instanceof i}})}),this)}),this),t.addType({name:"Buffer",base:"binaryArray",identify:Di,prefix:function(t){return t.code("Buffer.from([","javascript")}}),t.addType({name:"string",identify:function(t){return"string"==typeof t},inspect:function(t,e,n){return n.singleQuotedString(t)},diffLimit:65536,diff:function(t,e,n,r,i){return Math.max(t.length,e.length)>this.diffLimit?(n.jsComment("Diff suppressed due to size > "+this.diffLimit),n):(n.stringDiff(t,e,{type:"WordsWithSpace",markUpSpecialCharacters:!0}),n.inline=!1,n)}}),t.addType({name:"number",identify:function(t){return"number"==typeof t&&!isNaN(t)},inspect:function(t,e,n){return t=0===t&&1/t==-1/0?"-0":String(t),n.jsNumber(String(t))}}),t.addType({name:"NaN",identify:function(t){return"number"==typeof t&&isNaN(t)},inspect:function(t,e,n){return n.jsPrimitive(t)}}),t.addType({name:"BigInt",identify:function(t){return"bigint"==typeof t},inspect:function(t,e,n){return n.code("BigInt(","javascript").jsNumber(t.toString()).code(")","javascript")}}),t.addType({name:"boolean",identify:function(t){return"boolean"==typeof t},inspect:function(t,e,n){return n.jsPrimitive(t)}}),t.addType({name:"undefined",identify:function(t){return void 0===t},inspect:function(t,e,n){return n.jsPrimitive(t)}}),t.addType({name:"null",identify:function(t){return null===t},inspect:function(t,e,n){return n.jsPrimitive(t)}}),t.addType({name:"assertion",identify:function(t){return t instanceof e}})})).use((function(t){function e(t,e,n){var r=t.getDiffMethod();if(r)return function(t){for(var i=[],o=arguments.length-1;o-- >0;)i[o]=arguments[o+1];e.prefix(t,n);var s=r.call.apply(r,[this,t].concat(i));return e.suffix(t,n),s}}function n(t,e){function n(){return t.apply(this,e)}return n.prototype=t.prototype,new n}t.addAssertion("<any> [not] to be (ok|truthy)",(function(t,e){!!e===!!t.flags.not&&t.fail()})),t.addAssertion("<any> [not] to be (ok|truthy) <string>",(function(t,e,n){!!e===!!t.flags.not&&t.fail({errorMode:"bubble",message:n})})),t.addAssertion("<any> [not] to be <any>",(function(t,e,n){eo(e,n)===t.flags.not&&t.fail({label:"should be"})})),t.addAssertion("<string> [not] to be <string>",(function(t,e,n){t(e,"[not] to equal",n)})),t.addAssertion("<boolean> [not] to be true",(function(t,e){t(e,"[not] to be",!0)})),t.addAssertion("<boolean> [not] to be false",(function(t,e){t(e,"[not] to be",!1)})),t.addAssertion("<any> [not] to be falsy",(function(t,e){t(e,"[!not] to be truthy")})),t.addAssertion("<any> [not] to be falsy <string>",(function(t,e,n){!!e!==!!t.flags.not&&t.fail({errorMode:"bubble",message:n})})),t.addAssertion("<any> [not] to be null",(function(t,e){t(e,"[not] to be",null)})),t.addAssertion("<any> [not] to be undefined",(function(t,e){t(void 0===e,"[not] to be truthy")})),t.addAssertion("<any> [not] to be defined",(function(t,e){t(e,"[!not] to be undefined")})),t.addAssertion("<number|NaN> [not] to be NaN",(function(t,e){t(isNaN(e),"[not] to be truthy")})),t.addAssertion("<number> [not] to be close to <number> <number?>",(function(t,e,n,r){t.errorMode="bubble","number"!=typeof r&&(r=1e-9),t.withError((function(){t(Math.abs(e-n),"[not] to be less than or equal to",r)}),(function(i){t.fail((function(i){i.error("expected ").appendInspected(e).sp().error(t.testDescription).sp().appendInspected(n).sp().text("(epsilon: ").jsNumber(r.toExponential()).text(")")}))}))})),t.addAssertion("<any> [not] to be (a|an) <type>",(function(t,e,n){t.argsOutput[0]=function(t){t.text(n.name)},t(n.identify(e),"[not] to be true")})),t.addAssertion("<any> [not] to be (a|an) <string>",(function(t,e,n){n=/^reg(?:exp?|ular expression)$/.test(n)?"regexp":n,t.argsOutput[0]=function(t){t.jsString(n)},t.getType(n)||(t.errorMode="nested",t.fail((function(t){t.error("Unknown type:").sp().jsString(n)}))),t(t.subjectType.is(n),"[not] to be truthy")})),t.addAssertion("<any> [not] to be (a|an) <function>",(function(t,e,n){var r=D.getFunctionName(n);r&&(t.argsOutput[0]=function(t){t.text(r)}),t(e instanceof n,"[not] to be truthy")})),t.addAssertion("<any> [not] to be one of <array>",(function(t,e,n){for(var r=!1,i=0;i<n.length;i+=1)r=r||eo(e,n[i]);r===t.flags.not&&t.fail()})),t.addAssertion("<any> [not] to be an (object|array)",(function(t,e){t(e,"[not] to be an",t.alternations[0])})),t.addAssertion("<any> [not] to be a (boolean|number|string|function|regexp|regex|regular expression|date)",(function(t,e){t(e,"[not] to be a",t.alternations[0])})),t.addAssertion("<string> to be (the empty|an empty|a non-empty) string",(function(t,e){t(e,"a non-empty"===t.alternations[0]?"not to be empty":"to be empty")})),t.addAssertion("<array-like> to be (the empty|an empty|a non-empty) array",(function(t,e){t(e,"a non-empty"===t.alternations[0]?"not to be empty":"to be empty")})),t.addAssertion("<string> to match <regexp>",(function(t,e,n){return t.withError((function(){var r=e.match(n);return t(r,"to be truthy"),r}),(function(e){e.label="should match",t.fail(e)}))})),t.addAssertion("<string> not to match <regexp>",(function(t,e,n){return t.withError((function(){t(n.test(e),"to be false")}),(function(r){t.fail({label:"should not match",diff:function(t){t.inline=!1;var r=0;function i(n){n>r&&(t.text(e.substring(r,n)),r=n)}return e.replace(new RegExp(n.source,"g"),(function(e,n){i(n),r+=e.length,t.removedHighlight(e)})),i(e.length),t}})}))})),t.addAssertion("<object> [not] to have own property <string|Symbol>",(function(t,e,n){return t(Object.prototype.hasOwnProperty.call(e,n),"[not] to be truthy"),e[n]})),t.addAssertion("<object> to have (enumerable|unenumerable|configurable|unconfigurable|writable|unwritable|readonly) property <string|Symbol>",(function(t,e,n){var r=t.alternations[0],i=!1;0===r.indexOf("un")?(r=r.substr(2),i=!0):"readonly"===r&&(r="writable",i=!0);var o=Object.getOwnPropertyDescriptor(e,n);return t(o,"to be defined"),t(o[r]!==i,"to be true"),e[n]})),t.addAssertion("<object> [not] to have property <string|Symbol>",(function(t,e,n){var r=t.findTypeOf(e),i=r.is("function")?e[n]:r.valueForKey(e,n);return t(i,"[!not] to be undefined"),i})),t.addAssertion("<object> to have [own] property <string|Symbol> <any>",(function(t,e,n,r){return t(e,"to have [own] property",n).then((function(e){return t.argsOutput=function(){this.appendInspected(n).sp().error("with a value of").sp().appendInspected(r)},t(e,"to equal",r),e}))})),t.addAssertion("<object> [not] to [only] have [own] properties <array>",(function(t,e,n){var r=n.filter((function(t){var e=typeof t;return"string"!==e&&"number"!==e&&"symbol"!==e}));if(r.length>0&&(t.errorMode="nested",t.fail((function(){this.error("All expected properties must be passed as strings, symbols, or numbers, but these are not:").indentLines(),r.forEach((function(t){this.nl().i().appendInspected(t)}),this),this.outdentLines()}))),t.flags.only){t.flags.not&&(t.errorMode="bubble",t.fail('The "not" flag cannot be used together with "to only have properties".')),t.flags.own&&(t.errorMode="bubble",t.fail('The "own" flag cannot be used together with "to only have properties".'));var i=t.subjectType,o=i.getKeys(e).filter((function(t){return void 0!==i.valueForKey(e,t)}));t.withError((function(){t(o.length===n.length,"to be true");var e={};n.forEach((function(t){e[t]=!0})),o.forEach((function(n){return t(Object.prototype.hasOwnProperty.call(e,n),"to be true")}))}),(function(){t.fail({diff:function(t,r,s,a){t.inline=!0;var u={};return n.forEach((function(t){u[t]=!0})),i.prefix(t,e),t.nl().indentLines(),o.forEach((function(n,r){var a=i.property(t.clone(),n,s(i.valueForKey(e,n))),c=i.delimiter(t.clone(),r,o.length);t.i().block((function(){this.append(a).amend(c),Object.prototype.hasOwnProperty.call(u,n)?delete u[n]:this.sp().annotationBlock((function(){this.error("should be removed")}))})).nl()})),Object.keys(u).forEach((function(e){t.i().annotationBlock((function(){this.error("missing").sp().append(s(e))})).nl()})),t.outdentLines(),i.suffix(t,e),t}})}))}else n.forEach((function(n){t(e,"[not] to have [own] property","number"==typeof n?String(n):n)}))})),t.addAssertion("<object> to have [own] properties <object>",(function(t,e,n){t.withError((function(){Object.keys(n).forEach((function(r){var i=n[r];void 0===i?t(e,"not to have [own] property",r):t(e,"to have [own] property",r,i)}))}),(function(r){t.fail({diff:function(r,i){r.inline=!1;var o=no({},n),s={},a=t.findTypeOf(e).getKeys(e);for(var u in e)Object.prototype.hasOwnProperty.call(e,u)||a.push(u);return a.forEach((function(r){t.flags.own&&!Object.prototype.hasOwnProperty.call(e,r)||r in n||(o[r]=e[r]),t.flags.own&&!Object.prototype.hasOwnProperty.call(e,r)||r in s||(s[r]=e[r])})),D.wrapConstructorNameAroundOutput(i(s,o),e)}})}))})),t.addAssertion("<string|array-like> [not] to have length <number>",(function(t,e,n){t.flags.not||(t.errorMode="nested"),t(e.length,"[not] to be",n)})),t.addAssertion("<string|array-like> [not] to be empty",(function(t,e){t(e,"[not] to have length",0)})),t.addAssertion("<string|array-like|object> to be non-empty",(function(t,e){t(e,"not to be empty")})),t.addAssertion("<object> to [not] [only] have keys <array>",(function(t,e,n){var r={},i=t.findTypeOf(e),o=i.getKeys(e);if(o.forEach((function(t){r[t]=!0})),!t.flags.not||0!==n.length){var s=n.every((function(t){return r[t]}));t.flags.only?(t(s,"to be truthy"),t.withError((function(){t(o.length===n.length,"[not] to be truthy")}),(function(){t.fail({diff:!t.flags.not&&function(t,r,s,a){t.inline=!0;var u={};n.forEach((function(t){u[t]=!0}));var c=i.is("array-like");return i.prefix(t,e),t.nl().indentLines(),o.forEach((function(n,r){var a=i.property(t.clone(),n,s(i.valueForKey(e,n)),c),l=i.delimiter(t.clone(),r,o.length);t.i().block((function(){this.append(a).amend(l),u[n]||this.sp().annotationBlock((function(){this.error("should be removed")}))})).nl()})),t.outdentLines(),i.suffix(t,e),t}})}))):t(s,"[not] to be truthy")}})),t.addAssertion("<object> [not] to be empty",(function(t,e){if(t.flags.not&&!t.findTypeOf(e).getKeys(e).length)return t.fail();t(e,"to [not] only have keys",[])})),t.addAssertion("<object> not to have keys <array>",(function(t,e,n){t(e,"to not have keys",n)})),t.addAssertion("<object> not to have key <string>",(function(t,e,n){t(e,"to not have keys",[n])})),t.addAssertion("<object> not to have keys <string+>",(function(t,e,n){t(e,"to not have keys",Array.prototype.slice.call(arguments,2))})),t.addAssertion("<object> to [not] [only] have key <string>",(function(t,e,n){t(e,"to [not] [only] have keys",[n])})),t.addAssertion("<object> to [not] [only] have keys <string+>",(function(t,e){t(e,"to [not] [only] have keys",Array.prototype.slice.call(arguments,2))})),t.addAssertion("<string> [not] to contain <string+>",(function(t,e){var n=Array.prototype.slice.call(arguments,2);n.forEach((function(e){if(""===e)throw new Error("The '"+t.testDescription+"' assertion does not support the empty string")})),t.withError((function(){n.forEach((function(n){t(-1!==e.indexOf(n),"[not] to be truthy")}))}),(function(r){t.fail({diff:function(r){r.inline=!1;var i=0;function o(t){t>i&&(r.text(e.substring(i,t)),i=t)}if(t.flags.not)e.replace(new RegExp(n.map((function(t){return D.escapeRegExpMetaChars(t)})).join("|"),"g"),(function(t,e){o(e),i+=t.length,r.removedHighlight(t)})),o(e.length);else{var s=[];n.forEach((function(t){for(var n=t,r=!1;n.length>1;){var o=!1;i=-1;var a=void 0;do{-1!==(a=e.indexOf(n,i+1))&&(o=!0,s.push({startIndex:a,endIndex:a+n.length,partial:r})),i=a}while(-1!==i);if(o)break;n=t.substr(0,n.length-1),r=!0}})),i=0,s.sort((function(t,e){return t.startIndex-e.startIndex})).forEach((function(t){var n=t.startIndex,s=t.endIndex,a=t.partial;o(n);var u=Math.max(n,i);s>u&&(a?r.partialMatch(e.substring(u,s)):r.match(e.substring(u,s)),i=s)})),o(e.length)}return r}})}))})),t.addAssertion("<array-like> [not] to contain <any+>",(function(t,e){var n=Array.prototype.slice.call(arguments,2);t.withError((function(){n.forEach((function(n){t(e&&Array.prototype.some.call(e,(function(e){return t.equal(e,n)})),"[not] to be truthy")}))}),(function(r){t.fail({diff:t.flags.not&&function(t,r,i,o){return r(e,Array.prototype.filter.call(e,(function(t){return!n.some((function(e){return o(t,e)}))})))}})}))})),t.addAssertion(["<string> [not] to begin with <string>","<string> [not] to start with <string>"],(function(t,e,n){if(""===n)throw new Error("The '"+t.testDescription+"' assertion does not support a prefix of the empty string");var r=!1,i=D.truncateSubjectStringForBegin(e,n);null===i?i=e:r=!0,t.subjectOutput=function(t){t=t.jsString("'"+i.replace(/\n/g,"\\n")+"'"),r&&t.jsComment("...")},t.withError((function(){t(e.substr(0,n.length),"[not] to equal",n)}),(function(){t.fail({diff:function(o){if(o.inline=!1,t.flags.not)o.removedHighlight(n).text(e.substr(n.length));else{for(var s=0;e[s]===n[s];)s+=1;if(0===s)return null;o.partialMatch(e.substr(0,s)).text(i.substr(s)).jsComment(r?"...":"")}return o}})}))})),t.addAssertion("<string> [not] to end with <string>",(function(t,e,n){if(""===n)throw new Error("The '"+t.testDescription+"' assertion does not support a suffix of the empty string");var r=!1,i=D.truncateSubjectStringForEnd(e,n);null===i?i=e:r=!0,t.subjectOutput=function(t){r&&(t=t.jsComment("...")),t.jsString("'"+i.replace(/\n/g,"\\n")+"'")},t.withError((function(){t(e.substr(-n.length),"[not] to equal",n)}),(function(){t.fail({diff:function(o){if(o.inline=!1,t.flags.not)o.text(e.substr(0,e.length-n.length)).removedHighlight(n);else{for(var s=0;i[i.length-1-s]===n[n.length-1-s];)s+=1;if(0===s)return null;o.jsComment(r?"...":"").text(i.substr(0,i.length-s)).partialMatch(i.substr(i.length-s,i.length))}return o}})}))})),t.addAssertion("<number> [not] to be finite",(function(t,e){t(isFinite(e),"[not] to be truthy")})),t.addAssertion("<number> [not] to be infinite",(function(t,e){t(!isNaN(e)&&!isFinite(e),"[not] to be truthy")})),t.addAssertion(["<number> [not] to be within <number> <number>","<BigInt> [not] to be within <BigInt> <BigInt>","<string> [not] to be within <string> <string>"],(function(t,e,n,r){t.argsOutput=function(t){t.appendInspected(n).text("..").appendInspected(r)},t(e>=n&&e<=r,"[not] to be truthy")})),t.addAssertion(["<number> [not] to be (less than|below) <number>","<BigInt> [not] to be (less than|below) <BigInt>","<string> [not] to be (less than|below) <string>"],(function(t,e,n){t(e<n,"[not] to be truthy")})),t.addAssertion("<string> [not] to be (less than|below) <string>",(function(t,e,n){t(e<n,"[not] to be truthy")})),t.addAssertion(["<number> [not] to be less than or equal to <number>","<BigInt> [not] to be less than or equal to <BigInt>","<string> [not] to be less than or equal to <string>"],(function(t,e,n){t(e<=n,"[not] to be truthy")})),t.addAssertion(["<number> [not] to be (greater than|above) <number>","<BigInt> [not] to be (greater than|above) <BigInt>","<string> [not] to be (greater than|above) <string>"],(function(t,e,n){t(e>n,"[not] to be truthy")})),t.addAssertion(["<number> [not] to be greater than or equal to <number>","<BigInt> [not] to be greater than or equal to <BigInt>","<string> [not] to be greater than or equal to <string>"],(function(t,e,n){t(e>=n,"[not] to be truthy")})),t.addAssertion("<number> [not] to be positive",(function(t,e){t(e,"[not] to be greater than",0)})),t.addAssertion("<BigInt> [not] to be positive",(function(t,e){t(e>0,"[not] to be true")})),t.addAssertion("<number> [not] to be negative",(function(t,e){t(e,"[not] to be less than",0)})),t.addAssertion("<BigInt> [not] to be negative",(function(t,e){t(e<0,"[not] to be true")})),t.addAssertion("<any> to equal <any>",(function(t,e,n){t.withError((function(){t(t.equal(n,e),"to be truthy")}),(function(r){t.fail({label:"should equal",diff:function(t,r){return r(e,n)}})}))})),t.addAssertion("<any> not to equal <any>",(function(t,e,n){t(t.equal(n,e),"to be falsy")})),t.addAssertion("<function> to error",(function(t,e){return t.promise((function(){return e()})).then((function(){t.fail()}),(function(t){return t}))})),t.addAssertion("<function> to error [with] <any>",(function(t,e,n){return t(e,"to error").then((function(e){return t.errorMode="nested",t.withError((function(){return t(e,"to satisfy",n)}),(function(t){throw t.originalError=e,t}))}))})),t.addAssertion("<function> not to error",(function(t,e){var n=!1;return t.promise((function(){try{return e()}catch(t){throw n=!0,t}})).caught((function(e){t.errorMode="nested",t.fail({output:function(t){t.error(n?"threw":"returned promise rejected with").error(": ").appendErrorMessage(e)},originalError:e})}))})),t.addAssertion("<function> not to throw",(function(t,e){var n,r=!1;try{e()}catch(t){n=t,r=!0}r&&(t.errorMode="nested",t.fail({output:function(t){t.error("threw: ").appendErrorMessage(n)},originalError:n}))})),t.addAssertion("<function> to (throw|throw error|throw exception)",(function(t,e){try{e()}catch(t){return t}t.errorMode="nested",t.fail("did not throw")})),t.addAssertion("<object> to satisfy <function>",(function(t){return t.fail()})),t.addAssertion("<function> to throw (a|an) <function>",(function(t,e,n){var r=D.getFunctionName(n);return r&&(t.argsOutput[0]=function(t){t.jsFunctionName(r)}),t.errorMode="nested",t(e,"to throw").tap((function(e){t(e,"to be a",n)}))})),t.addAssertion("<function> to (throw|throw error|throw exception) <any>",(function(t,e,n){return t.errorMode="nested",t(e,"to throw").then((function(e){return t.errorMode="nested",t.withError((function(){return t(e,"to satisfy",n)}),(function(t){throw t.originalError=e,t}))}))})),t.addAssertion("<function> to have arity <number>",(function(t,e,n){t(e.length,"to equal",n)})),t.addAssertion(["<object> to have values [exhaustively] satisfying <any>","<object> to have values [exhaustively] satisfying <assertion>","<object> to be (a map|a hash|an object) whose values [exhaustively] satisfy <any>","<object> to be (a map|a hash|an object) whose values [exhaustively] satisfy <assertion>"],(function(t,e,n){t.errorMode="nested",t(e,"not to be empty"),t.errorMode="bubble";var r=t.subjectType.getKeys(e),i={};return r.forEach((function(e){i[e]="string"==typeof n?t.it((function(e){return t.shift(e)})):n})),t.withError((function(){return t(e,"to [exhaustively] satisfy",i)}),(function(e){t.fail({message:function(n){n.append(t.standardErrorMessage(n.clone(),{compact:e&&e._isUnexpected&&e.hasDiff()}))},diff:function(t){var n=e.getDiff({output:t});return n.inline=!0,n}})}))})),t.addAssertion(["<array-like> to have items [exhaustively] satisfying <any>","<array-like> to have items [exhaustively] satisfying <assertion>","<array-like> to be an array whose items [exhaustively] satisfy <any>","<array-like> to be an array whose items [exhaustively] satisfy <assertion>"],(function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return t.errorMode="nested",t(e,"not to be empty"),t.errorMode="bubble",t.withError((function(){return t.apply(void 0,[e,"to have values [exhaustively] satisfying"].concat(n))}),(function(e){t.fail({message:function(n){n.append(t.standardErrorMessage(n.clone(),{compact:e&&e._isUnexpected&&e.hasDiff()}))},diff:function(t){var n=e.getDiff({output:t});return n.inline=!0,n}})}))})),t.addAssertion(["<object> to have keys satisfying <any>","<object> to have keys satisfying <assertion>","<object> to be (a map|a hash|an object) whose (keys|properties) satisfy <any>","<object> to be (a map|a hash|an object) whose (keys|properties) satisfy <assertion>"],(function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];t.errorMode="nested",t(e,"not to be empty"),t.errorMode="default";var i=t.subjectType.getKeys(e);return t.apply(void 0,[i,"to have items satisfying"].concat(n))})),t.addAssertion(["<object> [not] to have a value [exhaustively] satisfying <any>","<object> [not] to have a value [exhaustively] satisfying <assertion>"],(function(t,e,n){t.errorMode="nested",t(e,"not to be empty"),t.errorMode="bubble";var r=t.findTypeOf(e),i=r.getKeys(e),o=!!t.flags.not,s=new Array(i.length);t.withError((function(){return t.promise[o?"all":"any"](i.map((function(i){var o;return o="string"==typeof n?t.it((function(e){return t.shift(e)})):n,s[i]=t.promise((function(){return t(r.valueForKey(e,i),"[not] to [exhaustively] satisfy",o)})),s[i]})))}),(function(n){t.fail({message:function(e){e.append(t.standardErrorMessage(e.clone(),{compact:n&&n._isUnexpected&&n.hasDiff()}))},diff:t.flags.not&&function(t,n,o,a){var u=r.is("array-like")?[]:{};return i.forEach((function(t){s[t].isFulfilled()&&(u[t]=r.valueForKey(e,t))})),n(e,u)}})}))})),t.addAssertion(["<array-like> [not] to have an item [exhaustively] satisfying <any>","<array-like> [not] to have an item [exhaustively] satisfying <assertion>"],(function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return t.errorMode="nested",t(e,"not to be empty"),t.errorMode="default",t.apply(void 0,[e,"[not] to have a value [exhaustively] satisfying"].concat(n))})),t.addAssertion("<object> to be canonical",(function(t,e){var n=[];!function e(r){var i;for(i=0;i<n.length;i+=1)if(n[i]===r)return;if(r&&"object"==typeof r){var o=Object.keys(r);for(i=0;i<o.length-1;i+=1)t(o[i],"to be less than",o[i+1]);n.push(r),o.forEach((function(t){e(r[t])})),n.pop()}}(e)})),t.addAssertion("<Error> to have message <any>",(function(t,e,n){return t.errorMode="nested",t(e.isUnexpected?e.getErrorMessage("text").toString():e.message,"to satisfy",n)})),t.addAssertion("<Error> to [exhaustively] satisfy <Error>",(function(t,e,n){t(e.constructor,"to be",n.constructor);var r=t.argTypes[0].unwrap(n);return t.withError((function(){return t(e,"to [exhaustively] satisfy",r)}),(function(n){t.fail({diff:function(n,i){n.inline=!1;var o=t.subjectType.unwrap(e);return D.wrapConstructorNameAroundOutput(i(o,r),e)}})}))})),t.addAssertion("<Error> to [exhaustively] satisfy <object>",(function(t,e,n){var r=t.argTypes[0],i=t.subjectType.getKeys(e),o=r.getKeys(n),s={};return i.concat(o).forEach((function(t){s[t]=e[t]})),t(s,"to [exhaustively] satisfy",n)})),t.addAssertion("<Error> to [exhaustively] satisfy <regexp|string|any>",(function(t,e,n){return t(e.message,"to [exhaustively] satisfy",n)})),t.addAssertion("<UnexpectedError> to [exhaustively] satisfy <regexp|string>",(function(t,e,n){return t.errorMode="bubble",t(e,"to have message",n)})),t.addAssertion("<binaryArray> to [exhaustively] satisfy <expect.it>",(function(t,e,n){return t.withError((function(){return n(e,t.context)}),(function(e){t.fail({diff:function(t,n,r,i){return t.inline=!1,t.appendErrorMessage(e)}})}))})),t.addAssertion("<any|Error> to [exhaustively] satisfy <expect.it>",(function(t,e,n){return t.promise((function(){return n(e)}))})),t.addAssertion("<Buffer> [when] decoded as <string> <assertion?>",(function(t,e,n){return t.shift(e.toString(n))})),t.addAssertion("<any> not to [exhaustively] satisfy [assertion] <any>",(function(t,e,n){return t.promise((function(r,i){return t.promise((function(){return t(e,"to [exhaustively] satisfy [assertion]",n)})).then((function(){try{t.fail()}catch(t){i(t)}})).caught((function(t){t&&t._isUnexpected?r():i(t)}))}))})),t.addAssertion("<any> to [exhaustively] satisfy assertion <any>",(function(t,e,n){return t.errorMode="bubble",t(e,"to [exhaustively] satisfy",n)})),t.addAssertion("<any> to [exhaustively] satisfy assertion <assertion>",(function(t,e){return t.errorMode="bubble",t.shift()})),t.addAssertion("<any|object> to [exhaustively] satisfy [assertion] <expect.it>",(function(t,e,n){return t.withError((function(){return n(e,t.context)}),(function(e){t.fail({diff:function(t){return t.inline=!1,t.appendErrorMessage(e)}})}))})),t.addAssertion("<regexp> to [exhaustively] satisfy <regexp>",(function(t,e,n){t(e,"to equal",n)})),t.addAssertion("<string> to [exhaustively] satisfy <regexp>",(function(t,e,n){return t.errorMode="bubble",t(e,"to match",n)})),t.addAssertion("<function> to [exhaustively] satisfy <function>",(function(t,e,n){t.errorMode="bubble",t(e,"to be",n)})),t.addAssertion("<binaryArray> to [exhaustively] satisfy <binaryArray>",(function(t,e,n){t.errorMode="bubble",t(e,"to equal",n)})),t.addAssertion("<any> to [exhaustively] satisfy <any>",(function(t,e,n){t.errorMode="bubble",t(e,"to equal",n)})),t.addAssertion("<array-like> to [exhaustively] satisfy <array-like>",(function(t,e,n){t.errorMode="bubble";var r=t.subjectType,i=r.getKeys(e),o=t.argTypes[0],s=o.getKeys(n).filter((function(t){return D.numericalRegExp.test(t)||"symbol"==typeof t||void 0!==o.valueForKey(n,t)||void 0!==r.valueForKey(e,t)})),a={};return s.forEach((function(i){a[i]=t.promise((function(){var s=r.valueForKey(e,i),a=o.valueForKey(n,i);return t.findTypeOf(a).is("expect.it")?(t.context.thisObject=e,a(s,t.context)):t(s,"to [exhaustively] satisfy",a)}))})),t.promise.all([t.promise((function(){var n={};i.forEach((function(t){n[t]=1})),s.forEach((function(e){n[e]||!D.numericalRegExp.test(e)&&!t.flags.exhaustively?delete n[e]:n[e]=2}));var o=Object.keys(n).filter((function(t){return D.numericalRegExp.test(t)||"symbol"==typeof t||void 0!==r.valueForKey(e,t)&&2===n[t]}));t(0===o.length,"to be truthy")})),t.promise.all(a)]).caught((function(){var u=0;return t.promise.settle(a).then((function(){var c=new Array(e.length);for(u=0;u<e.length;u+=1)c[u]=new Array(n.length),u<n.length&&(c[u][u]=a[u].isFulfilled()||a[u].reason());if(e.length>10||n.length>10){var l=[];for(u=0;u<e.length;u+=1){var f=a[u];u<n.length?l.push({type:f.isFulfilled()?"equal":"similar",value:e[u],expected:n[u],actualIndex:u,expectedIndex:u,last:u===Math.max(e.length,n.length)-1}):l.push({type:"remove",value:e[u],actualIndex:u,last:u===e.length-1})}for(u=e.length;u<n.length;u+=1)l.push({type:"insert",value:n[u],expectedIndex:u});return v(l)}var h=!1,p=D.duplicateArrayLikeUsingType(e,r),d=D.duplicateArrayLikeUsingType(n,o),y=!r.numericalPropertiesOnly&&D.uniqueNonNumericalStringsAndSymbols(i,s),g=qi(p,d,(function(e,n,r,i){c[r]=c[r]||[];var o,s=c[r][i];if(void 0!==s)return!0===s;try{o=t(e,"to [exhaustively] satisfy",n)}catch(t){return fn(t),c[r][i]=t,!1}return o.then((function(){}),(function(){})),o.isPending()?(h=!0,!1):(c[r][i]=!0,!0)}),(function(t,e){return r.similar(t,e)}),{includeNonNumericalProperties:y});return h?t.promise((function(i,o){to(e,n,(function(e,n,r,i,o){c[r]=c[r]||[];var s=c[r][i];if(void 0!==s)return o(!0===s);t.promise((function(){return t(e,"to [exhaustively] satisfy",n)})).then((function(){c[r][i]=!0,o(!0)}),(function(t){c[r][i]=t,o(!1)}))}),(function(t,e,n,i,o){o(r.similar(t,e))}),y,i)})).then(v):v(g);function v(n){t.errorMode="default",t.fail({diff:function(i,o,s,u){i.inline=!0;var l=n.reduce((function(t,e,n){return"insert"===e.type?t:n}),-1),f=r.prefix(i.clone(),e);i.append(f).nl(f.isEmpty()?0:1),r.indent&&i.indentLines();var h=D.packArrows(n);i.arrowsAlongsideChangeOutputs(h,n.map((function(e,n){var o=r.delimiter(i.clone(),n,l+1),u=e.type;return"moveTarget"===u?i.clone():i.clone().block((function(){if("moveSource"===u){var n=r.property(i.clone(),e.actualIndex,s(e.value),!0);this.append(n).amend(o).sp().error("// should be moved")}else if("insert"===u)this.annotationBlock((function(){if(t.findTypeOf(e.value).is("expect.it"))this.error("missing: ").block((function(){this.omitSubject=void 0;var t=a[e.expectedIndex];t.isRejected()?this.appendErrorMessage(t.reason()):this.appendInspected(e.value)}));else{var n=void 0!==e.actualIndex?e.actualIndex:e.expectedIndex,o=r.property(i.clone(),n,s(e.value),!0);this.error("missing ").append(o)}}));else{var l=r.property(i.clone(),e.actualIndex,s(e.value),!0);this.block((function(){if("remove"===u)this.append(l).amend(o).sp().error("// should be removed");else if("equal"===u)this.append(l).amend(o);else{var t=c[e.actualIndex][e.expectedIndex],n=t&&!0!==t&&t.getDiff({output:i.clone()});n&&n.inline?this.append(n).amend(o):this.append(l).amend(o).sp().annotationBlock((function(){this.omitSubject=e.value;var r=t.getLabel();r?(this.error(r).sp().block(s(e.expected)),n&&this.nl(2).append(n)):this.appendErrorMessage(t)}))}}))}}))}))),r.indent&&i.outdentLines();var p=r.suffix(i.clone(),e);return i.nl(p.isEmpty()?0:1).append(p),i}})}}))}))})),t.addAssertion("<object> to [exhaustively] satisfy <object>",(function(t,e,n){var r=t.argTypes[0],i=t.subjectType,o=i.is("array-like");if(e!==n){r.is("array-like")&&!o&&t.fail();var s=i.getKeys(e),a=r.getKeys(n),u=i.uniqueKeys(s,a),c={},l=!1;return u.forEach((function(o,s){var a=i.hasKey(e,o),u=r.hasKey(n,o,!0)?r.valueForKey(n,o):void 0,f=t.findTypeOf(u);if(t.flags.exhaustively)f.is("expect.it")&&!a&&(l=!0);else if(a&&void 0===u)return;var h=a?i.valueForKey(e,o):void 0;c[o]=t.promise((function(){return f.is("expect.it")?(t.context.thisObject=e,u(h,t.context)):t(h,"to [exhaustively] satisfy",u)}))})),t.promise.all([t.promise((function(){if(l)throw new Error("exhaustive comparison failure")})),t.promise.all(c)]).caught((function(){return t.promise.settle(c).then((function(){t.fail({diff:function(o,a,l,f){o.inline=!0;var h=i.is("array-like"),p=u.filter((function(t){return i.hasKey(e,t)||void 0!==r.valueForKey(n,t)})),d=i.prefix(o.clone(),e);o.append(d).nl(d.isEmpty()?0:1),i.indent&&o.indentLines(),p.forEach((function(a,u){var f=i.valueForKey(e,a),d=r.valueForKey(n,a);o.nl(u>0?1:0).i().block((function(){var y,g,v=o.clone();Object.prototype.hasOwnProperty.call(c,a)&&c[a].isRejected()&&(g=c[a].reason());var m=i.is("array-like")&&!i.hasKey(e,a),b=!0;if(o.omitSubject=f,r.hasKey(n,a))if(i.hasKey(e,a)){if(g||m){var _=g&&g.getDiff({output:o});b=!_||_.inline,m&&o.error("// missing").sp(),_&&_.inline?y=_:t.findTypeOf(d).is("expect.it")?(b=!1,v.appendErrorMessage(g)):!_||_&&!_.inline?(v.error(g&&g.getLabel()||"should satisfy").sp().block(l(d)),_&&v.nl(2).append(_)):y=_}}else t.findTypeOf(d).is("expect.it")?c[a].isRejected()?(o.error("// missing:").sp(),y=o.clone().appendErrorMessage(c[a].reason())):(o.error("// missing").sp(),y=o.clone().error("should satisfy").sp().block(l(n[a]))):(o.error("// missing").sp(),y=l(d));else t.flags.exhaustively?v.error("should be removed"):g=null;if(y||(y=m||!i.hasKey(e,a)?o.clone():l(f)),!(m||u>=s.length-1)){var w=i.delimiter(o.clone(),u,p.length);y.amend(w)}var E=!b&&o.preferredWidth<this.size().width+y.size().width+v.size().width;v.isEmpty()||(y.isEmpty()||(E?y.nl():y.sp()),y.annotationBlock((function(){this.append(v)}))),b||(y=o.clone().block(y));var x=i.property(o.clone(),a,y,h);this.append(x)}))})),i.indent&&o.outdentLines();var y=i.suffix(o.clone(),e);return o.nl(y.isEmpty()?0:1).append(y)}})}))}))}})),t.addAssertion("<wrapperObject> to [exhaustively] satisfy <wrapperObject>",(function(t,n,r){var i=t.findCommonType(n,r);return t(i.is("wrapperObject"),"to be truthy"),t.withError((function(){return t(i.unwrap(n),"to [exhaustively] satisfy",i.unwrap(r))}),(function(r){t.fail({label:r.getLabel(),diff:e(r,i,n)})}))})),t.addAssertion("<wrapperObject> to [exhaustively] satisfy <any>",(function(t,n,r){var i=t.subjectType;return t.withError((function(){return t(i.unwrap(n),"to [exhaustively] satisfy",r)}),(function(r){t.fail({label:r.getLabel(),diff:e(r,i,n)})}))})),t.addAssertion("<function> [when] called with <array-like> <assertion?>",(function(t,e,n){t.errorMode="nested",t.argsOutput[0]=function(t){t.appendItems(n,", ")};var r=t.context.thisObject||null;return t.shift(e.apply(r,n))})),t.addAssertion("<function> [when] called <assertion?>",(function(t,e){t.errorMode="nested";var n=t.context.thisObject||null;return t.shift(e.call(n))})),t.addAssertion(["<array-like> [when] passed as parameters to [async] <function> <assertion?>","<array-like> [when] passed as parameters to [constructor] <function> <assertion?>"],(function(t,e,r){t.errorMode="nested";var i=e;return t.flags.async?t.promise((function(e){i=i.concat([e((function(e,n){return t(e,"to be falsy"),t.shift(n)}))]),r.apply(void 0,i)})):t.shift(t.flags.constructor?n(r,i):r.apply(void 0,i))})),t.addAssertion(["<any> [when] passed as parameter to [async] <function> <assertion?>","<any> [when] passed as parameter to [constructor] <function> <assertion?>"],(function(t,e,r){t.errorMode="nested";var i=[e];return t.flags.async?t.promise((function(e){i=i.concat([e((function(e,n){return t(e,"to be falsy"),t.shift(n)}))]),r.apply(void 0,i)})):t.shift(t.flags.constructor?n(r,i):r.apply(void 0,i))})),t.addAssertion(["<array-like> [when] sorted [numerically] <assertion?>","<array-like> [when] sorted by <function> <assertion?>"],(function(t,e,n){return t.flags.numerically&&(n=function(t,e){return t-e}),t.shift(Array.prototype.slice.call(e).sort("function"==typeof n?n:void 0))})),t.addAssertion("<Promise> to be rejected",(function(t,e){return t.errorMode="nested",t.promise((function(){return e})).then((function(n){t.fail((function(t){t.appendInspected(e).sp().text("unexpectedly fulfilled"),void 0!==n&&t.sp().text("with").sp().appendInspected(n)}))}),(function(t){return t}))})),t.addAssertion("<function> to be rejected",(function(t,e){return t.errorMode="nested",t(t.promise((function(){return e()})),"to be rejected")})),t.addAssertion(["<Promise> to be rejected with <any>","<Promise> to be rejected with error [exhaustively] satisfying <any>"],(function(t,e,n){return t.errorMode="nested",t(e,"to be rejected").tap((function(e){return t.withError((function(){return t(e,"to [exhaustively] satisfy",n)}),(function(t){throw t.originalError=e,t}))}))})),t.addAssertion(["<function> to be rejected with <any>","<function> to be rejected with error [exhaustively] satisfying <any>"],(function(t,e,n){return t.errorMode="nested",t(t.promise((function(){return e()})),"to be rejected with error [exhaustively] satisfying",n)})),t.addAssertion("<Promise> to be fulfilled",(function(t,e){return t.errorMode="nested",t.promise((function(){return e})).caught((function(n){t.fail({output:function(t){t.appendInspected(e).sp().text("unexpectedly rejected"),void 0!==n&&t.sp().text("with").sp().appendInspected(n)},originalError:n})}))})),t.addAssertion("<function> to be fulfilled",(function(t,e){return t.errorMode="nested",t(t.promise((function(){return e()})),"to be fulfilled")})),t.addAssertion(["<Promise> to be fulfilled with <any>","<Promise> to be fulfilled with value [exhaustively] satisfying <any>"],(function(t,e,n){return t.errorMode="nested",t(e,"to be fulfilled").tap((function(e){return t(e,"to [exhaustively] satisfy",n)}))})),t.addAssertion(["<function> to be fulfilled with <any>","<function> to be fulfilled with value [exhaustively] satisfying <any>"],(function(t,e,n){return t.errorMode="nested",t(t.promise((function(){return e()})),"to be fulfilled with value [exhaustively] satisfying",n)})),t.addAssertion("<Promise> when rejected <assertion>",(function(t,e,n){return t.errorMode="nested",t.promise((function(){return e})).then((function(r){"string"==typeof n&&(t.argsOutput=function(e){e.error(n);var r=t.args.slice(1);r.length>0&&e.sp().appendItems(r,", ")}),t.fail((function(t){t.appendInspected(e).sp().text("unexpectedly fulfilled"),void 0!==r&&t.sp().text("with").sp().appendInspected(r)}))}),(function(e){e.isOperational&&!Object.prototype.propertyIsEnumerable.call(e,"isOperational")&&delete e.isOperational,t.withError((function(){return t.shift(e)}),(function(t){throw t.originalError=e,t}))}))})),t.addAssertion("<function> when rejected <assertion>",(function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return t.errorMode="nested",t.apply(void 0,[t.promise((function(){return e()})),"when rejected"].concat(n))})),t.addAssertion("<Promise> when fulfilled <assertion>",(function(t,e,n){return t.errorMode="nested",t.promise((function(){return e})).then((function(e){return t.shift(e)}),(function(r){t.argsOutput=function(e){e.error(n);var r=t.args.slice(1);r.length>0&&e.sp().appendItems(r,", ")},t.fail({output:function(t){t.appendInspected(e).sp().text("unexpectedly rejected"),void 0!==r&&t.sp().text("with").sp().appendInspected(r)},originalError:r})}))})),t.addAssertion("<function> when fulfilled <assertion>",(function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return t.errorMode="nested",t.apply(void 0,[t.promise((function(){return e()})),"when fulfilled"].concat(n))})),t.addAssertion("<function> to call the callback",(function(t,e){return t.errorMode="nested",t.promise((function(n){var r,i=!1,o=!1;var s=n((function(){return o&&t.fail((function(){this.error("The callback was called twice")})),r}));if(e((function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];r?o=!0:r=Array.prototype.slice.call(t),i&&setTimeout(s,0)})),i=!0,r)return s()}))})),t.addAssertion("<function> to call the callback without error",(function(t,e){return t(e,"to call the callback").then((function(e){var n=e[0];if(!n)return e.slice(1);t.errorMode="nested",t.fail({message:function(t){t.error("called the callback with: "),n.getErrorMessage?t.appendErrorMessage(n):t.appendInspected(n)}})}))})),t.addAssertion("<function> to call the callback with error",(function(t,e){return t(e,"to call the callback").spread((function(e){return t(e,"to be truthy"),e}))})),t.addAssertion("<function> to call the callback with error <any>",(function(t,e,n){return t(e,"to call the callback with error").tap((function(e){t.errorMode="nested",t(e,"to satisfy",n)}))}))})).freeze();return rn.prototype[Dn]=function(){return ro.createOutput(Lt.defaultFormat).appendInspected(this).toString()},ro}));
106//# sourceMappingURL=unexpected.js.map