From ec47f88c585fe6098f6e0ca9afcce80ae3a49c13 Mon Sep 17 00:00:00 2001 From: steve-gray Date: Fri, 5 Feb 2016 06:43:49 +1000 Subject: [PATCH] IoC support. Controller modules can now return a generator function that permits instances to be created with custom parameters. This allows use of an IoC container with dynamically wired-up controllers. --- browser/swagger-tools-standalone-min.js | 18 +- browser/swagger-tools-standalone.js | 4683 ++++++++++---------- docs/Middleware.md | 3 + docs/QuickStart.md | 6 +- examples/2.0/index.js | 6 +- middleware/swagger-router.js | 12 +- test/1.2/test-middleware-swagger-router.js | 8 +- test/1.2/test-middleware-swagger-ui.js | 4 +- test/2.0/test-middleware-swagger-router.js | 10 +- test/controllers/Users.js | 23 +- 10 files changed, 2421 insertions(+), 2352 deletions(-) diff --git a/browser/swagger-tools-standalone-min.js b/browser/swagger-tools-standalone-min.js index bda6e3efa9..21b12be26e 100755 --- a/browser/swagger-tools-standalone-min.js +++ b/browser/swagger-tools-standalone-min.js @@ -1,10 +1,10 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.SwaggerTools||(t.SwaggerTools={})).specs=e()}}(function(){var e;return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var f=r[a]={exports:{}};e[a][0].call(f.exports,function(t){var r=e[a][1][t];return i(r?r:t)},f,f.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a1?"s are":" is")+" invalid:"),n.each(r.getLastErrors(),function(e){console.error(" "+(n.isArray(e.path)?i.pathToPtr(e.path):e.path)+": "+e.message)}),new Error("Unable to create validator due to invalid JSON Schema");return r},t.exports.formatResults=function(e){return e&&(e=e.errors.length+e.warnings.length+n.reduce(e.apiDeclarations,function(e,t){return t&&(e+=t.errors.length+t.warnings.length),e},0)>0?e:void 0),e};var p=t.exports.getErrorCount=function(e){var t=0;return e&&(t=e.errors.length,n.each(e.apiDeclarations,function(e){e&&(t+=e.errors.length)})),t},l=function(e){return e&&!n.isString(e)&&(e=e.toString(),-1===e.indexOf(".")&&(e+=".0")),e};t.exports.getSpec=function(t,r){var i;if(t=l(t),i=f[t],n.isUndefined(i))switch(t){case"1.2":i=e("../lib/specs").v1_2;break;case"2.0":i=e("../lib/specs").v2_0;break;default:if(r===!0)throw new Error("Unsupported Swagger version: "+t)}return i},t.exports.getSwaggerVersion=function(e){return n.isPlainObject(e)?l(e.swaggerVersion||e.swagger):void 0},t.exports.printValidationResults=function(e,t,r,o,a){var s=p(o)>0,c=s?console.error:console.log,u=function(e,t){return 1===t?e:e+"s"},f=function(e,t,r){e&&(c(e+":"),c()),n.each(t,function(e){c(new Array(r+1).join(" ")+i.pathToPtr(e.path)+": "+e.message),e.inner&&f(void 0,e.inner,r+2)}),e&&c()},l=0,h=0;c(),o.errors.length>0&&(l+=o.errors.length,f("API Errors",o.errors,2)),o.warnings.length>0&&(h+=o.warnings.length,f("API Warnings",o.warnings,2)),o.apiDeclarations&&o.apiDeclarations.forEach(function(e,t){if(e){var n=r[t].resourcePath||t;e.errors.length>0&&(l+=e.errors.length,f(" API Declaration ("+n+") Errors",e.errors,4)),e.warnings.length>0&&(h+=e.warnings.length,f(" API Declaration ("+n+") Warnings",e.warnings,4))}}),a&&c(l>0?l+" "+u("error",l)+" and "+h+" "+u("warning",h):"Validation succeeded but with "+h+" "+u("warning",h)),c()},t.exports.swaggerOperationMethods=["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]},{"../lib/specs":2,"../schemas/json-schema-draft-04.json":218,"json-refs":37,"lodash-compat/array/indexOf":39,"lodash-compat/collection/each":43,"lodash-compat/collection/reduce":47,"lodash-compat/lang/isArray":118,"lodash-compat/lang/isPlainObject":127,"lodash-compat/lang/isString":128,"lodash-compat/lang/isUndefined":130,traverse:185,"z-schema":203}],2:[function(e,t,r){(function(r){"use strict";var n={cloneDeep:e("lodash-compat/lang/cloneDeep"),difference:e("lodash-compat/array/difference"),each:e("lodash-compat/collection/each"),find:e("lodash-compat/collection/find"),has:e("lodash-compat/object/has"),isArray:e("lodash-compat/lang/isArray"),isFunction:e("lodash-compat/lang/isFunction"),isPlainObject:e("lodash-compat/lang/isPlainObject"),isString:e("lodash-compat/lang/isString"),isUndefined:e("lodash-compat/lang/isUndefined"),map:e("lodash-compat/collection/map"),reduce:e("lodash-compat/collection/reduce"),set:e("lodash-compat/object/set"),union:e("lodash-compat/array/union")},i=e("async"),o=e("./helpers"),a=e("json-refs"),s=e("spark-md5"),c=e("swagger-converter"),u=e("traverse"),f=e("./validators"),p=e("js-yaml");n.isPlainObject(c)&&(c=r.SwaggerConverter.convert);var l={},h=function(e,t){return"1.2"!==e?t:t.replace("#/models/","")},d=function(e){var t=n.cloneDeep(e);return t.$ref="#/models/"+e.$ref,t},m=n.map(o.swaggerOperationMethods,function(e){return e.toLowerCase()}),y=function(e){return["relative","remote"].indexOf(e.type)>-1},g=function(e,t,r,n){n.push({code:e,message:t,path:r})},v=function(e,t,r,i,s){var c,u,f,p,l,h,d=!0,m=o.getSwaggerVersion(e.resolved),y=n.isArray(t)?t:a.pathFromPtr(t),v=n.isArray(t)?a.pathToPtr(t):t,b=n.isArray(r)?r:a.pathFromPtr(r),E=n.isArray(r)?a.pathToPtr(r):r;if(u=e.definitions[v],h=y[0],c="securityDefinitions"===h?"SECURITY_DEFINITION":h.substring(0,h.length-1).toUpperCase(),f="1.2"===m?y[y.length-1]:v,l="securityDefinitions"===h?"Security definition":c.charAt(0)+c.substring(1).toLowerCase(),["authorizations","securityDefinitions"].indexOf(y[0])>-1&&"scopes"===y[2]&&(c+="_SCOPE",l+=" scope"),n.isUndefined(u)&&-1===["AUTHORIZATION_SCOPE","SECURITY_DEFINITION_SCOPE"].indexOf(c))for(p=1;p0&&(r.allOf=[],n.each(s.lineage,function(t){r.allOf.push(b(e,t))})),delete r.subTypes,n.each(r.properties,function(t,r){var o=i.properties[r];n.each(["maximum","minimum"],function(e){n.isString(t[e])&&(t[e]=parseFloat(t[e]))}),n.each(a.findRefs(o,{includeInvalid:!0,refPreProcessor:d}),function(r,n){var i=e.definitions[r.uri],o=a.pathFromPtr(n);i.lineage.length>0?u(t).set(o,b(e,r.uri)):u(t).set(o.concat("title"),"Composed "+h(e.swaggerVersion,r.uri))})})),r=u(r).map(function(e){"id"===this.key&&n.isString(e)&&this.remove()}),r.title=o,r):void 0},E=function(e,t,r,n,i){g("UNUSED_"+t,r+" is defined but is not used: "+e,n,i)},x=function(e){var t=s.hash(JSON.stringify(e)),r=l[t]||n.find(l,function(e){return e.resolvedId===t});return r||(r=l[t]={definitions:{},original:e,resolved:void 0,swaggerVersion:o.getSwaggerVersion(e)}),r},O=function(e,t){var r=new Error("The Swagger document(s) are invalid");r.errors=e.errors,r.failedValidation=!0,r.warnings=e.warnings,e.apiDeclarations&&(r.apiDeclarations=e.apiDeclarations),t(r)},j=function(e){var t=e.match(/\{(.*?)\}/g),r=[],i=e;return t&&n.each(t,function(e,t){i=i.replace(e,"{"+t+"}"),r.push(e.replace(/[{}]/g,""))}),{path:i,args:r}},w=function(e){function t(r,i,o){function a(e,n){o.push(n),t(r,e,o),o.pop()}-1===r.indexOf(i)?(r.push(i),(n.isArray(i)||n.isPlainObject(i))&&n.each(i,function(e,t){a(e,t.toString())})):n.set(e,o,{}),r.pop()}t([],e,[])},A=function(e,t,r,i,o,a){!n.isUndefined(e)&&e.indexOf(t)>-1&&g("DUPLICATE_"+r,i+" already defined: "+t,o,a)},_=function(e,t,r,n,i){try{f.validateSchemaConstraints(e.swaggerVersion,t,r,void 0)}catch(o){i||g(o.code,o.message,o.path,n.errors)}},I=function(e,t){var r=e.swaggerVersion,i=function(t,r){var n=a.pathToPtr(t),i=e.definitions[n];return i||(i=e.definitions[n]={inline:r||!1,references:[]},["definitions","models"].indexOf(a.pathFromPtr(n)[0])>-1&&(i.cyclical=!1,i.lineage=void 0,i.parents=[])),i},o=function(e){return"1.2"===r?a.pathFromPtr(e).pop():e},s={filter:"local",includeInvalid:!0},c=function(t,r,i){var o=e.definitions[r||t];o&&n.each(o.parents,function(e){i.push(e),t!==e&&c(t,e,i)})},f="1.2"===r?"authorizations":"securityDefinitions",p="1.2"===r?"models":"definitions";switch(n.each(e.resolved[f],function(e,o){var a=[f,o];("1.2"!==r||e.type)&&(i(a),n.reduce(e.scopes,function(e,n,o){var s="1.2"===r?n.scope:o,c=a.concat(["scopes",o.toString()]),u=i(a.concat(["scopes",s]));return u.scopePath=c,A(e,s,"AUTHORIZATION_SCOPE_DEFINITION","Authorization scope definition","1.2"===r?c.concat("scope"):c,t.warnings),e.push(s),e},[]))}),n.each(e.resolved[p],function(o,s){var c=[p,s],f=i(c);if("1.2"===r&&s!==o.id&&g("MODEL_ID_MISMATCH","Model id does not match id in models object: "+o.id,c.concat("id"),t.errors),n.isUndefined(f.lineage))switch(r){case"1.2":n.each(o.subTypes,function(r,n){var o=["models",r],s=a.pathToPtr(o),u=e.definitions[s],f=c.concat(["subTypes",n.toString()]);!u&&e.resolved[p][r]&&(u=i(o)),v(e,o,f,t)&&u.parents.push(a.pathToPtr(c))});break;default:n.each(e.original[p][s].allOf,function(t,r){var o,s=!1;n.isUndefined(t.$ref)||y(a.getRefDetails(t))?(s=!0,o=c.concat(["allOf",r.toString()])):o=a.pathFromPtr(t.$ref),n.isUndefined(u(e.resolved).get(o))||(i(o,s),f.parents.push(a.pathToPtr(o)))})}}),r){case"2.0":n.each(e.resolved.parameters,function(r,n){var o=["parameters",n];i(o),_(e,r,o,t)}),n.each(e.resolved.responses,function(r,n){var o=["responses",n];i(o),_(e,r,o,t)})}n.each(e.definitions,function(i,s){var f,p,l,h=a.pathFromPtr(s),d=u(e.original).get(h),m=h[0],y=m.substring(0,m.length-1).toUpperCase(),v=y.charAt(0)+y.substring(1).toLowerCase();-1!==["definitions","models"].indexOf(m)&&(f=[],p=[],l=i.lineage,n.isUndefined(l)&&(l=[],c(s,void 0,l),l.reverse(),i.lineage=n.cloneDeep(l),i.cyclical=l.length>1&&l[0]===s),i.parents.length>1&&"1.2"===r&&g("MULTIPLE_"+y+"_INHERITANCE","Child "+y.toLowerCase()+" is sub type of multiple models: "+n.map(i.parents,function(e){return o(e)}).join(" && "),h,t.errors),i.cyclical&&g("CYCLICAL_"+y+"_INHERITANCE",v+" has a circular inheritance: "+n.map(l,function(e){return o(e)}).join(" -> ")+" -> "+o(s),h.concat("1.2"===r?"subTypes":"allOf"),t.errors),n.each(l.slice(i.cyclical?1:0),function(t){var r=u(e.resolved).get(a.pathFromPtr(t));n.each(Object.keys(r.properties||{}),function(e){-1===p.indexOf(e)&&p.push(e)})}),_(e,d,h,t),n.each(d.properties,function(r,i){var o=h.concat(["properties",i]);n.isUndefined(r)||(_(e,r,o,t),p.indexOf(i)>-1?g("CHILD_"+y+"_REDECLARES_PROPERTY","Child "+y.toLowerCase()+" declares property already declared by ancestor: "+i,o,t.errors):f.push(i))}),n.each(d.required||[],function(e,n){var i="1.2"===r?"Model":"Definition";-1===p.indexOf(e)&&-1===f.indexOf(e)&&g("MISSING_REQUIRED_"+i.toUpperCase()+"_PROPERTY",i+" requires property but it is not defined: "+e,h.concat(["required",n.toString()]),t.errors)}))}),"1.2"===e.swaggerVersion&&(s.refPreProcessor=d),n.each(a.findRefs(e.original,s),function(r,n){v(e,r.uri,n,t)}),n.each(e.referencesMetadata,function(r,n){y(r)&&r.missing===!0&&t.errors.push({code:"UNRESOLVABLE_REFERENCE",message:"Reference could not be resolved: "+h(e.swaggerVersion,r.uri),path:a.pathFromPtr(n).concat("$ref")})})},P=function(e,t,r,i,o,a){n.isUndefined(e)||-1!==e.indexOf(t)||g("UNRESOLVABLE_"+r,i+" could not be resolved: "+t,o,a)},S=function(e,t,r,i){var o="1.2"===e.swaggerVersion?"AUTHORIZATION":"SECURITY_DEFINITION",a="AUTHORIZATION"===o?"Authorization":"Security definition";"1.2"===e.swaggerVersion?n.reduce(t,function(t,s,c){var u=["authorizations",c],f=r.concat([c]);return v(e,u,f,i)&&n.reduce(s,function(t,r,n){var s=f.concat(n.toString(),"scope"),c=u.concat(["scopes",r.scope]);return A(t,r.scope,o+"_SCOPE_REFERENCE",a+" scope reference",s,i.warnings),v(e,c,s,i),t.concat(r.scope)},[]),t.concat(c)},[]):n.reduce(t,function(t,s,c){return n.each(s,function(s,u){var f=["securityDefinitions",u],p=r.concat(c.toString(),u);A(t,u,o+"_REFERENCE",a+" reference",p,i.warnings),t.push(u),v(e,f,p,i)&&n.each(s,function(t,r){var n=f.concat(["scopes",t]);v(e,n,p.concat(r.toString()),i)})}),t},[])},T=function(e,t){var r=x(e),n=o.getSwaggerVersion(e),i={includeInvalid:!0,loaderOptions:{processContent:function(e,t){t(void 0,p.safeLoad(e.text))}}};r.resolved?t():("1.2"===n&&(i.refPreProcessor=d),a.resolveRefs(e,i).then(function(e){w(e.resolved),r.referencesMetadata=e.refs,r.resolved=e.resolved,r.resolvedId=s.hash(JSON.stringify(e.resolved)),t()})["catch"](t))},C=function(e,t,r,i){var a=n.isString(t)?e.validators[t]:o.createJsonValidator();o.registerCustomFormats(r);try{f.validateAgainstSchema(t,r,a)}catch(s){return s.failedValidation?i(void 0,s.results):i(s)}T(r,function(e){return i(e)})},$=function(e,t){n.each(e.definitions,function(r,n){var i=a.pathFromPtr(n),o=i[0].substring(0,i[0].length-1),s="1.2"===e.swaggerVersion?i[i.length-1]:n,c="securityDefinition"===o?"SECURITY_DEFINITION":o.toUpperCase(),u="securityDefinition"===o?"Security definition":o.charAt(0).toUpperCase()+o.substring(1);0!==r.references.length||r.inline||(r.scopePath&&(c+="_SCOPE",u+=" scope",i=r.scopePath),E(s,c,u,i,t.warnings))})},D=function(e,t,r,i,o,a,s){var c=function(t){g("INVALID_PARAMETER_COMBINATION","API cannot have a a body parameter and a "+("1.2"===e.version?"form":"formData")+" parameter",t,a.errors)},u=[],f=!1,p=!1;n.reduce(i,function(i,s,l){var h=o.concat(["parameters",l.toString()]);if(!n.isUndefined(s))return A(i,s.name,"PARAMETER","Parameter",h.concat("name"),a.errors),"body"===s.paramType||"body"===s["in"]?(f===!0?g("DUPLICATE_API_BODY_PARAMETER","API has more than one body parameter",h,a.errors):p===!0&&c(h),f=!0):"form"===s.paramType||"formData"===s["in"]?(f===!0&&c(h),p=!0):("path"===s.paramType||"path"===s["in"])&&(-1===r.args.indexOf(s.name)&&g("UNRESOLVABLE_API_PATH_PARAMETER","API path parameter could not be resolved: "+s.name,h.concat("name"),a.errors),u.push(s.name)),-1===e.primitives.indexOf(s.type)&&"1.2"===e.version&&v(t,"#/models/"+s.type,h.concat("type"),a),_(t,s,h,a,s.skipErrors),i.concat(s.name)},[]),(n.isUndefined(s)||s===!1)&&n.each(n.difference(r.args,u),function(e){g("MISSING_API_PATH_PARAMETER","API requires path parameter but it is not defined: "+e,"1.2"===t.swaggerVersion?o.slice(0,2).concat("path"):o,a.errors)})},R=function(e,t,r,i){var o=[],a=x(t),s=[],c={errors:[],warnings:[],apiDeclarations:[]};s=n.reduce(t.apis,function(e,t,r){return A(e,t.path,"RESOURCE_PATH","Resource path",["apis",r.toString(),"path"],c.errors),e.push(t.path),e},[]),I(a,c),o=n.reduce(r,function(t,r,i){var u=c.apiDeclarations[i]={errors:[],warnings:[]},f=x(r);return A(t,r.resourcePath,"RESOURCE_PATH","Resource path",["resourcePath"],u.errors),-1===o.indexOf(r.resourcePath)&&(P(s,r.resourcePath,"RESOURCE_PATH","Resource path",["resourcePath"],u.errors),t.push(r.resourcePath)),I(f,u),n.reduce(r.apis,function(t,r,i){var o=["apis",i.toString()],s=j(r.path);return t.indexOf(s.path)>-1?g("DUPLICATE_API_PATH","API path (or equivalent) already defined: "+r.path,o.concat("path"),u.errors):t.push(s.path),n.reduce(r.operations,function(t,r,i){var c=o.concat(["operations",i.toString()]);return A(t,r.method,"OPERATION_METHOD","Operation method",c.concat("method"),u.errors),t.push(r.method),-1===e.primitives.indexOf(r.type)&&"1.2"===e.version&&v(f,"#/models/"+r.type,c.concat("type"),u),S(a,r.authorizations,c.concat("authorizations"),u),_(f,r,c,u),D(e,f,s,r.parameters,c,u),n.reduce(r.responseMessages,function(e,t,r){var n=c.concat(["responseMessages",r.toString()]);return A(e,t.code,"RESPONSE_MESSAGE_CODE","Response message code",n.concat(["code"]),u.errors),t.responseModel&&v(f,"#/models/"+t.responseModel,n.concat("responseModel"),u),e.concat(t.code)},[]),t},[]),t},[]),$(f,u),t},[]),$(a,c),n.each(n.difference(s,o),function(e){var r=s.indexOf(e);E(t.apis[r].path,"RESOURCE_PATH","Resource path",["apis",r.toString(),"path"],c.errors)}),i(void 0,c)},k=function(e,t,r){var i=x(t),o={errors:[],warnings:[]};I(i,o),S(i,t.security,["security"],o),n.reduce(i.resolved.paths,function(t,r,a){var s=["paths",a],c=j(a);return t.indexOf(c.path)>-1&&g("DUPLICATE_API_PATH","API path (or equivalent) already defined: "+a,s,o.errors),D(e,i,c,r.parameters,s,o,!0),n.each(r,function(t,a){var u=[],f=s.concat(a),p=[];-1!==m.indexOf(a)&&(S(i,t.security,f.concat("security"),o),n.each(t.parameters,function(e){n.isUndefined(e)||(u.push(e),p.push(e.name+":"+e["in"]))}),n.each(r.parameters,function(e){var t=n.cloneDeep(e);t.skipErrors=!0,-1===p.indexOf(e.name+":"+e["in"])&&u.push(t)}),D(e,i,c,u,f,o),n.each(t.responses,function(e,t){n.isUndefined(e)||_(i,e,f.concat("responses",t),o)}))}),t.concat(c.path)},[]),$(i,o),r(void 0,o)},F=function(e,t,r,n){var i=function(e,t){n(e,o.formatResults(t))};"1.2"===e.version?R(e,t,r,i):k(e,t,i)},U=function(e,t,r,o){C(e,"1.2"===e.version?"resourceListing.json":"schema.json",t,function(t,a){return t?o(t):void(a||"1.2"!==e.version?o(void 0,a):(a={errors:[],warnings:[],apiDeclarations:[]},i.map(r,function(t,r){C(e,"apiDeclaration.json",t,r)},function(e,t){return e?o(e):(n.each(t,function(e,t){a.apiDeclarations[t]=e}),void o(void 0,a))})))})},L=function(t){var r=this,i=function(e,t){return n.reduce(t,function(e,t,r){return e[r]=o.createJsonValidator(t),e},{})},a=function(e){var t=n.cloneDeep(r.schemas[e]);return t.id=e,t},s=["string","number","boolean","integer","array"];switch(t){case"1.2":this.docsUrl="https://github.com/swagger-api/swagger-spec/blob/master/versions/1.2.md",this.primitives=n.union(s,["void","File"]),this.schemasUrl="https://github.com/swagger-api/swagger-spec/tree/master/schemas/v1.2",this.schemas={"apiDeclaration.json":e("../schemas/1.2/apiDeclaration.json"),"authorizationObject.json":e("../schemas/1.2/authorizationObject.json"),"dataType.json":e("../schemas/1.2/dataType.json"),"dataTypeBase.json":e("../schemas/1.2/dataTypeBase.json"),"infoObject.json":e("../schemas/1.2/infoObject.json"),"modelsObject.json":e("../schemas/1.2/modelsObject.json"),"oauth2GrantType.json":e("../schemas/1.2/oauth2GrantType.json"),"operationObject.json":e("../schemas/1.2/operationObject.json"),"parameterObject.json":e("../schemas/1.2/parameterObject.json"),"resourceListing.json":e("../schemas/1.2/resourceListing.json"),"resourceObject.json":e("../schemas/1.2/resourceObject.json")},this.validators=i(this,{"apiDeclaration.json":n.map(["dataTypeBase.json","modelsObject.json","oauth2GrantType.json","authorizationObject.json","parameterObject.json","operationObject.json","apiDeclaration.json"],a),"resourceListing.json":n.map(["resourceObject.json","infoObject.json","oauth2GrantType.json","authorizationObject.json","resourceListing.json"],a)});break;case"2.0":this.docsUrl="https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md",this.primitives=n.union(s,["file"]),this.schemasUrl="https://github.com/swagger-api/swagger-spec/tree/master/schemas/v2.0",this.schemas={"schema.json":e("../schemas/2.0/schema.json")},this.validators=i(this,{"schema.json":[a("schema.json")]});break;default:throw new Error(t+" is an unsupported Swagger specification version")}this.version=t};L.prototype.validate=function(e,t,r){switch(this.version){case"1.2":if(n.isUndefined(e))throw new Error("resourceListing is required");if(!n.isPlainObject(e))throw new TypeError("resourceListing must be an object");if(n.isUndefined(t))throw new Error("apiDeclarations is required");if(!n.isArray(t))throw new TypeError("apiDeclarations must be an array");break;case"2.0":if(n.isUndefined(e))throw new Error("swaggerObject is required");if(!n.isPlainObject(e))throw new TypeError("swaggerObject must be an object")}if("2.0"===this.version&&(r=arguments[1]),n.isUndefined(r))throw new Error("callback is required");if(!n.isFunction(r))throw new TypeError("callback must be a function");"2.0"===this.version&&(t=[]);var i=this;U(this,e,t,function(n,a){n||o.formatResults(a)?r(n,a):F(i,e,t,r)})},L.prototype.composeModel=function(e,t,r){var i=o.getSwaggerVersion(e),a=function(n,i){var a;return n?r(n):o.getErrorCount(i)>0?O(i,r):(a=x(e),i={errors:[],warnings:[]},I(a,i),a.definitions[t]?o.getErrorCount(i)>0?O(i,r):void r(void 0,b(a,t)):r())};switch(this.version){case"1.2":if(n.isUndefined(e))throw new Error("apiDeclaration is required");if(!n.isPlainObject(e))throw new TypeError("apiDeclaration must be an object");if(n.isUndefined(t))throw new Error("modelId is required");break;case"2.0":if(n.isUndefined(e))throw new Error("swaggerObject is required");if(!n.isPlainObject(e))throw new TypeError("swaggerObject must be an object");if(n.isUndefined(t))throw new Error("modelRef is required")}if(n.isUndefined(r))throw new Error("callback is required");if(!n.isFunction(r))throw new TypeError("callback must be a function");if("#"!==t.charAt(0)){if("1.2"!==this.version)throw new Error("modelRef must be a JSON Pointer");t="#/models/"+t}"1.2"===i?C(this,"apiDeclaration.json",e,a):this.validate(e,a)},L.prototype.validateModel=function(e,t,r,i){switch(this.version){case"1.2":if(n.isUndefined(e))throw new Error("apiDeclaration is required");if(!n.isPlainObject(e))throw new TypeError("apiDeclaration must be an object");if(n.isUndefined(t))throw new Error("modelId is required");break;case"2.0":if(n.isUndefined(e))throw new Error("swaggerObject is required");if(!n.isPlainObject(e))throw new TypeError("swaggerObject must be an object");if(n.isUndefined(t))throw new Error("modelRef is required")}if(n.isUndefined(r))throw new Error("data is required");if(n.isUndefined(i))throw new Error("callback is required");if(!n.isFunction(i))throw new TypeError("callback must be a function");var o=this;this.composeModel(e,t,function(e,t){return e?i(e):void C(o,t,r,i)})},L.prototype.resolve=function(e,t,r){var i,s=function(e){return n.isString(t)?r(void 0,u(e).get(a.pathFromPtr(t))):r(void 0,e)};if(n.isUndefined(e))throw new Error("document is required");if(!n.isPlainObject(e))throw new TypeError("document must be an object");if(2===arguments.length&&(r=arguments[1],t=void 0),!n.isUndefined(t)&&!n.isString(t))throw new TypeError("ptr must be a JSON Pointer string");if(n.isUndefined(r))throw new Error("callback is required");if(!n.isFunction(r))throw new TypeError("callback must be a function");if(i=x(e),"1.2"===i.swaggerVersion)throw new Error("Swagger 1.2 is not supported");return i.resolved?s(i.resolved):void this.validate(e,function(e,t){return e?r(e):o.getErrorCount(t)>0?O(t,r):s(i.resolved)})},L.prototype.convert=function(e,t,r,i){var a=function(e,t){i(void 0,c(e,t))};if("1.2"!==this.version)throw new Error("Specification#convert only works for Swagger 1.2");if(n.isUndefined(e))throw new Error("resourceListing is required");if(!n.isPlainObject(e))throw new TypeError("resourceListing must be an object");if(n.isUndefined(t)&&(t=[]),!n.isArray(t))throw new TypeError("apiDeclarations must be an array");if(arguments.length<4&&(i=arguments[arguments.length-1]),n.isUndefined(i))throw new Error("callback is required");if(!n.isFunction(i))throw new TypeError("callback must be a function");r===!0?a(e,t):this.validate(e,t,function(r,n){return r?i(r):o.getErrorCount(n)>0?O(n,i):void a(e,t)})},t.exports.v1=t.exports.v1_2=new L("1.2"),t.exports.v2=t.exports.v2_0=new L("2.0")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../schemas/1.2/apiDeclaration.json":206,"../schemas/1.2/authorizationObject.json":207,"../schemas/1.2/dataType.json":208,"../schemas/1.2/dataTypeBase.json":209,"../schemas/1.2/infoObject.json":210,"../schemas/1.2/modelsObject.json":211,"../schemas/1.2/oauth2GrantType.json":212,"../schemas/1.2/operationObject.json":213,"../schemas/1.2/parameterObject.json":214,"../schemas/1.2/resourceListing.json":215,"../schemas/1.2/resourceObject.json":216,"../schemas/2.0/schema.json":217,"./helpers":1,"./validators":3,async:4,"js-yaml":7,"json-refs":37,"lodash-compat/array/difference":38,"lodash-compat/array/union":41,"lodash-compat/collection/each":43,"lodash-compat/collection/find":44,"lodash-compat/collection/map":46,"lodash-compat/collection/reduce":47,"lodash-compat/lang/cloneDeep":116,"lodash-compat/lang/isArray":118,"lodash-compat/lang/isFunction":122,"lodash-compat/lang/isPlainObject":127,"lodash-compat/lang/isString":128,"lodash-compat/lang/isUndefined":130,"lodash-compat/object/has":131,"lodash-compat/object/set":135,"spark-md5":183,"swagger-converter":184,traverse:185}],3:[function(e,t,r){"use strict";var n={cloneDeep:e("lodash-compat/lang/cloneDeep"),each:e("lodash-compat/collection/each"),isArray:e("lodash-compat/lang/isArray"),isBoolean:e("lodash-compat/lang/isBoolean"),isDate:e("lodash-compat/lang/isDate"),isFinite:e("lodash-compat/lang/isFinite"),isNull:e("lodash-compat/lang/isNull"),isNumber:e("lodash-compat/lang/isNumber"),isPlainObject:e("lodash-compat/lang/isPlainObject"),isString:e("lodash-compat/lang/isString"),isUndefined:e("lodash-compat/lang/isUndefined"),map:e("lodash-compat/collection/map"),union:e("lodash-compat/array/union"),uniq:e("lodash-compat/array/uniq")},i=e("./helpers"),o=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/,a=/^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$/,s=function(e){var t,r,i;return n.isDate(e)?!0:(n.isString(e)||(e=e.toString()),r=o.exec(e),null===r?!1:(t=r[3],i=r[2],"01">i||i>"12"||"01">t||t>"31"?!1:!0))},c=function(e){var t,r,i,o,c,u,f;return n.isDate(e)?!0:(n.isString(e)||(e=e.toString()),u=e.toLowerCase().split("t"),r=u[0],i=u.length>1?u[1]:void 0,s(r)?(o=a.exec(i),null===o?!1:(t=o[1],c=o[2],f=o[3],t>"23"||c>"59"||f>"59"?!1:!0)):!1)},u=function(e,t){var r=new Error(t);throw r.code=e,r.failedValidation=!0,r};t.exports.validateAgainstSchema=function(e,t,r){var o=function(e){var t=["additionalProperties","items"].indexOf(e.path[e.path.length-1])>-1?"schema":e.path[e.path.length-2];if(["ANY_OF_MISSING","ONE_OF_MISSING"].indexOf(e.code)>-1){switch(t){case"parameters":t="parameter";break;case"responses":t="response";break;case"schema":t+=" "+e.path[e.path.length-1]}e.message="Not a valid "+t+" definition"}delete e.params,delete e.schemaId,e.inner&&n.each(e.inner,function(e){o(e)})},a=n.isPlainObject(e)?n.cloneDeep(e):e;n.isUndefined(r)&&(r=i.createJsonValidator([a]));var s=r.validate(t,a);if(!s)try{u("SCHEMA_VALIDATION_FAILED","Failed schema validation")}catch(c){throw c.results={errors:n.map(r.getLastErrors(),function(e){return o(e),e}),warnings:[]},c}};var f=t.exports.validateArrayType=function(e){"array"===e.type&&n.isUndefined(e.items)&&u("OBJECT_MISSING_REQUIRED_PROPERTY","Missing required property: items")};t.exports.validateContentType=function(e,t,r){var i="function"==typeof r.end,o=i?r.getHeader("content-type"):r.headers["content-type"],a=n.map(n.union(e,t),function(e){return e.split(";")[0]});if(o||(o=i?"text/plain":"application/octet-stream"),o=o.split(";")[0],a.length>0&&(i?!0:-1!==["POST","PUT"].indexOf(r.method))&&-1===a.indexOf(o))throw new Error("Invalid content type ("+o+"). These are valid: "+a.join(", "))};var p=t.exports.validateEnum=function(e,t){n.isUndefined(t)||n.isUndefined(e)||-1!==t.indexOf(e)||u("ENUM_MISMATCH","Not an allowable value ("+t.join(", ")+"): "+e)},l=t.exports.validateMaximum=function(e,t,r,i){var o,a,s=i===!0?"MAXIMUM_EXCLUSIVE":"MAXIMUM";n.isUndefined(i)&&(i=!1),"integer"===r?a=parseInt(e,10):"number"===r&&(a=parseFloat(e)),n.isUndefined(t)||(o=parseFloat(t),i&&a>=o?u(s,"Greater than or equal to the configured maximum ("+t+"): "+e):a>o&&u(s,"Greater than the configured maximum ("+t+"): "+e))},h=t.exports.validateMaxItems=function(e,t){!n.isUndefined(t)&&e.length>t&&u("ARRAY_LENGTH_LONG","Array is too long ("+e.length+"), maximum "+t)},d=t.exports.validateMaxLength=function(e,t){!n.isUndefined(t)&&e.length>t&&u("MAX_LENGTH","String is too long ("+e.length+" chars), maximum "+t)},m=t.exports.validateMaxProperties=function(e,t){var r=n.isPlainObject(e)?Object.keys(e).length:0;!n.isUndefined(t)&&r>t&&u("MAX_PROPERTIES","Number of properties is too many ("+r+" properties), maximum "+t)},y=t.exports.validateMinimum=function(e,t,r,i){var o,a,s=i===!0?"MINIMUM_EXCLUSIVE":"MINIMUM";n.isUndefined(i)&&(i=!1),"integer"===r?a=parseInt(e,10):"number"===r&&(a=parseFloat(e)),n.isUndefined(t)||(o=parseFloat(t),i&&o>=a?u(s,"Less than or equal to the configured minimum ("+t+"): "+e):o>a&&u(s,"Less than the configured minimum ("+t+"): "+e))},g=t.exports.validateMinItems=function(e,t){!n.isUndefined(t)&&e.lengthr&&u("MIN_PROPERTIES","Number of properties is too few ("+r+" properties), minimum "+t)},E=t.exports.validateMultipleOf=function(e,t){n.isUndefined(t)||e%t===0||u("MULTIPLE_OF","Not a multiple of "+t)},x=t.exports.validatePattern=function(e,t){!n.isUndefined(t)&&n.isNull(e.match(new RegExp(t)))&&u("PATTERN","Does not match required pattern: "+t)};t.exports.validateRequiredness=function(e,t){!n.isUndefined(t)&&t===!0&&n.isUndefined(e)&&u("REQUIRED","Is required")};var O=t.exports.validateTypeAndFormat=function A(e,t,r,i,o,a){var f=!0,p=t;if(o!==!0||""!==t){if(n.isArray(t))n.each(t,function(t,n){A(e,t,r,i,o,!0)||u("INVALID_TYPE","Value at index "+n+" is not a valid "+r+": "+t)});else switch(r){case"boolean":"1.2"===e&&n.isString(t)&&("false"===t?t=!1:"true"===t&&(t=!0)),f=n.isBoolean(t);break;case"integer":"1.2"===e&&n.isString(t)&&(t=Number(t)),f=n.isFinite(t)&&Math.round(t)===t;break;case"number":"1.2"===e&&n.isString(t)&&(t=Number(t)),f=n.isFinite(t);break;case"string":if(!n.isUndefined(i))switch(i){case"date":f=s(t);break;case"date-time":f=c(t)}break;case"void":f=n.isUndefined(t)}return a?f:void(f||u("INVALID_TYPE","void"!==r?"Not a valid "+(n.isUndefined(i)?"":i+" ")+r+": "+p:"Void does not allow a value"))}},j=t.exports.validateUniqueItems=function(e,t){n.isUndefined(t)||n.uniq(e).length===e.length||u("ARRAY_UNIQUE","Does not allow duplicate values: "+e.join(", "))},w=t.exports.validateSchemaConstraints=function(e,t,r,i){var o,a=function(e){var t=e;return t.schema&&(r=r.concat(["schema"]),t=a(t.schema)),t},s=t.type;s||(t.schema?(t=a(t),s=t.type||"object"):s="responses"===r[r.length-2]?"void":"object"),o=t?t.allowEmptyValue===!0:!1;try{if("array"===s&&f(t),n.isUndefined(i)&&(i="1.2"===e?t.defaultValue:t["default"],r=r.concat(["1.2"===e?"defaultValue":"default"])),n.isUndefined(i))return;"array"===s?n.each(i,function(n,i){try{w(e,t.items||{},r.concat(i.toString()),n)}catch(o){throw o.message="Value at index "+i+" "+("INVALID_TYPE"===o.code?"is ":"")+o.message.charAt(0).toLowerCase()+o.message.substring(1),o}}):O(e,i,s,t.format,o),p(i,t["enum"]),l(i,t.maximum,s,t.exclusiveMaximum),h(i,t.maxItems),d(i,t.maxLength),m(i,t.maxProperties),y(i,t.minimum,s,t.exclusiveMinimum),g(i,t.minItems),v(i,t.minLength),b(i,t.minProperties),E(i,t.multipleOf),x(i,t.pattern),j(i,t.uniqueItems)}catch(c){throw c.path=r,c}}},{"./helpers":1,"lodash-compat/array/union":41,"lodash-compat/array/uniq":42,"lodash-compat/collection/each":43,"lodash-compat/collection/map":46,"lodash-compat/lang/cloneDeep":116,"lodash-compat/lang/isArray":118,"lodash-compat/lang/isBoolean":119,"lodash-compat/lang/isDate":120,"lodash-compat/lang/isFinite":121,"lodash-compat/lang/isNull":124,"lodash-compat/lang/isNumber":125,"lodash-compat/lang/isPlainObject":127, -"lodash-compat/lang/isString":128,"lodash-compat/lang/isUndefined":130}],4:[function(t,r,n){(function(t,n){!function(){function i(){}function o(e){return e}function a(e){return!!e}function s(e){return!e}function c(e){return function(){if(null===e)throw new Error("Callback was already called.");e.apply(this,arguments),e=null}}function u(e){return function(){null!==e&&(e.apply(this,arguments),e=null)}}function f(e){return M(e)||"number"==typeof e.length&&e.length>=0&&e.length%1===0}function p(e,t){for(var r=-1,n=e.length;++rn?n:null}):(r=Y(e),t=r.length,function(){return n++,t>n?r[n]:null})}function v(e,t){return t=null==t?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),i=0;r>i;i++)n[i]=arguments[i+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n)}}}function b(e){return function(t,r,n){return e(t,n)}}function E(e){return function(t,r,n){n=u(n||i),t=t||[];var o=g(t);if(0>=e)return n(null);var a=!1,s=0,f=!1;!function p(){if(a&&0>=s)return n(null);for(;e>s&&!f;){var i=o();if(null===i)return a=!0,void(0>=s&&n(null));s+=1,r(t[i],i,c(function(e){s-=1,e?(n(e),f=!0):p()}))}}()}}function x(e){return function(t,r,n){return e(U.eachOf,t,r,n)}}function O(e){return function(t,r,n,i){return e(E(r),t,n,i)}}function j(e){return function(t,r,n){return e(U.eachOfSeries,t,r,n)}}function w(e,t,r,n){n=u(n||i),t=t||[];var o=f(t)?[]:{};e(t,function(e,t,n){r(e,function(e,r){o[t]=r,n(e)})},function(e){n(e,o)})}function A(e,t,r,n){var i=[];e(t,function(e,t,n){r(e,function(r){r&&i.push({index:t,value:e}),n()})},function(){n(l(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})}function _(e,t,r,n){A(e,t,function(e,t){r(e,function(e){t(!e)})},n)}function I(e,t,r){return function(n,i,o,a){function s(){a&&a(r(!1,void 0))}function c(e,n,i){return a?void o(e,function(n){a&&t(n)&&(a(r(!0,e)),a=o=!1),i()}):i()}arguments.length>3?e(n,i,c,s):(a=o,o=i,e(n,c,s))}}function P(e,t){return t}function S(e,t,r){r=r||i;var n=f(t)?[]:{};e(t,function(e,t,r){e(v(function(e,i){i.length<=1&&(i=i[0]),n[t]=i,r(e)}))},function(e){r(e,n)})}function T(e,t,r,n){var i=[];e(t,function(e,t,n){r(e,function(e,t){i=i.concat(t||[]),n(e)})},function(e){n(e,i)})}function C(e,t,r){function n(e,t,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");return e.started=!0,M(t)||(t=[t]),0===t.length&&e.idle()?U.setImmediate(function(){e.drain()}):(p(t,function(t){var o={data:t,callback:n||i};r?e.tasks.unshift(o):e.tasks.push(o),e.tasks.length===e.concurrency&&e.saturated()}),void U.setImmediate(e.process))}function o(e,t){return function(){a-=1;var r=!1,n=arguments;p(t,function(e){p(s,function(t,n){t!==e||r||(s.splice(n,1),r=!0)}),e.callback.apply(e,n)}),e.tasks.length+a===0&&e.drain(),e.process()}}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var a=0,s=[],u={tasks:[],concurrency:t,payload:r,saturated:i,empty:i,drain:i,started:!1,paused:!1,push:function(e,t){n(u,e,!1,t)},kill:function(){u.drain=i,u.tasks=[]},unshift:function(e,t){n(u,e,!0,t)},process:function(){for(;!u.paused&&a=t;t++)U.setImmediate(u.process)}}};return u}function $(e){return v(function(t,r){t.apply(null,r.concat([v(function(t,r){"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&p(r,function(t){console[e](t)}))})]))})}function D(e){return function(t,r,n){e(h(t),r,n)}}function R(e){return v(function(t,r){var n=v(function(r){var n=this,i=r.pop();return e(t,function(e,t,i){e.apply(n,r.concat([i]))},i)});return r.length?n.apply(this,r):n})}function k(e){return v(function(t){var r=t.pop();t.push(function(){var e=arguments;n?U.setImmediate(function(){r.apply(null,e)}):r.apply(null,e)});var n=!0;e.apply(this,t),n=!1})}var F,U={},L="object"==typeof self&&self.self===self&&self||"object"==typeof n&&n.global===n&&n||this;null!=L&&(F=L.async),U.noConflict=function(){return L.async=F,U};var N=Object.prototype.toString,M=Array.isArray||function(e){return"[object Array]"===N.call(e)},q=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},Y=Object.keys||function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t},B="function"==typeof setImmediate&&setImmediate,H=B?function(e){B(e)}:function(e){setTimeout(e,0)};"object"==typeof t&&"function"==typeof t.nextTick?U.nextTick=t.nextTick:U.nextTick=H,U.setImmediate=B?H:U.nextTick,U.forEach=U.each=function(e,t,r){return U.eachOf(e,b(t),r)},U.forEachSeries=U.eachSeries=function(e,t,r){return U.eachOfSeries(e,b(t),r)},U.forEachLimit=U.eachLimit=function(e,t,r,n){return E(t)(e,b(r),n)},U.forEachOf=U.eachOf=function(e,t,r){function n(e){s--,e?r(e):null===o&&0>=s&&r(null)}r=u(r||i),e=e||[];for(var o,a=g(e),s=0;null!=(o=a());)s+=1,t(e[o],o,c(n));0===s&&r(null)},U.forEachOfSeries=U.eachOfSeries=function(e,t,r){function n(){var i=!0;return null===a?r(null):(t(e[a],a,c(function(e){if(e)r(e);else{if(a=o(),null===a)return r(null);i?U.setImmediate(n):n()}})),void(i=!1))}r=u(r||i),e=e||[];var o=g(e),a=o();n()},U.forEachOfLimit=U.eachOfLimit=function(e,t,r,n){E(t)(e,r,n)},U.map=x(w),U.mapSeries=j(w),U.mapLimit=O(w),U.inject=U.foldl=U.reduce=function(e,t,r,n){U.eachOfSeries(e,function(e,n,i){r(t,e,function(e,r){t=r,i(e)})},function(e){n(e,t)})},U.foldr=U.reduceRight=function(e,t,r,n){var i=l(e,o).reverse();U.reduce(i,t,r,n)},U.transform=function(e,t,r,n){3===arguments.length&&(n=r,r=t,t=M(e)?[]:{}),U.eachOf(e,function(e,n,i){r(t,e,n,i)},function(e){n(e,t)})},U.select=U.filter=x(A),U.selectLimit=U.filterLimit=O(A),U.selectSeries=U.filterSeries=j(A),U.reject=x(_),U.rejectLimit=O(_),U.rejectSeries=j(_),U.any=U.some=I(U.eachOf,a,o),U.someLimit=I(U.eachOfLimit,a,o),U.all=U.every=I(U.eachOf,s,s),U.everyLimit=I(U.eachOfLimit,s,s),U.detect=I(U.eachOf,o,P),U.detectSeries=I(U.eachOfSeries,o,P),U.detectLimit=I(U.eachOfLimit,o,P),U.sortBy=function(e,t,r){function n(e,t){var r=e.criteria,n=t.criteria;return n>r?-1:r>n?1:0}U.map(e,function(e,r){t(e,function(t,n){t?r(t):r(null,{value:e,criteria:n})})},function(e,t){return e?r(e):void r(null,l(t.sort(n),function(e){return e.value}))})},U.auto=function(e,t,r){function n(e){g.unshift(e)}function o(e){var t=y(g,e);t>=0&&g.splice(t,1)}function a(){c--,p(g.slice(0),function(e){e()})}"function"==typeof arguments[1]&&(r=t,t=null),r=u(r||i);var s=Y(e),c=s.length;if(!c)return r(null);t||(t=c);var f={},l=0,h=!1,g=[];n(function(){c||r(null,f)}),p(s,function(i){function s(){return t>l&&d(b,function(e,t){return e&&f.hasOwnProperty(t)},!0)&&!f.hasOwnProperty(i)}function c(){s()&&(l++,o(c),p[p.length-1](g,f))}if(!h){for(var u,p=M(e[i])?e[i]:[e[i]],g=v(function(e,t){if(l--,t.length<=1&&(t=t[0]),e){var n={};m(f,function(e,t){n[t]=e}),n[i]=t,h=!0,r(e,n)}else f[i]=t,U.setImmediate(a)}),b=p.slice(0,p.length-1),E=b.length;E--;){if(!(u=e[b[E]]))throw new Error("Has nonexistent dependency in "+b.join(", "));if(M(u)&&y(u,i)>=0)throw new Error("Has cyclic dependencies")}s()?(l++,p[p.length-1](g,f)):n(c)}})},U.retry=function(e,t,r){function n(e,t){if("number"==typeof t)e.times=parseInt(t,10)||o;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);e.times=parseInt(t.times,10)||o,e.interval=parseInt(t.interval,10)||a}}function i(e,t){function r(e,r){return function(n){e(function(e,t){n(!e||r,{err:e,result:t})},t)}}function n(e){return function(t){setTimeout(function(){t(null)},e)}}for(;c.times;){var i=!(c.times-=1);s.push(r(c.task,i)),!i&&c.interval>0&&s.push(n(c.interval))}U.series(s,function(t,r){r=r[r.length-1],(e||c.callback)(r.err,r.result)})}var o=5,a=0,s=[],c={times:o,interval:a},u=arguments.length;if(1>u||u>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=u&&"function"==typeof e&&(r=t,t=e),"function"!=typeof e&&n(c,e),c.callback=r,c.task=t,c.callback?i():i},U.waterfall=function(e,t){function r(e){return v(function(n,i){if(n)t.apply(null,[n].concat(i));else{var o=e.next();o?i.push(r(o)):i.push(t),k(e).apply(null,i)}})}if(t=u(t||i),!M(e)){var n=new Error("First argument to waterfall must be an array of functions");return t(n)}return e.length?void r(U.iterator(e))():t()},U.parallel=function(e,t){S(U.eachOf,e,t)},U.parallelLimit=function(e,t,r){S(E(t),e,r)},U.series=function(e,t){S(U.eachOfSeries,e,t)},U.iterator=function(e){function t(r){function n(){return e.length&&e[r].apply(null,arguments),n.next()}return n.next=function(){return rn;){var o=n+(i-n+1>>>1);r(t,e[o])>=0?n=o:i=o-1}return n}function o(e,t,o,a){if(null!=a&&"function"!=typeof a)throw new Error("task callback must be a function");return e.started=!0,M(t)||(t=[t]),0===t.length?U.setImmediate(function(){e.drain()}):void p(t,function(t){var s={data:t,priority:o,callback:"function"==typeof a?a:i};e.tasks.splice(n(e.tasks,s,r)+1,0,s),e.tasks.length===e.concurrency&&e.saturated(),U.setImmediate(e.process)})}var a=U.queue(e,t);return a.push=function(e,t,r){o(a,e,t,r)},delete a.unshift,a},U.cargo=function(e,t){return C(e,1,t)},U.log=$("log"),U.dir=$("dir"),U.memoize=function(e,t){var r={},n={},i=Object.prototype.hasOwnProperty;t=t||o;var a=v(function(o){var a=o.pop(),s=t.apply(null,o);i.call(r,s)?U.setImmediate(function(){a.apply(null,r[s])}):i.call(n,s)?n[s].push(a):(n[s]=[a],e.apply(null,o.concat([v(function(e){r[s]=e;var t=n[s];delete n[s];for(var i=0,o=t.length;o>i;i++)t[i].apply(null,e)})])))});return a.memo=r,a.unmemoized=e,a},U.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}},U.times=D(U.map),U.timesSeries=D(U.mapSeries),U.timesLimit=function(e,t,r,n){return U.mapLimit(h(e),t,r,n)},U.seq=function(){var e=arguments;return v(function(t){var r=this,n=t[t.length-1];"function"==typeof n?t.pop():n=i,U.reduce(e,t,function(e,t,n){t.apply(r,e.concat([v(function(e,t){n(e,t)})]))},function(e,t){n.apply(r,[e].concat(t))})})},U.compose=function(){return U.seq.apply(null,Array.prototype.reverse.call(arguments))},U.applyEach=R(U.eachOf),U.applyEachSeries=R(U.eachOfSeries),U.forever=function(e,t){function r(e){return e?n(e):void o(r)}var n=c(t||i),o=k(e);r()},U.ensureAsync=k,U.constant=v(function(e){var t=[null].concat(e);return function(e){return e.apply(this,t)}}),U.wrapSync=U.asyncify=function(e){return v(function(t){var r,n=t.pop();try{r=e.apply(this,t)}catch(i){return n(i)}q(r)&&"function"==typeof r.then?r.then(function(e){n(null,e)})["catch"](function(e){n(e.message?e:new Error(e))}):n(null,r)})},"object"==typeof r&&r.exports?r.exports=U:"function"==typeof e&&e.amd?e([],function(){return U}):L.async=U}()}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:176}],5:[function(e,t,r){},{}],6:[function(e,t,r){function n(e){return e?i(e):void 0}function i(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n,i=0;in;++n)r[n].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],7:[function(e,t,r){"use strict";var n=e("./lib/js-yaml.js");t.exports=n},{"./lib/js-yaml.js":8}],8:[function(e,t,r){"use strict";function n(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}var i=e("./js-yaml/loader"),o=e("./js-yaml/dumper");t.exports.Type=e("./js-yaml/type"),t.exports.Schema=e("./js-yaml/schema"),t.exports.FAILSAFE_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.JSON_SCHEMA=e("./js-yaml/schema/json"),t.exports.CORE_SCHEMA=e("./js-yaml/schema/core"),t.exports.DEFAULT_SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_FULL_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=o.dump,t.exports.safeDump=o.safeDump,t.exports.YAMLException=e("./js-yaml/exception"),t.exports.MINIMAL_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.scan=n("scan"),t.exports.parse=n("parse"),t.exports.compose=n("compose"),t.exports.addConstructor=n("addConstructor")},{"./js-yaml/dumper":10,"./js-yaml/exception":11,"./js-yaml/loader":12,"./js-yaml/schema":14,"./js-yaml/schema/core":15,"./js-yaml/schema/default_full":16,"./js-yaml/schema/default_safe":17,"./js-yaml/schema/failsafe":18,"./js-yaml/schema/json":19,"./js-yaml/type":20}],9:[function(e,t,r){"use strict";function n(e){return"undefined"==typeof e||null===e}function i(e){return"object"==typeof e&&null!==e}function o(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){var r,n,i,o;if(t)for(o=Object.keys(t),r=0,n=o.length;n>r;r+=1)i=o[r],e[i]=t[i];return e}function s(e,t){var r,n="";for(r=0;t>r;r+=1)n+=e;return n}function c(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=n,t.exports.isObject=i,t.exports.toArray=o,t.exports.repeat=s,t.exports.isNegativeZero=c,t.exports.extend=a},{}],10:[function(e,t,r){"use strict";function n(e,t){var r,n,i,o,a,s,c;if(null===t)return{};for(r={},n=Object.keys(t),i=0,o=n.length;o>i;i+=1)a=n[i],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap[a],c&&T.call(c.styleAliases,s)&&(s=c.styleAliases[s]),r[a]=s;return r}function i(e){var t,r,n;if(t=e.toString(16).toUpperCase(),255>=e)r="x",n=2;else if(65535>=e)r="u",n=4;else{if(!(4294967295>=e))throw new _("code point within a string may not be greater than 0xFFFFFFFF");r="U",n=8}return"\\"+r+A.repeat("0",n-t.length)+t}function o(e){this.schema=e.schema||I,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=A.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=n(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function a(e,t){for(var r,n=A.repeat(" ",t),i=0,o=-1,a="",s=e.length;s>i;)o=e.indexOf("\n",i),-1===o?(r=e.slice(i),i=s):(r=e.slice(i,o+1),i=o+1),r.length&&"\n"!==r&&(a+=n),a+=r;return a}function s(e,t){return"\n"+A.repeat(" ",e.indent*t)}function c(e,t){var r,n,i;for(r=0,n=e.implicitTypes.length;n>r;r+=1)if(i=e.implicitTypes[r],i.resolve(t))return!0;return!1}function u(e){this.source=e,this.result="",this.checkpoint=0}function f(e,t,r,n){var i,o,s,f,l,m,y,g,v,b,E,x,O,j,w,A,_,I,P,S,T;if(0===t.length)return void(e.dump="''");if(-1!==te.indexOf(t))return void(e.dump="'"+t+"'");for(i=!0,o=t.length?t.charCodeAt(0):0,s=R===o||R===t.charCodeAt(t.length-1),(B===o||K===o||W===o||G===o)&&(i=!1),s||e.flowLevel>-1&&e.flowLevel<=r?(s&&(i=!1),f=!1,l=!1):(f=!n,l=!n),m=!0,y=new u(t),g=!1,v=0,b=0,E=e.indent*r,x=e.lineWidth,-1===x&&(x=9007199254740991),40>E?x-=E:x=40,j=0;j0&&(_=t.charCodeAt(j-1),_===R&&(l=!1,f=!1)),f&&(I=j-v,v=j,I>b&&(b=I))),O!==F&&(m=!1),y.takeUpTo(j),y.escapeChar())}if(i&&c(e,t)&&(i=!1),P="",(f||l)&&(S=0,t.charCodeAt(t.length-1)===$&&(S+=1,t.charCodeAt(t.length-2)===$&&(S+=1)),0===S?P="-":2===S&&(P="+")),(l&&x>b||null!==e.tag)&&(f=!1),g||(l=!1),i)e.dump=t;else if(m)e.dump="'"+t+"'";else if(f)T=p(t,x),e.dump=">"+P+"\n"+a(T,E);else if(l)P||(t=t.replace(/\n$/,"")),e.dump="|"+P+"\n"+a(t,E);else{if(!y)throw new Error("Failed to dump scalar value");y.finish(),e.dump='"'+y.result+'"'}}function p(e,t){var r,n="",i=0,o=e.length,a=/\n+$/.exec(e);for(a&&(o=a.index+1);o>i;)r=e.indexOf("\n",i),r>o||-1===r?(n&&(n+="\n\n"),n+=l(e.slice(i,o),t),i=o):(n&&(n+="\n\n"),n+=l(e.slice(i,r),t),i=r+1);return a&&"\n"!==a[0]&&(n+=a[0]),n}function l(e,t){if(""===e)return e;for(var r,n,i,o=/[^\s] [^\s]/g,a="",s=0,c=0,u=o.exec(e);u;)r=u.index,r-c>t&&(n=s!==c?s:r,a&&(a+="\n"),i=e.slice(c,n),a+=i,c=n+1),s=r+1,u=o.exec(e);return a&&(a+="\n"),a+=c!==s&&e.length-c>t?e.slice(c,s)+"\n"+e.slice(s+1):e.slice(c)}function h(e){return C!==e&&$!==e&&D!==e&&Y!==e&&z!==e&&X!==e&&J!==e&&Q!==e&&U!==e&&N!==e&&q!==e&&k!==e&&Z!==e&&V!==e&&M!==e&&F!==e&&L!==e&&H!==e&&!ee[e]&&!d(e)}function d(e){return!(e>=32&&126>=e||133===e||e>=160&&55295>=e||e>=57344&&65533>=e||e>=65536&&1114111>=e)}function m(e,t,r){var n,i,o="",a=e.tag;for(n=0,i=r.length;i>n;n+=1)E(e,t,r[n],!1,!1)&&(0!==n&&(o+=", "),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function y(e,t,r,n){var i,o,a="",c=e.tag;for(i=0,o=r.length;o>i;i+=1)E(e,t+1,r[i],!0,!0)&&(n&&0===i||(a+=s(e,t)),a+="- "+e.dump);e.tag=c,e.dump=a||"[]"}function g(e,t,r){var n,i,o,a,s,c="",u=e.tag,f=Object.keys(r);for(n=0,i=f.length;i>n;n+=1)s="",0!==n&&(s+=", "),o=f[n],a=r[o],E(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",E(e,t,a,!1,!1)&&(s+=e.dump,c+=s));e.tag=u,e.dump="{"+c+"}"}function v(e,t,r,n){var i,o,a,c,u,f,p="",l=e.tag,h=Object.keys(r);if(e.sortKeys===!0)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new _("sortKeys must be a boolean or a function");for(i=0,o=h.length;o>i;i+=1)f="",n&&0===i||(f+=s(e,t)),a=h[i],c=r[a],E(e,t+1,a,!0,!0,!0)&&(u=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,u&&(f+=e.dump&&$===e.dump.charCodeAt(0)?"?":"? "),f+=e.dump,u&&(f+=s(e,t)),E(e,t+1,c,!0,u)&&(f+=e.dump&&$===e.dump.charCodeAt(0)?":":": ",f+=e.dump,p+=f));e.tag=l,e.dump=p||"{}"}function b(e,t,r){var n,i,o,a,s,c;for(i=r?e.explicitTypes:e.implicitTypes,o=0,a=i.length;a>o;o+=1)if(s=i[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=r?s.tag:"?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===S.call(s.represent))n=s.represent(t,c);else{if(!T.call(s.represent,c))throw new _("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');n=s.represent[c](t,c)}e.dump=n}return!0}return!1}function E(e,t,r,n,i,o){e.tag=null,e.dump=r,b(e,r,!1)||b(e,r,!0);var a=S.call(e.dump);n&&(n=0>e.flowLevel||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(s=e.duplicates.indexOf(r),c=-1!==s),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&t>0)&&(i=!1),c&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(u&&c&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),"[object Object]"===a)n&&0!==Object.keys(e.dump).length?(v(e,t,e.dump,i),c&&(e.dump="&ref_"+s+e.dump)):(g(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else if("[object Array]"===a)n&&0!==e.dump.length?(y(e,t,e.dump,i),c&&(e.dump="&ref_"+s+e.dump)):(m(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else{if("[object String]"!==a){if(e.skipInvalid)return!1;throw new _("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&f(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function x(e,t){var r,n,i=[],o=[];for(O(e,i,o),r=0,n=o.length;n>r;r+=1)t.duplicates.push(i[o[r]]);t.usedDuplicates=new Array(n)}function O(e,t,r){var n,i,o;if(null!==e&&"object"==typeof e)if(i=t.indexOf(e),-1!==i)-1===r.indexOf(i)&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;o>i;i+=1)O(e[i],t,r);else for(n=Object.keys(e),i=0,o=n.length;o>i;i+=1)O(e[n[i]],t,r)}function j(e,t){t=t||{};var r=new o(t);return r.noRefs||x(e,r),E(r,0,e,!0,!0)?r.dump+"\n":""}function w(e,t){return j(e,A.extend({schema:P},t))}var A=e("./common"),_=e("./exception"),I=e("./schema/default_full"),P=e("./schema/default_safe"),S=Object.prototype.toString,T=Object.prototype.hasOwnProperty,C=9,$=10,D=13,R=32,k=33,F=34,U=35,L=37,N=38,M=39,q=42,Y=44,B=45,H=58,V=62,K=63,W=64,z=91,X=93,G=96,J=123,Z=124,Q=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";var te=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];u.prototype.takeUpTo=function(e){var t;if(e checkpoint"),t.position=e,t.checkpoint=this.checkpoint,t;return this.result+=this.source.slice(this.checkpoint,e),this.checkpoint=e,this},u.prototype.escapeChar=function(){var e,t;return e=this.source.charCodeAt(this.checkpoint),t=ee[e]||i(e),this.result+=t,this.checkpoint+=1,this},u.prototype.finish=function(){this.source.length>this.checkpoint&&this.takeUpTo(this.source.length)},t.exports.dump=j,t.exports.safeDump=w},{"./common":9,"./exception":11,"./schema/default_full":16,"./schema/default_safe":17}],11:[function(e,t,r){"use strict";function n(e,t){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():"")}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=n},{}],12:[function(e,t,r){"use strict";function n(e){return 10===e||13===e}function i(e){return 9===e||32===e}function o(e){return 9===e||32===e||10===e||13===e}function a(e){return 44===e||91===e||93===e||123===e||125===e}function s(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function c(e){return 120===e?2:117===e?4:85===e?8:0}function u(e){return e>=48&&57>=e?e-48:-1}function f(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?"\x0B":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e){return 65535>=e?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function l(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||H,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function h(e,t){return new q(t,new Y(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function d(e,t){throw h(e,t)}function m(e,t){e.onWarning&&e.onWarning.call(null,h(e,t))}function y(e,t,r,n){var i,o,a,s;if(r>t){if(s=e.input.slice(t,r),n)for(i=0,o=s.length;o>i;i+=1)a=s.charCodeAt(i),9===a||a>=32&&1114111>=a||d(e,"expected valid JSON character");else Q.test(s)&&d(e,"the stream contains non-printable characters");e.result+=s}}function g(e,t,r,n){var i,o,a,s;for(M.isObject(r)||d(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),a=0,s=i.length;s>a;a+=1)o=i[a],V.call(t,o)||(t[o]=r[o],n[o]=!0)}function v(e,t,r,n,i,o){var a,s;if(i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(o))for(a=0,s=o.length;s>a;a+=1)g(e,t,o[a],r);else g(e,t,o,r);else e.json||V.call(r,i)||!V.call(t,i)||d(e,"duplicated mapping key"),t[i]=o,delete r[i];return t}function b(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):d(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function E(e,t,r){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;i(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do a=e.input.charCodeAt(++e.position);while(10!==a&&13!==a&&0!==a);if(!n(a))break;for(b(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position)}return-1!==r&&0!==o&&e.lineIndent1&&(e.result+=M.repeat("\n",t-1))}function j(e,t,r){var s,c,u,f,p,l,h,d,m,g=e.kind,v=e.result;if(m=e.input.charCodeAt(e.position),o(m)||a(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(c=e.input.charCodeAt(e.position+1),o(c)||r&&a(c)))return!1;for(e.kind="scalar",e.result="",u=f=e.position,p=!1;0!==m;){if(58===m){if(c=e.input.charCodeAt(e.position+1),o(c)||r&&a(c))break}else if(35===m){if(s=e.input.charCodeAt(e.position-1),o(s))break}else{if(e.position===e.lineStart&&x(e)||r&&a(m))break;if(n(m)){if(l=e.line,h=e.lineStart,d=e.lineIndent,E(e,!1,-1),e.lineIndent>=t){p=!0,m=e.input.charCodeAt(e.position);continue}e.position=f,e.line=l,e.lineStart=h,e.lineIndent=d;break}}p&&(y(e,u,f,!1),O(e,e.line-l),u=f=e.position,p=!1),i(m)||(f=e.position+1),m=e.input.charCodeAt(++e.position)}return y(e,u,f,!1),e.result?!0:(e.kind=g,e.result=v,!1)}function w(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),39!==r)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;0!==(r=e.input.charCodeAt(e.position));)if(39===r){if(y(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),39!==r)return!0;i=o=e.position,e.position++}else n(r)?(y(e,i,o,!0),O(e,E(e,!1,t)),i=o=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);d(e,"unexpected end of the stream within a single quoted scalar")}function A(e,t){var r,i,o,a,u,f;if(f=e.input.charCodeAt(e.position),34!==f)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(f=e.input.charCodeAt(e.position));){if(34===f)return y(e,r,e.position,!0),e.position++,!0;if(92===f){if(y(e,r,e.position,!0),f=e.input.charCodeAt(++e.position),n(f))E(e,!1,t);else if(256>f&&ie[f])e.result+=oe[f],e.position++;else if((u=c(f))>0){for(o=u,a=0;o>0;o--)f=e.input.charCodeAt(++e.position),(u=s(f))>=0?a=(a<<4)+u:d(e,"expected hexadecimal character");e.result+=p(a),e.position++}else d(e,"unknown escape sequence");r=i=e.position}else n(f)?(y(e,r,i,!0),O(e,E(e,!1,t)),r=i=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}d(e,"unexpected end of the stream within a double quoted scalar")}function _(e,t){var r,n,i,a,s,c,u,f,p,l,h,m=!0,y=e.tag,g=e.anchor,b={};if(h=e.input.charCodeAt(e.position),91===h)a=93,u=!1,n=[];else{if(123!==h)return!1;a=125,u=!0,n={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=n),h=e.input.charCodeAt(++e.position);0!==h;){if(E(e,!0,t),h=e.input.charCodeAt(e.position),h===a)return e.position++,e.tag=y,e.anchor=g,e.kind=u?"mapping":"sequence",e.result=n,!0;m||d(e,"missed comma between flow collection entries"),p=f=l=null,s=c=!1,63===h&&(i=e.input.charCodeAt(e.position+1),o(i)&&(s=c=!0,e.position++,E(e,!0,t))),r=e.line,D(e,t,K,!1,!0),p=e.tag,f=e.result,E(e,!0,t),h=e.input.charCodeAt(e.position),!c&&e.line!==r||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),E(e,!0,t),D(e,t,K,!1,!0),l=e.result),u?v(e,n,b,p,f,l):s?n.push(v(e,null,b,p,f,l)):n.push(f),E(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}d(e,"unexpected end of the stream within a flow collection")}function I(e,t){var r,o,a,s,c=G,f=!1,p=t,l=0,h=!1;if(s=e.input.charCodeAt(e.position),124===s)o=!1;else{if(62!==s)return!1;o=!0}for(e.kind="scalar",e.result="";0!==s;)if(s=e.input.charCodeAt(++e.position),43===s||45===s)G===c?c=43===s?Z:J:d(e,"repeat of a chomping mode identifier");else{if(!((a=u(s))>=0))break;0===a?d(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):f?d(e,"repeat of an indentation width identifier"):(p=t+a-1,f=!0)}if(i(s)){do s=e.input.charCodeAt(++e.position);while(i(s));if(35===s)do s=e.input.charCodeAt(++e.position);while(!n(s)&&0!==s)}for(;0!==s;){for(b(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!f||e.lineIndentp&&(p=e.lineIndent),n(s))l++;else{if(e.lineIndentt)&&0!==i)d(e,"bad indentation of a sequence entry");else if(e.lineIndent1?"s are":" is")+" invalid:"),n.each(r.getLastErrors(),function(e){console.error(" "+(n.isArray(e.path)?i.pathToPtr(e.path):e.path)+": "+e.message)}),new Error("Unable to create validator due to invalid JSON Schema");return r},t.exports.formatResults=function(e){return e&&(e=e.errors.length+e.warnings.length+n.reduce(e.apiDeclarations,function(e,t){return t&&(e+=t.errors.length+t.warnings.length),e},0)>0?e:void 0),e};var p=t.exports.getErrorCount=function(e){var t=0;return e&&(t=e.errors.length,n.each(e.apiDeclarations,function(e){e&&(t+=e.errors.length)})),t},l=function(e){return e&&!n.isString(e)&&(e=e.toString(),-1===e.indexOf(".")&&(e+=".0")),e};t.exports.getSpec=function(t,r){var i;if(t=l(t),i=f[t],n.isUndefined(i))switch(t){case"1.2":i=e("../lib/specs").v1_2;break;case"2.0":i=e("../lib/specs").v2_0;break;default:if(r===!0)throw new Error("Unsupported Swagger version: "+t)}return i},t.exports.getSwaggerVersion=function(e){return n.isPlainObject(e)?l(e.swaggerVersion||e.swagger):void 0},t.exports.printValidationResults=function(e,t,r,o,a){var s=p(o)>0,c=s?console.error:console.log,u=function(e,t){return 1===t?e:e+"s"},f=function(e,t,r){e&&(c(e+":"),c()),n.each(t,function(e){c(new Array(r+1).join(" ")+i.pathToPtr(e.path)+": "+e.message),e.inner&&f(void 0,e.inner,r+2)}),e&&c()},l=0,h=0;c(),o.errors.length>0&&(l+=o.errors.length,f("API Errors",o.errors,2)),o.warnings.length>0&&(h+=o.warnings.length,f("API Warnings",o.warnings,2)),o.apiDeclarations&&o.apiDeclarations.forEach(function(e,t){if(e){var n=r[t].resourcePath||t;e.errors.length>0&&(l+=e.errors.length,f(" API Declaration ("+n+") Errors",e.errors,4)),e.warnings.length>0&&(h+=e.warnings.length,f(" API Declaration ("+n+") Warnings",e.warnings,4))}}),a&&c(l>0?l+" "+u("error",l)+" and "+h+" "+u("warning",h):"Validation succeeded but with "+h+" "+u("warning",h)),c()},t.exports.swaggerOperationMethods=["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]},{"../lib/specs":2,"../schemas/json-schema-draft-04.json":218,"json-refs":37,"lodash-compat/array/indexOf":39,"lodash-compat/collection/each":43,"lodash-compat/collection/reduce":47,"lodash-compat/lang/isArray":118,"lodash-compat/lang/isPlainObject":127,"lodash-compat/lang/isString":128,"lodash-compat/lang/isUndefined":130,traverse:185,"z-schema":203}],2:[function(e,t,r){(function(r){"use strict";var n={cloneDeep:e("lodash-compat/lang/cloneDeep"),difference:e("lodash-compat/array/difference"),each:e("lodash-compat/collection/each"),find:e("lodash-compat/collection/find"),has:e("lodash-compat/object/has"),isArray:e("lodash-compat/lang/isArray"),isFunction:e("lodash-compat/lang/isFunction"),isPlainObject:e("lodash-compat/lang/isPlainObject"),isString:e("lodash-compat/lang/isString"),isUndefined:e("lodash-compat/lang/isUndefined"),map:e("lodash-compat/collection/map"),reduce:e("lodash-compat/collection/reduce"),set:e("lodash-compat/object/set"),union:e("lodash-compat/array/union")},i=e("async"),o=e("./helpers"),a=e("json-refs"),s=e("spark-md5"),c=e("swagger-converter"),u=e("traverse"),f=e("./validators"),p=e("js-yaml");n.isPlainObject(c)&&(c=r.SwaggerConverter.convert);var l={},h=function(e,t){return"1.2"!==e?t:t.replace("#/models/","")},d=function(e){var t=n.cloneDeep(e);return t.$ref="#/models/"+e.$ref,t},m=n.map(o.swaggerOperationMethods,function(e){return e.toLowerCase()}),y=function(e){return["relative","remote"].indexOf(e.type)>-1},g=function(e,t,r,n){n.push({code:e,message:t,path:r})},v=function(e,t,r,i,s){var c,u,f,p,l,h,d=!0,m=o.getSwaggerVersion(e.resolved),y=n.isArray(t)?t:a.pathFromPtr(t),v=n.isArray(t)?a.pathToPtr(t):t,b=n.isArray(r)?r:a.pathFromPtr(r),E=n.isArray(r)?a.pathToPtr(r):r;if(u=e.definitions[v],h=y[0],c="securityDefinitions"===h?"SECURITY_DEFINITION":h.substring(0,h.length-1).toUpperCase(),f="1.2"===m?y[y.length-1]:v,l="securityDefinitions"===h?"Security definition":c.charAt(0)+c.substring(1).toLowerCase(),["authorizations","securityDefinitions"].indexOf(y[0])>-1&&"scopes"===y[2]&&(c+="_SCOPE",l+=" scope"),n.isUndefined(u)&&-1===["AUTHORIZATION_SCOPE","SECURITY_DEFINITION_SCOPE"].indexOf(c))for(p=1;p0&&(r.allOf=[],n.each(s.lineage,function(t){r.allOf.push(b(e,t))})),delete r.subTypes,n.each(r.properties,function(t,r){var o=i.properties[r];n.each(["maximum","minimum"],function(e){n.isString(t[e])&&(t[e]=parseFloat(t[e]))}),n.each(a.findRefs(o,{includeInvalid:!0,refPreProcessor:d}),function(r,n){var i=e.definitions[r.uri],o=a.pathFromPtr(n);i.lineage.length>0?u(t).set(o,b(e,r.uri)):u(t).set(o.concat("title"),"Composed "+h(e.swaggerVersion,r.uri))})})),r=u(r).map(function(e){"id"===this.key&&n.isString(e)&&this.remove()}),r.title=o,r):void 0},E=function(e,t,r,n,i){g("UNUSED_"+t,r+" is defined but is not used: "+e,n,i)},x=function(e){var t=s.hash(JSON.stringify(e)),r=l[t]||n.find(l,function(e){return e.resolvedId===t});return r||(r=l[t]={definitions:{},original:e,resolved:void 0,swaggerVersion:o.getSwaggerVersion(e)}),r},O=function(e,t){var r=new Error("The Swagger document(s) are invalid");r.errors=e.errors,r.failedValidation=!0,r.warnings=e.warnings,e.apiDeclarations&&(r.apiDeclarations=e.apiDeclarations),t(r)},j=function(e){var t=e.match(/\{(.*?)\}/g),r=[],i=e;return t&&n.each(t,function(e,t){i=i.replace(e,"{"+t+"}"),r.push(e.replace(/[{}]/g,""))}),{path:i,args:r}},w=function(e){function t(r,i,o){function a(e,n){o.push(n),t(r,e,o),o.pop()}-1===r.indexOf(i)?(r.push(i),(n.isArray(i)||n.isPlainObject(i))&&n.each(i,function(e,t){a(e,t.toString())})):n.set(e,o,{}),r.pop()}t([],e,[])},A=function(e,t,r,i,o,a){!n.isUndefined(e)&&e.indexOf(t)>-1&&g("DUPLICATE_"+r,i+" already defined: "+t,o,a)},_=function(e,t,r,n,i){try{f.validateSchemaConstraints(e.swaggerVersion,t,r,void 0)}catch(o){i||g(o.code,o.message,o.path,n.errors)}},I=function(e,t){var r=e.swaggerVersion,i=function(t,r){var n=a.pathToPtr(t),i=e.definitions[n];return i||(i=e.definitions[n]={inline:r||!1,references:[]},["definitions","models"].indexOf(a.pathFromPtr(n)[0])>-1&&(i.cyclical=!1,i.lineage=void 0,i.parents=[])),i},o=function(e){return"1.2"===r?a.pathFromPtr(e).pop():e},s={filter:"local",includeInvalid:!0},c=function(t,r,i){var o=e.definitions[r||t];o&&n.each(o.parents,function(e){i.push(e),t!==e&&c(t,e,i)})},f="1.2"===r?"authorizations":"securityDefinitions",p="1.2"===r?"models":"definitions";switch(n.each(e.resolved[f],function(e,o){var a=[f,o];("1.2"!==r||e.type)&&(i(a),n.reduce(e.scopes,function(e,n,o){var s="1.2"===r?n.scope:o,c=a.concat(["scopes",o.toString()]),u=i(a.concat(["scopes",s]));return u.scopePath=c,A(e,s,"AUTHORIZATION_SCOPE_DEFINITION","Authorization scope definition","1.2"===r?c.concat("scope"):c,t.warnings),e.push(s),e},[]))}),n.each(e.resolved[p],function(o,s){var c=[p,s],f=i(c);if("1.2"===r&&s!==o.id&&g("MODEL_ID_MISMATCH","Model id does not match id in models object: "+o.id,c.concat("id"),t.errors),n.isUndefined(f.lineage))switch(r){case"1.2":n.each(o.subTypes,function(r,n){var o=["models",r],s=a.pathToPtr(o),u=e.definitions[s],f=c.concat(["subTypes",n.toString()]);!u&&e.resolved[p][r]&&(u=i(o)),v(e,o,f,t)&&u.parents.push(a.pathToPtr(c))});break;default:n.each(e.original[p][s].allOf,function(t,r){var o,s=!1;n.isUndefined(t.$ref)||y(a.getRefDetails(t))?(s=!0,o=c.concat(["allOf",r.toString()])):o=a.pathFromPtr(t.$ref),n.isUndefined(u(e.resolved).get(o))||(i(o,s),f.parents.push(a.pathToPtr(o)))})}}),r){case"2.0":n.each(e.resolved.parameters,function(r,n){var o=["parameters",n];i(o),_(e,r,o,t)}),n.each(e.resolved.responses,function(r,n){var o=["responses",n];i(o),_(e,r,o,t)})}n.each(e.definitions,function(i,s){var f,p,l,h=a.pathFromPtr(s),d=u(e.original).get(h),m=h[0],y=m.substring(0,m.length-1).toUpperCase(),v=y.charAt(0)+y.substring(1).toLowerCase();-1!==["definitions","models"].indexOf(m)&&(f=[],p=[],l=i.lineage,n.isUndefined(l)&&(l=[],c(s,void 0,l),l.reverse(),i.lineage=n.cloneDeep(l),i.cyclical=l.length>1&&l[0]===s),i.parents.length>1&&"1.2"===r&&g("MULTIPLE_"+y+"_INHERITANCE","Child "+y.toLowerCase()+" is sub type of multiple models: "+n.map(i.parents,function(e){return o(e)}).join(" && "),h,t.errors),i.cyclical&&g("CYCLICAL_"+y+"_INHERITANCE",v+" has a circular inheritance: "+n.map(l,function(e){return o(e)}).join(" -> ")+" -> "+o(s),h.concat("1.2"===r?"subTypes":"allOf"),t.errors),n.each(l.slice(i.cyclical?1:0),function(t){var r=u(e.resolved).get(a.pathFromPtr(t));n.each(Object.keys(r.properties||{}),function(e){-1===p.indexOf(e)&&p.push(e)})}),_(e,d,h,t),n.each(d.properties,function(r,i){var o=h.concat(["properties",i]);n.isUndefined(r)||(_(e,r,o,t),p.indexOf(i)>-1?g("CHILD_"+y+"_REDECLARES_PROPERTY","Child "+y.toLowerCase()+" declares property already declared by ancestor: "+i,o,t.errors):f.push(i))}),n.each(d.required||[],function(e,n){var i="1.2"===r?"Model":"Definition";-1===p.indexOf(e)&&-1===f.indexOf(e)&&g("MISSING_REQUIRED_"+i.toUpperCase()+"_PROPERTY",i+" requires property but it is not defined: "+e,h.concat(["required",n.toString()]),t.errors)}))}),"1.2"===e.swaggerVersion&&(s.refPreProcessor=d),n.each(a.findRefs(e.original,s),function(r,n){v(e,r.uri,n,t)}),n.each(e.referencesMetadata,function(r,n){y(r)&&r.missing===!0&&t.errors.push({code:"UNRESOLVABLE_REFERENCE",message:"Reference could not be resolved: "+h(e.swaggerVersion,r.uri),path:a.pathFromPtr(n).concat("$ref")})})},P=function(e,t,r,i,o,a){n.isUndefined(e)||-1!==e.indexOf(t)||g("UNRESOLVABLE_"+r,i+" could not be resolved: "+t,o,a)},S=function(e,t,r,i){var o="1.2"===e.swaggerVersion?"AUTHORIZATION":"SECURITY_DEFINITION",a="AUTHORIZATION"===o?"Authorization":"Security definition";"1.2"===e.swaggerVersion?n.reduce(t,function(t,s,c){var u=["authorizations",c],f=r.concat([c]);return v(e,u,f,i)&&n.reduce(s,function(t,r,n){var s=f.concat(n.toString(),"scope"),c=u.concat(["scopes",r.scope]);return A(t,r.scope,o+"_SCOPE_REFERENCE",a+" scope reference",s,i.warnings),v(e,c,s,i),t.concat(r.scope)},[]),t.concat(c)},[]):n.reduce(t,function(t,s,c){return n.each(s,function(s,u){var f=["securityDefinitions",u],p=r.concat(c.toString(),u);A(t,u,o+"_REFERENCE",a+" reference",p,i.warnings),t.push(u),v(e,f,p,i)&&n.each(s,function(t,r){var n=f.concat(["scopes",t]);v(e,n,p.concat(r.toString()),i)})}),t},[])},T=function(e,t){var r=x(e),n=o.getSwaggerVersion(e),i={includeInvalid:!0,loaderOptions:{processContent:function(e,t){t(void 0,p.safeLoad(e.text))}}};r.resolved?t():("1.2"===n&&(i.refPreProcessor=d),a.resolveRefs(e,i).then(function(e){w(e.resolved),r.referencesMetadata=e.refs,r.resolved=e.resolved,r.resolvedId=s.hash(JSON.stringify(e.resolved)),t()})["catch"](t))},C=function(e,t,r,i){var a=n.isString(t)?e.validators[t]:o.createJsonValidator();o.registerCustomFormats(r);try{f.validateAgainstSchema(t,r,a)}catch(s){return s.failedValidation?i(void 0,s.results):i(s)}T(r,function(e){return i(e)})},$=function(e,t){n.each(e.definitions,function(r,n){var i=a.pathFromPtr(n),o=i[0].substring(0,i[0].length-1),s="1.2"===e.swaggerVersion?i[i.length-1]:n,c="securityDefinition"===o?"SECURITY_DEFINITION":o.toUpperCase(),u="securityDefinition"===o?"Security definition":o.charAt(0).toUpperCase()+o.substring(1);0!==r.references.length||r.inline||(r.scopePath&&(c+="_SCOPE",u+=" scope",i=r.scopePath),E(s,c,u,i,t.warnings))})},D=function(e,t,r,i,o,a,s){var c=function(t){g("INVALID_PARAMETER_COMBINATION","API cannot have a a body parameter and a "+("1.2"===e.version?"form":"formData")+" parameter",t,a.errors)},u=[],f=!1,p=!1;n.reduce(i,function(i,s,l){var h=o.concat(["parameters",l.toString()]);if(!n.isUndefined(s))return A(i,s.name,"PARAMETER","Parameter",h.concat("name"),a.errors),"body"===s.paramType||"body"===s["in"]?(f===!0?g("DUPLICATE_API_BODY_PARAMETER","API has more than one body parameter",h,a.errors):p===!0&&c(h),f=!0):"form"===s.paramType||"formData"===s["in"]?(f===!0&&c(h),p=!0):("path"===s.paramType||"path"===s["in"])&&(-1===r.args.indexOf(s.name)&&g("UNRESOLVABLE_API_PATH_PARAMETER","API path parameter could not be resolved: "+s.name,h.concat("name"),a.errors),u.push(s.name)),-1===e.primitives.indexOf(s.type)&&"1.2"===e.version&&v(t,"#/models/"+s.type,h.concat("type"),a),_(t,s,h,a,s.skipErrors),i.concat(s.name)},[]),(n.isUndefined(s)||s===!1)&&n.each(n.difference(r.args,u),function(e){g("MISSING_API_PATH_PARAMETER","API requires path parameter but it is not defined: "+e,"1.2"===t.swaggerVersion?o.slice(0,2).concat("path"):o,a.errors)})},R=function(e,t,r,i){var o=[],a=x(t),s=[],c={errors:[],warnings:[],apiDeclarations:[]};s=n.reduce(t.apis,function(e,t,r){return A(e,t.path,"RESOURCE_PATH","Resource path",["apis",r.toString(),"path"],c.errors),e.push(t.path),e},[]),I(a,c),o=n.reduce(r,function(t,r,i){var u=c.apiDeclarations[i]={errors:[],warnings:[]},f=x(r);return A(t,r.resourcePath,"RESOURCE_PATH","Resource path",["resourcePath"],u.errors),-1===o.indexOf(r.resourcePath)&&(P(s,r.resourcePath,"RESOURCE_PATH","Resource path",["resourcePath"],u.errors),t.push(r.resourcePath)),I(f,u),n.reduce(r.apis,function(t,r,i){var o=["apis",i.toString()],s=j(r.path);return t.indexOf(s.path)>-1?g("DUPLICATE_API_PATH","API path (or equivalent) already defined: "+r.path,o.concat("path"),u.errors):t.push(s.path),n.reduce(r.operations,function(t,r,i){var c=o.concat(["operations",i.toString()]);return A(t,r.method,"OPERATION_METHOD","Operation method",c.concat("method"),u.errors),t.push(r.method),-1===e.primitives.indexOf(r.type)&&"1.2"===e.version&&v(f,"#/models/"+r.type,c.concat("type"),u),S(a,r.authorizations,c.concat("authorizations"),u),_(f,r,c,u),D(e,f,s,r.parameters,c,u),n.reduce(r.responseMessages,function(e,t,r){var n=c.concat(["responseMessages",r.toString()]);return A(e,t.code,"RESPONSE_MESSAGE_CODE","Response message code",n.concat(["code"]),u.errors),t.responseModel&&v(f,"#/models/"+t.responseModel,n.concat("responseModel"),u),e.concat(t.code)},[]),t},[]),t},[]),$(f,u),t},[]),$(a,c),n.each(n.difference(s,o),function(e){var r=s.indexOf(e);E(t.apis[r].path,"RESOURCE_PATH","Resource path",["apis",r.toString(),"path"],c.errors)}),i(void 0,c)},k=function(e,t,r){var i=x(t),o={errors:[],warnings:[]};I(i,o),S(i,t.security,["security"],o),n.reduce(i.resolved.paths,function(t,r,a){var s=["paths",a],c=j(a);return t.indexOf(c.path)>-1&&g("DUPLICATE_API_PATH","API path (or equivalent) already defined: "+a,s,o.errors),D(e,i,c,r.parameters,s,o,!0),n.each(r,function(t,a){var u=[],f=s.concat(a),p=[];-1!==m.indexOf(a)&&(S(i,t.security,f.concat("security"),o),n.each(t.parameters,function(e){n.isUndefined(e)||(u.push(e),p.push(e.name+":"+e["in"]))}),n.each(r.parameters,function(e){var t=n.cloneDeep(e);t.skipErrors=!0,-1===p.indexOf(e.name+":"+e["in"])&&u.push(t)}),D(e,i,c,u,f,o),n.each(t.responses,function(e,t){n.isUndefined(e)||_(i,e,f.concat("responses",t),o)}))}),t.concat(c.path)},[]),$(i,o),r(void 0,o)},F=function(e,t,r,n){var i=function(e,t){n(e,o.formatResults(t))};"1.2"===e.version?R(e,t,r,i):k(e,t,i)},U=function(e,t,r,o){C(e,"1.2"===e.version?"resourceListing.json":"schema.json",t,function(t,a){return t?o(t):void(a||"1.2"!==e.version?o(void 0,a):(a={errors:[],warnings:[],apiDeclarations:[]},i.map(r,function(t,r){C(e,"apiDeclaration.json",t,r)},function(e,t){return e?o(e):(n.each(t,function(e,t){a.apiDeclarations[t]=e}),void o(void 0,a))})))})},L=function(t){var r=this,i=function(e,t){return n.reduce(t,function(e,t,r){return e[r]=o.createJsonValidator(t),e},{})},a=function(e){var t=n.cloneDeep(r.schemas[e]);return t.id=e,t},s=["string","number","boolean","integer","array"];switch(t){case"1.2":this.docsUrl="https://github.com/swagger-api/swagger-spec/blob/master/versions/1.2.md",this.primitives=n.union(s,["void","File"]),this.schemasUrl="https://github.com/swagger-api/swagger-spec/tree/master/schemas/v1.2",this.schemas={"apiDeclaration.json":e("../schemas/1.2/apiDeclaration.json"),"authorizationObject.json":e("../schemas/1.2/authorizationObject.json"),"dataType.json":e("../schemas/1.2/dataType.json"),"dataTypeBase.json":e("../schemas/1.2/dataTypeBase.json"),"infoObject.json":e("../schemas/1.2/infoObject.json"),"modelsObject.json":e("../schemas/1.2/modelsObject.json"),"oauth2GrantType.json":e("../schemas/1.2/oauth2GrantType.json"),"operationObject.json":e("../schemas/1.2/operationObject.json"),"parameterObject.json":e("../schemas/1.2/parameterObject.json"),"resourceListing.json":e("../schemas/1.2/resourceListing.json"),"resourceObject.json":e("../schemas/1.2/resourceObject.json")},this.validators=i(this,{"apiDeclaration.json":n.map(["dataTypeBase.json","modelsObject.json","oauth2GrantType.json","authorizationObject.json","parameterObject.json","operationObject.json","apiDeclaration.json"],a),"resourceListing.json":n.map(["resourceObject.json","infoObject.json","oauth2GrantType.json","authorizationObject.json","resourceListing.json"],a)});break;case"2.0":this.docsUrl="https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md",this.primitives=n.union(s,["file"]),this.schemasUrl="https://github.com/swagger-api/swagger-spec/tree/master/schemas/v2.0",this.schemas={"schema.json":e("../schemas/2.0/schema.json")},this.validators=i(this,{"schema.json":[a("schema.json")]});break;default:throw new Error(t+" is an unsupported Swagger specification version")}this.version=t};L.prototype.validate=function(e,t,r){switch(this.version){case"1.2":if(n.isUndefined(e))throw new Error("resourceListing is required");if(!n.isPlainObject(e))throw new TypeError("resourceListing must be an object");if(n.isUndefined(t))throw new Error("apiDeclarations is required");if(!n.isArray(t))throw new TypeError("apiDeclarations must be an array");break;case"2.0":if(n.isUndefined(e))throw new Error("swaggerObject is required");if(!n.isPlainObject(e))throw new TypeError("swaggerObject must be an object")}if("2.0"===this.version&&(r=arguments[1]),n.isUndefined(r))throw new Error("callback is required");if(!n.isFunction(r))throw new TypeError("callback must be a function");"2.0"===this.version&&(t=[]);var i=this;U(this,e,t,function(n,a){n||o.formatResults(a)?r(n,a):F(i,e,t,r)})},L.prototype.composeModel=function(e,t,r){var i=o.getSwaggerVersion(e),a=function(n,i){var a;return n?r(n):o.getErrorCount(i)>0?O(i,r):(a=x(e),i={errors:[],warnings:[]},I(a,i),a.definitions[t]?o.getErrorCount(i)>0?O(i,r):void r(void 0,b(a,t)):r())};switch(this.version){case"1.2":if(n.isUndefined(e))throw new Error("apiDeclaration is required");if(!n.isPlainObject(e))throw new TypeError("apiDeclaration must be an object");if(n.isUndefined(t))throw new Error("modelId is required");break;case"2.0":if(n.isUndefined(e))throw new Error("swaggerObject is required");if(!n.isPlainObject(e))throw new TypeError("swaggerObject must be an object");if(n.isUndefined(t))throw new Error("modelRef is required")}if(n.isUndefined(r))throw new Error("callback is required");if(!n.isFunction(r))throw new TypeError("callback must be a function");if("#"!==t.charAt(0)){if("1.2"!==this.version)throw new Error("modelRef must be a JSON Pointer");t="#/models/"+t}"1.2"===i?C(this,"apiDeclaration.json",e,a):this.validate(e,a)},L.prototype.validateModel=function(e,t,r,i){switch(this.version){case"1.2":if(n.isUndefined(e))throw new Error("apiDeclaration is required");if(!n.isPlainObject(e))throw new TypeError("apiDeclaration must be an object");if(n.isUndefined(t))throw new Error("modelId is required");break;case"2.0":if(n.isUndefined(e))throw new Error("swaggerObject is required");if(!n.isPlainObject(e))throw new TypeError("swaggerObject must be an object");if(n.isUndefined(t))throw new Error("modelRef is required")}if(n.isUndefined(r))throw new Error("data is required");if(n.isUndefined(i))throw new Error("callback is required");if(!n.isFunction(i))throw new TypeError("callback must be a function");var o=this;this.composeModel(e,t,function(e,t){return e?i(e):void C(o,t,r,i)})},L.prototype.resolve=function(e,t,r){var i,s=function(e){return n.isString(t)?r(void 0,u(e).get(a.pathFromPtr(t))):r(void 0,e)};if(n.isUndefined(e))throw new Error("document is required");if(!n.isPlainObject(e))throw new TypeError("document must be an object");if(2===arguments.length&&(r=arguments[1],t=void 0),!n.isUndefined(t)&&!n.isString(t))throw new TypeError("ptr must be a JSON Pointer string");if(n.isUndefined(r))throw new Error("callback is required");if(!n.isFunction(r))throw new TypeError("callback must be a function");if(i=x(e),"1.2"===i.swaggerVersion)throw new Error("Swagger 1.2 is not supported");return i.resolved?s(i.resolved):void this.validate(e,function(e,t){return e?r(e):o.getErrorCount(t)>0?O(t,r):s(i.resolved)})},L.prototype.convert=function(e,t,r,i){var a=function(e,t){i(void 0,c(e,t))};if("1.2"!==this.version)throw new Error("Specification#convert only works for Swagger 1.2");if(n.isUndefined(e))throw new Error("resourceListing is required");if(!n.isPlainObject(e))throw new TypeError("resourceListing must be an object");if(n.isUndefined(t)&&(t=[]),!n.isArray(t))throw new TypeError("apiDeclarations must be an array");if(arguments.length<4&&(i=arguments[arguments.length-1]),n.isUndefined(i))throw new Error("callback is required");if(!n.isFunction(i))throw new TypeError("callback must be a function");r===!0?a(e,t):this.validate(e,t,function(r,n){return r?i(r):o.getErrorCount(n)>0?O(n,i):void a(e,t)})},t.exports.v1=t.exports.v1_2=new L("1.2"),t.exports.v2=t.exports.v2_0=new L("2.0")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../schemas/1.2/apiDeclaration.json":206,"../schemas/1.2/authorizationObject.json":207,"../schemas/1.2/dataType.json":208,"../schemas/1.2/dataTypeBase.json":209,"../schemas/1.2/infoObject.json":210,"../schemas/1.2/modelsObject.json":211,"../schemas/1.2/oauth2GrantType.json":212,"../schemas/1.2/operationObject.json":213,"../schemas/1.2/parameterObject.json":214,"../schemas/1.2/resourceListing.json":215,"../schemas/1.2/resourceObject.json":216,"../schemas/2.0/schema.json":217,"./helpers":1,"./validators":3,async:4,"js-yaml":7,"json-refs":37,"lodash-compat/array/difference":38,"lodash-compat/array/union":41,"lodash-compat/collection/each":43,"lodash-compat/collection/find":44,"lodash-compat/collection/map":46,"lodash-compat/collection/reduce":47,"lodash-compat/lang/cloneDeep":116,"lodash-compat/lang/isArray":118,"lodash-compat/lang/isFunction":122,"lodash-compat/lang/isPlainObject":127,"lodash-compat/lang/isString":128,"lodash-compat/lang/isUndefined":130,"lodash-compat/object/has":131,"lodash-compat/object/set":135,"spark-md5":182,"swagger-converter":184,traverse:185}],3:[function(e,t,r){"use strict";var n={cloneDeep:e("lodash-compat/lang/cloneDeep"),each:e("lodash-compat/collection/each"),isArray:e("lodash-compat/lang/isArray"),isBoolean:e("lodash-compat/lang/isBoolean"),isDate:e("lodash-compat/lang/isDate"),isFinite:e("lodash-compat/lang/isFinite"),isNull:e("lodash-compat/lang/isNull"),isNumber:e("lodash-compat/lang/isNumber"),isPlainObject:e("lodash-compat/lang/isPlainObject"),isString:e("lodash-compat/lang/isString"),isUndefined:e("lodash-compat/lang/isUndefined"),map:e("lodash-compat/collection/map"),union:e("lodash-compat/array/union"),uniq:e("lodash-compat/array/uniq")},i=e("./helpers"),o=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/,a=/^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$/,s=function(e){var t,r,i;return n.isDate(e)?!0:(n.isString(e)||(e=e.toString()),r=o.exec(e),null===r?!1:(t=r[3],i=r[2],"01">i||i>"12"||"01">t||t>"31"?!1:!0))},c=function(e){var t,r,i,o,c,u,f;return n.isDate(e)?!0:(n.isString(e)||(e=e.toString()),u=e.toLowerCase().split("t"),r=u[0],i=u.length>1?u[1]:void 0,s(r)?(o=a.exec(i),null===o?!1:(t=o[1],c=o[2],f=o[3],t>"23"||c>"59"||f>"59"?!1:!0)):!1)},u=function(e,t){var r=new Error(t);throw r.code=e,r.failedValidation=!0,r};t.exports.validateAgainstSchema=function(e,t,r){var o=function(e){var t=["additionalProperties","items"].indexOf(e.path[e.path.length-1])>-1?"schema":e.path[e.path.length-2];if(["ANY_OF_MISSING","ONE_OF_MISSING"].indexOf(e.code)>-1){switch(t){case"parameters":t="parameter";break;case"responses":t="response";break;case"schema":t+=" "+e.path[e.path.length-1]}e.message="Not a valid "+t+" definition"}delete e.params,delete e.schemaId,e.inner&&n.each(e.inner,function(e){o(e)})},a=n.isPlainObject(e)?n.cloneDeep(e):e;n.isUndefined(r)&&(r=i.createJsonValidator([a]));var s=r.validate(t,a);if(!s)try{u("SCHEMA_VALIDATION_FAILED","Failed schema validation")}catch(c){throw c.results={errors:n.map(r.getLastErrors(),function(e){return o(e),e}),warnings:[]},c}};var f=t.exports.validateArrayType=function(e){"array"===e.type&&n.isUndefined(e.items)&&u("OBJECT_MISSING_REQUIRED_PROPERTY","Missing required property: items")};t.exports.validateContentType=function(e,t,r){var i="function"==typeof r.end,o=i?r.getHeader("content-type"):r.headers["content-type"],a=n.map(n.union(e,t),function(e){return e.split(";")[0]});if(o||(o=i?"text/plain":"application/octet-stream"),o=o.split(";")[0],a.length>0&&(i?!0:-1!==["POST","PUT"].indexOf(r.method))&&-1===a.indexOf(o))throw new Error("Invalid content type ("+o+"). These are valid: "+a.join(", "))};var p=t.exports.validateEnum=function(e,t){n.isUndefined(t)||n.isUndefined(e)||-1!==t.indexOf(e)||u("ENUM_MISMATCH","Not an allowable value ("+t.join(", ")+"): "+e)},l=t.exports.validateMaximum=function(e,t,r,i){var o,a,s=i===!0?"MAXIMUM_EXCLUSIVE":"MAXIMUM";n.isUndefined(i)&&(i=!1),"integer"===r?a=parseInt(e,10):"number"===r&&(a=parseFloat(e)),n.isUndefined(t)||(o=parseFloat(t),i&&a>=o?u(s,"Greater than or equal to the configured maximum ("+t+"): "+e):a>o&&u(s,"Greater than the configured maximum ("+t+"): "+e))},h=t.exports.validateMaxItems=function(e,t){!n.isUndefined(t)&&e.length>t&&u("ARRAY_LENGTH_LONG","Array is too long ("+e.length+"), maximum "+t)},d=t.exports.validateMaxLength=function(e,t){!n.isUndefined(t)&&e.length>t&&u("MAX_LENGTH","String is too long ("+e.length+" chars), maximum "+t)},m=t.exports.validateMaxProperties=function(e,t){var r=n.isPlainObject(e)?Object.keys(e).length:0;!n.isUndefined(t)&&r>t&&u("MAX_PROPERTIES","Number of properties is too many ("+r+" properties), maximum "+t)},y=t.exports.validateMinimum=function(e,t,r,i){var o,a,s=i===!0?"MINIMUM_EXCLUSIVE":"MINIMUM";n.isUndefined(i)&&(i=!1),"integer"===r?a=parseInt(e,10):"number"===r&&(a=parseFloat(e)),n.isUndefined(t)||(o=parseFloat(t),i&&o>=a?u(s,"Less than or equal to the configured minimum ("+t+"): "+e):o>a&&u(s,"Less than the configured minimum ("+t+"): "+e))},g=t.exports.validateMinItems=function(e,t){!n.isUndefined(t)&&e.lengthr&&u("MIN_PROPERTIES","Number of properties is too few ("+r+" properties), minimum "+t)},E=t.exports.validateMultipleOf=function(e,t){n.isUndefined(t)||e%t===0||u("MULTIPLE_OF","Not a multiple of "+t)},x=t.exports.validatePattern=function(e,t){!n.isUndefined(t)&&n.isNull(e.match(new RegExp(t)))&&u("PATTERN","Does not match required pattern: "+t)};t.exports.validateRequiredness=function(e,t){!n.isUndefined(t)&&t===!0&&n.isUndefined(e)&&u("REQUIRED","Is required")};var O=t.exports.validateTypeAndFormat=function A(e,t,r,i,o,a){var f=!0,p=t;if(o!==!0||""!==t){if(n.isArray(t))n.each(t,function(t,n){A(e,t,r,i,o,!0)||u("INVALID_TYPE","Value at index "+n+" is not a valid "+r+": "+t)});else switch(r){case"boolean":"1.2"===e&&n.isString(t)&&("false"===t?t=!1:"true"===t&&(t=!0)),f=n.isBoolean(t);break;case"integer":"1.2"===e&&n.isString(t)&&(t=Number(t)),f=n.isFinite(t)&&Math.round(t)===t;break;case"number":"1.2"===e&&n.isString(t)&&(t=Number(t)),f=n.isFinite(t);break;case"string":if(!n.isUndefined(i))switch(i){case"date":f=s(t);break;case"date-time":f=c(t)}break;case"void":f=n.isUndefined(t)}return a?f:void(f||u("INVALID_TYPE","void"!==r?"Not a valid "+(n.isUndefined(i)?"":i+" ")+r+": "+p:"Void does not allow a value"))}},j=t.exports.validateUniqueItems=function(e,t){n.isUndefined(t)||n.uniq(e).length===e.length||u("ARRAY_UNIQUE","Does not allow duplicate values: "+e.join(", "))},w=t.exports.validateSchemaConstraints=function(e,t,r,i){var o,a=function(e){var t=e;return t.schema&&(r=r.concat(["schema"]),t=a(t.schema)),t},s=t.type;s||(t.schema?(t=a(t),s=t.type||"object"):s="responses"===r[r.length-2]?"void":"object"),o=t?t.allowEmptyValue===!0:!1;try{if("array"===s&&f(t),n.isUndefined(i)&&(i="1.2"===e?t.defaultValue:t["default"],r=r.concat(["1.2"===e?"defaultValue":"default"])),n.isUndefined(i))return;"array"===s?n.each(i,function(n,i){try{w(e,t.items||{},r.concat(i.toString()),n)}catch(o){throw o.message="Value at index "+i+" "+("INVALID_TYPE"===o.code?"is ":"")+o.message.charAt(0).toLowerCase()+o.message.substring(1),o}}):O(e,i,s,t.format,o),p(i,t["enum"]),l(i,t.maximum,s,t.exclusiveMaximum),h(i,t.maxItems),d(i,t.maxLength),m(i,t.maxProperties),y(i,t.minimum,s,t.exclusiveMinimum),g(i,t.minItems),v(i,t.minLength),b(i,t.minProperties),E(i,t.multipleOf),x(i,t.pattern),j(i,t.uniqueItems)}catch(c){throw c.path=r,c}}},{"./helpers":1,"lodash-compat/array/union":41,"lodash-compat/array/uniq":42,"lodash-compat/collection/each":43,"lodash-compat/collection/map":46,"lodash-compat/lang/cloneDeep":116,"lodash-compat/lang/isArray":118,"lodash-compat/lang/isBoolean":119,"lodash-compat/lang/isDate":120,"lodash-compat/lang/isFinite":121,"lodash-compat/lang/isNull":124,"lodash-compat/lang/isNumber":125,"lodash-compat/lang/isPlainObject":127, +"lodash-compat/lang/isString":128,"lodash-compat/lang/isUndefined":130}],4:[function(t,r,n){(function(t,n){!function(){function i(){}function o(e){return e}function a(e){return!!e}function s(e){return!e}function c(e){return function(){if(null===e)throw new Error("Callback was already called.");e.apply(this,arguments),e=null}}function u(e){return function(){null!==e&&(e.apply(this,arguments),e=null)}}function f(e){return M(e)||"number"==typeof e.length&&e.length>=0&&e.length%1===0}function p(e,t){for(var r=-1,n=e.length;++rn?n:null}):(r=Y(e),t=r.length,function(){return n++,t>n?r[n]:null})}function v(e,t){return t=null==t?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),i=0;r>i;i++)n[i]=arguments[i+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n)}}}function b(e){return function(t,r,n){return e(t,n)}}function E(e){return function(t,r,n){n=u(n||i),t=t||[];var o=g(t);if(0>=e)return n(null);var a=!1,s=0,f=!1;!function p(){if(a&&0>=s)return n(null);for(;e>s&&!f;){var i=o();if(null===i)return a=!0,void(0>=s&&n(null));s+=1,r(t[i],i,c(function(e){s-=1,e?(n(e),f=!0):p()}))}}()}}function x(e){return function(t,r,n){return e(U.eachOf,t,r,n)}}function O(e){return function(t,r,n,i){return e(E(r),t,n,i)}}function j(e){return function(t,r,n){return e(U.eachOfSeries,t,r,n)}}function w(e,t,r,n){n=u(n||i),t=t||[];var o=f(t)?[]:{};e(t,function(e,t,n){r(e,function(e,r){o[t]=r,n(e)})},function(e){n(e,o)})}function A(e,t,r,n){var i=[];e(t,function(e,t,n){r(e,function(r){r&&i.push({index:t,value:e}),n()})},function(){n(l(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})}function _(e,t,r,n){A(e,t,function(e,t){r(e,function(e){t(!e)})},n)}function I(e,t,r){return function(n,i,o,a){function s(){a&&a(r(!1,void 0))}function c(e,n,i){return a?void o(e,function(n){a&&t(n)&&(a(r(!0,e)),a=o=!1),i()}):i()}arguments.length>3?e(n,i,c,s):(a=o,o=i,e(n,c,s))}}function P(e,t){return t}function S(e,t,r){r=r||i;var n=f(t)?[]:{};e(t,function(e,t,r){e(v(function(e,i){i.length<=1&&(i=i[0]),n[t]=i,r(e)}))},function(e){r(e,n)})}function T(e,t,r,n){var i=[];e(t,function(e,t,n){r(e,function(e,t){i=i.concat(t||[]),n(e)})},function(e){n(e,i)})}function C(e,t,r){function n(e,t,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");return e.started=!0,M(t)||(t=[t]),0===t.length&&e.idle()?U.setImmediate(function(){e.drain()}):(p(t,function(t){var o={data:t,callback:n||i};r?e.tasks.unshift(o):e.tasks.push(o),e.tasks.length===e.concurrency&&e.saturated()}),void U.setImmediate(e.process))}function o(e,t){return function(){a-=1;var r=!1,n=arguments;p(t,function(e){p(s,function(t,n){t!==e||r||(s.splice(n,1),r=!0)}),e.callback.apply(e,n)}),e.tasks.length+a===0&&e.drain(),e.process()}}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var a=0,s=[],u={tasks:[],concurrency:t,payload:r,saturated:i,empty:i,drain:i,started:!1,paused:!1,push:function(e,t){n(u,e,!1,t)},kill:function(){u.drain=i,u.tasks=[]},unshift:function(e,t){n(u,e,!0,t)},process:function(){for(;!u.paused&&a=t;t++)U.setImmediate(u.process)}}};return u}function $(e){return v(function(t,r){t.apply(null,r.concat([v(function(t,r){"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&p(r,function(t){console[e](t)}))})]))})}function D(e){return function(t,r,n){e(h(t),r,n)}}function R(e){return v(function(t,r){var n=v(function(r){var n=this,i=r.pop();return e(t,function(e,t,i){e.apply(n,r.concat([i]))},i)});return r.length?n.apply(this,r):n})}function k(e){return v(function(t){var r=t.pop();t.push(function(){var e=arguments;n?U.setImmediate(function(){r.apply(null,e)}):r.apply(null,e)});var n=!0;e.apply(this,t),n=!1})}var F,U={},L="object"==typeof self&&self.self===self&&self||"object"==typeof n&&n.global===n&&n||this;null!=L&&(F=L.async),U.noConflict=function(){return L.async=F,U};var N=Object.prototype.toString,M=Array.isArray||function(e){return"[object Array]"===N.call(e)},q=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},Y=Object.keys||function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t},B="function"==typeof setImmediate&&setImmediate,H=B?function(e){B(e)}:function(e){setTimeout(e,0)};"object"==typeof t&&"function"==typeof t.nextTick?U.nextTick=t.nextTick:U.nextTick=H,U.setImmediate=B?H:U.nextTick,U.forEach=U.each=function(e,t,r){return U.eachOf(e,b(t),r)},U.forEachSeries=U.eachSeries=function(e,t,r){return U.eachOfSeries(e,b(t),r)},U.forEachLimit=U.eachLimit=function(e,t,r,n){return E(t)(e,b(r),n)},U.forEachOf=U.eachOf=function(e,t,r){function n(e){s--,e?r(e):null===o&&0>=s&&r(null)}r=u(r||i),e=e||[];for(var o,a=g(e),s=0;null!=(o=a());)s+=1,t(e[o],o,c(n));0===s&&r(null)},U.forEachOfSeries=U.eachOfSeries=function(e,t,r){function n(){var i=!0;return null===a?r(null):(t(e[a],a,c(function(e){if(e)r(e);else{if(a=o(),null===a)return r(null);i?U.setImmediate(n):n()}})),void(i=!1))}r=u(r||i),e=e||[];var o=g(e),a=o();n()},U.forEachOfLimit=U.eachOfLimit=function(e,t,r,n){E(t)(e,r,n)},U.map=x(w),U.mapSeries=j(w),U.mapLimit=O(w),U.inject=U.foldl=U.reduce=function(e,t,r,n){U.eachOfSeries(e,function(e,n,i){r(t,e,function(e,r){t=r,i(e)})},function(e){n(e,t)})},U.foldr=U.reduceRight=function(e,t,r,n){var i=l(e,o).reverse();U.reduce(i,t,r,n)},U.transform=function(e,t,r,n){3===arguments.length&&(n=r,r=t,t=M(e)?[]:{}),U.eachOf(e,function(e,n,i){r(t,e,n,i)},function(e){n(e,t)})},U.select=U.filter=x(A),U.selectLimit=U.filterLimit=O(A),U.selectSeries=U.filterSeries=j(A),U.reject=x(_),U.rejectLimit=O(_),U.rejectSeries=j(_),U.any=U.some=I(U.eachOf,a,o),U.someLimit=I(U.eachOfLimit,a,o),U.all=U.every=I(U.eachOf,s,s),U.everyLimit=I(U.eachOfLimit,s,s),U.detect=I(U.eachOf,o,P),U.detectSeries=I(U.eachOfSeries,o,P),U.detectLimit=I(U.eachOfLimit,o,P),U.sortBy=function(e,t,r){function n(e,t){var r=e.criteria,n=t.criteria;return n>r?-1:r>n?1:0}U.map(e,function(e,r){t(e,function(t,n){t?r(t):r(null,{value:e,criteria:n})})},function(e,t){return e?r(e):void r(null,l(t.sort(n),function(e){return e.value}))})},U.auto=function(e,t,r){function n(e){g.unshift(e)}function o(e){var t=y(g,e);t>=0&&g.splice(t,1)}function a(){c--,p(g.slice(0),function(e){e()})}"function"==typeof arguments[1]&&(r=t,t=null),r=u(r||i);var s=Y(e),c=s.length;if(!c)return r(null);t||(t=c);var f={},l=0,h=!1,g=[];n(function(){c||r(null,f)}),p(s,function(i){function s(){return t>l&&d(b,function(e,t){return e&&f.hasOwnProperty(t)},!0)&&!f.hasOwnProperty(i)}function c(){s()&&(l++,o(c),p[p.length-1](g,f))}if(!h){for(var u,p=M(e[i])?e[i]:[e[i]],g=v(function(e,t){if(l--,t.length<=1&&(t=t[0]),e){var n={};m(f,function(e,t){n[t]=e}),n[i]=t,h=!0,r(e,n)}else f[i]=t,U.setImmediate(a)}),b=p.slice(0,p.length-1),E=b.length;E--;){if(!(u=e[b[E]]))throw new Error("Has nonexistent dependency in "+b.join(", "));if(M(u)&&y(u,i)>=0)throw new Error("Has cyclic dependencies")}s()?(l++,p[p.length-1](g,f)):n(c)}})},U.retry=function(e,t,r){function n(e,t){if("number"==typeof t)e.times=parseInt(t,10)||o;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);e.times=parseInt(t.times,10)||o,e.interval=parseInt(t.interval,10)||a}}function i(e,t){function r(e,r){return function(n){e(function(e,t){n(!e||r,{err:e,result:t})},t)}}function n(e){return function(t){setTimeout(function(){t(null)},e)}}for(;c.times;){var i=!(c.times-=1);s.push(r(c.task,i)),!i&&c.interval>0&&s.push(n(c.interval))}U.series(s,function(t,r){r=r[r.length-1],(e||c.callback)(r.err,r.result)})}var o=5,a=0,s=[],c={times:o,interval:a},u=arguments.length;if(1>u||u>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=u&&"function"==typeof e&&(r=t,t=e),"function"!=typeof e&&n(c,e),c.callback=r,c.task=t,c.callback?i():i},U.waterfall=function(e,t){function r(e){return v(function(n,i){if(n)t.apply(null,[n].concat(i));else{var o=e.next();o?i.push(r(o)):i.push(t),k(e).apply(null,i)}})}if(t=u(t||i),!M(e)){var n=new Error("First argument to waterfall must be an array of functions");return t(n)}return e.length?void r(U.iterator(e))():t()},U.parallel=function(e,t){S(U.eachOf,e,t)},U.parallelLimit=function(e,t,r){S(E(t),e,r)},U.series=function(e,t){S(U.eachOfSeries,e,t)},U.iterator=function(e){function t(r){function n(){return e.length&&e[r].apply(null,arguments),n.next()}return n.next=function(){return rn;){var o=n+(i-n+1>>>1);r(t,e[o])>=0?n=o:i=o-1}return n}function o(e,t,o,a){if(null!=a&&"function"!=typeof a)throw new Error("task callback must be a function");return e.started=!0,M(t)||(t=[t]),0===t.length?U.setImmediate(function(){e.drain()}):void p(t,function(t){var s={data:t,priority:o,callback:"function"==typeof a?a:i};e.tasks.splice(n(e.tasks,s,r)+1,0,s),e.tasks.length===e.concurrency&&e.saturated(),U.setImmediate(e.process)})}var a=U.queue(e,t);return a.push=function(e,t,r){o(a,e,t,r)},delete a.unshift,a},U.cargo=function(e,t){return C(e,1,t)},U.log=$("log"),U.dir=$("dir"),U.memoize=function(e,t){var r={},n={},i=Object.prototype.hasOwnProperty;t=t||o;var a=v(function(o){var a=o.pop(),s=t.apply(null,o);i.call(r,s)?U.setImmediate(function(){a.apply(null,r[s])}):i.call(n,s)?n[s].push(a):(n[s]=[a],e.apply(null,o.concat([v(function(e){r[s]=e;var t=n[s];delete n[s];for(var i=0,o=t.length;o>i;i++)t[i].apply(null,e)})])))});return a.memo=r,a.unmemoized=e,a},U.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}},U.times=D(U.map),U.timesSeries=D(U.mapSeries),U.timesLimit=function(e,t,r,n){return U.mapLimit(h(e),t,r,n)},U.seq=function(){var e=arguments;return v(function(t){var r=this,n=t[t.length-1];"function"==typeof n?t.pop():n=i,U.reduce(e,t,function(e,t,n){t.apply(r,e.concat([v(function(e,t){n(e,t)})]))},function(e,t){n.apply(r,[e].concat(t))})})},U.compose=function(){return U.seq.apply(null,Array.prototype.reverse.call(arguments))},U.applyEach=R(U.eachOf),U.applyEachSeries=R(U.eachOfSeries),U.forever=function(e,t){function r(e){return e?n(e):void o(r)}var n=c(t||i),o=k(e);r()},U.ensureAsync=k,U.constant=v(function(e){var t=[null].concat(e);return function(e){return e.apply(this,t)}}),U.wrapSync=U.asyncify=function(e){return v(function(t){var r,n=t.pop();try{r=e.apply(this,t)}catch(i){return n(i)}q(r)&&"function"==typeof r.then?r.then(function(e){n(null,e)})["catch"](function(e){n(e.message?e:new Error(e))}):n(null,r)})},"object"==typeof r&&r.exports?r.exports=U:"function"==typeof e&&e.amd?e([],function(){return U}):L.async=U}()}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:175}],5:[function(e,t,r){},{}],6:[function(e,t,r){function n(e){return e?i(e):void 0}function i(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n,i=0;in;++n)r[n].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],7:[function(e,t,r){"use strict";var n=e("./lib/js-yaml.js");t.exports=n},{"./lib/js-yaml.js":8}],8:[function(e,t,r){"use strict";function n(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}var i=e("./js-yaml/loader"),o=e("./js-yaml/dumper");t.exports.Type=e("./js-yaml/type"),t.exports.Schema=e("./js-yaml/schema"),t.exports.FAILSAFE_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.JSON_SCHEMA=e("./js-yaml/schema/json"),t.exports.CORE_SCHEMA=e("./js-yaml/schema/core"),t.exports.DEFAULT_SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_FULL_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=o.dump,t.exports.safeDump=o.safeDump,t.exports.YAMLException=e("./js-yaml/exception"),t.exports.MINIMAL_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.scan=n("scan"),t.exports.parse=n("parse"),t.exports.compose=n("compose"),t.exports.addConstructor=n("addConstructor")},{"./js-yaml/dumper":10,"./js-yaml/exception":11,"./js-yaml/loader":12,"./js-yaml/schema":14,"./js-yaml/schema/core":15,"./js-yaml/schema/default_full":16,"./js-yaml/schema/default_safe":17,"./js-yaml/schema/failsafe":18,"./js-yaml/schema/json":19,"./js-yaml/type":20}],9:[function(e,t,r){"use strict";function n(e){return"undefined"==typeof e||null===e}function i(e){return"object"==typeof e&&null!==e}function o(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){var r,n,i,o;if(t)for(o=Object.keys(t),r=0,n=o.length;n>r;r+=1)i=o[r],e[i]=t[i];return e}function s(e,t){var r,n="";for(r=0;t>r;r+=1)n+=e;return n}function c(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=n,t.exports.isObject=i,t.exports.toArray=o,t.exports.repeat=s,t.exports.isNegativeZero=c,t.exports.extend=a},{}],10:[function(e,t,r){"use strict";function n(e,t){var r,n,i,o,a,s,c;if(null===t)return{};for(r={},n=Object.keys(t),i=0,o=n.length;o>i;i+=1)a=n[i],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap[a],c&&T.call(c.styleAliases,s)&&(s=c.styleAliases[s]),r[a]=s;return r}function i(e){var t,r,n;if(t=e.toString(16).toUpperCase(),255>=e)r="x",n=2;else if(65535>=e)r="u",n=4;else{if(!(4294967295>=e))throw new _("code point within a string may not be greater than 0xFFFFFFFF");r="U",n=8}return"\\"+r+A.repeat("0",n-t.length)+t}function o(e){this.schema=e.schema||I,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=A.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=n(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function a(e,t){for(var r,n=A.repeat(" ",t),i=0,o=-1,a="",s=e.length;s>i;)o=e.indexOf("\n",i),-1===o?(r=e.slice(i),i=s):(r=e.slice(i,o+1),i=o+1),r.length&&"\n"!==r&&(a+=n),a+=r;return a}function s(e,t){return"\n"+A.repeat(" ",e.indent*t)}function c(e,t){var r,n,i;for(r=0,n=e.implicitTypes.length;n>r;r+=1)if(i=e.implicitTypes[r],i.resolve(t))return!0;return!1}function u(e){this.source=e,this.result="",this.checkpoint=0}function f(e,t,r,n){var i,o,s,f,l,m,y,g,v,b,E,x,O,j,w,A,_,I,P,S,T;if(0===t.length)return void(e.dump="''");if(-1!==te.indexOf(t))return void(e.dump="'"+t+"'");for(i=!0,o=t.length?t.charCodeAt(0):0,s=R===o||R===t.charCodeAt(t.length-1),(B===o||K===o||W===o||G===o)&&(i=!1),s||e.flowLevel>-1&&e.flowLevel<=r?(s&&(i=!1),f=!1,l=!1):(f=!n,l=!n),m=!0,y=new u(t),g=!1,v=0,b=0,E=e.indent*r,x=e.lineWidth,-1===x&&(x=9007199254740991),40>E?x-=E:x=40,j=0;j0&&(_=t.charCodeAt(j-1),_===R&&(l=!1,f=!1)),f&&(I=j-v,v=j,I>b&&(b=I))),O!==F&&(m=!1),y.takeUpTo(j),y.escapeChar())}if(i&&c(e,t)&&(i=!1),P="",(f||l)&&(S=0,t.charCodeAt(t.length-1)===$&&(S+=1,t.charCodeAt(t.length-2)===$&&(S+=1)),0===S?P="-":2===S&&(P="+")),(l&&x>b||null!==e.tag)&&(f=!1),g||(l=!1),i)e.dump=t;else if(m)e.dump="'"+t+"'";else if(f)T=p(t,x),e.dump=">"+P+"\n"+a(T,E);else if(l)P||(t=t.replace(/\n$/,"")),e.dump="|"+P+"\n"+a(t,E);else{if(!y)throw new Error("Failed to dump scalar value");y.finish(),e.dump='"'+y.result+'"'}}function p(e,t){var r,n="",i=0,o=e.length,a=/\n+$/.exec(e);for(a&&(o=a.index+1);o>i;)r=e.indexOf("\n",i),r>o||-1===r?(n&&(n+="\n\n"),n+=l(e.slice(i,o),t),i=o):(n&&(n+="\n\n"),n+=l(e.slice(i,r),t),i=r+1);return a&&"\n"!==a[0]&&(n+=a[0]),n}function l(e,t){if(""===e)return e;for(var r,n,i,o=/[^\s] [^\s]/g,a="",s=0,c=0,u=o.exec(e);u;)r=u.index,r-c>t&&(n=s!==c?s:r,a&&(a+="\n"),i=e.slice(c,n),a+=i,c=n+1),s=r+1,u=o.exec(e);return a&&(a+="\n"),a+=c!==s&&e.length-c>t?e.slice(c,s)+"\n"+e.slice(s+1):e.slice(c)}function h(e){return C!==e&&$!==e&&D!==e&&Y!==e&&z!==e&&X!==e&&J!==e&&Q!==e&&U!==e&&N!==e&&q!==e&&k!==e&&Z!==e&&V!==e&&M!==e&&F!==e&&L!==e&&H!==e&&!ee[e]&&!d(e)}function d(e){return!(e>=32&&126>=e||133===e||e>=160&&55295>=e||e>=57344&&65533>=e||e>=65536&&1114111>=e)}function m(e,t,r){var n,i,o="",a=e.tag;for(n=0,i=r.length;i>n;n+=1)E(e,t,r[n],!1,!1)&&(0!==n&&(o+=", "),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function y(e,t,r,n){var i,o,a="",c=e.tag;for(i=0,o=r.length;o>i;i+=1)E(e,t+1,r[i],!0,!0)&&(n&&0===i||(a+=s(e,t)),a+="- "+e.dump);e.tag=c,e.dump=a||"[]"}function g(e,t,r){var n,i,o,a,s,c="",u=e.tag,f=Object.keys(r);for(n=0,i=f.length;i>n;n+=1)s="",0!==n&&(s+=", "),o=f[n],a=r[o],E(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",E(e,t,a,!1,!1)&&(s+=e.dump,c+=s));e.tag=u,e.dump="{"+c+"}"}function v(e,t,r,n){var i,o,a,c,u,f,p="",l=e.tag,h=Object.keys(r);if(e.sortKeys===!0)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new _("sortKeys must be a boolean or a function");for(i=0,o=h.length;o>i;i+=1)f="",n&&0===i||(f+=s(e,t)),a=h[i],c=r[a],E(e,t+1,a,!0,!0,!0)&&(u=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,u&&(f+=e.dump&&$===e.dump.charCodeAt(0)?"?":"? "),f+=e.dump,u&&(f+=s(e,t)),E(e,t+1,c,!0,u)&&(f+=e.dump&&$===e.dump.charCodeAt(0)?":":": ",f+=e.dump,p+=f));e.tag=l,e.dump=p||"{}"}function b(e,t,r){var n,i,o,a,s,c;for(i=r?e.explicitTypes:e.implicitTypes,o=0,a=i.length;a>o;o+=1)if(s=i[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=r?s.tag:"?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===S.call(s.represent))n=s.represent(t,c);else{if(!T.call(s.represent,c))throw new _("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');n=s.represent[c](t,c)}e.dump=n}return!0}return!1}function E(e,t,r,n,i,o){e.tag=null,e.dump=r,b(e,r,!1)||b(e,r,!0);var a=S.call(e.dump);n&&(n=0>e.flowLevel||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(s=e.duplicates.indexOf(r),c=-1!==s),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&t>0)&&(i=!1),c&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(u&&c&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),"[object Object]"===a)n&&0!==Object.keys(e.dump).length?(v(e,t,e.dump,i),c&&(e.dump="&ref_"+s+e.dump)):(g(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else if("[object Array]"===a)n&&0!==e.dump.length?(y(e,t,e.dump,i),c&&(e.dump="&ref_"+s+e.dump)):(m(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else{if("[object String]"!==a){if(e.skipInvalid)return!1;throw new _("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&f(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function x(e,t){var r,n,i=[],o=[];for(O(e,i,o),r=0,n=o.length;n>r;r+=1)t.duplicates.push(i[o[r]]);t.usedDuplicates=new Array(n)}function O(e,t,r){var n,i,o;if(null!==e&&"object"==typeof e)if(i=t.indexOf(e),-1!==i)-1===r.indexOf(i)&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;o>i;i+=1)O(e[i],t,r);else for(n=Object.keys(e),i=0,o=n.length;o>i;i+=1)O(e[n[i]],t,r)}function j(e,t){t=t||{};var r=new o(t);return r.noRefs||x(e,r),E(r,0,e,!0,!0)?r.dump+"\n":""}function w(e,t){return j(e,A.extend({schema:P},t))}var A=e("./common"),_=e("./exception"),I=e("./schema/default_full"),P=e("./schema/default_safe"),S=Object.prototype.toString,T=Object.prototype.hasOwnProperty,C=9,$=10,D=13,R=32,k=33,F=34,U=35,L=37,N=38,M=39,q=42,Y=44,B=45,H=58,V=62,K=63,W=64,z=91,X=93,G=96,J=123,Z=124,Q=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";var te=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];u.prototype.takeUpTo=function(e){var t;if(e checkpoint"),t.position=e,t.checkpoint=this.checkpoint,t;return this.result+=this.source.slice(this.checkpoint,e),this.checkpoint=e,this},u.prototype.escapeChar=function(){var e,t;return e=this.source.charCodeAt(this.checkpoint),t=ee[e]||i(e),this.result+=t,this.checkpoint+=1,this},u.prototype.finish=function(){this.source.length>this.checkpoint&&this.takeUpTo(this.source.length)},t.exports.dump=j,t.exports.safeDump=w},{"./common":9,"./exception":11,"./schema/default_full":16,"./schema/default_safe":17}],11:[function(e,t,r){"use strict";function n(e,t){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():"")}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=n},{}],12:[function(e,t,r){"use strict";function n(e){return 10===e||13===e}function i(e){return 9===e||32===e}function o(e){return 9===e||32===e||10===e||13===e}function a(e){return 44===e||91===e||93===e||123===e||125===e}function s(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function c(e){return 120===e?2:117===e?4:85===e?8:0}function u(e){return e>=48&&57>=e?e-48:-1}function f(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?"\x0B":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e){return 65535>=e?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function l(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||H,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function h(e,t){return new q(t,new Y(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function d(e,t){throw h(e,t)}function m(e,t){e.onWarning&&e.onWarning.call(null,h(e,t))}function y(e,t,r,n){var i,o,a,s;if(r>t){if(s=e.input.slice(t,r),n)for(i=0,o=s.length;o>i;i+=1)a=s.charCodeAt(i),9===a||a>=32&&1114111>=a||d(e,"expected valid JSON character");else Q.test(s)&&d(e,"the stream contains non-printable characters");e.result+=s}}function g(e,t,r,n){var i,o,a,s;for(M.isObject(r)||d(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),a=0,s=i.length;s>a;a+=1)o=i[a],V.call(t,o)||(t[o]=r[o],n[o]=!0)}function v(e,t,r,n,i,o){var a,s;if(i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(o))for(a=0,s=o.length;s>a;a+=1)g(e,t,o[a],r);else g(e,t,o,r);else e.json||V.call(r,i)||!V.call(t,i)||d(e,"duplicated mapping key"),t[i]=o,delete r[i];return t}function b(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):d(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function E(e,t,r){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;i(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do a=e.input.charCodeAt(++e.position);while(10!==a&&13!==a&&0!==a);if(!n(a))break;for(b(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position)}return-1!==r&&0!==o&&e.lineIndent1&&(e.result+=M.repeat("\n",t-1))}function j(e,t,r){var s,c,u,f,p,l,h,d,m,g=e.kind,v=e.result;if(m=e.input.charCodeAt(e.position),o(m)||a(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(c=e.input.charCodeAt(e.position+1),o(c)||r&&a(c)))return!1;for(e.kind="scalar",e.result="",u=f=e.position,p=!1;0!==m;){if(58===m){if(c=e.input.charCodeAt(e.position+1),o(c)||r&&a(c))break}else if(35===m){if(s=e.input.charCodeAt(e.position-1),o(s))break}else{if(e.position===e.lineStart&&x(e)||r&&a(m))break;if(n(m)){if(l=e.line,h=e.lineStart,d=e.lineIndent,E(e,!1,-1),e.lineIndent>=t){p=!0,m=e.input.charCodeAt(e.position);continue}e.position=f,e.line=l,e.lineStart=h,e.lineIndent=d;break}}p&&(y(e,u,f,!1),O(e,e.line-l),u=f=e.position,p=!1),i(m)||(f=e.position+1),m=e.input.charCodeAt(++e.position)}return y(e,u,f,!1),e.result?!0:(e.kind=g,e.result=v,!1)}function w(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),39!==r)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;0!==(r=e.input.charCodeAt(e.position));)if(39===r){if(y(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),39!==r)return!0;i=o=e.position,e.position++}else n(r)?(y(e,i,o,!0),O(e,E(e,!1,t)),i=o=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);d(e,"unexpected end of the stream within a single quoted scalar")}function A(e,t){var r,i,o,a,u,f;if(f=e.input.charCodeAt(e.position),34!==f)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(f=e.input.charCodeAt(e.position));){if(34===f)return y(e,r,e.position,!0),e.position++,!0;if(92===f){if(y(e,r,e.position,!0),f=e.input.charCodeAt(++e.position),n(f))E(e,!1,t);else if(256>f&&ie[f])e.result+=oe[f],e.position++;else if((u=c(f))>0){for(o=u,a=0;o>0;o--)f=e.input.charCodeAt(++e.position),(u=s(f))>=0?a=(a<<4)+u:d(e,"expected hexadecimal character");e.result+=p(a),e.position++}else d(e,"unknown escape sequence");r=i=e.position}else n(f)?(y(e,r,i,!0),O(e,E(e,!1,t)),r=i=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}d(e,"unexpected end of the stream within a double quoted scalar")}function _(e,t){var r,n,i,a,s,c,u,f,p,l,h,m=!0,y=e.tag,g=e.anchor,b={};if(h=e.input.charCodeAt(e.position),91===h)a=93,u=!1,n=[];else{if(123!==h)return!1;a=125,u=!0,n={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=n),h=e.input.charCodeAt(++e.position);0!==h;){if(E(e,!0,t),h=e.input.charCodeAt(e.position),h===a)return e.position++,e.tag=y,e.anchor=g,e.kind=u?"mapping":"sequence",e.result=n,!0;m||d(e,"missed comma between flow collection entries"),p=f=l=null,s=c=!1,63===h&&(i=e.input.charCodeAt(e.position+1),o(i)&&(s=c=!0,e.position++,E(e,!0,t))),r=e.line,D(e,t,K,!1,!0),p=e.tag,f=e.result,E(e,!0,t),h=e.input.charCodeAt(e.position),!c&&e.line!==r||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),E(e,!0,t),D(e,t,K,!1,!0),l=e.result),u?v(e,n,b,p,f,l):s?n.push(v(e,null,b,p,f,l)):n.push(f),E(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}d(e,"unexpected end of the stream within a flow collection")}function I(e,t){var r,o,a,s,c=G,f=!1,p=t,l=0,h=!1;if(s=e.input.charCodeAt(e.position),124===s)o=!1;else{if(62!==s)return!1;o=!0}for(e.kind="scalar",e.result="";0!==s;)if(s=e.input.charCodeAt(++e.position),43===s||45===s)G===c?c=43===s?Z:J:d(e,"repeat of a chomping mode identifier");else{if(!((a=u(s))>=0))break;0===a?d(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):f?d(e,"repeat of an indentation width identifier"):(p=t+a-1,f=!0)}if(i(s)){do s=e.input.charCodeAt(++e.position);while(i(s));if(35===s)do s=e.input.charCodeAt(++e.position);while(!n(s)&&0!==s)}for(;0!==s;){for(b(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!f||e.lineIndentp&&(p=e.lineIndent),n(s))l++;else{if(e.lineIndentt)&&0!==i)d(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(D(e,t,X,!0,a)&&(g?m=e.result:y=e.result),g||(v(e,p,l,h,m,y),h=m=y=null),E(e,!0,-1),c=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==c)d(e,"bad indentation of a mapping entry");else if(e.lineIndentt?h=1:e.lineIndent===t?h=0:e.lineIndentt?h=1:e.lineIndent===t?h=0:e.lineIndentc;c+=1)if(f=e.implicitTypes[c],f.resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else V.call(e.typeMap,e.tag)?(f=e.typeMap[e.tag],null!==e.result&&f.kind!==e.kind&&d(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result)?(e.result=f.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):d(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):d(e,"unknown tag !<"+e.tag+">");return null!==e.tag||null!==e.anchor||y}function R(e){var t,r,a,s,c=e.position,u=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(E(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(u=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!o(s);)s=e.input.charCodeAt(++e.position);for(r=e.input.slice(t,e.position),a=[],r.length<1&&d(e,"directive name must not be less than one character in length");0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(35===s){do s=e.input.charCodeAt(++e.position);while(0!==s&&!n(s));break}if(n(s))break;for(t=e.position;0!==s&&!o(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(t,e.position))}0!==s&&b(e),V.call(se,r)?se[r](e,r,a):m(e,'unknown document directive "'+r+'"')}return E(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,E(e,!0,-1)):u&&d(e,"directives end mark is expected"),D(e,e.lineIndent-1,X,!1,!0),E(e,!0,-1),e.checkLineBreaks&&ee.test(e.input.slice(c,e.position))&&m(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&x(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,E(e,!0,-1))):void(e.positionn;n+=1)t(o[n])}function U(e,t){var r=k(e,t);if(0!==r.length){if(1===r.length)return r[0];throw new q("expected a single document in the stream, but found more")}}function L(e,t,r){F(e,t,M.extend({schema:B},r))}function N(e,t){return U(e,M.extend({schema:B},t))}for(var M=e("./common"),q=e("./exception"),Y=e("./mark"),B=e("./schema/default_safe"),H=e("./schema/default_full"),V=Object.prototype.hasOwnProperty,K=1,W=2,z=3,X=4,G=1,J=2,Z=3,Q=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ee=/[\x85\u2028\u2029]/,te=/[,\[\]\{\}]/,re=/^(?:!|!!|![a-z\-]+!)$/i,ne=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,ie=new Array(256),oe=new Array(256),ae=0;256>ae;ae++)ie[ae]=f(ae)?1:0,oe[ae]=f(ae);var se={YAML:function(e,t,r){var n,i,o;null!==e.version&&d(e,"duplication of %YAML directive"),1!==r.length&&d(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),null===n&&d(e,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),o=parseInt(n[2],10),1!==i&&d(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=2>o,1!==o&&2!==o&&m(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var n,i;2!==r.length&&d(e,"TAG directive accepts exactly two arguments"),n=r[0],i=r[1],re.test(n)||d(e,"ill-formed tag handle (first argument) of the TAG directive"),V.call(e.tagMap,n)&&d(e,'there is a previously declared suffix for "'+n+'" tag handle'),ne.test(i)||d(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=i}};t.exports.loadAll=F,t.exports.load=U,t.exports.safeLoadAll=L,t.exports.safeLoad=N},{"./common":9,"./exception":11,"./mark":13,"./schema/default_full":16,"./schema/default_safe":17}],13:[function(e,t,r){"use strict";function n(e,t,r,n,i){this.name=e,this.buffer=t,this.position=r,this.line=n,this.column=i}var i=e("./common");n.prototype.getSnippet=function(e,t){var r,n,o,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,r="",n=this.position;n>0&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(n-1));)if(n-=1,this.position-n>t/2-1){r=" ... ",n+=5;break}for(o="",a=this.position;at/2-1){o=" ... ",a-=5;break}return s=this.buffer.slice(n,a),i.repeat(" ",e)+r+s+o+"\n"+i.repeat(" ",e+this.position-n+r.length)+"^"},n.prototype.toString=function(e){var t,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(r+=":\n"+t)),r},t.exports=n},{"./common":9}],14:[function(e,t,r){"use strict";function n(e,t,r){var i=[];return e.include.forEach(function(e){r=n(e,t,r)}),e[t].forEach(function(e){r.forEach(function(t,r){t.tag===e.tag&&i.push(r)}),r.push(e)}),r.filter(function(e,t){return-1===i.indexOf(t)})}function i(){function e(e){n[e.tag]=e}var t,r,n={};for(t=0,r=arguments.length;r>t;t+=1)arguments[t].forEach(e);return n}function o(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new s("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=n(this,"implicit",[]),this.compiledExplicit=n(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var a=e("./common"),s=e("./exception"),c=e("./type");o.DEFAULT=null,o.create=function(){var e,t;switch(arguments.length){case 1:e=o.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new s("Wrong number of arguments for Schema.create function")}if(e=a.toArray(e),t=a.toArray(t),!e.every(function(e){return e instanceof o}))throw new s("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof c}))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new o({include:e,explicit:t})},t.exports=o},{"./common":9,"./exception":11,"./type":20}],15:[function(e,t,r){"use strict";var n=e("../schema");t.exports=new n({include:[e("./json")]})},{"../schema":14,"./json":19}],16:[function(e,t,r){"use strict";var n=e("../schema");t.exports=n.DEFAULT=new n({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":14,"../type/js/function":25,"../type/js/regexp":26,"../type/js/undefined":27,"./default_safe":17}],17:[function(e,t,r){"use strict";var n=e("../schema");t.exports=new n({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../type/set")]})},{"../schema":14,"../type/binary":21,"../type/merge":29,"../type/omap":31,"../type/pairs":32,"../type/set":34,"../type/timestamp":36,"./core":15}],18:[function(e,t,r){"use strict";var n=e("../schema");t.exports=new n({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":14,"../type/map":28,"../type/seq":33,"../type/str":35}],19:[function(e,t,r){"use strict";var n=e("../schema");t.exports=new n({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":14,"../type/bool":22,"../type/float":23,"../type/int":24,"../type/null":30,"./failsafe":18}],20:[function(e,t,r){"use strict";function n(e){var t={};return null!==e&&Object.keys(e).forEach(function(r){e[r].forEach(function(e){t[String(e)]=r})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===a.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=n(t.styleAliases||null),-1===s.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var o=e("./exception"),a=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=i},{"./exception":11}],21:[function(e,t,r){"use strict";function n(e){if(null===e)return!1;var t,r,n=0,i=e.length,o=u;for(r=0;i>r;r++)if(t=o.indexOf(e.charAt(r)),!(t>64)){if(0>t)return!1;n+=6}return n%8===0}function i(e){var t,r,n=e.replace(/[\r\n=]/g,""),i=n.length,o=u,a=0,c=[];for(t=0;i>t;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|o.indexOf(n.charAt(t));return r=i%4*6,0===r?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===r?(c.push(a>>10&255),c.push(a>>2&255)):12===r&&c.push(a>>4&255),s?new s(c):c}function o(e){var t,r,n="",i=0,o=e.length,a=u;for(t=0;o>t;t++)t%3===0&&t&&(n+=a[i>>18&63],n+=a[i>>12&63],n+=a[i>>6&63],n+=a[63&i]),i=(i<<8)+e[t];return r=o%3,0===r?(n+=a[i>>18&63],n+=a[i>>12&63],n+=a[i>>6&63],n+=a[63&i]):2===r?(n+=a[i>>10&63],n+=a[i>>4&63],n+=a[i<<2&63],n+=a[64]):1===r&&(n+=a[i>>2&63],n+=a[i<<4&63],n+=a[64],n+=a[64]),n}function a(e){return s&&s.isBuffer(e)}var s=e("buffer").Buffer,c=e("../type"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new c("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:i,predicate:a,represent:o})},{"../type":20,buffer:5}],22:[function(e,t,r){"use strict";function n(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function o(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var a=e("../type");t.exports=new a("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":20}],23:[function(e,t,r){"use strict";function n(e){return null===e?!1:u.test(e)?!0:!1}function i(e){var t,r,n,i;return t=e.replace(/_/g,"").toLowerCase(),r="-"===t[0]?-1:1,i=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:0<=t.indexOf(":")?(t.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),t=0,n=1,i.forEach(function(e){t+=e*n,n*=60}),r*t):r*parseFloat(t,10)}function o(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(s.isNegativeZero(e))return"-0.0";return r=e.toString(10),f.test(r)?r.replace("e",".e"):r}function a(e){return"[object Number]"===Object.prototype.toString.call(e)&&(0!==e%1||s.isNegativeZero(e))}var s=e("../common"),c=e("../type"),u=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),f=/^[-+]?[0-9]+e/;t.exports=new c("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:a,represent:o,defaultStyle:"lowercase"})},{"../common":9,"../type":20}],24:[function(e,t,r){"use strict";function n(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function i(e){return e>=48&&55>=e}function o(e){return e>=48&&57>=e}function a(e){if(null===e)return!1;var t,r=e.length,a=0,s=!1;if(!r)return!1;if(t=e[a],("-"===t||"+"===t)&&(t=e[++a]),"0"===t){if(a+1===r)return!0;if(t=e[++a],"b"===t){for(a++;r>a;a++)if(t=e[a],"_"!==t){if("0"!==t&&"1"!==t)return!1;s=!0}return s}if("x"===t){for(a++;r>a;a++)if(t=e[a],"_"!==t){if(!n(e.charCodeAt(a)))return!1;s=!0}return s}for(;r>a;a++)if(t=e[a],"_"!==t){if(!i(e.charCodeAt(a)))return!1;s=!0}return s}for(;r>a;a++)if(t=e[a],"_"!==t){if(":"===t)break;if(!o(e.charCodeAt(a)))return!1;s=!0}return s?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(a)):!1}function s(e){var t,r,n=e,i=1,o=[];return-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),t=n[0],("-"===t||"+"===t)&&("-"===t&&(i=-1),n=n.slice(1),t=n[0]),"0"===n?0:"0"===t?"b"===n[1]?i*parseInt(n.slice(2),2):"x"===n[1]?i*parseInt(n,16):i*parseInt(n,8):-1!==n.indexOf(":")?(n.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),n=0,r=1,o.forEach(function(e){n+=e*r,r*=60}),i*n):i*parseInt(n,10)}function c(e){return"[object Number]"===Object.prototype.toString.call(e)&&0===e%1&&!u.isNegativeZero(e)}var u=e("../common"),f=e("../type");t.exports=new f("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:s,predicate:c,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":9,"../type":20}],25:[function(e,t,r){"use strict";function n(e){if(null===e)return!1;try{var t="("+e+")",r=s.parse(t,{range:!0});return"Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"FunctionExpression"!==r.body[0].expression.type?!1:!0}catch(n){return!1}}function i(e){var t,r="("+e+")",n=s.parse(r,{range:!0}),i=[];if("Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"FunctionExpression"!==n.body[0].expression.type)throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=n.body[0].expression.body.range,new Function(i,r.slice(t[0]+1,t[1]-1))}function o(e){return e.toString()}function a(e){return"[object Function]"===Object.prototype.toString.call(e)}var s;try{var c=e;s=c("esprima")}catch(u){"undefined"!=typeof window&&(s=window.esprima)}var f=e("../../type");t.exports=new f("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:n,construct:i,predicate:a,represent:o})},{"../../type":20}],26:[function(e,t,r){"use strict";function n(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,r=/\/([gim]*)$/.exec(e),n="";if("/"===t[0]){if(r&&(n=r[1]),n.length>3)return!1;if("/"!==t[t.length-n.length-1])return!1;t=t.slice(1,t.length-n.length-1)}try{return!0}catch(i){return!1}}function i(e){var t=e,r=/\/([gim]*)$/.exec(e),n="";return"/"===t[0]&&(r&&(n=r[1]),t=t.slice(1,t.length-n.length-1)),new RegExp(t,n)}function o(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function a(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:n,construct:i,predicate:a,represent:o})},{"../../type":20}],27:[function(e,t,r){"use strict";function n(){return!0}function i(){}function o(){return""}function a(e){return"undefined"==typeof e}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:n,construct:i,predicate:a,represent:o})},{"../../type":20}],28:[function(e,t,r){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":20}],29:[function(e,t,r){"use strict";function n(e){return"<<"===e||null===e}var i=e("../type");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})},{"../type":20}],30:[function(e,t,r){"use strict";function n(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function o(e){return null===e}var a=e("../type");t.exports=new a("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":20}],31:[function(e,t,r){"use strict";function n(e){if(null===e)return!0;var t,r,n,i,o,c=[],u=e;for(t=0,r=u.length;r>t;t+=1){if(n=u[t],o=!1,"[object Object]"!==s.call(n))return!1;for(i in n)if(a.call(n,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==c.indexOf(i))return!1;c.push(i)}return!0}function i(e){return null!==e?e:[]}var o=e("../type"),a=Object.prototype.hasOwnProperty,s=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:n,construct:i})},{"../type":20}],32:[function(e,t,r){"use strict";function n(e){if(null===e)return!0;var t,r,n,i,o,s=e;for(o=new Array(s.length),t=0,r=s.length;r>t;t+=1){if(n=s[t],"[object Object]"!==a.call(n))return!1;if(i=Object.keys(n),1!==i.length)return!1;o[t]=[i[0],n[i[0]]]}return!0}function i(e){if(null===e)return[];var t,r,n,i,o,a=e;for(o=new Array(a.length),t=0,r=a.length;r>t;t+=1)n=a[t],i=Object.keys(n),o[t]=[i[0],n[i[0]]];return o}var o=e("../type"),a=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:i})},{"../type":20}],33:[function(e,t,r){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":20}],34:[function(e,t,r){"use strict";function n(e){if(null===e)return!0;var t,r=e;for(t in r)if(a.call(r,t)&&null!==r[t])return!1;return!0}function i(e){return null!==e?e:{}}var o=e("../type"),a=Object.prototype.hasOwnProperty;t.exports=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:n,construct:i})},{"../type":20}],35:[function(e,t,r){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":20}],36:[function(e,t,r){"use strict";function n(e){return null===e?!1:null===s.exec(e)?!1:!0}function i(e){var t,r,n,i,o,a,c,u,f,p,l=0,h=null;if(t=s.exec(e),null===t)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,n,i));if(o=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],f=+(t[11]||0),h=6e4*(60*u+f),"-"===t[9]&&(h=-h)),p=new Date(Date.UTC(r,n,i,o,a,c,l)),h&&p.setTime(p.getTime()-h),p}function o(e){return e.toISOString()}var a=e("../type"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");t.exports=new a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:o})},{"../type":20}],37:[function(e,t,r){"use strict";function n(e){var t;return d(e,"Array")?(t=[],e.forEach(function(e,r){t[r]=n(e)})):d(e,"Object")?(t={},Object.keys(e).forEach(function(r){t[r]=n(e[r])})):t=e,t}function i(e,t){function r(e){Object.keys(e).forEach(function(t){n[t]=e[t]})}var n={};return r(k.parse(e||"")),r(k.parse(t||"")),0===Object.keys(n).length?void 0:k.stringify(n)}function o(e,t){d(e,"String")&&(e=F(e)),d(t,"String")&&(t=F(t));var r,n,o=g(d(t,"Undefined")?"":t);return q.indexOf(o.reference)>-1?n=o:(r=d(e,"Undefined")?void 0:g(e),d(r,"Undefined")?n=o:(n=r,n.path=D.join(r.path,o.path),n.query=i(r.query,o.query))),n.fragment=void 0,(-1===q.indexOf(n.reference)&&0===n.path.indexOf("../")?"../":"")+U.serialize(n)}function a(e,t){var r,n=[];return t.length>0&&(r=e,t.slice(0,t.length-1).forEach(function(e){e in r&&(r=r[e],n.push(r))})),n}function s(e,t,r,i,o,a,s,f,p){var l,h;if(r.length>0)try{l=u(t,r)}catch(m){"remote"===e&&(i.error=m.message,i.missing=!0)}else l=t;return d(l,"Undefined")||(i.value=l),d(l,"Array")||d(l,"Object")?(h=n(o),"local"===e?(delete h.subDocPath,t=l):(h.relativeBase=D.dirname(a[a.length-1]),0===r.length?delete h.subDocPath:h.subDocPath=r),c(t,h,a,s,f,p)):void 0}function c(e,t,r,n,i,a){var c=Promise.resolve(),u=n.length?S(n[n.length-1]):[],f=w(e,t),p=t.subDocPath||[],h=T(p),m=["#"];return r.forEach(function(e,t){"#"!==e.charAt(0)&&m.push(n[t])}),m.reverse(),"#"!==(r[r.length-1]||"").charAt(0)&&(i.documents[T(u)]=e),Object.keys(f).forEach(function(y){var g,v,b,E,x=f[y];b=0===r.length?u.concat(S(y)):u.concat(S(y).slice(0===r.length?0:p.length)),E=T(b),d(i[E],"Undefined")&&(i.refs[E]=f[y],d(x.error,"Undefined")&&"invalid"!==x.type&&(M.indexOf(x.type)>-1?(g=o(t.relativeBase,x.uri),v=r.indexOf(g)):(g=x.uri,v=n.indexOf(g)),x.ancestorPtrs=m,x.indirect=a,-1===v?M.indexOf(x.type)>-1?c=c.then(function(){return l(g,t).then(function(e){return s("remote",e,d(x.uriDetails.fragment,"Undefined")?[]:S(decodeURI(x.uriDetails.fragment)),x,t,r.concat(g),n.concat(E),i,a)})["catch"](function(e){x.error=e.message,x.missing=!0})}):0!==E.indexOf(g+"/")&&E!==g&&0!==h.indexOf(g+"/")&&h!==g?0!==g.indexOf(h+"/")&&(c=c.then(function(){return s("local",e,S(g),x,t,r.concat(g),n.concat(E),i,a||-1===g.indexOf(h+"/")&&g!==h)})):x.circular=!0:(n.slice(v).forEach(function(e){i.refs[e].circular=!0}),x.circular=!0)))}),c=c.then(function(){return i})}function u(e,t){var r=e;return t.forEach(function(e){if(e=decodeURI(e),!(e in r))throw Error("JSON Pointer points to missing location: "+T(t));r=r[e]}),r}function f(e){return Object.keys(e).filter(function(e){return"$ref"!==e})}function p(e){var t;switch(e.uriDetails.reference){case"absolute":case"uri":t="remote";break;case"same-document":t="local";break;default:t=e.uriDetails.reference}return t}function l(e,t){var r=N[e],i=Promise.resolve(),o=n(t.loaderOptions||{});return d(r,"Undefined")?(d(o.processContent,"Undefined")&&(o.processContent=function(e,t){t(void 0,JSON.parse(e.text))}),i=R.load(decodeURI(e),o),i=i.then(function(t){return N[e]={value:t},t})["catch"](function(t){throw N[e]={error:t},t})):i=i.then(function(){return r.value}),i=i.then(function(e){return n(e)})}function h(e,t){var r=!0;try{if(!d(e,"Object"))throw new Error("obj is not an Object");if(!d(e.$ref,"String"))throw new Error("obj.$ref is not a String")}catch(n){if(t)throw n;r=!1}return r}function d(e,t){return"Undefined"===t?"undefined"==typeof e:Object.prototype.toString.call(e)==="[object "+t+"]"}function m(e){var t,r;return d(e.filter,"Array")||d(e.filter,"String")?(r=d(e.filter,"String")?[e.filter]:e.filter,t=function(e){return r.indexOf(e.type)>-1||r.indexOf(p(e))>-1}):d(e.filter,"Function")?t=e.filter:d(e.filter,"Undefined")&&(t=function(){return!0}),function(r,n){return("invalid"!==r.type||e.includeInvalid===!0)&&t(r,n)}}function y(e){var t;return d(e.subDocPath,"Array")?t=e.subDocPath:d(e.subDocPath,"String")?t=S(e.subDocPath):d(e.subDocPath,"Undefined")&&(t=[]),t}function g(e){return U.parse(encodeURI(decodeURI(e)))}function v(e,t,r){u(e,t.slice(0,t.length-1))[decodeURI(t[t.length-1])]=r}function b(e,t,r,n){function i(t,i){r.push(i),b(e,t,r,n),r.pop()}var o=!0;d(n,"Function")&&(o=n(e,t,r)),-1===e.indexOf(t)&&(e.push(t),o!==!1&&(d(t,"Array")?t.forEach(function(e,t){i(e,t.toString())}):d(t,"Object")&&Object.keys(t).forEach(function(e){i(t[e],e)}))),e.pop()}function E(e,t){if(e=d(e,"Undefined")?{}:n(e),!d(e,"Object"))throw new TypeError("options must be an Object");if(!(d(e.filter,"Undefined")||d(e.filter,"Array")||d(e.filter,"Function")||d(e.filter,"String")))throw new TypeError("options.filter must be an Array, a Function of a String");if(!d(e.includeInvalid,"Undefined")&&!d(e.includeInvalid,"Boolean"))throw new TypeError("options.includeInvalid must be a Boolean");if(!d(e.refPreProcessor,"Undefined")&&!d(e.refPreProcessor,"Function"))throw new TypeError("options.refPreProcessor must be a Function");if(!d(e.refPostProcessor,"Undefined")&&!d(e.refPostProcessor,"Function"))throw new TypeError("options.refPostProcessor must be a Function");if(!d(e.subDocPath,"Undefined")&&!d(e.subDocPath,"Array")&&!I(e.subDocPath))throw new TypeError("options.subDocPath must be an Array of path segments or a valid JSON Pointer");if(e.filter=m(e),e.subDocPath=y(e),!d(t,"Undefined"))try{u(t,e.subDocPath)}catch(r){throw r.message=r.message.replace("JSON Pointer","options.subDocPath"),r}return e}function x(){N={}}function O(e){if(!d(e,"Array"))throw new TypeError("path must be an array");return e.map(function(e){return d(e,"String")||(e=JSON.stringify(e)),decodeURI(e.replace(/~1/g,"/").replace(/~0/g,"~"))})}function j(e){if(!d(e,"Array"))throw new TypeError("path must be an array");return e.map(function(e){return d(e,"String")||(e=JSON.stringify(e)),e.replace(/~/g,"~0").replace(/\//g,"~1")})}function w(e,t){var r={};if(!d(e,"Array")&&!d(e,"Object"))throw new TypeError("obj must be an Array or an Object");return t=E(t,e),b(a(e,t.subDocPath),u(e,t.subDocPath),n(t.subDocPath),function(e,i,o){var a,s=!0;return h(i)&&(d(t.refPreProcessor,"Undefined")||(i=t.refPreProcessor(n(i),o)),a=_(i),d(t.refPostProcessor,"Undefined")||(a=t.refPostProcessor(a,o)),t.filter(a,o)&&(r[T(o)]=a),f(i).length>0&&(s=!1)),s}),r}function A(e,t){var r=Promise.resolve();return r=r.then(function(){if(!d(e,"String"))throw new TypeError("location must be a string");return t=E(t),e=o(t.relativeBase,e),l(e,t)}).then(function(r){var i=n(N[e]),o=n(t),a=g(e);return d(i.refs,"Undefined")&&(delete o.filter,delete o.subDocPath,o.includeInvalid=!0,N[e].refs=w(r,o)),d(t.filter,"Undefined")||(o.filter=t.filter),d(a.fragment,"Undefined")?d(a.subDocPath,"Undefined")||(o.subDocPath=t.subDocPath):o.subDocPath=S(decodeURI(a.fragment)),{refs:w(r,o),value:r}})}function _(e){var t,r,n,i={def:e};try{h(e,!0)?(t=e.$ref,n=Y[t],d(n,"Undefined")&&(n=Y[t]=g(t)),i.uri=t,i.uriDetails=n,d(n.error,"Undefined")?i.type=p(i):(i.error=i.uriDetails.error,i.type="invalid"),r=f(e),r.length>0&&(i.warning="Extra JSON Reference properties will be ignored: "+r.join(", "))):i.type="invalid"}catch(o){i.error=o.message,i.type="invalid"}return i}function I(e,t){var r,n=!0;try{if(!d(e,"String"))throw new Error("ptr is not a String");if(""!==e){if(r=e.charAt(0),-1===["#","/"].indexOf(r))throw new Error("ptr must start with a / or #/");if("#"===r&&"#"!==e&&"/"!==e.charAt(1))throw new Error("ptr must start with a / or #/");if(e.match(L))throw new Error("ptr has invalid token(s)")}}catch(i){if(t===!0)throw i;n=!1}return n}function P(e,t){return h(e,t)&&"invalid"!==_(e,t).type}function S(e){if(!I(e))throw new Error("ptr must be a JSON Pointer");var t=e.split("/");return t.shift(),O(t)}function T(e,t){if(!d(e,"Array"))throw new Error("path must be an Array");return(t!==!1?"#":"")+(e.length>0?"/":"")+j(e).join("/")}function C(e,t){var r=Promise.resolve();return r=r.then(function(){if(!d(e,"Array")&&!d(e,"Object"))throw new TypeError("obj must be an Array or an Object");t=E(t,e),e=n(e)}).then(function(){return c(e,t,[],[],{documents:{},refs:{}})}).then(function(t){function r(e,t){return S(e).length-S(t).length}var n={},i={};return Object.keys(t.refs).sort(r).forEach(function(r){var o=t.refs[r];o.indirect||(i[r]=o),delete o.indirect,d(o.error,"Undefined")&&"invalid"!==o.type&&(d(o.value,"Undefined")&&o.circular&&(o.value=o.def),d(o.value,"Undefined")?n[r]=o:("#"===r?e=o.value:v(e,S(r),o.value),delete o.ancestorPtrs))}),Object.keys(n).forEach(function(r){var i=n[r];i.ancestorPtrs.forEach(function(n,o){if(d(i.value,"Undefined"))try{i.value=u(t.documents[n],S(i.uri)),delete i.ancestorPtrs,v(e,S(r),i.value)}catch(a){o===i.ancestorPtrs.length-1&&(i.error=a.message,i.missing=!0,delete i.ancestorPtrs)}})}),{refs:i,resolved:e}})}function $(e,t){var r=Promise.resolve();return r=r.then(function(){if(!d(e,"String"))throw new TypeError("location must be a string");return t=E(t),e=o(t.relativeBase,e),l(e,t)}).then(function(r){var i=n(t),o=g(e);return d(o.fragment,"Undefined")||(i.subDocPath=S(decodeURI(o.fragment))),i.relativeBase=D.dirname(e),C(r,i).then(function(e){return{refs:e.refs,resolved:e.resolved,value:r}})})}var D=e("path"),R=e("path-loader"),k=e("querystring"),F=e("slash"),U=e("uri-js"),L=/~(?:[^01]|$)/g,N={},M=["relative","remote"],q=["absolute","uri"],Y={}; -"undefined"==typeof Promise&&e("native-promise-only"),t.exports.clearCache=x,t.exports.decodePath=O,t.exports.encodePath=j,t.exports.findRefs=w,t.exports.findRefsAt=A,t.exports.getRefDetails=_,t.exports.isPtr=I,t.exports.isRef=P,t.exports.pathFromPtr=S,t.exports.pathToPtr=T,t.exports.resolveRefs=C,t.exports.resolveRefsAt=$},{"native-promise-only":170,path:171,"path-loader":172,querystring:180,slash:182,"uri-js":191}],38:[function(e,t,r){var n=e("../internal/baseDifference"),i=e("../internal/baseFlatten"),o=e("../internal/isArrayLike"),a=e("../internal/isObjectLike"),s=e("../function/restParam"),c=s(function(e,t){return a(e)&&o(e)?n(e,i(t,!1,!0)):[]});t.exports=c},{"../function/restParam":48,"../internal/baseDifference":60,"../internal/baseFlatten":64,"../internal/isArrayLike":104,"../internal/isObjectLike":110}],39:[function(e,t,r){function n(e,t,r){var n=e?e.length:0;if(!n)return-1;if("number"==typeof r)r=0>r?a(n+r,0):r;else if(r){var s=o(e,t);return n>s&&(t===t?t===e[s]:e[s]!==e[s])?s:-1}return i(e,t,r||0)}var i=e("../internal/baseIndexOf"),o=e("../internal/binaryIndex"),a=Math.max;t.exports=n},{"../internal/baseIndexOf":69,"../internal/binaryIndex":82}],40:[function(e,t,r){function n(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=n},{}],41:[function(e,t,r){var n=e("../internal/baseFlatten"),i=e("../internal/baseUniq"),o=e("../function/restParam"),a=o(function(e){return i(n(e,!1,!0))});t.exports=a},{"../function/restParam":48,"../internal/baseFlatten":64,"../internal/baseUniq":81}],42:[function(e,t,r){function n(e,t,r,n){var c=e?e.length:0;return c?(null!=t&&"boolean"!=typeof t&&(n=r,r=a(e,t,n)?void 0:t,t=!1),r=null==r?r:i(r,n,3),t?s(e,r):o(e,r)):[]}var i=e("../internal/baseCallback"),o=e("../internal/baseUniq"),a=e("../internal/isIterateeCall"),s=e("../internal/sortedUniq");t.exports=n},{"../internal/baseCallback":57,"../internal/baseUniq":81,"../internal/isIterateeCall":107,"../internal/sortedUniq":113}],43:[function(e,t,r){t.exports=e("./forEach")},{"./forEach":45}],44:[function(e,t,r){var n=e("../internal/baseEach"),i=e("../internal/createFind"),o=i(n);t.exports=o},{"../internal/baseEach":61,"../internal/createFind":91}],45:[function(e,t,r){var n=e("../internal/arrayEach"),i=e("../internal/baseEach"),o=e("../internal/createForEach"),a=o(n,i);t.exports=a},{"../internal/arrayEach":51,"../internal/baseEach":61,"../internal/createForEach":92}],46:[function(e,t,r){function n(e,t,r){var n=s(e)?i:a;return t=o(t,r,3),n(e,t)}var i=e("../internal/arrayMap"),o=e("../internal/baseCallback"),a=e("../internal/baseMap"),s=e("../lang/isArray");t.exports=n},{"../internal/arrayMap":52,"../internal/baseCallback":57,"../internal/baseMap":73,"../lang/isArray":118}],47:[function(e,t,r){var n=e("../internal/arrayReduce"),i=e("../internal/baseEach"),o=e("../internal/createReduce"),a=o(n,i);t.exports=a},{"../internal/arrayReduce":54,"../internal/baseEach":61,"../internal/createReduce":93}],48:[function(e,t,r){function n(e,t){if("function"!=typeof e)throw new TypeError(i);return t=o(void 0===t?e.length-1:+t||0,0),function(){for(var r=arguments,n=-1,i=o(r.length-t,0),a=Array(i);++n=s?a(t):null,l=t.length;p&&(u=o,f=!1,t=p);e:for(;++cn;)e=i(e)[t[n++]];return n&&n==o?e:void 0}}var i=e("./toObject");t.exports=n},{"./toObject":114}],69:[function(e,t,r){function n(e,t,r){if(t!==t)return i(e,r);for(var n=r-1,o=e.length;++nt&&(t=-t>i?0:i+t),r=void 0===r||r>i?i:+r||0,0>r&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n=s,p=f?a():null,l=[];p?(n=o,u=!1):(f=!1,p=t?[]:l);e:for(;++r=a){for(;a>n;){var c=n+a>>>1,u=e[c];(r?t>=u:t>u)&&null!==u?n=c+1:a=c}return a}return i(e,t,o,r)}var i=e("./binaryIndexBy"),o=e("../utility/identity"),a=4294967295,s=a>>>1;t.exports=n},{"../utility/identity":137,"./binaryIndexBy":83}],83:[function(e,t,r){function n(e,t,r,n){t=r(t);for(var a=0,c=e?e.length:0,u=t!==t,f=null===t,p=void 0===t;c>a;){var l=i((a+c)/2),h=r(e[l]),d=void 0!==h,m=h===h;if(u)var y=m||n;else y=f?m&&d&&(n||null!=h):p?m&&(n||d):null==h?!1:n?t>=h:t>h;y?a=l+1:c=l}return o(c,s)}var i=Math.floor,o=Math.min,a=4294967295,s=a-1;t.exports=n},{}],84:[function(e,t,r){function n(e,t,r){if("function"!=typeof e)return i;if(void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 3:return function(r,n,i){return e.call(t,r,n,i)};case 4:return function(r,n,i,o){return e.call(t,r,n,i,o)};case 5:return function(r,n,i,o,a){return e.call(t,r,n,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=e("../utility/identity");t.exports=n},{"../utility/identity":137}],85:[function(e,t,r){(function(e){function r(e){var t=new n(e.byteLength),r=new i(t);return r.set(new i(e)),t}var n=e.ArrayBuffer,i=e.Uint8Array;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],86:[function(e,t,r){function n(e,t){var r=e.data,n="string"==typeof t||i(t)?r.set.has(t):r.hash[t];return n?0:-1}var i=e("../lang/isObject");t.exports=n},{"../lang/isObject":126}],87:[function(e,t,r){function n(e){var t=this.data;"string"==typeof e||i(e)?t.set.add(e):t.hash[e]=!0}var i=e("../lang/isObject");t.exports=n},{"../lang/isObject":126}],88:[function(e,t,r){function n(e,t){return function(r,n){var s=r?i(r):0;if(!o(s))return e(r,n);for(var c=t?s:-1,u=a(r);(t?c--:++c-1?r[u]:void 0}return o(r,n,e)}}var i=e("./baseCallback"),o=e("./baseFind"),a=e("./baseFindIndex"),s=e("../lang/isArray");t.exports=n},{"../lang/isArray":118,"./baseCallback":57,"./baseFind":62,"./baseFindIndex":63}],92:[function(e,t,r){function n(e,t){return function(r,n,a){return"function"==typeof n&&void 0===a&&o(r)?e(r,n):t(r,i(n,a,3))}}var i=e("./bindCallback"),o=e("../lang/isArray");t.exports=n},{"../lang/isArray":118,"./bindCallback":84}],93:[function(e,t,r){function n(e,t){return function(r,n,s,c){var u=arguments.length<3;return"function"==typeof n&&void 0===c&&a(r)?e(r,n,s,u):o(r,i(n,c,4),s,u,t)}}var i=e("./baseCallback"),o=e("./baseReduce"),a=e("../lang/isArray");t.exports=n},{"../lang/isArray":118,"./baseCallback":57,"./baseReduce":78}],94:[function(e,t,r){function n(e,t,r,n,o,a,s){var c=-1,u=e.length,f=t.length;if(u!=f&&!(o&&f>u))return!1;for(;++c-1&&e%1==0&&t>e}var i=/^\d+$/,o=9007199254740991;t.exports=n},{}],107:[function(e,t,r){function n(e,t,r){if(!a(r))return!1;var n=typeof t;if("number"==n?i(r)&&o(t,r.length):"string"==n&&t in r){var s=r[t];return e===e?e===s:s!==s}return!1}var i=e("./isArrayLike"),o=e("./isIndex"),a=e("../lang/isObject");t.exports=n},{"../lang/isObject":126,"./isArrayLike":104,"./isIndex":106}],108:[function(e,t,r){function n(e,t){var r=typeof e;if("string"==r&&s.test(e)||"number"==r)return!0;if(i(e))return!1;var n=!a.test(e);return n||null!=t&&e in o(t)}var i=e("../lang/isArray"),o=e("./toObject"),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=n},{"../lang/isArray":118,"./toObject":114}],109:[function(e,t,r){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}var i=9007199254740991;t.exports=n},{}],110:[function(e,t,r){function n(e){return!!e&&"object"==typeof e}t.exports=n},{}],111:[function(e,t,r){function n(e){return e===e&&!i(e)}var i=e("../lang/isObject");t.exports=n},{"../lang/isObject":126}],112:[function(e,t,r){function n(e){for(var t=u(e),r=t.length,n=r&&e.length,f=!!n&&s(n)&&(o(e)||i(e)||c(e)),l=-1,h=[];++l0,g=l.enumErrorProps&&(e===j||e instanceof Error),v=l.enumPrototypes&&s(e);++nn;)e=e[t[n++]];return n&&n==o?e:void 0}}function i(e){return o(e)?e:Object(e)}function o(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=n},{}],146:[function(e,t,r){function n(e,t,r,c,p,l){var h=1&t,d=2&t,m=4&t,y=16&t,g=32&t;if(!d&&!a(e))throw new TypeError;y&&!r.length&&(t&=-17,y=r=!1),g&&!c.length&&(t&=-33,g=c=!1);var v=e&&e.__bindData__;if(v&&v!==!0)return v=s(v),v[2]&&(v[2]=s(v[2])),v[3]&&(v[3]=s(v[3])),!h||1&v[1]||(v[4]=p),!h&&1&v[1]&&(t|=8),!m||4&v[1]||(v[5]=l),y&&u.apply(v[2]||(v[2]=[]),r),g&&f.apply(v[3]||(v[3]=[]),c),v[1]|=t,n.apply(null,v);var b=1==t||17===t?i:o;return b([e,t,r,c,p,l])}var i=e("lodash._basebind"),o=e("lodash._basecreatewrapper"),a=e("lodash.isfunction"),s=e("lodash._slice"),c=[],u=c.push,f=c.unshift;t.exports=n},{"lodash._basebind":140,"lodash._basecreatewrapper":144,"lodash._slice":154,"lodash.isfunction":165}],147:[function(e,t,r){function n(){return i.pop()||[]}var i=e("lodash._arraypool");t.exports=n},{"lodash._arraypool":139}],148:[function(e,t,r){function n(e){return"function"==typeof e&&a.test(e)}var i=Object.prototype,o=i.toString,a=RegExp("^"+String(o).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");t.exports=n},{}],149:[function(e,t,r){var n=40;t.exports=n},{}],150:[function(e,t,r){var n={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1};t.exports=n},{}],151:[function(e,t,r){function n(e){e.length=0,i.lengthi?0:i);++n-1&&e%1==0&&v>=e}function a(e){return s(e)&&m.call(e)==f}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function c(e){return null==e?!1:a(e)?y.test(h.call(e)):n(e)&&p.test(e)}var u="[object Array]",f="[object Function]",p=/^\[object .+?Constructor\]$/,l=Object.prototype,h=Function.prototype.toString,d=l.hasOwnProperty,m=l.toString,y=RegExp("^"+h.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=i(Array,"isArray"),v=9007199254740991,b=g||function(e){return n(e)&&o(e.length)&&m.call(e)==u};t.exports=b},{}],157:[function(e,t,r){var n=e("lodash._basecreatecallback"),i=e("lodash.keys"),o=e("lodash._objecttypes"),a=function(e,t,r){var a,s=e,c=s;if(!s)return c;var u=arguments,f=0,p="number"==typeof r?2:u.length;if(p>3&&"function"==typeof u[p-2])var l=n(u[--p-1],u[p--],2);else p>2&&"function"==typeof u[p-1]&&(l=u[--p]);for(;++f2?i(e,17,o(arguments,2),null,t):i(e,1,null,null,t)}var i=e("lodash._createwrapper"),o=e("lodash._slice");t.exports=n},{"lodash._createwrapper":146,"lodash._slice":154}],159:[function(e,t,r){function n(e,t,r){return i(e,!0,"function"==typeof t&&o(t,r,1))}var i=e("lodash._baseclone"),o=e("lodash._basecreatecallback");t.exports=n},{"lodash._baseclone":141,"lodash._basecreatecallback":143}],160:[function(e,t,r){function n(e,t,r){var n=-1,a=e?e.length:0;if(t=t&&"undefined"==typeof r?t:i(t,r,3),"number"==typeof a)for(;++n0&&e(r,c))}catch(u){o.call(new s(c),u)}}}function o(t){var n=this;n.triggered||(n.triggered=!0,n.def&&(n=n.def),n.msg=t,n.state=2,n.chain.length>0&&e(r,n))}function a(e,t,r,n){for(var i=0;i=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var i=r.isAbsolute(e),o="/"===a(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),o=n(t.split("/")),a=Math.min(i.length,o.length),s=a,c=0;a>c;c++)if(i[c]!==o[c]){s=c;break}for(var u=[],c=s;ct&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:176}],172:[function(e,t,r){"use strict";function n(e){return"undefined"!=typeof e&&(e=-1===e.indexOf("://")?"":e.split("://")[0]),e}function i(e){var t=n(e),r=o[t];if("undefined"==typeof r){if(""!==t)throw new Error("Unsupported scheme: "+t);r=a}return r}var o={file:e("./lib/loaders/file"),http:e("./lib/loaders/http"),https:e("./lib/loaders/http")},a="object"==typeof window||"function"==typeof importScripts?o.http:o.file;"undefined"==typeof Promise&&e("native-promise-only"),t.exports.load=function(e,t){var r=Promise.resolve();return"undefined"==typeof t&&(t={}),r=r.then(function(){if("undefined"==typeof e)throw new TypeError("location is required");if("string"!=typeof e)throw new TypeError("location must be a string");if("undefined"!=typeof t){if("object"!=typeof t)throw new TypeError("options must be an object");if("undefined"!=typeof t.processContent&&"function"!=typeof t.processContent)throw new TypeError("options.processContent must be a function")}}),r=r.then(function(){return new Promise(function(r,n){var o=i(e);o.load(e,t||{},function(e,t){e?n(e):r(t)})})}).then(function(e){return t.processContent?new Promise(function(r,n){t.processContent("object"==typeof e?e:{text:e},function(e,t){e?n(e):r(t)})}):"object"==typeof e?e.text:e})}},{"./lib/loaders/file":173,"./lib/loaders/http":174,"native-promise-only":170}],173:[function(e,t,r){"use strict";var n=new TypeError("The 'file' scheme is not supported in the browser");t.exports.getBase=function(){throw n},t.exports.load=function(){var e=arguments[arguments.length-1];if("function"!=typeof e)throw n;e(n)}},{}],174:[function(e,t,r){"use strict";var n=e("superagent"),i=["delete","get","head","patch","post","put"];t.exports.load=function(e,t,r){function o(e,t){e?r(e):("function"==typeof t.buffer&&t.buffer(!0),t.end(function(e,t){e?r(e):r(void 0,t)}))}var a,s,c=t.method?t.method.toLowerCase():"get";if("undefined"!=typeof t.method?"string"!=typeof t.method?a=new TypeError("options.method must be a string"):-1===i.indexOf(t.method)&&(a=new TypeError("options.method must be one of the following: "+i.slice(0,i.length-1).join(", ")+" or "+i[i.length-1])):"undefined"!=typeof t.prepareRequest&&"function"!=typeof t.prepareRequest&&(a=new TypeError("options.prepareRequest must be a function")),a)r(a);else if(s=n["delete"===c?"del":c](e),t.prepareRequest)try{t.prepareRequest(s,o)}catch(u){r(u)}else o(void 0,s)}},{superagent:175}],175:[function(e,t,r){function n(){}function i(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function o(e){return e===Object(e)}function a(e){if(!o(e))return e;var t=[];for(var r in e)null!=e[r]&&s(t,r,e[r]);return t.join("&")}function s(e,t,r){return Array.isArray(r)?r.forEach(function(r){s(e,t,r)}):void e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}function c(e){for(var t,r,n={},i=e.split("&"),o=0,a=i.length;a>o;++o)r=i[o],t=r.split("="),n[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return n}function u(e){var t,r,n,i,o=e.split(/\r?\n/),a={};o.pop();for(var s=0,c=o.length;c>s;++s)r=o[s],t=r.indexOf(":"),n=r.slice(0,t).toLowerCase(),i=E(r.slice(t+1)),a[n]=i;return a}function f(e){return/[\/+]json\b/.test(e)}function p(e){return e.split(/ *; */).shift()}function l(e){return b(e.split(/ *; */),function(e,t){var r=t.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(e[n]=i),e},{})}function h(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=u(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function d(e,t){var r=this;v.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new h(r)}catch(n){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=n,e.rawResponse=r.xhr&&r.xhr.responseText?r.xhr.responseText:null,r.callback(e)}if(r.emit("response",t),e)return r.callback(e,t);if(t.status>=200&&t.status<300)return r.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,r.callback(i,t)})}function m(e,t){return"function"==typeof t?new d("GET",e).end(t):1==arguments.length?new d("GET",e):new d(e,t)}function y(e,t){var r=m("DELETE",e);return t&&r.end(t),r}var g,v=e("emitter"),b=e("reduce");g="undefined"!=typeof window?window:"undefined"!=typeof self?self:this,m.getXHR=function(){if(!(!g.XMLHttpRequest||g.location&&"file:"==g.location.protocol&&g.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var E="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};m.serializeObject=a,m.parseString=c,m.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},m.serialize={"application/x-www-form-urlencoded":a,"application/json":JSON.stringify},m.parse={"application/x-www-form-urlencoded":c,"application/json":JSON.parse},h.prototype.get=function(e){return this.header[e.toLowerCase()]},h.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=p(t);var r=l(t);for(var n in r)this[n]=r[n]},h.prototype.parseBody=function(e){var t=m.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},h.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},h.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,n="cannot "+t+" "+r+" ("+this.status+")",i=new Error(n);return i.status=this.status,i.method=t,i.url=r,i},m.Response=h,v(d.prototype),d.prototype.use=function(e){return e(this),this},d.prototype.timeout=function(e){return this._timeout=e,this},d.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},d.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},d.prototype.set=function(e,t){if(o(e)){for(var r in e)this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},d.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},d.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},d.prototype.type=function(e){return this.set("Content-Type",m.types[e]||e),this},d.prototype.parse=function(e){return this._parser=e,this},d.prototype.accept=function(e){return this.set("Accept",m.types[e]||e),this},d.prototype.auth=function(e,t){var r=btoa(e+":"+t);return this.set("Authorization","Basic "+r),this},d.prototype.query=function(e){return"string"!=typeof e&&(e=a(e)),e&&this._query.push(e),this},d.prototype.field=function(e,t){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t),this},d.prototype.attach=function(e,t,r){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t,r||t.name),this},d.prototype.send=function(e){var t=o(e),r=this.getHeader("Content-Type");if(t&&o(this._data))for(var n in e)this._data[n]=e[n];else"string"==typeof e?(r||this.type("form"),r=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==r?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||i(e)?this:(r||this.type("json"),this)},d.prototype.callback=function(e,t){var r=this._callback;this.clearTimeout(),r(e,t)},d.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},d.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},d.prototype.withCredentials=function(){return this._withCredentials=!0,this},d.prototype.end=function(e){var t=this,r=this.xhr=m.getXHR(),o=this._query.join("&"),a=this._timeout,s=this._formData||this._data;this._callback=e||n,r.onreadystatechange=function(){if(4==r.readyState){var e;try{e=r.status}catch(n){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var c=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),e.direction="download",t.emit("progress",e)};this.hasListeners("progress")&&(r.onprogress=c);try{r.upload&&this.hasListeners("progress")&&(r.upload.onprogress=c)}catch(u){}if(a&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},a)),o&&(o=m.serializeObject(o),this.url+=~this.url.indexOf("?")?"&"+o:"?"+o),r.open(this.method,this.url,!0),this._withCredentials&&(r.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!i(s)){var p=this.getHeader("Content-Type"),l=this._parser||m.serialize[p?p.split(";")[0]:""];!l&&f(p)&&(l=m.serialize["application/json"]),l&&(s=l(s))}for(var h in this.header)null!=this.header[h]&&r.setRequestHeader(h,this.header[h]);return this.emit("request",this),r.send("undefined"!=typeof s?s:null),this},d.prototype.then=function(e,t){return this.end(function(r,n){r?t(r):e(n)})},m.Request=d,m.get=function(e,t,r){var n=m("GET",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},m.head=function(e,t,r){var n=m("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},m.del=y,m["delete"]=y,m.patch=function(e,t,r){var n=m("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},m.post=function(e,t,r){var n=m("POST",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},m.put=function(e,t,r){var n=m("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},t.exports=m},{emitter:6,reduce:181}],176:[function(e,t,r){function n(){f=!1,s.length?u=s.concat(u):p=-1,u.length&&i()}function i(){if(!f){var e=setTimeout(n);f=!0;for(var t=u.length;t;){for(s=u,u=[];++p1)for(var r=1;r1&&(n=r[0]+"@",e=r[1]),e=e.replace(D,".");var i=e.split("."),o=a(i,t).join(".");return n+o}function c(e){for(var t,r,n=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(r=e.charCodeAt(i++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--)):n.push(t);return n}function u(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=U(e>>>10&1023|55296),e=56320|1023&e),t+=U(e)}).join("")}function f(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:j}function p(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function l(e,t,r){var n=0;for(e=r?F(e/I):e>>1,e+=F(e/t);e>k*A>>1;n+=j)e=F(e/k);return F(n+(k+1)*e/(e+_))}function h(e){var t,r,n,i,a,s,c,p,h,d,m=[],y=e.length,g=0,v=S,b=P;for(r=e.lastIndexOf(T),0>r&&(r=0),n=0;r>n;++n)e.charCodeAt(n)>=128&&o("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;y>i;){for(a=g,s=1,c=j;i>=y&&o("invalid-input"),p=f(e.charCodeAt(i++)),(p>=j||p>F((O-g)/s))&&o("overflow"),g+=p*s,h=b>=c?w:c>=b+A?A:c-b,!(h>p);c+=j)d=j-h,s>F(O/d)&&o("overflow"),s*=d;t=m.length+1,b=l(g-a,t,0==a),F(g/t)>O-v&&o("overflow"),v+=F(g/t),g%=t,m.splice(g++,0,v)}return u(m)}function d(e){var t,r,n,i,a,s,u,f,h,d,m,y,g,v,b,E=[];for(e=c(e),y=e.length,t=S,r=0,a=P,s=0;y>s;++s)m=e[s],128>m&&E.push(U(m));for(n=i=E.length,i&&E.push(T);y>n;){for(u=O,s=0;y>s;++s)m=e[s],m>=t&&u>m&&(u=m);for(g=n+1,u-t>F((O-r)/g)&&o("overflow"),r+=(u-t)*g,t=u,s=0;y>s;++s)if(m=e[s],t>m&&++r>O&&o("overflow"),m==t){for(f=r,h=j;d=a>=h?w:h>=a+A?A:h-a,!(d>f);h+=j)b=f-d,v=j-d,E.push(U(p(d+b%v,0))),f=F(b/v);E.push(U(p(f,0))),a=l(r,g,n==i),r=0,++n}++r,++t}return E.join("")}function m(e){return s(e,function(e){return C.test(e)?h(e.slice(4).toLowerCase()):e})}function y(e){return s(e,function(e){return $.test(e)?"xn--"+d(e):e})}var g="object"==typeof n&&n&&!n.nodeType&&n,v="object"==typeof r&&r&&!r.nodeType&&r,b="object"==typeof t&&t;(b.global===b||b.window===b||b.self===b)&&(i=b);var E,x,O=2147483647,j=36,w=1,A=26,_=38,I=700,P=72,S=128,T="-",C=/^xn--/,$=/[^\x20-\x7E]/,D=/[\x2E\u3002\uFF0E\uFF61]/g,R={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=j-w,F=Math.floor,U=String.fromCharCode;if(E={version:"1.3.2",ucs2:{decode:c,encode:u},decode:h,encode:d,toASCII:y,toUnicode:m},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return E});else if(g&&v)if(r.exports==g)v.exports=E;else for(x in E)E.hasOwnProperty(x)&&(g[x]=E[x]);else i.punycode=E}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],178:[function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var f=0;u>f;++f){var p,l,h,d,m=e[f].replace(s,"%20"),y=m.indexOf(r);y>=0?(p=m.substr(0,y),l=m.substr(y+1)):(p=m,l=""),h=decodeURIComponent(p),d=decodeURIComponent(l),n(a,h)?i(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],179:[function(e,t,r){"use strict";function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;nn;)o=t.call(null,o,e[n],++n,e);return o}},{}],182:[function(e,t,r){"use strict";t.exports=function(e){var t=/^\\\\\?\\/.test(e),r=/[^\x00-\x80]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}},{}],183:[function(t,r,n){!function(t){if("object"==typeof n)r.exports=t();else if("function"==typeof e&&e.amd)e(t);else{var i;try{i=window}catch(o){i=self}i.SparkMD5=t()}}(function(e){"use strict";function t(e,t,r,n,i,o){return t=v(v(t,e),v(n,o)),v(t<>>32-i,r)}function r(e,r,n,i,o,a,s){return t(r&n|~r&i,e,r,o,a,s)}function n(e,r,n,i,o,a,s){return t(r&i|n&~i,e,r,o,a,s); -}function i(e,r,n,i,o,a,s){return t(r^n^i,e,r,o,a,s)}function o(e,r,n,i,o,a,s){return t(n^(r|~i),e,r,o,a,s)}function a(e,t){var a=e[0],s=e[1],c=e[2],u=e[3];a=r(a,s,c,u,t[0],7,-680876936),u=r(u,a,s,c,t[1],12,-389564586),c=r(c,u,a,s,t[2],17,606105819),s=r(s,c,u,a,t[3],22,-1044525330),a=r(a,s,c,u,t[4],7,-176418897),u=r(u,a,s,c,t[5],12,1200080426),c=r(c,u,a,s,t[6],17,-1473231341),s=r(s,c,u,a,t[7],22,-45705983),a=r(a,s,c,u,t[8],7,1770035416),u=r(u,a,s,c,t[9],12,-1958414417),c=r(c,u,a,s,t[10],17,-42063),s=r(s,c,u,a,t[11],22,-1990404162),a=r(a,s,c,u,t[12],7,1804603682),u=r(u,a,s,c,t[13],12,-40341101),c=r(c,u,a,s,t[14],17,-1502002290),s=r(s,c,u,a,t[15],22,1236535329),a=n(a,s,c,u,t[1],5,-165796510),u=n(u,a,s,c,t[6],9,-1069501632),c=n(c,u,a,s,t[11],14,643717713),s=n(s,c,u,a,t[0],20,-373897302),a=n(a,s,c,u,t[5],5,-701558691),u=n(u,a,s,c,t[10],9,38016083),c=n(c,u,a,s,t[15],14,-660478335),s=n(s,c,u,a,t[4],20,-405537848),a=n(a,s,c,u,t[9],5,568446438),u=n(u,a,s,c,t[14],9,-1019803690),c=n(c,u,a,s,t[3],14,-187363961),s=n(s,c,u,a,t[8],20,1163531501),a=n(a,s,c,u,t[13],5,-1444681467),u=n(u,a,s,c,t[2],9,-51403784),c=n(c,u,a,s,t[7],14,1735328473),s=n(s,c,u,a,t[12],20,-1926607734),a=i(a,s,c,u,t[5],4,-378558),u=i(u,a,s,c,t[8],11,-2022574463),c=i(c,u,a,s,t[11],16,1839030562),s=i(s,c,u,a,t[14],23,-35309556),a=i(a,s,c,u,t[1],4,-1530992060),u=i(u,a,s,c,t[4],11,1272893353),c=i(c,u,a,s,t[7],16,-155497632),s=i(s,c,u,a,t[10],23,-1094730640),a=i(a,s,c,u,t[13],4,681279174),u=i(u,a,s,c,t[0],11,-358537222),c=i(c,u,a,s,t[3],16,-722521979),s=i(s,c,u,a,t[6],23,76029189),a=i(a,s,c,u,t[9],4,-640364487),u=i(u,a,s,c,t[12],11,-421815835),c=i(c,u,a,s,t[15],16,530742520),s=i(s,c,u,a,t[2],23,-995338651),a=o(a,s,c,u,t[0],6,-198630844),u=o(u,a,s,c,t[7],10,1126891415),c=o(c,u,a,s,t[14],15,-1416354905),s=o(s,c,u,a,t[5],21,-57434055),a=o(a,s,c,u,t[12],6,1700485571),u=o(u,a,s,c,t[3],10,-1894986606),c=o(c,u,a,s,t[10],15,-1051523),s=o(s,c,u,a,t[1],21,-2054922799),a=o(a,s,c,u,t[8],6,1873313359),u=o(u,a,s,c,t[15],10,-30611744),c=o(c,u,a,s,t[6],15,-1560198380),s=o(s,c,u,a,t[13],21,1309151649),a=o(a,s,c,u,t[4],6,-145523070),u=o(u,a,s,c,t[11],10,-1120210379),c=o(c,u,a,s,t[2],15,718787259),s=o(s,c,u,a,t[9],21,-343485551),e[0]=v(a,e[0]),e[1]=v(s,e[1]),e[2]=v(c,e[2]),e[3]=v(u,e[3])}function s(e){var t,r=[];for(t=0;64>t;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function c(e){var t,r=[];for(t=0;64>t;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function u(e){var t,r,n,i,o,c,u=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;u>=t;t+=64)a(f,s(e.substring(t-64,t)));for(e=e.substring(t-64),r=e.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;r>t;t+=1)n[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55)for(a(f,n),t=0;16>t;t+=1)n[t]=0;return i=8*u,i=i.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(i[2],16),c=parseInt(i[1],16)||0,n[14]=o,n[15]=c,a(f,n),f}function f(e){var t,r,n,i,o,s,u=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;u>=t;t+=64)a(f,c(e.subarray(t-64,t)));for(e=u>t-64?e.subarray(t-64):new Uint8Array(0),r=e.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;r>t;t+=1)n[t>>2]|=e[t]<<(t%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55)for(a(f,n),t=0;16>t;t+=1)n[t]=0;return i=8*u,i=i.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(i[2],16),s=parseInt(i[1],16)||0,n[14]=o,n[15]=s,a(f,n),f}function p(e){var t,r="";for(t=0;4>t;t+=1)r+=b[e>>8*t+4&15]+b[e>>8*t&15];return r}function l(e){var t;for(t=0;tr;r++)o[r]=e.charCodeAt(r);return t?o:i}function m(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function y(e,t,r){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e)),n.set(new Uint8Array(t),e.byteLength),r?n:n.buffer}function g(){this.reset()}var v=function(e,t){return e+t&4294967295},b=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return"5d41402abc4b2a76b9719d911017c592"!==l(u("hello"))&&(v=function(e,t){var r=(65535&e)+(65535&t),n=(e>>16)+(t>>16)+(r>>16);return n<<16|65535&r}),g.prototype.append=function(e){return this.appendBinary(h(e)),this},g.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,r=this._buff.length;for(t=64;r>=t;t+=64)a(this._hash,s(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},g.prototype.end=function(e){var t,r,n=this._buff,i=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;i>t;t+=1)o[t>>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(o,i),r=e?this._hash:l(this._hash),this.reset(),r},g.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},g.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},g.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},g.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},g.prototype._finish=function(e,t){var r,n,i,o=t;if(e[o>>2]|=128<<(o%4<<3),o>55)for(a(this._hash,e),o=0;16>o;o+=1)e[o]=0;r=8*this._length,r=r.toString(16).match(/(.*?)(.{0,8})$/),n=parseInt(r[2],16),i=parseInt(r[1],16)||0,e[14]=n,e[15]=i,a(this._hash,e)},g.hash=function(e,t){return g.hashBinary(h(e),t)},g.hashBinary=function(e,t){var r=u(e);return t?r:l(r)},g.ArrayBuffer=function(){this.reset()},g.ArrayBuffer.prototype.append=function(e){var t,r=y(this._buff.buffer,e,!0),n=r.length;for(this._length+=e.byteLength,t=64;n>=t;t+=64)a(this._hash,c(r.subarray(t-64,t)));return this._buff=n>t-64?r.subarray(t-64):new Uint8Array(0),this},g.ArrayBuffer.prototype.end=function(e){var t,r,n=this._buff,i=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;i>t;t+=1)o[t>>2]|=n[t]<<(t%4<<3);return this._finish(o,i),r=e?this._hash:l(this._hash),this.reset(),r},g.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},g.ArrayBuffer.prototype.getState=function(){var e=g.prototype.getState.call(this);return e.buff=m(e.buff),e},g.ArrayBuffer.prototype.setState=function(e){return e.buff=d(e.buff,!0),g.prototype.setState.call(this,e)},g.ArrayBuffer.prototype.destroy=g.prototype.destroy,g.ArrayBuffer.prototype._finish=g.prototype._finish,g.ArrayBuffer.hash=function(e,t){var r=f(new Uint8Array(e));return t?r:l(r)},g})},{}],184:[function(e,t,r){function n(e,t){if("object"!=typeof e)throw new Error("resourceListing must be an object");Array.isArray(t)||(t=[]);var r={},n={},a={swagger:"2.0",info:i(e),paths:{}};return e.authorizations&&(a.securityDefinitions=l(e,r)),e.basePath&&o(e.basePath,a),m(n,e.models),Array.isArray(e.apis)&&(t.length>0&&(a.tags=[]),e.apis.forEach(function(t){a.tags&&a.tags.push({name:t.path.replace(".{format}","").substring(1),description:t.description}),Array.isArray(t.operations)&&(a.paths[t.path]=s(t,e))})),t.forEach(function(e){e.basePath&&o(e.basePath,a),Array.isArray(e.apis)&&(e.apis.forEach(function(t){a.paths[t.path]=s(t,e)}),e.models&&Object.keys(e.models).length&&m(n,d(e.models)))}),Object.keys(n).length&&(a.definitions=d(n)),a}function i(e){var t={version:e.apiVersion,title:"Title was not specified"};return"object"==typeof e.info&&(e.info.title&&(t.title=e.info.title),e.info.description&&(t.description=e.info.description),e.info.contact&&(t.contact={email:e.info.contact}),e.info.license&&(t.license={name:e.info.license,url:e.info.licenseUrl}),e.info.termsOfServiceUrl&&(t.termsOfService=e.info.termsOfServiceUrl)),t}function o(e,t){var r=g(e);t.host=r.host,t.basePath=r.path,r.protocol&&(t.schemes=[r.protocol.substr(0,r.protocol.length-1)])}function a(e,t){return e=v(e),e.$ref&&-1===e.$ref.indexOf("#/definitions/")?e.$ref="#/definitions/"+e.$ref:e.items&&e.items.$ref&&-1===e.items.$ref.indexOf("#/definitions/")&&(e.items.$ref="#/definitions/"+e.items.$ref),t&&e.type&&-1===b.indexOf(e.type)&&(e={$ref:"#/definitions/"+e.type}),e.minimum&&(e.minimum=y(e.minimum)),e.maximum&&(e.maximum=y(e.maximum)),e.defaultValue&&(e["default"]=e.defaultValue,delete e.defaultValue,e.type&&"string"!==e.type&&(e["default"]=y(e["default"]))),e}function s(e,t){var r={};return e.operations.forEach(function(e){var n=e.method.toLowerCase();r[n]=c(e,t.produces,t.consumes,t.resourcePath)}),r}function c(e,t,r,n){var i={responses:{},description:e.description||""};if(n&&(i.tags=[],i.tags.push(n.substr(1))),e.summary&&(i.summary=e.summary),e.nickname&&(i.operationId=e.nickname),t&&(i.produces=t),r&&(i.consumes=r),Array.isArray(e.parameters)&&e.parameters.length&&(i.parameters=e.parameters.map(function(e){return f(e)})),Array.isArray(e.responseMessages)&&e.responseMessages.forEach(function(e){i.responses[e.code]=u(e)}),(!Object.keys(i.responses).length||!i.responses[200]&&e.type)&&(i.responses[200]={description:"No response was specified"}),e.type&&"void"!==e.type){var o=p(e);-1===b.indexOf(e.type)&&(o={$ref:"#/definitions/"+e.type}),i.responses[200].schema=o}return i}function u(e){var t={};return t.description=e.message,t}function f(e){var t={"in":e.paramType,description:e.description,name:e.name,required:!!e.required};return-1===b.indexOf(e.type)?t.schema={$ref:"#/definitions/"+e.type}:"body"===e.paramType?t.schema=p(e):m(t,p(e)),"form"===t["in"]&&(t["in"]="formData"),t}function p(e){var t={},r=["default","maximum","minimum","items"];return e=a(e,!1),t.type=e.type.toLowerCase(),r.forEach(function(r){"undefined"!=typeof e[r]&&(t[r]=e[r])}),"undefined"!=typeof e.defaultValue&&(t["default"]=e.defaultValue),t}function l(e,t){var r={};return Object.keys(e.authorizations).forEach(function(n){var i=e.authorizations[n],o=function(e){var t=r[e||n]={type:i.type};return i.passAs&&(t["in"]=i.passAs),i.keyname&&(t.name=i.keyname),t};i.grantTypes?(t[n]=[],Object.keys(i.grantTypes).forEach(function(e){var r=i.grantTypes[e],a=n+"_"+e,s=o(a);switch(t[n].push(a),"implicit"===e?s.flow="implicit":s.flow="accessCode",e){case"implicit":s.authorizationUrl=r.loginEndpoint.url;break;case"authorization_code":s.authorizationUrl=r.tokenRequestEndpoint.url,s.tokenUrl=r.tokenEndpoint.url}i.scopes&&(s.scopes={},i.scopes.forEach(function(e){s.scopes[e.scope]=e.description||"Undescribed "+e.scope}))})):o()}),r}function h(e){"object"==typeof e.properties&&Object.keys(e.properties).forEach(function(t){e.properties[t]=a(e.properties[t],!0)})}function d(e){var t=v(e);if("object"!=typeof e)throw new Error("models must be object");var r={};return Object.keys(t).forEach(function(e){var n=t[e];delete n.id,h(n),n.subTypes&&(r[e]=n.subTypes,delete n.subTypes)}),Object.keys(r).forEach(function(e){r[e].forEach(function(r){var n=t[r];if(n){var i=(n.allOf||[]).concat({$ref:"#/definitions/"+e}).concat(v(n));for(var o in n)delete n[o];n.allOf=i}})}),t}function m(e,t){if("object"!=typeof e)throw new Error("source must be objects");"object"==typeof t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}function y(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){throw Error("incorect property value: "+t.message)}}var g=e("url").parse,v=e("lodash.clonedeep"),b=["string","number","boolean","integer","array","void","File"];"undefined"==typeof window?t.exports=n:window.SwaggerConverter=window.SwaggerConverter||{convert:n}},{"lodash.clonedeep":159,url:192}],185:[function(e,t,r){function n(e){this.value=e}function i(e,t,r){var n=[],i=[],a=!0;return function s(e){function c(){if("object"==typeof l.node&&null!==l.node){l.keys&&l.node_===l.node||(l.keys=d(l.node)),l.isLeaf=0==l.keys.length;for(var t=0;t1&&(i=n[0]+"@",e=n[1]),e=e.replace(w,".");var o=e.split("."),a=t(o,r).join(".");return i+a}function n(e){for(var t,r,n=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(r=e.charCodeAt(i++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--)):n.push(t);return n}function i(e){return t(e,function(e){var t="";return e>65535&&(e-=65536,t+=P(e>>>10&1023|55296),e=56320|1023&e),t+=P(e)}).join("")}function o(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:d}function a(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function s(e,t,r){var n=0;for(e=r?I(e/v):e>>1,e+=I(e/t);e>_*y>>1;n+=d)e=I(e/_);return I(n+(_+1)*e/(e+g))}function c(t){var r,n,a,c,u,f,p,l,g,v,O=[],j=t.length,w=0,A=E,_=b;for(n=t.lastIndexOf(x),0>n&&(n=0),a=0;n>a;++a)t.charCodeAt(a)>=128&&e("not-basic"),O.push(t.charCodeAt(a));for(c=n>0?n+1:0;j>c;){for(u=w,f=1,p=d;c>=j&&e("invalid-input"),l=o(t.charCodeAt(c++)),(l>=d||l>I((h-w)/f))&&e("overflow"),w+=l*f,g=_>=p?m:p>=_+y?y:p-_,!(g>l);p+=d)v=d-g,f>I(h/v)&&e("overflow"),f*=v;r=O.length+1,_=s(w-u,r,0==u),I(w/r)>h-A&&e("overflow"),A+=I(w/r),w%=r,O.splice(w++,0,A)}return i(O)}function u(t){var r,i,o,c,u,f,p,l,g,v,O,j,w,A,_,S=[];for(t=n(t),j=t.length,r=E,i=0,u=b,f=0;j>f;++f)O=t[f],128>O&&S.push(P(O));for(o=c=S.length,c&&S.push(x);j>o;){for(p=h,f=0;j>f;++f)O=t[f],O>=r&&p>O&&(p=O);for(w=o+1,p-r>I((h-i)/w)&&e("overflow"),i+=(p-r)*w,r=p,f=0;j>f;++f)if(O=t[f],r>O&&++i>h&&e("overflow"),O==r){for(l=i,g=d;v=u>=g?m:g>=u+y?y:g-u,!(v>l);g+=d)_=l-v,A=d-v,S.push(P(a(v+_%A,0))),l=I(_/A);S.push(P(a(l,0))),u=s(i,w,o==c),i=0,++o}++i,++r}return S.join("")}function f(e){return r(e,function(e){return O.test(e)?c(e.slice(4).toLowerCase()):e})}function p(e){return r(e,function(e){return j.test(e)?"xn--"+u(e):e})}var l,h=2147483647,d=36,m=1,y=26,g=38,v=700,b=72,E=128,x="-",O=/^xn--/,j=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=d-m,I=Math.floor,P=String.fromCharCode;return l={version:"1.3.2",ucs2:{decode:n,encode:i},decode:c,encode:u,toASCII:p,toUnicode:f}}();"undefined"==typeof COMPILED&&"undefined"!=typeof t&&(t.exports=n)},{}],187:[function(e,t,r){e("./schemes/http"),e("./schemes/urn"),e("./schemes/mailto")},{"./schemes/http":188,"./schemes/mailto":189,"./schemes/urn":190}],188:[function(e,t,r){if("undefined"==typeof COMPILED&&"undefined"==typeof n&&"function"==typeof e)var n=e("../uri");n.SCHEMES.http=n.SCHEMES.https={domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return(e.port===("https"!==String(e.scheme).toLowerCase()?80:443)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}}},{"../uri":191}],189:[function(e,t,r){if("undefined"==typeof COMPILED&&"undefined"==typeof n&&"function"==typeof e)var n=e("../uri"),i=e("../punycode");!function(){function e(){for(var e=[],t=0;t1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,n=1;r>n;++n)e[n]=e[n].slice(1,-1);return e[r]=e[r].slice(1),e.join("")}return e[0]}function t(e){return"(?:"+e+")"}function r(e){return e.toUpperCase()}function o(e){var t=n.pctDecChars(e);return t.match(C)?t:e}function a(e){return void 0!==e&&null!==e?e instanceof Array&&!e.callee?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}var s={},c=n.IRI_SUPPORT,u="[A-Za-z0-9\\-\\.\\_\\~"+(c?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",f="[0-9A-Fa-f]",p=t(t("%[EFef]"+f+"%"+f+f+"%"+f+f)+"|"+t("%[89A-Fa-f]"+f+"%"+f+f)+"|"+t("%"+f+f)),l="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",h="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",d=e(h,'[\\"\\\\]'),m=t(l+"+"+t("\\."+l+"+")+"*"),y=t("\\\\"+d),g=t(h+"|"+y),v=t('\\"'+g+'*\\"'),b="[\\x21-\\x5A\\x5E-\\x7E]",E="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",x=t(u+"|"+p+"|"+E),O=t(m+"|\\["+b+"*\\]"),j=t(m+"|"+v),w=t(j+"\\@"+O),A=t(w+t("\\,"+w)+"*"),_=t(x+"*"),I=_,P=t(_+"\\="+I),S=t(P+t("\\&"+P)+"*"),T=t("\\?"+S),C=(n.VALIDATE_SUPPORT&&new RegExp("^mailto\\:"+A+"?"+T+"?$"),new RegExp(u,"g")),$=new RegExp(p,"g"),D=new RegExp(e("[^]",l,"[\\.]",'[\\"]',d),"g"),R=new RegExp(e("[^]",l,"[\\.]","[\\[]",b,"[\\]]"),"g"),k=new RegExp(e("[^]",u,E),"g"),F=k,U=n.VALIDATE_SUPPORT&&new RegExp("^"+A+"$"),L=n.VALIDATE_SUPPORT&&new RegExp("^"+S+"$");n.SCHEMES.mailto={parse:function(e,t){n.VALIDATE_SUPPORT&&!e.error&&(e.path&&!U.test(e.path)?e.error="Email address is not valid":e.query&&!L.test(e.query)&&(e.error="Header fields are invalid"));var r=e.to=e.path?e.path.split(","):[];if(e.path=void 0,e.query){for(var o=!1,a={},s=e.query.split("&"),c=0,u=s.length;u>c;++c){var f=s[c].split("=");switch(f[0]){case"to":for(var p=f[1].split(","),l=0,h=p.length;h>l;++l)r.push(p[l]);break;case"subject":e.subject=n.unescapeComponent(f[1],t);break;case"body":e.body=n.unescapeComponent(f[1],t);break;default:o=!0,a[n.unescapeComponent(f[0],t)]=n.unescapeComponent(f[1],t)}}o&&(e.headers=a)}e.query=void 0;for(var c=0,u=r.length;u>c;++c){var d=r[c].split("@");if(d[0]=n.unescapeComponent(d[0]),"undefined"==typeof i||t.unicodeSupport)d[1]=n.unescapeComponent(d[1],t).toLowerCase();else try{d[1]=i.toASCII(n.unescapeComponent(d[1],t).toLowerCase())}catch(m){e.error=e.error||"Email address's domain name can not be converted to ASCII via punycode: "+m}r[c]=d.join("@")}return e},serialize:function(e,t){var c=a(e.to);if(c){for(var u=0,f=c.length;f>u;++u){var p=String(c[u]),l=p.lastIndexOf("@"),h=p.slice(0,l),d=p.slice(l+1);if(h=h.replace($,o).replace($,r).replace(D,n.pctEncChar),"undefined"!=typeof i)try{d=t.iri?i.toUnicode(d):i.toASCII(n.unescapeComponent(d,t).toLowerCase())}catch(m){e.error=e.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+m}else d=d.replace($,o).toLowerCase().replace($,r).replace(R,n.pctEncChar);c[u]=h+"@"+d}e.path=c.join(",")}var y=e.headers=e.headers||{};e.subject&&(y.subject=e.subject),e.body&&(y.body=e.body);var g=[];for(var v in y)y[v]!==s[v]&&g.push(v.replace($,o).replace($,r).replace(k,n.pctEncChar)+"="+y[v].replace($,o).replace($,r).replace(F,n.pctEncChar));return g.length&&(e.query=g.join("&")),e}}}()},{"../punycode":186,"../uri":191}],190:[function(e,t,r){if("undefined"==typeof COMPILED&&"undefined"==typeof n&&"function"==typeof e)var n=e("../uri");!function(){var e=n.pctEncChar,t="(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})",r="(?:\\%[0-9A-Fa-f]{2})",i="[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]",o="(?:(?:"+r+"|"+i+")+)",a=new RegExp("^urn\\:("+t+")$"),s=new RegExp("^("+t+")\\:("+o+")$"),c=/^([^\:]+)\:(.*)/,u=/[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g,f=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;n.SCHEMES.urn={parse:function(e,t){var r,i,o=e.path.match(s);return o||(t.tolerant||(e.error=e.error||"URN is not strictly valid."),o=e.path.match(c)),o?(r="urn:"+o[1].toLowerCase(),i=n.SCHEMES[r],i||(i=n.SCHEMES[r]={parse:function(e,t){return e},serialize:n.SCHEMES.urn.serialize}),e.scheme=r,e.path=o[2],e=i.parse(e,t)):e.error=e.error||"URN can not be parsed.",e},serialize:function(t,r){var n,i=t.scheme||r.scheme;if(i&&"urn"!==i){var n=i.match(a);n||(n=["urn:"+i,i]),t.scheme="urn",t.path=n[1]+":"+(t.path?t.path.replace(u,e):"")}return t}},n.SCHEMES["urn:uuid"]={parse:function(e,t){return t.tolerant||e.path&&e.path.match(f)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e,t){return t.tolerant||e.path&&e.path.match(f)?e.path=(e.path||"").toLowerCase():e.scheme=void 0,n.SCHEMES.urn.serialize(e,t)}}}()},{"../uri":191}],191:[function(e,t,r){var n=!1,i=!0,o=!0,a=function(){function e(){for(var e=[],t=0;t1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,n=1;r>n;++n)e[n]=e[n].slice(1,-1);return e[r]=e[r].slice(1),e.join("")}return e[0]}function t(e){return"(?:"+e+")"}function r(r){var n="[A-Za-z]",i="[0-9]",a=e(i,"[A-Fa-f]"),s=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),c="[\\:\\/\\?\\#\\[\\]\\@]",u="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",f=e(c,u),p=r?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",l=r?"[\\uE000-\\uF8FF]":"[]",h=e(n,i,"[\\-\\.\\_\\~]",p),d=t(n+e(n,i,"[\\+\\-\\.]")+"*"),m=t(t(s+"|"+e(h,u,"[\\:]"))+"*"),y=t(t("25[0-5]")+"|"+t("2[0-4]"+i)+"|"+t("1"+i+i)+"|"+t("[1-9]"+i)+"|"+i),g=t(y+"\\."+y+"\\."+y+"\\."+y),v=t(a+"{1,4}"),b=(t(t(v+"\\:"+v)+"|"+g),t(e(h,u,"[\\:]")+"+")),E=t("v"+a+"+\\."+e(h,u,"[\\:]")+"+"),x=t("\\["+t(b+"|"+E)+"\\]"),O=t(t(s+"|"+e(h,u))+"*"),j=t(x+"|"+g+"(?!"+O+")|"+O),w=t(i+"*"),A=t(t(m+"@")+"?"+j+t("\\:"+w)+"?"),_=t(s+"|"+e(h,u,"[\\:\\@]")),I=t(_+"*"),P=t(_+"+"),S=t(t(s+"|"+e(h,u,"[\\@]"))+"+"),T=t(t("\\/"+I)+"*"),C=t("\\/"+t(P+T)+"?"),$=t(S+T),D=t(P+T),R="(?!"+_+")",k=(t(T+"|"+C+"|"+$+"|"+D+"|"+R),t(t(_+"|"+e("[\\/\\?]",l))+"*")),F=t(t(_+"|[\\/\\?]")+"*"),U=t(t("\\/\\/"+A+T)+"|"+C+"|"+D+"|"+R),L=t(d+"\\:"+U+t("\\?"+k)+"?"+t("\\#"+F)+"?"),N=t(t("\\/\\/"+A+T)+"|"+C+"|"+$+"|"+R),M=t(N+t("\\?"+k)+"?"+t("\\#"+F)+"?"),q=(t(L+"|"+M),t(d+"\\:"+U+t("\\?"+k)+"?"),"^("+d+")\\:"+t(t("\\/\\/("+t("("+m+")@")+"?("+j+")"+t("\\:("+w+")")+"?)")+"?("+T+"|"+C+"|"+D+"|"+R+")")+t("\\?("+k+")")+"?"+t("\\#("+F+")")+"?$"),Y="^(){0}"+t(t("\\/\\/("+t("("+m+")@")+"?("+j+")"+t("\\:("+w+")")+"?)")+"?("+T+"|"+C+"|"+$+"|"+R+")")+t("\\?("+k+")")+"?"+t("\\#("+F+")")+"?$";"^("+d+")\\:"+t(t("\\/\\/("+t("("+m+")@")+"?("+j+")"+t("\\:("+w+")")+"?)")+"?("+T+"|"+C+"|"+D+"|"+R+")")+t("\\?("+k+")")+"?$","^"+t("\\#("+F+")")+"?$","^"+t("("+m+")@")+"?("+j+")"+t("\\:("+w+")")+"?$";return{URI_REF:o&&new RegExp("("+q+")|("+Y+")"),NOT_SCHEME:new RegExp(e("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",h,u),"g"),NOT_HOST:new RegExp(e("[^\\%]",h,u),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",h,u),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",h,u),"g"),NOT_QUERY:new RegExp(e("[^\\%]",h,u,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",h,u,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",h,u),"g"),UNRESERVED:new RegExp(h,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",h,f),"g"),PCT_ENCODED:new RegExp(s,"g")}}function n(e){var t,r=e.charCodeAt(0);return t=16>r?"%0"+r.toString(16).toUpperCase():128>r?"%"+r.toString(16).toUpperCase():2048>r?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function a(e){for(var t,r,n,i="",o=0,a=e.length;a>o;)t=parseInt(e.substr(o+1,2),16),128>t?(i+=String.fromCharCode(t),o+=3):t>=194&&224>t?(a-o>=6?(r=parseInt(e.substr(o+4,2),16),i+=String.fromCharCode((31&t)<<6|63&r)):i+=e.substr(o,6),o+=6):t>=224?(a-o>=9?(r=parseInt(e.substr(o+4,2),16),n=parseInt(e.substr(o+7,2),16),i+=String.fromCharCode((15&t)<<12|(63&r)<<6|63&n)):i+=e.substr(o,9),o+=9):(i+=e.substr(o,3),o+=3);return i}function c(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function u(e){return e.toUpperCase()}function f(e,t){function r(e){var r=a(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,n).replace(t.PCT_ENCODED,u)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,n).replace(t.PCT_ENCODED,u)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,n).replace(t.PCT_ENCODED,u)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,n).replace(t.PCT_ENCODED,u)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,n).replace(t.PCT_ENCODED,u)),e}function p(e,t){void 0===t&&(t={});var r,n,c=i&&t.iri!==!1?O:x,u=!1,p={};if("suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e),o?(r=e.match(c.URI_REF),r&&(r=r[1]?r.slice(1,10):r.slice(10,19)),r||(u=!0,t.tolerant||(p.error=p.error||"URI is not strictly valid."),r=e.match(j))):r=e.match(j),r){if(P?(p.scheme=r[1],p.userinfo=r[3],p.host=r[4],p.port=parseInt(r[5],10),p.path=r[6]||"",p.query=r[7],p.fragment=r[8],isNaN(p.port)&&(p.port=r[5])):(p.scheme=r[1]||void 0,p.userinfo=-1!==e.indexOf("@")?r[3]:void 0,p.host=-1!==e.indexOf("//")?r[4]:void 0,p.port=parseInt(r[5],10),p.path=r[6]||"",p.query=-1!==e.indexOf("?")?r[7]:void 0,p.fragment=-1!==e.indexOf("#")?r[8]:void 0,isNaN(p.port)&&(p.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?r[4]:void 0)),void 0!==p.scheme||void 0!==p.userinfo||void 0!==p.host||void 0!==p.port||p.path||void 0!==p.query?void 0===p.scheme?p.reference="relative":void 0===p.fragment?p.reference="absolute":p.reference="uri":p.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==p.reference&&(p.error=p.error||"URI is not a "+t.reference+" reference."),n=S[(t.scheme||p.scheme||"").toLowerCase()],!i||"undefined"==typeof s||t.unicodeSupport||n&&n.unicodeSupport)f(p,c);else{if(p.host&&(t.domainHost||n&&n.domainHost))try{p.host=s.toASCII(p.host.replace(c.PCT_ENCODED,a).toLowerCase())}catch(l){p.error=p.error||"Host's domain name can not be converted to ASCII via punycode: "+l}f(p,x)}n&&n.parse&&n.parse(p,t)}else u=!0,p.error=p.error||"URI can not be parsed.";return p}function l(e,t){var r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(e.host),"number"==typeof e.port&&(r.push(":"),r.push(e.port.toString(10))),r.length?r.join(""):void 0}function h(e){for(var t,r=[];e.length;)e.match(w)?e=e.replace(w,""):e.match(A)?e=e.replace(A,"/"):e.match(_)?(e=e.replace(_,"/"),r.pop()):"."===e||".."===e?e="":(t=e.match(I)[0],e=e.slice(t.length),r.push(t));return r.join("")}function d(e,t){void 0===t&&(t={});var r,n,o,c=i&&t.iri?O:x,u=[];if(r=S[(t.scheme||e.scheme||"").toLowerCase()],r&&r.serialize&&r.serialize(e,t),i&&"undefined"!=typeof s&&e.host&&(t.domainHost||r&&r.domainHost))try{e.host=t.iri?s.toUnicode(e.host):s.toASCII(e.host.replace(c.PCT_ENCODED,a).toLowerCase())}catch(p){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+p}return f(e,c),"suffix"!==t.reference&&e.scheme&&(u.push(e.scheme),u.push(":")),n=l(e,t),void 0!==n&&("suffix"!==t.reference&&u.push("//"),u.push(n),e.path&&"/"!==e.path.charAt(0)&&u.push("/")),void 0!==e.path&&(o=e.path,t.absolutePath||r&&r.absolutePath||(o=h(o)),void 0===n&&(o=o.replace(/^\/\//,"/%2F")),u.push(o)),void 0!==e.query&&(u.push("?"),u.push(e.query)),void 0!==e.fragment&&(u.push("#"),u.push(e.fragment)),u.join("")}function m(e,t,r,n){void 0===r&&(r={});var i={};return n||(e=p(d(e,r),r),t=p(d(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=h(t.path),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=h(t.path),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=h(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=h(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function y(e,t,r){return d(m(p(e,r),p(t,r),r,!0),r)}function g(e,t){return"string"==typeof e?e=d(p(e,t),t):"object"===c(e)&&(e=p(d(e,t),t)),e}function v(e,t,r){return"string"==typeof e?e=d(p(e,r),r):"object"===c(e)&&(e=d(e,r)),"string"==typeof t?t=d(p(t,r),r):"object"===c(t)&&(t=d(t,r)),e===t}function b(e,t){return e&&e.toString().replace(i&&t&&t.iri?O.ESCAPE:x.ESCAPE,n)}function E(e,t){return e&&e.toString().replace(i&&t&&t.iri?O.PCT_ENCODED:x.PCT_ENCODED,a)}var x=r(!1),O=i?r(!0):void 0,j=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i,w=/^\.\.?\//,A=/^\/\.(\/|$)/,_=/^\/\.\.(\/|$)/,I=/^\/?(?:.|\n)*?(?=\/|$)/,P=void 0==="".match(/(){0}/)[1],S={};return{IRI_SUPPORT:i,VALIDATE_SUPPORT:o,pctEncChar:n,pctDecChars:a,SCHEMES:S,parse:p,_recomposeAuthority:l,removeDotSegments:h,serialize:d, -resolveComponents:m,resolve:y,normalize:g,equal:v,escapeComponent:b,unescapeComponent:E}}();if(!n&&"undefined"!=typeof t&&"function"==typeof e){var s=e("./punycode");t.exports=a,e("./schemes")}},{"./punycode":186,"./schemes":187}],192:[function(e,t,r){function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,r){if(e&&u(e)&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}function o(e){return c(e)&&(e=i(e)),e instanceof n?e.format():n.prototype.format.call(e)}function a(e,t){return i(e,!1,!0).resolve(t)}function s(e,t){return e?i(e,!1,!0).resolveObject(t):t}function c(e){return"string"==typeof e}function u(e){return"object"==typeof e&&null!==e}function f(e){return null===e}function p(e){return null==e}var l=e("punycode");r.parse=i,r.resolve=a,r.resolveObject=s,r.format=o,r.Url=n;var h=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,m=["<",">",'"',"`"," ","\r","\n"," "],y=["{","}","|","\\","^","`"].concat(m),g=["'"].concat(y),v=["%","/","?",";","#"].concat(g),b=["/","?","#"],E=255,x=/^[a-z0-9A-Z_-]{0,63}$/,O=/^([a-z0-9A-Z_-]{0,63})(.*)$/,j={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},A={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=e("querystring");n.prototype.parse=function(e,t,r){if(!c(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e;n=n.trim();var i=h.exec(n);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,n=n.substr(i.length)}if(r||i||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var a="//"===n.substr(0,2);!a||i&&w[i]||(n=n.substr(2),this.slashes=!0)}if(!w[i]&&(a||i&&!A[i])){for(var s=-1,u=0;uf)&&(s=f)}var p,d;d=-1===s?n.lastIndexOf("@"):n.lastIndexOf("@",s),-1!==d&&(p=n.slice(0,d),n=n.slice(d+1),this.auth=decodeURIComponent(p)),s=-1;for(var u=0;uf)&&(s=f)}-1===s&&(s=n.length),this.host=n.slice(0,s),n=n.slice(s),this.parseHost(),this.hostname=this.hostname||"";var m="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!m)for(var y=this.hostname.split(/\./),u=0,I=y.length;I>u;u++){var P=y[u];if(P&&!P.match(x)){for(var S="",T=0,C=P.length;C>T;T++)S+=P.charCodeAt(T)>127?"x":P[T];if(!S.match(x)){var $=y.slice(0,u),D=y.slice(u+1),R=P.match(O);R&&($.push(R[1]),D.unshift(R[2])),D.length&&(n="/"+D.join(".")+n),this.hostname=$.join(".");break}}}if(this.hostname.length>E?this.hostname="":this.hostname=this.hostname.toLowerCase(),!m){for(var k=this.hostname.split("."),F=[],u=0;uu;u++){var M=g[u],q=encodeURIComponent(M);q===M&&(q=escape(M)),n=n.split(M).join(q)}var Y=n.indexOf("#");-1!==Y&&(this.hash=n.substr(Y),n=n.slice(0,Y));var B=n.indexOf("?");if(-1!==B?(this.search=n.substr(B),this.query=n.substr(B+1),t&&(this.query=_.parse(this.query)),n=n.slice(0,B)):t&&(this.search="",this.query={}),n&&(this.pathname=n),A[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var L=this.pathname||"",U=this.search||"";this.path=L+U}return this.href=this.format(),this},n.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=_.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||A[t])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),a=a.replace("#","%23"),t+i+r+a+n},n.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},n.prototype.resolveObject=function(e){if(c(e)){var t=new n;t.parse(e,!1,!0),e=t}var r=new n;if(Object.keys(this).forEach(function(e){r[e]=this[e]},this),r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(r[t]=e[t])}),A[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(e.protocol&&e.protocol!==r.protocol){if(!A[e.protocol])return Object.keys(e).forEach(function(t){r[t]=e[t]}),r.href=r.format(),r;if(r.protocol=e.protocol,e.host||w[e.protocol])r.pathname=e.pathname;else{for(var i=(e.pathname||"").split("/");i.length&&!(e.host=i.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),r.pathname=i.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var o=r.pathname||"",a=r.search||"";r.path=o+a}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var s=r.pathname&&"/"===r.pathname.charAt(0),u=e.host||e.pathname&&"/"===e.pathname.charAt(0),l=u||s||r.host&&e.pathname,h=l,d=r.pathname&&r.pathname.split("/")||[],i=e.pathname&&e.pathname.split("/")||[],m=r.protocol&&!A[r.protocol];if(m&&(r.hostname="",r.port=null,r.host&&(""===d[0]?d[0]=r.host:d.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===i[0]?i[0]=e.host:i.unshift(e.host)),e.host=null),l=l&&(""===i[0]||""===d[0])),u)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,d=i;else if(i.length)d||(d=[]),d.pop(),d=d.concat(i),r.search=e.search,r.query=e.query;else if(!p(e.search)){if(m){r.hostname=r.host=d.shift();var y=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;y&&(r.auth=y.shift(),r.host=r.hostname=y.shift())}return r.search=e.search,r.query=e.query,f(r.pathname)&&f(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!d.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var g=d.slice(-1)[0],v=(r.host||e.host)&&("."===g||".."===g)||""===g,b=0,E=d.length;E>=0;E--)g=d[E],"."==g?d.splice(E,1):".."===g?(d.splice(E,1),b++):b&&(d.splice(E,1),b--);if(!l&&!h)for(;b--;b)d.unshift("..");!l||""===d[0]||d[0]&&"/"===d[0].charAt(0)||d.unshift(""),v&&"/"!==d.join("/").substr(-1)&&d.push("");var x=""===d[0]||d[0]&&"/"===d[0].charAt(0);if(m){r.hostname=r.host=x?"":d.length?d.shift():"";var y=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;y&&(r.auth=y.shift(),r.host=r.hostname=y.shift())}return l=l||r.host&&d.length,l&&!x&&d.unshift(""),d.length?r.pathname=d.join("/"):(r.pathname=null,r.path=null),f(r.pathname)&&f(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=d.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:177,querystring:180}],193:[function(t,r,n){!function(t,i){"undefined"!=typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof e&&"object"==typeof e.amd?e(i):"function"==typeof e&&"object"==typeof e.petal?e(t,[],i):this[t]=i()}("validator",function(e){"use strict";function t(e){var t,r,n,i,o=e.match($);if(o){if(t=o[21],!t)return o[12]?null:0;if("z"===t||"Z"===t)return 0;r=o[22],-1!==t.indexOf(":")?(n=parseInt(o[23]),i=parseInt(o[24])):(n=0,i=parseInt(o[23]))}else{if(e=e.toLowerCase(),t=e.match(/(?:\s|gmt\s*)(-|\+)(\d{1,4})(\s|$)/),!t)return-1!==e.indexOf("gmt")?0:null;r=t[1];var a=t[2];3===a.length&&(a="0"+a),a.length<=2?(n=0,i=parseInt(a)):(n=parseInt(a.slice(0,2)),i=parseInt(a.slice(2,4)))}return(60*n+i)*("-"===r?1:-1)}function r(e,t){e=e||{};for(var r in t)"undefined"==typeof e[r]&&(e[r]=t[r]);return e}function n(e){var t="(\\"+e.symbol.replace(/\./g,"\\.")+")"+(e.require_symbol?"":"?"),r="-?",n="[1-9]\\d*",i="[1-9]\\d{0,2}(\\"+e.thousands_separator+"\\d{3})*",o=["0",n,i],a="("+o.join("|")+")?",s="(\\"+e.decimal_separator+"\\d{2})?",c=a+s;return e.allow_negatives&&!e.parens_for_negatives&&(e.negative_sign_after_digits?c+=r:e.negative_sign_before_digits&&(c=r+c)),e.allow_negative_sign_placeholder?c="( (?!\\-))?"+c:e.allow_space_after_symbol?c=" ?"+c:e.allow_space_after_digits&&(c+="( (?!$))?"),e.symbol_after_digits?c+=t:c=t+c,e.allow_negatives&&(e.parens_for_negatives?c="(\\("+c+"\\)|"+c+")":e.negative_sign_before_digits||e.negative_sign_after_digits||(c=r+c)),new RegExp("^(?!-? )(?=.*\\d)"+c+"$")}e={version:"4.5.2"};var i=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,o=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,a=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,s=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,c=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\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9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/,S=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,T=/^(?:[A-Z0-9+\/]{4})*(?:[A-Z0-9+\/]{2}==|[A-Z0-9+\/]{3}=|[A-Z0-9+\/]{4})$/i,C={"zh-CN":/^(\+?0?86\-?)?((13\d|14[57]|15[^4,\D]|17[678]|18\d)\d{8}|170[059]\d{7})$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-HK":/^(\+?852\-?)?[569]\d{3}\-?\d{4}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"pt-PT":/^(\+351)?9[1236]\d{7}$/,"el-GR":/^(\+?30)?(69\d{8})$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-US":/^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,"en-ZM":/^(\+26)?09[567]\d{7}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"vi-VN":/^(0|\+?84)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,"en-NZ":/^(\+?64|0)2\d{7,9}$/,"en-IN":/^(\+?91|0)?[789]\d{9}$/},$=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;e.extend=function(t,r){e[t]=function(){var t=Array.prototype.slice.call(arguments);return t[0]=e.toString(t[0]),r.apply(e,t)}},e.init=function(){for(var t in e)"function"==typeof e[t]&&"toString"!==t&&"toDate"!==t&&"extend"!==t&&"init"!==t&&e.extend(t,e[t])},e.toString=function(e){return"object"==typeof e&&null!==e&&e.toString?e=e.toString():(null===e||"undefined"==typeof e||isNaN(e)&&!e.length)&&(e=""),""+e},e.toDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)?e:(e=Date.parse(e),isNaN(e)?null:new Date(e))},e.toFloat=function(e){return parseFloat(e)},e.toInt=function(e,t){return parseInt(e,t||10)},e.toBoolean=function(e,t){return t?"1"===e||"true"===e:"0"!==e&&"false"!==e&&""!==e},e.equals=function(t,r){return t===e.toString(r)},e.contains=function(t,r){return t.indexOf(e.toString(r))>=0},e.matches=function(e,t,r){return"[object RegExp]"!==Object.prototype.toString.call(t)&&(t=new RegExp(t,r)),t.test(e)};var D={allow_display_name:!1,allow_utf8_local_part:!0,require_tld:!0};e.isEmail=function(t,n){if(n=r(n,D),n.allow_display_name){var u=t.match(c);u&&(t=u[1])}var f=t.split("@"),p=f.pop(),l=f.join("@"),h=p.toLowerCase();if(("gmail.com"===h||"googlemail.com"===h)&&(l=l.replace(/\./g,"").toLowerCase()),!e.isByteLength(l,{max:64})||!e.isByteLength(p,{max:256}))return!1;if(!e.isFQDN(p,{require_tld:n.require_tld}))return!1;if('"'===l[0])return l=l.slice(1,l.length-1),n.allow_utf8_local_part?s.test(l):o.test(l);for(var d=n.allow_utf8_local_part?a:i,m=l.split("."),y=0;y=2083||/\s/.test(t))return!1;if(0===t.indexOf("mailto:"))return!1;n=r(n,R);var i,o,a,s,c,u,f;if(f=t.split("://"),f.length>1){if(i=f.shift(),n.require_valid_protocol&&-1===n.protocols.indexOf(i))return!1}else{if(n.require_protocol)return!1;n.allow_protocol_relative_urls&&"//"===t.substr(0,2)&&(f[0]=t.substr(2))}return t=f.join("://"),f=t.split("#"),t=f.shift(),f=t.split("?"),t=f.shift(),f=t.split("/"),t=f.shift(),f=t.split("@"),f.length>1&&(o=f.shift(),o.indexOf(":")>=0&&o.split(":").length>2)?!1:(s=f.join("@"),f=s.split(":"),a=f.shift(),f.length&&(u=f.join(":"),c=parseInt(u,10),!/^[0-9]+$/.test(u)||0>=c||c>65535)?!1:e.isIP(a)||e.isFQDN(a,n)||"localhost"===a?n.host_whitelist&&-1===n.host_whitelist.indexOf(a)?!1:n.host_blacklist&&-1!==n.host_blacklist.indexOf(a)?!1:!0:!1)},e.isMACAddress=function(e){return h.test(e)},e.isIP=function(t,r){if(r=e.toString(r),!r)return e.isIP(t,4)||e.isIP(t,6);if("4"===r){if(!d.test(t))return!1;var n=t.split(".").sort(function(e,t){return e-t});return n[3]<=255}if("6"===r){var i=t.split(":"),o=!1,a=e.isIP(i[i.length-1],4),s=a?7:8;if(i.length>s)return!1;if("::"===t)return!0;"::"===t.substr(0,2)?(i.shift(),i.shift(),o=!0):"::"===t.substr(t.length-2)&&(i.pop(),i.pop(),o=!0);for(var c=0;c0&&c=1:i.length===s}return!1};var k={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1};e.isFQDN=function(e,t){t=r(t,k),t.allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));var n=e.split(".");if(t.require_tld){var i=n.pop();if(!n.length||!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(i))return!1}for(var o,a=0;a=0)return!1;o=o.replace(/_/g,"")}if(!/^[a-z\u00a1-\uffff0-9-]+$/i.test(o))return!1;if(/[\uff01-\uff5e]/.test(o))return!1;if("-"===o[0]||"-"===o[o.length-1])return!1;if(o.indexOf("---")>=0&&"xn--"!==o.slice(0,4))return!1}return!0},e.isBoolean=function(e){return["true","false","1","0"].indexOf(e)>=0},e.isAlpha=function(e){return g.test(e)},e.isAlphanumeric=function(e){return v.test(e)},e.isNumeric=function(e){return b.test(e)},e.isDecimal=function(e){return""!==e&&j.test(e)},e.isHexadecimal=function(e){return O.test(e)},e.isHexColor=function(e){return w.test(e)},e.isLowercase=function(e){return e===e.toLowerCase()},e.isUppercase=function(e){return e===e.toUpperCase()},e.isInt=function(e,t){return t=t||{},E.test(e)&&(!t.hasOwnProperty("min")||e>=t.min)&&(!t.hasOwnProperty("max")||e<=t.max)},e.isFloat=function(e,t){return t=t||{},""===e||"."===e?!1:x.test(e)&&(!t.hasOwnProperty("min")||e>=t.min)&&(!t.hasOwnProperty("max")||e<=t.max)},e.isDivisibleBy=function(t,r){return e.toFloat(t)%e.toInt(r)===0},e.isNull=function(e){return 0===e.length},e.isLength=function(e,t){var r,n;"object"==typeof t?(r=t.min||0,n=t.max):(r=arguments[1],n=arguments[2]);var i=e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],o=e.length-i.length;return o>=r&&("undefined"==typeof n||n>=o)},e.isByteLength=function(e,t){var r,n;"object"==typeof t?(r=t.min||0,n=t.max):(r=arguments[1],n=arguments[2]);var i=encodeURI(e).split(/%..|./).length-1;return i>=r&&("undefined"==typeof n||n>=i)},e.isUUID=function(e,t){var r=y[t?t:"all"];return r&&r.test(e)},e.isDate=function(e){var r=new Date(Date.parse(e));if(isNaN(r))return!1;var n=t(e);if(null!==n){var i=r.getTimezoneOffset()-n;r=new Date(r.getTime()+6e4*i)}var o,a,s,c=String(r.getDate());return(a=e.match(/(^|[^:\d])[23]\d([^:\d]|$)/g))?(o=a.map(function(e){return e.match(/\d+/g)[0]}).join("/"),s=String(r.getFullYear()).slice(-2),o===c||o===s?!0:o===c+"/"+s||o===s+"/"+c?!0:!1):!0},e.isAfter=function(t,r){var n=e.toDate(r||new Date),i=e.toDate(t);return!!(i&&n&&i>n)},e.isBefore=function(t,r){var n=e.toDate(r||new Date),i=e.toDate(t);return!!(i&&n&&n>i)},e.isIn=function(t,r){var n;if("[object Array]"===Object.prototype.toString.call(r)){var i=[];for(n in r)i[n]=e.toString(r[n]);return i.indexOf(t)>=0}return"object"==typeof r?r.hasOwnProperty(t):r&&"function"==typeof r.indexOf?r.indexOf(t)>=0:!1},e.isWhitelisted=function(e,t){for(var r=e.length-1;r>=0;r--)if(-1===t.indexOf(e[r]))return!1;return!0},e.isCreditCard=function(e){var t=e.replace(/[^0-9]+/g,"");if(!u.test(t))return!1;for(var r,n,i,o=0,a=t.length-1;a>=0;a--)r=t.substring(a,a+1),n=parseInt(r,10),i?(n*=2,o+=n>=10?n%10+1:n):o+=n,i=!i;return!!(o%10===0?t:!1)},e.isISIN=function(e){if(!f.test(e))return!1;for(var t,r,n=e.replace(/[A-Z]/g,function(e){return parseInt(e,36)}),i=0,o=!0,a=n.length-2;a>=0;a--)t=n.substring(a,a+1),r=parseInt(t,10),o?(r*=2,i+=r>=10?r+1:r):i+=r,o=!o;return parseInt(e.substr(e.length-1),10)===(1e4-i)%10},e.isISBN=function(t,r){if(r=e.toString(r),!r)return e.isISBN(t,10)||e.isISBN(t,13);var n,i=t.replace(/[\s-]+/g,""),o=0;if("10"===r){if(!p.test(i))return!1;for(n=0;9>n;n++)o+=(n+1)*i.charAt(n);if(o+="X"===i.charAt(9)?100:10*i.charAt(9),o%11===0)return!!i}else if("13"===r){if(!l.test(i))return!1;var a=[1,3];for(n=0;12>n;n++)o+=a[n%2]*i.charAt(n);if(i.charAt(12)-(10-o%10)%10===0)return!!i}return!1},e.isMobilePhone=function(e,t){return t in C?C[t].test(e):!1};var F={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_space_after_digits:!1};e.isCurrency=function(e,t){return t=r(t,F),n(t).test(e)},e.isJSON=function(e){try{var t=JSON.parse(e);return!!t&&"object"==typeof t}catch(r){}return!1},e.isMultibyte=function(e){return _.test(e)},e.isAscii=function(e){return A.test(e)},e.isFullWidth=function(e){return I.test(e)},e.isHalfWidth=function(e){return P.test(e)},e.isVariableWidth=function(e){return I.test(e)&&P.test(e)},e.isSurrogatePair=function(e){return S.test(e)},e.isBase64=function(e){return T.test(e)},e.isMongoId=function(t){return e.isHexadecimal(t)&&24===t.length},e.isISO8601=function(e){return $.test(e)},e.ltrim=function(e,t){var r=t?new RegExp("^["+t+"]+","g"):/^\s+/g;return e.replace(r,"")},e.rtrim=function(e,t){var r=t?new RegExp("["+t+"]+$","g"):/\s+$/g;return e.replace(r,"")},e.trim=function(e,t){var r=t?new RegExp("^["+t+"]+|["+t+"]+$","g"):/^\s+|\s+$/g;return e.replace(r,"")},e.escape=function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\//g,"/").replace(/\`/g,"`")},e.stripLow=function(t,r){var n=r?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return e.blacklist(t,n)},e.whitelist=function(e,t){return e.replace(new RegExp("[^"+t+"]+","g"),"")},e.blacklist=function(e,t){return e.replace(new RegExp("["+t+"]+","g"),"")};var U={lowercase:!0,remove_dots:!0,remove_extension:!0};return e.normalizeEmail=function(t,n){if(n=r(n,U),!e.isEmail(t))return!1;var i=t.split("@",2);if(i[1]=i[1].toLowerCase(),"gmail.com"===i[1]||"googlemail.com"===i[1]){if(n.remove_extension&&(i[0]=i[0].split("+")[0]),n.remove_dots&&(i[0]=i[0].replace(/\./g,"")),!i[0].length)return!1;i[0]=i[0].toLowerCase(),i[1]="gmail.com"}else n.lowercase&&(i[0]=i[0].toLowerCase());return i.join("@")},e.init(),e})},{}],194:[function(e,t,r){"use strict";t.exports={INVALID_TYPE:"Expected type {0} but found type {1}",INVALID_FORMAT:"Object didn't pass validation for format {0}: {1}",ENUM_MISMATCH:"No enum match for: {0}",ANY_OF_MISSING:"Data does not match any schemas from 'anyOf'",ONE_OF_MISSING:"Data does not match any schemas from 'oneOf'",ONE_OF_MULTIPLE:"Data is valid against more than one schema from 'oneOf'",NOT_PASSED:"Data matches schema from 'not'",ARRAY_LENGTH_SHORT:"Array is too short ({0}), minimum {1}",ARRAY_LENGTH_LONG:"Array is too long ({0}), maximum {1}",ARRAY_UNIQUE:"Array items are not unique (indexes {0} and {1})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",MULTIPLE_OF:"Value {0} is not a multiple of {1}",MINIMUM:"Value {0} is less than minimum {1}",MINIMUM_EXCLUSIVE:"Value {0} is equal or less than exclusive minimum {1}",MAXIMUM:"Value {0} is greater than maximum {1}",MAXIMUM_EXCLUSIVE:"Value {0} is equal or greater than exclusive maximum {1}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({0}), minimum {1}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({0}), maximum {1}",OBJECT_MISSING_REQUIRED_PROPERTY:"Missing required property: {0}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed: {0}",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {0} (due to key: {1})",MIN_LENGTH:"String is too short ({0} chars), minimum {1}",MAX_LENGTH:"String is too long ({0} chars), maximum {1}",PATTERN:"String does not match pattern {0}: {1}",KEYWORD_TYPE_EXPECTED:"Keyword '{0}' is expected to be of type '{1}'",KEYWORD_UNDEFINED_STRICT:"Keyword '{0}' must be defined in strict mode",KEYWORD_UNEXPECTED:"Keyword '{0}' is not expected to appear in the schema",KEYWORD_MUST_BE:"Keyword '{0}' must be {1}",KEYWORD_DEPENDENCY:"Keyword '{0}' requires keyword '{1}'",KEYWORD_PATTERN:"Keyword '{0}' is not a valid RegExp pattern: {1}",KEYWORD_VALUE_TYPE:"Each element of keyword '{0}' array must be a '{1}'",UNKNOWN_FORMAT:"There is no validation function for format '{0}'",CUSTOM_MODE_FORCE_PROPERTIES:"{0} must define at least one property if present",REF_UNRESOLVED:"Reference has not been resolved during compilation: {0}",UNRESOLVABLE_REFERENCE:"Reference could not be resolved: {0}",SCHEMA_NOT_REACHABLE:"Validator was not able to read schema with uri: {0}",SCHEMA_TYPE_EXPECTED:"Schema is expected to be of type 'object'",SCHEMA_NOT_AN_OBJECT:"Schema is not an object: {0}",ASYNC_TIMEOUT:"{0} asynchronous task(s) have timed out after {1} ms",PARENT_SCHEMA_VALIDATION_FAILED:"Schema failed to validate against its parent schema, see inner errors for details.",REMOTE_NOT_VALID:"Remote reference didn't compile successfully: {0}"}},{}],195:[function(e,t,r){var n=e("validator"),i={date:function(e){if("string"!=typeof e)return!0;var t=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.exec(e);return null===t?!1:t[2]<"01"||t[2]>"12"||t[3]<"01"||t[3]>"31"?!1:!0},"date-time":function(e){if("string"!=typeof e)return!0;var t=e.toLowerCase().split("t");if(!i.date(t[0]))return!1;var r=/^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$/.exec(t[1]);return null===r?!1:r[1]>"23"||r[2]>"59"||r[3]>"59"?!1:!0},email:function(e){return"string"!=typeof e?!0:n.isEmail(e,{require_tld:!0})},hostname:function(e){if("string"!=typeof e)return!0;var t=/^[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?(\.[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?)*$/.test(e);if(t){if(e.length>255)return!1;for(var r=e.split("."),n=0;n63)return!1}return t},"host-name":function(e){return i.hostname.call(this,e)},ipv4:function(e){return"string"!=typeof e?!0:n.isIP(e,4)},ipv6:function(e){return"string"!=typeof e?!0:n.isIP(e,6)},regex:function(e){try{return RegExp(e),!0}catch(t){return!1}},uri:function(e){return this.options.strictUris?i["strict-uri"].apply(this,arguments):"string"!=typeof e||RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?").test(e)},"strict-uri":function(e){return"string"!=typeof e||n.isURL(e)}};t.exports=i},{validator:193}],196:[function(e,t,r){"use strict";var n=e("./FormatValidators"),i=e("./Report"),o=e("./Utils"),a={multipleOf:function(e,t,r){"number"==typeof r&&"integer"!==o.whatIs(r/t.multipleOf)&&e.addError("MULTIPLE_OF",[r,t.multipleOf],null,t.description)},maximum:function(e,t,r){"number"==typeof r&&(t.exclusiveMaximum!==!0?r>t.maximum&&e.addError("MAXIMUM",[r,t.maximum],null,t.description):r>=t.maximum&&e.addError("MAXIMUM_EXCLUSIVE",[r,t.maximum],null,t.description))},exclusiveMaximum:function(){},minimum:function(e,t,r){"number"==typeof r&&(t.exclusiveMinimum!==!0?rt.maxLength&&e.addError("MAX_LENGTH",[r.length,t.maxLength],null,t.description)},minLength:function(e,t,r){"string"==typeof r&&o.ucs2decode(r).lengtht.items.length&&e.addError("ARRAY_ADDITIONAL_ITEMS",null,null,t.description)},items:function(){},maxItems:function(e,t,r){Array.isArray(r)&&r.length>t.maxItems&&e.addError("ARRAY_LENGTH_LONG",[r.length,t.maxItems],null,t.description)},minItems:function(e,t,r){Array.isArray(r)&&r.lengtht.maxProperties&&e.addError("OBJECT_PROPERTIES_MAXIMUM",[n,t.maxProperties],null,t.description)}},minProperties:function(e,t,r){if("object"===o.whatIs(r)){var n=Object.keys(r).length;n0){var l=this.options.assumeAdditional.length;if(l)for(;l--;){var h=a.indexOf(this.options.assumeAdditional[l]);-1!==h&&a.splice(h,1)}a.length>0&&e.addError("OBJECT_ADDITIONAL_PROPERTIES",[a],null,t.description)}}}},dependencies:function(e,t,n){if("object"===o.whatIs(n))for(var i=Object.keys(t.dependencies),a=i.length;a--;){var s=i[a];if(n[s]){var c=t.dependencies[s];if("object"===o.whatIs(c))r.validate.call(this,e,c,n);else for(var u=c.length;u--;){var f=c[u];void 0===n[f]&&e.addError("OBJECT_DEPENDENCY_KEY",[f,s],null,t.description)}}}},"enum":function(e,t,r){for(var n=!1,i=t["enum"].length;i--;)if(o.areEqual(r,t["enum"][i])){n=!0;break}n===!1&&e.addError("ENUM_MISMATCH",[r],null,t.description)},allOf:function(e,t,n){for(var i=t.allOf.length;i--;){var o=r.validate.call(this,e,t.allOf[i],n);if(this.options.breakOnFirstError&&o===!1)break}},anyOf:function(e,t,n){for(var o=[],a=!1,s=t.anyOf.length;s--&&a===!1;){var c=new i(e);o.push(c),a=r.validate.call(this,c,t.anyOf[s],n)}a===!1&&e.addError("ANY_OF_MISSING",void 0,o,t.description)},oneOf:function(e,t,n){for(var o=0,a=[],s=t.oneOf.length;s--;){var c=new i(e,{maxErrors:1});a.push(c),r.validate.call(this,c,t.oneOf[s],n)===!0&&o++}0===o?e.addError("ONE_OF_MISSING",void 0,a,t.description):o>1&&e.addError("ONE_OF_MULTIPLE",null,null,t.description)},not:function(e,t,n){var o=new i(e);r.validate.call(this,o,t.not,n)===!0&&e.addError("NOT_PASSED",null,null,t.description)},definitions:function(){},format:function(e,t,r){var i=n[t.format];"function"==typeof i?2===i.length?e.addAsyncTask(i,[r],function(n){n!==!0&&e.addError("INVALID_FORMAT",[t.format,r],null,t.description)}):i.call(this,r)!==!0&&e.addError("INVALID_FORMAT",[t.format,r],null,t.description):this.options.ignoreUnknownFormats!==!0&&e.addError("UNKNOWN_FORMAT",[t.format],null,t.description)}},s=function(e,t,n){var i=n.length;if(Array.isArray(t.items))for(;i--;)i0;){if(!t.__$refResolved){e.addError("REF_UNRESOLVED",[t.$ref],null,t.description);break}if(t.__$refResolved===t)break;t=t.__$refResolved,i=Object.keys(t),f--}if(0===f)throw new Error("Circular dependency by $ref references!")}var p=o.whatIs(r);if(t.type)if("string"==typeof t.type){if(p!==t.type&&("integer"!==p||"number"!==t.type)&&(e.addError("INVALID_TYPE",[t.type,p],null,t.description),this.options.breakOnFirstError))return!1}else if(-1===t.type.indexOf(p)&&("integer"!==p||-1===t.type.indexOf("number"))&&(e.addError("INVALID_TYPE",[t.type,p],null,t.description),this.options.breakOnFirstError))return!1;for(var l=i.length;l--&&!(a[i[l]]&&(a[i[l]].call(this,e,t,r),e.errors.length&&this.options.breakOnFirstError)););return(0===e.errors.length||this.options.breakOnFirstError===!1)&&("array"===p?s.call(this,e,t,r):"object"===p&&c.call(this,e,t,r)),u&&(e.rootSchema=void 0),0===e.errors.length}},{"./FormatValidators":195,"./Report":198,"./Utils":202}],197:[function(e,t,r){"function"!=typeof Number.isFinite&&(Number.isFinite=function(e){return"number"!=typeof e?!1:e!==e||e===1/0||e===-(1/0)?!1:!0})},{}],198:[function(e,t,r){(function(r){"use strict";function n(e,t){this.parentReport=e instanceof n?e:void 0,this.options=e instanceof n?e.options:e||{}, -this.reportOptions=t||{},this.errors=[],this.path=[],this.asyncTasks=[]}var i=e("lodash.get"),o=e("./Errors"),a=e("./Utils");n.prototype.isValid=function(){if(this.asyncTasks.length>0)throw new Error("Async tasks pending, can't answer isValid");return 0===this.errors.length},n.prototype.addAsyncTask=function(e,t,r){this.asyncTasks.push([e,t,r])},n.prototype.processAsyncTasks=function(e,t){function n(){r.nextTick(function(){var e=0===u.errors.length,r=e?void 0:u.errors;t(r,e)})}function i(e){return function(t){c||(e(t),0===--a&&n())}}var o=e||2e3,a=this.asyncTasks.length,s=a,c=!1,u=this;if(0===a||this.errors.length>0)return void n();for(;s--;){var f=this.asyncTasks[s];f[0].apply(null,f[1].concat(i(f[2])))}setTimeout(function(){a>0&&(c=!0,u.addError("ASYNC_TIMEOUT",[a,o]),t(u.errors,!1))},o)},n.prototype.getPath=function(){var e=[];return this.parentReport&&(e=e.concat(this.parentReport.path)),e=e.concat(this.path),this.options.reportPathAsArray!==!0&&(e="#/"+e.map(function(e){return a.isAbsoluteUri(e)?"uri("+e+")":e.replace(/\~/g,"~0").replace(/\//g,"~1")}).join("/")),e},n.prototype.getSchemaId=function(){if(!this.rootSchema)return null;var e=[];for(this.parentReport&&(e=e.concat(this.parentReport.path)),e=e.concat(this.path);e.length>0;){var t=i(this.rootSchema,e);if(t&&t.id)return t.id;e.pop()}return this.rootSchema.id},n.prototype.hasError=function(e,t){for(var r=this.errors.length;r--;)if(this.errors[r].code===e){for(var n=!0,i=this.errors[r].params.length;i--;)this.errors[r].params[i]!==t[i]&&(n=!1);if(n)return n}return!1},n.prototype.addError=function(e,t,r,n){if(!(this.errors.length>=this.reportOptions.maxErrors)){if(!e)throw new Error("No errorCode passed into addError()");if(!o[e])throw new Error("No errorMessage known for code "+e);t=t||[];for(var i=t.length,s=o[e];i--;){var c=a.whatIs(t[i]),u="object"===c||"null"===c?JSON.stringify(t[i]):t[i];s=s.replace("{"+i+"}",u)}var f={code:e,params:t,message:s,path:this.getPath(),schemaId:this.getSchemaId()};if(n&&(f.description=n),null!=r){for(Array.isArray(r)||(r=[r]),f.inner=[],i=r.length;i--;)for(var p=r[i],l=p.errors.length;l--;)f.inner.push(p.errors[l]);0===f.inner.length&&(f.inner=void 0)}this.errors.push(f)}},t.exports=n}).call(this,e("_process"))},{"./Errors":194,"./Utils":202,_process:176,"lodash.get":162}],199:[function(e,t,r){"use strict";function n(e){return decodeURIComponent(e).replace(/~[0-1]/g,function(e){return"~1"===e?"/":"~"})}function i(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function o(e){var t=e.indexOf("#"),r=-1===t?void 0:e.slice(t+1);return r}function a(e,t){if("object"==typeof e&&null!==e){if(!t)return e;if(e.id&&(e.id===t||"#"===e.id[0]&&e.id.substring(1)===t))return e;var r,n;if(Array.isArray(e)){for(r=e.length;r--;)if(n=a(e[r],t))return n}else{var i=Object.keys(e);for(r=i.length;r--;){var o=i[r];if(0!==o.indexOf("__$")&&(n=a(e[o],t)))return n}}}}var s=e("./Report"),c=e("./SchemaCompilation"),u=e("./SchemaValidation"),f=e("./Utils");r.cacheSchemaByUri=function(e,t){var r=i(e);r&&(this.cache[r]=t)},r.removeFromCacheByUri=function(e){var t=i(e);t&&delete this.cache[t]},r.checkCacheForUri=function(e){var t=i(e);return t?null!=this.cache[t]:!1},r.getSchema=function(e,t){return"object"==typeof t&&(t=r.getSchemaByReference.call(this,e,t)),"string"==typeof t&&(t=r.getSchemaByUri.call(this,e,t)),t},r.getSchemaByReference=function(e,t){for(var r=this.referenceCache.length;r--;)if(this.referenceCache[r][0]===t)return this.referenceCache[r][1];var n=f.cloneDeep(t);return this.referenceCache.push([t,n]),n},r.getSchemaByUri=function(e,t,r){var f=i(t),p=o(t),l=f?this.cache[f]:r;if(l&&f){var h=l!==r;if(h){e.path.push(f);var d=new s(e);c.compileSchema.call(this,d,l)&&u.validateSchema.call(this,d,l);var m=d.isValid();if(m||e.addError("REMOTE_NOT_VALID",[t],d),e.path.pop(),!m)return}}if(l&&p)for(var y=p.split("/"),g=0,v=y.length;l&&v>g;g++){var b=n(y[g]);l=0===g?a(l,b):l[b]}return l},r.getRemotePath=i},{"./Report":198,"./SchemaCompilation":200,"./SchemaValidation":201,"./Utils":202}],200:[function(e,t,r){"use strict";function n(e,t){if(c.isAbsoluteUri(t))return t;var r,n=e.join(""),i=c.isAbsoluteUri(n),o=c.isRelativeUri(n),a=c.isRelativeUri(t);i&&a?(r=n.match(/\/[^\/]*$/),r&&(n=n.slice(0,r.index+1))):o&&a?n="":(r=n.match(/[^#\/]+$/),r&&(n=n.slice(0,r.index)));var s=n+t;return s=s.replace(/##/,"#")}function i(e,t,r,o){if(t=t||[],r=r||[],o=o||[],"object"!=typeof e||null===e)return t;"string"==typeof e.id&&r.push(e.id),"string"==typeof e.$ref&&"undefined"==typeof e.__$refResolved&&t.push({ref:n(r,e.$ref),key:"$ref",obj:e,path:o.slice(0)}),"string"==typeof e.$schema&&"undefined"==typeof e.__$schemaResolved&&t.push({ref:n(r,e.$schema),key:"$schema",obj:e,path:o.slice(0)});var a;if(Array.isArray(e))for(a=e.length;a--;)o.push(a.toString()),i(e[a],t,r,o),o.pop();else{var s=Object.keys(e);for(a=s.length;a--;)0!==s[a].indexOf("__$")&&(o.push(s[a]),i(e[s[a]],t,r,o),o.pop())}return"string"==typeof e.id&&r.pop(),t}function o(e,t){for(var r=e.length;r--;)if(e[r].id===t)return e[r];return null}var a=e("./Report"),s=e("./SchemaCache"),c=e("./Utils"),u=function(e,t){for(var n=t.length,i=0;n--;){var o=new a(e),s=r.compileSchema.call(this,o,t[n]);s&&i++,e.errors=e.errors.concat(o.errors)}return i},f=function(e,t){var r,n=0;do{for(var i=e.errors.length;i--;)"UNRESOLVABLE_REFERENCE"===e.errors[i].code&&e.errors.splice(i,1);for(r=n,n=u.call(this,e,t),i=t.length;i--;){var a=t[i];if(a.__$missingReferences){for(var s=a.__$missingReferences.length;s--;){var c=a.__$missingReferences[s],f=o(t,c.ref);f&&(c.obj["__"+c.key+"Resolved"]=f,a.__$missingReferences.splice(s,1))}0===a.__$missingReferences.length&&delete a.__$missingReferences}}}while(n!==t.length&&n!==r);return e.isValid()};r.compileSchema=function(e,t){if(e.commonErrorMessage="SCHEMA_COMPILATION_FAILED","string"==typeof t){var n=s.getSchemaByUri.call(this,e,t);if(!n)return e.addError("SCHEMA_NOT_REACHABLE",[t]),!1;t=n}if(Array.isArray(t))return f.call(this,e,t);if(t.__$compiled&&t.id&&s.checkCacheForUri.call(this,t.id)===!1&&(t.__$compiled=void 0),t.__$compiled)return!0;t.id&&"string"==typeof t.id&&s.cacheSchemaByUri.call(this,t.id,t);var o=!1;e.rootSchema||(e.rootSchema=t,o=!0);var u=e.isValid();delete t.__$missingReferences;for(var p=i.call(this,t),l=p.length;l--;){var h=p[l],d=s.getSchemaByUri.call(this,e,h.ref,t);if(!d){var m=this.getSchemaReader();if(m){var y=m(h.ref);if(y){y.id=h.ref;var g=new a(e);r.compileSchema.call(this,g,y)?d=s.getSchemaByUri.call(this,e,h.ref,t):e.errors=e.errors.concat(g.errors)}}}if(!d){var v=e.hasError("REMOTE_NOT_VALID",[h.ref]),b=c.isAbsoluteUri(h.ref),E=!1,x=this.options.ignoreUnresolvableReferences===!0;b&&(E=s.checkCacheForUri.call(this,h.ref)),v||x&&b||E||(Array.prototype.push.apply(e.path,h.path),e.addError("UNRESOLVABLE_REFERENCE",[h.ref]),e.path=e.path.slice(0,-h.path.length),u&&(t.__$missingReferences=t.__$missingReferences||[],t.__$missingReferences.push(h)))}h.obj["__"+h.key+"Resolved"]=d}var O=e.isValid();return O?t.__$compiled=!0:t.id&&"string"==typeof t.id&&s.removeFromCacheByUri.call(this,t.id),o&&(e.rootSchema=void 0),O}},{"./Report":198,"./SchemaCache":199,"./Utils":202}],201:[function(e,t,r){"use strict";var n=e("./FormatValidators"),i=e("./JsonValidation"),o=e("./Report"),a=e("./Utils"),s={$ref:function(e,t){"string"!=typeof t.$ref&&e.addError("KEYWORD_TYPE_EXPECTED",["$ref","string"])},$schema:function(e,t){"string"!=typeof t.$schema&&e.addError("KEYWORD_TYPE_EXPECTED",["$schema","string"])},multipleOf:function(e,t){"number"!=typeof t.multipleOf?e.addError("KEYWORD_TYPE_EXPECTED",["multipleOf","number"]):t.multipleOf<=0&&e.addError("KEYWORD_MUST_BE",["multipleOf","strictly greater than 0"])},maximum:function(e,t){"number"!=typeof t.maximum&&e.addError("KEYWORD_TYPE_EXPECTED",["maximum","number"])},exclusiveMaximum:function(e,t){"boolean"!=typeof t.exclusiveMaximum?e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMaximum","boolean"]):void 0===t.maximum&&e.addError("KEYWORD_DEPENDENCY",["exclusiveMaximum","maximum"])},minimum:function(e,t){"number"!=typeof t.minimum&&e.addError("KEYWORD_TYPE_EXPECTED",["minimum","number"])},exclusiveMinimum:function(e,t){"boolean"!=typeof t.exclusiveMinimum?e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMinimum","boolean"]):void 0===t.minimum&&e.addError("KEYWORD_DEPENDENCY",["exclusiveMinimum","minimum"])},maxLength:function(e,t){"integer"!==a.whatIs(t.maxLength)?e.addError("KEYWORD_TYPE_EXPECTED",["maxLength","integer"]):t.maxLength<0&&e.addError("KEYWORD_MUST_BE",["maxLength","greater than, or equal to 0"])},minLength:function(e,t){"integer"!==a.whatIs(t.minLength)?e.addError("KEYWORD_TYPE_EXPECTED",["minLength","integer"]):t.minLength<0&&e.addError("KEYWORD_MUST_BE",["minLength","greater than, or equal to 0"])},pattern:function(e,t){if("string"!=typeof t.pattern)e.addError("KEYWORD_TYPE_EXPECTED",["pattern","string"]);else try{RegExp(t.pattern)}catch(r){e.addError("KEYWORD_PATTERN",["pattern",t.pattern])}},additionalItems:function(e,t){var n=a.whatIs(t.additionalItems);"boolean"!==n&&"object"!==n?e.addError("KEYWORD_TYPE_EXPECTED",["additionalItems",["boolean","object"]]):"object"===n&&(e.path.push("additionalItems"),r.validateSchema.call(this,e,t.additionalItems),e.path.pop())},items:function(e,t){var n=a.whatIs(t.items);if("object"===n)e.path.push("items"),r.validateSchema.call(this,e,t.items),e.path.pop();else if("array"===n)for(var i=t.items.length;i--;)e.path.push("items"),e.path.push(i.toString()),r.validateSchema.call(this,e,t.items[i]),e.path.pop(),e.path.pop();else e.addError("KEYWORD_TYPE_EXPECTED",["items",["array","object"]]);this.options.forceAdditional===!0&&void 0===t.additionalItems&&Array.isArray(t.items)&&e.addError("KEYWORD_UNDEFINED_STRICT",["additionalItems"]),this.options.assumeAdditional&&void 0===t.additionalItems&&Array.isArray(t.items)&&(t.additionalItems=!1)},maxItems:function(e,t){"number"!=typeof t.maxItems?e.addError("KEYWORD_TYPE_EXPECTED",["maxItems","integer"]):t.maxItems<0&&e.addError("KEYWORD_MUST_BE",["maxItems","greater than, or equal to 0"])},minItems:function(e,t){"integer"!==a.whatIs(t.minItems)?e.addError("KEYWORD_TYPE_EXPECTED",["minItems","integer"]):t.minItems<0&&e.addError("KEYWORD_MUST_BE",["minItems","greater than, or equal to 0"])},uniqueItems:function(e,t){"boolean"!=typeof t.uniqueItems&&e.addError("KEYWORD_TYPE_EXPECTED",["uniqueItems","boolean"])},maxProperties:function(e,t){"integer"!==a.whatIs(t.maxProperties)?e.addError("KEYWORD_TYPE_EXPECTED",["maxProperties","integer"]):t.maxProperties<0&&e.addError("KEYWORD_MUST_BE",["maxProperties","greater than, or equal to 0"])},minProperties:function(e,t){"integer"!==a.whatIs(t.minProperties)?e.addError("KEYWORD_TYPE_EXPECTED",["minProperties","integer"]):t.minProperties<0&&e.addError("KEYWORD_MUST_BE",["minProperties","greater than, or equal to 0"])},required:function(e,t){if("array"!==a.whatIs(t.required))e.addError("KEYWORD_TYPE_EXPECTED",["required","array"]);else if(0===t.required.length)e.addError("KEYWORD_MUST_BE",["required","an array with at least one element"]);else{for(var r=t.required.length;r--;)"string"!=typeof t.required[r]&&e.addError("KEYWORD_VALUE_TYPE",["required","string"]);a.isUniqueArray(t.required)===!1&&e.addError("KEYWORD_MUST_BE",["required","an array with unique items"])}},additionalProperties:function(e,t){var n=a.whatIs(t.additionalProperties);"boolean"!==n&&"object"!==n?e.addError("KEYWORD_TYPE_EXPECTED",["additionalProperties",["boolean","object"]]):"object"===n&&(e.path.push("additionalProperties"),r.validateSchema.call(this,e,t.additionalProperties),e.path.pop())},properties:function(e,t){if("object"!==a.whatIs(t.properties))return void e.addError("KEYWORD_TYPE_EXPECTED",["properties","object"]);for(var n=Object.keys(t.properties),i=n.length;i--;){var o=n[i],s=t.properties[o];e.path.push("properties"),e.path.push(o),r.validateSchema.call(this,e,s),e.path.pop(),e.path.pop()}this.options.forceAdditional===!0&&void 0===t.additionalProperties&&e.addError("KEYWORD_UNDEFINED_STRICT",["additionalProperties"]),this.options.assumeAdditional&&void 0===t.additionalProperties&&(t.additionalProperties=!1),this.options.forceProperties===!0&&0===n.length&&e.addError("CUSTOM_MODE_FORCE_PROPERTIES",["properties"])},patternProperties:function(e,t){if("object"!==a.whatIs(t.patternProperties))return void e.addError("KEYWORD_TYPE_EXPECTED",["patternProperties","object"]);for(var n=Object.keys(t.patternProperties),i=n.length;i--;){var o=n[i],s=t.patternProperties[o];try{RegExp(o)}catch(c){e.addError("KEYWORD_PATTERN",["patternProperties",o])}e.path.push("patternProperties"),e.path.push(o.toString()),r.validateSchema.call(this,e,s),e.path.pop(),e.path.pop()}this.options.forceProperties===!0&&0===n.length&&e.addError("CUSTOM_MODE_FORCE_PROPERTIES",["patternProperties"])},dependencies:function(e,t){if("object"!==a.whatIs(t.dependencies))e.addError("KEYWORD_TYPE_EXPECTED",["dependencies","object"]);else for(var n=Object.keys(t.dependencies),i=n.length;i--;){var o=n[i],s=t.dependencies[o],c=a.whatIs(s);if("object"===c)e.path.push("dependencies"),e.path.push(o),r.validateSchema.call(this,e,s),e.path.pop(),e.path.pop();else if("array"===c){var u=s.length;for(0===u&&e.addError("KEYWORD_MUST_BE",["dependencies","not empty array"]);u--;)"string"!=typeof s[u]&&e.addError("KEYWORD_VALUE_TYPE",["dependensices","string"]);a.isUniqueArray(s)===!1&&e.addError("KEYWORD_MUST_BE",["dependencies","an array with unique items"])}else e.addError("KEYWORD_VALUE_TYPE",["dependencies","object or array"])}},"enum":function(e,t){Array.isArray(t["enum"])===!1?e.addError("KEYWORD_TYPE_EXPECTED",["enum","array"]):0===t["enum"].length?e.addError("KEYWORD_MUST_BE",["enum","an array with at least one element"]):a.isUniqueArray(t["enum"])===!1&&e.addError("KEYWORD_MUST_BE",["enum","an array with unique elements"])},type:function(e,t){var r=["array","boolean","integer","number","null","object","string"],n=r.join(","),i=Array.isArray(t.type);if(i){for(var o=t.type.length;o--;)-1===r.indexOf(t.type[o])&&e.addError("KEYWORD_TYPE_EXPECTED",["type",n]);a.isUniqueArray(t.type)===!1&&e.addError("KEYWORD_MUST_BE",["type","an object with unique properties"])}else"string"==typeof t.type?-1===r.indexOf(t.type)&&e.addError("KEYWORD_TYPE_EXPECTED",["type",n]):e.addError("KEYWORD_TYPE_EXPECTED",["type",["string","array"]]);this.options.noEmptyStrings===!0&&("string"===t.type||i&&-1!==t.type.indexOf("string"))&&void 0===t.minLength&&void 0===t["enum"]&&void 0===t.format&&(t.minLength=1),this.options.noEmptyArrays===!0&&("array"===t.type||i&&-1!==t.type.indexOf("array"))&&void 0===t.minItems&&(t.minItems=1),this.options.forceProperties===!0&&("object"===t.type||i&&-1!==t.type.indexOf("object"))&&void 0===t.properties&&void 0===t.patternProperties&&e.addError("KEYWORD_UNDEFINED_STRICT",["properties"]),this.options.forceItems===!0&&("array"===t.type||i&&-1!==t.type.indexOf("array"))&&void 0===t.items&&e.addError("KEYWORD_UNDEFINED_STRICT",["items"]),this.options.forceMinItems===!0&&("array"===t.type||i&&-1!==t.type.indexOf("array"))&&void 0===t.minItems&&e.addError("KEYWORD_UNDEFINED_STRICT",["minItems"]),this.options.forceMaxItems===!0&&("array"===t.type||i&&-1!==t.type.indexOf("array"))&&void 0===t.maxItems&&e.addError("KEYWORD_UNDEFINED_STRICT",["maxItems"]),this.options.forceMinLength===!0&&("string"===t.type||i&&-1!==t.type.indexOf("string"))&&void 0===t.minLength&&void 0===t.format&&void 0===t["enum"]&&void 0===t.pattern&&e.addError("KEYWORD_UNDEFINED_STRICT",["minLength"]),this.options.forceMaxLength===!0&&("string"===t.type||i&&-1!==t.type.indexOf("string"))&&void 0===t.maxLength&&void 0===t.format&&void 0===t["enum"]&&void 0===t.pattern&&e.addError("KEYWORD_UNDEFINED_STRICT",["maxLength"])},allOf:function(e,t){if(Array.isArray(t.allOf)===!1)e.addError("KEYWORD_TYPE_EXPECTED",["allOf","array"]);else if(0===t.allOf.length)e.addError("KEYWORD_MUST_BE",["allOf","an array with at least one element"]);else for(var n=t.allOf.length;n--;)e.path.push("allOf"),e.path.push(n.toString()),r.validateSchema.call(this,e,t.allOf[n]),e.path.pop(),e.path.pop()},anyOf:function(e,t){if(Array.isArray(t.anyOf)===!1)e.addError("KEYWORD_TYPE_EXPECTED",["anyOf","array"]);else if(0===t.anyOf.length)e.addError("KEYWORD_MUST_BE",["anyOf","an array with at least one element"]);else for(var n=t.anyOf.length;n--;)e.path.push("anyOf"),e.path.push(n.toString()),r.validateSchema.call(this,e,t.anyOf[n]),e.path.pop(),e.path.pop()},oneOf:function(e,t){if(Array.isArray(t.oneOf)===!1)e.addError("KEYWORD_TYPE_EXPECTED",["oneOf","array"]);else if(0===t.oneOf.length)e.addError("KEYWORD_MUST_BE",["oneOf","an array with at least one element"]);else for(var n=t.oneOf.length;n--;)e.path.push("oneOf"),e.path.push(n.toString()),r.validateSchema.call(this,e,t.oneOf[n]),e.path.pop(),e.path.pop()},not:function(e,t){"object"!==a.whatIs(t.not)?e.addError("KEYWORD_TYPE_EXPECTED",["not","object"]):(e.path.push("not"),r.validateSchema.call(this,e,t.not),e.path.pop())},definitions:function(e,t){if("object"!==a.whatIs(t.definitions))e.addError("KEYWORD_TYPE_EXPECTED",["definitions","object"]);else for(var n=Object.keys(t.definitions),i=n.length;i--;){var o=n[i],s=t.definitions[o];e.path.push("definitions"),e.path.push(o),r.validateSchema.call(this,e,s),e.path.pop(),e.path.pop()}},format:function(e,t){"string"!=typeof t.format?e.addError("KEYWORD_TYPE_EXPECTED",["format","string"]):void 0===n[t.format]&&this.options.ignoreUnknownFormats!==!0&&e.addError("UNKNOWN_FORMAT",[t.format])},id:function(e,t){"string"!=typeof t.id&&e.addError("KEYWORD_TYPE_EXPECTED",["id","string"])},title:function(e,t){"string"!=typeof t.title&&e.addError("KEYWORD_TYPE_EXPECTED",["title","string"])},description:function(e,t){"string"!=typeof t.description&&e.addError("KEYWORD_TYPE_EXPECTED",["description","string"])},"default":function(){}},c=function(e,t){for(var n=t.length;n--;)r.validateSchema.call(this,e,t[n]);return e.isValid()};r.validateSchema=function(e,t){if(e.commonErrorMessage="SCHEMA_VALIDATION_FAILED",Array.isArray(t))return c.call(this,e,t);if(t.__$validated)return!0;var r=t.$schema&&t.id!==t.$schema;if(r)if(t.__$schemaResolved&&t.__$schemaResolved!==t){var n=new o(e),u=i.validate.call(this,n,t.__$schemaResolved,t);u===!1&&e.addError("PARENT_SCHEMA_VALIDATION_FAILED",null,n)}else this.options.ignoreUnresolvableReferences!==!0&&e.addError("REF_UNRESOLVED",[t.$schema]);if(this.options.noTypeless===!0){if(void 0!==t.type){var f=[];Array.isArray(t.anyOf)&&(f=f.concat(t.anyOf)),Array.isArray(t.oneOf)&&(f=f.concat(t.oneOf)),Array.isArray(t.allOf)&&(f=f.concat(t.allOf)),f.forEach(function(e){e.type||(e.type=t.type)})}void 0===t["enum"]&&void 0===t.type&&void 0===t.anyOf&&void 0===t.oneOf&&void 0===t.not&&void 0===t.$ref&&e.addError("KEYWORD_UNDEFINED_STRICT",["type"])}for(var p=Object.keys(t),l=p.length;l--;){var h=p[l];0!==h.indexOf("__")&&(void 0!==s[h]?s[h].call(this,e,t):r||this.options.noExtraKeywords===!0&&e.addError("KEYWORD_UNEXPECTED",[h]))}if(this.options.pedanticCheck===!0){if(t["enum"]){var d=a.clone(t);for(delete d["enum"],delete d["default"],e.path.push("enum"),l=t["enum"].length;l--;)e.path.push(l.toString()),i.validate.call(this,e,d,t["enum"][l]),e.path.pop();e.path.pop()}t["default"]&&(e.path.push("default"),i.validate.call(this,e,t,t["default"]),e.path.pop())}var m=e.isValid();return m&&(t.__$validated=!0),m}},{"./FormatValidators":195,"./JsonValidation":196,"./Report":198,"./Utils":202}],202:[function(e,t,r){"use strict";r.isAbsoluteUri=function(e){return/^https?:\/\//.test(e)},r.isRelativeUri=function(e){return/.+#/.test(e)},r.whatIs=function(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"array":"object":"number"===t?Number.isFinite(e)?e%1===0?"integer":"number":Number.isNaN(e)?"not-a-number":"unknown-number":t},r.areEqual=function n(e,t){if(e===t)return!0;var i,o;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(o=e.length,i=0;o>i;i++)if(!n(e[i],t[i]))return!1;return!0}if("object"===r.whatIs(e)&&"object"===r.whatIs(t)){var a=Object.keys(e),s=Object.keys(t);if(!n(a,s))return!1;for(o=a.length,i=0;o>i;i++)if(!n(e[a[i]],t[a[i]]))return!1;return!0}return!1},r.isUniqueArray=function(e,t){var n,i,o=e.length;for(n=0;o>n;n++)for(i=n+1;o>i;i++)if(r.areEqual(e[n],e[i]))return t&&t.push(n,i),!1;return!0},r.difference=function(e,t){for(var r=[],n=e.length;n--;)-1===t.indexOf(e[n])&&r.push(e[n]);return r},r.clone=function(e){if("undefined"!=typeof e){if("object"!=typeof e||null===e)return e;var t,r;if(Array.isArray(e))for(t=[],r=e.length;r--;)t[r]=e[r];else{t={};var n=Object.keys(e);for(r=n.length;r--;){var i=n[r];t[i]=e[i]}}return t}},r.cloneDeep=function(e){function t(e){if("object"!=typeof e||null===e)return e;var i,o,a;if(a=r.indexOf(e),-1!==a)return n[a];if(r.push(e),Array.isArray(e))for(i=[],n.push(i),o=e.length;o--;)i[o]=t(e[o]);else{i={},n.push(i);var s=Object.keys(e);for(o=s.length;o--;){var c=s[o];i[c]=t(e[c])}}return i}var r=[],n=[];return t(e)},r.ucs2decode=function(e){for(var t,r,n=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(r=e.charCodeAt(i++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--)):n.push(t);return n}},{}],203:[function(e,t,r){(function(r){"use strict";function n(e){if(this.cache={},this.referenceCache=[],this.setRemoteReference("http://json-schema.org/draft-04/schema",l),this.setRemoteReference("http://json-schema.org/draft-04/hyper-schema",h),"object"==typeof e){for(var t,r=Object.keys(e),n=r.length;n--;)if(t=r[n],void 0===d[t])throw new Error("Unexpected option passed to constructor: "+t);for(r=Object.keys(d),n=r.length;n--;)t=r[n],void 0===e[t]&&(e[t]=p.clone(d[t]));this.options=e}else this.options=p.clone(d);this.options.strictMode===!0&&(this.options.forceAdditional=!0,this.options.forceItems=!0,this.options.forceMaxLength=!0,this.options.forceProperties=!0,this.options.noExtraKeywords=!0,this.options.noTypeless=!0,this.options.noEmptyStrings=!0,this.options.noEmptyArrays=!0)}e("./Polyfills");var i=e("lodash.get"),o=e("./Report"),a=e("./FormatValidators"),s=e("./JsonValidation"),c=e("./SchemaCache"),u=e("./SchemaCompilation"),f=e("./SchemaValidation"),p=e("./Utils"),l=e("./schemas/schema.json"),h=e("./schemas/hyper-schema.json"),d={asyncTimeout:2e3,forceAdditional:!1,assumeAdditional:!1,forceItems:!1,forceMinItems:!1,forceMaxItems:!1,forceMinLength:!1,forceMaxLength:!1,forceProperties:!1,ignoreUnresolvableReferences:!1,noExtraKeywords:!1,noTypeless:!1,noEmptyStrings:!1,noEmptyArrays:!1,strictUris:!1,strictMode:!1,reportPathAsArray:!1,breakOnFirstError:!0,pedanticCheck:!1,ignoreUnknownFormats:!1};n.prototype.compileSchema=function(e){var t=new o(this.options);return e=c.getSchema.call(this,t,e),u.compileSchema.call(this,t,e),this.lastReport=t,t.isValid()},n.prototype.validateSchema=function(e){if(Array.isArray(e)&&0===e.length)throw new Error(".validateSchema was called with an empty array");var t=new o(this.options);e=c.getSchema.call(this,t,e);var r=u.compileSchema.call(this,t,e);return r&&f.validateSchema.call(this,t,e),this.lastReport=t,t.isValid()},n.prototype.validate=function(e,t,n,a){"function"===p.whatIs(n)&&(a=n,n={}),n||(n={});var l=p.whatIs(t);if("string"!==l&&"object"!==l){var h=new Error("Invalid .validate call - schema must be an string or object but "+l+" was passed!");if(a)return void r.nextTick(function(){a(h,!1)});throw h}var d=!1,m=new o(this.options);if("string"==typeof t){var y=t;if(t=c.getSchema.call(this,m,y),!t)throw new Error("Schema with id '"+y+"' wasn't found in the validator cache!")}else t=c.getSchema.call(this,m,t);var g=!1;d||(g=u.compileSchema.call(this,m,t)),g||(this.lastReport=m,d=!0);var v=!1;if(d||(v=f.validateSchema.call(this,m,t)),v||(this.lastReport=m,d=!0),n.schemaPath&&(m.rootSchema=t,t=i(t,n.schemaPath),!t))throw new Error("Schema path '"+n.schemaPath+"' wasn't found in the schema!");if(d||s.validate.call(this,m,t,e),a)return void m.processAsyncTasks(this.options.asyncTimeout,a);if(m.asyncTasks.length>0)throw new Error("This validation has async tasks and cannot be done in sync mode, please provide callback argument.");return this.lastReport=m,m.isValid()},n.prototype.getLastError=function(){if(0===this.lastReport.errors.length)return null;var e=new Error;return e.name="z-schema validation error",e.message=this.lastReport.commonErrorMessage,e.details=this.lastReport.errors,e},n.prototype.getLastErrors=function(){return this.lastReport&&this.lastReport.errors.length>0?this.lastReport.errors:void 0},n.prototype.getMissingReferences=function(e){e=e||this.lastReport.errors;for(var t=[],r=e.length;r--;){var n=e[r];if("UNRESOLVABLE_REFERENCE"===n.code){var i=n.params[0];-1===t.indexOf(i)&&t.push(i)}n.inner&&(t=t.concat(this.getMissingReferences(n.inner)))}return t},n.prototype.getMissingRemoteReferences=function(){for(var e=this.getMissingReferences(),t=[],r=e.length;r--;){var n=c.getRemotePath(e[r]);n&&-1===t.indexOf(n)&&t.push(n)}return t},n.prototype.setRemoteReference=function(e,t){t="string"==typeof t?JSON.parse(t):p.cloneDeep(t),c.cacheSchemaByUri.call(this,e,t)},n.prototype.getResolvedSchema=function(e){var t=new o(this.options);e=c.getSchema.call(this,t,e),e=p.cloneDeep(e);var r=[],n=function(e){var t,i=p.whatIs(e);if(("object"===i||"array"===i)&&!e.___$visited){if(e.___$visited=!0,r.push(e),e.$ref&&e.__$refResolved){var o=e.__$refResolved,a=e;delete e.$ref,delete e.__$refResolved;for(t in o)o.hasOwnProperty(t)&&(a[t]=o[t])}for(t in e)e.hasOwnProperty(t)&&(0===t.indexOf("__$")?delete e[t]:n(e[t]))}};if(n(e),r.forEach(function(e){delete e.___$visited}),this.lastReport=t,t.isValid())return e;throw this.getLastError()},n.prototype.setSchemaReader=function(e){return n.setSchemaReader(e)},n.prototype.getSchemaReader=function(){return n.schemaReader},n.setSchemaReader=function(e){n.schemaReader=e},n.registerFormat=function(e,t){a[e]=t},n.unregisterFormat=function(e){delete a[e]},n.getRegisteredFormats=function(){return Object.keys(a)},n.getDefaultOptions=function(){return p.cloneDeep(d)},t.exports=n}).call(this,e("_process"))},{"./FormatValidators":195,"./JsonValidation":196,"./Polyfills":197,"./Report":198,"./SchemaCache":199,"./SchemaCompilation":200,"./SchemaValidation":201,"./Utils":202,"./schemas/hyper-schema.json":204,"./schemas/schema.json":205,_process:176,"lodash.get":162}],204:[function(e,t,r){t.exports={$schema:"http://json-schema.org/draft-04/hyper-schema#",id:"http://json-schema.org/draft-04/hyper-schema#",title:"JSON Hyper-Schema",allOf:[{$ref:"http://json-schema.org/draft-04/schema#"}],properties:{additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}]},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}]},dependencies:{additionalProperties:{anyOf:[{$ref:"#"},{type:"array"}]}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}]},definitions:{additionalProperties:{$ref:"#"}},patternProperties:{additionalProperties:{$ref:"#"}},properties:{additionalProperties:{$ref:"#"}},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"},links:{type:"array",items:{$ref:"#/definitions/linkDescription"}},fragmentResolution:{type:"string"},media:{type:"object",properties:{type:{description:"A media type, as described in RFC 2046",type:"string"},binaryEncoding:{description:"A content encoding scheme, as described in RFC 2045",type:"string"}}},pathStart:{description:"Instances' URIs must start with this value for this schema to apply to them",type:"string",format:"uri"}},definitions:{schemaArray:{type:"array",items:{$ref:"#"}},linkDescription:{title:"Link Description Object",type:"object",required:["href","rel"],properties:{href:{description:"a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",type:"string"},rel:{description:"relation to the target resource of the link",type:"string"},title:{description:"a title for the link",type:"string"},targetSchema:{description:"JSON Schema describing the link target",$ref:"#"},mediaType:{description:"media type (as defined by RFC 2046) describing the link target",type:"string"},method:{description:'method for requesting the target of the link (e.g. for HTTP this might be "GET" or "DELETE")',type:"string"},encType:{description:"The media type in which to submit data along with the request",type:"string","default":"application/json"},schema:{description:"Schema describing the data to submit along with the request",$ref:"#"}}}}}},{}],205:[function(e,t,r){t.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{"default":0}]},simpleTypes:{"enum":["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},"default":{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],"default":{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean","default":!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},definitions:{type:"object",additionalProperties:{$ref:"#"},"default":{}},properties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},"enum":{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},"default":{}}},{}],206:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/apiDeclaration.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swaggerVersion","basePath","apis"],properties:{swaggerVersion:{"enum":["1.2"]},apiVersion:{type:"string"},basePath:{type:"string",format:"uri",pattern:"^https?://"},resourcePath:{type:"string",format:"uri",pattern:"^/"},apis:{type:"array",items:{$ref:"#/definitions/apiObject"}},models:{type:"object",additionalProperties:{$ref:"modelsObject.json#"}},produces:{$ref:"#/definitions/mimeTypeArray"},consumes:{$ref:"#/definitions/mimeTypeArray"},authorizations:{$ref:"authorizationObject.json#"}},additionalProperties:!1,definitions:{apiObject:{type:"object",required:["path","operations"],properties:{path:{type:"string",format:"uri-template",pattern:"^/"},description:{type:"string"},operations:{type:"array",items:{$ref:"operationObject.json#"}}},additionalProperties:!1},mimeTypeArray:{type:"array",items:{type:"string",format:"mime-type"},uniqueItems:!0}}}},{}],207:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/authorizationObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object", -additionalProperties:{oneOf:[{$ref:"#/definitions/basicAuth"},{$ref:"#/definitions/apiKey"},{$ref:"#/definitions/oauth2"}]},definitions:{basicAuth:{required:["type"],properties:{type:{"enum":["basicAuth"]}},additionalProperties:!1},apiKey:{required:["type","passAs","keyname"],properties:{type:{"enum":["apiKey"]},passAs:{"enum":["header","query"]},keyname:{type:"string"}},additionalProperties:!1},oauth2:{type:"object",required:["type","grantTypes"],properties:{type:{"enum":["oauth2"]},scopes:{type:"array",items:{$ref:"#/definitions/oauth2Scope"}},grantTypes:{$ref:"oauth2GrantType.json#"}},additionalProperties:!1},oauth2Scope:{type:"object",required:["scope"],properties:{scope:{type:"string"},description:{type:"string"}},additionalProperties:!1}}}},{}],208:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/dataType.json#",$schema:"http://json-schema.org/draft-04/schema#",description:"Data type as described by the specification (version 1.2)",type:"object",oneOf:[{$ref:"#/definitions/refType"},{$ref:"#/definitions/voidType"},{$ref:"#/definitions/primitiveType"},{$ref:"#/definitions/modelType"},{$ref:"#/definitions/arrayType"}],definitions:{refType:{required:["$ref"],properties:{$ref:{type:"string"}},additionalProperties:!1},voidType:{"enum":[{type:"void"}]},modelType:{required:["type"],properties:{type:{type:"string",not:{"enum":["boolean","integer","number","string","array"]}}},additionalProperties:!1},primitiveType:{required:["type"],properties:{type:{"enum":["boolean","integer","number","string"]},format:{type:"string"},defaultValue:{not:{type:["array","object","null"]}},"enum":{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},minimum:{type:"string"},maximum:{type:"string"}},additionalProperties:!1,dependencies:{format:{oneOf:[{properties:{type:{"enum":["integer"]},format:{"enum":["int32","int64"]}}},{properties:{type:{"enum":["number"]},format:{"enum":["float","double"]}}},{properties:{type:{"enum":["string"]},format:{"enum":["byte","date","date-time"]}}}]},"enum":{properties:{type:{"enum":["string"]}}},minimum:{properties:{type:{"enum":["integer","number"]}}},maximum:{properties:{type:{"enum":["integer","number"]}}}}},arrayType:{required:["type","items"],properties:{type:{"enum":["array"]},items:{type:"array",items:{$ref:"#/definitions/itemsObject"}},uniqueItems:{type:"boolean"}},additionalProperties:!1},itemsObject:{oneOf:[{$ref:"#/definitions/refType"},{allOf:[{$ref:"#/definitions/primitiveType"},{properties:{type:{},format:{}},additionalProperties:!1}]}]}}}},{}],209:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/dataTypeBase.json#",$schema:"http://json-schema.org/draft-04/schema#",description:"Data type fields (section 4.3.3)",type:"object",oneOf:[{required:["type"]},{required:["$ref"]}],properties:{type:{type:"string"},$ref:{type:"string"},format:{type:"string"},defaultValue:{not:{type:["array","object","null"]}},"enum":{type:"array",items:{type:"string"},uniqueItems:!0,minItems:1},minimum:{type:"string"},maximum:{type:"string"},items:{$ref:"#/definitions/itemsObject"},uniqueItems:{type:"boolean"}},dependencies:{format:{oneOf:[{properties:{type:{"enum":["integer"]},format:{"enum":["int32","int64"]}}},{properties:{type:{"enum":["number"]},format:{"enum":["float","double"]}}},{properties:{type:{"enum":["string"]},format:{"enum":["byte","date","date-time"]}}}]}},definitions:{itemsObject:{oneOf:[{type:"object",required:["$ref"],properties:{$ref:{type:"string"}},additionalProperties:!1},{allOf:[{$ref:"#"},{required:["type"],properties:{type:{},format:{}},additionalProperties:!1}]}]}}}},{}],210:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/infoObject.json#",$schema:"http://json-schema.org/draft-04/schema#",description:"info object (section 5.1.3)",type:"object",required:["title","description"],properties:{title:{type:"string"},description:{type:"string"},termsOfServiceUrl:{type:"string",format:"uri"},contact:{type:"string",format:"email"},license:{type:"string"},licenseUrl:{type:"string",format:"uri"}},additionalProperties:!1}},{}],211:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/modelsObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["id","properties"],properties:{id:{type:"string"},description:{type:"string"},properties:{type:"object",additionalProperties:{$ref:"#/definitions/propertyObject"}},subTypes:{type:"array",items:{type:"string"},uniqueItems:!0},discriminator:{type:"string"}},dependencies:{subTypes:["discriminator"]},definitions:{propertyObject:{allOf:[{not:{$ref:"#"}},{$ref:"dataTypeBase.json#"}]}}}},{}],212:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/oauth2GrantType.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",minProperties:1,properties:{implicit:{$ref:"#/definitions/implicit"},authorization_code:{$ref:"#/definitions/authorizationCode"}},definitions:{implicit:{type:"object",required:["loginEndpoint"],properties:{loginEndpoint:{$ref:"#/definitions/loginEndpoint"},tokenName:{type:"string"}},additionalProperties:!1},authorizationCode:{type:"object",required:["tokenEndpoint","tokenRequestEndpoint"],properties:{tokenEndpoint:{$ref:"#/definitions/tokenEndpoint"},tokenRequestEndpoint:{$ref:"#/definitions/tokenRequestEndpoint"}},additionalProperties:!1},loginEndpoint:{type:"object",required:["url"],properties:{url:{type:"string",format:"uri"}},additionalProperties:!1},tokenEndpoint:{type:"object",required:["url"],properties:{url:{type:"string",format:"uri"},tokenName:{type:"string"}},additionalProperties:!1},tokenRequestEndpoint:{type:"object",required:["url"],properties:{url:{type:"string",format:"uri"},clientIdName:{type:"string"},clientSecretName:{type:"string"}},additionalProperties:!1}}}},{}],213:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/operationObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",allOf:[{$ref:"dataTypeBase.json#"},{required:["method","nickname","parameters"],properties:{method:{"enum":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},summary:{type:"string",maxLength:120},notes:{type:"string"},nickname:{type:"string",pattern:"^[a-zA-Z0-9_]+$"},authorizations:{type:"object",additionalProperties:{type:"array",items:{$ref:"authorizationObject.json#/definitions/oauth2Scope"}}},parameters:{type:"array",items:{$ref:"parameterObject.json#"}},responseMessages:{type:"array",items:{$ref:"#/definitions/responseMessageObject"}},produces:{$ref:"#/definitions/mimeTypeArray"},consumes:{$ref:"#/definitions/mimeTypeArray"},deprecated:{"enum":["true","false"]}}}],definitions:{responseMessageObject:{type:"object",required:["code","message"],properties:{code:{$ref:"#/definitions/rfc2616section10"},message:{type:"string"},responseModel:{type:"string"}}},rfc2616section10:{type:"integer",minimum:100,maximum:600,exclusiveMaximum:!0},mimeTypeArray:{type:"array",items:{type:"string",format:"mime-type"},uniqueItems:!0}}}},{}],214:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/parameterObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",allOf:[{$ref:"dataTypeBase.json#"},{required:["paramType","name"],properties:{paramType:{"enum":["path","query","body","header","form"]},name:{type:"string"},description:{type:"string"},required:{type:"boolean"},allowMultiple:{type:"boolean"}}},{description:"type File requires special paramType and consumes",oneOf:[{properties:{type:{not:{"enum":["File"]}}}},{properties:{type:{"enum":["File"]},paramType:{"enum":["form"]},consumes:{"enum":["multipart/form-data"]}}}]}]}},{}],215:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/resourceListing.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swaggerVersion","apis"],properties:{swaggerVersion:{"enum":["1.2"]},apis:{type:"array",items:{$ref:"resourceObject.json#"}},apiVersion:{type:"string"},info:{$ref:"infoObject.json#"},authorizations:{$ref:"authorizationObject.json#"}}}},{}],216:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/resourceObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["path"],properties:{path:{type:"string",format:"uri"},description:{type:"string"}},additionalProperties:!1}},{}],217:[function(e,t,r){t.exports={title:"A JSON Schema for Swagger 2.0 API.",id:"http://swagger.io/v2/schema.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swagger","info","paths"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{swagger:{type:"string","enum":["2.0"],description:"The Swagger version of this document."},info:{$ref:"#/definitions/info"},host:{type:"string",pattern:"^[^{}/ :\\\\]+(?::\\d+)?$",description:"The host (name or ip) of the API. Example: 'swagger.io'"},basePath:{type:"string",pattern:"^/",description:"The base path to the API. Example: '/api'."},schemes:{$ref:"#/definitions/schemesList"},consumes:{description:"A list of MIME types accepted by the API.",$ref:"#/definitions/mediaTypeList"},produces:{description:"A list of MIME types the API can produce.",$ref:"#/definitions/mediaTypeList"},paths:{$ref:"#/definitions/paths"},definitions:{$ref:"#/definitions/definitions"},parameters:{$ref:"#/definitions/parameterDefinitions"},responses:{$ref:"#/definitions/responseDefinitions"},security:{$ref:"#/definitions/security"},securityDefinitions:{$ref:"#/definitions/securityDefinitions"},tags:{type:"array",items:{$ref:"#/definitions/tag"},uniqueItems:!0},externalDocs:{$ref:"#/definitions/externalDocs"}},definitions:{info:{type:"object",description:"General information about the API.",required:["version","title"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{title:{type:"string",description:"A unique and precise title of the API."},version:{type:"string",description:"A semantic version number of the API."},description:{type:"string",description:"A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."},termsOfService:{type:"string",description:"The terms of service for the API."},contact:{$ref:"#/definitions/contact"},license:{$ref:"#/definitions/license"}}},contact:{type:"object",description:"Contact information for the owners of the API.",additionalProperties:!1,properties:{name:{type:"string",description:"The identifying name of the contact person/organization."},url:{type:"string",description:"The URL pointing to the contact information.",format:"uri"},email:{type:"string",description:"The email address of the contact person/organization.",format:"email"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},license:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"The name of the license type. It's encouraged to use an OSI compatible license."},url:{type:"string",description:"The URL pointing to the license.",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},paths:{type:"object",description:"Relative paths to the individual endpoints. They must be relative to the 'basePath'.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"},"^/":{$ref:"#/definitions/pathItem"}},additionalProperties:!1},definitions:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},description:"One or more JSON objects describing the schemas being consumed and produced by the API."},parameterDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/parameter"},description:"One or more JSON representations for parameters"},responseDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/response"},description:"One or more JSON representations for parameters"},externalDocs:{type:"object",additionalProperties:!1,description:"information about external documentation",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},examples:{type:"object",additionalProperties:!0},mimeType:{type:"string",description:"The MIME type of the HTTP message."},operation:{type:"object",required:["responses"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{tags:{type:"array",items:{type:"string"},uniqueItems:!0},summary:{type:"string",description:"A brief summary of the operation."},description:{type:"string",description:"A longer description of the operation, GitHub Flavored Markdown is allowed."},externalDocs:{$ref:"#/definitions/externalDocs"},operationId:{type:"string",description:"A unique identifier of the operation."},produces:{description:"A list of MIME types the API can produce.",$ref:"#/definitions/mediaTypeList"},consumes:{description:"A list of MIME types the API can consume.",$ref:"#/definitions/mediaTypeList"},parameters:{$ref:"#/definitions/parametersList"},responses:{$ref:"#/definitions/responses"},schemes:{$ref:"#/definitions/schemesList"},deprecated:{type:"boolean","default":!1},security:{$ref:"#/definitions/security"}}},pathItem:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},get:{$ref:"#/definitions/operation"},put:{$ref:"#/definitions/operation"},post:{$ref:"#/definitions/operation"},"delete":{$ref:"#/definitions/operation"},options:{$ref:"#/definitions/operation"},head:{$ref:"#/definitions/operation"},patch:{$ref:"#/definitions/operation"},parameters:{$ref:"#/definitions/parametersList"}}},responses:{type:"object",description:"Response objects names can either be any valid HTTP status code or 'default'.",minProperties:1,additionalProperties:!1,patternProperties:{"^([0-9]{3})$|^(default)$":{$ref:"#/definitions/responseValue"},"^x-":{$ref:"#/definitions/vendorExtension"}},not:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}}},responseValue:{oneOf:[{$ref:"#/definitions/response"},{$ref:"#/definitions/jsonReference"}]},response:{type:"object",required:["description"],properties:{description:{type:"string"},schema:{oneOf:[{$ref:"#/definitions/schema"},{$ref:"#/definitions/fileSchema"}]},headers:{$ref:"#/definitions/headers"},examples:{$ref:"#/definitions/examples"}},additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},headers:{type:"object",additionalProperties:{$ref:"#/definitions/header"}},header:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string","enum":["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},vendorExtension:{description:"Any property starting with x- is valid.",additionalProperties:!0,additionalItems:!0},bodyParameter:{type:"object",required:["name","in","schema"],patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},"in":{type:"string",description:"Determines the location of the parameter.","enum":["body"]},required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.","default":!1},schema:{$ref:"#/definitions/schema"}},additionalProperties:!1},headerParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.","default":!1},"in":{type:"string",description:"Determines the location of the parameter.","enum":["header"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string","enum":["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},queryParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.","default":!1},"in":{type:"string",description:"Determines the location of the parameter.","enum":["query"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean","default":!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string","enum":["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},formDataParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.","default":!1},"in":{type:"string",description:"Determines the location of the parameter.","enum":["formData"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean","default":!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string","enum":["string","number","boolean","integer","array","file"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},pathParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["required"],properties:{required:{type:"boolean","enum":[!0],description:"Determines whether or not this parameter is required or optional."},"in":{type:"string",description:"Determines the location of the parameter.","enum":["path"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string","enum":["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},nonBodyParameter:{type:"object",required:["name","in","type"],oneOf:[{$ref:"#/definitions/headerParameterSubSchema"},{$ref:"#/definitions/formDataParameterSubSchema"},{$ref:"#/definitions/queryParameterSubSchema"},{$ref:"#/definitions/pathParameterSubSchema"}]},parameter:{oneOf:[{$ref:"#/definitions/bodyParameter"},{$ref:"#/definitions/nonBodyParameter"}]},schema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},"default":{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},maxProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},"enum":{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},additionalProperties:{anyOf:[{$ref:"#/definitions/schema"},{type:"boolean"}],"default":{}},type:{$ref:"http://json-schema.org/draft-04/schema#/properties/type"},items:{anyOf:[{$ref:"#/definitions/schema"},{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}}],"default":{}},allOf:{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}},properties:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},"default":{}},discriminator:{type:"string"},readOnly:{type:"boolean","default":!1},xml:{$ref:"#/definitions/xml"},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},fileSchema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["type"],properties:{format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},"default":{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},type:{type:"string","enum":["file"]},readOnly:{type:"boolean","default":!1},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},primitivesItems:{type:"object",additionalProperties:!1,properties:{type:{type:"string","enum":["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},security:{type:"array",items:{$ref:"#/definitions/securityRequirement"},uniqueItems:!0},securityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"},uniqueItems:!0}},xml:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean","default":!1},wrapped:{type:"boolean","default":!1}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},tag:{type:"object",additionalProperties:!1,required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/externalDocs"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},securityDefinitions:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/basicAuthenticationSecurity"},{$ref:"#/definitions/apiKeySecurity"},{$ref:"#/definitions/oauth2ImplicitSecurity"},{$ref:"#/definitions/oauth2PasswordSecurity"},{$ref:"#/definitions/oauth2ApplicationSecurity"},{$ref:"#/definitions/oauth2AccessCodeSecurity"}]}},basicAuthenticationSecurity:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string","enum":["basic"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},apiKeySecurity:{type:"object",additionalProperties:!1,required:["type","name","in"],properties:{type:{type:"string","enum":["apiKey"]},name:{type:"string"},"in":{type:"string","enum":["header","query"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ImplicitSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl"],properties:{type:{type:"string","enum":["oauth2"]},flow:{type:"string","enum":["implicit"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2PasswordSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string","enum":["oauth2"]},flow:{type:"string","enum":["password"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ApplicationSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string","enum":["oauth2"]},flow:{type:"string","enum":["application"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2AccessCodeSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl","tokenUrl"],properties:{type:{type:"string","enum":["oauth2"]},flow:{type:"string","enum":["accessCode"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2Scopes:{type:"object",additionalProperties:{type:"string"}},mediaTypeList:{type:"array",items:{$ref:"#/definitions/mimeType"},uniqueItems:!0},parametersList:{type:"array",description:"The parameters needed to send a valid API call.",additionalItems:!1,items:{oneOf:[{$ref:"#/definitions/parameter"},{$ref:"#/definitions/jsonReference"}]},uniqueItems:!0},schemesList:{type:"array",description:"The transfer protocol of the API.",items:{type:"string","enum":["http","https","ws","wss"]},uniqueItems:!0},collectionFormat:{type:"string","enum":["csv","ssv","tsv","pipes"],"default":"csv"},collectionFormatWithMulti:{type:"string","enum":["csv","ssv","tsv","pipes","multi"],"default":"csv"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},"default":{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},"enum":{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},jsonReference:{type:"object",required:["$ref"],additionalProperties:!1,properties:{$ref:{type:"string"}}}}}},{}],218:[function(e,t,r){t.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{"default":0}]},simpleTypes:{"enum":["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{ -type:"string"},"default":{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],"default":{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean","default":!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},definitions:{type:"object",additionalProperties:{$ref:"#"},"default":{}},properties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},"enum":{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},"default":{}}},{}]},{},[2])(2)}); \ No newline at end of file +"undefined"==typeof Promise&&e("native-promise-only"),t.exports.clearCache=x,t.exports.decodePath=O,t.exports.encodePath=j,t.exports.findRefs=w,t.exports.findRefsAt=A,t.exports.getRefDetails=_,t.exports.isPtr=I,t.exports.isRef=P,t.exports.pathFromPtr=S,t.exports.pathToPtr=T,t.exports.resolveRefs=C,t.exports.resolveRefsAt=$},{"native-promise-only":170,path:171,"path-loader":172,querystring:179,slash:181,"uri-js":191}],38:[function(e,t,r){var n=e("../internal/baseDifference"),i=e("../internal/baseFlatten"),o=e("../internal/isArrayLike"),a=e("../internal/isObjectLike"),s=e("../function/restParam"),c=s(function(e,t){return a(e)&&o(e)?n(e,i(t,!1,!0)):[]});t.exports=c},{"../function/restParam":48,"../internal/baseDifference":60,"../internal/baseFlatten":64,"../internal/isArrayLike":104,"../internal/isObjectLike":110}],39:[function(e,t,r){function n(e,t,r){var n=e?e.length:0;if(!n)return-1;if("number"==typeof r)r=0>r?a(n+r,0):r;else if(r){var s=o(e,t);return n>s&&(t===t?t===e[s]:e[s]!==e[s])?s:-1}return i(e,t,r||0)}var i=e("../internal/baseIndexOf"),o=e("../internal/binaryIndex"),a=Math.max;t.exports=n},{"../internal/baseIndexOf":69,"../internal/binaryIndex":82}],40:[function(e,t,r){function n(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=n},{}],41:[function(e,t,r){var n=e("../internal/baseFlatten"),i=e("../internal/baseUniq"),o=e("../function/restParam"),a=o(function(e){return i(n(e,!1,!0))});t.exports=a},{"../function/restParam":48,"../internal/baseFlatten":64,"../internal/baseUniq":81}],42:[function(e,t,r){function n(e,t,r,n){var c=e?e.length:0;return c?(null!=t&&"boolean"!=typeof t&&(n=r,r=a(e,t,n)?void 0:t,t=!1),r=null==r?r:i(r,n,3),t?s(e,r):o(e,r)):[]}var i=e("../internal/baseCallback"),o=e("../internal/baseUniq"),a=e("../internal/isIterateeCall"),s=e("../internal/sortedUniq");t.exports=n},{"../internal/baseCallback":57,"../internal/baseUniq":81,"../internal/isIterateeCall":107,"../internal/sortedUniq":113}],43:[function(e,t,r){t.exports=e("./forEach")},{"./forEach":45}],44:[function(e,t,r){var n=e("../internal/baseEach"),i=e("../internal/createFind"),o=i(n);t.exports=o},{"../internal/baseEach":61,"../internal/createFind":91}],45:[function(e,t,r){var n=e("../internal/arrayEach"),i=e("../internal/baseEach"),o=e("../internal/createForEach"),a=o(n,i);t.exports=a},{"../internal/arrayEach":51,"../internal/baseEach":61,"../internal/createForEach":92}],46:[function(e,t,r){function n(e,t,r){var n=s(e)?i:a;return t=o(t,r,3),n(e,t)}var i=e("../internal/arrayMap"),o=e("../internal/baseCallback"),a=e("../internal/baseMap"),s=e("../lang/isArray");t.exports=n},{"../internal/arrayMap":52,"../internal/baseCallback":57,"../internal/baseMap":73,"../lang/isArray":118}],47:[function(e,t,r){var n=e("../internal/arrayReduce"),i=e("../internal/baseEach"),o=e("../internal/createReduce"),a=o(n,i);t.exports=a},{"../internal/arrayReduce":54,"../internal/baseEach":61,"../internal/createReduce":93}],48:[function(e,t,r){function n(e,t){if("function"!=typeof e)throw new TypeError(i);return t=o(void 0===t?e.length-1:+t||0,0),function(){for(var r=arguments,n=-1,i=o(r.length-t,0),a=Array(i);++n=s?a(t):null,l=t.length;p&&(u=o,f=!1,t=p);e:for(;++cn;)e=i(e)[t[n++]];return n&&n==o?e:void 0}}var i=e("./toObject");t.exports=n},{"./toObject":114}],69:[function(e,t,r){function n(e,t,r){if(t!==t)return i(e,r);for(var n=r-1,o=e.length;++nt&&(t=-t>i?0:i+t),r=void 0===r||r>i?i:+r||0,0>r&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n=s,p=f?a():null,l=[];p?(n=o,u=!1):(f=!1,p=t?[]:l);e:for(;++r=a){for(;a>n;){var c=n+a>>>1,u=e[c];(r?t>=u:t>u)&&null!==u?n=c+1:a=c}return a}return i(e,t,o,r)}var i=e("./binaryIndexBy"),o=e("../utility/identity"),a=4294967295,s=a>>>1;t.exports=n},{"../utility/identity":137,"./binaryIndexBy":83}],83:[function(e,t,r){function n(e,t,r,n){t=r(t);for(var a=0,c=e?e.length:0,u=t!==t,f=null===t,p=void 0===t;c>a;){var l=i((a+c)/2),h=r(e[l]),d=void 0!==h,m=h===h;if(u)var y=m||n;else y=f?m&&d&&(n||null!=h):p?m&&(n||d):null==h?!1:n?t>=h:t>h;y?a=l+1:c=l}return o(c,s)}var i=Math.floor,o=Math.min,a=4294967295,s=a-1;t.exports=n},{}],84:[function(e,t,r){function n(e,t,r){if("function"!=typeof e)return i;if(void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 3:return function(r,n,i){return e.call(t,r,n,i)};case 4:return function(r,n,i,o){return e.call(t,r,n,i,o)};case 5:return function(r,n,i,o,a){return e.call(t,r,n,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=e("../utility/identity");t.exports=n},{"../utility/identity":137}],85:[function(e,t,r){(function(e){function r(e){var t=new n(e.byteLength),r=new i(t);return r.set(new i(e)),t}var n=e.ArrayBuffer,i=e.Uint8Array;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],86:[function(e,t,r){function n(e,t){var r=e.data,n="string"==typeof t||i(t)?r.set.has(t):r.hash[t];return n?0:-1}var i=e("../lang/isObject");t.exports=n},{"../lang/isObject":126}],87:[function(e,t,r){function n(e){var t=this.data;"string"==typeof e||i(e)?t.set.add(e):t.hash[e]=!0}var i=e("../lang/isObject");t.exports=n},{"../lang/isObject":126}],88:[function(e,t,r){function n(e,t){return function(r,n){var s=r?i(r):0;if(!o(s))return e(r,n);for(var c=t?s:-1,u=a(r);(t?c--:++c-1?r[u]:void 0}return o(r,n,e)}}var i=e("./baseCallback"),o=e("./baseFind"),a=e("./baseFindIndex"),s=e("../lang/isArray");t.exports=n},{"../lang/isArray":118,"./baseCallback":57,"./baseFind":62,"./baseFindIndex":63}],92:[function(e,t,r){function n(e,t){return function(r,n,a){return"function"==typeof n&&void 0===a&&o(r)?e(r,n):t(r,i(n,a,3))}}var i=e("./bindCallback"),o=e("../lang/isArray");t.exports=n},{"../lang/isArray":118,"./bindCallback":84}],93:[function(e,t,r){function n(e,t){return function(r,n,s,c){var u=arguments.length<3;return"function"==typeof n&&void 0===c&&a(r)?e(r,n,s,u):o(r,i(n,c,4),s,u,t)}}var i=e("./baseCallback"),o=e("./baseReduce"),a=e("../lang/isArray");t.exports=n},{"../lang/isArray":118,"./baseCallback":57,"./baseReduce":78}],94:[function(e,t,r){function n(e,t,r,n,o,a,s){var c=-1,u=e.length,f=t.length;if(u!=f&&!(o&&f>u))return!1;for(;++c-1&&e%1==0&&t>e}var i=/^\d+$/,o=9007199254740991;t.exports=n},{}],107:[function(e,t,r){function n(e,t,r){if(!a(r))return!1;var n=typeof t;if("number"==n?i(r)&&o(t,r.length):"string"==n&&t in r){var s=r[t];return e===e?e===s:s!==s}return!1}var i=e("./isArrayLike"),o=e("./isIndex"),a=e("../lang/isObject");t.exports=n},{"../lang/isObject":126,"./isArrayLike":104,"./isIndex":106}],108:[function(e,t,r){function n(e,t){var r=typeof e;if("string"==r&&s.test(e)||"number"==r)return!0;if(i(e))return!1;var n=!a.test(e);return n||null!=t&&e in o(t)}var i=e("../lang/isArray"),o=e("./toObject"),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=n},{"../lang/isArray":118,"./toObject":114}],109:[function(e,t,r){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}var i=9007199254740991;t.exports=n},{}],110:[function(e,t,r){function n(e){return!!e&&"object"==typeof e}t.exports=n},{}],111:[function(e,t,r){function n(e){return e===e&&!i(e)}var i=e("../lang/isObject");t.exports=n},{"../lang/isObject":126}],112:[function(e,t,r){function n(e){for(var t=u(e),r=t.length,n=r&&e.length,f=!!n&&s(n)&&(o(e)||i(e)||c(e)),l=-1,h=[];++l0,g=l.enumErrorProps&&(e===j||e instanceof Error),v=l.enumPrototypes&&s(e);++nn;)e=e[t[n++]];return n&&n==o?e:void 0}}function i(e){return o(e)?e:Object(e)}function o(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=n},{}],146:[function(e,t,r){function n(e,t,r,c,p,l){var h=1&t,d=2&t,m=4&t,y=16&t,g=32&t;if(!d&&!a(e))throw new TypeError;y&&!r.length&&(t&=-17,y=r=!1),g&&!c.length&&(t&=-33,g=c=!1);var v=e&&e.__bindData__;if(v&&v!==!0)return v=s(v),v[2]&&(v[2]=s(v[2])),v[3]&&(v[3]=s(v[3])),!h||1&v[1]||(v[4]=p),!h&&1&v[1]&&(t|=8),!m||4&v[1]||(v[5]=l),y&&u.apply(v[2]||(v[2]=[]),r),g&&f.apply(v[3]||(v[3]=[]),c),v[1]|=t,n.apply(null,v);var b=1==t||17===t?i:o;return b([e,t,r,c,p,l])}var i=e("lodash._basebind"),o=e("lodash._basecreatewrapper"),a=e("lodash.isfunction"),s=e("lodash._slice"),c=[],u=c.push,f=c.unshift;t.exports=n},{"lodash._basebind":140,"lodash._basecreatewrapper":144,"lodash._slice":154,"lodash.isfunction":165}],147:[function(e,t,r){function n(){return i.pop()||[]}var i=e("lodash._arraypool");t.exports=n},{"lodash._arraypool":139}],148:[function(e,t,r){function n(e){return"function"==typeof e&&a.test(e)}var i=Object.prototype,o=i.toString,a=RegExp("^"+String(o).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");t.exports=n},{}],149:[function(e,t,r){var n=40;t.exports=n},{}],150:[function(e,t,r){var n={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1};t.exports=n},{}],151:[function(e,t,r){function n(e){e.length=0,i.lengthi?0:i);++n-1&&e%1==0&&v>=e}function a(e){return s(e)&&m.call(e)==f}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function c(e){return null==e?!1:a(e)?y.test(h.call(e)):n(e)&&p.test(e)}var u="[object Array]",f="[object Function]",p=/^\[object .+?Constructor\]$/,l=Object.prototype,h=Function.prototype.toString,d=l.hasOwnProperty,m=l.toString,y=RegExp("^"+h.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=i(Array,"isArray"),v=9007199254740991,b=g||function(e){return n(e)&&o(e.length)&&m.call(e)==u};t.exports=b},{}],157:[function(e,t,r){var n=e("lodash._basecreatecallback"),i=e("lodash.keys"),o=e("lodash._objecttypes"),a=function(e,t,r){var a,s=e,c=s;if(!s)return c;var u=arguments,f=0,p="number"==typeof r?2:u.length;if(p>3&&"function"==typeof u[p-2])var l=n(u[--p-1],u[p--],2);else p>2&&"function"==typeof u[p-1]&&(l=u[--p]);for(;++f2?i(e,17,o(arguments,2),null,t):i(e,1,null,null,t)}var i=e("lodash._createwrapper"),o=e("lodash._slice");t.exports=n},{"lodash._createwrapper":146,"lodash._slice":154}],159:[function(e,t,r){function n(e,t,r){return i(e,!0,"function"==typeof t&&o(t,r,1))}var i=e("lodash._baseclone"),o=e("lodash._basecreatecallback");t.exports=n},{"lodash._baseclone":141,"lodash._basecreatecallback":143}],160:[function(e,t,r){function n(e,t,r){var n=-1,a=e?e.length:0;if(t=t&&"undefined"==typeof r?t:i(t,r,3),"number"==typeof a)for(;++n0&&e(r,c))}catch(u){o.call(new s(c),u)}}}function o(t){var n=this;n.triggered||(n.triggered=!0,n.def&&(n=n.def),n.msg=t,n.state=2,n.chain.length>0&&e(r,n))}function a(e,t,r,n){for(var i=0;i=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var i=r.isAbsolute(e),o="/"===a(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),o=n(t.split("/")),a=Math.min(i.length,o.length),s=a,c=0;a>c;c++)if(i[c]!==o[c]){s=c;break}for(var u=[],c=s;ct&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:175}],172:[function(e,t,r){"use strict";function n(e){return"undefined"!=typeof e&&(e=-1===e.indexOf("://")?"":e.split("://")[0]),e}function i(e){var t=n(e),r=o[t];if("undefined"==typeof r){if(""!==t)throw new Error("Unsupported scheme: "+t);r=a}return r}var o={file:e("./lib/loaders/file"),http:e("./lib/loaders/http"),https:e("./lib/loaders/http")},a="object"==typeof window||"function"==typeof importScripts?o.http:o.file;"undefined"==typeof Promise&&e("native-promise-only"),t.exports.load=function(e,t){var r=Promise.resolve();return"undefined"==typeof t&&(t={}),r=r.then(function(){if("undefined"==typeof e)throw new TypeError("location is required");if("string"!=typeof e)throw new TypeError("location must be a string");if("undefined"!=typeof t){if("object"!=typeof t)throw new TypeError("options must be an object");if("undefined"!=typeof t.processContent&&"function"!=typeof t.processContent)throw new TypeError("options.processContent must be a function")}}),r=r.then(function(){return new Promise(function(r,n){var o=i(e);o.load(e,t||{},function(e,t){e?n(e):r(t)})})}).then(function(e){return t.processContent?new Promise(function(r,n){t.processContent("object"==typeof e?e:{text:e},function(e,t){e?n(e):r(t)})}):"object"==typeof e?e.text:e})}},{"./lib/loaders/file":173,"./lib/loaders/http":174,"native-promise-only":170}],173:[function(e,t,r){"use strict";var n=new TypeError("The 'file' scheme is not supported in the browser");t.exports.getBase=function(){throw n},t.exports.load=function(){var e=arguments[arguments.length-1];if("function"!=typeof e)throw n;e(n)}},{}],174:[function(e,t,r){"use strict";var n=e("superagent"),i=["delete","get","head","patch","post","put"];t.exports.load=function(e,t,r){function o(e,t){e?r(e):("function"==typeof t.buffer&&t.buffer(!0),t.end(function(e,t){e?r(e):r(void 0,t)}))}var a,s,c=t.method?t.method.toLowerCase():"get";if("undefined"!=typeof t.method?"string"!=typeof t.method?a=new TypeError("options.method must be a string"):-1===i.indexOf(t.method)&&(a=new TypeError("options.method must be one of the following: "+i.slice(0,i.length-1).join(", ")+" or "+i[i.length-1])):"undefined"!=typeof t.prepareRequest&&"function"!=typeof t.prepareRequest&&(a=new TypeError("options.prepareRequest must be a function")),a)r(a);else if(s=n["delete"===c?"del":c](e),t.prepareRequest)try{t.prepareRequest(s,o)}catch(u){r(u)}else o(void 0,s)}},{superagent:183}],175:[function(e,t,r){function n(){f=!1,s.length?u=s.concat(u):p=-1,u.length&&i()}function i(){if(!f){var e=setTimeout(n);f=!0;for(var t=u.length;t;){for(s=u,u=[];++p1)for(var r=1;r1&&(n=r[0]+"@",e=r[1]),e=e.replace(D,".");var i=e.split("."),o=a(i,t).join(".");return n+o}function c(e){for(var t,r,n=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(r=e.charCodeAt(i++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--)):n.push(t);return n}function u(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=U(e>>>10&1023|55296),e=56320|1023&e),t+=U(e)}).join("")}function f(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:j}function p(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function l(e,t,r){var n=0;for(e=r?F(e/I):e>>1,e+=F(e/t);e>k*A>>1;n+=j)e=F(e/k);return F(n+(k+1)*e/(e+_))}function h(e){var t,r,n,i,a,s,c,p,h,d,m=[],y=e.length,g=0,v=S,b=P;for(r=e.lastIndexOf(T),0>r&&(r=0),n=0;r>n;++n)e.charCodeAt(n)>=128&&o("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;y>i;){for(a=g,s=1,c=j;i>=y&&o("invalid-input"),p=f(e.charCodeAt(i++)),(p>=j||p>F((O-g)/s))&&o("overflow"),g+=p*s,h=b>=c?w:c>=b+A?A:c-b,!(h>p);c+=j)d=j-h,s>F(O/d)&&o("overflow"),s*=d;t=m.length+1,b=l(g-a,t,0==a),F(g/t)>O-v&&o("overflow"),v+=F(g/t),g%=t,m.splice(g++,0,v)}return u(m)}function d(e){var t,r,n,i,a,s,u,f,h,d,m,y,g,v,b,E=[];for(e=c(e),y=e.length,t=S,r=0,a=P,s=0;y>s;++s)m=e[s],128>m&&E.push(U(m));for(n=i=E.length,i&&E.push(T);y>n;){for(u=O,s=0;y>s;++s)m=e[s],m>=t&&u>m&&(u=m);for(g=n+1,u-t>F((O-r)/g)&&o("overflow"),r+=(u-t)*g,t=u,s=0;y>s;++s)if(m=e[s],t>m&&++r>O&&o("overflow"),m==t){for(f=r,h=j;d=a>=h?w:h>=a+A?A:h-a,!(d>f);h+=j)b=f-d,v=j-d,E.push(U(p(d+b%v,0))),f=F(b/v);E.push(U(p(f,0))),a=l(r,g,n==i),r=0,++n}++r,++t}return E.join("")}function m(e){return s(e,function(e){return C.test(e)?h(e.slice(4).toLowerCase()):e})}function y(e){return s(e,function(e){return $.test(e)?"xn--"+d(e):e})}var g="object"==typeof n&&n&&!n.nodeType&&n,v="object"==typeof r&&r&&!r.nodeType&&r,b="object"==typeof t&&t;(b.global===b||b.window===b||b.self===b)&&(i=b);var E,x,O=2147483647,j=36,w=1,A=26,_=38,I=700,P=72,S=128,T="-",C=/^xn--/,$=/[^\x20-\x7E]/,D=/[\x2E\u3002\uFF0E\uFF61]/g,R={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=j-w,F=Math.floor,U=String.fromCharCode;if(E={version:"1.3.2",ucs2:{decode:c,encode:u},decode:h,encode:d,toASCII:y,toUnicode:m},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return E});else if(g&&v)if(r.exports==g)v.exports=E;else for(x in E)E.hasOwnProperty(x)&&(g[x]=E[x]);else i.punycode=E}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],177:[function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var f=0;u>f;++f){var p,l,h,d,m=e[f].replace(s,"%20"),y=m.indexOf(r);y>=0?(p=m.substr(0,y),l=m.substr(y+1)):(p=m,l=""),h=decodeURIComponent(p),d=decodeURIComponent(l),n(a,h)?i(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],178:[function(e,t,r){"use strict";function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;nn;)o=t.call(null,o,e[n],++n,e);return o}},{}],181:[function(e,t,r){"use strict";t.exports=function(e){var t=/^\\\\\?\\/.test(e),r=/[^\x00-\x80]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}},{}],182:[function(t,r,n){!function(t){if("object"==typeof n)r.exports=t();else if("function"==typeof e&&e.amd)e(t);else{var i;try{i=window}catch(o){i=self}i.SparkMD5=t()}}(function(e){"use strict";function t(e,t,r,n,i,o){return t=v(v(t,e),v(n,o)),v(t<>>32-i,r)}function r(e,r,n,i,o,a,s){return t(r&n|~r&i,e,r,o,a,s)}function n(e,r,n,i,o,a,s){return t(r&i|n&~i,e,r,o,a,s)}function i(e,r,n,i,o,a,s){return t(r^n^i,e,r,o,a,s)}function o(e,r,n,i,o,a,s){return t(n^(r|~i),e,r,o,a,s)}function a(e,t){var a=e[0],s=e[1],c=e[2],u=e[3];a=r(a,s,c,u,t[0],7,-680876936),u=r(u,a,s,c,t[1],12,-389564586),c=r(c,u,a,s,t[2],17,606105819),s=r(s,c,u,a,t[3],22,-1044525330),a=r(a,s,c,u,t[4],7,-176418897),u=r(u,a,s,c,t[5],12,1200080426),c=r(c,u,a,s,t[6],17,-1473231341),s=r(s,c,u,a,t[7],22,-45705983),a=r(a,s,c,u,t[8],7,1770035416),u=r(u,a,s,c,t[9],12,-1958414417),c=r(c,u,a,s,t[10],17,-42063),s=r(s,c,u,a,t[11],22,-1990404162),a=r(a,s,c,u,t[12],7,1804603682),u=r(u,a,s,c,t[13],12,-40341101),c=r(c,u,a,s,t[14],17,-1502002290),s=r(s,c,u,a,t[15],22,1236535329),a=n(a,s,c,u,t[1],5,-165796510),u=n(u,a,s,c,t[6],9,-1069501632),c=n(c,u,a,s,t[11],14,643717713),s=n(s,c,u,a,t[0],20,-373897302),a=n(a,s,c,u,t[5],5,-701558691),u=n(u,a,s,c,t[10],9,38016083),c=n(c,u,a,s,t[15],14,-660478335),s=n(s,c,u,a,t[4],20,-405537848),a=n(a,s,c,u,t[9],5,568446438),u=n(u,a,s,c,t[14],9,-1019803690),c=n(c,u,a,s,t[3],14,-187363961),s=n(s,c,u,a,t[8],20,1163531501),a=n(a,s,c,u,t[13],5,-1444681467),u=n(u,a,s,c,t[2],9,-51403784),c=n(c,u,a,s,t[7],14,1735328473),s=n(s,c,u,a,t[12],20,-1926607734),a=i(a,s,c,u,t[5],4,-378558),u=i(u,a,s,c,t[8],11,-2022574463),c=i(c,u,a,s,t[11],16,1839030562),s=i(s,c,u,a,t[14],23,-35309556),a=i(a,s,c,u,t[1],4,-1530992060),u=i(u,a,s,c,t[4],11,1272893353),c=i(c,u,a,s,t[7],16,-155497632),s=i(s,c,u,a,t[10],23,-1094730640),a=i(a,s,c,u,t[13],4,681279174),u=i(u,a,s,c,t[0],11,-358537222),c=i(c,u,a,s,t[3],16,-722521979),s=i(s,c,u,a,t[6],23,76029189),a=i(a,s,c,u,t[9],4,-640364487),u=i(u,a,s,c,t[12],11,-421815835),c=i(c,u,a,s,t[15],16,530742520),s=i(s,c,u,a,t[2],23,-995338651),a=o(a,s,c,u,t[0],6,-198630844),u=o(u,a,s,c,t[7],10,1126891415),c=o(c,u,a,s,t[14],15,-1416354905),s=o(s,c,u,a,t[5],21,-57434055),a=o(a,s,c,u,t[12],6,1700485571),u=o(u,a,s,c,t[3],10,-1894986606),c=o(c,u,a,s,t[10],15,-1051523),s=o(s,c,u,a,t[1],21,-2054922799),a=o(a,s,c,u,t[8],6,1873313359),u=o(u,a,s,c,t[15],10,-30611744),c=o(c,u,a,s,t[6],15,-1560198380),s=o(s,c,u,a,t[13],21,1309151649),a=o(a,s,c,u,t[4],6,-145523070),u=o(u,a,s,c,t[11],10,-1120210379),c=o(c,u,a,s,t[2],15,718787259),s=o(s,c,u,a,t[9],21,-343485551),e[0]=v(a,e[0]),e[1]=v(s,e[1]),e[2]=v(c,e[2]),e[3]=v(u,e[3])}function s(e){var t,r=[];for(t=0;64>t;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function c(e){var t,r=[];for(t=0;64>t;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function u(e){var t,r,n,i,o,c,u=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;u>=t;t+=64)a(f,s(e.substring(t-64,t)));for(e=e.substring(t-64),r=e.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;r>t;t+=1)n[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55)for(a(f,n),t=0;16>t;t+=1)n[t]=0;return i=8*u,i=i.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(i[2],16),c=parseInt(i[1],16)||0,n[14]=o,n[15]=c,a(f,n),f}function f(e){var t,r,n,i,o,s,u=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;u>=t;t+=64)a(f,c(e.subarray(t-64,t)));for(e=u>t-64?e.subarray(t-64):new Uint8Array(0),r=e.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;r>t;t+=1)n[t>>2]|=e[t]<<(t%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55)for(a(f,n),t=0;16>t;t+=1)n[t]=0;return i=8*u,i=i.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(i[2],16),s=parseInt(i[1],16)||0,n[14]=o,n[15]=s,a(f,n),f}function p(e){var t,r="";for(t=0;4>t;t+=1)r+=b[e>>8*t+4&15]+b[e>>8*t&15];return r}function l(e){var t;for(t=0;tr;r++)o[r]=e.charCodeAt(r);return t?o:i}function m(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function y(e,t,r){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e)),n.set(new Uint8Array(t),e.byteLength),r?n:n.buffer}function g(){this.reset()}var v=function(e,t){return e+t&4294967295},b=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return"5d41402abc4b2a76b9719d911017c592"!==l(u("hello"))&&(v=function(e,t){var r=(65535&e)+(65535&t),n=(e>>16)+(t>>16)+(r>>16);return n<<16|65535&r}),g.prototype.append=function(e){return this.appendBinary(h(e)),this},g.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,r=this._buff.length;for(t=64;r>=t;t+=64)a(this._hash,s(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},g.prototype.end=function(e){var t,r,n=this._buff,i=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;i>t;t+=1)o[t>>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(o,i),r=e?this._hash:l(this._hash),this.reset(),r},g.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},g.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},g.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},g.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},g.prototype._finish=function(e,t){var r,n,i,o=t;if(e[o>>2]|=128<<(o%4<<3),o>55)for(a(this._hash,e),o=0;16>o;o+=1)e[o]=0;r=8*this._length,r=r.toString(16).match(/(.*?)(.{0,8})$/),n=parseInt(r[2],16),i=parseInt(r[1],16)||0,e[14]=n,e[15]=i,a(this._hash,e)},g.hash=function(e,t){return g.hashBinary(h(e),t)},g.hashBinary=function(e,t){var r=u(e);return t?r:l(r)},g.ArrayBuffer=function(){this.reset()},g.ArrayBuffer.prototype.append=function(e){var t,r=y(this._buff.buffer,e,!0),n=r.length;for(this._length+=e.byteLength,t=64;n>=t;t+=64)a(this._hash,c(r.subarray(t-64,t)));return this._buff=n>t-64?r.subarray(t-64):new Uint8Array(0),this},g.ArrayBuffer.prototype.end=function(e){var t,r,n=this._buff,i=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;i>t;t+=1)o[t>>2]|=n[t]<<(t%4<<3);return this._finish(o,i),r=e?this._hash:l(this._hash),this.reset(),r},g.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},g.ArrayBuffer.prototype.getState=function(){var e=g.prototype.getState.call(this);return e.buff=m(e.buff),e},g.ArrayBuffer.prototype.setState=function(e){return e.buff=d(e.buff,!0),g.prototype.setState.call(this,e)},g.ArrayBuffer.prototype.destroy=g.prototype.destroy,g.ArrayBuffer.prototype._finish=g.prototype._finish,g.ArrayBuffer.hash=function(e,t){var r=f(new Uint8Array(e));return t?r:l(r)},g})},{}],183:[function(e,t,r){function n(){}function i(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function o(e){return e===Object(e)}function a(e){if(!o(e))return e;var t=[];for(var r in e)null!=e[r]&&s(t,r,e[r]);return t.join("&")}function s(e,t,r){return Array.isArray(r)?r.forEach(function(r){s(e,t,r)}):void e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}function c(e){for(var t,r,n={},i=e.split("&"),o=0,a=i.length;a>o;++o)r=i[o],t=r.split("="),n[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return n}function u(e){var t,r,n,i,o=e.split(/\r?\n/),a={};o.pop();for(var s=0,c=o.length;c>s;++s)r=o[s],t=r.indexOf(":"),n=r.slice(0,t).toLowerCase(),i=E(r.slice(t+1)),a[n]=i;return a}function f(e){return/[\/+]json\b/.test(e)}function p(e){return e.split(/ *; */).shift()}function l(e){return b(e.split(/ *; */),function(e,t){var r=t.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(e[n]=i),e},{})}function h(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=u(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function d(e,t){var r=this;v.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new h(r)}catch(n){return e=new Error("Parser is unable to parse the response"), +e.parse=!0,e.original=n,e.rawResponse=r.xhr&&r.xhr.responseText?r.xhr.responseText:null,r.callback(e)}if(r.emit("response",t),e)return r.callback(e,t);if(t.status>=200&&t.status<300)return r.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,r.callback(i,t)})}function m(e,t){return"function"==typeof t?new d("GET",e).end(t):1==arguments.length?new d("GET",e):new d(e,t)}function y(e,t){var r=m("DELETE",e);return t&&r.end(t),r}var g,v=e("emitter"),b=e("reduce");g="undefined"!=typeof window?window:"undefined"!=typeof self?self:this,m.getXHR=function(){if(!(!g.XMLHttpRequest||g.location&&"file:"==g.location.protocol&&g.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var E="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};m.serializeObject=a,m.parseString=c,m.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},m.serialize={"application/x-www-form-urlencoded":a,"application/json":JSON.stringify},m.parse={"application/x-www-form-urlencoded":c,"application/json":JSON.parse},h.prototype.get=function(e){return this.header[e.toLowerCase()]},h.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=p(t);var r=l(t);for(var n in r)this[n]=r[n]},h.prototype.parseBody=function(e){var t=m.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},h.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},h.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,n="cannot "+t+" "+r+" ("+this.status+")",i=new Error(n);return i.status=this.status,i.method=t,i.url=r,i},m.Response=h,v(d.prototype),d.prototype.use=function(e){return e(this),this},d.prototype.timeout=function(e){return this._timeout=e,this},d.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},d.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},d.prototype.set=function(e,t){if(o(e)){for(var r in e)this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},d.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},d.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},d.prototype.type=function(e){return this.set("Content-Type",m.types[e]||e),this},d.prototype.parse=function(e){return this._parser=e,this},d.prototype.accept=function(e){return this.set("Accept",m.types[e]||e),this},d.prototype.auth=function(e,t){var r=btoa(e+":"+t);return this.set("Authorization","Basic "+r),this},d.prototype.query=function(e){return"string"!=typeof e&&(e=a(e)),e&&this._query.push(e),this},d.prototype.field=function(e,t){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t),this},d.prototype.attach=function(e,t,r){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t,r||t.name),this},d.prototype.send=function(e){var t=o(e),r=this.getHeader("Content-Type");if(t&&o(this._data))for(var n in e)this._data[n]=e[n];else"string"==typeof e?(r||this.type("form"),r=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==r?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||i(e)?this:(r||this.type("json"),this)},d.prototype.callback=function(e,t){var r=this._callback;this.clearTimeout(),r(e,t)},d.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},d.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},d.prototype.withCredentials=function(){return this._withCredentials=!0,this},d.prototype.end=function(e){var t=this,r=this.xhr=m.getXHR(),o=this._query.join("&"),a=this._timeout,s=this._formData||this._data;this._callback=e||n,r.onreadystatechange=function(){if(4==r.readyState){var e;try{e=r.status}catch(n){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var c=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),e.direction="download",t.emit("progress",e)};this.hasListeners("progress")&&(r.onprogress=c);try{r.upload&&this.hasListeners("progress")&&(r.upload.onprogress=c)}catch(u){}if(a&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},a)),o&&(o=m.serializeObject(o),this.url+=~this.url.indexOf("?")?"&"+o:"?"+o),r.open(this.method,this.url,!0),this._withCredentials&&(r.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!i(s)){var p=this.getHeader("Content-Type"),l=this._parser||m.serialize[p?p.split(";")[0]:""];!l&&f(p)&&(l=m.serialize["application/json"]),l&&(s=l(s))}for(var h in this.header)null!=this.header[h]&&r.setRequestHeader(h,this.header[h]);return this.emit("request",this),r.send("undefined"!=typeof s?s:null),this},d.prototype.then=function(e,t){return this.end(function(r,n){r?t(r):e(n)})},m.Request=d,m.get=function(e,t,r){var n=m("GET",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},m.head=function(e,t,r){var n=m("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},m.del=y,m["delete"]=y,m.patch=function(e,t,r){var n=m("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},m.post=function(e,t,r){var n=m("POST",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},m.put=function(e,t,r){var n=m("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},t.exports=m},{emitter:6,reduce:180}],184:[function(e,t,r){function n(e,t){if("object"!=typeof e)throw new Error("resourceListing must be an object");Array.isArray(t)||(t=[]);var r={},n={},a={swagger:"2.0",info:i(e),paths:{}};return e.authorizations&&(a.securityDefinitions=l(e,r)),e.basePath&&o(e.basePath,a),m(n,e.models),Array.isArray(e.apis)&&(t.length>0&&(a.tags=[]),e.apis.forEach(function(t){a.tags&&a.tags.push({name:t.path.replace(".{format}","").substring(1),description:t.description}),Array.isArray(t.operations)&&(a.paths[t.path]=s(t,e))})),t.forEach(function(e){e.basePath&&o(e.basePath,a),Array.isArray(e.apis)&&(e.apis.forEach(function(t){a.paths[t.path]=s(t,e)}),e.models&&Object.keys(e.models).length&&m(n,d(e.models)))}),Object.keys(n).length&&(a.definitions=d(n)),a}function i(e){var t={version:e.apiVersion,title:"Title was not specified"};return"object"==typeof e.info&&(e.info.title&&(t.title=e.info.title),e.info.description&&(t.description=e.info.description),e.info.contact&&(t.contact={email:e.info.contact}),e.info.license&&(t.license={name:e.info.license,url:e.info.licenseUrl}),e.info.termsOfServiceUrl&&(t.termsOfService=e.info.termsOfServiceUrl)),t}function o(e,t){var r=g(e);t.host=r.host,t.basePath=r.path,r.protocol&&(t.schemes=[r.protocol.substr(0,r.protocol.length-1)])}function a(e,t){return e=v(e),e.$ref&&-1===e.$ref.indexOf("#/definitions/")?e.$ref="#/definitions/"+e.$ref:e.items&&e.items.$ref&&-1===e.items.$ref.indexOf("#/definitions/")&&(e.items.$ref="#/definitions/"+e.items.$ref),t&&e.type&&-1===b.indexOf(e.type)&&(e={$ref:"#/definitions/"+e.type}),e.minimum&&(e.minimum=y(e.minimum)),e.maximum&&(e.maximum=y(e.maximum)),e.defaultValue&&(e["default"]=e.defaultValue,delete e.defaultValue,e.type&&"string"!==e.type&&(e["default"]=y(e["default"]))),e}function s(e,t){var r={};return e.operations.forEach(function(e){var n=e.method.toLowerCase();r[n]=c(e,t.produces,t.consumes,t.resourcePath)}),r}function c(e,t,r,n){var i={responses:{},description:e.description||""};if(n&&(i.tags=[],i.tags.push(n.substr(1))),e.summary&&(i.summary=e.summary),e.nickname&&(i.operationId=e.nickname),t&&(i.produces=t),r&&(i.consumes=r),Array.isArray(e.parameters)&&e.parameters.length&&(i.parameters=e.parameters.map(function(e){return f(e)})),Array.isArray(e.responseMessages)&&e.responseMessages.forEach(function(e){i.responses[e.code]=u(e)}),(!Object.keys(i.responses).length||!i.responses[200]&&e.type)&&(i.responses[200]={description:"No response was specified"}),e.type&&"void"!==e.type){var o=p(e);-1===b.indexOf(e.type)&&(o={$ref:"#/definitions/"+e.type}),i.responses[200].schema=o}return i}function u(e){var t={};return t.description=e.message,t}function f(e){var t={"in":e.paramType,description:e.description,name:e.name,required:!!e.required};return-1===b.indexOf(e.type)?t.schema={$ref:"#/definitions/"+e.type}:"body"===e.paramType?t.schema=p(e):m(t,p(e)),"form"===t["in"]&&(t["in"]="formData"),t}function p(e){var t={},r=["default","maximum","minimum","items"];return e=a(e,!1),t.type=e.type.toLowerCase(),r.forEach(function(r){"undefined"!=typeof e[r]&&(t[r]=e[r])}),"undefined"!=typeof e.defaultValue&&(t["default"]=e.defaultValue),t}function l(e,t){var r={};return Object.keys(e.authorizations).forEach(function(n){var i=e.authorizations[n],o=function(e){var t=r[e||n]={type:i.type};return i.passAs&&(t["in"]=i.passAs),i.keyname&&(t.name=i.keyname),t};i.grantTypes?(t[n]=[],Object.keys(i.grantTypes).forEach(function(e){var r=i.grantTypes[e],a=n+"_"+e,s=o(a);switch(t[n].push(a),"implicit"===e?s.flow="implicit":s.flow="accessCode",e){case"implicit":s.authorizationUrl=r.loginEndpoint.url;break;case"authorization_code":s.authorizationUrl=r.tokenRequestEndpoint.url,s.tokenUrl=r.tokenEndpoint.url}i.scopes&&(s.scopes={},i.scopes.forEach(function(e){s.scopes[e.scope]=e.description||"Undescribed "+e.scope}))})):o()}),r}function h(e){"object"==typeof e.properties&&Object.keys(e.properties).forEach(function(t){e.properties[t]=a(e.properties[t],!0)})}function d(e){var t=v(e);if("object"!=typeof e)throw new Error("models must be object");var r={};return Object.keys(t).forEach(function(e){var n=t[e];delete n.id,h(n),n.subTypes&&(r[e]=n.subTypes,delete n.subTypes)}),Object.keys(r).forEach(function(e){r[e].forEach(function(r){var n=t[r];if(n){var i=(n.allOf||[]).concat({$ref:"#/definitions/"+e}).concat(v(n));for(var o in n)delete n[o];n.allOf=i}})}),t}function m(e,t){if("object"!=typeof e)throw new Error("source must be objects");"object"==typeof t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}function y(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){throw Error("incorect property value: "+t.message)}}var g=e("url").parse,v=e("lodash.clonedeep"),b=["string","number","boolean","integer","array","void","File"];"undefined"==typeof window?t.exports=n:window.SwaggerConverter=window.SwaggerConverter||{convert:n}},{"lodash.clonedeep":159,url:192}],185:[function(e,t,r){function n(e){this.value=e}function i(e,t,r){var n=[],i=[],a=!0;return function s(e){function c(){if("object"==typeof l.node&&null!==l.node){l.keys&&l.node_===l.node||(l.keys=d(l.node)),l.isLeaf=0==l.keys.length;for(var t=0;t1&&(i=n[0]+"@",e=n[1]),e=e.replace(w,".");var o=e.split("."),a=t(o,r).join(".");return i+a}function n(e){for(var t,r,n=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(r=e.charCodeAt(i++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--)):n.push(t);return n}function i(e){return t(e,function(e){var t="";return e>65535&&(e-=65536,t+=P(e>>>10&1023|55296),e=56320|1023&e),t+=P(e)}).join("")}function o(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:d}function a(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function s(e,t,r){var n=0;for(e=r?I(e/v):e>>1,e+=I(e/t);e>_*y>>1;n+=d)e=I(e/_);return I(n+(_+1)*e/(e+g))}function c(t){var r,n,a,c,u,f,p,l,g,v,O=[],j=t.length,w=0,A=E,_=b;for(n=t.lastIndexOf(x),0>n&&(n=0),a=0;n>a;++a)t.charCodeAt(a)>=128&&e("not-basic"),O.push(t.charCodeAt(a));for(c=n>0?n+1:0;j>c;){for(u=w,f=1,p=d;c>=j&&e("invalid-input"),l=o(t.charCodeAt(c++)),(l>=d||l>I((h-w)/f))&&e("overflow"),w+=l*f,g=_>=p?m:p>=_+y?y:p-_,!(g>l);p+=d)v=d-g,f>I(h/v)&&e("overflow"),f*=v;r=O.length+1,_=s(w-u,r,0==u),I(w/r)>h-A&&e("overflow"),A+=I(w/r),w%=r,O.splice(w++,0,A)}return i(O)}function u(t){var r,i,o,c,u,f,p,l,g,v,O,j,w,A,_,S=[];for(t=n(t),j=t.length,r=E,i=0,u=b,f=0;j>f;++f)O=t[f],128>O&&S.push(P(O));for(o=c=S.length,c&&S.push(x);j>o;){for(p=h,f=0;j>f;++f)O=t[f],O>=r&&p>O&&(p=O);for(w=o+1,p-r>I((h-i)/w)&&e("overflow"),i+=(p-r)*w,r=p,f=0;j>f;++f)if(O=t[f],r>O&&++i>h&&e("overflow"),O==r){for(l=i,g=d;v=u>=g?m:g>=u+y?y:g-u,!(v>l);g+=d)_=l-v,A=d-v,S.push(P(a(v+_%A,0))),l=I(_/A);S.push(P(a(l,0))),u=s(i,w,o==c),i=0,++o}++i,++r}return S.join("")}function f(e){return r(e,function(e){return O.test(e)?c(e.slice(4).toLowerCase()):e})}function p(e){return r(e,function(e){return j.test(e)?"xn--"+u(e):e})}var l,h=2147483647,d=36,m=1,y=26,g=38,v=700,b=72,E=128,x="-",O=/^xn--/,j=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=d-m,I=Math.floor,P=String.fromCharCode;return l={version:"1.3.2",ucs2:{decode:n,encode:i},decode:c,encode:u,toASCII:p,toUnicode:f}}();"undefined"==typeof COMPILED&&"undefined"!=typeof t&&(t.exports=n)},{}],187:[function(e,t,r){e("./schemes/http"),e("./schemes/urn"),e("./schemes/mailto")},{"./schemes/http":188,"./schemes/mailto":189,"./schemes/urn":190}],188:[function(e,t,r){if("undefined"==typeof COMPILED&&"undefined"==typeof n&&"function"==typeof e)var n=e("../uri");n.SCHEMES.http=n.SCHEMES.https={domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return(e.port===("https"!==String(e.scheme).toLowerCase()?80:443)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}}},{"../uri":191}],189:[function(e,t,r){if("undefined"==typeof COMPILED&&"undefined"==typeof n&&"function"==typeof e)var n=e("../uri"),i=e("../punycode");!function(){function e(){for(var e=[],t=0;t1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,n=1;r>n;++n)e[n]=e[n].slice(1,-1);return e[r]=e[r].slice(1),e.join("")}return e[0]}function t(e){return"(?:"+e+")"}function r(e){return e.toUpperCase()}function o(e){var t=n.pctDecChars(e);return t.match(C)?t:e}function a(e){return void 0!==e&&null!==e?e instanceof Array&&!e.callee?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}var s={},c=n.IRI_SUPPORT,u="[A-Za-z0-9\\-\\.\\_\\~"+(c?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",f="[0-9A-Fa-f]",p=t(t("%[EFef]"+f+"%"+f+f+"%"+f+f)+"|"+t("%[89A-Fa-f]"+f+"%"+f+f)+"|"+t("%"+f+f)),l="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",h="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",d=e(h,'[\\"\\\\]'),m=t(l+"+"+t("\\."+l+"+")+"*"),y=t("\\\\"+d),g=t(h+"|"+y),v=t('\\"'+g+'*\\"'),b="[\\x21-\\x5A\\x5E-\\x7E]",E="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",x=t(u+"|"+p+"|"+E),O=t(m+"|\\["+b+"*\\]"),j=t(m+"|"+v),w=t(j+"\\@"+O),A=t(w+t("\\,"+w)+"*"),_=t(x+"*"),I=_,P=t(_+"\\="+I),S=t(P+t("\\&"+P)+"*"),T=t("\\?"+S),C=(n.VALIDATE_SUPPORT&&new RegExp("^mailto\\:"+A+"?"+T+"?$"),new RegExp(u,"g")),$=new RegExp(p,"g"),D=new RegExp(e("[^]",l,"[\\.]",'[\\"]',d),"g"),R=new RegExp(e("[^]",l,"[\\.]","[\\[]",b,"[\\]]"),"g"),k=new RegExp(e("[^]",u,E),"g"),F=k,U=n.VALIDATE_SUPPORT&&new RegExp("^"+A+"$"),L=n.VALIDATE_SUPPORT&&new RegExp("^"+S+"$");n.SCHEMES.mailto={parse:function(e,t){n.VALIDATE_SUPPORT&&!e.error&&(e.path&&!U.test(e.path)?e.error="Email address is not valid":e.query&&!L.test(e.query)&&(e.error="Header fields are invalid"));var r=e.to=e.path?e.path.split(","):[];if(e.path=void 0,e.query){for(var o=!1,a={},s=e.query.split("&"),c=0,u=s.length;u>c;++c){var f=s[c].split("=");switch(f[0]){case"to":for(var p=f[1].split(","),l=0,h=p.length;h>l;++l)r.push(p[l]);break;case"subject":e.subject=n.unescapeComponent(f[1],t);break;case"body":e.body=n.unescapeComponent(f[1],t);break;default:o=!0,a[n.unescapeComponent(f[0],t)]=n.unescapeComponent(f[1],t)}}o&&(e.headers=a)}e.query=void 0;for(var c=0,u=r.length;u>c;++c){var d=r[c].split("@");if(d[0]=n.unescapeComponent(d[0]),"undefined"==typeof i||t.unicodeSupport)d[1]=n.unescapeComponent(d[1],t).toLowerCase();else try{d[1]=i.toASCII(n.unescapeComponent(d[1],t).toLowerCase())}catch(m){e.error=e.error||"Email address's domain name can not be converted to ASCII via punycode: "+m}r[c]=d.join("@")}return e},serialize:function(e,t){var c=a(e.to);if(c){for(var u=0,f=c.length;f>u;++u){var p=String(c[u]),l=p.lastIndexOf("@"),h=p.slice(0,l),d=p.slice(l+1);if(h=h.replace($,o).replace($,r).replace(D,n.pctEncChar),"undefined"!=typeof i)try{d=t.iri?i.toUnicode(d):i.toASCII(n.unescapeComponent(d,t).toLowerCase())}catch(m){e.error=e.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+m}else d=d.replace($,o).toLowerCase().replace($,r).replace(R,n.pctEncChar);c[u]=h+"@"+d}e.path=c.join(",")}var y=e.headers=e.headers||{};e.subject&&(y.subject=e.subject),e.body&&(y.body=e.body);var g=[];for(var v in y)y[v]!==s[v]&&g.push(v.replace($,o).replace($,r).replace(k,n.pctEncChar)+"="+y[v].replace($,o).replace($,r).replace(F,n.pctEncChar));return g.length&&(e.query=g.join("&")),e}}}()},{"../punycode":186,"../uri":191}],190:[function(e,t,r){if("undefined"==typeof COMPILED&&"undefined"==typeof n&&"function"==typeof e)var n=e("../uri");!function(){var e=n.pctEncChar,t="(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})",r="(?:\\%[0-9A-Fa-f]{2})",i="[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]",o="(?:(?:"+r+"|"+i+")+)",a=new RegExp("^urn\\:("+t+")$"),s=new RegExp("^("+t+")\\:("+o+")$"),c=/^([^\:]+)\:(.*)/,u=/[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g,f=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;n.SCHEMES.urn={parse:function(e,t){var r,i,o=e.path.match(s);return o||(t.tolerant||(e.error=e.error||"URN is not strictly valid."),o=e.path.match(c)),o?(r="urn:"+o[1].toLowerCase(),i=n.SCHEMES[r],i||(i=n.SCHEMES[r]={parse:function(e,t){return e},serialize:n.SCHEMES.urn.serialize}),e.scheme=r,e.path=o[2],e=i.parse(e,t)):e.error=e.error||"URN can not be parsed.",e},serialize:function(t,r){var n,i=t.scheme||r.scheme;if(i&&"urn"!==i){var n=i.match(a);n||(n=["urn:"+i,i]),t.scheme="urn",t.path=n[1]+":"+(t.path?t.path.replace(u,e):"")}return t}},n.SCHEMES["urn:uuid"]={parse:function(e,t){return t.tolerant||e.path&&e.path.match(f)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e,t){return t.tolerant||e.path&&e.path.match(f)?e.path=(e.path||"").toLowerCase():e.scheme=void 0,n.SCHEMES.urn.serialize(e,t)}}}()},{"../uri":191}],191:[function(e,t,r){var n=!1,i=!0,o=!0,a=function(){function e(){for(var e=[],t=0;t1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,n=1;r>n;++n)e[n]=e[n].slice(1,-1);return e[r]=e[r].slice(1),e.join("")}return e[0]}function t(e){return"(?:"+e+")"}function r(r){var n="[A-Za-z]",i="[0-9]",a=e(i,"[A-Fa-f]"),s=t(t("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+t("%[89A-Fa-f]"+a+"%"+a+a)+"|"+t("%"+a+a)),c="[\\:\\/\\?\\#\\[\\]\\@]",u="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",f=e(c,u),p=r?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",l=r?"[\\uE000-\\uF8FF]":"[]",h=e(n,i,"[\\-\\.\\_\\~]",p),d=t(n+e(n,i,"[\\+\\-\\.]")+"*"),m=t(t(s+"|"+e(h,u,"[\\:]"))+"*"),y=t(t("25[0-5]")+"|"+t("2[0-4]"+i)+"|"+t("1"+i+i)+"|"+t("[1-9]"+i)+"|"+i),g=t(y+"\\."+y+"\\."+y+"\\."+y),v=t(a+"{1,4}"),b=(t(t(v+"\\:"+v)+"|"+g),t(e(h,u,"[\\:]")+"+")),E=t("v"+a+"+\\."+e(h,u,"[\\:]")+"+"),x=t("\\["+t(b+"|"+E)+"\\]"),O=t(t(s+"|"+e(h,u))+"*"),j=t(x+"|"+g+"(?!"+O+")|"+O),w=t(i+"*"),A=t(t(m+"@")+"?"+j+t("\\:"+w)+"?"),_=t(s+"|"+e(h,u,"[\\:\\@]")),I=t(_+"*"),P=t(_+"+"),S=t(t(s+"|"+e(h,u,"[\\@]"))+"+"),T=t(t("\\/"+I)+"*"),C=t("\\/"+t(P+T)+"?"),$=t(S+T),D=t(P+T),R="(?!"+_+")",k=(t(T+"|"+C+"|"+$+"|"+D+"|"+R),t(t(_+"|"+e("[\\/\\?]",l))+"*")),F=t(t(_+"|[\\/\\?]")+"*"),U=t(t("\\/\\/"+A+T)+"|"+C+"|"+D+"|"+R),L=t(d+"\\:"+U+t("\\?"+k)+"?"+t("\\#"+F)+"?"),N=t(t("\\/\\/"+A+T)+"|"+C+"|"+$+"|"+R),M=t(N+t("\\?"+k)+"?"+t("\\#"+F)+"?"),q=(t(L+"|"+M),t(d+"\\:"+U+t("\\?"+k)+"?"),"^("+d+")\\:"+t(t("\\/\\/("+t("("+m+")@")+"?("+j+")"+t("\\:("+w+")")+"?)")+"?("+T+"|"+C+"|"+D+"|"+R+")")+t("\\?("+k+")")+"?"+t("\\#("+F+")")+"?$"),Y="^(){0}"+t(t("\\/\\/("+t("("+m+")@")+"?("+j+")"+t("\\:("+w+")")+"?)")+"?("+T+"|"+C+"|"+$+"|"+R+")")+t("\\?("+k+")")+"?"+t("\\#("+F+")")+"?$";"^("+d+")\\:"+t(t("\\/\\/("+t("("+m+")@")+"?("+j+")"+t("\\:("+w+")")+"?)")+"?("+T+"|"+C+"|"+D+"|"+R+")")+t("\\?("+k+")")+"?$","^"+t("\\#("+F+")")+"?$","^"+t("("+m+")@")+"?("+j+")"+t("\\:("+w+")")+"?$";return{URI_REF:o&&new RegExp("("+q+")|("+Y+")"),NOT_SCHEME:new RegExp(e("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",h,u),"g"),NOT_HOST:new RegExp(e("[^\\%]",h,u),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",h,u),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",h,u),"g"),NOT_QUERY:new RegExp(e("[^\\%]",h,u,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",h,u,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",h,u),"g"),UNRESERVED:new RegExp(h,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",h,f),"g"),PCT_ENCODED:new RegExp(s,"g")}}function n(e){var t,r=e.charCodeAt(0);return t=16>r?"%0"+r.toString(16).toUpperCase():128>r?"%"+r.toString(16).toUpperCase():2048>r?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function a(e){for(var t,r,n,i="",o=0,a=e.length;a>o;)t=parseInt(e.substr(o+1,2),16),128>t?(i+=String.fromCharCode(t),o+=3):t>=194&&224>t?(a-o>=6?(r=parseInt(e.substr(o+4,2),16),i+=String.fromCharCode((31&t)<<6|63&r)):i+=e.substr(o,6),o+=6):t>=224?(a-o>=9?(r=parseInt(e.substr(o+4,2),16),n=parseInt(e.substr(o+7,2),16),i+=String.fromCharCode((15&t)<<12|(63&r)<<6|63&n)):i+=e.substr(o,9),o+=9):(i+=e.substr(o,3),o+=3);return i}function c(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function u(e){return e.toUpperCase()}function f(e,t){function r(e){var r=a(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,n).replace(t.PCT_ENCODED,u)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,n).replace(t.PCT_ENCODED,u)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,n).replace(t.PCT_ENCODED,u)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,n).replace(t.PCT_ENCODED,u)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,n).replace(t.PCT_ENCODED,u)),e}function p(e,t){void 0===t&&(t={});var r,n,c=i&&t.iri!==!1?O:x,u=!1,p={};if("suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e),o?(r=e.match(c.URI_REF),r&&(r=r[1]?r.slice(1,10):r.slice(10,19)),r||(u=!0,t.tolerant||(p.error=p.error||"URI is not strictly valid."),r=e.match(j))):r=e.match(j),r){if(P?(p.scheme=r[1],p.userinfo=r[3],p.host=r[4],p.port=parseInt(r[5],10),p.path=r[6]||"",p.query=r[7],p.fragment=r[8],isNaN(p.port)&&(p.port=r[5])):(p.scheme=r[1]||void 0,p.userinfo=-1!==e.indexOf("@")?r[3]:void 0,p.host=-1!==e.indexOf("//")?r[4]:void 0,p.port=parseInt(r[5],10),p.path=r[6]||"",p.query=-1!==e.indexOf("?")?r[7]:void 0,p.fragment=-1!==e.indexOf("#")?r[8]:void 0,isNaN(p.port)&&(p.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?r[4]:void 0)),void 0!==p.scheme||void 0!==p.userinfo||void 0!==p.host||void 0!==p.port||p.path||void 0!==p.query?void 0===p.scheme?p.reference="relative":void 0===p.fragment?p.reference="absolute":p.reference="uri":p.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==p.reference&&(p.error=p.error||"URI is not a "+t.reference+" reference."),n=S[(t.scheme||p.scheme||"").toLowerCase()],!i||"undefined"==typeof s||t.unicodeSupport||n&&n.unicodeSupport)f(p,c);else{if(p.host&&(t.domainHost||n&&n.domainHost))try{p.host=s.toASCII(p.host.replace(c.PCT_ENCODED,a).toLowerCase())}catch(l){p.error=p.error||"Host's domain name can not be converted to ASCII via punycode: "+l}f(p,x)}n&&n.parse&&n.parse(p,t)}else u=!0,p.error=p.error||"URI can not be parsed.";return p}function l(e,t){var r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(e.host),"number"==typeof e.port&&(r.push(":"),r.push(e.port.toString(10))),r.length?r.join(""):void 0}function h(e){for(var t,r=[];e.length;)e.match(w)?e=e.replace(w,""):e.match(A)?e=e.replace(A,"/"):e.match(_)?(e=e.replace(_,"/"),r.pop()):"."===e||".."===e?e="":(t=e.match(I)[0],e=e.slice(t.length),r.push(t));return r.join("")}function d(e,t){void 0===t&&(t={});var r,n,o,c=i&&t.iri?O:x,u=[];if(r=S[(t.scheme||e.scheme||"").toLowerCase()],r&&r.serialize&&r.serialize(e,t),i&&"undefined"!=typeof s&&e.host&&(t.domainHost||r&&r.domainHost))try{e.host=t.iri?s.toUnicode(e.host):s.toASCII(e.host.replace(c.PCT_ENCODED,a).toLowerCase())}catch(p){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+p}return f(e,c),"suffix"!==t.reference&&e.scheme&&(u.push(e.scheme),u.push(":")),n=l(e,t),void 0!==n&&("suffix"!==t.reference&&u.push("//"),u.push(n),e.path&&"/"!==e.path.charAt(0)&&u.push("/")),void 0!==e.path&&(o=e.path,t.absolutePath||r&&r.absolutePath||(o=h(o)),void 0===n&&(o=o.replace(/^\/\//,"/%2F")),u.push(o)),void 0!==e.query&&(u.push("?"),u.push(e.query)),void 0!==e.fragment&&(u.push("#"),u.push(e.fragment)),u.join("")}function m(e,t,r,n){void 0===r&&(r={});var i={};return n||(e=p(d(e,r),r),t=p(d(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=h(t.path),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=h(t.path),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=h(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=h(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function y(e,t,r){return d(m(p(e,r),p(t,r),r,!0),r)}function g(e,t){return"string"==typeof e?e=d(p(e,t),t):"object"===c(e)&&(e=p(d(e,t),t)),e}function v(e,t,r){return"string"==typeof e?e=d(p(e,r),r):"object"===c(e)&&(e=d(e,r)),"string"==typeof t?t=d(p(t,r),r):"object"===c(t)&&(t=d(t,r)),e===t}function b(e,t){return e&&e.toString().replace(i&&t&&t.iri?O.ESCAPE:x.ESCAPE,n)}function E(e,t){return e&&e.toString().replace(i&&t&&t.iri?O.PCT_ENCODED:x.PCT_ENCODED,a)}var x=r(!1),O=i?r(!0):void 0,j=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i,w=/^\.\.?\//,A=/^\/\.(\/|$)/,_=/^\/\.\.(\/|$)/,I=/^\/?(?:.|\n)*?(?=\/|$)/,P=void 0==="".match(/(){0}/)[1],S={};return{IRI_SUPPORT:i,VALIDATE_SUPPORT:o,pctEncChar:n,pctDecChars:a,SCHEMES:S,parse:p,_recomposeAuthority:l,removeDotSegments:h,serialize:d,resolveComponents:m,resolve:y, +normalize:g,equal:v,escapeComponent:b,unescapeComponent:E}}();if(!n&&"undefined"!=typeof t&&"function"==typeof e){var s=e("./punycode");t.exports=a,e("./schemes")}},{"./punycode":186,"./schemes":187}],192:[function(e,t,r){function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,r){if(e&&u(e)&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}function o(e){return c(e)&&(e=i(e)),e instanceof n?e.format():n.prototype.format.call(e)}function a(e,t){return i(e,!1,!0).resolve(t)}function s(e,t){return e?i(e,!1,!0).resolveObject(t):t}function c(e){return"string"==typeof e}function u(e){return"object"==typeof e&&null!==e}function f(e){return null===e}function p(e){return null==e}var l=e("punycode");r.parse=i,r.resolve=a,r.resolveObject=s,r.format=o,r.Url=n;var h=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,m=["<",">",'"',"`"," ","\r","\n"," "],y=["{","}","|","\\","^","`"].concat(m),g=["'"].concat(y),v=["%","/","?",";","#"].concat(g),b=["/","?","#"],E=255,x=/^[a-z0-9A-Z_-]{0,63}$/,O=/^([a-z0-9A-Z_-]{0,63})(.*)$/,j={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},A={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=e("querystring");n.prototype.parse=function(e,t,r){if(!c(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e;n=n.trim();var i=h.exec(n);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,n=n.substr(i.length)}if(r||i||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var a="//"===n.substr(0,2);!a||i&&w[i]||(n=n.substr(2),this.slashes=!0)}if(!w[i]&&(a||i&&!A[i])){for(var s=-1,u=0;uf)&&(s=f)}var p,d;d=-1===s?n.lastIndexOf("@"):n.lastIndexOf("@",s),-1!==d&&(p=n.slice(0,d),n=n.slice(d+1),this.auth=decodeURIComponent(p)),s=-1;for(var u=0;uf)&&(s=f)}-1===s&&(s=n.length),this.host=n.slice(0,s),n=n.slice(s),this.parseHost(),this.hostname=this.hostname||"";var m="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!m)for(var y=this.hostname.split(/\./),u=0,I=y.length;I>u;u++){var P=y[u];if(P&&!P.match(x)){for(var S="",T=0,C=P.length;C>T;T++)S+=P.charCodeAt(T)>127?"x":P[T];if(!S.match(x)){var $=y.slice(0,u),D=y.slice(u+1),R=P.match(O);R&&($.push(R[1]),D.unshift(R[2])),D.length&&(n="/"+D.join(".")+n),this.hostname=$.join(".");break}}}if(this.hostname.length>E?this.hostname="":this.hostname=this.hostname.toLowerCase(),!m){for(var k=this.hostname.split("."),F=[],u=0;uu;u++){var M=g[u],q=encodeURIComponent(M);q===M&&(q=escape(M)),n=n.split(M).join(q)}var Y=n.indexOf("#");-1!==Y&&(this.hash=n.substr(Y),n=n.slice(0,Y));var B=n.indexOf("?");if(-1!==B?(this.search=n.substr(B),this.query=n.substr(B+1),t&&(this.query=_.parse(this.query)),n=n.slice(0,B)):t&&(this.search="",this.query={}),n&&(this.pathname=n),A[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var L=this.pathname||"",U=this.search||"";this.path=L+U}return this.href=this.format(),this},n.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=_.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||A[t])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),a=a.replace("#","%23"),t+i+r+a+n},n.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},n.prototype.resolveObject=function(e){if(c(e)){var t=new n;t.parse(e,!1,!0),e=t}var r=new n;if(Object.keys(this).forEach(function(e){r[e]=this[e]},this),r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(r[t]=e[t])}),A[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(e.protocol&&e.protocol!==r.protocol){if(!A[e.protocol])return Object.keys(e).forEach(function(t){r[t]=e[t]}),r.href=r.format(),r;if(r.protocol=e.protocol,e.host||w[e.protocol])r.pathname=e.pathname;else{for(var i=(e.pathname||"").split("/");i.length&&!(e.host=i.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),r.pathname=i.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var o=r.pathname||"",a=r.search||"";r.path=o+a}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var s=r.pathname&&"/"===r.pathname.charAt(0),u=e.host||e.pathname&&"/"===e.pathname.charAt(0),l=u||s||r.host&&e.pathname,h=l,d=r.pathname&&r.pathname.split("/")||[],i=e.pathname&&e.pathname.split("/")||[],m=r.protocol&&!A[r.protocol];if(m&&(r.hostname="",r.port=null,r.host&&(""===d[0]?d[0]=r.host:d.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===i[0]?i[0]=e.host:i.unshift(e.host)),e.host=null),l=l&&(""===i[0]||""===d[0])),u)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,d=i;else if(i.length)d||(d=[]),d.pop(),d=d.concat(i),r.search=e.search,r.query=e.query;else if(!p(e.search)){if(m){r.hostname=r.host=d.shift();var y=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;y&&(r.auth=y.shift(),r.host=r.hostname=y.shift())}return r.search=e.search,r.query=e.query,f(r.pathname)&&f(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!d.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var g=d.slice(-1)[0],v=(r.host||e.host)&&("."===g||".."===g)||""===g,b=0,E=d.length;E>=0;E--)g=d[E],"."==g?d.splice(E,1):".."===g?(d.splice(E,1),b++):b&&(d.splice(E,1),b--);if(!l&&!h)for(;b--;b)d.unshift("..");!l||""===d[0]||d[0]&&"/"===d[0].charAt(0)||d.unshift(""),v&&"/"!==d.join("/").substr(-1)&&d.push("");var x=""===d[0]||d[0]&&"/"===d[0].charAt(0);if(m){r.hostname=r.host=x?"":d.length?d.shift():"";var y=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;y&&(r.auth=y.shift(),r.host=r.hostname=y.shift())}return l=l||r.host&&d.length,l&&!x&&d.unshift(""),d.length?r.pathname=d.join("/"):(r.pathname=null,r.path=null),f(r.pathname)&&f(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=d.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:176,querystring:179}],193:[function(t,r,n){!function(t,i){"undefined"!=typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof e&&"object"==typeof e.amd?e(i):"function"==typeof e&&"object"==typeof e.petal?e(t,[],i):this[t]=i()}("validator",function(e){"use strict";function t(e){var t,r,n,i,o=e.match($);if(o){if(t=o[21],!t)return o[12]?null:0;if("z"===t||"Z"===t)return 0;r=o[22],-1!==t.indexOf(":")?(n=parseInt(o[23]),i=parseInt(o[24])):(n=0,i=parseInt(o[23]))}else{if(e=e.toLowerCase(),t=e.match(/(?:\s|gmt\s*)(-|\+)(\d{1,4})(\s|$)/),!t)return-1!==e.indexOf("gmt")?0:null;r=t[1];var a=t[2];3===a.length&&(a="0"+a),a.length<=2?(n=0,i=parseInt(a)):(n=parseInt(a.slice(0,2)),i=parseInt(a.slice(2,4)))}return(60*n+i)*("-"===r?1:-1)}function r(e,t){e=e||{};for(var r in t)"undefined"==typeof e[r]&&(e[r]=t[r]);return e}function n(e){var t="(\\"+e.symbol.replace(/\./g,"\\.")+")"+(e.require_symbol?"":"?"),r="-?",n="[1-9]\\d*",i="[1-9]\\d{0,2}(\\"+e.thousands_separator+"\\d{3})*",o=["0",n,i],a="("+o.join("|")+")?",s="(\\"+e.decimal_separator+"\\d{2})?",c=a+s;return e.allow_negatives&&!e.parens_for_negatives&&(e.negative_sign_after_digits?c+=r:e.negative_sign_before_digits&&(c=r+c)),e.allow_negative_sign_placeholder?c="( (?!\\-))?"+c:e.allow_space_after_symbol?c=" ?"+c:e.allow_space_after_digits&&(c+="( (?!$))?"),e.symbol_after_digits?c+=t:c=t+c,e.allow_negatives&&(e.parens_for_negatives?c="(\\("+c+"\\)|"+c+")":e.negative_sign_before_digits||e.negative_sign_after_digits||(c=r+c)),new RegExp("^(?!-? )(?=.*\\d)"+c+"$")}e={version:"4.7.0",coerce:!0};var i=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,o=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,a=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,s=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,c=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i,u=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,f=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/,p=/^(?:[0-9]{9}X|[0-9]{10})$/,l=/^(?:[0-9]{13})$/,h=/^([0-9a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"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-HK":/^(\+?852\-?)?[569]\d{3}\-?\d{4}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"el-GR":/^(\+?30)?(69\d{8})$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-US":/^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"vi-VN":/^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,"en-NZ":/^(\+?64|0)2\d{7,9}$/,"en-IN":/^(\+?91|0)?[789]\d{9}$/,"es-ES":/^(\+?34)?(6\d{1}|7[1234])\d{7}$/,"de-DE":/^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,"fi-FI":/^(\+?358|0)\s?(4(0|1|2|4|5)?|50)\s?(\d\s?){4,8}\d$/},$=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;e.extend=function(t,r){e[t]=function(){var t=Array.prototype.slice.call(arguments);return t[0]=e.toString(t[0]),r.apply(e,t)}},e.init=function(){for(var t in e)"function"==typeof e[t]&&"toString"!==t&&"toDate"!==t&&"extend"!==t&&"init"!==t&&e.extend(t,e[t])},e.toString=function(t){if("string"!=typeof t){if(!e.coerce)throw new Error("this library validates strings only");"object"==typeof console&&console&&"function"==typeof console.warn&&console.warn("warning: you tried to validate a "+typeof t+" but this library (github.com/chriso/validator.js) validates strings only. Please update your code as this will be an error soon.")}return"object"==typeof t&&null!==t?t="function"==typeof t.toString?t.toString():"[object Object]":(null===t||"undefined"==typeof t||isNaN(t)&&!t.length)&&(t=""),""+t},e.toDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)?e:(e=Date.parse(e),isNaN(e)?null:new Date(e))},e.toFloat=function(e){return parseFloat(e)},e.toInt=function(e,t){return parseInt(e,t||10)},e.toBoolean=function(e,t){return t?"1"===e||"true"===e:"0"!==e&&"false"!==e&&""!==e},e.equals=function(t,r){return t===e.toString(r)},e.contains=function(t,r){return t.indexOf(e.toString(r))>=0},e.matches=function(e,t,r){return"[object RegExp]"!==Object.prototype.toString.call(t)&&(t=new RegExp(t,r)),t.test(e)};var D={allow_display_name:!1,allow_utf8_local_part:!0,require_tld:!0};e.isEmail=function(t,n){if(n=r(n,D),n.allow_display_name){var u=t.match(c);u&&(t=u[1])}var f=t.split("@"),p=f.pop(),l=f.join("@"),h=p.toLowerCase();if(("gmail.com"===h||"googlemail.com"===h)&&(l=l.replace(/\./g,"").toLowerCase()),!e.isByteLength(l,{max:64})||!e.isByteLength(p,{max:256}))return!1;if(!e.isFQDN(p,{require_tld:n.require_tld}))return!1;if('"'===l[0])return l=l.slice(1,l.length-1),n.allow_utf8_local_part?s.test(l):o.test(l);for(var d=n.allow_utf8_local_part?a:i,m=l.split("."),y=0;y=2083||/\s/.test(t))return!1;if(0===t.indexOf("mailto:"))return!1;n=r(n,R);var i,o,a,s,c,u,f;if(f=t.split("://"),f.length>1){if(i=f.shift(),n.require_valid_protocol&&-1===n.protocols.indexOf(i))return!1}else{if(n.require_protocol)return!1;n.allow_protocol_relative_urls&&"//"===t.substr(0,2)&&(f[0]=t.substr(2))}return t=f.join("://"),f=t.split("#"),t=f.shift(),f=t.split("?"),t=f.shift(),f=t.split("/"),t=f.shift(),f=t.split("@"),f.length>1&&(o=f.shift(),o.indexOf(":")>=0&&o.split(":").length>2)?!1:(s=f.join("@"),f=s.split(":"),a=f.shift(),f.length&&(u=f.join(":"),c=parseInt(u,10),!/^[0-9]+$/.test(u)||0>=c||c>65535)?!1:e.isIP(a)||e.isFQDN(a,n)||"localhost"===a?n.host_whitelist&&-1===n.host_whitelist.indexOf(a)?!1:n.host_blacklist&&-1!==n.host_blacklist.indexOf(a)?!1:!0:!1)},e.isMACAddress=function(e){return h.test(e)},e.isIP=function(t,r){if(r=r?r+"":"",!r)return e.isIP(t,4)||e.isIP(t,6);if("4"===r){if(!d.test(t))return!1;var n=t.split(".").sort(function(e,t){return e-t});return n[3]<=255}if("6"===r){var i=t.split(":"),o=!1,a=e.isIP(i[i.length-1],4),s=a?7:8;if(i.length>s)return!1;if("::"===t)return!0;"::"===t.substr(0,2)?(i.shift(),i.shift(),o=!0):"::"===t.substr(t.length-2)&&(i.pop(),i.pop(),o=!0);for(var c=0;c0&&c=1:i.length===s}return!1};var k={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1};e.isFQDN=function(e,t){t=r(t,k),t.allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));var n=e.split(".");if(t.require_tld){var i=n.pop();if(!n.length||!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(i))return!1}for(var o,a=0;a=0)return!1;o=o.replace(/_/g,"")}if(!/^[a-z\u00a1-\uffff0-9-]+$/i.test(o))return!1;if(/[\uff01-\uff5e]/.test(o))return!1;if("-"===o[0]||"-"===o[o.length-1])return!1;if(o.indexOf("---")>=0&&"xn--"!==o.slice(0,4))return!1}return!0},e.isBoolean=function(e){return["true","false","1","0"].indexOf(e)>=0},e.isAlpha=function(e,t){return t=t||"en-US",g[t].test(e)},e.isAlphanumeric=function(e,t){return t=t||"en-US",v[t].test(e)},e.isNumeric=function(e){return b.test(e)},e.isDecimal=function(e){return""!==e&&j.test(e)},e.isHexadecimal=function(e){return O.test(e)},e.isHexColor=function(e){return w.test(e)},e.isLowercase=function(e){return e===e.toLowerCase()},e.isUppercase=function(e){return e===e.toUpperCase()},e.isInt=function(e,t){return t=t||{},E.test(e)&&(!t.hasOwnProperty("min")||e>=t.min)&&(!t.hasOwnProperty("max")||e<=t.max)},e.isFloat=function(e,t){return t=t||{},""===e||"."===e?!1:x.test(e)&&(!t.hasOwnProperty("min")||e>=t.min)&&(!t.hasOwnProperty("max")||e<=t.max)},e.isDivisibleBy=function(t,r){return e.toFloat(t)%parseInt(r,10)===0},e.isNull=function(e){return 0===e.length},e.isLength=function(e,t){var r,n;"object"==typeof t?(r=t.min||0,n=t.max):(r=arguments[1],n=arguments[2]);var i=e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],o=e.length-i.length;return o>=r&&("undefined"==typeof n||n>=o)},e.isByteLength=function(e,t){var r,n;"object"==typeof t?(r=t.min||0,n=t.max):(r=arguments[1],n=arguments[2]);var i=encodeURI(e).split(/%..|./).length-1;return i>=r&&("undefined"==typeof n||n>=i)},e.isUUID=function(e,t){var r=y[t?t:"all"];return r&&r.test(e)},e.isDate=function(e){var r=new Date(Date.parse(e));if(isNaN(r))return!1;var n=t(e);if(null!==n){var i=r.getTimezoneOffset()-n;r=new Date(r.getTime()+6e4*i)}var o,a,s,c=String(r.getDate());return(a=e.match(/(^|[^:\d])[23]\d([^:\d]|$)/g))?(o=a.map(function(e){return e.match(/\d+/g)[0]}).join("/"),s=String(r.getFullYear()).slice(-2),o===c||o===s?!0:o===c+"/"+s||o===s+"/"+c?!0:!1):!0},e.isAfter=function(t,r){var n=e.toDate(r||new Date),i=e.toDate(t);return!!(i&&n&&i>n)},e.isBefore=function(t,r){var n=e.toDate(r||new Date),i=e.toDate(t);return!!(i&&n&&n>i)},e.isIn=function(t,r){var n;if("[object Array]"===Object.prototype.toString.call(r)){var i=[];for(n in r)i[n]=e.toString(r[n]);return i.indexOf(t)>=0}return"object"==typeof r?r.hasOwnProperty(t):r&&"function"==typeof r.indexOf?r.indexOf(t)>=0:!1},e.isWhitelisted=function(e,t){for(var r=e.length-1;r>=0;r--)if(-1===t.indexOf(e[r]))return!1;return!0},e.isCreditCard=function(e){var t=e.replace(/[^0-9]+/g,"");if(!u.test(t))return!1;for(var r,n,i,o=0,a=t.length-1;a>=0;a--)r=t.substring(a,a+1),n=parseInt(r,10),i?(n*=2,o+=n>=10?n%10+1:n):o+=n,i=!i;return!!(o%10===0?t:!1)},e.isISIN=function(e){if(!f.test(e))return!1;for(var t,r,n=e.replace(/[A-Z]/g,function(e){return parseInt(e,36)}),i=0,o=!0,a=n.length-2;a>=0;a--)t=n.substring(a,a+1),r=parseInt(t,10),o?(r*=2,i+=r>=10?r+1:r):i+=r,o=!o;return parseInt(e.substr(e.length-1),10)===(1e4-i)%10},e.isISBN=function(t,r){if(r=r?r+"":"",!r)return e.isISBN(t,10)||e.isISBN(t,13);var n,i=t.replace(/[\s-]+/g,""),o=0;if("10"===r){if(!p.test(i))return!1;for(n=0;9>n;n++)o+=(n+1)*i.charAt(n);if(o+="X"===i.charAt(9)?100:10*i.charAt(9),o%11===0)return!!i}else if("13"===r){if(!l.test(i))return!1;var a=[1,3];for(n=0;12>n;n++)o+=a[n%2]*i.charAt(n);if(i.charAt(12)-(10-o%10)%10===0)return!!i}return!1},e.isMobilePhone=function(e,t){return t in C?C[t].test(e):!1};var F={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_space_after_digits:!1};e.isCurrency=function(e,t){return t=r(t,F),n(t).test(e)},e.isJSON=function(e){try{var t=JSON.parse(e);return!!t&&"object"==typeof t}catch(r){}return!1},e.isMultibyte=function(e){return _.test(e)},e.isAscii=function(e){return A.test(e)},e.isFullWidth=function(e){return I.test(e)},e.isHalfWidth=function(e){return P.test(e)},e.isVariableWidth=function(e){return I.test(e)&&P.test(e)},e.isSurrogatePair=function(e){return S.test(e)},e.isBase64=function(e){return T.test(e)},e.isMongoId=function(t){return e.isHexadecimal(t)&&24===t.length},e.isISO8601=function(e){return $.test(e)},e.ltrim=function(e,t){var r=t?new RegExp("^["+t+"]+","g"):/^\s+/g;return e.replace(r,"")},e.rtrim=function(e,t){var r=t?new RegExp("["+t+"]+$","g"):/\s+$/g;return e.replace(r,"")},e.trim=function(e,t){var r=t?new RegExp("^["+t+"]+|["+t+"]+$","g"):/^\s+|\s+$/g;return e.replace(r,"")},e.escape=function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\//g,"/").replace(/\`/g,"`")},e.stripLow=function(t,r){var n=r?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return e.blacklist(t,n)},e.whitelist=function(e,t){return e.replace(new RegExp("[^"+t+"]+","g"),"")},e.blacklist=function(e,t){return e.replace(new RegExp("["+t+"]+","g"),"")};var U={lowercase:!0,remove_dots:!0,remove_extension:!0};return e.normalizeEmail=function(t,n){if(n=r(n,U),!e.isEmail(t))return!1;var i=t.split("@",2);if(i[1]=i[1].toLowerCase(),"gmail.com"===i[1]||"googlemail.com"===i[1]){if(n.remove_extension&&(i[0]=i[0].split("+")[0]),n.remove_dots&&(i[0]=i[0].replace(/\./g,"")),!i[0].length)return!1;i[0]=i[0].toLowerCase(),i[1]="gmail.com"}else n.lowercase&&(i[0]=i[0].toLowerCase());return i.join("@")},e.init(),e})},{}],194:[function(e,t,r){"use strict";t.exports={INVALID_TYPE:"Expected type {0} but found type {1}",INVALID_FORMAT:"Object didn't pass validation for format {0}: {1}",ENUM_MISMATCH:"No enum match for: {0}",ANY_OF_MISSING:"Data does not match any schemas from 'anyOf'",ONE_OF_MISSING:"Data does not match any schemas from 'oneOf'",ONE_OF_MULTIPLE:"Data is valid against more than one schema from 'oneOf'",NOT_PASSED:"Data matches schema from 'not'",ARRAY_LENGTH_SHORT:"Array is too short ({0}), minimum {1}",ARRAY_LENGTH_LONG:"Array is too long ({0}), maximum {1}",ARRAY_UNIQUE:"Array items are not unique (indexes {0} and {1})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",MULTIPLE_OF:"Value {0} is not a multiple of {1}",MINIMUM:"Value {0} is less than minimum {1}",MINIMUM_EXCLUSIVE:"Value {0} is equal or less than exclusive minimum {1}",MAXIMUM:"Value {0} is greater than maximum {1}",MAXIMUM_EXCLUSIVE:"Value {0} is equal or greater than exclusive maximum {1}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({0}), minimum {1}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({0}), maximum {1}",OBJECT_MISSING_REQUIRED_PROPERTY:"Missing required property: {0}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed: {0}",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {0} (due to key: {1})",MIN_LENGTH:"String is too short ({0} chars), minimum {1}",MAX_LENGTH:"String is too long ({0} chars), maximum {1}",PATTERN:"String does not match pattern {0}: {1}",KEYWORD_TYPE_EXPECTED:"Keyword '{0}' is expected to be of type '{1}'",KEYWORD_UNDEFINED_STRICT:"Keyword '{0}' must be defined in strict mode",KEYWORD_UNEXPECTED:"Keyword '{0}' is not expected to appear in the schema",KEYWORD_MUST_BE:"Keyword '{0}' must be {1}",KEYWORD_DEPENDENCY:"Keyword '{0}' requires keyword '{1}'",KEYWORD_PATTERN:"Keyword '{0}' is not a valid RegExp pattern: {1}",KEYWORD_VALUE_TYPE:"Each element of keyword '{0}' array must be a '{1}'",UNKNOWN_FORMAT:"There is no validation function for format '{0}'",CUSTOM_MODE_FORCE_PROPERTIES:"{0} must define at least one property if present",REF_UNRESOLVED:"Reference has not been resolved during compilation: {0}",UNRESOLVABLE_REFERENCE:"Reference could not be resolved: {0}",SCHEMA_NOT_REACHABLE:"Validator was not able to read schema with uri: {0}",SCHEMA_TYPE_EXPECTED:"Schema is expected to be of type 'object'",SCHEMA_NOT_AN_OBJECT:"Schema is not an object: {0}",ASYNC_TIMEOUT:"{0} asynchronous task(s) have timed out after {1} ms",PARENT_SCHEMA_VALIDATION_FAILED:"Schema failed to validate against its parent schema, see inner errors for details.",REMOTE_NOT_VALID:"Remote reference didn't compile successfully: {0}"}},{}],195:[function(e,t,r){var n=e("validator"),i={date:function(e){if("string"!=typeof e)return!0;var t=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.exec(e);return null===t?!1:t[2]<"01"||t[2]>"12"||t[3]<"01"||t[3]>"31"?!1:!0},"date-time":function(e){if("string"!=typeof e)return!0;var t=e.toLowerCase().split("t");if(!i.date(t[0]))return!1;var r=/^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$/.exec(t[1]);return null===r?!1:r[1]>"23"||r[2]>"59"||r[3]>"59"?!1:!0},email:function(e){return"string"!=typeof e?!0:n.isEmail(e,{require_tld:!0})},hostname:function(e){if("string"!=typeof e)return!0;var t=/^[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?(\.[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?)*$/.test(e);if(t){if(e.length>255)return!1;for(var r=e.split("."),n=0;n63)return!1}return t},"host-name":function(e){return i.hostname.call(this,e)},ipv4:function(e){return"string"!=typeof e?!0:n.isIP(e,4)},ipv6:function(e){return"string"!=typeof e?!0:n.isIP(e,6)},regex:function(e){try{return RegExp(e),!0}catch(t){return!1}},uri:function(e){return this.options.strictUris?i["strict-uri"].apply(this,arguments):"string"!=typeof e||RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?").test(e)},"strict-uri":function(e){return"string"!=typeof e||n.isURL(e)}};t.exports=i},{validator:193}],196:[function(e,t,r){"use strict";var n=e("./FormatValidators"),i=e("./Report"),o=e("./Utils"),a={multipleOf:function(e,t,r){"number"==typeof r&&"integer"!==o.whatIs(r/t.multipleOf)&&e.addError("MULTIPLE_OF",[r,t.multipleOf],null,t.description)},maximum:function(e,t,r){"number"==typeof r&&(t.exclusiveMaximum!==!0?r>t.maximum&&e.addError("MAXIMUM",[r,t.maximum],null,t.description):r>=t.maximum&&e.addError("MAXIMUM_EXCLUSIVE",[r,t.maximum],null,t.description))},exclusiveMaximum:function(){},minimum:function(e,t,r){"number"==typeof r&&(t.exclusiveMinimum!==!0?rt.maxLength&&e.addError("MAX_LENGTH",[r.length,t.maxLength],null,t.description)},minLength:function(e,t,r){"string"==typeof r&&o.ucs2decode(r).lengtht.items.length&&e.addError("ARRAY_ADDITIONAL_ITEMS",null,null,t.description)},items:function(){},maxItems:function(e,t,r){Array.isArray(r)&&r.length>t.maxItems&&e.addError("ARRAY_LENGTH_LONG",[r.length,t.maxItems],null,t.description)},minItems:function(e,t,r){Array.isArray(r)&&r.lengtht.maxProperties&&e.addError("OBJECT_PROPERTIES_MAXIMUM",[n,t.maxProperties],null,t.description)}},minProperties:function(e,t,r){if("object"===o.whatIs(r)){var n=Object.keys(r).length;n0){var l=this.options.assumeAdditional.length;if(l)for(;l--;){var h=a.indexOf(this.options.assumeAdditional[l]);-1!==h&&a.splice(h,1)}a.length>0&&e.addError("OBJECT_ADDITIONAL_PROPERTIES",[a],null,t.description)}}}},dependencies:function(e,t,n){if("object"===o.whatIs(n))for(var i=Object.keys(t.dependencies),a=i.length;a--;){var s=i[a];if(n[s]){var c=t.dependencies[s];if("object"===o.whatIs(c))r.validate.call(this,e,c,n);else for(var u=c.length;u--;){var f=c[u];void 0===n[f]&&e.addError("OBJECT_DEPENDENCY_KEY",[f,s],null,t.description)}}}},"enum":function(e,t,r){for(var n=!1,i=t["enum"].length;i--;)if(o.areEqual(r,t["enum"][i])){n=!0;break}n===!1&&e.addError("ENUM_MISMATCH",[r],null,t.description)},allOf:function(e,t,n){for(var i=t.allOf.length;i--;){var o=r.validate.call(this,e,t.allOf[i],n);if(this.options.breakOnFirstError&&o===!1)break}},anyOf:function(e,t,n){for(var o=[],a=!1,s=t.anyOf.length;s--&&a===!1;){var c=new i(e);o.push(c),a=r.validate.call(this,c,t.anyOf[s],n)}a===!1&&e.addError("ANY_OF_MISSING",void 0,o,t.description)},oneOf:function(e,t,n){for(var o=0,a=[],s=t.oneOf.length;s--;){var c=new i(e,{maxErrors:1});a.push(c),r.validate.call(this,c,t.oneOf[s],n)===!0&&o++}0===o?e.addError("ONE_OF_MISSING",void 0,a,t.description):o>1&&e.addError("ONE_OF_MULTIPLE",null,null,t.description)},not:function(e,t,n){var o=new i(e);r.validate.call(this,o,t.not,n)===!0&&e.addError("NOT_PASSED",null,null,t.description)},definitions:function(){},format:function(e,t,r){var i=n[t.format];"function"==typeof i?2===i.length?e.addAsyncTask(i,[r],function(n){n!==!0&&e.addError("INVALID_FORMAT",[t.format,r],null,t.description)}):i.call(this,r)!==!0&&e.addError("INVALID_FORMAT",[t.format,r],null,t.description):this.options.ignoreUnknownFormats!==!0&&e.addError("UNKNOWN_FORMAT",[t.format],null,t.description)}},s=function(e,t,n){var i=n.length;if(Array.isArray(t.items))for(;i--;)i0;){if(!t.__$refResolved){e.addError("REF_UNRESOLVED",[t.$ref],null,t.description);break}if(t.__$refResolved===t)break;t=t.__$refResolved,i=Object.keys(t),f--}if(0===f)throw new Error("Circular dependency by $ref references!")}var p=o.whatIs(r);if(t.type)if("string"==typeof t.type){if(p!==t.type&&("integer"!==p||"number"!==t.type)&&(e.addError("INVALID_TYPE",[t.type,p],null,t.description),this.options.breakOnFirstError))return!1}else if(-1===t.type.indexOf(p)&&("integer"!==p||-1===t.type.indexOf("number"))&&(e.addError("INVALID_TYPE",[t.type,p],null,t.description),this.options.breakOnFirstError))return!1; +for(var l=i.length;l--&&!(a[i[l]]&&(a[i[l]].call(this,e,t,r),e.errors.length&&this.options.breakOnFirstError)););return(0===e.errors.length||this.options.breakOnFirstError===!1)&&("array"===p?s.call(this,e,t,r):"object"===p&&c.call(this,e,t,r)),u&&(e.rootSchema=void 0),0===e.errors.length}},{"./FormatValidators":195,"./Report":198,"./Utils":202}],197:[function(e,t,r){"function"!=typeof Number.isFinite&&(Number.isFinite=function(e){return"number"!=typeof e?!1:e!==e||e===1/0||e===-(1/0)?!1:!0})},{}],198:[function(e,t,r){(function(r){"use strict";function n(e,t){this.parentReport=e instanceof n?e:void 0,this.options=e instanceof n?e.options:e||{},this.reportOptions=t||{},this.errors=[],this.path=[],this.asyncTasks=[]}var i=e("lodash.get"),o=e("./Errors"),a=e("./Utils");n.prototype.isValid=function(){if(this.asyncTasks.length>0)throw new Error("Async tasks pending, can't answer isValid");return 0===this.errors.length},n.prototype.addAsyncTask=function(e,t,r){this.asyncTasks.push([e,t,r])},n.prototype.processAsyncTasks=function(e,t){function n(){r.nextTick(function(){var e=0===u.errors.length,r=e?void 0:u.errors;t(r,e)})}function i(e){return function(t){c||(e(t),0===--a&&n())}}var o=e||2e3,a=this.asyncTasks.length,s=a,c=!1,u=this;if(0===a||this.errors.length>0)return void n();for(;s--;){var f=this.asyncTasks[s];f[0].apply(null,f[1].concat(i(f[2])))}setTimeout(function(){a>0&&(c=!0,u.addError("ASYNC_TIMEOUT",[a,o]),t(u.errors,!1))},o)},n.prototype.getPath=function(){var e=[];return this.parentReport&&(e=e.concat(this.parentReport.path)),e=e.concat(this.path),this.options.reportPathAsArray!==!0&&(e="#/"+e.map(function(e){return a.isAbsoluteUri(e)?"uri("+e+")":e.replace(/\~/g,"~0").replace(/\//g,"~1")}).join("/")),e},n.prototype.getSchemaId=function(){if(!this.rootSchema)return null;var e=[];for(this.parentReport&&(e=e.concat(this.parentReport.path)),e=e.concat(this.path);e.length>0;){var t=i(this.rootSchema,e);if(t&&t.id)return t.id;e.pop()}return this.rootSchema.id},n.prototype.hasError=function(e,t){for(var r=this.errors.length;r--;)if(this.errors[r].code===e){for(var n=!0,i=this.errors[r].params.length;i--;)this.errors[r].params[i]!==t[i]&&(n=!1);if(n)return n}return!1},n.prototype.addError=function(e,t,r,n){if(!(this.errors.length>=this.reportOptions.maxErrors)){if(!e)throw new Error("No errorCode passed into addError()");if(!o[e])throw new Error("No errorMessage known for code "+e);t=t||[];for(var i=t.length,s=o[e];i--;){var c=a.whatIs(t[i]),u="object"===c||"null"===c?JSON.stringify(t[i]):t[i];s=s.replace("{"+i+"}",u)}var f={code:e,params:t,message:s,path:this.getPath(),schemaId:this.getSchemaId()};if(n&&(f.description=n),null!=r){for(Array.isArray(r)||(r=[r]),f.inner=[],i=r.length;i--;)for(var p=r[i],l=p.errors.length;l--;)f.inner.push(p.errors[l]);0===f.inner.length&&(f.inner=void 0)}this.errors.push(f)}},t.exports=n}).call(this,e("_process"))},{"./Errors":194,"./Utils":202,_process:175,"lodash.get":162}],199:[function(e,t,r){"use strict";function n(e){return decodeURIComponent(e).replace(/~[0-1]/g,function(e){return"~1"===e?"/":"~"})}function i(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function o(e){var t=e.indexOf("#"),r=-1===t?void 0:e.slice(t+1);return r}function a(e,t){if("object"==typeof e&&null!==e){if(!t)return e;if(e.id&&(e.id===t||"#"===e.id[0]&&e.id.substring(1)===t))return e;var r,n;if(Array.isArray(e)){for(r=e.length;r--;)if(n=a(e[r],t))return n}else{var i=Object.keys(e);for(r=i.length;r--;){var o=i[r];if(0!==o.indexOf("__$")&&(n=a(e[o],t)))return n}}}}var s=e("./Report"),c=e("./SchemaCompilation"),u=e("./SchemaValidation"),f=e("./Utils");r.cacheSchemaByUri=function(e,t){var r=i(e);r&&(this.cache[r]=t)},r.removeFromCacheByUri=function(e){var t=i(e);t&&delete this.cache[t]},r.checkCacheForUri=function(e){var t=i(e);return t?null!=this.cache[t]:!1},r.getSchema=function(e,t){return"object"==typeof t&&(t=r.getSchemaByReference.call(this,e,t)),"string"==typeof t&&(t=r.getSchemaByUri.call(this,e,t)),t},r.getSchemaByReference=function(e,t){for(var r=this.referenceCache.length;r--;)if(this.referenceCache[r][0]===t)return this.referenceCache[r][1];var n=f.cloneDeep(t);return this.referenceCache.push([t,n]),n},r.getSchemaByUri=function(e,t,r){var f=i(t),p=o(t),l=f?this.cache[f]:r;if(l&&f){var h=l!==r;if(h){e.path.push(f);var d=new s(e);c.compileSchema.call(this,d,l)&&u.validateSchema.call(this,d,l);var m=d.isValid();if(m||e.addError("REMOTE_NOT_VALID",[t],d),e.path.pop(),!m)return}}if(l&&p)for(var y=p.split("/"),g=0,v=y.length;l&&v>g;g++){var b=n(y[g]);l=0===g?a(l,b):l[b]}return l},r.getRemotePath=i},{"./Report":198,"./SchemaCompilation":200,"./SchemaValidation":201,"./Utils":202}],200:[function(e,t,r){"use strict";function n(e,t){if(c.isAbsoluteUri(t))return t;var r,n=e.join(""),i=c.isAbsoluteUri(n),o=c.isRelativeUri(n),a=c.isRelativeUri(t);i&&a?(r=n.match(/\/[^\/]*$/),r&&(n=n.slice(0,r.index+1))):o&&a?n="":(r=n.match(/[^#\/]+$/),r&&(n=n.slice(0,r.index)));var s=n+t;return s=s.replace(/##/,"#")}function i(e,t,r,o){if(t=t||[],r=r||[],o=o||[],"object"!=typeof e||null===e)return t;"string"==typeof e.id&&r.push(e.id),"string"==typeof e.$ref&&"undefined"==typeof e.__$refResolved&&t.push({ref:n(r,e.$ref),key:"$ref",obj:e,path:o.slice(0)}),"string"==typeof e.$schema&&"undefined"==typeof e.__$schemaResolved&&t.push({ref:n(r,e.$schema),key:"$schema",obj:e,path:o.slice(0)});var a;if(Array.isArray(e))for(a=e.length;a--;)o.push(a.toString()),i(e[a],t,r,o),o.pop();else{var s=Object.keys(e);for(a=s.length;a--;)0!==s[a].indexOf("__$")&&(o.push(s[a]),i(e[s[a]],t,r,o),o.pop())}return"string"==typeof e.id&&r.pop(),t}function o(e,t){for(var r=e.length;r--;)if(e[r].id===t)return e[r];return null}var a=e("./Report"),s=e("./SchemaCache"),c=e("./Utils"),u=function(e,t){for(var n=t.length,i=0;n--;){var o=new a(e),s=r.compileSchema.call(this,o,t[n]);s&&i++,e.errors=e.errors.concat(o.errors)}return i},f=function(e,t){var r,n=0;do{for(var i=e.errors.length;i--;)"UNRESOLVABLE_REFERENCE"===e.errors[i].code&&e.errors.splice(i,1);for(r=n,n=u.call(this,e,t),i=t.length;i--;){var a=t[i];if(a.__$missingReferences){for(var s=a.__$missingReferences.length;s--;){var c=a.__$missingReferences[s],f=o(t,c.ref);f&&(c.obj["__"+c.key+"Resolved"]=f,a.__$missingReferences.splice(s,1))}0===a.__$missingReferences.length&&delete a.__$missingReferences}}}while(n!==t.length&&n!==r);return e.isValid()};r.compileSchema=function(e,t){if(e.commonErrorMessage="SCHEMA_COMPILATION_FAILED","string"==typeof t){var n=s.getSchemaByUri.call(this,e,t);if(!n)return e.addError("SCHEMA_NOT_REACHABLE",[t]),!1;t=n}if(Array.isArray(t))return f.call(this,e,t);if(t.__$compiled&&t.id&&s.checkCacheForUri.call(this,t.id)===!1&&(t.__$compiled=void 0),t.__$compiled)return!0;t.id&&"string"==typeof t.id&&s.cacheSchemaByUri.call(this,t.id,t);var o=!1;e.rootSchema||(e.rootSchema=t,o=!0);var u=e.isValid();delete t.__$missingReferences;for(var p=i.call(this,t),l=p.length;l--;){var h=p[l],d=s.getSchemaByUri.call(this,e,h.ref,t);if(!d){var m=this.getSchemaReader();if(m){var y=m(h.ref);if(y){y.id=h.ref;var g=new a(e);r.compileSchema.call(this,g,y)?d=s.getSchemaByUri.call(this,e,h.ref,t):e.errors=e.errors.concat(g.errors)}}}if(!d){var v=e.hasError("REMOTE_NOT_VALID",[h.ref]),b=c.isAbsoluteUri(h.ref),E=!1,x=this.options.ignoreUnresolvableReferences===!0;b&&(E=s.checkCacheForUri.call(this,h.ref)),v||x&&b||E||(Array.prototype.push.apply(e.path,h.path),e.addError("UNRESOLVABLE_REFERENCE",[h.ref]),e.path=e.path.slice(0,-h.path.length),u&&(t.__$missingReferences=t.__$missingReferences||[],t.__$missingReferences.push(h)))}h.obj["__"+h.key+"Resolved"]=d}var O=e.isValid();return O?t.__$compiled=!0:t.id&&"string"==typeof t.id&&s.removeFromCacheByUri.call(this,t.id),o&&(e.rootSchema=void 0),O}},{"./Report":198,"./SchemaCache":199,"./Utils":202}],201:[function(e,t,r){"use strict";var n=e("./FormatValidators"),i=e("./JsonValidation"),o=e("./Report"),a=e("./Utils"),s={$ref:function(e,t){"string"!=typeof t.$ref&&e.addError("KEYWORD_TYPE_EXPECTED",["$ref","string"])},$schema:function(e,t){"string"!=typeof t.$schema&&e.addError("KEYWORD_TYPE_EXPECTED",["$schema","string"])},multipleOf:function(e,t){"number"!=typeof t.multipleOf?e.addError("KEYWORD_TYPE_EXPECTED",["multipleOf","number"]):t.multipleOf<=0&&e.addError("KEYWORD_MUST_BE",["multipleOf","strictly greater than 0"])},maximum:function(e,t){"number"!=typeof t.maximum&&e.addError("KEYWORD_TYPE_EXPECTED",["maximum","number"])},exclusiveMaximum:function(e,t){"boolean"!=typeof t.exclusiveMaximum?e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMaximum","boolean"]):void 0===t.maximum&&e.addError("KEYWORD_DEPENDENCY",["exclusiveMaximum","maximum"])},minimum:function(e,t){"number"!=typeof t.minimum&&e.addError("KEYWORD_TYPE_EXPECTED",["minimum","number"])},exclusiveMinimum:function(e,t){"boolean"!=typeof t.exclusiveMinimum?e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMinimum","boolean"]):void 0===t.minimum&&e.addError("KEYWORD_DEPENDENCY",["exclusiveMinimum","minimum"])},maxLength:function(e,t){"integer"!==a.whatIs(t.maxLength)?e.addError("KEYWORD_TYPE_EXPECTED",["maxLength","integer"]):t.maxLength<0&&e.addError("KEYWORD_MUST_BE",["maxLength","greater than, or equal to 0"])},minLength:function(e,t){"integer"!==a.whatIs(t.minLength)?e.addError("KEYWORD_TYPE_EXPECTED",["minLength","integer"]):t.minLength<0&&e.addError("KEYWORD_MUST_BE",["minLength","greater than, or equal to 0"])},pattern:function(e,t){if("string"!=typeof t.pattern)e.addError("KEYWORD_TYPE_EXPECTED",["pattern","string"]);else try{RegExp(t.pattern)}catch(r){e.addError("KEYWORD_PATTERN",["pattern",t.pattern])}},additionalItems:function(e,t){var n=a.whatIs(t.additionalItems);"boolean"!==n&&"object"!==n?e.addError("KEYWORD_TYPE_EXPECTED",["additionalItems",["boolean","object"]]):"object"===n&&(e.path.push("additionalItems"),r.validateSchema.call(this,e,t.additionalItems),e.path.pop())},items:function(e,t){var n=a.whatIs(t.items);if("object"===n)e.path.push("items"),r.validateSchema.call(this,e,t.items),e.path.pop();else if("array"===n)for(var i=t.items.length;i--;)e.path.push("items"),e.path.push(i.toString()),r.validateSchema.call(this,e,t.items[i]),e.path.pop(),e.path.pop();else e.addError("KEYWORD_TYPE_EXPECTED",["items",["array","object"]]);this.options.forceAdditional===!0&&void 0===t.additionalItems&&Array.isArray(t.items)&&e.addError("KEYWORD_UNDEFINED_STRICT",["additionalItems"]),this.options.assumeAdditional&&void 0===t.additionalItems&&Array.isArray(t.items)&&(t.additionalItems=!1)},maxItems:function(e,t){"number"!=typeof t.maxItems?e.addError("KEYWORD_TYPE_EXPECTED",["maxItems","integer"]):t.maxItems<0&&e.addError("KEYWORD_MUST_BE",["maxItems","greater than, or equal to 0"])},minItems:function(e,t){"integer"!==a.whatIs(t.minItems)?e.addError("KEYWORD_TYPE_EXPECTED",["minItems","integer"]):t.minItems<0&&e.addError("KEYWORD_MUST_BE",["minItems","greater than, or equal to 0"])},uniqueItems:function(e,t){"boolean"!=typeof t.uniqueItems&&e.addError("KEYWORD_TYPE_EXPECTED",["uniqueItems","boolean"])},maxProperties:function(e,t){"integer"!==a.whatIs(t.maxProperties)?e.addError("KEYWORD_TYPE_EXPECTED",["maxProperties","integer"]):t.maxProperties<0&&e.addError("KEYWORD_MUST_BE",["maxProperties","greater than, or equal to 0"])},minProperties:function(e,t){"integer"!==a.whatIs(t.minProperties)?e.addError("KEYWORD_TYPE_EXPECTED",["minProperties","integer"]):t.minProperties<0&&e.addError("KEYWORD_MUST_BE",["minProperties","greater than, or equal to 0"])},required:function(e,t){if("array"!==a.whatIs(t.required))e.addError("KEYWORD_TYPE_EXPECTED",["required","array"]);else if(0===t.required.length)e.addError("KEYWORD_MUST_BE",["required","an array with at least one element"]);else{for(var r=t.required.length;r--;)"string"!=typeof t.required[r]&&e.addError("KEYWORD_VALUE_TYPE",["required","string"]);a.isUniqueArray(t.required)===!1&&e.addError("KEYWORD_MUST_BE",["required","an array with unique items"])}},additionalProperties:function(e,t){var n=a.whatIs(t.additionalProperties);"boolean"!==n&&"object"!==n?e.addError("KEYWORD_TYPE_EXPECTED",["additionalProperties",["boolean","object"]]):"object"===n&&(e.path.push("additionalProperties"),r.validateSchema.call(this,e,t.additionalProperties),e.path.pop())},properties:function(e,t){if("object"!==a.whatIs(t.properties))return void e.addError("KEYWORD_TYPE_EXPECTED",["properties","object"]);for(var n=Object.keys(t.properties),i=n.length;i--;){var o=n[i],s=t.properties[o];e.path.push("properties"),e.path.push(o),r.validateSchema.call(this,e,s),e.path.pop(),e.path.pop()}this.options.forceAdditional===!0&&void 0===t.additionalProperties&&e.addError("KEYWORD_UNDEFINED_STRICT",["additionalProperties"]),this.options.assumeAdditional&&void 0===t.additionalProperties&&(t.additionalProperties=!1),this.options.forceProperties===!0&&0===n.length&&e.addError("CUSTOM_MODE_FORCE_PROPERTIES",["properties"])},patternProperties:function(e,t){if("object"!==a.whatIs(t.patternProperties))return void e.addError("KEYWORD_TYPE_EXPECTED",["patternProperties","object"]);for(var n=Object.keys(t.patternProperties),i=n.length;i--;){var o=n[i],s=t.patternProperties[o];try{RegExp(o)}catch(c){e.addError("KEYWORD_PATTERN",["patternProperties",o])}e.path.push("patternProperties"),e.path.push(o.toString()),r.validateSchema.call(this,e,s),e.path.pop(),e.path.pop()}this.options.forceProperties===!0&&0===n.length&&e.addError("CUSTOM_MODE_FORCE_PROPERTIES",["patternProperties"])},dependencies:function(e,t){if("object"!==a.whatIs(t.dependencies))e.addError("KEYWORD_TYPE_EXPECTED",["dependencies","object"]);else for(var n=Object.keys(t.dependencies),i=n.length;i--;){var o=n[i],s=t.dependencies[o],c=a.whatIs(s);if("object"===c)e.path.push("dependencies"),e.path.push(o),r.validateSchema.call(this,e,s),e.path.pop(),e.path.pop();else if("array"===c){var u=s.length;for(0===u&&e.addError("KEYWORD_MUST_BE",["dependencies","not empty array"]);u--;)"string"!=typeof s[u]&&e.addError("KEYWORD_VALUE_TYPE",["dependensices","string"]);a.isUniqueArray(s)===!1&&e.addError("KEYWORD_MUST_BE",["dependencies","an array with unique items"])}else e.addError("KEYWORD_VALUE_TYPE",["dependencies","object or array"])}},"enum":function(e,t){Array.isArray(t["enum"])===!1?e.addError("KEYWORD_TYPE_EXPECTED",["enum","array"]):0===t["enum"].length?e.addError("KEYWORD_MUST_BE",["enum","an array with at least one element"]):a.isUniqueArray(t["enum"])===!1&&e.addError("KEYWORD_MUST_BE",["enum","an array with unique elements"])},type:function(e,t){var r=["array","boolean","integer","number","null","object","string"],n=r.join(","),i=Array.isArray(t.type);if(i){for(var o=t.type.length;o--;)-1===r.indexOf(t.type[o])&&e.addError("KEYWORD_TYPE_EXPECTED",["type",n]);a.isUniqueArray(t.type)===!1&&e.addError("KEYWORD_MUST_BE",["type","an object with unique properties"])}else"string"==typeof t.type?-1===r.indexOf(t.type)&&e.addError("KEYWORD_TYPE_EXPECTED",["type",n]):e.addError("KEYWORD_TYPE_EXPECTED",["type",["string","array"]]);this.options.noEmptyStrings===!0&&("string"===t.type||i&&-1!==t.type.indexOf("string"))&&void 0===t.minLength&&void 0===t["enum"]&&void 0===t.format&&(t.minLength=1),this.options.noEmptyArrays===!0&&("array"===t.type||i&&-1!==t.type.indexOf("array"))&&void 0===t.minItems&&(t.minItems=1),this.options.forceProperties===!0&&("object"===t.type||i&&-1!==t.type.indexOf("object"))&&void 0===t.properties&&void 0===t.patternProperties&&e.addError("KEYWORD_UNDEFINED_STRICT",["properties"]),this.options.forceItems===!0&&("array"===t.type||i&&-1!==t.type.indexOf("array"))&&void 0===t.items&&e.addError("KEYWORD_UNDEFINED_STRICT",["items"]),this.options.forceMinItems===!0&&("array"===t.type||i&&-1!==t.type.indexOf("array"))&&void 0===t.minItems&&e.addError("KEYWORD_UNDEFINED_STRICT",["minItems"]),this.options.forceMaxItems===!0&&("array"===t.type||i&&-1!==t.type.indexOf("array"))&&void 0===t.maxItems&&e.addError("KEYWORD_UNDEFINED_STRICT",["maxItems"]),this.options.forceMinLength===!0&&("string"===t.type||i&&-1!==t.type.indexOf("string"))&&void 0===t.minLength&&void 0===t.format&&void 0===t["enum"]&&void 0===t.pattern&&e.addError("KEYWORD_UNDEFINED_STRICT",["minLength"]),this.options.forceMaxLength===!0&&("string"===t.type||i&&-1!==t.type.indexOf("string"))&&void 0===t.maxLength&&void 0===t.format&&void 0===t["enum"]&&void 0===t.pattern&&e.addError("KEYWORD_UNDEFINED_STRICT",["maxLength"])},allOf:function(e,t){if(Array.isArray(t.allOf)===!1)e.addError("KEYWORD_TYPE_EXPECTED",["allOf","array"]);else if(0===t.allOf.length)e.addError("KEYWORD_MUST_BE",["allOf","an array with at least one element"]);else for(var n=t.allOf.length;n--;)e.path.push("allOf"),e.path.push(n.toString()),r.validateSchema.call(this,e,t.allOf[n]),e.path.pop(),e.path.pop()},anyOf:function(e,t){if(Array.isArray(t.anyOf)===!1)e.addError("KEYWORD_TYPE_EXPECTED",["anyOf","array"]);else if(0===t.anyOf.length)e.addError("KEYWORD_MUST_BE",["anyOf","an array with at least one element"]);else for(var n=t.anyOf.length;n--;)e.path.push("anyOf"),e.path.push(n.toString()),r.validateSchema.call(this,e,t.anyOf[n]),e.path.pop(),e.path.pop()},oneOf:function(e,t){if(Array.isArray(t.oneOf)===!1)e.addError("KEYWORD_TYPE_EXPECTED",["oneOf","array"]);else if(0===t.oneOf.length)e.addError("KEYWORD_MUST_BE",["oneOf","an array with at least one element"]);else for(var n=t.oneOf.length;n--;)e.path.push("oneOf"),e.path.push(n.toString()),r.validateSchema.call(this,e,t.oneOf[n]),e.path.pop(),e.path.pop()},not:function(e,t){"object"!==a.whatIs(t.not)?e.addError("KEYWORD_TYPE_EXPECTED",["not","object"]):(e.path.push("not"),r.validateSchema.call(this,e,t.not),e.path.pop())},definitions:function(e,t){if("object"!==a.whatIs(t.definitions))e.addError("KEYWORD_TYPE_EXPECTED",["definitions","object"]);else for(var n=Object.keys(t.definitions),i=n.length;i--;){var o=n[i],s=t.definitions[o];e.path.push("definitions"),e.path.push(o),r.validateSchema.call(this,e,s),e.path.pop(),e.path.pop()}},format:function(e,t){"string"!=typeof t.format?e.addError("KEYWORD_TYPE_EXPECTED",["format","string"]):void 0===n[t.format]&&this.options.ignoreUnknownFormats!==!0&&e.addError("UNKNOWN_FORMAT",[t.format])},id:function(e,t){"string"!=typeof t.id&&e.addError("KEYWORD_TYPE_EXPECTED",["id","string"])},title:function(e,t){"string"!=typeof t.title&&e.addError("KEYWORD_TYPE_EXPECTED",["title","string"])},description:function(e,t){"string"!=typeof t.description&&e.addError("KEYWORD_TYPE_EXPECTED",["description","string"])},"default":function(){}},c=function(e,t){for(var n=t.length;n--;)r.validateSchema.call(this,e,t[n]);return e.isValid()};r.validateSchema=function(e,t){if(e.commonErrorMessage="SCHEMA_VALIDATION_FAILED",Array.isArray(t))return c.call(this,e,t);if(t.__$validated)return!0;var r=t.$schema&&t.id!==t.$schema;if(r)if(t.__$schemaResolved&&t.__$schemaResolved!==t){var n=new o(e),u=i.validate.call(this,n,t.__$schemaResolved,t);u===!1&&e.addError("PARENT_SCHEMA_VALIDATION_FAILED",null,n)}else this.options.ignoreUnresolvableReferences!==!0&&e.addError("REF_UNRESOLVED",[t.$schema]);if(this.options.noTypeless===!0){if(void 0!==t.type){var f=[];Array.isArray(t.anyOf)&&(f=f.concat(t.anyOf)),Array.isArray(t.oneOf)&&(f=f.concat(t.oneOf)),Array.isArray(t.allOf)&&(f=f.concat(t.allOf)),f.forEach(function(e){e.type||(e.type=t.type)})}void 0===t["enum"]&&void 0===t.type&&void 0===t.anyOf&&void 0===t.oneOf&&void 0===t.not&&void 0===t.$ref&&e.addError("KEYWORD_UNDEFINED_STRICT",["type"])}for(var p=Object.keys(t),l=p.length;l--;){var h=p[l];0!==h.indexOf("__")&&(void 0!==s[h]?s[h].call(this,e,t):r||this.options.noExtraKeywords===!0&&e.addError("KEYWORD_UNEXPECTED",[h]))}if(this.options.pedanticCheck===!0){if(t["enum"]){var d=a.clone(t);for(delete d["enum"],delete d["default"],e.path.push("enum"),l=t["enum"].length;l--;)e.path.push(l.toString()),i.validate.call(this,e,d,t["enum"][l]),e.path.pop();e.path.pop()}t["default"]&&(e.path.push("default"),i.validate.call(this,e,t,t["default"]),e.path.pop())}var m=e.isValid();return m&&(t.__$validated=!0),m}},{"./FormatValidators":195,"./JsonValidation":196,"./Report":198,"./Utils":202}],202:[function(e,t,r){"use strict";r.isAbsoluteUri=function(e){return/^https?:\/\//.test(e)},r.isRelativeUri=function(e){return/.+#/.test(e)},r.whatIs=function(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"array":"object":"number"===t?Number.isFinite(e)?e%1===0?"integer":"number":Number.isNaN(e)?"not-a-number":"unknown-number":t},r.areEqual=function n(e,t){if(e===t)return!0;var i,o;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(o=e.length,i=0;o>i;i++)if(!n(e[i],t[i]))return!1;return!0}if("object"===r.whatIs(e)&&"object"===r.whatIs(t)){var a=Object.keys(e),s=Object.keys(t);if(!n(a,s))return!1;for(o=a.length,i=0;o>i;i++)if(!n(e[a[i]],t[a[i]]))return!1;return!0}return!1},r.isUniqueArray=function(e,t){var n,i,o=e.length;for(n=0;o>n;n++)for(i=n+1;o>i;i++)if(r.areEqual(e[n],e[i]))return t&&t.push(n,i),!1;return!0},r.difference=function(e,t){for(var r=[],n=e.length;n--;)-1===t.indexOf(e[n])&&r.push(e[n]);return r},r.clone=function(e){if("undefined"!=typeof e){if("object"!=typeof e||null===e)return e;var t,r;if(Array.isArray(e))for(t=[],r=e.length;r--;)t[r]=e[r];else{t={};var n=Object.keys(e);for(r=n.length;r--;){var i=n[r];t[i]=e[i]}}return t}},r.cloneDeep=function(e){function t(e){if("object"!=typeof e||null===e)return e;var i,o,a;if(a=r.indexOf(e),-1!==a)return n[a];if(r.push(e),Array.isArray(e))for(i=[],n.push(i),o=e.length;o--;)i[o]=t(e[o]);else{i={},n.push(i);var s=Object.keys(e);for(o=s.length;o--;){var c=s[o];i[c]=t(e[c])}}return i}var r=[],n=[];return t(e)},r.ucs2decode=function(e){for(var t,r,n=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(r=e.charCodeAt(i++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--)):n.push(t);return n}},{}],203:[function(e,t,r){(function(r){"use strict";function n(e){if(this.cache={},this.referenceCache=[],this.setRemoteReference("http://json-schema.org/draft-04/schema",l),this.setRemoteReference("http://json-schema.org/draft-04/hyper-schema",h),"object"==typeof e){for(var t,r=Object.keys(e),n=r.length;n--;)if(t=r[n],void 0===d[t])throw new Error("Unexpected option passed to constructor: "+t);for(r=Object.keys(d),n=r.length;n--;)t=r[n],void 0===e[t]&&(e[t]=p.clone(d[t]));this.options=e}else this.options=p.clone(d);this.options.strictMode===!0&&(this.options.forceAdditional=!0,this.options.forceItems=!0,this.options.forceMaxLength=!0,this.options.forceProperties=!0,this.options.noExtraKeywords=!0,this.options.noTypeless=!0,this.options.noEmptyStrings=!0,this.options.noEmptyArrays=!0)}e("./Polyfills");var i=e("lodash.get"),o=e("./Report"),a=e("./FormatValidators"),s=e("./JsonValidation"),c=e("./SchemaCache"),u=e("./SchemaCompilation"),f=e("./SchemaValidation"),p=e("./Utils"),l=e("./schemas/schema.json"),h=e("./schemas/hyper-schema.json"),d={asyncTimeout:2e3,forceAdditional:!1,assumeAdditional:!1,forceItems:!1,forceMinItems:!1,forceMaxItems:!1,forceMinLength:!1,forceMaxLength:!1,forceProperties:!1,ignoreUnresolvableReferences:!1,noExtraKeywords:!1,noTypeless:!1,noEmptyStrings:!1,noEmptyArrays:!1,strictUris:!1,strictMode:!1,reportPathAsArray:!1,breakOnFirstError:!0,pedanticCheck:!1,ignoreUnknownFormats:!1};n.prototype.compileSchema=function(e){var t=new o(this.options);return e=c.getSchema.call(this,t,e),u.compileSchema.call(this,t,e),this.lastReport=t,t.isValid()},n.prototype.validateSchema=function(e){if(Array.isArray(e)&&0===e.length)throw new Error(".validateSchema was called with an empty array");var t=new o(this.options);e=c.getSchema.call(this,t,e);var r=u.compileSchema.call(this,t,e);return r&&f.validateSchema.call(this,t,e),this.lastReport=t,t.isValid()},n.prototype.validate=function(e,t,n,a){"function"===p.whatIs(n)&&(a=n,n={}),n||(n={});var l=p.whatIs(t);if("string"!==l&&"object"!==l){var h=new Error("Invalid .validate call - schema must be an string or object but "+l+" was passed!");if(a)return void r.nextTick(function(){a(h,!1)});throw h}var d=!1,m=new o(this.options);if("string"==typeof t){var y=t;if(t=c.getSchema.call(this,m,y),!t)throw new Error("Schema with id '"+y+"' wasn't found in the validator cache!")}else t=c.getSchema.call(this,m,t);var g=!1;d||(g=u.compileSchema.call(this,m,t)),g||(this.lastReport=m,d=!0);var v=!1;if(d||(v=f.validateSchema.call(this,m,t)),v||(this.lastReport=m,d=!0),n.schemaPath&&(m.rootSchema=t,t=i(t,n.schemaPath),!t))throw new Error("Schema path '"+n.schemaPath+"' wasn't found in the schema!");if(d||s.validate.call(this,m,t,e),a)return void m.processAsyncTasks(this.options.asyncTimeout,a);if(m.asyncTasks.length>0)throw new Error("This validation has async tasks and cannot be done in sync mode, please provide callback argument.");return this.lastReport=m,m.isValid()},n.prototype.getLastError=function(){if(0===this.lastReport.errors.length)return null;var e=new Error;return e.name="z-schema validation error",e.message=this.lastReport.commonErrorMessage,e.details=this.lastReport.errors,e},n.prototype.getLastErrors=function(){return this.lastReport&&this.lastReport.errors.length>0?this.lastReport.errors:void 0},n.prototype.getMissingReferences=function(e){e=e||this.lastReport.errors;for(var t=[],r=e.length;r--;){var n=e[r];if("UNRESOLVABLE_REFERENCE"===n.code){var i=n.params[0];-1===t.indexOf(i)&&t.push(i)}n.inner&&(t=t.concat(this.getMissingReferences(n.inner)))}return t},n.prototype.getMissingRemoteReferences=function(){for(var e=this.getMissingReferences(),t=[],r=e.length;r--;){var n=c.getRemotePath(e[r]);n&&-1===t.indexOf(n)&&t.push(n)}return t},n.prototype.setRemoteReference=function(e,t){t="string"==typeof t?JSON.parse(t):p.cloneDeep(t),c.cacheSchemaByUri.call(this,e,t)},n.prototype.getResolvedSchema=function(e){var t=new o(this.options);e=c.getSchema.call(this,t,e),e=p.cloneDeep(e);var r=[],n=function(e){var t,i=p.whatIs(e);if(("object"===i||"array"===i)&&!e.___$visited){if(e.___$visited=!0,r.push(e),e.$ref&&e.__$refResolved){var o=e.__$refResolved,a=e;delete e.$ref,delete e.__$refResolved;for(t in o)o.hasOwnProperty(t)&&(a[t]=o[t])}for(t in e)e.hasOwnProperty(t)&&(0===t.indexOf("__$")?delete e[t]:n(e[t]))}};if(n(e),r.forEach(function(e){delete e.___$visited}),this.lastReport=t,t.isValid())return e;throw this.getLastError()},n.prototype.setSchemaReader=function(e){return n.setSchemaReader(e)},n.prototype.getSchemaReader=function(){return n.schemaReader},n.setSchemaReader=function(e){n.schemaReader=e},n.registerFormat=function(e,t){a[e]=t},n.unregisterFormat=function(e){delete a[e]},n.getRegisteredFormats=function(){return Object.keys(a)},n.getDefaultOptions=function(){return p.cloneDeep(d)},t.exports=n}).call(this,e("_process"))},{"./FormatValidators":195,"./JsonValidation":196,"./Polyfills":197,"./Report":198,"./SchemaCache":199,"./SchemaCompilation":200,"./SchemaValidation":201,"./Utils":202,"./schemas/hyper-schema.json":204,"./schemas/schema.json":205,_process:175,"lodash.get":162}],204:[function(e,t,r){t.exports={$schema:"http://json-schema.org/draft-04/hyper-schema#",id:"http://json-schema.org/draft-04/hyper-schema#",title:"JSON Hyper-Schema",allOf:[{$ref:"http://json-schema.org/draft-04/schema#"}],properties:{additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}]},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}]},dependencies:{additionalProperties:{anyOf:[{$ref:"#"},{type:"array"}]}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}]},definitions:{additionalProperties:{$ref:"#"}},patternProperties:{additionalProperties:{$ref:"#"}},properties:{additionalProperties:{$ref:"#"}},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"},links:{type:"array",items:{$ref:"#/definitions/linkDescription"}},fragmentResolution:{type:"string"},media:{type:"object",properties:{type:{description:"A media type, as described in RFC 2046",type:"string"},binaryEncoding:{description:"A content encoding scheme, as described in RFC 2045",type:"string"}}},pathStart:{description:"Instances' URIs must start with this value for this schema to apply to them",type:"string",format:"uri"}},definitions:{schemaArray:{type:"array",items:{$ref:"#"}},linkDescription:{title:"Link Description Object",type:"object",required:["href","rel"],properties:{href:{description:"a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",type:"string"},rel:{description:"relation to the target resource of the link",type:"string"},title:{description:"a title for the link",type:"string"},targetSchema:{description:"JSON Schema describing the link target",$ref:"#"},mediaType:{description:"media type (as defined by RFC 2046) describing the link target",type:"string"},method:{description:'method for requesting the target of the link (e.g. for HTTP this might be "GET" or "DELETE")',type:"string"},encType:{description:"The media type in which to submit data along with the request",type:"string","default":"application/json"},schema:{description:"Schema describing the data to submit along with the request",$ref:"#"}}}}}},{}],205:[function(e,t,r){t.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{"default":0}]},simpleTypes:{"enum":["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},"default":{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],"default":{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean","default":!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},definitions:{type:"object",additionalProperties:{$ref:"#"},"default":{}},properties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},"enum":{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},"default":{}}},{}],206:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/apiDeclaration.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swaggerVersion","basePath","apis"],properties:{swaggerVersion:{"enum":["1.2"]},apiVersion:{type:"string"},basePath:{type:"string",format:"uri",pattern:"^https?://"},resourcePath:{type:"string",format:"uri",pattern:"^/"},apis:{type:"array",items:{$ref:"#/definitions/apiObject"}},models:{type:"object",additionalProperties:{$ref:"modelsObject.json#"}},produces:{$ref:"#/definitions/mimeTypeArray" +},consumes:{$ref:"#/definitions/mimeTypeArray"},authorizations:{$ref:"authorizationObject.json#"}},additionalProperties:!1,definitions:{apiObject:{type:"object",required:["path","operations"],properties:{path:{type:"string",format:"uri-template",pattern:"^/"},description:{type:"string"},operations:{type:"array",items:{$ref:"operationObject.json#"}}},additionalProperties:!1},mimeTypeArray:{type:"array",items:{type:"string",format:"mime-type"},uniqueItems:!0}}}},{}],207:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/authorizationObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/basicAuth"},{$ref:"#/definitions/apiKey"},{$ref:"#/definitions/oauth2"}]},definitions:{basicAuth:{required:["type"],properties:{type:{"enum":["basicAuth"]}},additionalProperties:!1},apiKey:{required:["type","passAs","keyname"],properties:{type:{"enum":["apiKey"]},passAs:{"enum":["header","query"]},keyname:{type:"string"}},additionalProperties:!1},oauth2:{type:"object",required:["type","grantTypes"],properties:{type:{"enum":["oauth2"]},scopes:{type:"array",items:{$ref:"#/definitions/oauth2Scope"}},grantTypes:{$ref:"oauth2GrantType.json#"}},additionalProperties:!1},oauth2Scope:{type:"object",required:["scope"],properties:{scope:{type:"string"},description:{type:"string"}},additionalProperties:!1}}}},{}],208:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/dataType.json#",$schema:"http://json-schema.org/draft-04/schema#",description:"Data type as described by the specification (version 1.2)",type:"object",oneOf:[{$ref:"#/definitions/refType"},{$ref:"#/definitions/voidType"},{$ref:"#/definitions/primitiveType"},{$ref:"#/definitions/modelType"},{$ref:"#/definitions/arrayType"}],definitions:{refType:{required:["$ref"],properties:{$ref:{type:"string"}},additionalProperties:!1},voidType:{"enum":[{type:"void"}]},modelType:{required:["type"],properties:{type:{type:"string",not:{"enum":["boolean","integer","number","string","array"]}}},additionalProperties:!1},primitiveType:{required:["type"],properties:{type:{"enum":["boolean","integer","number","string"]},format:{type:"string"},defaultValue:{not:{type:["array","object","null"]}},"enum":{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},minimum:{type:"string"},maximum:{type:"string"}},additionalProperties:!1,dependencies:{format:{oneOf:[{properties:{type:{"enum":["integer"]},format:{"enum":["int32","int64"]}}},{properties:{type:{"enum":["number"]},format:{"enum":["float","double"]}}},{properties:{type:{"enum":["string"]},format:{"enum":["byte","date","date-time"]}}}]},"enum":{properties:{type:{"enum":["string"]}}},minimum:{properties:{type:{"enum":["integer","number"]}}},maximum:{properties:{type:{"enum":["integer","number"]}}}}},arrayType:{required:["type","items"],properties:{type:{"enum":["array"]},items:{type:"array",items:{$ref:"#/definitions/itemsObject"}},uniqueItems:{type:"boolean"}},additionalProperties:!1},itemsObject:{oneOf:[{$ref:"#/definitions/refType"},{allOf:[{$ref:"#/definitions/primitiveType"},{properties:{type:{},format:{}},additionalProperties:!1}]}]}}}},{}],209:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/dataTypeBase.json#",$schema:"http://json-schema.org/draft-04/schema#",description:"Data type fields (section 4.3.3)",type:"object",oneOf:[{required:["type"]},{required:["$ref"]}],properties:{type:{type:"string"},$ref:{type:"string"},format:{type:"string"},defaultValue:{not:{type:["array","object","null"]}},"enum":{type:"array",items:{type:"string"},uniqueItems:!0,minItems:1},minimum:{type:"string"},maximum:{type:"string"},items:{$ref:"#/definitions/itemsObject"},uniqueItems:{type:"boolean"}},dependencies:{format:{oneOf:[{properties:{type:{"enum":["integer"]},format:{"enum":["int32","int64"]}}},{properties:{type:{"enum":["number"]},format:{"enum":["float","double"]}}},{properties:{type:{"enum":["string"]},format:{"enum":["byte","date","date-time"]}}}]}},definitions:{itemsObject:{oneOf:[{type:"object",required:["$ref"],properties:{$ref:{type:"string"}},additionalProperties:!1},{allOf:[{$ref:"#"},{required:["type"],properties:{type:{},format:{}},additionalProperties:!1}]}]}}}},{}],210:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/infoObject.json#",$schema:"http://json-schema.org/draft-04/schema#",description:"info object (section 5.1.3)",type:"object",required:["title","description"],properties:{title:{type:"string"},description:{type:"string"},termsOfServiceUrl:{type:"string",format:"uri"},contact:{type:"string",format:"email"},license:{type:"string"},licenseUrl:{type:"string",format:"uri"}},additionalProperties:!1}},{}],211:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/modelsObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["id","properties"],properties:{id:{type:"string"},description:{type:"string"},properties:{type:"object",additionalProperties:{$ref:"#/definitions/propertyObject"}},subTypes:{type:"array",items:{type:"string"},uniqueItems:!0},discriminator:{type:"string"}},dependencies:{subTypes:["discriminator"]},definitions:{propertyObject:{allOf:[{not:{$ref:"#"}},{$ref:"dataTypeBase.json#"}]}}}},{}],212:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/oauth2GrantType.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",minProperties:1,properties:{implicit:{$ref:"#/definitions/implicit"},authorization_code:{$ref:"#/definitions/authorizationCode"}},definitions:{implicit:{type:"object",required:["loginEndpoint"],properties:{loginEndpoint:{$ref:"#/definitions/loginEndpoint"},tokenName:{type:"string"}},additionalProperties:!1},authorizationCode:{type:"object",required:["tokenEndpoint","tokenRequestEndpoint"],properties:{tokenEndpoint:{$ref:"#/definitions/tokenEndpoint"},tokenRequestEndpoint:{$ref:"#/definitions/tokenRequestEndpoint"}},additionalProperties:!1},loginEndpoint:{type:"object",required:["url"],properties:{url:{type:"string",format:"uri"}},additionalProperties:!1},tokenEndpoint:{type:"object",required:["url"],properties:{url:{type:"string",format:"uri"},tokenName:{type:"string"}},additionalProperties:!1},tokenRequestEndpoint:{type:"object",required:["url"],properties:{url:{type:"string",format:"uri"},clientIdName:{type:"string"},clientSecretName:{type:"string"}},additionalProperties:!1}}}},{}],213:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/operationObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",allOf:[{$ref:"dataTypeBase.json#"},{required:["method","nickname","parameters"],properties:{method:{"enum":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},summary:{type:"string",maxLength:120},notes:{type:"string"},nickname:{type:"string",pattern:"^[a-zA-Z0-9_]+$"},authorizations:{type:"object",additionalProperties:{type:"array",items:{$ref:"authorizationObject.json#/definitions/oauth2Scope"}}},parameters:{type:"array",items:{$ref:"parameterObject.json#"}},responseMessages:{type:"array",items:{$ref:"#/definitions/responseMessageObject"}},produces:{$ref:"#/definitions/mimeTypeArray"},consumes:{$ref:"#/definitions/mimeTypeArray"},deprecated:{"enum":["true","false"]}}}],definitions:{responseMessageObject:{type:"object",required:["code","message"],properties:{code:{$ref:"#/definitions/rfc2616section10"},message:{type:"string"},responseModel:{type:"string"}}},rfc2616section10:{type:"integer",minimum:100,maximum:600,exclusiveMaximum:!0},mimeTypeArray:{type:"array",items:{type:"string",format:"mime-type"},uniqueItems:!0}}}},{}],214:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/parameterObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",allOf:[{$ref:"dataTypeBase.json#"},{required:["paramType","name"],properties:{paramType:{"enum":["path","query","body","header","form"]},name:{type:"string"},description:{type:"string"},required:{type:"boolean"},allowMultiple:{type:"boolean"}}},{description:"type File requires special paramType and consumes",oneOf:[{properties:{type:{not:{"enum":["File"]}}}},{properties:{type:{"enum":["File"]},paramType:{"enum":["form"]},consumes:{"enum":["multipart/form-data"]}}}]}]}},{}],215:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/resourceListing.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swaggerVersion","apis"],properties:{swaggerVersion:{"enum":["1.2"]},apis:{type:"array",items:{$ref:"resourceObject.json#"}},apiVersion:{type:"string"},info:{$ref:"infoObject.json#"},authorizations:{$ref:"authorizationObject.json#"}}}},{}],216:[function(e,t,r){t.exports={id:"http://wordnik.github.io/schemas/v1.2/resourceObject.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["path"],properties:{path:{type:"string",format:"uri"},description:{type:"string"}},additionalProperties:!1}},{}],217:[function(e,t,r){t.exports={title:"A JSON Schema for Swagger 2.0 API.",id:"http://swagger.io/v2/schema.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swagger","info","paths"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{swagger:{type:"string","enum":["2.0"],description:"The Swagger version of this document."},info:{$ref:"#/definitions/info"},host:{type:"string",pattern:"^[^{}/ :\\\\]+(?::\\d+)?$",description:"The host (name or ip) of the API. Example: 'swagger.io'"},basePath:{type:"string",pattern:"^/",description:"The base path to the API. Example: '/api'."},schemes:{$ref:"#/definitions/schemesList"},consumes:{description:"A list of MIME types accepted by the API.",$ref:"#/definitions/mediaTypeList"},produces:{description:"A list of MIME types the API can produce.",$ref:"#/definitions/mediaTypeList"},paths:{$ref:"#/definitions/paths"},definitions:{$ref:"#/definitions/definitions"},parameters:{$ref:"#/definitions/parameterDefinitions"},responses:{$ref:"#/definitions/responseDefinitions"},security:{$ref:"#/definitions/security"},securityDefinitions:{$ref:"#/definitions/securityDefinitions"},tags:{type:"array",items:{$ref:"#/definitions/tag"},uniqueItems:!0},externalDocs:{$ref:"#/definitions/externalDocs"}},definitions:{info:{type:"object",description:"General information about the API.",required:["version","title"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{title:{type:"string",description:"A unique and precise title of the API."},version:{type:"string",description:"A semantic version number of the API."},description:{type:"string",description:"A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."},termsOfService:{type:"string",description:"The terms of service for the API."},contact:{$ref:"#/definitions/contact"},license:{$ref:"#/definitions/license"}}},contact:{type:"object",description:"Contact information for the owners of the API.",additionalProperties:!1,properties:{name:{type:"string",description:"The identifying name of the contact person/organization."},url:{type:"string",description:"The URL pointing to the contact information.",format:"uri"},email:{type:"string",description:"The email address of the contact person/organization.",format:"email"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},license:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"The name of the license type. It's encouraged to use an OSI compatible license."},url:{type:"string",description:"The URL pointing to the license.",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},paths:{type:"object",description:"Relative paths to the individual endpoints. They must be relative to the 'basePath'.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"},"^/":{$ref:"#/definitions/pathItem"}},additionalProperties:!1},definitions:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},description:"One or more JSON objects describing the schemas being consumed and produced by the API."},parameterDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/parameter"},description:"One or more JSON representations for parameters"},responseDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/response"},description:"One or more JSON representations for parameters"},externalDocs:{type:"object",additionalProperties:!1,description:"information about external documentation",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},examples:{type:"object",additionalProperties:!0},mimeType:{type:"string",description:"The MIME type of the HTTP message."},operation:{type:"object",required:["responses"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{tags:{type:"array",items:{type:"string"},uniqueItems:!0},summary:{type:"string",description:"A brief summary of the operation."},description:{type:"string",description:"A longer description of the operation, GitHub Flavored Markdown is allowed."},externalDocs:{$ref:"#/definitions/externalDocs"},operationId:{type:"string",description:"A unique identifier of the operation."},produces:{description:"A list of MIME types the API can produce.",$ref:"#/definitions/mediaTypeList"},consumes:{description:"A list of MIME types the API can consume.",$ref:"#/definitions/mediaTypeList"},parameters:{$ref:"#/definitions/parametersList"},responses:{$ref:"#/definitions/responses"},schemes:{$ref:"#/definitions/schemesList"},deprecated:{type:"boolean","default":!1},security:{$ref:"#/definitions/security"}}},pathItem:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},get:{$ref:"#/definitions/operation"},put:{$ref:"#/definitions/operation"},post:{$ref:"#/definitions/operation"},"delete":{$ref:"#/definitions/operation"},options:{$ref:"#/definitions/operation"},head:{$ref:"#/definitions/operation"},patch:{$ref:"#/definitions/operation"},parameters:{$ref:"#/definitions/parametersList"}}},responses:{type:"object",description:"Response objects names can either be any valid HTTP status code or 'default'.",minProperties:1,additionalProperties:!1,patternProperties:{"^([0-9]{3})$|^(default)$":{$ref:"#/definitions/responseValue"},"^x-":{$ref:"#/definitions/vendorExtension"}},not:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}}},responseValue:{oneOf:[{$ref:"#/definitions/response"},{$ref:"#/definitions/jsonReference"}]},response:{type:"object",required:["description"],properties:{description:{type:"string"},schema:{oneOf:[{$ref:"#/definitions/schema"},{$ref:"#/definitions/fileSchema"}]},headers:{$ref:"#/definitions/headers"},examples:{$ref:"#/definitions/examples"}},additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},headers:{type:"object",additionalProperties:{$ref:"#/definitions/header"}},header:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string","enum":["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},vendorExtension:{description:"Any property starting with x- is valid.",additionalProperties:!0,additionalItems:!0},bodyParameter:{type:"object",required:["name","in","schema"],patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},"in":{type:"string",description:"Determines the location of the parameter.","enum":["body"]},required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.","default":!1},schema:{$ref:"#/definitions/schema"}},additionalProperties:!1},headerParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.","default":!1},"in":{type:"string",description:"Determines the location of the parameter.","enum":["header"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string","enum":["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},queryParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.","default":!1},"in":{type:"string",description:"Determines the location of the parameter.","enum":["query"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean","default":!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string","enum":["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},formDataParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.","default":!1},"in":{type:"string",description:"Determines the location of the parameter.","enum":["formData"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean","default":!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string","enum":["string","number","boolean","integer","array","file"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},pathParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["required"],properties:{required:{type:"boolean","enum":[!0],description:"Determines whether or not this parameter is required or optional."},"in":{type:"string",description:"Determines the location of the parameter.","enum":["path"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string","enum":["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},nonBodyParameter:{type:"object",required:["name","in","type"],oneOf:[{$ref:"#/definitions/headerParameterSubSchema"},{$ref:"#/definitions/formDataParameterSubSchema"},{$ref:"#/definitions/queryParameterSubSchema"},{$ref:"#/definitions/pathParameterSubSchema"}]},parameter:{oneOf:[{$ref:"#/definitions/bodyParameter"},{$ref:"#/definitions/nonBodyParameter"}]},schema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},"default":{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},maxProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},"enum":{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},additionalProperties:{anyOf:[{$ref:"#/definitions/schema"},{type:"boolean"}],"default":{}},type:{$ref:"http://json-schema.org/draft-04/schema#/properties/type"},items:{anyOf:[{$ref:"#/definitions/schema"},{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}}],"default":{}},allOf:{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}},properties:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},"default":{}},discriminator:{type:"string"},readOnly:{type:"boolean","default":!1},xml:{$ref:"#/definitions/xml"},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},fileSchema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["type"],properties:{format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},"default":{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},type:{type:"string","enum":["file"]},readOnly:{type:"boolean","default":!1},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},primitivesItems:{type:"object",additionalProperties:!1,properties:{type:{type:"string","enum":["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},"default":{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},"enum":{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},security:{type:"array",items:{$ref:"#/definitions/securityRequirement"},uniqueItems:!0},securityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"},uniqueItems:!0}},xml:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean","default":!1},wrapped:{type:"boolean","default":!1}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},tag:{type:"object",additionalProperties:!1,required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/externalDocs"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},securityDefinitions:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/basicAuthenticationSecurity"},{$ref:"#/definitions/apiKeySecurity"},{$ref:"#/definitions/oauth2ImplicitSecurity"},{$ref:"#/definitions/oauth2PasswordSecurity"},{$ref:"#/definitions/oauth2ApplicationSecurity"},{$ref:"#/definitions/oauth2AccessCodeSecurity"}]}},basicAuthenticationSecurity:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string","enum":["basic"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},apiKeySecurity:{type:"object",additionalProperties:!1,required:["type","name","in"],properties:{type:{type:"string","enum":["apiKey"]},name:{type:"string"},"in":{type:"string","enum":["header","query"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ImplicitSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl"],properties:{type:{type:"string","enum":["oauth2"]},flow:{type:"string","enum":["implicit"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2PasswordSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string","enum":["oauth2"]},flow:{type:"string","enum":["password"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ApplicationSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string","enum":["oauth2"]},flow:{type:"string","enum":["application"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2AccessCodeSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl","tokenUrl"],properties:{type:{type:"string","enum":["oauth2"]},flow:{type:"string","enum":["accessCode"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2Scopes:{type:"object",additionalProperties:{type:"string"}},mediaTypeList:{type:"array",items:{$ref:"#/definitions/mimeType"},uniqueItems:!0},parametersList:{type:"array",description:"The parameters needed to send a valid API call.",additionalItems:!1,items:{oneOf:[{$ref:"#/definitions/parameter"},{$ref:"#/definitions/jsonReference"}]},uniqueItems:!0},schemesList:{type:"array",description:"The transfer protocol of the API.",items:{type:"string","enum":["http","https","ws","wss"]},uniqueItems:!0},collectionFormat:{type:"string","enum":["csv","ssv","tsv","pipes"],"default":"csv"},collectionFormatWithMulti:{type:"string","enum":["csv","ssv","tsv","pipes","multi"],"default":"csv"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},"default":{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},"enum":{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},jsonReference:{type:"object",required:["$ref"],additionalProperties:!1,properties:{$ref:{type:"string"}}}}}},{}],218:[function(e,t,r){ +t.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{"default":0}]},simpleTypes:{"enum":["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},"default":{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],"default":{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean","default":!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},definitions:{type:"object",additionalProperties:{$ref:"#"},"default":{}},properties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},"enum":{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},"default":{}}},{}]},{},[2])(2)}); \ No newline at end of file diff --git a/browser/swagger-tools-standalone.js b/browser/swagger-tools-standalone.js index 98f33687c2..7d709d9fda 100755 --- a/browser/swagger-tools-standalone.js +++ b/browser/swagger-tools-standalone.js @@ -1799,7 +1799,7 @@ module.exports.v2 = module.exports.v2_0 = new Specification('2.0'); // jshint ig }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../schemas/1.2/apiDeclaration.json":206,"../schemas/1.2/authorizationObject.json":207,"../schemas/1.2/dataType.json":208,"../schemas/1.2/dataTypeBase.json":209,"../schemas/1.2/infoObject.json":210,"../schemas/1.2/modelsObject.json":211,"../schemas/1.2/oauth2GrantType.json":212,"../schemas/1.2/operationObject.json":213,"../schemas/1.2/parameterObject.json":214,"../schemas/1.2/resourceListing.json":215,"../schemas/1.2/resourceObject.json":216,"../schemas/2.0/schema.json":217,"./helpers":1,"./validators":3,"async":4,"js-yaml":7,"json-refs":37,"lodash-compat/array/difference":38,"lodash-compat/array/union":41,"lodash-compat/collection/each":43,"lodash-compat/collection/find":44,"lodash-compat/collection/map":46,"lodash-compat/collection/reduce":47,"lodash-compat/lang/cloneDeep":116,"lodash-compat/lang/isArray":118,"lodash-compat/lang/isFunction":122,"lodash-compat/lang/isPlainObject":127,"lodash-compat/lang/isString":128,"lodash-compat/lang/isUndefined":130,"lodash-compat/object/has":131,"lodash-compat/object/set":135,"spark-md5":183,"swagger-converter":184,"traverse":185}],3:[function(require,module,exports){ +},{"../schemas/1.2/apiDeclaration.json":206,"../schemas/1.2/authorizationObject.json":207,"../schemas/1.2/dataType.json":208,"../schemas/1.2/dataTypeBase.json":209,"../schemas/1.2/infoObject.json":210,"../schemas/1.2/modelsObject.json":211,"../schemas/1.2/oauth2GrantType.json":212,"../schemas/1.2/operationObject.json":213,"../schemas/1.2/parameterObject.json":214,"../schemas/1.2/resourceListing.json":215,"../schemas/1.2/resourceObject.json":216,"../schemas/2.0/schema.json":217,"./helpers":1,"./validators":3,"async":4,"js-yaml":7,"json-refs":37,"lodash-compat/array/difference":38,"lodash-compat/array/union":41,"lodash-compat/collection/each":43,"lodash-compat/collection/find":44,"lodash-compat/collection/map":46,"lodash-compat/collection/reduce":47,"lodash-compat/lang/cloneDeep":116,"lodash-compat/lang/isArray":118,"lodash-compat/lang/isFunction":122,"lodash-compat/lang/isPlainObject":127,"lodash-compat/lang/isString":128,"lodash-compat/lang/isUndefined":130,"lodash-compat/object/has":131,"lodash-compat/object/set":135,"spark-md5":182,"swagger-converter":184,"traverse":185}],3:[function(require,module,exports){ /* * The MIT License (MIT) * @@ -3745,7 +3745,7 @@ var validateSchemaConstraints = module.exports.validateSchemaConstraints = funct }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":176}],5:[function(require,module,exports){ +},{"_process":175}],5:[function(require,module,exports){ },{}],6:[function(require,module,exports){ @@ -9237,7 +9237,7 @@ module.exports.pathToPtr = pathToPtr; module.exports.resolveRefs = resolveRefs; module.exports.resolveRefsAt = resolveRefsAt; -},{"native-promise-only":170,"path":171,"path-loader":172,"querystring":180,"slash":182,"uri-js":191}],38:[function(require,module,exports){ +},{"native-promise-only":170,"path":171,"path-loader":172,"querystring":179,"slash":181,"uri-js":191}],38:[function(require,module,exports){ var baseDifference = require('../internal/baseDifference'), baseFlatten = require('../internal/baseFlatten'), isArrayLike = require('../internal/isArrayLike'), @@ -15381,7 +15381,7 @@ var substr = 'ab'.substr(-1) === 'b' }).call(this,require('_process')) -},{"_process":176}],172:[function(require,module,exports){ +},{"_process":175}],172:[function(require,module,exports){ /* * The MIT License (MIT) * @@ -15761,2680 +15761,2680 @@ module.exports.load = function (location, options, callback) { } }; -},{"superagent":175}],175:[function(require,module,exports){ -/** - * Module dependencies. - */ - -var Emitter = require('emitter'); -var reduce = require('reduce'); +},{"superagent":183}],175:[function(require,module,exports){ +// shim for using process in browser -/** - * Root reference for iframes. - */ +var process = module.exports = {}; +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; -var root; -if (typeof window !== 'undefined') { // Browser window - root = window; -} else if (typeof self !== 'undefined') { // Web Worker - root = self; -} else { // Other environments - root = this; +function cleanUpNextTick() { + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } } -/** - * Noop. - */ - -function noop(){}; +function drainQueue() { + if (draining) { + return; + } + var timeout = setTimeout(cleanUpNextTick); + draining = true; -/** - * Check if `obj` is a host object, - * we don't want to serialize these :) - * - * TODO: future proof, move to compoent land - * - * @param {Object} obj - * @return {Boolean} - * @api private - */ + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); +} -function isHost(obj) { - var str = {}.toString.call(obj); +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + setTimeout(drainQueue, 0); + } +}; - switch (str) { - case '[object File]': - case '[object Blob]': - case '[object FormData]': - return true; - default: - return false; - } +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; } +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; -/** - * Determine XHR. - */ +function noop() {} -request.getXHR = function () { - if (root.XMLHttpRequest - && (!root.location || 'file:' != root.location.protocol - || !root.ActiveXObject)) { - return new XMLHttpRequest; - } else { - try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {} - try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {} - try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {} - try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {} - } - return false; -}; +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; -/** - * Removes leading and trailing whitespace, added to support IE. - * - * @param {String} s - * @return {String} - * @api private - */ +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; -var trim = ''.trim - ? function(s) { return s.trim(); } - : function(s) { return s.replace(/(^\s*|\s*$)/g, ''); }; +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; -/** - * Check if `obj` is an object. - * - * @param {Object} obj - * @return {Boolean} - * @api private - */ +},{}],176:[function(require,module,exports){ +(function (global){ +/*! https://mths.be/punycode v1.4.0 by @mathias */ +;(function(root) { -function isObject(obj) { - return obj === Object(obj); -} + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } -/** - * Serialize the given `obj`. - * - * @param {Object} obj - * @return {String} - * @api private - */ + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, -function serialize(obj) { - if (!isObject(obj)) return obj; - var pairs = []; - for (var key in obj) { - if (null != obj[key]) { - pushEncodedKeyValuePair(pairs, key, obj[key]); - } - } - return pairs.join('&'); -} + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 -/** - * Helps 'serialize' with serializing arrays. - * Mutates the pairs array. - * - * @param {Array} pairs - * @param {String} key - * @param {Mixed} val - */ + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' -function pushEncodedKeyValuePair(pairs, key, val) { - if (Array.isArray(val)) { - return val.forEach(function(v) { - pushEncodedKeyValuePair(pairs, key, v); - }); - } - pairs.push(encodeURIComponent(key) - + '=' + encodeURIComponent(val)); -} + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators -/** - * Expose serialization method. - */ + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, - request.serializeObject = serialize; + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, - /** - * Parse the given x-www-form-urlencoded `str`. - * - * @param {String} str - * @return {Object} - * @api private - */ + /** Temporary variable */ + key; -function parseString(str) { - var obj = {}; - var pairs = str.split('&'); - var parts; - var pair; + /*--------------------------------------------------------------------------*/ - for (var i = 0, len = pairs.length; i < len; ++i) { - pair = pairs[i]; - parts = pair.split('='); - obj[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); - } - - return obj; -} - -/** - * Expose parser. - */ - -request.parseString = parseString; - -/** - * Default MIME type map. - * - * superagent.types.xml = 'application/xml'; - * - */ - -request.types = { - html: 'text/html', - json: 'application/json', - xml: 'application/xml', - urlencoded: 'application/x-www-form-urlencoded', - 'form': 'application/x-www-form-urlencoded', - 'form-data': 'application/x-www-form-urlencoded' -}; - -/** - * Default serialization map. - * - * superagent.serialize['application/xml'] = function(obj){ - * return 'generated xml here'; - * }; - * - */ - - request.serialize = { - 'application/x-www-form-urlencoded': serialize, - 'application/json': JSON.stringify - }; - - /** - * Default parsers. - * - * superagent.parse['application/xml'] = function(str){ - * return { object parsed from str }; - * }; - * - */ - -request.parse = { - 'application/x-www-form-urlencoded': parseString, - 'application/json': JSON.parse -}; - -/** - * Parse the given header `str` into - * an object containing the mapped fields. - * - * @param {String} str - * @return {Object} - * @api private - */ - -function parseHeader(str) { - var lines = str.split(/\r?\n/); - var fields = {}; - var index; - var line; - var field; - var val; - - lines.pop(); // trailing CRLF - - for (var i = 0, len = lines.length; i < len; ++i) { - line = lines[i]; - index = line.indexOf(':'); - field = line.slice(0, index).toLowerCase(); - val = trim(line.slice(index + 1)); - fields[field] = val; - } - - return fields; -} - -/** - * Check if `mime` is json or has +json structured syntax suffix. - * - * @param {String} mime - * @return {Boolean} - * @api private - */ - -function isJSON(mime) { - return /[\/+]json\b/.test(mime); -} - -/** - * Return the mime type for the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -function type(str){ - return str.split(/ *; */).shift(); -}; - -/** - * Return header field parameters. - * - * @param {String} str - * @return {Object} - * @api private - */ - -function params(str){ - return reduce(str.split(/ *; */), function(obj, str){ - var parts = str.split(/ *= */) - , key = parts.shift() - , val = parts.shift(); - - if (key && val) obj[key] = val; - return obj; - }, {}); -}; - -/** - * Initialize a new `Response` with the given `xhr`. - * - * - set flags (.ok, .error, etc) - * - parse header - * - * Examples: - * - * Aliasing `superagent` as `request` is nice: - * - * request = superagent; - * - * We can use the promise-like API, or pass callbacks: - * - * request.get('/').end(function(res){}); - * request.get('/', function(res){}); - * - * Sending data can be chained: - * - * request - * .post('/user') - * .send({ name: 'tj' }) - * .end(function(res){}); - * - * Or passed to `.send()`: - * - * request - * .post('/user') - * .send({ name: 'tj' }, function(res){}); - * - * Or passed to `.post()`: - * - * request - * .post('/user', { name: 'tj' }) - * .end(function(res){}); - * - * Or further reduced to a single call for simple cases: - * - * request - * .post('/user', { name: 'tj' }, function(res){}); - * - * @param {XMLHTTPRequest} xhr - * @param {Object} options - * @api private - */ + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw new RangeError(errors[type]); + } -function Response(req, options) { - options = options || {}; - this.req = req; - this.xhr = this.req.xhr; - // responseText is accessible only if responseType is '' or 'text' and on older browsers - this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined') - ? this.xhr.responseText - : null; - this.statusText = this.req.xhr.statusText; - this.setStatusProperties(this.xhr.status); - this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders()); - // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but - // getResponseHeader still works. so we get content-type even if getting - // other headers fails. - this.header['content-type'] = this.xhr.getResponseHeader('content-type'); - this.setHeaderProperties(this.header); - this.body = this.req.method != 'HEAD' - ? this.parseBody(this.text ? this.text : this.xhr.response) - : null; -} + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } -/** - * Get case-insensitive `field` value. - * - * @param {String} field - * @return {String} - * @api public - */ + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } -Response.prototype.get = function(field){ - return this.header[field.toLowerCase()]; -}; + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } -/** - * Set header related properties: - * - * - `.type` the content type without params - * - * A response of "Content-Type: text/plain; charset=utf-8" - * will provide you with a `.type` of "text/plain". - * - * @param {Object} header - * @api private - */ + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } -Response.prototype.setHeaderProperties = function(header){ - // content-type - var ct = this.header['content-type'] || ''; - this.type = type(ct); + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } - // params - var obj = params(ct); - for (var key in obj) this[key] = obj[key]; -}; + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } -/** - * Parse the given body `str`. - * - * Used for auto-parsing of bodies. Parsers - * are defined on the `superagent.parse` object. - * - * @param {String} str - * @return {Mixed} - * @api private - */ + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } -Response.prototype.parseBody = function(str){ - var parse = request.parse[this.type]; - return parse && str && (str.length || str instanceof Object) - ? parse(str) - : null; -}; + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; -/** - * Set flags such as `.ok` based on `status`. - * - * For example a 2xx response will give you a `.ok` of __true__ - * whereas 5xx will be __false__ and `.error` will be __true__. The - * `.clientError` and `.serverError` are also available to be more - * specific, and `.statusType` is the class of error ranging from 1..5 - * sometimes useful for mapping respond colors etc. - * - * "sugar" properties are also defined for common cases. Currently providing: - * - * - .noContent - * - .badRequest - * - .unauthorized - * - .notAcceptable - * - .notFound - * - * @param {Number} status - * @api private - */ + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. -Response.prototype.setStatusProperties = function(status){ - // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request - if (status === 1223) { - status = 204; - } + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } - var type = status / 100 | 0; + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } - // status / class - this.status = this.statusCode = status; - this.statusType = type; + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. - // basics - this.info = 1 == type; - this.ok = 2 == type; - this.clientError = 4 == type; - this.serverError = 5 == type; - this.error = (4 == type || 5 == type) - ? this.toError() - : false; + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - // sugar - this.accepted = 202 == status; - this.noContent = 204 == status; - this.badRequest = 400 == status; - this.unauthorized = 401 == status; - this.notAcceptable = 406 == status; - this.notFound = 404 == status; - this.forbidden = 403 == status; -}; + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { -/** - * Return an `Error` representative of this response. - * - * @return {Error} - * @api public - */ + if (index >= inputLength) { + error('invalid-input'); + } -Response.prototype.toError = function(){ - var req = this.req; - var method = req.method; - var url = req.url; + digit = basicToDigit(input.charCodeAt(index++)); - var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')'; - var err = new Error(msg); - err.status = this.status; - err.method = method; - err.url = url; + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } - return err; -}; + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); -/** - * Expose `Response`. - */ + if (digit < t) { + break; + } -request.Response = Response; + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } -/** - * Initialize a new `Request` with the given `method` and `url`. - * - * @param {String} method - * @param {String} url - * @api public - */ + w *= baseMinusT; -function Request(method, url) { - var self = this; - Emitter.call(this); - this._query = this._query || []; - this.method = method; - this.url = url; - this.header = {}; - this._header = {}; - this.on('end', function(){ - var err = null; - var res = null; + } - try { - res = new Response(self); - } catch(e) { - err = new Error('Parser is unable to parse the response'); - err.parse = true; - err.original = e; - // issue #675: return the raw response if the response parsing fails - err.rawResponse = self.xhr && self.xhr.responseText ? self.xhr.responseText : null; - return self.callback(err); - } + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); - self.emit('response', res); + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } - if (err) { - return self.callback(err, res); - } + n += floor(i / out); + i %= out; - if (res.status >= 200 && res.status < 300) { - return self.callback(err, res); - } + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); - var new_err = new Error(res.statusText || 'Unsuccessful HTTP response'); - new_err.original = err; - new_err.response = res; - new_err.status = res.status; + } - self.callback(new_err, res); - }); -} + return ucs2encode(output); + } -/** - * Mixin `Emitter`. - */ + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; -Emitter(Request.prototype); + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); -/** - * Allow for extension - */ + // Cache the length + inputLength = input.length; -Request.prototype.use = function(fn) { - fn(this); - return this; -} + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; -/** - * Set timeout to `ms`. - * - * @param {Number} ms - * @return {Request} for chaining - * @api public - */ + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } -Request.prototype.timeout = function(ms){ - this._timeout = ms; - return this; -}; + handledCPCount = basicLength = output.length; -/** - * Clear previous timeout. - * - * @return {Request} for chaining - * @api public - */ + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. -Request.prototype.clearTimeout = function(){ - this._timeout = 0; - clearTimeout(this._timer); - return this; -}; + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } -/** - * Abort the request, and clear potential timeout. - * - * @return {Request} - * @api public - */ + // Main encoding loop: + while (handledCPCount < inputLength) { -Request.prototype.abort = function(){ - if (this.aborted) return; - this.aborted = true; - this.xhr.abort(); - this.clearTimeout(); - this.emit('abort'); - return this; -}; + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } -/** - * Set header `field` to `val`, or multiple fields with one object. - * - * Examples: - * - * req.get('/') - * .set('Accept', 'application/json') - * .set('X-API-Key', 'foobar') - * .end(callback); - * - * req.get('/') - * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' }) - * .end(callback); - * - * @param {String|Object} field - * @param {String} val - * @return {Request} for chaining - * @api public - */ + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } -Request.prototype.set = function(field, val){ - if (isObject(field)) { - for (var key in field) { - this.set(key, field[key]); - } - return this; - } - this._header[field.toLowerCase()] = val; - this.header[field] = val; - return this; -}; + delta += (m - n) * handledCPCountPlusOne; + n = m; -/** - * Remove header `field`. - * - * Example: - * - * req.get('/') - * .unset('User-Agent') - * .end(callback); - * - * @param {String} field - * @return {Request} for chaining - * @api public - */ + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; -Request.prototype.unset = function(field){ - delete this._header[field.toLowerCase()]; - delete this.header[field]; - return this; -}; + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } -/** - * Get case-insensitive header `field` value. - * - * @param {String} field - * @return {String} - * @api private - */ + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } -Request.prototype.getHeader = function(field){ - return this._header[field.toLowerCase()]; -}; + ++delta; + ++n; -/** - * Set Content-Type to `type`, mapping values from `request.types`. - * - * Examples: - * - * superagent.types.xml = 'application/xml'; - * - * request.post('/') - * .type('xml') - * .send(xmlstring) - * .end(callback); - * - * request.post('/') - * .type('application/xml') - * .send(xmlstring) - * .end(callback); - * - * @param {String} type - * @return {Request} for chaining - * @api public - */ + } + return output.join(''); + } -Request.prototype.type = function(type){ - this.set('Content-Type', request.types[type] || type); - return this; -}; + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } -/** - * Force given parser - * - * Sets the body parser no matter type. - * - * @param {Function} - * @api public - */ + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } -Request.prototype.parse = function(fn){ - this._parser = fn; - return this; -}; + /*--------------------------------------------------------------------------*/ -/** - * Set Accept to `type`, mapping values from `request.types`. - * - * Examples: - * - * superagent.types.json = 'application/json'; - * - * request.get('/agent') - * .accept('json') - * .end(callback); - * - * request.get('/agent') - * .accept('application/json') - * .end(callback); - * - * @param {String} accept - * @return {Request} for chaining - * @api public - */ + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.3.2', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; -Request.prototype.accept = function(type){ - this.set('Accept', request.types[type] || type); - return this; -}; + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { + // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { + // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { + // in Rhino or a web browser + root.punycode = punycode; + } -/** - * Set Authorization field value with `user` and `pass`. - * - * @param {String} user - * @param {String} pass - * @return {Request} for chaining - * @api public - */ +}(this)); -Request.prototype.auth = function(user, pass){ - var str = btoa(user + ':' + pass); - this.set('Authorization', 'Basic ' + str); - return this; -}; +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -/** -* Add query-string `val`. -* -* Examples: -* -* request.get('/shoes') -* .query('size=10') -* .query({ color: 'blue' }) -* -* @param {Object|String} val -* @return {Request} for chaining -* @api public -*/ +},{}],177:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -Request.prototype.query = function(val){ - if ('string' != typeof val) val = serialize(val); - if (val) this._query.push(val); - return this; -}; +'use strict'; -/** - * Write the field `name` and `val` for "multipart/form-data" - * request bodies. - * - * ``` js - * request.post('/upload') - * .field('foo', 'bar') - * .end(callback); - * ``` - * - * @param {String} name - * @param {String|Blob|File} val - * @return {Request} for chaining - * @api public - */ +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} -Request.prototype.field = function(name, val){ - if (!this._formData) this._formData = new root.FormData(); - this._formData.append(name, val); - return this; -}; +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; -/** - * Queue the given `file` as an attachment to the specified `field`, - * with optional `filename`. - * - * ``` js - * request.post('/upload') - * .attach(new Blob(['hey!'], { type: "text/html"})) - * .end(callback); - * ``` - * - * @param {String} field - * @param {Blob|File} file - * @param {String} filename - * @return {Request} for chaining - * @api public - */ + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } -Request.prototype.attach = function(field, file, filename){ - if (!this._formData) this._formData = new root.FormData(); - this._formData.append(field, file, filename || file.name); - return this; -}; + var regexp = /\+/g; + qs = qs.split(sep); -/** - * Send `data` as the request body, defaulting the `.type()` to "json" when - * an object is given. - * - * Examples: - * - * // manual json - * request.post('/user') - * .type('json') - * .send('{"name":"tj"}') - * .end(callback) - * - * // auto json - * request.post('/user') - * .send({ name: 'tj' }) - * .end(callback) - * - * // manual x-www-form-urlencoded - * request.post('/user') - * .type('form') - * .send('name=tj') - * .end(callback) - * - * // auto x-www-form-urlencoded - * request.post('/user') - * .type('form') - * .send({ name: 'tj' }) - * .end(callback) - * - * // defaults to x-www-form-urlencoded - * request.post('/user') - * .send('name=tobi') - * .send('species=ferret') - * .end(callback) - * - * @param {String|Object} data - * @return {Request} for chaining - * @api public - */ + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } -Request.prototype.send = function(data){ - var obj = isObject(data); - var type = this.getHeader('Content-Type'); + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } - // merge - if (obj && isObject(this._data)) { - for (var key in data) { - this._data[key] = data[key]; + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; } - } else if ('string' == typeof data) { - if (!type) this.type('form'); - type = this.getHeader('Content-Type'); - if ('application/x-www-form-urlencoded' == type) { - this._data = this._data - ? this._data + '&' + data - : data; + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); } else { - this._data = (this._data || '') + data; + obj[k] = [obj[k], v]; } - } else { - this._data = data; } - if (!obj || isHost(data)) return this; - if (!type) this.type('json'); - return this; + return obj; }; -/** - * Invoke the callback with `err` and `res` - * and handle arity check. - * - * @param {Error} err - * @param {Response} res - * @api private - */ - -Request.prototype.callback = function(err, res){ - var fn = this._callback; - this.clearTimeout(); - fn(err, res); +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; }; -/** - * Invoke callback with x-domain error. - * - * @api private - */ +},{}],178:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -Request.prototype.crossDomainError = function(){ - var err = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.'); - err.crossDomain = true; +'use strict'; - err.status = this.status; - err.method = this.method; - err.url = this.url; +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; - this.callback(err); + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } }; -/** - * Invoke callback with timeout error. - * - * @api private - */ +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } -Request.prototype.timeoutError = function(){ - var timeout = this._timeout; - var err = new Error('timeout of ' + timeout + 'ms exceeded'); - err.timeout = timeout; - this.callback(err); + if (typeof obj === 'object') { + return map(objectKeys(obj), function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (isArray(obj[k])) { + return map(obj[k], function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); }; -/** - * Enable transmission of cookies with x-domain requests. - * - * Note that for this to work the origin must not be - * using "Access-Control-Allow-Origin" with a wildcard, - * and also must set "Access-Control-Allow-Credentials" - * to "true". - * - * @api public - */ +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; -Request.prototype.withCredentials = function(){ - this._withCredentials = true; - return this; +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + return res; }; +},{}],179:[function(require,module,exports){ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); + +},{"./decode":177,"./encode":178}],180:[function(require,module,exports){ + /** - * Initiate request, invoking callback `fn(res)` - * with an instanceof `Response`. + * Reduce `arr` with `fn`. * + * @param {Array} arr * @param {Function} fn - * @return {Request} for chaining - * @api public + * @param {Mixed} initial + * + * TODO: combatible error handling? */ -Request.prototype.end = function(fn){ - var self = this; - var xhr = this.xhr = request.getXHR(); - var query = this._query.join('&'); - var timeout = this._timeout; - var data = this._formData || this._data; +module.exports = function(arr, fn, initial){ + var idx = 0; + var len = arr.length; + var curr = arguments.length == 3 + ? initial + : arr[idx++]; - // store callback - this._callback = fn || noop; + while (idx < len) { + curr = fn.call(null, curr, arr[idx], ++idx, arr); + } + + return curr; +}; +},{}],181:[function(require,module,exports){ +'use strict'; +module.exports = function (str) { + var isExtendedLengthPath = /^\\\\\?\\/.test(str); + var hasNonAscii = /[^\x00-\x80]+/.test(str); - // state change - xhr.onreadystatechange = function(){ - if (4 != xhr.readyState) return; + if (isExtendedLengthPath || hasNonAscii) { + return str; + } - // In IE9, reads to any property (e.g. status) off of an aborted XHR will - // result in the error "Could not complete the operation due to error c00c023f" - var status; - try { status = xhr.status } catch(e) { status = 0; } + return str.replace(/\\/g, '/'); +}; - if (0 == status) { - if (self.timedout) return self.timeoutError(); - if (self.aborted) return; - return self.crossDomainError(); - } - self.emit('end'); - }; +},{}],182:[function(require,module,exports){ +(function (factory) { + if (typeof exports === 'object') { + // Node/CommonJS + module.exports = factory(); + } else if (typeof define === 'function' && define.amd) { + // AMD + define(factory); + } else { + // Browser globals (with support for web workers) + var glob; - // progress - var handleProgress = function(e){ - if (e.total > 0) { - e.percent = e.loaded / e.total * 100; - } - e.direction = 'download'; - self.emit('progress', e); - }; - if (this.hasListeners('progress')) { - xhr.onprogress = handleProgress; - } - try { - if (xhr.upload && this.hasListeners('progress')) { - xhr.upload.onprogress = handleProgress; + try { + glob = window; + } catch (e) { + glob = self; + } + + glob.SparkMD5 = factory(); } - } catch(e) { - // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist. - // Reported here: - // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context - } +}(function (undefined) { - // timeout - if (timeout && !this._timer) { - this._timer = setTimeout(function(){ - self.timedout = true; - self.abort(); - }, timeout); - } + 'use strict'; - // querystring - if (query) { - query = request.serializeObject(query); - this.url += ~this.url.indexOf('?') - ? '&' + query - : '?' + query; - } + /* + * Fastest md5 implementation around (JKM md5) + * Credits: Joseph Myers + * + * @see http://www.myersdaily.org/joseph/javascript/md5-text.html + * @see http://jsperf.com/md5-shootout/7 + */ - // initiate request - xhr.open(this.method, this.url, true); + /* this function is much faster, + so if possible we use it. Some IEs + are the only ones I know of that + need the idiotic second function, + generated by an if clause. */ + var add32 = function (a, b) { + return (a + b) & 0xFFFFFFFF; + }, + hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; - // CORS - if (this._withCredentials) xhr.withCredentials = true; - // body - if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !isHost(data)) { - // serialize stuff - var contentType = this.getHeader('Content-Type'); - var serialize = this._parser || request.serialize[contentType ? contentType.split(';')[0] : '']; - if (!serialize && isJSON(contentType)) serialize = request.serialize['application/json']; - if (serialize) data = serialize(data); - } + function cmn(q, a, b, x, s, t) { + a = add32(add32(a, q), add32(x, t)); + return add32((a << s) | (a >>> (32 - s)), b); + } - // set header fields - for (var field in this.header) { - if (null == this.header[field]) continue; - xhr.setRequestHeader(field, this.header[field]); - } + function ff(a, b, c, d, x, s, t) { + return cmn((b & c) | ((~b) & d), a, b, x, s, t); + } - // send stuff - this.emit('request', this); + function gg(a, b, c, d, x, s, t) { + return cmn((b & d) | (c & (~d)), a, b, x, s, t); + } - // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing) - // We need null here if data is undefined - xhr.send(typeof data !== 'undefined' ? data : null); - return this; -}; + function hh(a, b, c, d, x, s, t) { + return cmn(b ^ c ^ d, a, b, x, s, t); + } -/** - * Faux promise support - * - * @param {Function} fulfill - * @param {Function} reject - * @return {Request} - */ + function ii(a, b, c, d, x, s, t) { + return cmn(c ^ (b | (~d)), a, b, x, s, t); + } -Request.prototype.then = function (fulfill, reject) { - return this.end(function(err, res) { - err ? reject(err) : fulfill(res); - }); -} + function md5cycle(x, k) { + var a = x[0], + b = x[1], + c = x[2], + d = x[3]; -/** - * Expose `Request`. - */ + a = ff(a, b, c, d, k[0], 7, -680876936); + d = ff(d, a, b, c, k[1], 12, -389564586); + c = ff(c, d, a, b, k[2], 17, 606105819); + b = ff(b, c, d, a, k[3], 22, -1044525330); + a = ff(a, b, c, d, k[4], 7, -176418897); + d = ff(d, a, b, c, k[5], 12, 1200080426); + c = ff(c, d, a, b, k[6], 17, -1473231341); + b = ff(b, c, d, a, k[7], 22, -45705983); + a = ff(a, b, c, d, k[8], 7, 1770035416); + d = ff(d, a, b, c, k[9], 12, -1958414417); + c = ff(c, d, a, b, k[10], 17, -42063); + b = ff(b, c, d, a, k[11], 22, -1990404162); + a = ff(a, b, c, d, k[12], 7, 1804603682); + d = ff(d, a, b, c, k[13], 12, -40341101); + c = ff(c, d, a, b, k[14], 17, -1502002290); + b = ff(b, c, d, a, k[15], 22, 1236535329); -request.Request = Request; + a = gg(a, b, c, d, k[1], 5, -165796510); + d = gg(d, a, b, c, k[6], 9, -1069501632); + c = gg(c, d, a, b, k[11], 14, 643717713); + b = gg(b, c, d, a, k[0], 20, -373897302); + a = gg(a, b, c, d, k[5], 5, -701558691); + d = gg(d, a, b, c, k[10], 9, 38016083); + c = gg(c, d, a, b, k[15], 14, -660478335); + b = gg(b, c, d, a, k[4], 20, -405537848); + a = gg(a, b, c, d, k[9], 5, 568446438); + d = gg(d, a, b, c, k[14], 9, -1019803690); + c = gg(c, d, a, b, k[3], 14, -187363961); + b = gg(b, c, d, a, k[8], 20, 1163531501); + a = gg(a, b, c, d, k[13], 5, -1444681467); + d = gg(d, a, b, c, k[2], 9, -51403784); + c = gg(c, d, a, b, k[7], 14, 1735328473); + b = gg(b, c, d, a, k[12], 20, -1926607734); -/** - * Issue a request: - * - * Examples: - * - * request('GET', '/users').end(callback) - * request('/users').end(callback) - * request('/users', callback) - * - * @param {String} method - * @param {String|Function} url or callback - * @return {Request} - * @api public - */ + a = hh(a, b, c, d, k[5], 4, -378558); + d = hh(d, a, b, c, k[8], 11, -2022574463); + c = hh(c, d, a, b, k[11], 16, 1839030562); + b = hh(b, c, d, a, k[14], 23, -35309556); + a = hh(a, b, c, d, k[1], 4, -1530992060); + d = hh(d, a, b, c, k[4], 11, 1272893353); + c = hh(c, d, a, b, k[7], 16, -155497632); + b = hh(b, c, d, a, k[10], 23, -1094730640); + a = hh(a, b, c, d, k[13], 4, 681279174); + d = hh(d, a, b, c, k[0], 11, -358537222); + c = hh(c, d, a, b, k[3], 16, -722521979); + b = hh(b, c, d, a, k[6], 23, 76029189); + a = hh(a, b, c, d, k[9], 4, -640364487); + d = hh(d, a, b, c, k[12], 11, -421815835); + c = hh(c, d, a, b, k[15], 16, 530742520); + b = hh(b, c, d, a, k[2], 23, -995338651); -function request(method, url) { - // callback - if ('function' == typeof url) { - return new Request('GET', method).end(url); - } + a = ii(a, b, c, d, k[0], 6, -198630844); + d = ii(d, a, b, c, k[7], 10, 1126891415); + c = ii(c, d, a, b, k[14], 15, -1416354905); + b = ii(b, c, d, a, k[5], 21, -57434055); + a = ii(a, b, c, d, k[12], 6, 1700485571); + d = ii(d, a, b, c, k[3], 10, -1894986606); + c = ii(c, d, a, b, k[10], 15, -1051523); + b = ii(b, c, d, a, k[1], 21, -2054922799); + a = ii(a, b, c, d, k[8], 6, 1873313359); + d = ii(d, a, b, c, k[15], 10, -30611744); + c = ii(c, d, a, b, k[6], 15, -1560198380); + b = ii(b, c, d, a, k[13], 21, 1309151649); + a = ii(a, b, c, d, k[4], 6, -145523070); + d = ii(d, a, b, c, k[11], 10, -1120210379); + c = ii(c, d, a, b, k[2], 15, 718787259); + b = ii(b, c, d, a, k[9], 21, -343485551); - // url first - if (1 == arguments.length) { - return new Request('GET', method); - } + x[0] = add32(a, x[0]); + x[1] = add32(b, x[1]); + x[2] = add32(c, x[2]); + x[3] = add32(d, x[3]); + } - return new Request(method, url); -} + function md5blk(s) { + var md5blks = [], + i; /* Andy King said do it this way. */ -/** - * GET `url` with optional callback `fn(res)`. - * - * @param {String} url - * @param {Mixed|Function} data or fn - * @param {Function} fn - * @return {Request} - * @api public - */ + for (i = 0; i < 64; i += 4) { + md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24); + } + return md5blks; + } -request.get = function(url, data, fn){ - var req = request('GET', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.query(data); - if (fn) req.end(fn); - return req; -}; + function md5blk_array(a) { + var md5blks = [], + i; /* Andy King said do it this way. */ -/** - * HEAD `url` with optional callback `fn(res)`. - * - * @param {String} url - * @param {Mixed|Function} data or fn - * @param {Function} fn - * @return {Request} - * @api public - */ + for (i = 0; i < 64; i += 4) { + md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24); + } + return md5blks; + } -request.head = function(url, data, fn){ - var req = request('HEAD', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.send(data); - if (fn) req.end(fn); - return req; -}; + function md51(s) { + var n = s.length, + state = [1732584193, -271733879, -1732584194, 271733878], + i, + length, + tail, + tmp, + lo, + hi; -/** - * DELETE `url` with optional callback `fn(res)`. - * - * @param {String} url - * @param {Function} fn - * @return {Request} - * @api public - */ + for (i = 64; i <= n; i += 64) { + md5cycle(state, md5blk(s.substring(i - 64, i))); + } + s = s.substring(i - 64); + length = s.length; + tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + for (i = 0; i < length; i += 1) { + tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3); + } + tail[i >> 2] |= 0x80 << ((i % 4) << 3); + if (i > 55) { + md5cycle(state, tail); + for (i = 0; i < 16; i += 1) { + tail[i] = 0; + } + } -function del(url, fn){ - var req = request('DELETE', url); - if (fn) req.end(fn); - return req; -}; + // Beware that the final length might not fit in 32 bits so we take care of that + tmp = n * 8; + tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); + lo = parseInt(tmp[2], 16); + hi = parseInt(tmp[1], 16) || 0; -request['del'] = del; -request['delete'] = del; + tail[14] = lo; + tail[15] = hi; -/** - * PATCH `url` with optional `data` and callback `fn(res)`. - * - * @param {String} url - * @param {Mixed} data - * @param {Function} fn - * @return {Request} - * @api public - */ + md5cycle(state, tail); + return state; + } -request.patch = function(url, data, fn){ - var req = request('PATCH', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.send(data); - if (fn) req.end(fn); - return req; -}; + function md51_array(a) { + var n = a.length, + state = [1732584193, -271733879, -1732584194, 271733878], + i, + length, + tail, + tmp, + lo, + hi; -/** - * POST `url` with optional `data` and callback `fn(res)`. - * - * @param {String} url - * @param {Mixed} data - * @param {Function} fn - * @return {Request} - * @api public - */ + for (i = 64; i <= n; i += 64) { + md5cycle(state, md5blk_array(a.subarray(i - 64, i))); + } -request.post = function(url, data, fn){ - var req = request('POST', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.send(data); - if (fn) req.end(fn); - return req; -}; + // Not sure if it is a bug, however IE10 will always produce a sub array of length 1 + // containing the last element of the parent array if the sub array specified starts + // beyond the length of the parent array - weird. + // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue + a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0); -/** - * PUT `url` with optional `data` and callback `fn(res)`. - * - * @param {String} url - * @param {Mixed|Function} data or fn - * @param {Function} fn - * @return {Request} - * @api public - */ + length = a.length; + tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + for (i = 0; i < length; i += 1) { + tail[i >> 2] |= a[i] << ((i % 4) << 3); + } -request.put = function(url, data, fn){ - var req = request('PUT', url); - if ('function' == typeof data) fn = data, data = null; - if (data) req.send(data); - if (fn) req.end(fn); - return req; -}; + tail[i >> 2] |= 0x80 << ((i % 4) << 3); + if (i > 55) { + md5cycle(state, tail); + for (i = 0; i < 16; i += 1) { + tail[i] = 0; + } + } -/** - * Expose `request`. - */ + // Beware that the final length might not fit in 32 bits so we take care of that + tmp = n * 8; + tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); + lo = parseInt(tmp[2], 16); + hi = parseInt(tmp[1], 16) || 0; -module.exports = request; + tail[14] = lo; + tail[15] = hi; -},{"emitter":6,"reduce":181}],176:[function(require,module,exports){ -// shim for using process in browser + md5cycle(state, tail); -var process = module.exports = {}; -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; + return state; + } -function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; + function rhex(n) { + var s = '', + j; + for (j = 0; j < 4; j += 1) { + s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F]; + } + return s; } - if (queue.length) { - drainQueue(); + + function hex(x) { + var i; + for (i = 0; i < x.length; i += 1) { + x[i] = rhex(x[i]); + } + return x.join(''); } -} -function drainQueue() { - if (draining) { - return; + // In some cases the fast add32 function cannot be used.. + if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') { + add32 = function (x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF), + msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); + }; } - var timeout = setTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } + // --------------------------------------------------- + + function toUtf8(str) { + if (/[\u0080-\uFFFF]/.test(str)) { + str = unescape(encodeURIComponent(str)); } - queueIndex = -1; - len = queue.length; + + return str; } - currentQueue = null; - draining = false; - clearTimeout(timeout); -} -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; + function utf8Str2ArrayBuffer(str, returnUInt8Array) { + var length = str.length, + buff = new ArrayBuffer(length), + arr = new Uint8Array(buff), + i; + + for (i = 0; i < length; i++) { + arr[i] = str.charCodeAt(i); } + + return returnUInt8Array ? arr : buff; } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); + + function arrayBuffer2Utf8Str(buff) { + return String.fromCharCode.apply(null, new Uint8Array(buff)); } -}; -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; + function concatenateArrayBuffers(first, second, returnUInt8Array) { + var result = new Uint8Array(first.byteLength + second.byteLength); -function noop() {} + result.set(new Uint8Array(first)); + result.set(new Uint8Array(second), first.byteLength); -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; + return returnUInt8Array ? result : result.buffer; + } -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; + // --------------------------------------------------- -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; + /** + * SparkMD5 OOP implementation. + * + * Use this class to perform an incremental md5, otherwise use the + * static methods instead. + */ + function SparkMD5() { + // call reset to init the instance + this.reset(); + } -},{}],177:[function(require,module,exports){ -(function (global){ -/*! https://mths.be/punycode v1.4.0 by @mathias */ -;(function(root) { + /** + * Appends a string. + * A conversion will be applied if an utf8 string is detected. + * + * @param {String} str The string to be appended + * + * @return {SparkMD5} The instance itself + */ + SparkMD5.prototype.append = function (str) { + // Converts the string to utf8 bytes if necessary + // Then append as binary + this.appendBinary(toUtf8(str)); - /** Detect free variables */ - var freeExports = typeof exports == 'object' && exports && - !exports.nodeType && exports; - var freeModule = typeof module == 'object' && module && - !module.nodeType && module; - var freeGlobal = typeof global == 'object' && global; - if ( - freeGlobal.global === freeGlobal || - freeGlobal.window === freeGlobal || - freeGlobal.self === freeGlobal - ) { - root = freeGlobal; - } + return this; + }; - /** - * The `punycode` object. - * @name punycode - * @type Object - */ - var punycode, + /** + * Appends a binary string. + * + * @param {String} contents The binary string to be appended + * + * @return {SparkMD5} The instance itself + */ + SparkMD5.prototype.appendBinary = function (contents) { + this._buff += contents; + this._length += contents.length; - /** Highest positive signed 32-bit float value */ - maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + var length = this._buff.length, + i; - /** Bootstring parameters */ - base = 36, - tMin = 1, - tMax = 26, - skew = 38, - damp = 700, - initialBias = 72, - initialN = 128, // 0x80 - delimiter = '-', // '\x2D' + for (i = 64; i <= length; i += 64) { + md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i))); + } - /** Regular expressions */ - regexPunycode = /^xn--/, - regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars - regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + this._buff = this._buff.substring(i - 64); - /** Error messages */ - errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' - }, + return this; + }; - /** Convenience shortcuts */ - baseMinusTMin = base - tMin, - floor = Math.floor, - stringFromCharCode = String.fromCharCode, + /** + * Finishes the incremental computation, reseting the internal state and + * returning the result. + * Use the raw parameter to obtain the raw result instead of the hex one. + * + * @param {Boolean} raw True to get the raw result, false to get the hex result + * + * @return {String|Array} The result + */ + SparkMD5.prototype.end = function (raw) { + var buff = this._buff, + length = buff.length, + i, + tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ret; - /** Temporary variable */ - key; + for (i = 0; i < length; i += 1) { + tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3); + } - /*--------------------------------------------------------------------------*/ + this._finish(tail, length); + ret = !!raw ? this._hash : hex(this._hash); - /** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ - function error(type) { - throw new RangeError(errors[type]); - } + this.reset(); - /** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ - function map(array, fn) { - var length = array.length; - var result = []; - while (length--) { - result[length] = fn(array[length]); - } - return result; - } + return ret; + }; - /** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ - function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; - } + /** + * Resets the internal state of the computation. + * + * @return {SparkMD5} The instance itself + */ + SparkMD5.prototype.reset = function () { + this._buff = ''; + this._length = 0; + this._hash = [1732584193, -271733879, -1732584194, 271733878]; + + return this; + }; + + /** + * Gets the internal state of the computation. + * + * @return {Object} The state + */ + SparkMD5.prototype.getState = function () { + return { + buff: this._buff, + length: this._length, + hash: this._hash + }; + }; - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ - function ucs2decode(string) { - var output = [], - counter = 0, - length = string.length, - value, - extra; - while (counter < length) { - value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // low surrogate - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - } + /** + * Gets the internal state of the computation. + * + * @param {Object} state The state + * + * @return {SparkMD5} The instance itself + */ + SparkMD5.prototype.setState = function (state) { + this._buff = state.buff; + this._length = state.length; + this._hash = state.hash; - /** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ - function ucs2encode(array) { - return map(array, function(value) { - var output = ''; - if (value > 0xFFFF) { - value -= 0x10000; - output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); - value = 0xDC00 | value & 0x3FF; - } - output += stringFromCharCode(value); - return output; - }).join(''); - } + return this; + }; - /** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ - function basicToDigit(codePoint) { - if (codePoint - 48 < 10) { - return codePoint - 22; - } - if (codePoint - 65 < 26) { - return codePoint - 65; - } - if (codePoint - 97 < 26) { - return codePoint - 97; - } - return base; - } + /** + * Releases memory used by the incremental buffer and other additional + * resources. If you plan to use the instance again, use reset instead. + */ + SparkMD5.prototype.destroy = function () { + delete this._hash; + delete this._buff; + delete this._length; + }; - /** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ - function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); - } + /** + * Finish the final calculation based on the tail. + * + * @param {Array} tail The tail (will be modified) + * @param {Number} length The length of the remaining buffer + */ + SparkMD5.prototype._finish = function (tail, length) { + var i = length, + tmp, + lo, + hi; - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ - function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); - } + tail[i >> 2] |= 0x80 << ((i % 4) << 3); + if (i > 55) { + md5cycle(this._hash, tail); + for (i = 0; i < 16; i += 1) { + tail[i] = 0; + } + } - /** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ - function decode(input) { - // Don't use UCS-2 - var output = [], - inputLength = input.length, - out, - i = 0, - n = initialN, - bias = initialBias, - basic, - j, - index, - oldi, - w, - k, - digit, - t, - /** Cached calculation results */ - baseMinusT; + // Do the final computation based on the tail and length + // Beware that the final length may not fit in 32 bits so we take care of that + tmp = this._length * 8; + tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); + lo = parseInt(tmp[2], 16); + hi = parseInt(tmp[1], 16) || 0; - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. + tail[14] = lo; + tail[15] = hi; + md5cycle(this._hash, tail); + }; - basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } + /** + * Performs the md5 hash on a string. + * A conversion will be applied if utf8 string is detected. + * + * @param {String} str The string + * @param {Boolean} raw True to get the raw result, false to get the hex result + * + * @return {String|Array} The result + */ + SparkMD5.hash = function (str, raw) { + // Converts the string to utf8 bytes if necessary + // Then compute it using the binary function + return SparkMD5.hashBinary(toUtf8(str), raw); + }; - for (j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } + /** + * Performs the md5 hash on a binary string. + * + * @param {String} content The binary string + * @param {Boolean} raw True to get the raw result, false to get the hex result + * + * @return {String|Array} The result + */ + SparkMD5.hashBinary = function (content, raw) { + var hash = md51(content); - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. + return !!raw ? hash : hex(hash); + }; - for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + // --------------------------------------------------- - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + /** + * SparkMD5 OOP implementation for array buffers. + * + * Use this class to perform an incremental md5 ONLY for array buffers. + */ + SparkMD5.ArrayBuffer = function () { + // call reset to init the instance + this.reset(); + }; + + /** + * Appends an array buffer. + * + * @param {ArrayBuffer} arr The array to be appended + * + * @return {SparkMD5.ArrayBuffer} The instance itself + */ + SparkMD5.ArrayBuffer.prototype.append = function (arr) { + var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), + length = buff.length, + i; - if (index >= inputLength) { - error('invalid-input'); - } + this._length += arr.byteLength; - digit = basicToDigit(input.charCodeAt(index++)); + for (i = 64; i <= length; i += 64) { + md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i))); + } - if (digit >= base || digit > floor((maxInt - i) / w)) { - error('overflow'); - } + // Avoids IE10 weirdness (documented above) + this._buff = (i - 64) < length ? buff.subarray(i - 64) : new Uint8Array(0); - i += digit * w; - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + return this; + }; - if (digit < t) { - break; - } + /** + * Finishes the incremental computation, reseting the internal state and + * returning the result. + * Use the raw parameter to obtain the raw result instead of the hex one. + * + * @param {Boolean} raw True to get the raw result, false to get the hex result + * + * @return {String|Array} The result + */ + SparkMD5.ArrayBuffer.prototype.end = function (raw) { + var buff = this._buff, + length = buff.length, + tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + i, + ret; - baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } + for (i = 0; i < length; i += 1) { + tail[i >> 2] |= buff[i] << ((i % 4) << 3); + } - w *= baseMinusT; + this._finish(tail, length); + ret = !!raw ? this._hash : hex(this._hash); - } + this.reset(); - out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); + return ret; + }; - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } + /** + * Resets the internal state of the computation. + * + * @return {SparkMD5.ArrayBuffer} The instance itself + */ + SparkMD5.ArrayBuffer.prototype.reset = function () { + this._buff = new Uint8Array(0); + this._length = 0; + this._hash = [1732584193, -271733879, -1732584194, 271733878]; - n += floor(i / out); - i %= out; + return this; + }; - // Insert `n` at position `i` of the output - output.splice(i++, 0, n); + /** + * Gets the internal state of the computation. + * + * @return {Object} The state + */ + SparkMD5.ArrayBuffer.prototype.getState = function () { + var state = SparkMD5.prototype.getState.call(this); - } + // Convert buffer to a string + state.buff = arrayBuffer2Utf8Str(state.buff); - return ucs2encode(output); - } + return state; + }; - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ - function encode(input) { - var n, - delta, - handledCPCount, - basicLength, - bias, - j, - m, - q, - k, - t, - currentValue, - output = [], - /** `inputLength` will hold the number of code points in `input`. */ - inputLength, - /** Cached calculation results */ - handledCPCountPlusOne, - baseMinusT, - qMinusT; + /** + * Gets the internal state of the computation. + * + * @param {Object} state The state + * + * @return {SparkMD5.ArrayBuffer} The instance itself + */ + SparkMD5.ArrayBuffer.prototype.setState = function (state) { + // Convert string to buffer + state.buff = utf8Str2ArrayBuffer(state.buff, true); - // Convert the input in UCS-2 to Unicode - input = ucs2decode(input); + return SparkMD5.prototype.setState.call(this, state); + }; - // Cache the length - inputLength = input.length; + SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy; - // Initialize the state - n = initialN; - delta = 0; - bias = initialBias; + SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish; - // Handle the basic code points - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } + /** + * Performs the md5 hash on an array buffer. + * + * @param {ArrayBuffer} arr The array buffer + * @param {Boolean} raw True to get the raw result, false to get the hex result + * + * @return {String|Array} The result + */ + SparkMD5.ArrayBuffer.hash = function (arr, raw) { + var hash = md51_array(new Uint8Array(arr)); - handledCPCount = basicLength = output.length; + return !!raw ? hash : hex(hash); + }; - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. + return SparkMD5; +})); - // Finish the basic string - if it is not empty - with a delimiter - if (basicLength) { - output.push(delimiter); - } +},{}],183:[function(require,module,exports){ +/** + * Module dependencies. + */ - // Main encoding loop: - while (handledCPCount < inputLength) { +var Emitter = require('emitter'); +var reduce = require('reduce'); - // All non-basic code points < n have been handled already. Find the next - // larger one: - for (m = maxInt, j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } +/** + * Root reference for iframes. + */ - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow - handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } +var root; +if (typeof window !== 'undefined') { // Browser window + root = window; +} else if (typeof self !== 'undefined') { // Web Worker + root = self; +} else { // Other environments + root = this; +} - delta += (m - n) * handledCPCountPlusOne; - n = m; +/** + * Noop. + */ - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; +function noop(){}; - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } +/** + * Check if `obj` is a host object, + * we don't want to serialize these :) + * + * TODO: future proof, move to compoent land + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ - if (currentValue == n) { - // Represent delta as a generalized variable-length integer - for (q = delta, k = base; /* no condition */; k += base) { - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - qMinusT = q - t; - baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } +function isHost(obj) { + var str = {}.toString.call(obj); - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } + switch (str) { + case '[object File]': + case '[object Blob]': + case '[object FormData]': + return true; + default: + return false; + } +} - ++delta; - ++n; +/** + * Determine XHR. + */ + +request.getXHR = function () { + if (root.XMLHttpRequest + && (!root.location || 'file:' != root.location.protocol + || !root.ActiveXObject)) { + return new XMLHttpRequest; + } else { + try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {} + try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {} + try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {} + try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {} + } + return false; +}; - } - return output.join(''); - } +/** + * Removes leading and trailing whitespace, added to support IE. + * + * @param {String} s + * @return {String} + * @api private + */ - /** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ - function toUnicode(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); - } +var trim = ''.trim + ? function(s) { return s.trim(); } + : function(s) { return s.replace(/(^\s*|\s*$)/g, ''); }; - /** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ - function toASCII(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); - } +/** + * Check if `obj` is an object. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ - /*--------------------------------------------------------------------------*/ +function isObject(obj) { + return obj === Object(obj); +} - /** Define the public API */ - punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '1.3.2', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode - }; +/** + * Serialize the given `obj`. + * + * @param {Object} obj + * @return {String} + * @api private + */ - /** Expose `punycode` */ - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define('punycode', function() { - return punycode; - }); - } else if (freeExports && freeModule) { - if (module.exports == freeExports) { - // in Node.js, io.js, or RingoJS v0.8.0+ - freeModule.exports = punycode; - } else { - // in Narwhal or RingoJS v0.7.0- - for (key in punycode) { - punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); - } - } - } else { - // in Rhino or a web browser - root.punycode = punycode; - } +function serialize(obj) { + if (!isObject(obj)) return obj; + var pairs = []; + for (var key in obj) { + if (null != obj[key]) { + pushEncodedKeyValuePair(pairs, key, obj[key]); + } + } + return pairs.join('&'); +} -}(this)); +/** + * Helps 'serialize' with serializing arrays. + * Mutates the pairs array. + * + * @param {Array} pairs + * @param {String} key + * @param {Mixed} val + */ -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +function pushEncodedKeyValuePair(pairs, key, val) { + if (Array.isArray(val)) { + return val.forEach(function(v) { + pushEncodedKeyValuePair(pairs, key, v); + }); + } + pairs.push(encodeURIComponent(key) + + '=' + encodeURIComponent(val)); +} -},{}],178:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +/** + * Expose serialization method. + */ -'use strict'; + request.serializeObject = serialize; -// If obj.hasOwnProperty has been overridden, then calling -// obj.hasOwnProperty(prop) will break. -// See: https://github.com/joyent/node/issues/1707 -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} + /** + * Parse the given x-www-form-urlencoded `str`. + * + * @param {String} str + * @return {Object} + * @api private + */ -module.exports = function(qs, sep, eq, options) { - sep = sep || '&'; - eq = eq || '='; +function parseString(str) { var obj = {}; + var pairs = str.split('&'); + var parts; + var pair; - if (typeof qs !== 'string' || qs.length === 0) { - return obj; + for (var i = 0, len = pairs.length; i < len; ++i) { + pair = pairs[i]; + parts = pair.split('='); + obj[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); } - var regexp = /\+/g; - qs = qs.split(sep); + return obj; +} - var maxKeys = 1000; - if (options && typeof options.maxKeys === 'number') { - maxKeys = options.maxKeys; - } +/** + * Expose parser. + */ - var len = qs.length; - // maxKeys <= 0 means that we should not limit keys count - if (maxKeys > 0 && len > maxKeys) { - len = maxKeys; - } +request.parseString = parseString; - for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - kstr, vstr, k, v; +/** + * Default MIME type map. + * + * superagent.types.xml = 'application/xml'; + * + */ - if (idx >= 0) { - kstr = x.substr(0, idx); - vstr = x.substr(idx + 1); - } else { - kstr = x; - vstr = ''; - } +request.types = { + html: 'text/html', + json: 'application/json', + xml: 'application/xml', + urlencoded: 'application/x-www-form-urlencoded', + 'form': 'application/x-www-form-urlencoded', + 'form-data': 'application/x-www-form-urlencoded' +}; + +/** + * Default serialization map. + * + * superagent.serialize['application/xml'] = function(obj){ + * return 'generated xml here'; + * }; + * + */ - k = decodeURIComponent(kstr); - v = decodeURIComponent(vstr); + request.serialize = { + 'application/x-www-form-urlencoded': serialize, + 'application/json': JSON.stringify + }; - if (!hasOwnProperty(obj, k)) { - obj[k] = v; - } else if (isArray(obj[k])) { - obj[k].push(v); - } else { - obj[k] = [obj[k], v]; - } - } + /** + * Default parsers. + * + * superagent.parse['application/xml'] = function(str){ + * return { object parsed from str }; + * }; + * + */ - return obj; +request.parse = { + 'application/x-www-form-urlencoded': parseString, + 'application/json': JSON.parse }; -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; +/** + * Parse the given header `str` into + * an object containing the mapped fields. + * + * @param {String} str + * @return {Object} + * @api private + */ -},{}],179:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +function parseHeader(str) { + var lines = str.split(/\r?\n/); + var fields = {}; + var index; + var line; + var field; + var val; -'use strict'; + lines.pop(); // trailing CRLF -var stringifyPrimitive = function(v) { - switch (typeof v) { - case 'string': - return v; + for (var i = 0, len = lines.length; i < len; ++i) { + line = lines[i]; + index = line.indexOf(':'); + field = line.slice(0, index).toLowerCase(); + val = trim(line.slice(index + 1)); + fields[field] = val; + } - case 'boolean': - return v ? 'true' : 'false'; + return fields; +} - case 'number': - return isFinite(v) ? v : ''; +/** + * Check if `mime` is json or has +json structured syntax suffix. + * + * @param {String} mime + * @return {Boolean} + * @api private + */ - default: - return ''; - } -}; +function isJSON(mime) { + return /[\/+]json\b/.test(mime); +} -module.exports = function(obj, sep, eq, name) { - sep = sep || '&'; - eq = eq || '='; - if (obj === null) { - obj = undefined; - } +/** + * Return the mime type for the given `str`. + * + * @param {String} str + * @return {String} + * @api private + */ - if (typeof obj === 'object') { - return map(objectKeys(obj), function(k) { - var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; - if (isArray(obj[k])) { - return map(obj[k], function(v) { - return ks + encodeURIComponent(stringifyPrimitive(v)); - }).join(sep); - } else { - return ks + encodeURIComponent(stringifyPrimitive(obj[k])); - } - }).join(sep); +function type(str){ + return str.split(/ *; */).shift(); +}; - } +/** + * Return header field parameters. + * + * @param {String} str + * @return {Object} + * @api private + */ - if (!name) return ''; - return encodeURIComponent(stringifyPrimitive(name)) + eq + - encodeURIComponent(stringifyPrimitive(obj)); -}; +function params(str){ + return reduce(str.split(/ *; */), function(obj, str){ + var parts = str.split(/ *= */) + , key = parts.shift() + , val = parts.shift(); -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; + if (key && val) obj[key] = val; + return obj; + }, {}); }; -function map (xs, f) { - if (xs.map) return xs.map(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - res.push(f(xs[i], i)); - } - return res; +/** + * Initialize a new `Response` with the given `xhr`. + * + * - set flags (.ok, .error, etc) + * - parse header + * + * Examples: + * + * Aliasing `superagent` as `request` is nice: + * + * request = superagent; + * + * We can use the promise-like API, or pass callbacks: + * + * request.get('/').end(function(res){}); + * request.get('/', function(res){}); + * + * Sending data can be chained: + * + * request + * .post('/user') + * .send({ name: 'tj' }) + * .end(function(res){}); + * + * Or passed to `.send()`: + * + * request + * .post('/user') + * .send({ name: 'tj' }, function(res){}); + * + * Or passed to `.post()`: + * + * request + * .post('/user', { name: 'tj' }) + * .end(function(res){}); + * + * Or further reduced to a single call for simple cases: + * + * request + * .post('/user', { name: 'tj' }, function(res){}); + * + * @param {XMLHTTPRequest} xhr + * @param {Object} options + * @api private + */ + +function Response(req, options) { + options = options || {}; + this.req = req; + this.xhr = this.req.xhr; + // responseText is accessible only if responseType is '' or 'text' and on older browsers + this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined') + ? this.xhr.responseText + : null; + this.statusText = this.req.xhr.statusText; + this.setStatusProperties(this.xhr.status); + this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders()); + // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but + // getResponseHeader still works. so we get content-type even if getting + // other headers fails. + this.header['content-type'] = this.xhr.getResponseHeader('content-type'); + this.setHeaderProperties(this.header); + this.body = this.req.method != 'HEAD' + ? this.parseBody(this.text ? this.text : this.xhr.response) + : null; } -var objectKeys = Object.keys || function (obj) { - var res = []; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); - } - return res; +/** + * Get case-insensitive `field` value. + * + * @param {String} field + * @return {String} + * @api public + */ + +Response.prototype.get = function(field){ + return this.header[field.toLowerCase()]; }; -},{}],180:[function(require,module,exports){ -'use strict'; +/** + * Set header related properties: + * + * - `.type` the content type without params + * + * A response of "Content-Type: text/plain; charset=utf-8" + * will provide you with a `.type` of "text/plain". + * + * @param {Object} header + * @api private + */ -exports.decode = exports.parse = require('./decode'); -exports.encode = exports.stringify = require('./encode'); +Response.prototype.setHeaderProperties = function(header){ + // content-type + var ct = this.header['content-type'] || ''; + this.type = type(ct); -},{"./decode":178,"./encode":179}],181:[function(require,module,exports){ + // params + var obj = params(ct); + for (var key in obj) this[key] = obj[key]; +}; /** - * Reduce `arr` with `fn`. + * Parse the given body `str`. * - * @param {Array} arr - * @param {Function} fn - * @param {Mixed} initial + * Used for auto-parsing of bodies. Parsers + * are defined on the `superagent.parse` object. * - * TODO: combatible error handling? + * @param {String} str + * @return {Mixed} + * @api private */ -module.exports = function(arr, fn, initial){ - var idx = 0; - var len = arr.length; - var curr = arguments.length == 3 - ? initial - : arr[idx++]; - - while (idx < len) { - curr = fn.call(null, curr, arr[idx], ++idx, arr); - } - - return curr; -}; -},{}],182:[function(require,module,exports){ -'use strict'; -module.exports = function (str) { - var isExtendedLengthPath = /^\\\\\?\\/.test(str); - var hasNonAscii = /[^\x00-\x80]+/.test(str); - - if (isExtendedLengthPath || hasNonAscii) { - return str; - } - - return str.replace(/\\/g, '/'); +Response.prototype.parseBody = function(str){ + var parse = request.parse[this.type]; + return parse && str && (str.length || str instanceof Object) + ? parse(str) + : null; }; -},{}],183:[function(require,module,exports){ -(function (factory) { - if (typeof exports === 'object') { - // Node/CommonJS - module.exports = factory(); - } else if (typeof define === 'function' && define.amd) { - // AMD - define(factory); - } else { - // Browser globals (with support for web workers) - var glob; - - try { - glob = window; - } catch (e) { - glob = self; - } - - glob.SparkMD5 = factory(); - } -}(function (undefined) { - - 'use strict'; - - /* - * Fastest md5 implementation around (JKM md5) - * Credits: Joseph Myers - * - * @see http://www.myersdaily.org/joseph/javascript/md5-text.html - * @see http://jsperf.com/md5-shootout/7 - */ +/** + * Set flags such as `.ok` based on `status`. + * + * For example a 2xx response will give you a `.ok` of __true__ + * whereas 5xx will be __false__ and `.error` will be __true__. The + * `.clientError` and `.serverError` are also available to be more + * specific, and `.statusType` is the class of error ranging from 1..5 + * sometimes useful for mapping respond colors etc. + * + * "sugar" properties are also defined for common cases. Currently providing: + * + * - .noContent + * - .badRequest + * - .unauthorized + * - .notAcceptable + * - .notFound + * + * @param {Number} status + * @api private + */ - /* this function is much faster, - so if possible we use it. Some IEs - are the only ones I know of that - need the idiotic second function, - generated by an if clause. */ - var add32 = function (a, b) { - return (a + b) & 0xFFFFFFFF; - }, - hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; +Response.prototype.setStatusProperties = function(status){ + // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request + if (status === 1223) { + status = 204; + } + var type = status / 100 | 0; - function cmn(q, a, b, x, s, t) { - a = add32(add32(a, q), add32(x, t)); - return add32((a << s) | (a >>> (32 - s)), b); - } + // status / class + this.status = this.statusCode = status; + this.statusType = type; - function ff(a, b, c, d, x, s, t) { - return cmn((b & c) | ((~b) & d), a, b, x, s, t); - } + // basics + this.info = 1 == type; + this.ok = 2 == type; + this.clientError = 4 == type; + this.serverError = 5 == type; + this.error = (4 == type || 5 == type) + ? this.toError() + : false; - function gg(a, b, c, d, x, s, t) { - return cmn((b & d) | (c & (~d)), a, b, x, s, t); - } + // sugar + this.accepted = 202 == status; + this.noContent = 204 == status; + this.badRequest = 400 == status; + this.unauthorized = 401 == status; + this.notAcceptable = 406 == status; + this.notFound = 404 == status; + this.forbidden = 403 == status; +}; - function hh(a, b, c, d, x, s, t) { - return cmn(b ^ c ^ d, a, b, x, s, t); - } +/** + * Return an `Error` representative of this response. + * + * @return {Error} + * @api public + */ - function ii(a, b, c, d, x, s, t) { - return cmn(c ^ (b | (~d)), a, b, x, s, t); - } +Response.prototype.toError = function(){ + var req = this.req; + var method = req.method; + var url = req.url; - function md5cycle(x, k) { - var a = x[0], - b = x[1], - c = x[2], - d = x[3]; + var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')'; + var err = new Error(msg); + err.status = this.status; + err.method = method; + err.url = url; - a = ff(a, b, c, d, k[0], 7, -680876936); - d = ff(d, a, b, c, k[1], 12, -389564586); - c = ff(c, d, a, b, k[2], 17, 606105819); - b = ff(b, c, d, a, k[3], 22, -1044525330); - a = ff(a, b, c, d, k[4], 7, -176418897); - d = ff(d, a, b, c, k[5], 12, 1200080426); - c = ff(c, d, a, b, k[6], 17, -1473231341); - b = ff(b, c, d, a, k[7], 22, -45705983); - a = ff(a, b, c, d, k[8], 7, 1770035416); - d = ff(d, a, b, c, k[9], 12, -1958414417); - c = ff(c, d, a, b, k[10], 17, -42063); - b = ff(b, c, d, a, k[11], 22, -1990404162); - a = ff(a, b, c, d, k[12], 7, 1804603682); - d = ff(d, a, b, c, k[13], 12, -40341101); - c = ff(c, d, a, b, k[14], 17, -1502002290); - b = ff(b, c, d, a, k[15], 22, 1236535329); + return err; +}; - a = gg(a, b, c, d, k[1], 5, -165796510); - d = gg(d, a, b, c, k[6], 9, -1069501632); - c = gg(c, d, a, b, k[11], 14, 643717713); - b = gg(b, c, d, a, k[0], 20, -373897302); - a = gg(a, b, c, d, k[5], 5, -701558691); - d = gg(d, a, b, c, k[10], 9, 38016083); - c = gg(c, d, a, b, k[15], 14, -660478335); - b = gg(b, c, d, a, k[4], 20, -405537848); - a = gg(a, b, c, d, k[9], 5, 568446438); - d = gg(d, a, b, c, k[14], 9, -1019803690); - c = gg(c, d, a, b, k[3], 14, -187363961); - b = gg(b, c, d, a, k[8], 20, 1163531501); - a = gg(a, b, c, d, k[13], 5, -1444681467); - d = gg(d, a, b, c, k[2], 9, -51403784); - c = gg(c, d, a, b, k[7], 14, 1735328473); - b = gg(b, c, d, a, k[12], 20, -1926607734); +/** + * Expose `Response`. + */ - a = hh(a, b, c, d, k[5], 4, -378558); - d = hh(d, a, b, c, k[8], 11, -2022574463); - c = hh(c, d, a, b, k[11], 16, 1839030562); - b = hh(b, c, d, a, k[14], 23, -35309556); - a = hh(a, b, c, d, k[1], 4, -1530992060); - d = hh(d, a, b, c, k[4], 11, 1272893353); - c = hh(c, d, a, b, k[7], 16, -155497632); - b = hh(b, c, d, a, k[10], 23, -1094730640); - a = hh(a, b, c, d, k[13], 4, 681279174); - d = hh(d, a, b, c, k[0], 11, -358537222); - c = hh(c, d, a, b, k[3], 16, -722521979); - b = hh(b, c, d, a, k[6], 23, 76029189); - a = hh(a, b, c, d, k[9], 4, -640364487); - d = hh(d, a, b, c, k[12], 11, -421815835); - c = hh(c, d, a, b, k[15], 16, 530742520); - b = hh(b, c, d, a, k[2], 23, -995338651); +request.Response = Response; - a = ii(a, b, c, d, k[0], 6, -198630844); - d = ii(d, a, b, c, k[7], 10, 1126891415); - c = ii(c, d, a, b, k[14], 15, -1416354905); - b = ii(b, c, d, a, k[5], 21, -57434055); - a = ii(a, b, c, d, k[12], 6, 1700485571); - d = ii(d, a, b, c, k[3], 10, -1894986606); - c = ii(c, d, a, b, k[10], 15, -1051523); - b = ii(b, c, d, a, k[1], 21, -2054922799); - a = ii(a, b, c, d, k[8], 6, 1873313359); - d = ii(d, a, b, c, k[15], 10, -30611744); - c = ii(c, d, a, b, k[6], 15, -1560198380); - b = ii(b, c, d, a, k[13], 21, 1309151649); - a = ii(a, b, c, d, k[4], 6, -145523070); - d = ii(d, a, b, c, k[11], 10, -1120210379); - c = ii(c, d, a, b, k[2], 15, 718787259); - b = ii(b, c, d, a, k[9], 21, -343485551); +/** + * Initialize a new `Request` with the given `method` and `url`. + * + * @param {String} method + * @param {String} url + * @api public + */ - x[0] = add32(a, x[0]); - x[1] = add32(b, x[1]); - x[2] = add32(c, x[2]); - x[3] = add32(d, x[3]); +function Request(method, url) { + var self = this; + Emitter.call(this); + this._query = this._query || []; + this.method = method; + this.url = url; + this.header = {}; + this._header = {}; + this.on('end', function(){ + var err = null; + var res = null; + + try { + res = new Response(self); + } catch(e) { + err = new Error('Parser is unable to parse the response'); + err.parse = true; + err.original = e; + // issue #675: return the raw response if the response parsing fails + err.rawResponse = self.xhr && self.xhr.responseText ? self.xhr.responseText : null; + return self.callback(err); } - function md5blk(s) { - var md5blks = [], - i; /* Andy King said do it this way. */ + self.emit('response', res); - for (i = 0; i < 64; i += 4) { - md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24); - } - return md5blks; + if (err) { + return self.callback(err, res); } - function md5blk_array(a) { - var md5blks = [], - i; /* Andy King said do it this way. */ - - for (i = 0; i < 64; i += 4) { - md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24); - } - return md5blks; + if (res.status >= 200 && res.status < 300) { + return self.callback(err, res); } - function md51(s) { - var n = s.length, - state = [1732584193, -271733879, -1732584194, 271733878], - i, - length, - tail, - tmp, - lo, - hi; + var new_err = new Error(res.statusText || 'Unsuccessful HTTP response'); + new_err.original = err; + new_err.response = res; + new_err.status = res.status; - for (i = 64; i <= n; i += 64) { - md5cycle(state, md5blk(s.substring(i - 64, i))); - } - s = s.substring(i - 64); - length = s.length; - tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - for (i = 0; i < length; i += 1) { - tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3); - } - tail[i >> 2] |= 0x80 << ((i % 4) << 3); - if (i > 55) { - md5cycle(state, tail); - for (i = 0; i < 16; i += 1) { - tail[i] = 0; - } - } + self.callback(new_err, res); + }); +} - // Beware that the final length might not fit in 32 bits so we take care of that - tmp = n * 8; - tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); - lo = parseInt(tmp[2], 16); - hi = parseInt(tmp[1], 16) || 0; +/** + * Mixin `Emitter`. + */ - tail[14] = lo; - tail[15] = hi; +Emitter(Request.prototype); - md5cycle(state, tail); - return state; - } +/** + * Allow for extension + */ - function md51_array(a) { - var n = a.length, - state = [1732584193, -271733879, -1732584194, 271733878], - i, - length, - tail, - tmp, - lo, - hi; +Request.prototype.use = function(fn) { + fn(this); + return this; +} - for (i = 64; i <= n; i += 64) { - md5cycle(state, md5blk_array(a.subarray(i - 64, i))); - } +/** + * Set timeout to `ms`. + * + * @param {Number} ms + * @return {Request} for chaining + * @api public + */ - // Not sure if it is a bug, however IE10 will always produce a sub array of length 1 - // containing the last element of the parent array if the sub array specified starts - // beyond the length of the parent array - weird. - // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue - a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0); +Request.prototype.timeout = function(ms){ + this._timeout = ms; + return this; +}; - length = a.length; - tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - for (i = 0; i < length; i += 1) { - tail[i >> 2] |= a[i] << ((i % 4) << 3); - } +/** + * Clear previous timeout. + * + * @return {Request} for chaining + * @api public + */ - tail[i >> 2] |= 0x80 << ((i % 4) << 3); - if (i > 55) { - md5cycle(state, tail); - for (i = 0; i < 16; i += 1) { - tail[i] = 0; - } - } +Request.prototype.clearTimeout = function(){ + this._timeout = 0; + clearTimeout(this._timer); + return this; +}; - // Beware that the final length might not fit in 32 bits so we take care of that - tmp = n * 8; - tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); - lo = parseInt(tmp[2], 16); - hi = parseInt(tmp[1], 16) || 0; +/** + * Abort the request, and clear potential timeout. + * + * @return {Request} + * @api public + */ - tail[14] = lo; - tail[15] = hi; +Request.prototype.abort = function(){ + if (this.aborted) return; + this.aborted = true; + this.xhr.abort(); + this.clearTimeout(); + this.emit('abort'); + return this; +}; - md5cycle(state, tail); +/** + * Set header `field` to `val`, or multiple fields with one object. + * + * Examples: + * + * req.get('/') + * .set('Accept', 'application/json') + * .set('X-API-Key', 'foobar') + * .end(callback); + * + * req.get('/') + * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' }) + * .end(callback); + * + * @param {String|Object} field + * @param {String} val + * @return {Request} for chaining + * @api public + */ + +Request.prototype.set = function(field, val){ + if (isObject(field)) { + for (var key in field) { + this.set(key, field[key]); + } + return this; + } + this._header[field.toLowerCase()] = val; + this.header[field] = val; + return this; +}; + +/** + * Remove header `field`. + * + * Example: + * + * req.get('/') + * .unset('User-Agent') + * .end(callback); + * + * @param {String} field + * @return {Request} for chaining + * @api public + */ + +Request.prototype.unset = function(field){ + delete this._header[field.toLowerCase()]; + delete this.header[field]; + return this; +}; + +/** + * Get case-insensitive header `field` value. + * + * @param {String} field + * @return {String} + * @api private + */ + +Request.prototype.getHeader = function(field){ + return this._header[field.toLowerCase()]; +}; + +/** + * Set Content-Type to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.xml = 'application/xml'; + * + * request.post('/') + * .type('xml') + * .send(xmlstring) + * .end(callback); + * + * request.post('/') + * .type('application/xml') + * .send(xmlstring) + * .end(callback); + * + * @param {String} type + * @return {Request} for chaining + * @api public + */ + +Request.prototype.type = function(type){ + this.set('Content-Type', request.types[type] || type); + return this; +}; + +/** + * Force given parser + * + * Sets the body parser no matter type. + * + * @param {Function} + * @api public + */ - return state; - } +Request.prototype.parse = function(fn){ + this._parser = fn; + return this; +}; - function rhex(n) { - var s = '', - j; - for (j = 0; j < 4; j += 1) { - s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F]; - } - return s; - } +/** + * Set Accept to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.json = 'application/json'; + * + * request.get('/agent') + * .accept('json') + * .end(callback); + * + * request.get('/agent') + * .accept('application/json') + * .end(callback); + * + * @param {String} accept + * @return {Request} for chaining + * @api public + */ - function hex(x) { - var i; - for (i = 0; i < x.length; i += 1) { - x[i] = rhex(x[i]); - } - return x.join(''); - } +Request.prototype.accept = function(type){ + this.set('Accept', request.types[type] || type); + return this; +}; - // In some cases the fast add32 function cannot be used.. - if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') { - add32 = function (x, y) { - var lsw = (x & 0xFFFF) + (y & 0xFFFF), - msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); - }; - } +/** + * Set Authorization field value with `user` and `pass`. + * + * @param {String} user + * @param {String} pass + * @return {Request} for chaining + * @api public + */ - // --------------------------------------------------- +Request.prototype.auth = function(user, pass){ + var str = btoa(user + ':' + pass); + this.set('Authorization', 'Basic ' + str); + return this; +}; - function toUtf8(str) { - if (/[\u0080-\uFFFF]/.test(str)) { - str = unescape(encodeURIComponent(str)); - } +/** +* Add query-string `val`. +* +* Examples: +* +* request.get('/shoes') +* .query('size=10') +* .query({ color: 'blue' }) +* +* @param {Object|String} val +* @return {Request} for chaining +* @api public +*/ - return str; - } +Request.prototype.query = function(val){ + if ('string' != typeof val) val = serialize(val); + if (val) this._query.push(val); + return this; +}; - function utf8Str2ArrayBuffer(str, returnUInt8Array) { - var length = str.length, - buff = new ArrayBuffer(length), - arr = new Uint8Array(buff), - i; +/** + * Write the field `name` and `val` for "multipart/form-data" + * request bodies. + * + * ``` js + * request.post('/upload') + * .field('foo', 'bar') + * .end(callback); + * ``` + * + * @param {String} name + * @param {String|Blob|File} val + * @return {Request} for chaining + * @api public + */ - for (i = 0; i < length; i++) { - arr[i] = str.charCodeAt(i); - } +Request.prototype.field = function(name, val){ + if (!this._formData) this._formData = new root.FormData(); + this._formData.append(name, val); + return this; +}; - return returnUInt8Array ? arr : buff; - } +/** + * Queue the given `file` as an attachment to the specified `field`, + * with optional `filename`. + * + * ``` js + * request.post('/upload') + * .attach(new Blob(['hey!'], { type: "text/html"})) + * .end(callback); + * ``` + * + * @param {String} field + * @param {Blob|File} file + * @param {String} filename + * @return {Request} for chaining + * @api public + */ - function arrayBuffer2Utf8Str(buff) { - return String.fromCharCode.apply(null, new Uint8Array(buff)); - } +Request.prototype.attach = function(field, file, filename){ + if (!this._formData) this._formData = new root.FormData(); + this._formData.append(field, file, filename || file.name); + return this; +}; - function concatenateArrayBuffers(first, second, returnUInt8Array) { - var result = new Uint8Array(first.byteLength + second.byteLength); +/** + * Send `data` as the request body, defaulting the `.type()` to "json" when + * an object is given. + * + * Examples: + * + * // manual json + * request.post('/user') + * .type('json') + * .send('{"name":"tj"}') + * .end(callback) + * + * // auto json + * request.post('/user') + * .send({ name: 'tj' }) + * .end(callback) + * + * // manual x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send('name=tj') + * .end(callback) + * + * // auto x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send({ name: 'tj' }) + * .end(callback) + * + * // defaults to x-www-form-urlencoded + * request.post('/user') + * .send('name=tobi') + * .send('species=ferret') + * .end(callback) + * + * @param {String|Object} data + * @return {Request} for chaining + * @api public + */ - result.set(new Uint8Array(first)); - result.set(new Uint8Array(second), first.byteLength); +Request.prototype.send = function(data){ + var obj = isObject(data); + var type = this.getHeader('Content-Type'); - return returnUInt8Array ? result : result.buffer; + // merge + if (obj && isObject(this._data)) { + for (var key in data) { + this._data[key] = data[key]; } - - // --------------------------------------------------- - - /** - * SparkMD5 OOP implementation. - * - * Use this class to perform an incremental md5, otherwise use the - * static methods instead. - */ - function SparkMD5() { - // call reset to init the instance - this.reset(); + } else if ('string' == typeof data) { + if (!type) this.type('form'); + type = this.getHeader('Content-Type'); + if ('application/x-www-form-urlencoded' == type) { + this._data = this._data + ? this._data + '&' + data + : data; + } else { + this._data = (this._data || '') + data; } + } else { + this._data = data; + } - /** - * Appends a string. - * A conversion will be applied if an utf8 string is detected. - * - * @param {String} str The string to be appended - * - * @return {SparkMD5} The instance itself - */ - SparkMD5.prototype.append = function (str) { - // Converts the string to utf8 bytes if necessary - // Then append as binary - this.appendBinary(toUtf8(str)); - - return this; - }; + if (!obj || isHost(data)) return this; + if (!type) this.type('json'); + return this; +}; - /** - * Appends a binary string. - * - * @param {String} contents The binary string to be appended - * - * @return {SparkMD5} The instance itself - */ - SparkMD5.prototype.appendBinary = function (contents) { - this._buff += contents; - this._length += contents.length; +/** + * Invoke the callback with `err` and `res` + * and handle arity check. + * + * @param {Error} err + * @param {Response} res + * @api private + */ - var length = this._buff.length, - i; +Request.prototype.callback = function(err, res){ + var fn = this._callback; + this.clearTimeout(); + fn(err, res); +}; - for (i = 64; i <= length; i += 64) { - md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i))); - } +/** + * Invoke callback with x-domain error. + * + * @api private + */ - this._buff = this._buff.substring(i - 64); +Request.prototype.crossDomainError = function(){ + var err = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.'); + err.crossDomain = true; - return this; - }; + err.status = this.status; + err.method = this.method; + err.url = this.url; - /** - * Finishes the incremental computation, reseting the internal state and - * returning the result. - * Use the raw parameter to obtain the raw result instead of the hex one. - * - * @param {Boolean} raw True to get the raw result, false to get the hex result - * - * @return {String|Array} The result - */ - SparkMD5.prototype.end = function (raw) { - var buff = this._buff, - length = buff.length, - i, - tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - ret; + this.callback(err); +}; - for (i = 0; i < length; i += 1) { - tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3); - } +/** + * Invoke callback with timeout error. + * + * @api private + */ - this._finish(tail, length); - ret = !!raw ? this._hash : hex(this._hash); +Request.prototype.timeoutError = function(){ + var timeout = this._timeout; + var err = new Error('timeout of ' + timeout + 'ms exceeded'); + err.timeout = timeout; + this.callback(err); +}; - this.reset(); +/** + * Enable transmission of cookies with x-domain requests. + * + * Note that for this to work the origin must not be + * using "Access-Control-Allow-Origin" with a wildcard, + * and also must set "Access-Control-Allow-Credentials" + * to "true". + * + * @api public + */ - return ret; - }; +Request.prototype.withCredentials = function(){ + this._withCredentials = true; + return this; +}; - /** - * Resets the internal state of the computation. - * - * @return {SparkMD5} The instance itself - */ - SparkMD5.prototype.reset = function () { - this._buff = ''; - this._length = 0; - this._hash = [1732584193, -271733879, -1732584194, 271733878]; +/** + * Initiate request, invoking callback `fn(res)` + * with an instanceof `Response`. + * + * @param {Function} fn + * @return {Request} for chaining + * @api public + */ - return this; - }; +Request.prototype.end = function(fn){ + var self = this; + var xhr = this.xhr = request.getXHR(); + var query = this._query.join('&'); + var timeout = this._timeout; + var data = this._formData || this._data; - /** - * Gets the internal state of the computation. - * - * @return {Object} The state - */ - SparkMD5.prototype.getState = function () { - return { - buff: this._buff, - length: this._length, - hash: this._hash - }; - }; + // store callback + this._callback = fn || noop; - /** - * Gets the internal state of the computation. - * - * @param {Object} state The state - * - * @return {SparkMD5} The instance itself - */ - SparkMD5.prototype.setState = function (state) { - this._buff = state.buff; - this._length = state.length; - this._hash = state.hash; + // state change + xhr.onreadystatechange = function(){ + if (4 != xhr.readyState) return; - return this; - }; + // In IE9, reads to any property (e.g. status) off of an aborted XHR will + // result in the error "Could not complete the operation due to error c00c023f" + var status; + try { status = xhr.status } catch(e) { status = 0; } - /** - * Releases memory used by the incremental buffer and other additional - * resources. If you plan to use the instance again, use reset instead. - */ - SparkMD5.prototype.destroy = function () { - delete this._hash; - delete this._buff; - delete this._length; - }; + if (0 == status) { + if (self.timedout) return self.timeoutError(); + if (self.aborted) return; + return self.crossDomainError(); + } + self.emit('end'); + }; - /** - * Finish the final calculation based on the tail. - * - * @param {Array} tail The tail (will be modified) - * @param {Number} length The length of the remaining buffer - */ - SparkMD5.prototype._finish = function (tail, length) { - var i = length, - tmp, - lo, - hi; + // progress + var handleProgress = function(e){ + if (e.total > 0) { + e.percent = e.loaded / e.total * 100; + } + e.direction = 'download'; + self.emit('progress', e); + }; + if (this.hasListeners('progress')) { + xhr.onprogress = handleProgress; + } + try { + if (xhr.upload && this.hasListeners('progress')) { + xhr.upload.onprogress = handleProgress; + } + } catch(e) { + // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist. + // Reported here: + // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context + } - tail[i >> 2] |= 0x80 << ((i % 4) << 3); - if (i > 55) { - md5cycle(this._hash, tail); - for (i = 0; i < 16; i += 1) { - tail[i] = 0; - } - } + // timeout + if (timeout && !this._timer) { + this._timer = setTimeout(function(){ + self.timedout = true; + self.abort(); + }, timeout); + } - // Do the final computation based on the tail and length - // Beware that the final length may not fit in 32 bits so we take care of that - tmp = this._length * 8; - tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); - lo = parseInt(tmp[2], 16); - hi = parseInt(tmp[1], 16) || 0; + // querystring + if (query) { + query = request.serializeObject(query); + this.url += ~this.url.indexOf('?') + ? '&' + query + : '?' + query; + } - tail[14] = lo; - tail[15] = hi; - md5cycle(this._hash, tail); - }; + // initiate request + xhr.open(this.method, this.url, true); - /** - * Performs the md5 hash on a string. - * A conversion will be applied if utf8 string is detected. - * - * @param {String} str The string - * @param {Boolean} raw True to get the raw result, false to get the hex result - * - * @return {String|Array} The result - */ - SparkMD5.hash = function (str, raw) { - // Converts the string to utf8 bytes if necessary - // Then compute it using the binary function - return SparkMD5.hashBinary(toUtf8(str), raw); - }; + // CORS + if (this._withCredentials) xhr.withCredentials = true; - /** - * Performs the md5 hash on a binary string. - * - * @param {String} content The binary string - * @param {Boolean} raw True to get the raw result, false to get the hex result - * - * @return {String|Array} The result - */ - SparkMD5.hashBinary = function (content, raw) { - var hash = md51(content); + // body + if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !isHost(data)) { + // serialize stuff + var contentType = this.getHeader('Content-Type'); + var serialize = this._parser || request.serialize[contentType ? contentType.split(';')[0] : '']; + if (!serialize && isJSON(contentType)) serialize = request.serialize['application/json']; + if (serialize) data = serialize(data); + } - return !!raw ? hash : hex(hash); - }; + // set header fields + for (var field in this.header) { + if (null == this.header[field]) continue; + xhr.setRequestHeader(field, this.header[field]); + } + + // send stuff + this.emit('request', this); - // --------------------------------------------------- + // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing) + // We need null here if data is undefined + xhr.send(typeof data !== 'undefined' ? data : null); + return this; +}; - /** - * SparkMD5 OOP implementation for array buffers. - * - * Use this class to perform an incremental md5 ONLY for array buffers. - */ - SparkMD5.ArrayBuffer = function () { - // call reset to init the instance - this.reset(); - }; +/** + * Faux promise support + * + * @param {Function} fulfill + * @param {Function} reject + * @return {Request} + */ - /** - * Appends an array buffer. - * - * @param {ArrayBuffer} arr The array to be appended - * - * @return {SparkMD5.ArrayBuffer} The instance itself - */ - SparkMD5.ArrayBuffer.prototype.append = function (arr) { - var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), - length = buff.length, - i; +Request.prototype.then = function (fulfill, reject) { + return this.end(function(err, res) { + err ? reject(err) : fulfill(res); + }); +} - this._length += arr.byteLength; +/** + * Expose `Request`. + */ - for (i = 64; i <= length; i += 64) { - md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i))); - } +request.Request = Request; - // Avoids IE10 weirdness (documented above) - this._buff = (i - 64) < length ? buff.subarray(i - 64) : new Uint8Array(0); +/** + * Issue a request: + * + * Examples: + * + * request('GET', '/users').end(callback) + * request('/users').end(callback) + * request('/users', callback) + * + * @param {String} method + * @param {String|Function} url or callback + * @return {Request} + * @api public + */ - return this; - }; +function request(method, url) { + // callback + if ('function' == typeof url) { + return new Request('GET', method).end(url); + } - /** - * Finishes the incremental computation, reseting the internal state and - * returning the result. - * Use the raw parameter to obtain the raw result instead of the hex one. - * - * @param {Boolean} raw True to get the raw result, false to get the hex result - * - * @return {String|Array} The result - */ - SparkMD5.ArrayBuffer.prototype.end = function (raw) { - var buff = this._buff, - length = buff.length, - tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - i, - ret; + // url first + if (1 == arguments.length) { + return new Request('GET', method); + } - for (i = 0; i < length; i += 1) { - tail[i >> 2] |= buff[i] << ((i % 4) << 3); - } + return new Request(method, url); +} - this._finish(tail, length); - ret = !!raw ? this._hash : hex(this._hash); +/** + * GET `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} data or fn + * @param {Function} fn + * @return {Request} + * @api public + */ - this.reset(); +request.get = function(url, data, fn){ + var req = request('GET', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.query(data); + if (fn) req.end(fn); + return req; +}; - return ret; - }; +/** + * HEAD `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} data or fn + * @param {Function} fn + * @return {Request} + * @api public + */ - /** - * Resets the internal state of the computation. - * - * @return {SparkMD5.ArrayBuffer} The instance itself - */ - SparkMD5.ArrayBuffer.prototype.reset = function () { - this._buff = new Uint8Array(0); - this._length = 0; - this._hash = [1732584193, -271733879, -1732584194, 271733878]; +request.head = function(url, data, fn){ + var req = request('HEAD', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; +}; - return this; - }; +/** + * DELETE `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Function} fn + * @return {Request} + * @api public + */ - /** - * Gets the internal state of the computation. - * - * @return {Object} The state - */ - SparkMD5.ArrayBuffer.prototype.getState = function () { - var state = SparkMD5.prototype.getState.call(this); +function del(url, fn){ + var req = request('DELETE', url); + if (fn) req.end(fn); + return req; +}; - // Convert buffer to a string - state.buff = arrayBuffer2Utf8Str(state.buff); +request['del'] = del; +request['delete'] = del; - return state; - }; +/** + * PATCH `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} data + * @param {Function} fn + * @return {Request} + * @api public + */ - /** - * Gets the internal state of the computation. - * - * @param {Object} state The state - * - * @return {SparkMD5.ArrayBuffer} The instance itself - */ - SparkMD5.ArrayBuffer.prototype.setState = function (state) { - // Convert string to buffer - state.buff = utf8Str2ArrayBuffer(state.buff, true); +request.patch = function(url, data, fn){ + var req = request('PATCH', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; +}; - return SparkMD5.prototype.setState.call(this, state); - }; +/** + * POST `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} data + * @param {Function} fn + * @return {Request} + * @api public + */ - SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy; +request.post = function(url, data, fn){ + var req = request('POST', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; +}; - SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish; +/** + * PUT `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} data or fn + * @param {Function} fn + * @return {Request} + * @api public + */ - /** - * Performs the md5 hash on an array buffer. - * - * @param {ArrayBuffer} arr The array buffer - * @param {Boolean} raw True to get the raw result, false to get the hex result - * - * @return {String|Array} The result - */ - SparkMD5.ArrayBuffer.hash = function (arr, raw) { - var hash = md51_array(new Uint8Array(arr)); +request.put = function(url, data, fn){ + var req = request('PUT', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; +}; - return !!raw ? hash : hex(hash); - }; +/** + * Expose `request`. + */ - return SparkMD5; -})); +module.exports = request; -},{}],184:[function(require,module,exports){ +},{"emitter":6,"reduce":180}],184:[function(require,module,exports){ /* * The MIT License (MIT) * @@ -21286,7 +21286,7 @@ function isNullOrUndefined(arg) { return arg == null; } -},{"punycode":177,"querystring":180}],193:[function(require,module,exports){ +},{"punycode":176,"querystring":179}],193:[function(require,module,exports){ /*! * Copyright (c) 2015 Chris O'Hara * @@ -21324,7 +21324,7 @@ function isNullOrUndefined(arg) { 'use strict'; - validator = { version: '4.5.2' }; + validator = { version: '4.7.0', coerce: true }; var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i; var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i; @@ -21353,8 +21353,14 @@ function isNullOrUndefined(arg) { , all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i }; - var alpha = /^[A-Z]+$/i - , alphanumeric = /^[0-9A-Z]+$/i + var alpha = { + 'en-US': /^[A-Z]+$/i, + 'de-DE': /^[A-ZÄÖÜß]+$/i, + } + , alphanumeric = { + 'en-US': /^[0-9A-Z]+$/i, + 'de-DE': /^[0-9A-ZÄÖÜß]+$/i + } , numeric = /^[-+]?[0-9]+$/ , int = /^(?:[-+]?(?:0|[1-9][0-9]*))$/ , float = /^(?:[-+]?(?:[0-9]+))?(?:\.[0-9]*)?(?:[eE][\+\-]?(?:[0-9]+))?$/ @@ -21378,17 +21384,20 @@ function isNullOrUndefined(arg) { 'en-AU': /^(\+?61|0)4\d{8}$/, 'en-HK': /^(\+?852\-?)?[569]\d{3}\-?\d{4}$/, 'fr-FR': /^(\+?33|0)[67]\d{8}$/, - 'pt-PT': /^(\+351)?9[1236]\d{7}$/, + 'pt-PT': /^(\+?351)?9[1236]\d{7}$/, 'el-GR': /^(\+?30)?(69\d{8})$/, 'en-GB': /^(\+?44|0)7\d{9}$/, 'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/, - 'en-ZM': /^(\+26)?09[567]\d{7}$/, + 'en-ZM': /^(\+?26)?09[567]\d{7}$/, 'ru-RU': /^(\+?7|8)?9\d{9}$/, 'nb-NO': /^(\+?47)?[49]\d{7}$/, 'nn-NO': /^(\+?47)?[49]\d{7}$/, - 'vi-VN': /^(0|\+?84)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/, + 'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/, 'en-NZ': /^(\+?64|0)2\d{7,9}$/, - 'en-IN': /^(\+?91|0)?[789]\d{9}$/ + 'en-IN': /^(\+?91|0)?[789]\d{9}$/, + 'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/, + 'de-DE': /^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/, + 'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5)?|50)\s?(\d\s?){4,8}\d$/ }; // from http://goo.gl/0ejHHW @@ -21415,8 +21424,24 @@ function isNullOrUndefined(arg) { }; validator.toString = function (input) { - if (typeof input === 'object' && input !== null && input.toString) { - input = input.toString(); + // The library validates strings only. Currently it coerces all input to a string, but this + // will go away in an upcoming major version change. Print a deprecation notice for now + if (typeof input !== 'string') { + if (!validator.coerce) { + throw new Error('this library validates strings only'); + } + if (typeof console === 'object' && console && typeof console.warn === 'function') { + console.warn('warning: you tried to validate a ' + typeof input + ' but this library ' + + '(github.com/chriso/validator.js) validates strings only. Please update your code ' + + 'as this will be an error soon.'); + } + } + if (typeof input === 'object' && input !== null) { + if (typeof input.toString === 'function') { + input = input.toString(); + } else { + input = '[object Object]'; + } } else if (input === null || typeof input === 'undefined' || (isNaN(input) && !input.length)) { input = ''; } @@ -21592,7 +21617,7 @@ function isNullOrUndefined(arg) { }; validator.isIP = function (str, version) { - version = validator.toString(version); + version = version ? version + '' : ''; if (!version) { return validator.isIP(str, 4) || validator.isIP(str, 6); } else if (version === '4') { @@ -21703,12 +21728,14 @@ function isNullOrUndefined(arg) { return (['true', 'false', '1', '0'].indexOf(str) >= 0); }; - validator.isAlpha = function (str) { - return alpha.test(str); + validator.isAlpha = function (str, locale) { + locale = locale || 'en-US'; + return alpha[locale].test(str); }; - validator.isAlphanumeric = function (str) { - return alphanumeric.test(str); + validator.isAlphanumeric = function (str, locale) { + locale = locale || 'en-US'; + return alphanumeric[locale].test(str); }; validator.isNumeric = function (str) { @@ -21749,7 +21776,7 @@ function isNullOrUndefined(arg) { }; validator.isDivisibleBy = function (str, num) { - return validator.toFloat(str) % validator.toInt(num) === 0; + return validator.toFloat(str) % parseInt(num, 10) === 0; }; validator.isNull = function (str) { @@ -21960,7 +21987,7 @@ function isNullOrUndefined(arg) { }; validator.isISBN = function (str, version) { - version = validator.toString(version); + version = version ? version + '' : ''; if (!version) { return validator.isISBN(str, 10) || validator.isISBN(str, 13); } @@ -23155,7 +23182,7 @@ module.exports = Report; }).call(this,require('_process')) -},{"./Errors":194,"./Utils":202,"_process":176,"lodash.get":162}],199:[function(require,module,exports){ +},{"./Errors":194,"./Utils":202,"_process":175,"lodash.get":162}],199:[function(require,module,exports){ "use strict"; var Report = require("./Report"); @@ -24794,7 +24821,7 @@ module.exports = ZSchema; }).call(this,require('_process')) -},{"./FormatValidators":195,"./JsonValidation":196,"./Polyfills":197,"./Report":198,"./SchemaCache":199,"./SchemaCompilation":200,"./SchemaValidation":201,"./Utils":202,"./schemas/hyper-schema.json":204,"./schemas/schema.json":205,"_process":176,"lodash.get":162}],204:[function(require,module,exports){ +},{"./FormatValidators":195,"./JsonValidation":196,"./Polyfills":197,"./Report":198,"./SchemaCache":199,"./SchemaCompilation":200,"./SchemaValidation":201,"./Utils":202,"./schemas/hyper-schema.json":204,"./schemas/schema.json":205,"_process":175,"lodash.get":162}],204:[function(require,module,exports){ module.exports={ "$schema": "http://json-schema.org/draft-04/hyper-schema#", "id": "http://json-schema.org/draft-04/hyper-schema#", @@ -27442,4 +27469,4 @@ module.exports={ },{}]},{},[2])(2) }); -//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJsaWIvaGVscGVycy5qcyIsImxpYi9zcGVjcy5qcyIsImxpYi92YWxpZGF0b3JzLmpzIiwibm9kZV9tb2R1bGVzL2FzeW5jL2xpYi9hc3luYy5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyLXJlc29sdmUvZW1wdHkuanMiLCJub2RlX21vZHVsZXMvY29tcG9uZW50LWVtaXR0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Rpb24gKHByb3ApIHtcbiAgICAgICAgaWYgKF8uaXNTdHJpbmcocHJvcGVydHlbcHJvcF0pKSB7XG4gICAgICAgICAgcHJvcGVydHlbcHJvcF0gPSBwYXJzZUZsb2F0KHByb3BlcnR5W3Byb3BdKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIF8uZWFjaChKc29uUmVmcy5maW5kUmVmcyhvUHJvcCwge1xuICAgICAgICBpbmNsdWRlSW52YWxpZDogdHJ1ZSxcbiAgICAgICAgcmVmUHJlUHJvY2Vzc29yOiBzd2FnZ2VyMVJlZlByZVByb2Nlc29yXG4gICAgICB9KSwgZnVuY3Rpb24gKHJlZkRldGFpbHMsIHJlZlB0cikge1xuICAgICAgICB2YXIgZE1ldGFkYXRhID0gZG9jdW1lbnRNZXRhZGF0YS5kZWZpbml0aW9uc1tyZWZEZXRhaWxzLnVyaV07XG4gICAgICAgIHZhciBwYXRoID0gSnNvblJlZnMucGF0aEZyb21QdHIocmVmUHRyKTtcblxuICAgICAgICBpZiAoZE1ldGFkYXRhLmxpbmVhZ2UubGVuZ3RoID4gMCkge1xuICAgICAgICAgIHRyYXZlcnNlKHByb3BlcnR5KS5zZXQocGF0aCwgZ2V0T3JDb21wb3NlU2NoZW1hKGRvY3VtZW50TWV0YWRhdGEsIHJlZkRldGFpbHMudXJpKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdHJhdmVyc2UocHJvcGVydHkpLnNldChwYXRoLmNvbmNhdCgndGl0bGUnKSwgJ0NvbXBvc2VkICcgKyBzYW5pdGl6ZVJlZihkb2N1bWVudE1ldGFkYXRhLnN3YWdnZXJWZXJzaW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmRGV0YWlscy51cmkpKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cblxuICAvLyBTY3J1Yi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cnJvck9yV2FybmluZygnTVVMVElQTEVfJyArIGNvZGUgKyAnX0lOSEVSSVRBTkNFJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICdDaGlsZCAnICsgY29kZS50b0xvd2VyQ2FzZSgpICsgJyBpcyBzdWIgdHlwZSBvZiBtdWx0aXBsZSBtb2RlbHM6ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5tYXAobWV0YWRhdGEucGFyZW50cywgZnVuY3Rpb24gKHBhcmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0RGlzcGxheUlkKHBhcmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5qb2luKCcgJiYgJyksIGRlZlBhdGgsIHJlc3VsdHMuZXJyb3JzKTtcbiAgICB9XG5cbiAgICBpZiAobWV0YWRhdGEuY3ljbGljYWwpIHtcbiAgICAgIGNyZWF0ZUVycm9yT3JXYXJuaW5nKCdDWUNMSUNBTF8nICsgY29kZSArICdfSU5IRVJJVEFOQ0UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnUHJlZml4ICsgJyBoYXMgYSBjaXJjdWxhciBpbmhlcml0YW5jZTogJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8ubWFwKGxpbmVhZ2UsIGZ1bmN0aW9uIChkZXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0RGlzcGxheUlkKGRlcCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJyAtPiAnKSArICcgLT4gJyArIGdldERpc3BsYXlJZChpZCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmUGF0aC5jb25jYXQoc3dhZ2dlclZlcnNpb24gPT09ICcxLjInID8gJ3N1YlR5cGVzJyA6ICdhbGxPZicpLCByZXN1bHRzLmVycm9ycyk7XG4gICAgfVxuXG4gICAgLy8gUmVtb3ZlIHNlbGYgcmV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vY3VtZW50TWV0YWRhdGEsIHByb3BlcnR5LCBwUGF0aCwgcmVzdWx0cyk7XG5cbiAgICAgICAgaWYgKGlQcm9wZXJ0aWVzLmluZGV4T2YobmFtZSkgPiAtMSkge1xuICAgICAgICAgIGNyZWF0ZUVycm9yT3JXYXJuaW5nKCdDSElMRF8nICsgY29kZSArICdfUkVERUNMQVJFU19QUk9QRVJUWScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NoaWxkICcgKyBjb2RlLnRvTG93ZXJDYXNlKCkgKyAnIGRlY2xhcmVzIHByb3BlcnR5IGFscmVhZHkgZGVjbGFyZWQgYnkgYW5jZXN0b3I6ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFBhdGgsIHJlc3VsdHMuZXJyb3JzKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBkUHJvcGVydGllcy5wdXNoKG5hbWUpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICAvLyBJZGVudGlmeSBtaXNzaW5nIHJlcXVpcmVkIHByb3BlcnRpZXNcbiAgICBfLmVhY2goZGVmaW5pdGlvbi5yZXF1aXJlZCB8fCBbXSwgZnVuY3Rpb24gKG5hbWUsIGluZGV4KSB7XG4gICAgICB2YXIgdHlwZSA9IHN3YWdnZXJWZXJzaW9uID09PSAnMS4yJyA/ICdNb2RlbCcgOiAnRGVmaW5pdGlvbic7XG5cbiAgICAgIGlmIChpUHJvcGVydGllcy5pbmRleE9mKG5hbWUpID09PSAtMSAmJiBkUHJvcGVydGllcy5pbmRleE9mKG5hbWUpID09PSAtMSkge1xuICAgICAgICBjcmVhdGVFcnJvck9yV2FybmluZygnTUlTU0lOR19SRVFVSVJFRF8nICsgdHlwZS50b1VwcGVyQ2FzZSgpICsgJ19QUk9QRVJUWScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgK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JzEuMicpIHtcbiAgICB2YWxpZGF0ZVN3YWdnZXIxXzIoc3BlYywgcmxPclNPLCBhcGlEZWNsYXJhdGlvbnMsIGNiV3JhcHBlcik7IC8vIGpzaGludCBpZ25vcmU6bGluZVxuICB9IGVsc2Uge1xuICAgIHZhbGlkYXRlU3dhZ2dlcjJfMChzcGVjLCBybE9yU08sIGNiV3JhcHBlcik7IC8vIGpzaGludCBpZ25vcmU6bGluZVxuICB9XG59O1xuXG52YXIgdmFsaWRhdGVTdHJ1Y3R1cmFsbHkgPSBmdW5jdGlvbiAoc3BlYywgcmxPclNPLCBhcGlEZWNsYXJhdGlvbnMsIGNhbGxiYWNrKSB7XG4gIHZhbGlkYXRlQWdhaW5zdFNjaGVtYShzcGVjLCBzcGVjLnZlcnNpb24gPT09ICcxLjInID8gJ3Jlc291cmNlTGlzdGluZy5qc29uJyA6ICdzY2hlbWEuanNvbicsIHJsT3JTTyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChlcnIsIHJlc3VsdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhlcnIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gT25seSB2YWxpZGF0ZSB0aGUgQVBJIERlY2xhcmF0aW9ucyBpZiB0aGUgQVBJIGlzIDEuMiBhbmQgdGhlIFJlc291cmNlIExpc3Rpbmcgd2FzIHZhbGlkXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmVzdWx0cyAmJiBzcGVjLnZlcnNpb24gPT09ICcxLjInKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0cyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yczogW10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YXJuaW5nczogW10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGlEZWNsYXJhdGlvbnM6IFtdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzeW5jLm1hcChhcGlEZWNsYXJhdGlvbnMsIGZ1bmN0aW9uIChhcGlEZWNsYXJhdGlvbiwgY2FsbGJhY2syKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZGF0ZUFnYWluc3RTY2hlbWEoc3BlYywgJ2FwaURlY2xhcmF0aW9uLmpzb24nLCBhcGlEZWNsYXJhdGlvbiwgY2FsbGJhY2syKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBmdW5jdGlvbiAoZXJyLCBhbGxSZXN1bHRzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhlcnIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLmVhY2goYWxsUmVzdWx0cywgZnVuY3Rpb24gKHJlc3VsdCwgaW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0cy5hcGlEZWNsYXJhdGlvbnNbaW5kZXhdID0gcmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKHVuZGVmaW5lZCwgcmVzdWx0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sodW5kZWZpbmVkLCByZXN1bHRzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfV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AmJiBfLmlzU3RyaW5nKHZhbCkpIHtcbiAgICAgICAgICB2YWwgPSBOdW1iZXIodmFsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJlc3VsdCA9IF8uaXNGaW5pdGUodmFsKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdzdHJpbmcnOlxuICAgICAgICBpZiAoIV8uaXNVbmRlZmluZWQoZm9ybWF0KSkge1xuICAgICAgICAgIHN3aXRjaCAoZm9ybWF0KSB7XG4gICAgICAgICAgY2FzZSAnZGF0ZSc6XG4gICAgICAgICAgICByZXN1bHQgPSBpc1ZhbGlkRGF0ZSh2YWwpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnZGF0ZS10aW1lJzpcbiAgICAgICAgICAgIHJlc3VsdCA9IGlzVmFsaWREYXRlVGltZSh2YWwpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAndm9pZCc6XG4gICAgICAgIHJlc3VsdCA9IF8uaXNVbmRlZmluZWQodmFsKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKHNraXBFcnJvcikge1xuICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9IGVsc2UgaWYgKCFyZXN1bHQpIHtcbiAgICAgIHRocm93RXJyb3JXaXRoQ29kZSgnSU5WQUxJRF9UWVBFJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlICE9PSAndm9pZCcgP1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgJ05vdCBhIHZhbGlkICcgKyAoXy5pc1VuZGVmaW5lZChmb3JtYXQpID8gJycgOiBmb3JtYXQgKyAnICcpICsgdHlwZSArICc6ICcgKyBvVmFsIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICdWb2lkIGRvZXMgbm90IGFsbG93IGEgdmFsdWUnKTtcbiAgICB9XG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3Rpb24gX3JlZHVjZShhcnIsIGl0ZXJhdG9yLCBtZW1vKSB7XG4gICAgICAgIF9hcnJheUVhY2goYXJyLCBmdW5jdGlvbiAoeCwgaSwgYSkge1xuICAgICAgICAgICAgbWVtbyA9IGl0ZXJhdG9yKG1lbW8sIHgsIGksIGEpO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIG1lbW87XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX2ZvckVhY2hPZihvYmplY3QsIGl0ZXJhdG9yKSB7XG4gICAgICAgIF9hcnJheUVhY2goX2tleXMob2JqZWN0KSwgZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgaXRlcmF0b3Iob2JqZWN0W2tleV0sIGtleSk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIF9pbmRleE9mKGFyciwgaXRlbSkge1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGFycltpXSA9PT0gaXRlbSkgcmV0dXJuIGk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIC0xO1xuICAgIH1cblxuICAgIHZhciBfa2V5cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIChvYmopIHtcbiAgICAgICAgdmFyIGtleXMgPSBbXTtcbiAgICAgICAgZm9yICh2YXIgayBpbiBvYmopIHtcbiAgICAgICAgICAgIGlmIChvYmouaGFzT3duUHJvcGVydHkoaykpIHtcbiAgICAgICAgICAgICAgICBrZXlzLnB1c2goayk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGtleXM7XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIF9rZXlJdGVyYXRvcihjb2xsKSB7XG4gICAgICAgIHZhciBpID0gLTE7XG4gICAgICAgIHZhciBsZW47XG4gICAgICAgIHZhciBrZXlzO1xuICAgICAgICBpZiAoX2lzQXJyYXlMaWtlKGNvbGwpKSB7XG4gICAgICAgICAgICBsZW4gPSBjb2xsLmxlbmd0aDtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiBuZXh0KCkge1xuICAgICAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgICAgICByZXR1cm4gaSA8IGxlbiA/IGkgOiBudWxsO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleXMgPSBfa2V5cyhjb2xsKTtcbiAgICAgICAgICAgIGxlbiA9IGtleXMubGVuZ3RoO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIG5leHQoKSB7XG4gICAgICAgICAgICAgICAgaSsrO1xuICAgICAgICAgICAgICAgIHJldHVybiBpIDwgbGVuID8ga2V5c1tpXSA6IG51bGw7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gU2ltaWxhciB0byBFUzYncyByZXN0IHBhcmFtIChodHRwOi8vYXJpeWEub2ZpbGFicy5jb20vMjAxMy8wMy9lczYtYW5kLXJlc3QtcGFyYW1ldGVyLmh0bWwpXG4gICAgLy8gVGhpcyBhY2N1bXVsYXRlcyB0aGUgYXJndW1lbnRzIHBhc3NlZCBpbnRvIGFuIGFycmF5LCBhZnRlciBhIGdpdmVuIGluZGV4LlxuICAgIC8vIEZyb20gdW5kZXJzY29yZS5qcyAoaHR0cHM6Ly9naXRodWIuY29tL2phc2hrZW5hcy91bmRlcnNjb3JlL3B1bGwvMjE0MCkuXG4gICAgZnVuY3Rpb24gX3Jlc3RQYXJhbShmdW5jLCBzdGFydEluZGV4KSB7XG4gICAgICAgIHN0YXJ0SW5kZXggPSBzdGFydEluZGV4ID09IG51bGwgPyBmdW5jLmxlbmd0aCAtIDEgOiArc3RhcnRJbmRleDtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIGxlbmd0aCA9IE1hdGgubWF4KGFyZ3VtZW50cy5s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ZShkb25lKSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY29tcGxldGVkID09PSAwKSBjYWxsYmFjayhudWxsKTtcblxuICAgICAgICBmdW5jdGlvbiBkb25lKGVycikge1xuICAgICAgICAgICAgY29tcGxldGVkLS07XG4gICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2soZXJyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIENoZWNrIGtleSBpcyBudWxsIGluIGNhc2UgaXRlcmF0b3IgaXNuJ3QgZXhoYXVzdGVkXG4gICAgICAgICAgICAvLyBhbmQgZG9uZSByZXNvbHZlZCBzeW5jaHJvbm91c2x5LlxuICAgICAgICAgICAgZWxzZSBpZiAoa2V5ID09PSBudWxsICYmIGNvbXBsZXRlZCA8PSAwKSB7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2sobnVsbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYXN5bmMuZm9yRWFjaE9mU2VyaWVzID1cbiAgICBhc3luYy5lYWNoT2ZTZXJpZXMgPSBmdW5jdGlvbiAob2JqLCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgY2FsbGJhY2sgPSBfb25jZShjYWxsYmFjayB8fCBub29wKTtcbiAgICAgICAgb2JqID0gb2JqIHx8IFtdO1xuICAgICAgICB2YXIgbmV4dEtleSA9IF9rZXlJdGVyYXRvcihvYmopO1xuICAgICAgICB2YXIga2V5ID0gbmV4dEtleSgpO1xuICAgICAgICBmdW5jdGlvbiBpdGVyYXRlKCkge1xuICAgICAgICAgICAgdmFyIHN5bmMgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKGtleSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGl0ZXJhdG9yKG9ialtrZXldLCBrZXksIG9ubHlfb25jZShmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAga2V5ID0gbmV4dEtleSgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoa2V5ID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2sobnVsbCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3luYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzeW5jLnNldEltbWVkaWF0ZShpdGVyYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlcmF0ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgc3luYyA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGl0ZXJhdGUoKTtcbiAgICB9O1xuXG5cblxuICAgIGFzeW5jLmZvckVhY2hPZkxpbWl0ID1cbiAgICBhc3luYy5lYWNoT2ZMaW1pdCA9IGZ1bmN0aW9uIChvYmosIGxpbWl0LCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgX2VhY2hPZkxpbWl0KGxpbWl0KShvYmosIGl0ZXJhdG9yLCBjYWxsYmFjayk7XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIF9lYWNoT2ZMaW1pdChsaW1pdCkge1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAob2JqLCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgIGNhbGxiYWNrID0gX29uY2UoY2FsbGJhY2sgfHwgbm9vcCk7XG4gICAgICAgICAgICBvYmogPSBvYmogfHwgW107XG4gICAgICAgICAgICB2YXIgbmV4dEtleSA9IF9rZXlJdGVyYXRvcihvYmopO1xuICAgICAgICAgICAgaWYgKGxpbWl0IDw9IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2sobnVsbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgZG9uZSA9IGZhbHNlO1xuICAgICAgICAgICAgdmFyIHJ1bm5pbmcgPSAwO1xuICAgICAgICAgICAgdmFyIGVycm9yZWQgPSBmYWxzZTtcblxuICAgICAgICAgICAgKGZ1bmN0aW9uIHJlcGxlbmlzaCAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKGRvbmUgJiYgcnVubmluZyA8PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB3aGlsZSAocnVubmluZyA8IGxpbWl0ICYmICFlcnJvcmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBrZXkgPSBuZXh0S2V5KCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChrZXkgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1bm5pbmcgPD0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJ1bm5pbmcgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgaXRlcmF0b3Iob2JqW2tleV0sIGtleSwgb25seV9vbmNlKGZ1bmN0aW9uIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bm5pbmcgLT0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhlcnIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGVuaXNoKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KSgpO1xuICAgICAgICB9O1xuICAgIH1cblxuXG4gICAgZnVuY3Rpb24gZG9QYXJhbGxlbChmbikge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKG9iaiwgaXRlcmF0b3IsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICByZXR1cm4gZm4oYXN5bmMuZWFjaE9mLCBvYmosIGl0ZXJhdG9yLCBjYWxsYmFjayk7XG4gICAgICAgIH07XG4gICAgfVxuICAgIGZ1bmN0aW9uIGRvUGFyYWxsZWxMaW1pdChmbikge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKG9iaiwgbGltaXQsIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgcmV0dXJuIGZuKF9lYWNoT2ZMaW1pdChsaW1pdCksIG9iaiwgaXRlcmF0b3IsIGNhbGxiYWNrKTtcbiAgICAgICAgfTtcbiAgICB9XG4gICAgZnVuY3Rpb24gZG9TZXJpZXMoZm4pIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChvYmosIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgcmV0dXJuIGZuKGFzeW5jLmVhY2hPZlNlcmllcywgb2JqLCBpdGVy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IsIGNhbGxiYWNrKSB7XG4gICAgICAgIGFzeW5jLmVhY2hPZlNlcmllcyhhcnIsIGZ1bmN0aW9uICh4LCBpLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgaXRlcmF0b3IobWVtbywgeCwgZnVuY3Rpb24gKGVyciwgdikge1xuICAgICAgICAgICAgICAgIG1lbW8gPSB2O1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSwgZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgY2FsbGJhY2soZXJyLCBtZW1vKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIGFzeW5jLmZvbGRyID1cbiAgICBhc3luYy5yZWR1Y2VSaWdodCA9IGZ1bmN0aW9uIChhcnIsIG1lbW8sIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICB2YXIgcmV2ZXJzZWQgPSBfbWFwKGFyciwgaWRlbnRpdHkpLnJldmVyc2UoKTtcbiAgICAgICAgYXN5bmMucmVkdWNlKHJldmVyc2VkLCBtZW1vLCBpdGVyYXRvciwgY2FsbGJhY2spO1xuICAgIH07XG5cbiAgICBhc3luYy50cmFuc2Zvcm0gPSBmdW5jdGlvbiAoYXJyLCBtZW1vLCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDMpIHtcbiAgICAgICAgICAgIGNhbGxiYWNrID0gaXRlcmF0b3I7XG4gICAgICAgICAgICBpdGVyYXRvciA9IG1lbW87XG4gICAgICAgICAgICBtZW1vID0gX2lzQXJyYXkoYXJyKSA/IFtdIDoge307XG4gICAgICAgIH1cblxuICAgICAgICBhc3luYy5lYWNoT2YoYXJyLCBmdW5jdGlvbih2LCBrLCBjYikge1xuICAgICAgICAgICAgaXRlcmF0b3IobWVtbywgdiwgaywgY2IpO1xuICAgICAgICB9LCBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAgIGNhbGxiYWNrKGVyciwgbWVtbyk7XG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBfZmlsdGVyKGVhY2hmbiwgYXJyLCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgdmFyIHJlc3VsdHMgPSBbXTtcbiAgICAgICAgZWFjaGZuKGFyciwgZnVuY3Rpb24gKHgsIGluZGV4LCBjYWxsYmFjaykge1xuICAgICAgICAgICAgaXRlcmF0b3IoeCwgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRzLnB1c2goe2luZGV4OiBpbmRleCwgdmFsdWU6IHh9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2FsbGJhY2soKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBjYWxsYmFjayhfbWFwKHJlc3VsdHMuc29ydChmdW5jdGlvbiAoYSwgYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBhLmluZGV4IC0gYi5pbmRleDtcbiAgICAgICAgICAgIH0pLCBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB4LnZhbHVlO1xuICAgICAgICAgICAgfSkpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYy5zZWxlY3QgPVxuICAgIGFzeW5jLmZpbHRlciA9IGRvUGFyYWxsZWwoX2ZpbHRlcik7XG5cbiAgICBhc3luYy5zZWxlY3RMaW1pdCA9XG4gICAgYXN5bmMuZmlsdGVyTGltaXQgPSBkb1BhcmFsbGVsTGltaXQoX2ZpbHRlcik7XG5cbiAgICBhc3luYy5zZWxlY3RTZXJpZXMgPVxuICAgIGFzeW5jLmZpbHRlclNlcmllcyA9IGRvU2VyaWVzKF9maWx0ZXIpO1xuXG4gICAgZnVuY3Rpb24gX3JlamVjdChlYWNoZm4sIGFyciwgaXRlcmF0b3IsIGNhbGxiYWNrKSB7XG4gICAgICAgIF9maWx0ZXIoZWFjaGZuLCBhcnIsIGZ1bmN0aW9uKHZhbHVlLCBjYikge1xuICAgICAgICAgICAgaXRlcmF0b3IodmFsdWUsIGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICAgICAgICBjYighdik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSwgY2FsbGJhY2spO1xuICAgIH1cbiAgICBhc3luYy5yZWplY3QgPSBkb1BhcmFsbGVsKF9yZWplY3QpO1xuICAgIGFzeW5jLnJlamVjdExpbWl0ID0gZG9QYXJhbGxlbExpbWl0KF9yZWplY3QpO1xuICAgIGFzeW5jLnJlamVjdFNlcmllcyA9IGRvU2VyaWVzKF9yZWplY3QpO1xuXG4gICAgZnVuY3Rpb24gX2NyZWF0ZVRlc3RlcihlYWNoZm4sIGNoZWNrLCBnZXRSZXN1bHQpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKGFyciwgbGltaXQsIGl0ZXJhdG9yLCBjYikge1xuICAgICAgICAgICAgZnVuY3Rpb24gZG9uZSgpIHtcbiAgICAgICAgICAgICAgICBpZiAoY2IpIGNiKGdldFJlc3VsdChmYWxzZSwgdm9pZCAwKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBpdGVyYXRlZSh4LCBfLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIGlmICghY2IpIHJldHVybiBjYWxsYmFjaygpO1xuICAgICAgICAgICAgICAgIGl0ZXJhdG9yKHgsIGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjYiAmJiBjaGVjayh2KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2IoZ2V0UmVzdWx0KHRydWUsIHgpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNiID0gaXRlcmF0b3IgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAg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5lYWNoT2ZTZXJpZXMsIGlkZW50aXR5LCBfZmluZEdldFJlc3VsdCk7XG4gICAgYXN5bmMuZGV0ZWN0TGltaXQgPSBfY3JlYXRlVGVzdGVyKGFzeW5jLmVhY2hPZkxpbWl0LCBpZGVudGl0eSwgX2ZpbmRHZXRSZXN1bHQpO1xuXG4gICAgYXN5bmMuc29ydEJ5ID0gZnVuY3Rpb24gKGFyciwgaXRlcmF0b3IsIGNhbGxiYWNrKSB7XG4gICAgICAgIGFzeW5jLm1hcChhcnIsIGZ1bmN0aW9uICh4LCBjYWxsYmFjaykge1xuICAgICAgICAgICAgaXRlcmF0b3IoeCwgZnVuY3Rpb24gKGVyciwgY3JpdGVyaWEpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhudWxsLCB7dmFsdWU6IHgsIGNyaXRlcmlhOiBjcml0ZXJpYX0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LCBmdW5jdGlvbiAoZXJyLCByZXN1bHRzKSB7XG4gICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhudWxsLCBfbWFwKHJlc3VsdHMuc29ydChjb21wYXJhdG9yKSwgZnVuY3Rpb24gKHgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHgudmFsdWU7XG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0pO1xuXG4gICAgICAgIGZ1bmN0aW9uIGNvbXBhcmF0b3IobGVmdCwgcmlnaHQpIHtcbi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JzLnVuc2hpZnQoZm4pO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHJlbW92ZUxpc3RlbmVyKGZuKSB7XG4gICAgICAgICAgICB2YXIgaWR4ID0gX2luZGV4T2YobGlzdGVuZXJzLCBmbik7XG4gICAgICAgICAgICBpZiAoaWR4ID49IDApIGxpc3RlbmVycy5zcGxpY2UoaWR4LCAxKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiB0YXNrQ29tcGxldGUoKSB7XG4gICAgICAgICAgICByZW1haW5pbmdUYXNrcy0tO1xuICAgICAgICAgICAgX2FycmF5RWFjaChsaXN0ZW5lcnMuc2xpY2UoMCksIGZ1bmN0aW9uIChmbikge1xuICAgICAgICAgICAgICAgIGZuKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGFkZExpc3RlbmVyKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICghcmVtYWluaW5nVGFza3MpIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhudWxsLCByZXN1bHRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgX2FycmF5RWFjaChrZXlzLCBmdW5jdGlvbiAoaykge1xuICAgICAgICAgICAgaWYgKGhhc0Vycm9yKSByZXR1cm47XG4gICAgICAgICAgICB2YXIgdGFzayA9IF9pc0FycmF5KHRhc2tzW2tdKSA/IHRhc2tzW2tdOiBbdGFza3Nba11dO1xuICAgICAgICAgICAgdmFyIHRhc2tDYWxsYmFjayA9IF9yZXN0UGFyYW0oZnVuY3Rpb24oZXJyLCBhcmdzKSB7XG4gICAgICAgICAgICAgICAgcnVubmluZ1Rhc2tzLS07XG4gICAgICAgICAgICAgICAgaWYgKGFyZ3MubGVuZ3RoIDw9IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJncyA9IGFyZ3NbMF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNhZmVSZXN1bHRzID0ge307XG4gICAgICAgICAgICAgICAgICAgIF9mb3JFYWNoT2YocmVzdWx0cywgZnVuY3Rpb24odmFsLCBya2V5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzYWZlUmVzdWx0c1tya2V5XSA9IHZhbDtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIHNhZmVSZXN1bHRzW2tdID0gYXJncztcbiAgICAgICAgICAgICAgICAgICAgaGFzRXJyb3IgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKGVyciwgc2FmZVJlc3VsdHMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0c1trXSA9IGFyZ3M7XG4gICAgICAgICAgICAgICAgICAgIGFzeW5jLnNldEltbWVkaWF0ZSh0YXNrQ29tcGxldGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdmFyIHJlcXVpcmVzID0gdGFzay5zbGljZSgwLCB0YXNrLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgLy8gcHJldmVudCBkZWFkLWxvY2tzXG4gICAgICAgICAgICB2YXIgbGVuID0gcmVxdWlyZXMubGVuZ3RoO1xuICAgICAgICAgICAgdmFyIGRlcDtcbiAgICAgICAgICAgIHdoaWxlIChsZW4tLSkge1xuICAgICAgICAgICAgICAgIGlmICghKGRlcCA9IHRhc2tzW3JlcXVpcmVzW2xlbl1dKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0hhcyBub25leGlzdGVudCBkZXBlbmRlbmN5IGluICcgKyByZXF1aXJlcy5qb2luKCcsICcpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKF9pc0FycmF5KGRlcCkgJiYgX2luZGV4T2YoZGVwLCBrKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSGFzIGN5Y2xpYyBkZXBlbmRlbmNpZXMnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiByZWFkeSgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcnVubmluZ1Rhc2tzIDwgY29uY3VycmVuY3kgJiYgX3JlZHVjZShyZXF1aXJlcywgZnVuY3Rpb24gKGEsIHgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChhICYmIHJlc3VsdHMuaGFzT3duUHJvcGVydHkoeCkpO1xuICAgICAgICAgICAgICAgIH0sIHRydWUpICYmICFyZXN1bHRzLmhhc093blByb3BlcnR5KGspO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHJlYWR5KCkpIHtcbiAgICAgICAgICAgICAgICBydW5uaW5nVGFza3MrKztcbiAgICAgICAgICAgICAgICB0YXNrW3Rhc2subGVuZ3RoIC0gMV0odGFza0NhbGxiYWNrLCByZXN1bHRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGFkZExpc3RlbmVyKGxpc3RlbmVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGxpc3RlbmVyKCkge1xuICAgICAgICAgICAgICAgIGlmIChyZWFkeSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJ1bm5pbmdUYXNrcysrO1xuICAgICAgICAgICAgICAgICAgICByZW1vdmVMaXN0ZW5lcihsaXN0ZW5lcik7XG4gICAgICAgICAgICAgICAgICAgIHRhc2tbdGFzay5sZW5ndGggLSAxXSh0YXNrQ2FsbGJhY2ssIHJlc3VsdHMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcblxuXG5cbiAgICBhc3luYy5yZXRyeSA9IGZ1bmN0aW9uKHRpbWVzLCB0YXNrLCBjYWxsYmFjaykge1xuICAgICAgICB2YXIgREVGQVVMVF9USU1FUyA9IDU7XG4gICAgICAgIHZhciBERUZBVUxUX0lOVEVSVkFMID0gMDtcblxuICAgICAgICB2YXIgYXR0ZW1wdHMgPSBbXTtcblxuICAgICAgICB2YXIgb3B0cyA9IHtcbiAgICAgICAgICAgIHRpbWVzOiBERUZBVUxUX1RJTUVTLFxuICAgICAgICAgICAgaW50ZXJ2YWw6IERFRkFVTFRfSU5URVJWQUxcbiAgICAgICAgfTtcblxuICAgICAgICBmdW5jdGlvbiBwYXJzZVRpbWVzKGFjYywgdCl7XG4gICAgICAgICAgICBpZih0eXBlb2YgdCA9PT0gJ251bWJlcicpe1xuICAgICAgICAgICAgICAgIGFjYy50aW1lcyA9IHBhcnNlSW50KHQsIDEwKSB8fCBERUZBVUxUX1RJTUVTO1xuICAgICAgICAgICAgfSBlbHNlIGlmKHR5cGVvZiB0ID09PSAnb2JqZWN0Jyl7XG4gICAgICAgICAgICAgICAgYWNjLnRpbWVzID0gcGFyc2VJbnQodC50aW1lcywgMTApIHx8IERFRkFVTFRfVElNRVM7XG4gICAgICAgICAgICAgICAgYWNjLmludGVydmFsID0gcGFyc2VJbnQodC5pbnRlcnZhbCwgMTApIHx8IERFRkFVTFRfSU5URVJWQUw7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5zdXBwb3J0ZWQgYXJndW1lbnQgdHlwZSBmb3IgXFwndGltZXNcXCc6ICcgKyB0eXBlb2YgdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbGVuZ3RoID0gYXJndW1lbnRzLmxlbmd0aDtcbiAgICAgICAgaWYgKGxlbmd0aCA8IDEgfHwgbGVuZ3RoID4gMykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yK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AgICAgICAgIHJldHVybiBmdW5jdGlvbihzZXJpZXNDYWxsYmFjayl7XG4gICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlcmllc0NhbGxiYWNrKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICB9LCBpbnRlcnZhbCk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgd2hpbGUgKG9wdHMudGltZXMpIHtcblxuICAgICAgICAgICAgICAgIHZhciBmaW5hbEF0dGVtcHQgPSAhKG9wdHMudGltZXMtPTEpO1xuICAgICAgICAgICAgICAgIGF0dGVtcHRzLnB1c2gocmV0cnlBdHRlbXB0KG9wdHMudGFzaywgZmluYWxBdHRlbXB0KSk7XG4gICAgICAgICAgICAgICAgaWYoIWZpbmFsQXR0ZW1wdCAmJiBvcHRzLmludGVydmFsID4gMCl7XG4gICAgICAgICAgICAgICAgICAgIGF0dGVtcHRzLnB1c2gocmV0cnlJbnRlcnZhbChvcHRzLmludGVydmFsKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBhc3luYy5zZXJpZXMoYXR0ZW1wdHMsIGZ1bmN0aW9uKGRvbmUsIGRhdGEpe1xuICAgICAgICAgICAgICAgIGRhdGEgPSBkYXRhW2RhdGEubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgKHdyYXBwZWRDYWxsYmFjayB8fCBvcHRzLmNhbGxiYWNrKShkYXRhLmVyciwgZGF0YS5yZXN1bHQpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBJZiBhIGNhbGxiYWNrIGlzIHBhc3NlZCwgcnVuIHRoaXMgYXMgYSBjb250cm9sbCBmbG93XG4gICAgICAgIHJldHVybiBvcHRzLmNhbGxiYWNrID8gd3JhcHBlZFRhc2soKSA6IHdyYXBwZWRUYXNrO1xuICAgIH07XG5cbiAgICBhc3luYy53YXRlcmZhbGwgPSBmdW5jdGlvbiAodGFza3MsIGNhbGxiYWNrKSB7XG4gICAgICAgIGNhbGxiYWNrID0gX29uY2UoY2FsbGJhY2sgfHwgbm9vcCk7XG4gICAgICAgIGlmICghX2lzQXJyYXkodGFza3MpKSB7XG4gICAgICAgICAgICB2YXIgZXJyID0gbmV3IEVycm9yKCdGaXJzdCBhcmd1bWVudCB0byB3YXRlcmZhbGwgbXVzdCBiZSBhbiBhcnJheSBvZiBmdW5jdGlvbnMnKTtcbiAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhlcnIpO1xuICAgICAgICB9XG4gICAgICAgIGlmICghdGFza3MubGVuZ3RoKSB7XG4gICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiB3cmFwSXRlcmF0b3IoaXRlcmF0b3IpIHtcbiAgICAgICAgICAgIHJldHVybiBfcmVzdFBhcmFtKGZ1bmN0aW9uIChlcnIsIGFyZ3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLmFwcGx5KG51bGwsIFtlcnJdLmNvbmNhdChhcmdzKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbmV4dCA9IGl0ZXJhdG9yLm5leHQoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MucHVzaCh3cmFwSXRlcmF0b3IobmV4dCkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXJncy5wdXNoKGNhbGxiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbnN1cmVBc3luYyhpdGVyYXRvcikuYXBwbHkobnVsbCwgYXJncyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgd3JhcEl0ZXJhdG9yKGFzeW5jLml0ZXJhdG9yKHRhc2tzKSkoKTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gX3BhcmFsbGVsKGVhY2hmbiwgdGFza3MsIGNhbGxiYWNrKSB7XG4gICAgICAgIGNhbGxiYWNrID0gY2FsbGJhY2sgfHwgbm9vcDtcbiAgICAgICAgdmFyIHJlc3VsdHMgPSBfaXNBcnJheUxpa2UodGFza3MpID8gW10gOiB7fTtcblxuICAgICAgICBlYWNoZm4odGFza3MsIGZ1bmN0aW9uICh0YXNrLCBrZXksIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICB0YXNrKF9yZXN0UGFyYW0oZnVuY3Rpb24gKGVyciwgYXJncykge1xuICAgICAgICAgICAgICAgIGlmIChhcmdzLmxlbmd0aCA8PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyZ3MgPSBhcmdzWzBdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXN1bHRzW2tleV0gPSBhcmdzO1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH0sIGZ1bmN0aW9uIChlcnIpIHtcbiAgICAgICAgICAgIGNhbGxiYWNrKGVyciwgcmVzdWx0cyk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jLnBhcmFsbGVsID0gZnVuY3Rpb24gKHRhc2tzLCBjYWxsYmFjaykge1xuICAgICAgICBfcGFyYWxsZWwoYXN5bmMuZWFjaE9mLCB0YXNrcywgY2FsbGJhY2spO1xuICAgIH07XG5cbiAgICBhc3luYy5wYXJhbGxlbExpbWl0ID0gZnVuY3Rpb24odGFza3MsIGxpbWl0LCBjYWxsYmFjaykge1xuICAgICAgICBf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ICAgICAgICAgICApO1xuICAgICAgICB9KTtcbiAgICB9KTtcblxuICAgIGZ1bmN0aW9uIF9jb25jYXQoZWFjaGZuLCBhcnIsIGZuLCBjYWxsYmFjaykge1xuICAgICAgICB2YXIgcmVzdWx0ID0gW107XG4gICAgICAgIGVhY2hmbihhcnIsIGZ1bmN0aW9uICh4LCBpbmRleCwgY2IpIHtcbiAgICAgICAgICAgIGZuKHgsIGZ1bmN0aW9uIChlcnIsIHkpIHtcbiAgICAgICAgICAgICAgICByZXN1bHQgPSByZXN1bHQuY29uY2F0KHkgfHwgW10pO1xuICAgICAgICAgICAgICAgIGNiKGVycik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSwgZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgY2FsbGJhY2soZXJyLCByZXN1bHQpO1xuICAgICAgICB9KTtcbiAgICB9XG4gICAgYXN5bmMuY29uY2F0ID0gZG9QYXJhbGxlbChfY29uY2F0KTtcbiAgICBhc3luYy5jb25jYXRTZXJpZXMgPSBkb1NlcmllcyhfY29uY2F0KTtcblxuICAgIGFzeW5jLndoaWxzdCA9IGZ1bmN0aW9uICh0ZXN0LCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgY2FsbGJhY2sgPSBjYWxsYmFjayB8fCBub29wO1xuICAgICAgICBpZiAodGVzdCgpKSB7XG4gICAgICAgICAgICB2YXIgbmV4dCA9IF9yZXN0UGFyYW0oZnVuY3Rpb24oZXJyLCBhcmdzKSB7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhlcnIpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGVzdC5hcHBseSh0aGlzLCBhcmdzKSkge1xuICAgICAgICAgICAgICAgICAgICBpdGVyYXRvcihuZXh0KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjay5hcHBseShudWxsLCBbbn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gICAgICAgY2FsbGJhY2sgPSBjYWxsYmFjayB8fCBub29wO1xuXG4gICAgICAgIHZhciBuZXh0ID0gX3Jlc3RQYXJhbShmdW5jdGlvbihlcnIsIGFyZ3MpIHtcbiAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhlcnIpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBhcmdzLnB1c2goY2hlY2spO1xuICAgICAgICAgICAgICAgIHRlc3QuYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHZhciBjaGVjayA9IGZ1bmN0aW9uKGVyciwgdHJ1dGgpIHtcbiAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhlcnIpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0cnV0aCkge1xuICAgICAgICAgICAgICAgIGl0ZXJhdG9yKG5leHQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICB0ZXN0KGNoZWNrKTtcbiAgICB9O1xuXG4gICAgYXN5bmMuZG9EdXJpbmcgPSBmdW5jdGlvbiAoaXRlcmF0b3IsIHRlc3QsIGNhbGxiYWNrKSB7XG4gICAgICAgIHZhciBjYWxscyA9IDA7XG4gICAgICAgIGFzeW5jLmR1cmluZyhmdW5jdGlvbihuZXh0KSB7XG4gICAgICAgICAgICBpZiAoY2FsbHMrKyA8IDEpIHtcbiAgICAgICAgICAgICAgICBuZXh0KG51bGwsIHRydWUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0ZXN0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIGl0ZXJhdG9yLCBjYWxsYmFjayk7XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIF9xdWV1ZSh3b3JrZXIsIGNvbmN1cnJlbmN5LCBwYXlsb2FkKSB7XG4gICAgICAgIGlmIChjb25jdXJyZW5jeSA9PSBudWxsKSB7XG4gICAgICAgICAgICBjb25jdXJyZW5jeSA9IDE7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZihjb25jdXJyZW5jeSA9PT0gMCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdDb25jdXJyZW5jeSBtdXN0IG5vdCBiZSB6ZXJvJyk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX2luc2VydChxLCBkYXRhLCBwb3MsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCAmJiB0eXBlb2YgY2FsbGJhY2sgIT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcInRhc2sgY2FsbGJhY2sgbXVzdCBiZSBhIGZ1bmN0aW9uXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcS5zdGFydGVkID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICghX2lzQXJyYXkoZGF0YSkpIHtcbiAgICAgICAgICAgICAgICBkYXRhID0gW2RhdGFdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYoZGF0YS5sZW5ndGggPT09IDAgJiYgcS5pZGxlKCkpIHtcbiAgICAgICAgICAgICAgICAvLyBjYWxsIGRyYWluIGltbWVkaWF0ZWx5IGlmIHRoZXJlIGFyZSBubyB0YXNrc1xuICAgICAgICAgICAgICAgIHJldHVybiBhc3luYy5zZXRJbW1lZGlhdGUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIHEuZHJhaW4oKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF9hcnJheUVhY2goZGF0YSwgZnVuY3Rpb24odGFzaykge1xuICAgICAgICAgICAgICAgIHZhciBpdGVtID0ge1xuICAgICAgICAgICAgICAgICAgICBkYXRhOiB0YXNrLFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogY2FsbGJhY2sgfHwgbm9vcFxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICBpZiAocG9zKSB7XG4gICAgICAgICAgICAgICAgICAgIHEudGFza3MudW5zaGlmdChpdGVtKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBxLnRhc2tzLnB1c2goaXRlbSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKHEudGFza3MubGVuZ3RoID09PSBxLmNvbmN1cnJlbmN5KSB7XG4gICAgICAgICAgICAgICAgICAgIHEuc2F0dXJhdGVkKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBhc3luYy5zZXRJbW1lZGlhdGUocS5wcm9jZXNzKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfbmV4dChxLCB0YXNrcykge1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICAgICAgd29ya2VycyAtPSAxO1xuXG4gICAgICAgICAgICAgICAgdmFyIHJlbW92ZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IGFyZ3VtZW50cztcbiAgICAgICAgICAgICAgICBfYXJyYXlFYWNoKHRhc2tzLCBmdW5jdGlvbiAodGFzaykge1xuICAgICAgICAgICAgICAgICAgICBfYXJyYXlFYWNoKHdvcmtlcnNMaXN0LCBmdW5jdGlvbiAod29ya2VyLCBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdvcmtlciA9PT0gdGFzayAmJiAhcmVtb3ZlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdvcmtlcnNMaXN0LnNwbGljZShpbmRleCwgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIHRhc2suY2FsbGJhY2suYXBwbHkodGFzaywgYXJncyk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgaWYgKHEudGFza3MubGVuZ3RoICsgd29ya2VycyA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBxLmRyYWluKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHEucHJvY2VzcygpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciB3b3JrZXJzID0gMDtcbiAgICAgICAgdmFyIHdvcmtlcnNMaXN0ID0gW107XG4gICAgICAgIHZhciBxID0ge1xuICAgICAgICAgICAgdGFza3M6IFtdLFxuICAgICAgICAgICAgY29uY3VycmVuY3k6IGNvbmN1cnJlbmN5LFxuICAgICAgICAgICAgcGF5bG9hZDogcGF5bG9hZCxcbiAgICAgICAgICAgIHNhdHVyYXRlZDogbm9vcCxcbiAgICAgICAgICAgIGVtcHR5OiBub29wLFxuICAgICAgICAgICAgZHJhaW46IG5vb3AsXG4gICAgICAgICAgICBzdGFydGVkOiBmYWxzZSxcbiAgICAgICAgICAgIHBhdXNlZDogZmFsc2UsXG4gICAgICAgICAgICBwdXNoOiBmdW5jdGlvbiAoZGF0YSwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBfaW5zZXJ0KHEsIGRhdGEsIGZhbHNlLCBjYWxsYmFjayk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAga2lsbDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHEuZHJhaW4gPSBub29wO1xuICAgICAgICAgICAgICAgIHEudGFza3MgPSBbXTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB1bnNoaWZ0OiBmdW5jdGlvbiAoZGF0YSwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBfaW5zZXJ0KHEsIGRhdGEsIHRydWUsIGNhbGxiYWNrKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBwcm9jZXNzOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgd2hpbGUoIXEucGF1c2VkICYmIHdvcmtlcnMgPCBxLmNvbmN1cnJlbmN5ICYmIHEudGFza3MubGVuZ3RoKXtcblxuICAgICAgICAgICAgICAgICAgICB2YXIgdGFza3MgPSBxLnBheWxvYWQgP1xuICAgICAgICAgICAgICAgICAgICAgICAgcS50YXNrcy5zcGxpY2UoMCwgcS5wYXlsb2FkKSA6XG4gICAgICAgICAgICAgICAgICAgICAgICBxLnRhc2tzLnNwbGljZSgwLCBxLnRhc2tzLmxlbmd0aCk7XG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSBfbWFwKHRhc2tzLCBmdW5jdGlvbiAodGFzaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRhc2suZGF0YTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHEudGFza3MubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxLmVtcHR5KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgd29ya2VycyArPSAxO1xuICAgICAgICAgICAgICAgICAgICB3b3JrZXJzTGlzdC5wdXNoKHRhc2tzWzBdKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNiID0gb25seV9vbmNlKF9uZXh0KHEsIHRhc2tzKSk7XG4gICAgICAgICAgICAgICAgICAgIHdvcmtlcihkYXRhLCBjYik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxlbmd0aDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBxLnRhc2tzLmxlbmd0aDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBydW5uaW5nOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlcnM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgd29ya2Vyc0xpc3Q6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2Vyc0xpc3Q7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaWRsZTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHEudGFza3MubGVuZ3RoICsgd29ya2VycyA9PT0gMDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBwYXVzZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHEucGF1c2VkID0gdHJ1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICByZXN1bWU6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAocS5wYXVzZWQgPT09IGZhbHNlKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIHEucGF1c2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgdmFyIHJlc3VtZUNvdW50ID0gTWF0aC5taW4ocS5jb25jdXJyZW5jeSwgcS50YXNrcy5sZW5ndGgpO1xuICAgICAgICAgICAgICAgIC8vIE5lZWQgdG8gY2FsbCBxLnByb2Nlc3Mgb25jZSBwZXIgY29uY3VycmVudFxuICAgICAgICAgICAgICAgIC8vIHdvcmtlciB0byBwcmVzZXJ2ZSBmdWxsIGNvbmN1cnJlbmN5IGFmdGVyIHBhdXNlXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgdyA9IDE7IHcgPD0gcmVzdW1lQ291bnQ7IHcrKykge1xuICAgICAgICAgICAgICAgICAgICBhc3luYy5zZXRJbW1lZGlhdGUocS5wcm9jZXNzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBxO1xuICAgIH1cblxuICAgIGFzeW5jLnF1ZXVlID0gZnVuY3Rpb24gKHdvcmtlciwgY29uY3VycmVuY3kpIHtcbiAgICAgICAgdmFyIHEgPSBfcXVldWUoZnVuY3Rpb24gKGl0ZW1zLCBjYikge1xuICAgICAgICAgICAgd29ya2VyKGl0ZW1zWzBdLCBjYik7XG4gICAgICAgIH0sIGNvbmN1cnJlbmN5LCAxKTtcblxuICAgICAgICByZXR1cm4gcTtcbiAgICB9O1xuXG4gICAgYXN5bmMucHJpb3JpdHlRdWV1ZSA9IGZ1bmN0aW9uICh3b3JrZXIsIGNvbmN1cnJlbmN5KSB7XG5cbiAgICAgICAgZnVuY3Rpb24gX2NvbXBhcmVUYXNrcyhhLCBiKXtcbiAgICAgICAgICAgIHJldHVybiBhLnByaW9yaXR5IC0gYi5wcmlvcml0eTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIF9iaW5hcnlTZWFyY2goc2VxdWVuY2UsIGl0ZW0sIGNvbXBhcmUpIHtcbiAgICAgICAgICAgIHZhciBiZWcgPSAtMSxcbiAgICAgICAgICAgICAgICBlbmQgPSBzZXF1ZW5jZS5sZW5ndGggLSAxO1xuICAgICAgICAgICAgd2hpbGUgKGJlZyA8IGVuZCkge1xuICAgICAgICAgICAgICAgIHZhciBtaWQgPSBiZWcgKyAoKGVuZCAtIGJlZyArIDEpID4+PiAxKTtcbiAgICAgICAgICAgICAgICBpZiAoY29tcGFyZShpdGVtLCBzZXF1ZW5jZVttaWRdKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGJlZyA9IG1pZDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBlbmQgPSBtaWQgLSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBiZWc7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBfaW5zZXJ0KHEsIGRhdGEsIHByaW9yaXR5LCBjYWxsYmFjaykge1xuICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwgJiYgdHlwZW9mIGNhbGxiYWNrICE9PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJ0YXNrIGNhbGxiYWNrIG11c3QgYmUgYSBmdW5jdGlvblwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHEuc3RhcnRlZCA9IHRydWU7XG4gICAgICAgICAgICBpZiAoIV9pc0FycmF5KGRhdGEpKSB7XG4gICAgICAgICAgICAgICAgZGF0YSA9IFtkYXRhXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmKGRhdGEubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgLy8gY2FsbCBkcmFpbiBpbW1lZGlhdGVseSBpZiB0aGVyZSBhcmUgbm8gdGFza3NcbiAgICAgICAgICAgICAgICByZXR1cm4gYXN5bmMuc2V0SW1tZWRpYXRlKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBxLmRyYWluKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBfYXJyYXlFYWNoKGRhdGEsIGZ1bmN0aW9uKHRhc2spIHtcbiAgICAgICAgICAgICAgICB2YXIgaXRlbSA9IHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YTogdGFzayxcbiAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHk6IHByaW9yaXR5LFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogdHlwZW9mIGNhbGxiYWNrID09PSAnZnVuY3Rpb24nID8gY2FsbGJhY2sgOiBub29wXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgI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gICAgZm4uYXBwbHkobnVsbCwgYXJncy5jb25jYXQoW19yZXN0UGFyYW0oZnVuY3Rpb24gKGVyciwgYXJncykge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY29uc29sZSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnNvbGUuZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGVycik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoY29uc29sZVtuYW1lXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX2FycmF5RWFjaChhcmdzLCBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGVbbmFtZV0oeCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXSkpO1xuICAgICAgICB9KTtcbiAgICB9XG4gICAgYXN5bmMubG9nID0gX2NvbnNvbGVfZm4oJ2xvZycpO1xuICAgIGFzeW5jLmRpciA9IF9jb25zb2xlX2ZuKCdkaXInKTtcbiAgICAvKmFzeW5jLmluZm8gPSBfY29uc29sZV9mbignaW5mbycpO1xuICAgIGFzeW5jLndhcm4gPSBfY29uc29sZV9mbignd2FybicpO1xuICAgIGFzeW5jLmVycm9yID0gX2NvbnNvbGVfZm4oJ2Vycm9yJyk7Ki9cblxuICAgIGFzeW5jLm1lbW9pemUgPSBmdW5jdGlvbiAoZm4sIGhhc2hlcikge1xuICAgICAgICB2YXIgbWVtbyA9IHt9O1xuICAgICAgICB2YXIgcXVldWVzID0ge307XG4gICAgICAgIHZhciBoYXMgPSBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O1xuICAgICAgICBoYXNoZXIgPSBoYXNoZXIgfHwgaWRlbnRpdHk7XG4gICAgICAgIHZhciBtZW1vaXplZCA9IF9yZXN0UGFyYW0oZnVuY3Rpb24gbWVtb2l6ZWQoYXJncykge1xuICAgICAgICAgICAgdmFyIGNhbGxiYWNrID0gYXJncy5wb3AoKTtcbiAgICAgICAgICAgIHZhciBrZXkgPSBoYXNoZXIuYXBwbHkobnVsbCwgYXJncyk7XG4gICAgICAgICAgICBpZiAoaGFzLmNhbGwobWVtbywga2V5KSkgeyAgIFxuICAgICAgICAgICAgICAgIGFzeW5jLnNldEltbWVkaWF0ZShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLmFwcGx5KG51bGwsIG1lbW9ba2V5XSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChoYXMuY2FsbChxdWV1ZXMsIGtleSkpIHtcbiAgICAgICAgICAgICAgICBxdWV1ZXNba2V5XS5wdXNoKGNhbGxiYWNrKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHF1ZXVlc1trZXldID0gW2NhbGxiYWNrXTtcbiAgICAgICAgICAgICAgICBmbi5hcHBseShudWxsLCBhcmdzLmNvbmNhdChbX3Jlc3RQYXJhbShmdW5jdGlvbiAoYXJncykge1xuICAgICAgICAgICAgICAgICAgICBtZW1vW2tleV0gPSBhcmdzO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcSA9IHF1ZXVlc1trZXldO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcXVldWVzW2tleV07XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBsID0gcS5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHFbaV0uYXBwbHkobnVsbCwgYXJncyk7XG4gICAgIC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ZnVuY3Rpb24gKGFyZ3MpIHtcbiAgICAgICAgICAgIHZhciB0aGF0ID0gdGhpcztcblxuICAgICAgICAgICAgdmFyIGNhbGxiYWNrID0gYXJnc1thcmdzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBjYWxsYmFjayA9PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgYXJncy5wb3AoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2sgPSBub29wO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBhc3luYy5yZWR1Y2UoZm5zLCBhcmdzLCBmdW5jdGlvbiAobmV3YXJncywgZm4sIGNiKSB7XG4gICAgICAgICAgICAgICAgZm4uYXBwbHkodGhhdCwgbmV3YXJncy5jb25jYXQoW19yZXN0UGFyYW0oZnVuY3Rpb24gKGVyciwgbmV4dGFyZ3MpIHtcbiAgICAgICAgICAgICAgICAgICAgY2IoZXJyLCBuZXh0YXJncyk7XG4gICAgICAgICAgICAgICAgfSldKSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZnVuY3Rpb24gKGVyciwgcmVzdWx0cykge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrLmFwcGx5KHRoYXQsIFtlcnJdLmNvbmNhdChyZXN1bHRzKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIGFzeW5jLmNvbXBvc2UgPSBmdW5jdGlvbiAoLyogZnVuY3Rpb25zLi4uICovKSB7XG4gICAgICAgIHJldHVybiBhc3luYy5zZXEuYXBwbHkobnVsbCwgQXJyYXkucHJvdG90eXBlLnJldmVyc2UuY2FsbChhcmd1bWVudHMpKTtcbiAgICB9O1xuXG5cbiAgICBmdW5jdGlvbiBfYXBwbHlFYWNoKGVhY2hmbikge1xuICAgICAgICByZXR1cm4gX3Jlc3RQYXJhbShmdW5jdGlvbihmbnMsIGFyZ3MpIHtcbiAgICAgICAgICAgIHZhciBnbyA9IF9yZXN0UGFyYW0oZnVuY3Rpb24oYXJncykge1xuICAgICAgICAgICAgICAgIHZhciB0aGF0ID0gdGhpcztcbiAgICAgICAgICAgICAgICB2YXIgY2FsbGJhY2sgPSBhcmdzLnBvcCgpO1xuICAgICAgICAgICAgICAgIHJldHVybiBlYWNoZm4oZm5zLCBmdW5jdGlvbiAoZm4sIF8sIGNiKSB7XG4gICAgICAgICAgICAgICAgICAgIGZuLmFwcGx5KHRoYXQsIGFyZ3MuY29uY2F0KFtjYl0pKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGNhbGxiYWNrKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKGFyZ3MubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdvLmFwcGx5KHRoaXMsIGFyZ3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdvO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYy5hcHBseUVhY2ggPSBfYXBwbHlFYWNoKGFzeW5jLmVhY2hPZik7XG4gICAgYXN5bmMuYXBwbHlFYWNoU2VyaWVzID0gX2FwcGx5RWFjaChhc3luYy5lYWNoT2ZTZXJpZXMpO1xuXG5cbiAgICBhc3luYy5mb3JldmVyID0gZnVuY3Rpb24gKGZuLCBjYWxsYmFjaykge1xuICAgICAgICB2YXIgZG9uZSA9IG9ubHlfb25jZShjYWxsYmFjayB8fCBub29wKTtcbiAgICAgICAgdmFyIHRhc2sgPSBlbnN1cmVBc3luYyhmbik7XG4gICAgICAgIGZ1bmN0aW9uIG5leHQoZXJyKSB7XG4gICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGRvbmUoZXJyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRhc2sobmV4dCk7XG4gICAgICAgIH1cbiAgICAgICAgbmV4dCgpO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBlbnN1cmVBc3luYyhmbikge1xuICAgICAgICByZXR1cm4gX3Jlc3RQYXJhbShmdW5jdGlvbiAoYXJncykge1xuICAgICAgICAgICAgdmFyIGNhbGxiYWNrID0gYXJncy5wb3AoKTtcbiAgICAgICAgICAgIGFyZ3MucHVzaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGlubmVyQXJncyA9IGFyZ3VtZW50cztcbiAgICAgICAgICAgICAgICBpZiAoc3luYykge1xuICAgICAgICAgICAgICAgICAgICBhc3luYy5zZXRJbW1lZGlhdGUoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgaW5uZXJBcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgaW5uZXJBcmdzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHZhciBzeW5jID0gdHJ1ZTtcbiAgICAgICAgICAgIGZuLmFwcGx5KHRoaXMsIGFyZ3MpO1xuICAgICAgICAgICAgc3luYyA9IGZhbHNlO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYy5lbnN1cmVBc3luYyA9IGVuc3VyZUFzeW5jO1xuXG4gICAgYXN5bmMuY29uc3RhbnQgPSBfcmVzdFBhcmFtKGZ1bmN0aW9uKHZhbHVlcykge1xuICAgICAgICB2YXIgYXJncyA9IFtudWxsXS5jb25jYXQodmFsdWVzKTtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChjYWxsYmFjaykge1xuICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrLmFwcGx5KHRoaXMsIGFyZ3MpO1xuICAgICAgICB9O1xuICAgIH0pO1xuXG4gICAgYXN5bmMud3JhcFN5bmMgPVxuICAgIGFzeW5jLmFzeW5jaWZ5ID0gZnVuY3Rpb24gYXN5bmNpZnkoZnVuYykge1xuICAgICAgICByZXR1cm4gX3Jlc3RQYXJhbShmdW5jdGlvbiAoYXJncykge1xuICAgICAgICAgICAgdmFyIGNhbGxiYWNrID0gYXJncy5wb3AoKTtcbiAgICAgICAgICAgIHZhciByZXN1bHQ7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGZ1bmMuYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gaWYgcmVzdWx0IGlzIFByb21pc2Ugb2JqZWN0XG4gICAgICAgICAgICBpZiAoX2lzT2JqZWN0KHJlc3VsdCkgJiYgdHlwZW9mIHJlc3VsdC50aGVuID09PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgICAgICByZXN1bHQudGhlbihmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhudWxsLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgfSlbXCJjYXRjaFwiXShmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soZXJyLm1lc3NhZ2UgPyBlcnIgOiBuZXcgRXJyb3IoZXJyKSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKG51bGwsIHJlc3VsdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICAvLyBOb2RlLmpzXG4gICAgaWYgKHR5cGVvZiBtb2R1bGUgPT09ICdvYmplY3QnICYmIG1vZH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OT05fQVNDSUlfTElORV9CUkVBS1MgPSAvW1xceDg1XFx1MjAyOFxcdTIwMjldLztcbnZhciBQQVRURVJOX0ZMT1dfSU5ESUNBVE9SUyAgICAgICA9IC9bLFxcW1xcXVxce1xcfV0vO1xudmFyIFBBVFRFUk5fVEFHX0hBTkRMRSAgICAgICAgICAgID0gL14oPzohfCEhfCFbYS16XFwtXSshKSQvaTtcbnZhciBQQVRURVJOX1RBR19VUkkgICAgICAgICAgICAgICA9IC9eKD86IXxbXixcXFtcXF1cXHtcXH1dKSg/OiVbMC05YS1mXXsyfXxbMC05YS16XFwtIztcXC9cXD86QCY9XFwrXFwkLF9cXC4hflxcKidcXChcXClcXFtcXF1dKSokL2k7XG5cblxuZnVuY3Rpb24gaXNfRU9MKGMpIHtcbiAgcmV0dXJuIChjID09PSAweDBBLyogTEYgKi8pIHx8IChjID09PSAweDBELyogQ1IgKi8pO1xufVxuXG5mdW5jdGlvbiBpc19XSElURV9TUEFDRShjKSB7XG4gIHJldHVybiAoYyA9PT0gMHgwOS8qIFRhYiAqLykgfHwgKGMgPT09IDB4MjAvKiBTcGFjZSAqLyk7XG59XG5cbmZ1bmN0aW9uIGlzX1dTX09SX0VPTChjKSB7XG4gIHJldHVybiAoYyA9PT0gMHgwOS8qIFRhYiAqLykgfHxcbiAgICAgICAgIChjID09PSAweDIwLyogU3BhY2UgKi8pIHx8XG4gICAgICAgICAoYyA9PT0gMHgwQS8qIExGICovKSB8fFxuICAgICAgICAgKGMgPT09IDB4MEQvKiBDUiAqLyk7XG59XG5cbmZ1bmN0aW9uIGlzX0ZMT1dfSU5ESUNBVE9SKGMpIHtcbiAgcmV0dXJuIDB4MkMvKiAsICovID09PSBjIHx8XG4gICAgICAgICAweDVCLyogWyAqLyA9PT0gYyB8fFxuICAgICAgICAgMHg1RC8qIF0gKi8gPT09IGMgfHxcbiAgICAgICAgIDB4N0IvKiB7ICovID09PSBjIHx8XG4gICAgICAgICAweDdELyogfSAqLyA9PT0gYztcbn1c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weDZFLyogbiAqLykgPyAnXFx4MEEnIDpcbiAgICAgICAgKGMgPT09IDB4NzYvKiB2ICovKSA/ICdcXHgwQicgOlxuICAgICAgICAoYyA9PT0gMHg2Ni8qIGYgKi8pID8gJ1xceDBDJyA6XG4gICAgICAgIChjID09PSAweDcyLyogciAqLykgPyAnXFx4MEQnIDpcbiAgICAgICAgKGMgPT09IDB4NjUvKiBlICovKSA/ICdcXHgxQicgOlxuICAgICAgICAoYyA9PT0gMHgyMC8qIFNwYWNlICovKSA/ICcgJyA6XG4gICAgICAgIChjID09PSAweDIyLyogXCIgKi8pID8gJ1xceDIyJyA6XG4gICAgICAgIChjID09PSAweDJGLyogLyAqLykgPyAnLycgOlxuICAgICAgICAoYyA9PT0gMHg1Qy8qIFxcICovKSA/ICdcXHg1QycgOlxuICAgICAgICAoYyA9PT0gMHg0RS8qIE4gKi8pID8gJ1xceDg1JyA6XG4gICAgICAgIChjID09PSAweDVGLyogXyAqLykgPyAnXFx4QTAnIDpcbiAgICAgICAgKGMgPT09IDB4NEMvKiBMICovKSA/ICdcXHUyMDI4JyA6XG4gICAgICAgIChjID09PSAweDUwLyogUCAqLykgPyAnXFx1MjAyOScgOiAnJztcbn1cblxuZnVuY3Rpb24gY2hhckZyb21Db2RlcG9pbnQoYykge1xuICBpZiAoYyA8PSAweEZGRkYpIHtcbiAgICByZXR1cm4gU3RyaW5nLmZyb21DaGFyQ29kZShjKTtcbiAgfVxuICAvLyBFbmNvZGUgVVRGLTE2IHN1cnJvZ2F0ZSBwYWlyXG4gIC8vIGh0dHBzOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL1VURi0xNiNDb2RlX3BvaW50c19VLjJCMDEwMDAwX3RvX1UuMkIxMEZGRkZcbiAgcmV0dXJuIFN0cmluZy5mcm9tQ2hhckNvZGUoKChjIC0gMHgwMTAwMDApID4+IDEwKSArIDB4RDgwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjIC0gMHgwMTAwMDApICYgMHg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ICAgICAgZm9yICg7IGluZGV4IDwgbWF4OyBpbmRleCsrKSB7XG4gICAgICAgIGNoID0gZGF0YVtpbmRleF07XG4gICAgICAgIGlmIChjaCA9PT0gJ18nKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgIGlmIChjaCAhPT0gJzAnICYmIGNoICE9PSAnMScpIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgaGFzRGlnaXRzID0gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBoYXNEaWdpdHM7XG4gICAgfVxuXG5cbiAgICBpZiAoY2ggPT09ICd4Jykge1xuICAgICAgLy8gYmFzZSAxNlxuICAgICAgaW5kZXgrKztcblxuICAgICAgZm9yICg7IGluZGV4IDwgbWF4OyBpbmRleCsrKSB7XG4gICAgICAgIGNoID0gZGF0YVtpbmRleF07XG4gICAgICAgIGlmIChjaCA9PT0gJ18nKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgIGlmICghaXNIZXhDb2RlKGRhdGEuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGhhc0RpZ2l0cyA9IHRydWU7XG4gICAgICB9XG4gICAgICByZXR1cm4gaGFzRGlnaXRzO1xuICAgIH1cblxuICAgIC8vIGJhc2UgOFxuICAgIGZvciAoOyBpbmRleCA8IG1heDsgaW5kZXgrKykge1xuICAgICAgY2ggPSBkYXRhW2luZGV4XTtcbiAgICAgIGlmIChjaCA9PT0gJ18nKSB7IGNvbnRpbnVlOyB9XG4gICAgICBpZiAoIWlzT2N0Q29kZShkYXRhLmNoYXJDb2RlQXQoaW5kZXgpKSkge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9XG4gICAgICBoYXNEaWdpdHMgPSB0cnVlO1xuICAgIH1cbiAgICByZXR1cm4gaGFzRGlnaXRzO1xuICB9XG5cbiAgLy8gYmFzZSAxMCAoZXh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JldHVybiAwO1xuICB9XG5cbiAgaWYgKGNoID09PSAnMCcpIHtcbiAgICBpZiAodmFsdWVbMV0gPT09ICdiJykge1xuICAgICAgcmV0dXJuIHNpZ24gKiBwYXJzZUludCh2YWx1ZS5zbGljZSgyKSwgMik7XG4gICAgfVxuICAgIGlmICh2YWx1ZVsxXSA9PT0gJ3gnKSB7XG4gICAgICByZXR1cm4gc2lnbiAqIHBhcnNlSW50KHZhbHVlLCAxNik7XG4gICAgfVxuICAgIHJldHVybiBzaWduICogcGFyc2VJbnQodmFsdWUsIDgpO1xuXG4gIH1cblxuICBpZiAodmFsdWUuaW5kZXhPZignOicpICE9PSAtMSkge1xuICAgIHZhbHVlLnNwbGl0KCc6JykuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgZGlnaXRzLnVuc2hpZnQocGFyc2VJbnQodiwgMTApKTtcbiAgICB9KTtcblxuICAgIHZhbHVlID0gMDtcbiAgICBiYXNlID0gMTtcblxuICAgIGRpZ2l0cy5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICB2YWx1ZSArPSAoZCAqIGJhc2UpO1xuICAgICAgYmFzZSAqPSA2MDtcbiAgICB9KTtcblxuICAgIHJldHVybiBzaWduICogdmFsdWU7XG5cbiAgfVxuXG4gIHJldHVybiBzaWduICogcGFyc2VJbnQodmFsdWUsIDEwKTtcbn1cblxuZnVuY3Rpb24gaXNJbnRlZ2VyKG9iamVjdCkge1xuICByZXR1cm4gKCdbb2JqZWN0IE51bWJlcl0nID09PSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqZWN0KSkgJiZcbiAgICAgICAgICgwID09PSBvYmplY3QgJSAxICYmICFjb21tb24uaXNOZWdhdGl2ZVplcm8ob2JqZWN0KSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gbmV3IFR5cGUoJ3RhZzp5YW1sLm9yZywyMDAyOmludCcsIHtcbiAga2luZDogJ3NjYWxhcicsXG4gIHJlc29sdmU6I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lwZSgndGFnOnlhbWwub3JnLDIwMDI6c2V0Jywge1xuICBraW5kOiAnbWFwcGluZycsXG4gIHJlc29sdmU6IHJlc29sdmVZYW1sU2V0LFxuICBjb25zdHJ1Y3Q6IGNvbnN0cnVjdFlhbWxTZXRcbn0pO1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG52YXIgVHlwZSA9IHJlcXVpcmUoJy4uL3R5cGUnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBuZXcgVHlwZSgndGFnOnlhbWwub3JnLDIwMDI6c3RyJywge1xuICBraW5kOiAnc2NhbGFyJyxcbiAgY29uc3RydWN0OiBmdW5jdGlvbiAoZGF0YSkgeyByZXR1cm4gbnVsbCAhPT0gZGF0YSA/IGRhdGEgOiAnJzsgfVxufSk7XG4iLCIndXNlIHN0cmljdCc7XG5cbnZhciBUeXBlID0gcmVxdWlyZSgnLi4vdHlwZScpO1xuXG52YXIgWUFNTF9USU1FU1RBTVBfUkVHRVhQID0gbmV3IFJlZ0V4cChcbiAgJ14oWzAtOV1bMC05XVswLTldWzAtOV0pJyAgICAgICAgICArIC8vIFsxXSB5ZWFyXG4gICctKFswLTldWzAtOV0/KScgICAgICAgICAgICAgICAgICAgKyAvLyBbMl0gbW9udGhcbiAgJy0oWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICArIC8vIFszXSBkYXlcbiAgJyg/Oig/OltUdF18WyBcXFxcdF0rKScgICAgICAgICAgICAgICsgLy8gLi4uXG4gICcoWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICAgKyAvLyBbNF0gaG91clxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzVdIG1pbnV0ZVxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzZdIHNlY29uZFxuICAnKD86XFxcXC4oWzAtOV0qKSk/JyAgICAgICAgICAgICAgICAgKyAvLyBbN10gZnJhY3Rpb25cbiAgJyg/OlsgXFxcXHRdK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5pbmRpcmVjdCA9IGluZGlyZWN0O1xuXG4gICAgICAvLyBPbmx5IHByb2Nlc3Mgbm9uLWNpcmN1bGFyIHJlZmVyZW5jZXMgZnVydGhlclxuICAgICAgaWYgKHBhcmVudEluZGV4ID09PSAtMSkge1xuICAgICAgICBpZiAocmVtb3RlVHlwZXMuaW5kZXhPZihyZWZEZXRhaWxzLnR5cGUpID4gLTEpIHtcbiAgICAgICAgICBhbGxUYXNrcyA9IGFsbFRhc2tzXG4gICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBnZXRSZW1vdGVEb2N1bWVudChsb2NhdGlvbiwgb3B0aW9ucylcbiAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoZG9jKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gcHJvY2Vzc1N1YkRvY3VtZW50KCdyZW1vdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVHlwZShyZWZEZXRhaWxzLnVyaURldGFpbHMuZnJhZ21lbnQsICdVbmRlZmluZWQnKSA/XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW10gOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhGcm9tUHRyKGRlY29kZVVSSShyZWZEZXRhaWxzLnVyaURldGFpbHMuZnJhZ21lbnQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmRGV0YWlscyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50cy5jb25jYXQobG9jYXRpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRQdHJzLmNvbmNhdChyZWZGdWxsUHRyKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsUmVmcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kaXJlY3QpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLmNhdGNoKGZ1bmN0aW9uIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgIHJlZkRldGFpbHMuZXJyb3IgPSBlcnIubWVzc2FnZTtcbiAgICAgICAgICAgICAgICAgIHJlZkRldGFpbHMubWlzc2luZyA9IHRydWU7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAocmVmRnVsbFB0ci5pbmRleE9mKGxvY2F0aW9uICsgJy8nKSAhPT0gMCAmJiByZWZGdWxsUHRyICE9PSBsb2NhdGlvbiAmJlxuICAgICAgICAgICAgICBzdWJEb2NQdHIuaW5kZXhPZihsb2NhdGlvbiArICcvJykgIT09IDAgJiYgc3ViRG9jUHRyICE9PSBsb2NhdGlvbikge1xuICAgICAgICAgICAgaWYgKGxvY2F0aW9uLmluZGV4T2Yoc3ViRG9jUHRyICsgJy8nKSAhPT0gMCkge1xuICAgICAgICAgICAgICBhbGxUYXNrcyA9IGFsbFRhc2tzXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIHByb2Nlc3NTdWJEb2N1bWVudCgnbG9jYWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmosXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhGcm9tUHRyKGxvY2F0aW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmRGV0YWlscyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50cy5jb25jYXQobG9jYXRpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRQdHJzLmNvbmNhdChyZWZGdWxsUHRyKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsUmVmcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kaXJlY3QgfHwgKGxvY2F0aW9uLmluZGV4T2Yoc3ViRG9jUHRyICsgJy8nKSA9PT0gLTEgJiYgbG9jYXRpb24gIT09IHN1YkRvY1B0cikpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZWZEZXRhaWxzLmNpcmN1bGFyID0gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vIE1hcmsgc2VlbiBhbmNlc3RvcnMgYXMgY2lyY3VsYXJcbiAgICAgICAgcGFyZW50UHRycy5zbGljZShwYXJlbnRJbmRleCkuZm9yRWFjaChmdW5jdGlvbiAocGFyZW50UHRyKSB7XG4gICAgICAgICAgYWxsUmVmcy5yZWZzW3BhcmVudFB0cl0uY2lyY3VsYXIgPSB0cnVlO1xuICAgICAgICB9KTtcblxuICAgICAgICByZWZEZXRhaWxzLmNpcmN1bGFyID0gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xuXG4gIGFsbFRhc2tzID0gYWxsVGFza3NcbiAgICAudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICByZXR1cm4gYWxsUmVmcztcbiAgICB9KTtcblxuICByZXR1cm4gY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XNzYXJ5XG4gICAgICAgICAgIGlmICghaXNUeXBlKG9wdGlvbnMucmVmUHJlUHJvY2Vzc29yLCAnVW5kZWZpbmVkJykpIHtcbiAgICAgICAgICAgICBub2RlID0gb3B0aW9ucy5yZWZQcmVQcm9jZXNzb3IoY2xvbmUobm9kZSksIHBhdGgpO1xuICAgICAgICAgICB9XG5cbiAgICAgICAgICAgcmVmRGV0YWlscyA9IGdldFJlZkRldGFpbHMobm9kZSk7XG5cbiAgICAgICAgICAgLy8gUG9zdC1wcm9jZXNzIHRoZSByZWZlcmVuY2UgZGV0YWlsc1xuICAgICAgICAgICBpZiAoIWlzVHlwZShvcHRpb25zLnJlZlBvc3RQcm9jZXNzb3IsICdVbmRlZmluZWQnKSkge1xuICAgICAgICAgICAgIHJlZkRldGFpbHMgPSBvcHRpb25zLnJlZlBvc3RQcm9jZXNzb3IocmVmRGV0YWlscywgcGF0aCk7XG4gICAgICAgICAgIH1cblxuICAgICAgICAgICBpZiAob3B0aW9ucy5maWx0ZXIocmVmRGV0YWlscywgcGF0aCkpIHtcbiAgICAgICAgICAgICByZWZzW3BhdGhUb1B0cihwYXRoKV0gPSByZWZEZXRhaWxzO1xuICAgICAgICAgICB9XG5cbiAgICAgICAgICAgLy8gV2hlbmV2ZXIgYSBKU09OIFJlZmVyZW5jZSBoYXMgZXh0cmEgY2hpbGRyZW4sIGl0cyBjaGlsZHJlbiBzaG91bGQgbm90IGJlIHByb2Nlc3NlZC5cbiAgICAgICAgICAgLy8gICBTZWU6IGh0dHA6Ly90b29scy5pZXRmLm9yZy9odG1sL2RyYWZ0LXBicnlhbi16eXAtanNvbi1yZWYtMDMjc2VjdGlvbi0zXG4gICAgICAgICAgIGlmIChnZXRFeHRyYVJlZktleXMobm9kZSkubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgIHByb2Nlc3NDaGlsZHJlbiA9IGZhbHNlO1xuICAgICAgICAgICB9XG4gICAgICAgICB9XG5cbiAgICAgICAgIHJldHVybiBwcm9jZ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oYW5jZXN0b3JQdHIsIGluZGV4KSB7XG4gICAgICAgICAgaWYgKGlzVHlwZShyZWZEZXRhaWxzLnZhbHVlLCAnVW5kZWZpbmVkJykpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIHJlZkRldGFpbHMudmFsdWUgPSBmaW5kVmFsdWUoYWxsUmVmcy5kb2N1bWVudHNbYW5jZXN0b3JQdHJdLCBwYXRoRnJvbVB0cihyZWZEZXRhaWxzLnVyaSkpO1xuXG4gICAgICAgICAgICAgIC8vIERlbGV0ZSBoZWxwZXIgcHJvcGVydHlcbiAgICAgICAgICAgICAgZGVsZXRlIHJlZkRldGFpbHMuYW5jZXN0b3JQdHJzO1xuXG4gICAgICAgICAgICAgIHNldFZhbHVlKG9iaiwgcGF0aEZyb21QdHIocmVmUHRyKSwgcmVmRGV0YWlscy52YWx1ZSk7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSByZWZEZXRhaWxzLmFuY2VzdG9yUHRycy5sZW5ndGggLSAxKSB7XG4gICAgICAgICAgICAgICAgcmVmRGV0YWlscy5lcnJvciA9IGVyci5tZXNzYWdlO1xuICAgICAgICAgICAgICAgIHJlZkRldGFpbHMubWlzc2luZyA9IHRydWU7XG5cbiAgICAgICAgICAgICAgICAvLyBEZWxldGUgaGVscGVyIHByb3BlcnR5XG4gICAgICAgICAgICAgICAgZGVsZXRlIHJlZkRldGFpbHMuYW5jZXN0b3JQdHJzO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH0pO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICByZWZzOiByZWZzLFxuICAgICAgICByZXNvbHZlZDogb2JqXG4gICAgICB9O1xuICAgIH0pO1xuXG4gIHJldHVybiBhbGxUYXNrcztcbn1cblxuLyoqXG4gKiBSZXNvbHZlcyBKU09OIFJlZmVyZW5j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A9IHMuY2hhckNvZGVBdChpKSArIChzLmNoYXJDb2RlQXQoaSArIDEpIDw8IDgpICsgKHMuY2hhckNvZGVBdChpICsgMikgPDwgMTYpICsgKHMuY2hhckNvZGVBdChpICsgMykgPDwgMjQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtZDVibGtzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1kNWJsa19hcnJheShhKSB7XG4gICAgICAgIHZhciBtZDVibGtzID0gW10sXG4gICAgICAgICAgICBpOyAvKiBBbmR5IEtpbmcgc2FpZCBkbyBpdCB0aGlzIHdheS4gKi9cblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjQ7IGkgKz0gNCkge1xuICAgICAgICAgICAgbWQ1Ymxrc1tpID4+IDJdID0gYVtpXSArIChhW2kgKyAxXSA8PCA4KSArIChhW2kgKyAyXSA8PCAxNikgKyAoYVtpICsgM10gPDwgMjQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtZDVibGtzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1kNTEocykge1xuICAgICAgICB2YXIgbiA9IHMubGVuZ3RoLFxuICAgICAgICAgICAgc3RhdGUgPSBbMTczMjU4NDE5MywgLTI3MTczMzg3OSwgLTE3MzI1ODQxOTQsIDI3MTczMzg3OF0sXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgbGVuZ3RoLFxuICAgICAgICAgICAgdGFpbCxcbiAgICAgICAgICAgIHRtcCxcbiAgICAgICAgICAgIGxvLFxuICAgICAgICAgICAgaGk7XG5cbiAgICAgICAgZm9yIChpID0gNjQ7IGkgPD0gbjsgaSArPSA2NCkge1xuICAgICAgICAgICAgbWQ1Y3ljbGUoc3RhdGUsIG1kNWJsayhzLnN1YnN0cmluZyhpIC0gNjQsIGkpKSk7XG4gICAgICAgIH1cbiAgICAgICAgcyA9IHMuc3Vic3RyaW5nKGkgLSA2NCk7XG4gICAgICAgIGxlbmd0aCA9IHMubGVuZ3RoO1xu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AxKSB7XG4gICAgICAgICAgICB0YWlsW2kgPj4gMl0gfD0gYVtpXSA8PCAoKGkgJSA0KSA8PCAzKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRhaWxbaSA+PiAyXSB8PSAweDgwIDw8ICgoaSAlIDQpIDw8IDMpO1xuICAgICAgICBpZiAoaSA+IDU1KSB7XG4gICAgICAgICAgICBtZDVjeWNsZShzdGF0ZSwgdGFpbCk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkgKz0gMSkge1xuICAgICAgICAgICAgICAgIHRhaWxbaV0gPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmV3YXJlIHRoYXQgdGhlIGZpbmFsIGxlbmd0aCBtaWdodCBub3QgZml0IGluIDMyIGJpdHMgc28gd2UgdGFrZSBjYXJlIG9mIHRoYXRcbiAgICAgICAgdG1wID0gbiAqIDg7XG4gICAgICAgIHRtcCA9IHRtcC50b1N0cmluZygxNikubWF0Y2goLyguKj8pKC57MCw4fSkkLyk7XG4gICAgICAgIGxvID0gcGFyc2VJbnQodG1wWzJdLCAxNik7XG4gICAgICAgIGhpID0gcGFyc2VJbnQodG1wWzFdLCAxNikgfHwgMDtcblxuICAgICAgICB0YWlsWzE0XSA9IGxvO1xuICAgICAgICB0YWlsWzE1XSA9IGhpO1xuXG4gICAgICAgIG1kNWN5Y2xlKHN0YXRlLCB0YWlsKTtcblxuICAgICAgICByZXR1cm4gc3RhdGU7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcmhleChuKSB7XG4gICAgICAgIHZhciBzID0gJycsXG4gICAgICAgICAgICBqO1xuICAgICAgICBmb3IgKGogPSAwOyBqIDwgNDsgaiArPSAxKSB7XG4gICAgICAgICAgICBzICs9IGhleF9jaHJbKG4gPj4gKGogKiA4ICsgNCkpICYgMHgwRl0gKyBoZXhfY2hyWyhuID4+IChqICogOCkpICYgMHgwRl07XG4gICAgICAgIH1cbiAgICAgICAgc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29udmVydGVkU2VjdXJpdHlOYW1lc1tuYW1lXS5wdXNoKG9OYW1lKTtcblxuICAgICAgICBpZiAoZ3ROYW1lID09PSAnaW1wbGljaXQnKSB7XG4gICAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLmZsb3cgPSAnaW1wbGljaXQnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi5mbG93ID0gJ2FjY2Vzc0NvZGUnO1xuICAgICAgICB9XG5cbiAgICAgICAgc3dpdGNoIChndE5hbWUpIHtcbiAgICAgICAgY2FzZSAnaW1wbGljaXQnOlxuICAgICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi5hdXRob3JpemF0aW9uVXJsID0gZ3JhbnRUeXBlLmxvZ2luRW5kcG9pbnQudXJsO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ2F1dGhvcml6YXRpb25fY29kZSc6XG4gICAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLmF1dGhvcml6YXRpb25VcmwgPVxuICAgICAgICAgICAgZ3JhbnRUeXBlLnRva2VuUmVxdWVzdEVuZHBvaW50LnVybDtcbiAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24udG9rZW5VcmwgPSBncmFudFR5cGUudG9rZW5FbmRwb2ludC51cmw7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYXV0aG9yaXphdGlvbi5zY29wZXMpIHtcbiAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24uc2NvcGVzID0ge307XG5cbiAgICAgICAgICBhdXRob3JpemF0aW9uLnNjb3Blcy5mb3JFYWNoKGZ1bmN0aW9uKHNjb3BlKSB7XG4gICAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24uc2NvcGVzW3Njb3BlLnNjb3BlXSA9IHNjb3BlLmRlc2NyaXB0aW9uIHx8XG4gICAgICAgICAgICAgICgnVW5kZXNjcmliZWQgJyArIHNj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gICAgICAgICBkc3Rba2V5XSA9IGNsb25lKHNyY1trZXldKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBwYXJlbnRzLnBvcCgpO1xuICAgICAgICAgICAgbm9kZXMucG9wKCk7XG4gICAgICAgICAgICByZXR1cm4gZHN0O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHNyYztcbiAgICAgICAgfVxuICAgIH0pKHRoaXMudmFsdWUpO1xufTtcblxuZnVuY3Rpb24gd2FsayAocm9vdCwgY2IsIGltbXV0YWJsZSkge1xuICAgIHZhciBwYXRoID0gW107XG4gICAgdmFyIHBhcmVudHMgPSBbXTtcbiAgICB2YXIgYWxpdmUgPSB0cnVlO1xuICAgIFxuICAgIHJldHVybiAoZnVuY3Rpb24gd2Fsa2VyIChub2RlXykge1xuICAgICAgICB2YXIgbm9kZSA9IGltbXV0YWJsZSA/IGNvcHkobm9kZV8pIDogbm9kZV87XG4gICAgICAgIHZhciBtb2RpZmllcnMgPSB7fTtcbiAgICAgICAgXG4gICAgICAgIHZhciBrZWVwR29pbmcgPSB0cnVlO1xuICAgICAgICBcbiAgICAgICAgdmFyIHN0YXRlID0ge1xuICAgICAgICAgICAgbm9kZSA6IG5vZGUsXG4gICAgICAgICAgICBub2RlXyA6IG5vZGVfLFxuICAgICAgICAgICAgcGF0aCA6IFtdLmNvbmNhdChwYXRoKSxcbiAgICAgICAgICAgIHBhcmVudCA6IHBhcmVudHNbcGFyZW50cy5sZW5ndGggLSAxXSxcbiAgICAgICAgICAgIHBhcmVudHMgOiBwYXJlbnRzLFxuICAgICAgICAgICAga2V5IDogcGF0aC5zbGljZSgtMSlbMF0sXG4gICAgICAgICAgICBpc1Jvb3QgOiBwYXRoLmxlbmd0aCA9PT0gMCxcbiAgICAgICAgICAgIGxldmVsIDogcGF0aC5sZW5ndGgsXG4gICAgICAgICAgICBjaXJjdWxhciA6IG51bGwsXG4gICAgICAgICAgICB1cGRhdGUgOiBmdW5jdGlvbiAoeCwgc3RvcEhlcmUpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXN0YXRlLmlzUm9vdCkge1xuICAgICAgICAgICAgICAgICAgICBzdGF0ZS5wYXJlbnQubm9kZVtzdGF0ZS5rZXldID0geDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3RhdGUubm9kZSA9IHg7XG4gICAgICAgICAgICAgICAgaWYgKHN0b3BIZXJlKSBrZWVwR29pbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZGVsZXRlJyA6IGZ1bmN0aW9uIChzdG9wSGVyZSkge1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBzdGF0ZS5wYXJlbnQubm9kZVtzdGF0ZS5rZXldO1xuICAgICAgICAgICAgICAgIGlmIChzdG9wSGVyZSkga2VlcEdvaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVtb3ZlIDogZnVuY3Rpb24gKHN0b3BIZXJlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzQXJyYXkoc3RhdGUucGFyZW50Lm5vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0YXRlLnBhcmVudC5ub2RlLnNwbGljZShzdGF0ZS5rZXksIDEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHN0YXRlLnBhcmVudC5ub2RlW3N0YXRlLmtleV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzdG9wSGVyZSkga2VlcEdvaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAga2V5cyA6IG51bGwsXG4gICAgICAgICAgICBiZWZvcmUgOiBmdW5jdGlvbiAoZikgeyBtb2RpZmllcnMuYmVmb3JlID0gZiB9LFxuICAgICAgICAgICAgYWZ0ZXIgOiBmdW5jdGlvbiAoZikgeyBtb2RpZmllcnMuYWZ0ZXIgPSBmIH0sXG4gICAgICAgICAgICBwcmUgOiBmdW5jdGlvbiAoZikgeyBtb2RpZmllcnMucHJlID0gZiB9LFxuICAgICAgICAgICAgcG9zdCA6IGZ1bmN0aW9uIChmKSB7IG1vZGlmaWVycy5wb3N0ID0gZiB9LFxuICAgICAgICAgICAgc3RvcCA6IGZ1bmN0aW9uICgpIHsgYWxpdmUgPSBmYWxzZSB9LFxuICAgICAgICAgICAgYmxvY2sgOiBmdW5jdGlvbiAoKSB7IGtlZXBHb2luZyA9IGZhbHNlIH1cbiAgICAgICAgfTtcbiAgICAgICAgXG4gICAgICAgIGlmICghYWxpdmUpIHJldHVybiBzdGF0ZTtcbiAgICAgICAgXG4gICAgICAgIGZ1bmN0aW9uIHVwZGF0ZVN0YXRlKCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBzdGF0ZS5ub2RlID09PSAnb2JqZWN0JyAmJiBzdGF0ZS5ub2RlICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFzdGF0ZS5rZXlzIHx8IHN0YXRlLm5vZGVfICE9PSBzdGF0ZS5ub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0YXRlLmtleXMgPSBvYmplY3RLZXlzKHN0YXRlLm5vZGUpXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgIHN0YXRlLmlzTGVhZiA9IHN0YXRlLmtleXMubGVuZ3RoID09IDA7XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwYXJlbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnRzW2ldLm5vZGVfID09PSBub2RlXykge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUuY2lyY3VsYXIgPSBwYXJlbnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBzdGF0ZS5pc0xlYWYgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHN0YXRlLmtleXMgPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgXG4gICAgICAgICAgICBzdGF0ZS5ub3RMZWFmID0gIXN0YXRlLmlzTGVhZjtcbiAgICAgICAgICAgIHN0YXRlLm5vdFJvb3QgPSAhc3RhdGUuaXNSb290O1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICB1cGRhdGVTdGF0ZSgpO1xuICAgICAgICBcbiAgICAgICAgLy8gdXNlIHJldHVybiB2YWx1ZXMgdG8gdXBkYXRlIGlmIGRlZmluZWRcbiAgICAgICAgdmFyIHJldCA9IGNiLmNhbGwoc3RhdGUsIHN0YXRlLm5vZGUpO1xuICAgICAgICBpZiAocmV0ICE9PSB1bmRlZmluZWQgJiYgc3RhdGUudXBkYXRlKSBzdGF0ZS51cGRhdGUocmV0KTtcbiAgICAgICAgXG4gICAgICAgIGlmIChtb2RpZmllcnMuYmVmb3JlKSBtb2RpZmllcnMuYmVmb3JlLmNhbGwoc3RhdGUsIHN0YXRlLm5vZGUpO1xuICAgICAgICBcbiAgICAgICAgaWYgKCFrZWVwR29pbmcpIHJldHVybiBzdGF0ZTtcbiAgICAgICAgXG4gICAgICAgIGlmICh0eXBlb2Ygc3RhdGUubm9kZSA9PSAnb2JqZWN0J1xuICAgICAgICAmJiBzdGF0ZS5ub2RlICE9PSBudWxsICYmICFzdGF0ZS5jaXJjdWxhcikge1xuICAgICAgICAgICAgcGFyZW50cy5wdXNoKHN0YXRlKTtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgdXBkYXRlU3RhdGUoKTtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgZm9yRWFjaChzdGF0ZS5rZXlzLCBmdW5jdGlvbiAoa2V5LCBpKSB7XG4gICAgICAgICAgICAgICAgcGF0aC5wdXNoKGtleSk7XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYgKG1vZGlmaWVycy5wcmUpIG1vZGlmaWVycy5wcmUuY2FsbChzdGF0ZSwgc3RhdGUubm9kZVtrZXldLCBrZXkpO1xuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgIHZhciBjaGlsZCA9IHdhbGtlcihzdGF0ZS5ub2RlW2tleV0pO1xuICAgICAgICAgICAgICAgIGlmIChpbW11dGFibGUgJiYgaGFzT3duUHJvcGVydHkuY2FsbChzdGF0ZS5ub2RlLCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0YXRlLm5vZGVba2V5XSA9IGNoaWxkLm5vZGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgIGNoaWxkLmlzTGFzdCA9IGkgPT0gc3RhdGUua2V5cy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgIGNoaWxkLmlzRmlyc3QgPSBpID09IDA7XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYgKG1vZGlmaWVycy5wb3N0KSBtb2RpZmllcnMucG9zdC5jYWxsKHN0YXRlLCBjaGlsZCk7XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgcGF0aC5wb3AoKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcGFyZW50cy5wb3AoKTtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgaWYgKG1vZGlmaWVycy5hZnRlcikgbW9kaWZpZXJzLmFmdGVyLmNhbGwoc3RhdGUsIHN0YXRlLm5vZGUpO1xuICAgICAgICBcbiAgICAgICAgcmV0dXJuIHN0YXRlO1xuICAgIH0pKHJvb3QpLm5vZGU7XG59XG5cbmZ1bmN0aW9uIGNvcHkgKHNyYykge1xuICAgIGlmICh0eXBlb2Ygc3JjID09PSAnb2JqZWN0JyAmJiBzcmMgIT09IG51bGwpIHtcbiAgICAgICAgdmFyIGRzdDtcbiAgICAgICAgXG4gICAgICAgIGlmIChpc0FycmF5KHNyYykpIHtcbiAgICAgICAgICAgIGRzdCA9IFtdO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGlzRGF0ZShzcmMpKSB7XG4gICAgICAgICAgICBkc3QgPSBuZXcgRGF0ZShzcmMuZ2V0VGltZSA/IHNyYy5nZXRUaW1lKCkgOiBzcmMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGlzUmVnRXhwKHNyYykpIHtcbiAgICAgICAgICAgIGRzdCA9IG5ldyBSZWdFeHAoc3JjKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpc0Vycm9yKHNyYykpIHtcbiAgICAgICAgICAgIGRzdCA9IHsgbWVzc2FnZTogc3JjLm1lc3NhZ2UgfTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpc0Jvb2xlYW4oc3JjKSkge1xuICAgICAgICAgICAgZHN0ID0gbmV3IEJvb2xlYW4oc3JjKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpc051bWJlcihzcmMpKSB7XG4gICAgICAgICAgICBkc3QgPSBuZXcgTnVtYmVyKHNyYyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoaXNTdHJpbmcoc3JjKSkge1xuICAgICAgICAgICAgZHN0ID0gbmV3IFN0cmluZyhzcmMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKE9iamVjdC5jcmVhdGUgJiYgT2JqZWN0LmdldFByb3RvdHlwZU9mKSB7XG4gICAgICAgICAgICBkc3QgPSBPYmplY3QuY3JlYXRlKE9iamVjdC5nZXRQcm90b3R5cGVPZihzcmMpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChzcmMuY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xuICAgICAgICAgICAgZHN0ID0ge307XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YXIgcHJvdG8gPVxuICAgICAgICAgICAgICAgIChzcmMuY29uc3RydWN0b3IgJiYgc3JjLmNvbnN0cnVjdG9yLnByb3RvdHlwZSlcbiAgICAgICAgICAgICAgICB8fCBzcmMuX19wcm90b19fXG4gICAgICAgICAgICAgICAgfHwge31cbiAgICAgICAgICAgIDtcbiAgICAgICAgICAgIHZhciBUID0gZnVuY3Rpb24gKCkge307XG4gICAgICAgICAgICBULnByb3RvdHlwZSA9IHByb3RvO1xuICAgICAgICAgICAgZHN0ID0gbmV3IFQ7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGZvckVhY2gob2JqZWN0S2V5cyhzcmMpLCBmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICBkc3Rba2V5XSA9IHNyY1trZXldO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIGRzdDtcbiAgICB9XG4gICAgZWxzZSByZXR1cm4gc3JjO1xufVxuXG52YXIgb2JqZWN0S2V5cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMgKG9iaikge1xuICAgIHZhciByZXMgPSBbXTtcbiAgICBmb3IgKHZhciBrZXkgaW4gb2JqKSByZXMucHVzaChrZXkpXG4gICAgcmV0dXJuIHJlcztcbn07XG5cbmZ1bmN0aW9uIHRvUyAob2JqKSB7IHJldHVybiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKSB9XG5mdW5jdGlvbiBpc0RhdGUgKG9iaikgeyByZXR1cm4gdG9TKG9iaikgPT09ICdbb2JqZWN0IERhdGVdJyB9XG5mdW5jdGlvbiBpc1JlZ0V4cCAob2JqKSB7IHJldHVybiB0b1Mob2JqKSA9PT0gJ1tvYmplY3QgUmVnRXhwXScgfVxuZnVuY3Rpb24gaXNFcnJvciAob2JqKSB7IHJldHVybi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bn1cclxuKGZ1bmN0aW9uICgpIHtcclxuICAgIGZ1bmN0aW9uIG1lcmdlKCkge1xyXG4gICAgICAgIHZhciBzZXRzID0gW107XHJcbiAgICAgICAgZm9yICh2YXIgX2kgPSAwOyBfaSA8IGFyZ3VtZW50cy5sZW5ndGg7IF9pKyspIHtcclxuICAgICAgICAgICAgc2V0c1tfaSAtIDBdID0gYXJndW1lbnRzW19pXTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHNldHMubGVuZ3RoID4gMSkge1xyXG4gICAgICAgICAgICBzZXRzWzBdID0gc2V0c1swXS5zbGljZSgwLCAtMSk7XHJcbiAgICAgICAgICAgIHZhciB4bCA9IHNldHMubGVuZ3RoIC0gMTtcclxuICAgICAgICAgICAgZm9yICh2YXIgeCA9IDE7IHggPCB4bDsgKyt4KSB7XHJcbiAgICAgICAgICAgICAgICBzZXRzW3hdID0gc2V0c1t4XS5zbGljZSgxLCAtMSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgc2V0c1t4bF0gPSBzZXRzW3hsXS5zbGljZSgxKTtcclxuICAgICAgICAgICAgcmV0dXJuIHNldHMuam9pbignJyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICByZXR1cm4gc2V0c1swXTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBmdW5jdGlvbiBzdWJleHAoc3RyKSB7XHJcbiAgICAgICAgcmV0dXJuIFwiKD86XCIgKyBzdHIgKyBcIilcIjtcclxuICAgIH1cclxuICAgIHZhciBPID0ge30sIGlzSVJJID0gVVJJLklSSV9TVVBQT1JULCBcclxuICAgIC8vUkZDIDM5ODZcclxuICAgIFVOUkVTRVJWRUQkJCA9IFwiW0EtWmEtejAtOVxcXFwtXFxcXC5cXFxcX1xcXFx+XCIgKyAoaXNJUkkgPyBcIlxcXFx4QTAtXFxcXHUyMDBEXFxcXHUyMDEwLVxcXFx1MjAyOVxcXFx1MjAyRi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5ICYmICFIRklFTERTLnRlc3QoY29tcG9uZW50cy5xdWVyeSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRzLmVycm9yID0gXCJIZWFkZXIgZmllbGRzIGFyZSBpbnZhbGlkXCI7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdmFyIHRvID0gY29tcG9uZW50cy50byA9IChjb21wb25lbnRzLnBhdGggPyBjb21wb25lbnRzLnBhdGguc3BsaXQoXCIsXCIpIDogW10pO1xyXG4gICAgICAgICAgICBjb21wb25lbnRzLnBhdGggPSB1bmRlZmluZWQ7XHJcbiAgICAgICAgICAgIGlmIChjb21wb25lbnRzLnF1ZXJ5KSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgdW5rbm93bkhlYWRlcnMgPSBmYWxzZSwgaGVhZGVycyA9IHt9O1xyXG4gICAgICAgICAgICAgICAgdmFyIGhmaWVsZHMgPSBjb21wb25lbnRzLnF1ZXJ5LnNwbGl0KFwiJlwiKTtcclxuICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwLCB4bCA9IGhmaWVsZHMubGVuZ3RoOyB4IDwgeGw7ICsreCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBoZmllbGQgPSBoZmllbGRzW3hdLnNwbGl0KFwiPVwiKTtcclxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGhmaWVsZFswXSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwidG9cIjpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b0FkZHJzID0gaGZpZWxkWzFdLnNwbGl0KFwiLFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHhfMSA9IDAsIHhsXzEgPSB0b0FkZHJzLmxlbmd0aDsgeF8xIDwgeGxfMTsgKyt4XzEpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0by5wdXNoKHRvQWRkcnNbeF8xXSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcInN1YmplY3RcIjpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuc3ViamVjdCA9IFVSSS51bmVzY2FwZUNvbXBvbmVudChoZmllbGRbMV0sIG9wdGlvbnMpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJib2R5XCI6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRzLmJvZHkgPSBVUkkudW5lc2NhcGVDb21wb25lbnQoaGZpZWxkWzFdLCBvcHRpb25zKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5rbm93bkhlYWRlcnMgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1tVUkkudW5lc2NhcGVDb21wb25lbnQoaGZpZWxkWzBdLCBvcHRpb25zKV0gPSBVUkkudW5lc2NhcGVDb21wb25lbnQoaGZpZWxkWzFdLCBvcHRpb25zKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICh1bmtub3duSGVhZGVycylcclxuICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRzLmhlYWRlcnMgPSBoZWFkZXJzO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbXBvbmVudHMucXVlcnkgPSB1bmRlZmluZWQ7XHJcbiAgICAgICAgICAgIGZvciAodmFyIHggPSAwLCB4bCA9IHRvLmxlbmd0aDsgeCA8IHhsOyArK3gpIHtcclxuICAgICAgICAgICAgICAgIHZhciBhZGRyID0gdG9beF0uc3BsaXQoXCJAXCIpO1xyXG4gICAgICAgICAgICAgICAgYWRkclswXSA9IFVSSS51bmVzY2FwZUNvbXBvbmVudChhZGRyWzBdKTtcclxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcHVueWNvZGUgIT09IFwidW5kZWZpbmVkXCIgJiYgIW9wdGlvbnMudW5pY29kZVN1cHBvcnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2NvbnZlcnQgVW5pY29kZSBJRE4gLT4gQVNDSUkgSUROXHJcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkclsxXSA9IHB1bnljb2RlLnRvQVNDSUkoVVJJLnVuZXNjYXBlQ29tcG9uZW50KGFkZHJbMV0sIG9wdGlvbnMpLnRvTG93ZXJDYXNlKCkpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRzLmVycm9yID0gY29tcG9uZW50cy5lcnJvciB8fCBcIkVtYWlsIGFkZHJlc3MncyBkb21haW4gbmFtZSBjYW4gbm90IGJlIGNvbnZlcnRlZCB0byBBU0NJSSB2aWEgcHVueWNvZGU6IFwiICsgZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBhZGRyWzFdID0gVVJJLnVuZXNjYXBlQ29tcG9uZW50KGFkZHJbMV0sIG9wdGlvbnMpLnRvTG93ZXJDYXNlKCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0b1t4XSA9IGFkZHIuam9pbihcIkBcIik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGNvbXBvbmVudHM7XHJcbiAgICAgICAgfSxcclxuICAgICAgICBzZXJpYWxpemU6IGZ1bmN0aW9uIChjb21wb25lbnRzLCBvcHRpb25zKSB7XHJcbiAgICAgICAgICAgIHZhciB0byA9IHRvQXJyYXkoY29tcG9uZW50cy50byk7XHJcbiAgICAgICAgICAgIGlmICh0bykge1xyXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgeCA9IDAsIHhsID0gdG8ubGVuZ3RoOyB4IDwgeGw7ICsreCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciB0b0FkZHIgPSBTdHJpbmcodG9beF0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBhdElkeCA9IHRvQWRkci5sYXN0SW5kZXhPZihcIkBcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxvY2FsUGFydCA9IHRvQWRkci5zbGljZSgwLCBhdElkeCk7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRvbWFpbiA9IHRvQWRkci5zbGljZShhdElkeCArIDEpO1xyXG4gICAgICAgICAgICAgICAgICAgIGxvY2FsUGFydCA9IGxvY2FsUGFydC5yZXBsYWNlKFBDVF9FTkNPREVELCBkZWNvZGVVbnJlc2VydmVkKS5yZXBsYWNlKFBDVF9FTkNPREVELCB0b1VwcGVyQ2FzZSkucmVwbGFjZShOT1RfTE9DQUxfUEFSVCwgVVJJLnBjdEVuY0NoYXIpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcHVueWNvZGUgIT09IFwidW5kZWZpbmVkXCIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9jb252ZXJ0IElETiB2aWEgcHVueWNvZGVcclxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbWFpbiA9ICghb3B0aW9ucy5pcmkgPyBwdW55Y29kZS50b0FTQ0lJKFVSSS51bmVzY2FwZUNvbXBvbmVudChkb21haW4sIG9wdGlvbnMpLnRvTG93ZXJDYXNlKCkpIDogcHVueWNvZGUudG9Vbmljb2RlKGRvbWFpbikpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRzLmVycm9yID0gY29tcG9uZW50cy5lcnJvciB8fCBcIkVtYWlsIGFkZHJlc3MncyBkb21haW4gbmFtZSBjYW4gbm90IGJlIGNvbnZlcnRlZCB0byBcIiArICghb3B0aW9ucy5pcmkgPyBcIkFTQ0lJXCIgOiBcIlVuaWNvZGVcIikgKyBcIiB2aWEgcHVueWNvZGU6IFwiICsgZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZG9tYWluID0gZG9tYWluLnJlcGxhY2UoUENUX0VOQ09ERUQsIGRlY29kZVVucmVzZXJ2ZWQpLnRvTG93ZXJDYXNlKCkucmVwbGFjZShQQ1RfRU5DT0RFRCwgdG9VcHBlckNhc2UpLnJlcGxhY2UoTk9UX0RPTUFJTiwgVVJJLnBjdEVuY0NoYXIpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB0b1t4XSA9IGxvY2FsUGFydCArIFwiQFwiICsgZG9tYWluO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5wYXRoID0gdG8uam9pbihcIixcIik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdmFyIGhlYWRlcnMgPSBjb21wb25lbnRzLmhlYWRlcnMgPSBjb21wb25lbnRzLmhlYWRlcnMgfHwge307XHJcbiAgICAgICAgICAgIGlmIChjb21wb25lbnRzLnN1YmplY3QpXHJcbiAgICAgICAgICAgICAgICBoZWFkZXJzW1wic3ViamVjdFwiXSA9IGNvbXBvbmVudHMuc3ViamVjdDtcclxuICAgICAgICAgICAgaWYgKGNvbXBvbmVudHMuYm9keSlcclxuICAgICAgICAgICAgICAgIGhlYWRlcnNbXCJib2R5XCJdID0gY29tcG9uZW50cy5ib2R5O1xyXG4gICAgICAgICAgICB2YXIgZmllbGRzID0gW107XHJcbiAgICAgICAgICAgIGZvciAodmFyIG5hbWVfMSBpbiBoZWFkZXJzKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaGVhZGVyc1tuYW1lXzFdICE9PSBPW25hbWVfMV0pIHtcclxuICAgICAgICAgICAgICAgICAgICBmaWVsZHMucHVzaChuYW1lXzEucmVwbGFjZShQQ1RfRU5DT0RFRCwgZGVjb2RlVW5yZXNlcnZlZCkucmVwbGFjZShQQ1RfRU5DT0RFRCwgdG9VcHBlckNhc2UpLnJlcGxhY2UoTk9UX0hGTkFNRSwgVVJJLnBjdEVuY0NoYXIpICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgXCI9XCIgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzW25hbWVfMV0ucmVwbGFjZShQQ1RfRU5DT0RFRCwgZGVjb2RlVW5yZXNlcnZlZCkucmVwbGFjZShQQ1RfRU5DT0RFRCwgdG9VcHBlckNhc2UpLnJlcGxhY2UoTk9UX0hGVkFMVUUsIFVSSS5wY3RFbmNDaGFyKSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGZpZWxkcy5sZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucXVlcnkgPSBmaWVsZHMuam9pbihcIiZcIik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGNvbXBvbmVudHM7XHJcbiAgICAgICAgfVxyX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XC1bMC05QS1GYS1mXXs0fSl7M31cXC1bMC05QS1GYS1mXXsxMn0kLztcclxuICAgIC8vUkZDIDIxNDFcclxuICAgIFVSSS5TQ0hFTUVTW1widXJuXCJdID0ge1xyXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoY29tcG9uZW50cywgb3B0aW9ucykge1xyXG4gICAgICAgICAgICB2YXIgbWF0Y2hlcyA9IGNvbXBvbmVudHMucGF0aC5tYXRjaChVUk5fUEFUSCksIHNjaGVtZSwgc2NoZW1lSGFuZGxlcjtcclxuICAgICAgICAgICAgaWYgKCFtYXRjaGVzKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIW9wdGlvbnMudG9sZXJhbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRzLmVycm9yID0gY29tcG9uZW50cy5lcnJvciB8fCBcIlVSTiBpcyBub3Qgc3RyaWN0bHkgdmFsaWQuXCI7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBtYXRjaGVzID0gY29tcG9uZW50cy5wYXRoLm1hdGNoKFVSTl9QQVJTRSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKG1hdGNoZXMpIHtcclxuICAgICAgICAgICAgICAgIHNjaGVtZSA9IFwidXJuOlwiICsgbWF0Y2hlc1sxXS50b0xvd2VyQ2FzZSgpO1xyXG4gICAgICAgICAgICAgICAgc2NoZW1lSGFuZGxlciA9IFVSSS5TQ0hFTUVTW3NjaGVtZV07XHJcbiAgICAgICAgICAgICAgICAvL2luIG9yZGVyIHRvIHNlcmlhbGl6ZSBwcm9wZXJseSwgXHJcbiAgICAgICAgICAgICAgICAvL2V2ZXJ5IFVSTiBtdXN0IGhhdmUgYSBzZXJpYWxpemVyIHRoYXQgY2FsbHMgdGhlIFVSTiBzZXJpYWxpemVyIFxyXG4gICAgICAgICAgICAgICAgaWYgKCFzY2hlbWVIYW5kbGVyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9jcmVhdGUgZmFrZSBzY2hlbWUgaGFuZGxlclxyXG4gICAgICAgICAgICAgICAgICAgIHNjaGVtZUhhbmRsZXIgPSBVUkkuU0NIRU1FU1tzY2hlbWVdID0ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGNvbXBvbmVudHMsIG9wdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb21wb25lbnRzO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemU6IFVSSS5TQ0hFTUVTW1widXJuXCJdLnNlcmlhbGl6ZVxyXG4gICAgICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnNjaGVtZSA9IHNjaGVtZTtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucGF0aCA9IG1hdGNoZXNbMl07XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzID0gc2NoZW1lSGFuZGxlci5wYXJzZShjb21wb25lbnRzLCBvcHRpb25zKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuZXJyb3IgPSBjb21wb25lbnRzLmVycm9yIHx8IFwiVVJOIGNhbiBub3QgYmUgcGFyc2VkLlwiO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBjb21wb25lbnRzO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgc2VyaWFsaXplOiBmdW5jdGlvbiAoY29tcG9uZW50cywgb3B0aW9ucykge1xyXG4gICAgICAgICAgICB2YXIgc2NoZW1lID0gY29tcG9uZW50cy5zY2hlbWUgfHwgb3B0aW9ucy5zY2hlbWUsIG1hdGNoZXM7XHJcbiAgICAgICAgICAgIGlmIChzY2hlbWUgJiYgc2NoZW1lICE9PSBcInVyblwiKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgbWF0Y2hlcyA9IHNjaGVtZS5tYXRjaChVUk5fU0NIRU1FKTtcclxuICAgICAgICAgICAgICAgIGlmICghbWF0Y2hlcykge1xyXG4gICAgICAgICAgICAgICAgICAgIG1hdGNoZXMgPSBbXCJ1cm46XCIgKyBzY2hlbWUsIHNjaGVtZV07XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnNjaGVtZSA9IFwidXJuXCI7XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnBhdGggPSBtYXRjaGVzWzFdICsgXCI6XCIgKyAoY29tcG9uZW50cy5wYXRoID8gY29tcG9uZW50cy5wYXRoLnJlcGxhY2UoVVJOX0VYQ0xVREVELCBwY3RFbmNDaGFyKSA6IFwiXCIpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBjb21wb25lbnRzO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICAvL1JGQyA0MTIyXHJcbiAgICBVUkkuU0NIRU1FU1tcInVybjp1dWlkXCJdID0ge1xyXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoY29tcG9uZW50cywgb3B0aW9ucykge1xyXG4gICAgICAgICAgICBpZiAoIW9wdGlvbnMudG9sZXJhbnQgJiYgKCFjb21wb25lbnRzLnBhdGggfHwgIWNvbXBvbmVudHMucGF0aC5tYXRjaChVVUlEKSkpIHtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuZXJyb3IgPSBjb21wb25lbnRzLmVycm9yIHx8IFwiVVVJRCBpcyBub3QgdmFsaWQuXCI7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGNvbXBvbmVudHM7XHJcbiAgICAgICAgfSxcclxuICAgICAgICBzZXJpYWxpemU6IGZ1bmN0aW9uIChjb21wb25lbnRzLCBvcHRpb25zK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gICB2YXIgeGwgPSBzZXRzLmxlbmd0aCAtIDE7XHJcbiAgICAgICAgICAgIGZvciAodmFyIHggPSAxOyB4IDwgeGw7ICsreCkge1xyXG4gICAgICAgICAgICAgICAgc2V0c1t4XSA9IHNldHNbeF0uc2xpY2UoMSwgLTEpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHNldHNbeGxdID0gc2V0c1t4bF0uc2xpY2UoMSk7XHJcbiAgICAgICAgICAgIHJldHVybiBzZXRzLmpvaW4oJycpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgcmV0dXJuIHNldHNbMF07XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZnVuY3Rpb24gc3ViZXhwKHN0cikge1xyXG4gICAgICAgIHJldHVybiBcIig/OlwiICsgc3RyICsgXCIpXCI7XHJcbiAgICB9XHJcbiAgICBmdW5jdGlvbiBidWlsZEV4cHMoaXNJUkkpIHtcclxuICAgICAgICB2YXIgQUxQSEEkJCA9IFwiW0EtWmEtel1cIiwgQ1IkID0gXCJbXFxcXHgwRF1cIiwgRElHSVQkJCA9IFwiWzAtOV1cIiwgRFFVT1RFJCQgPSBcIltcXFxceDIyXVwiLCBIRVhESUckJCA9IG1lcmdlKERJR0lUJCQsIFwiW0EtRmEtZl1cIiksIExGJCQgPSBcIltcXFxceDBBXVwiLCBTUCQkID0gXCJbXFxcXHgyMF1cIiwgUENUX0VOQ09ERUQkID0gc3ViZXhwKHN1YmV4cChcIiVbRUZlZl1cIiArIEhFWERJRyQkICsgXCIlXCIgKyBIRVhESUckJCArIEhFWERJRyQkICsgXCIlXCIgKyBIRVhESUckJCArIEhFWERJRyQkKSArIFwifFwiICsgc3ViZXhwKFwiJVs4OUEtRmEtZl1cIiArIEhFWERJRyQkICsgXCIlXCIgKyBIRVhESUckJCArIEhFWERJRyQkKSArIFwifFwiICsgc3ViZXhwKFwiJVwiICsgSEVYRElHJCQgKyBIRVhESUckJC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wgXCJnXCIpXHJcbiAgICAgICAgfTtcclxuICAgIH1cclxuICAgIHZhciBVUklfUFJPVE9DT0wgPSBidWlsZEV4cHMoZmFsc2UpLCBJUklfUFJPVE9DT0wgPSBVUklfX0lSSV9TVVBQT1JUID8gYnVpbGRFeHBzKHRydWUpIDogdW5kZWZpbmVkLCBVUklfUEFSU0UgPSAvXig/OihbXjpcXC8/I10rKTopPyg/OlxcL1xcLygoPzooW15cXC8/I0BdKilAKT8oW15cXC8/IzpdKikoPzpcXDooXFxkKikpPykpPyhbXj8jXSopKD86XFw/KFteI10qKSk/KD86IygoPzoufFxcbikqKSk/L2ksIFJEUzEgPSAvXlxcLlxcLj9cXC8vLCBSRFMyID0gL15cXC9cXC4oXFwvfCQpLywgUkRTMyA9IC9eXFwvXFwuXFwuKFxcL3wkKS8sIFJEUzQgPSAvXlxcLlxcLj8kLywgUkRTNSA9IC9eXFwvPyg/Oi58XFxuKSo/KD89XFwvfCQpLywgTk9fTUFUQ0hfSVNfVU5ERUZJTkVEID0gKFwiXCIpLm1hdGNoKC8oKXswfS8pWzFdID09PSB1bmRlZmluZWQ7XHJcbiAgICBmdW5jdGlvbiBwY3RFbmNDaGFyKGNocikge1xyXG4gICAgICAgIHZhciBjID0gY2hyLmNoYXJDb2RlQXQoMCksIGU7XHJcbiAgICAgICAgaWYgKGMgPCAxNilcclxuICAgICAgICAgICAgZSA9IFwiJTBcIiArIGMudG9TdHJpbmcoMTYpLnRvVXBwZXJDYXNlKCk7XHJcbiAgICAgICAgZWxzZSBpZiAoYyA8IDEyOClcclxuICAgICAgICAgICAgZSA9IFwiJVwiICsgYy50b1N0cmluZygxNikudG9VcHBlckNhc2UoKTtcclxuICAgICAgICBlbHNlIGlmIChjIDwgMjA0OClcclxuICAgICAgICAgICAgZSA9IFwiJVwiICsgKChjID4+IDYpIHwgMTkyKS50b1N0cmluZygxNikudG9VcHBlckNhc2UoKSArIFwiJVwiICsgKChjICYgNjMpIHwgMTI4KS50b1N0cmluZygxNikudG9VcHBlckNhc2UoKTtcclxuICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIGUgPSBcIiVcIiArICgoYyA+PiAxMikgfCAyMjQpLnRvU3RyaW5nKDE2KS50b1VwcGVyQ2FzZSgpICsgXCIlXCIgKyAoKChjID4+IDYpICYgNjMpIHwgMTI4KS50b1N0cmluZygxNikudG9VcHBlckNhc2UoKSArIFwiJVwiICsgKChjICYgNjMpIHwgMTI4KS50b1N0cmluZygxNikudG9VcHBlckNhc2UoKTtcclxuICAgICAgICByZXR1cm4gZTtcclxuICAgIH1cclxuICAgIGZ1bmN0aW9uIHBjdERlY0NoYXJzKHN0cikge1xyXG4gICAgICAgIHZhciBuZXdTdHIgPSBcIlwiLCBpID0gMCwgaWwgPSBzdHIubGVuZ3RoLCBjLCBjMiwgYzM7XHJcbiAgICAgICAgd2hpbGUgKGkgPCBpbCkge1xyXG4gICAgICAgICAgICBjID0gcGFyc2VJbnQoc3RyLnN1YnN0cihpICsgMSwgMiksIDE2KTtcclxuICAgICAgICAgICAgaWYgKGMgPCAxMjgpIHtcclxuICAgICAgICAgICAgICAgIG5ld1N0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGMpO1xyXG4gICAgICAgICAgICAgICAgaSArPSAzO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKGMgPj0gMTk0ICYmIGMgPCAyMjQpIHtcclxuICAgICAgICAgICAgICAgIGlmICgoaWwgLSBpKSA+PSA2KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgYzIgPSBwYXJzZUludChzdHIuc3Vic3RyKGkgKyA0LCAyKSwgMTYpO1xyXG4gICAgICAgICAgICAgICAgICAgIG5ld1N0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKCgoYyAmIDMxKSA8PCA2KSB8IChjMiAmIDYzKSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBuZXdTdHIgKz0gc3RyLnN1YnN0cihpLCA2KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGkgKz0gNjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChjID49IDIyNCkge1xyXG4gICAgICAgICAgICAgICAgaWYgKChpbCAtIGkpID49IDkpIHtcclxuICAgICAgICAgICAgICAgICAgICBjMiA9IHBhcnNlSW50KHN0ci5zdWJzdHIoaSArIDQsIDIpLCAxNik7XHJcbiAgICAgICAgICAgICAgICAgICAgYzMgPSBwYXJzZUludChzdHIuc3Vic3RyKGkgKyA3LCAyKSwgMTYpO1xyXG4gICAgICAgICAgICAgICAgICAgIG5ld1N0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKCgoYyAmIDE1KSA8PCAxMikgfCAoKGMyICYgNjMpIDw8IDYpIHwgKGMzICYgNjMpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIG5ld1N0ciArPSBzdHIuc3Vic3RyKGksIDkpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaSArPSA5O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgbmV3U3RyICs9IHN0ci5zdWJzdHIoaSwgMyk7XHJcbiAgICAgICAgICAgICAgICBpICs9IDM7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIG5ld1N0cjtcclxuICAgIH1cclxuICAgIGZ1bmN0aW9uIHR5cGVPZihvKSB7XHJcbiAgICAgICAgcmV0dXJuIG8gPT09IHVuZGVmaW5lZCA/IFwidW5kZWZpbmVkXCIgOiAobyA9PT0gbnVsbCA/IFwibnVsbFwiIDogT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKG8pLnNwbGl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GVzWzFdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9nZW5lcmljIFVSSVxyXG4gICAgICAgICAgICAgICAgICAgIG1hdGNoZXMgPSBtYXRjaGVzLnNsaWNlKDEsIDEwKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vcmVsYXRpdmUgVVJJXHJcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2hlcyA9IG1hdGNoZXMuc2xpY2UoMTAsIDE5KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoIW1hdGNoZXMpIHtcclxuICAgICAgICAgICAgICAgIHBhcnNlRXJyb3IgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zLnRvbGVyYW50KVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuZXJyb3IgPSBjb21wb25lbnRzLmVycm9yIHx8IFwiVVJJIGlzIG5vdCBzdHJpY3RseSB2YWxpZC5cIjtcclxuICAgICAgICAgICAgICAgIG1hdGNoZXMgPSB1cmlTdHJpbmcubWF0Y2goVVJJX1BBUlNFKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgbWF0Y2hlcyA9IHVyaVN0cmluZy5tYXRjaChVUklfUEFSU0UpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAobWF0Y2hlcykge1xyXG4gICAgICAgICAgICBpZiAoTk9fTUFUQ0hfSVNfVU5ERUZJTkVEKSB7XHJcbiAgICAgICAgICAgICAgICAvL3N0b3JlIGVhY2ggY29tcG9uZW50XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnNjaGVtZSA9IG1hdGNoZXNbMV07XHJcbiAgICAgICAgICAgICAgICAvL2NvbXBvbmVudHMuYXV0aG9yaXR5ID0gbWF0Y2hlc1syXTtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMudXNlcmluZm8gPSBtYXRjaGVzWzNdO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5ob3N0ID0gbWF0Y2hlc1s0XTtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucG9ydCA9IHBhcnNlSW50KG1hdGNoZXNbNV0sIDEwKTtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucGF0aCA9IG1hdGNoZXNbNl0gfHwgXCJcIjtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucXVlcnkgPSBtYXRjaGVzWzddO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5mcmFnbWVudCA9IG1hdGNoZXNbOF07XHJcbiAgICAgICAgICAgICAgICAvL2ZpeCBwb3J0IG51bWJlclxyXG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKGNvbXBvbmVudHMucG9ydCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRzLnBvcnQgPSBtYXRjaGVzWzVdO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy9zdG9yZSBlYWNoIGNvbXBvbmVudFxyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5zY2hlbWUgPSBtYXRjaGVzWzFdIHx8IHVuZGVmaW5lZDtcclxuICAgICAgICAgICAgICAgIC8vY29tcG9uZW50cy5hdXRob3JpdHkgPSAodXJpU3RyaW5nLmluZGV4T2YoXCIvL1wiKSAhPT0gLTEgPyBtYXRjaGVzWzJdIDogdW5kZWZpbmVkKTtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMudXNlcmluZm8gPSAodXJpU3RyaW5nLmluZGV4T2YoXCJAXCIpICE9PSAtMSA/IG1hdGNoZXNbM10gOiB1bmRlZmluZWQpO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5ob3N0ID0gKHVyaVN0cmluZy5pbmRleE9mKFwiLy9cIikgIT09IC0xID8gbWF0Y2hlc1s0XSA6IHVuZGVmaW5lZCk7XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnBvcnQgPSBwYXJzZUludChtYXRjaGVzWzVdLCAxMCk7XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnBhdGggPSBtYXRjaGVzWzZdIHx8IFwiXCI7XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnF1ZXJ5ID0gKHVyaVN0cmluZy5pbmRleE9mKFwiP1wiKSAhPT0gLTEgPyBtYXRjaGVzWzddIDogdW5kZWZpbmVkKTtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuZnJhZ21lbnQgPSAodXJpU3RyaW5nLmluZGV4T2YoXCIjXCIpICE9PSAtMSA/IG1hdGNoZXNbOF0gOiB1bmRlZmluZWQpO1xyXG4gICAgICAgICAgICAgICAgLy9maXggcG9ydCBudW1iZXJcclxuICAgICAgICAgICAgICAgIGlmIChpc05hTihjb21wb25lbnRzLnBvcnQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50cy5wb3J0ID0gKHVyaVN0cmluZy5tYXRjaCgvXFwvXFwvKD86LnxcXG4pKlxcOig/OlxcL3xcXD98XFwjfCQpLykgPyBtYXRjaGVzWzRdIDogdW5kZWZpbmVkKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvL2RldGVybWluZSByZWZlcmVuY2UgdHlwZVxyXG4gICAgICAgICAgICBpZiAoY29tcG9uZW50cy5zY2hlbWUgPT09IHVuZGVmaW5lZCAmJiBjb21wb25lbnRzLnVzZXJpbmZvID09PSB1bmRlZmluZWQgJiYgY29tcG9uZW50cy5ob3N0ID09PSB1bmRlZmluZWQgJiYgY29tcG9uZW50cy5wb3J0ID09PSB1bmRlZmluZWQgJiYgIWNvbXBvbmVudHMucGF0aCAmJiBjb21wb25lbnRzLnF1ZXJ5ID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucmVmZXJlbmNlID0gXCJzYW1lLWRvY3VtZW50XCI7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoY29tcG9uZW50cy5zY2hlbWUgPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5yZWZlcmVuY2UgPSBcInJlbGF0aXZlXCI7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoY29tcG9uZW50cy5mcmFnbWVudCA9PT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnJlZmVyZW5jZSA9IFwiYWJzb2x1dGVcIjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucmVmZXJlbmNlID0gXCJ1cmlcIjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvL2NoZWNrIGZvciByZWZlcmVuY2UgZXJyb3JzXHJcbiAgICAgICAgICAgIGlmIChvcHRpb25zLnJlZmVyZW5jZSAmJiBvcHRpb25zLnJlZmVyZW5jZSAhPT0gXCJzdWZmaXhcIiAmJiBvcHRpb25zLnJlZmVyZW5jZSAhPT0gY29tcG9uZW50cy5yZWZlcmVuY2UpIHtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuZXJyb3IgPSBjb21wb25lbnRzLmVycm9yIHx8IFwiVVJJIGlzIG5vdCBhIFwiICsgb3B0aW9ucy5yZWZlcmVuY2UgKyBcIiByZWZlcmVuY2UuXCI7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy9maW5kIHNjaGVtZSBoYW5kbGVyXHJcbiAgICAgICAgICAgIHNjaGVtZUhhbmRsZXIgPSBTQ0hFTUVTWy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1bnljb2RlOiBcIiArIGU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy9jb252ZXJ0IElSSSAtPiBVUklcclxuICAgICAgICAgICAgICAgIF9ub3JtYWxpemVDb21wb25lbnRFbmNvZGluZyhjb21wb25lbnRzLCBVUklfUFJPVE9DT0wpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy9ub3JtYWxpemUgZW5jb2RpbmdzXHJcbiAgICAgICAgICAgICAgICBfbm9ybWFsaXplQ29tcG9uZW50RW5jb2RpbmcoY29tcG9uZW50cywgcHJvdG9jb2wpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vcGVyZm9ybSBzY2hlbWUgc3BlY2lmaWMgcGFyc2luZ1xyXG4gICAgICAgICAgICBpZiAoc2NoZW1lSGFuZGxlciAmJiBzY2hlbWVIYW5kbGVyLnBhcnNlKSB7XHJcbiAgICAgICAgICAgICAgICBzY2hlbWVIYW5kbGVyLnBhcnNlKGNvbXBvbmVudHMsIG9wdGlvbnMpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBwYXJzZUVycm9yID0gdHJ1ZTtcclxuICAgICAgICAgICAgY29tcG9uZW50cy5lcnJvciA9IGNvbXBvbmVudHMuZXJyb3IgfHwgXCJVUkkgY2FuIG5vdCBiZSBwYXJzZWQuXCI7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBjb21wb25lbnRzO1xyXG4gICAgfVxyXG4gICAgO1xyXG4gICAgZnVuY3Rpb24gX3JlY29tcG9zZUF1dGhvcml0eShjb21wb25lbnRzLCBvcHRpb25zKSB7XHJcbiAgICAgICAgdmFyIHVyaVRva2VucyA9IFtdO1xyXG4gICAgICAgIGlmIChjb21wb25lbnRzLnVzZXJp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XCIgKyBlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vbm9ybWFsaXplIGVuY29kaW5nXHJcbiAgICAgICAgX25vcm1hbGl6ZUNvbXBvbmVudEVuY29kaW5nKGNvbXBvbmVudHMsIHByb3RvY29sKTtcclxuICAgICAgICBpZiAob3B0aW9ucy5yZWZlcmVuY2UgIT09IFwic3VmZml4XCIgJiYgY29tcG9uZW50cy5zY2hlbWUpIHtcclxuICAgICAgICAgICAgdXJpVG9rZW5zLnB1c2goY29tcG9uZW50cy5zY2hlbWUpO1xyXG4gICAgICAgICAgICB1cmlUb2tlbnMucHVzaChcIjpcIik7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGF1dGhvcml0eSA9IF9yZWNvbXBvc2VBdXRob3JpdHkoY29tcG9uZW50cywgb3B0aW9ucyk7XHJcbiAgICAgICAgaWYgKGF1dGhvcml0eSAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgIGlmIChvcHRpb25zLnJlZmVyZW5jZSAhPT0gXCJzdWZmaXhcIikge1xyXG4gICAgICAgICAgICAgICAgdXJpVG9rZW5zLnB1c2goXCIvL1wiKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB1cmlUb2tlbnMucHVzaChhdXRob3JpdHkpO1xyXG4gICAgICAgICAgICBpZiAoY29tcG9uZW50cy5wYXRoICYmIGNvbXBvbmVudHMucGF0aC5jaGFyQXQoMCkgIT09IFwiL1wiKSB7XHJcbiAgICAgICAgICAgICAgICB1cmlUb2tlbnMucHVzaChcIi9cIik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGNvbXBvbmVudHMucGF0aCAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgIHMgPSBjb21wb25lbnRzLnBhdGg7XHJcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5hYnNvbHV0ZVBhdGggJiYgKCFzY2hlbWVIYW5kbGVyIHx8ICFzY2hlbWVIYW5kbGVyLmFic29sdXRlUGF0aCkpIHtcclxuICAgICAgICAgICAgICAgIHMgPSByZW1vdmVEb3RTZWdtZW50cyhzKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoYXV0aG9yaXR5ID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgICAgIHMgPSBzLnJlcGxhY2UoL15cXC9cXC8vLCBcIi8lMkZcIik7IC8vZG9uJ3QgYWxsb3cgdGhlIHBhdGggdG8gc3RhcnQgd2l0aCBcIi8vXCJcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB1cmlUb2tlbnMucHVzaChzKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGNvbXBvbmVudHMucXVlcnkgIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICB1cmlUb2tlbnMucHVzaChcIj9cIik7XHJcbiAgICAgICAgICAgIHVyaVRva2Vucy5wdXNoKGNvbXBvbmVudHMucXVlcnkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoY29tcG9uZW50cy5mcmFnbWVudCAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgIHVyaVRva2Vucy5wdXNoKFwiI1wiKTtcclxuICAgICAgICAgICAgdXJpVG9rZW5zLnB1c2goY29tcG9uZW50cy5mcmFnbWVudCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB1cmlUb2tlbnMuam9pbignJyk7IC8vbWVyZ2UgdG9rZW5zIGludG8gYSBzdHJpbmdcclxuICAgIH1cclxuICAgIDtcclxuICAgIGZ1bmN0aW9uIHJlc29sdmVDb21wb25lbnRzKGJhc2UsIHJlbGF0aXZlLCBvcHRpb25zLCBza2lwTm9ybWFsaXphdGlvbikge1xyXG4gICAgICAgIGlmIChvcHRpb25zID09PSB2b2lkIDApIHsgb3B0aW9ucyA9IHt9OyB9XHJcbiAgICAgICAgdmFyIHRhcmdldCA9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IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgLy90YXJnZXQuYXV0aG9yaXR5ID0gcmVsYXRpdmUuYXV0aG9yaXR5O1xyXG4gICAgICAgICAgICAgICAgdGFyZ2V0LnVzZXJpbmZvID0gcmVsYXRpdmUudXNlcmluZm87XHJcbiAgICAgICAgICAgICAgICB0YXJnZXQuaG9zdCA9IHJlbGF0aXZlLmhvc3Q7XHJcbiAgICAgICAgICAgICAgICB0YXJnZXQucG9ydCA9IHJlbGF0aXZlLnBvcnQ7XHJcbiAgICAgICAgICAgICAgICB0YXJnZXQucGF0aCA9IHJlbW92ZURvdFNlZ21lbnRzKHJlbGF0aXZlLnBhdGgpO1xyXG4gICAgICAgICAgICAgICAgdGFyZ2V0LnF1ZXJ5ID0gcmVsYXRpdmUucXVlcnk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXJlbGF0aXZlLnBhdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICB0YXJnZXQucGF0aCA9IGJhc2UucGF0aDtcclxuICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRpdmUucXVlcnkgIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXQucXVlcnkgPSByZWxhdGl2ZS5xdWVyeTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldC5xdWVyeSA9IGJhc2UucXVlcnk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlbGF0aXZlLnBhdGguY2hhckF0KDApID09PSBcIi9cIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXQucGF0aCA9IHJlbW92ZURvdFNlZ21lbnRzKHJlbGF0aXZlLnBhdGgpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiYXNlLnVzZXJpbmZvICE9PSB1bmRlZmluZWQgfHwgYmFzZS5ob3N0ICE9PSB1bmRlZmluZWQgfHwgYmFzZS5wb3J0ICE9PSB1bmRlZmluZWQpICYmICFiYXNlLnBhdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldC5wYXRoID0gXCIvXCIgKyByZWxhdGl2ZS5wYXRoO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFiYXNlLnBhdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldC5wYXRoID0gcmVsYXRpdmUucGF0aDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldC5wYXRoID0gYmFzZS5wYXRoLnNsaWNlKDAsIGJhc2UucGF0aC5sYXN0SW5kZXhPZihcIi9cIikgKyAxKSArIHJlbGF0aXZlLnBhdGg7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LnBhdGggPSByZW1vdmVEb3RTZWdtZW50cyh0YXJnZXQucGF0aCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldC5xdWVyeSA9IHJlbGF0aXZlLnF1ZXJ5O1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy90YXJnZXQuYXV0aG9yaXR5ID0gYmFzZS5hdXRob3JpdHk7XHJcbiAgICAgICAgICAg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xpY2UoMCwgaSk7XG4gICAgICAgICAgICB2YXIgbm90SG9zdCA9IGhvc3RwYXJ0cy5zbGljZShpICsgMSk7XG4gICAgICAgICAgICB2YXIgYml0ID0gcGFydC5tYXRjaChob3N0bmFtZVBhcnRTdGFydCk7XG4gICAgICAgICAgICBpZiAoYml0KSB7XG4gICAgICAgICAgICAgIHZhbGlkUGFydHMucHVzaChiaXRbMV0pO1xuICAgICAgICAgICAgICBub3RIb3N0LnVuc2hpZnQoYml0WzJdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChub3RIb3N0Lmxlbmd0aCkge1xuICAgICAgICAgICAgICByZXN0ID0gJy8nICsgbm90SG9zdC5qb2luKCcuJykgKyByZXN0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5ob3N0bmFtZSA9IHZhbGlkUGFydHMuam9pbignLicpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKHRoaXMuaG9zdG5hbWUubGVuZ3RoID4gaG9zdG5hbWVNYXhMZW4pIHtcbiAgICAgIHRoaXMuaG9zdG5hbWUgPSAnJztcbiAgICB9IGVsc2Uge1xuICAgICAgLy8gaG9zdG5hbWVzIGFyZSBhbHdheXMgbG93ZXIgY2FzZS5cbiAgICAgIHRoaXMuaG9zdG5hbWUgPSB0aGlzLmhvc3RuYW1lLnRvTG93ZXJDYXNlKCk7XG4gICAgfVxuXG4gICAgaWYgKCFpcHY2SG9zdG5hbWUpIHtcbiAgICAgIC8vIElETkEgU3VwcG9ydDogUmV0dXJucyBhIHB1bnkgY29kZWQgcmVwcmVzZW50YXRpb24gb2YgXCJkb21haW5cIi5cbiAgICAgIC8vIEl0IG9ubHkgY29udmVydHMgdGhlIHBhcnQgb2YgdGhlIGRvbWFpbiBuYW1lIHRoYXRcbiAgICAgIC8vIGhhcyBub24gQVNDSUkgY2hhcmFjdGVycy4gSS5lLiB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AvXihbMC05YS1mQS1GXVswLTlhLWZBLUZdOil7NX0oWzAtOWEtZkEtRl1bMC05YS1mQS1GXSkkLztcblxuICAgIHZhciBpcHY0TWF5YmUgPSAvXihcXGQrKVxcLihcXGQrKVxcLihcXGQrKVxcLihcXGQrKSQvXG4gICAgICAsIGlwdjZCbG9jayA9IC9eWzAtOUEtRl17MSw0fSQvaTtcblxuICAgIHZhciB1dWlkID0ge1xuICAgICAgICAnMyc6IC9eWzAtOUEtRl17OH0tWzAtOUEtRl17NH0tM1swLTlBLUZdezN9LVswLTlBLUZdezR9LVswLTlBLUZdezEyfSQvaVxuICAgICAgLCAnNCc6IC9eWzAtOUEtRl17OH0tWzAtOUEtRl17NH0tNFswLTlBLUZdezN9LVs4OUFCXVswLTlBLUZdezN9LVswLTlBLUZdezEyfSQvaVxuICAgICAgLCAnNSc6IC9eWzAtOUEtRl17OH0tWzAtOUEtRl17NH0tNVswLTlBLUZdezN9LVs4OUFCXVswLTlBLUZdezN9LVswLTlBLUZdezEyfSQvaVxuICAgICAgLCBhbGw6IC9eWzAtOUEtRl17OH0tWzAtOUEtRl17NH0tWzAtOUEtRl17NH0tWzAtOUEtRl17NH0tWzAtOUEtRl17MTJ9JC9pXG4gICAgfTtcblxuICAgIHZhciBhbHBoYSA9IC9eW0EtWl0rJC9pXG4gICAgICAsIGFscGhhbnVtZXJpYyA9IC9eWzAtOUEtWl0rJC9pXG4gICAgICAsIG51bWVyaWMgPSAvXlstK10/WzAtOV0rJC9cbiAgICAgICwgaW50ID0gL14oPzpbLStdPyg/OjB8WzEtOV1bMC05XSopKSQvXG4gICAgICAsIGZsb2F0ID0gL14oPzpbLStdPyg/OlswLTldKykpPyg/OlxcLlswLTldKik/KD86W2VFXVtcXCtcXC1dPyg/OlswLTldKykpPyQvXG4gICAgICAsIGhleGFkZWNpbWFsID0gL15bMC05QS1GXSskL2lcbiAgICAgICwgZGVjaW1hbCA9IC9eWy0rXT8oWzAtOV0rfFxcLlswLTldK3xbMC05X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ICAgICAgLCBhbGxvd191bmRlcnNjb3JlczogZmFsc2VcbiAgICAgICwgYWxsb3dfdHJhaWxpbmdfZG90OiBmYWxzZVxuICAgICAgLCBhbGxvd19wcm90b2NvbF9yZWxhdGl2ZV91cmxzOiBmYWxzZVxuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNVUkwgPSBmdW5jdGlvbiAodXJsLCBvcHRpb25zKSB7XG4gICAgICAgIGlmICghdXJsIHx8IHVybC5sZW5ndGggPj0gMjA4MyB8fCAvXFxzLy50ZXN0KHVybCkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodXJsLmluZGV4T2YoJ21haWx0bzonKSA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIG9wdGlvbnMgPSBtZXJnZShvcHRpb25zLCBkZWZhdWx0X3VybF9vcHRpb25zKTtcbiAgICAgICAgdmFyIHByb3RvY29sLCBhdXRoLCBob3N0LCBob3N0bmFtZSwgcG9ydCxcbiAgICAgICAgICAgIHBvcnRfc3RyLCBzcGxpdDtcbiAgICAgICAgc3BsaXQgPSB1cmwuc3BsaXQoJzovLycpO1xuICAgICAgICBpZiAoc3BsaXQubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgcHJvdG9jb2wgPSBzcGxpdC5zaGlmdCgpO1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMucmVxdWlyZV92YWxpZF9wcm90b2NvbCAmJiBvcHRpb25zLnByb3RvY29scy5pbmRleE9mKHByb3RvY29sKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAob3B0aW9ucy5yZXF1aXJlX3Byb3RvY29sKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH0gIGVsc2UgaWYgKG9wdGlvbnMuYWxsb3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wgcG9ydCA+IDY1NTM1KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghdmFsaWRhdG9yLmlzSVAoaG9zdCkgJiYgIXZhbGlkYXRvci5pc0ZRRE4oaG9zdCwgb3B0aW9ucykgJiZcbiAgICAgICAgICAgICAgICBob3N0ICE9PSAnbG9jYWxob3N0Jykge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChvcHRpb25zLmhvc3Rfd2hpdGVsaXN0ICYmXG4gICAgICAgICAgICAgICAgb3B0aW9ucy5ob3N0X3doaXRlbGlzdC5pbmRleE9mKGhvc3QpID09PSAtMSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChvcHRpb25zLmhvc3RfYmxhY2tsaXN0ICYmXG4gICAgICAgICAgICAgICAgb3B0aW9ucy5ob3N0X2JsYWNrbGlzdC5pbmRleE9mKGhvc3QpICE9PSAtMSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNNQUNBZGRyZXNzID0gZnVuY3Rpb24gKHN0cikge1xuICAgICAgICByZXR1cm4gbWFjQWRkcmVzcy50ZXN0KHN0cik7XG4gICAgfTtcblxuICAgIHZhbGlkYXRvci5pc0lQID0gZnVuY3Rpb24gKHN0ciwgdmVyc2lvbikge1xuICAgICAgICB2ZXJzaW9uID0gdmFsaWRhdG9yLnRvU3RyaW5nKHZlcnNpb24pO1xuICAgICAgICBpZiAoIXZlcnNpb24pIHtcbiAgICAgICAgICAgIHJldHVybiB2YWxpZGF0b3IuaXNJUChzdHIsIDQpIHx8IHZhbGlkYXRvci5pc0lQKHN0ciwgNik7XG4gICAgICAgIH0gZWxzZSBpZiAodmVyc2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kSVB2NFRyYW5zaXRpb25CbG9jayA/IDcgOiA4O1xuXG4gICAgICAgICAgICBpZiAoYmxvY2tzLmxlbmd0aCA+IGV4cGVjdGVkTnVtYmVyT2ZCbG9ja3MpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuXG4gICAgICAgICAgICAvLyBpbml0aWFsIG9yIGZpbmFsIDo6XG4gICAgICAgICAgICBpZiAoc3RyID09PSAnOjonKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN0ci5zdWJzdHIoMCwgMikgPT09ICc6OicpIHtcbiAgICAgICAgICAgICAgICBibG9ja3Muc2hpZnQoKTtcbiAgICAgICAgICAgICAgICBibG9ja3Muc2hpZnQoKTtcbiAgICAgICAgICAgICAgICBmb3VuZE9taXNzaW9uQmxvY2sgPSB0cnVlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChzdHIuc3Vic3RyKHN0ci5sZW5ndGggLSAyKSA9PT0gJzo6Jykge1xuICAgICAgICAgICAgICAgIGJsb2Nrcy5wb3AoKTtcbiAgICAgICAgICAgICAgICBibG9ja3MucG9wKCk7XG4gICAgICAgICAgICAgICAgZm91bmRPbWlzc2lvbkJsb2NrID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBibG9ja3MubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICAvLyB0ZXN0IGZvciBhIDo6IHdoaWNoIGNhbiBub3QgYmUgYXQgdGhlIHN0cmluZyBzdGFydC9lbmRcbiAgICAgICAgICAgICAgICAvLyBzaW5jZSB0aG9zZSBjYXNlcyBoYXZlIGJlZW4gaGFuZGxlZCBhYm92ZVxuICAgICAgICAgICAgICAgIGlmIChibG9ja3NbaV0gPT09ICcnICYmIGkgPiAwICYmIGkgPCBibG9ja3MubGVuZ3RoIC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmb3VuZE9taXNzaW9uQmxvY2spXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7IC8vIG11bHRpcGxlIDo6IGluIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgZm91bmRPbWlzc2lvbkJsb2NrID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZvdW5kSVB2NFRyYW5zaXRpb25CbG9jayAmJiBpID09IGJsb2Nrcy5sZW5ndGggLSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGl0IGhhcyBiZWVuIGNoZWNrZWQgYmVmb3JlIHRoYXQgdGhlIGxhc3RcbiAgICAgICAgICAgICAgICAgICAgLy8gYmxvY2sgaXMgYSB2YWxpZCBJUHY0IGFkZHJlc3NcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFpcHY2QmxvY2sudGVzdChibG9ja3NbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChmb3VuZE9taXNzaW9uQmxvY2spIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gYmxvY2tzLmxlbmd0aCA+PSAxO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gYmxvY2tzLmxlbmd0aCA9PT0gZXhwZWN0ZWROdW1iZXJPZkJsb2NrcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfTtcblxuICAgIHZhciBkZWZhdWx0X2ZxZG5fb3B0aW9ucyA9IHtcbiAgICAgICAgcmVxdWlyZV90bGQ6IHRydWVcbiAgICAgICwgYWxsb3dfdW5kZXJzY29yZXM6IGZhbHNlXG4gICAgICAsIGFsbG93X3RyYWlsaW5nX2RvdDogZmFsc2VcbiAgICB9O1xuXG4gICAgdmFsaWRhdG9yL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AnJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIS9eW2EtelxcdTAwYTEtXFx1ZmZmZjAtOS1dKyQvaS50ZXN0KHBhcnQpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKC9bXFx1ZmYwMS1cXHVmZjVlXS8udGVzdChwYXJ0KSkge1xuICAgICAgICAgICAgICAgIC8vIGRpc2FsbG93IGZ1bGwtd2lkdGggY2hhcnNcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocGFydFswXSA9PT0gJy0nIHx8IHBhcnRbcGFydC5sZW5ndGggLSAxXSA9PT0gJy0nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHBhcnQuaW5kZXhPZignLS0tJykgPj0gMCAmJiBwYXJ0LnNsaWNlKDAsIDQpICE9PSAneG4tLScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfTtcblxuICAgIHZhbGlkYXRvci5pc0Jvb2xlYW4gPSBmdW5jdGlvbihzdHIpIHtcbiAgICAgICAgcmV0dXJuIChbJ3RydWUnLCAnZmFsc2UnLCAnMScsICcwJ10uaW5kZXhPZihzdHIpID49IDApO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNBbHBoYSA9IGZ1bmN0aW9uIChzdHIpIHtcbiAgICAgICAgcmV0dXJuIGFscGhhLnRlc3Qoc3RyKTtcbiAgICB9O1xuXG4gICAgdmFsaWRhdG9yLmlzQWxwaGFudW1lcmljID0gZnVuY3Rpb24gKHN0cikge1xuICAgICAgICByZXR1cm4gYWxwaGFudW1lcmljLnRlc3Qoc3RyKTtcbiAgICB9O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XJzaW9uID8gdmVyc2lvbiA6ICdhbGwnXTtcbiAgICAgICAgcmV0dXJuIHBhdHRlcm4gJiYgcGF0dGVybi50ZXN0KHN0cik7XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIGdldFRpbWV6b25lT2Zmc2V0KHN0cikge1xuICAgICAgICB2YXIgaXNvODYwMVBhcnRzID0gc3RyLm1hdGNoKGlzbzg2MDEpXG4gICAgICAgICAgLCB0aW1lem9uZSwgc2lnbiwgaG91cnMsIG1pbnV0ZXM7XG4gICAgICAgIGlmICghaXNvODYwMVBhcnRzKSB7XG4gICAgICAgICAgICBzdHIgPSBzdHIudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgIHRpbWV6b25lID0gc3RyLm1hdGNoKC8oPzpcXHN8Z210XFxzKikoLXxcXCspKFxcZHsxLDR9KShcXHN8JCkvKTtcbiAgICAgICAgICAgIGlmICghdGltZXpvbmUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc3RyLmluZGV4T2YoJ2dtdCcpICE9PSAtMSA/IDAgOiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2lnbiA9IHRpbWV6b25lWzFdO1xuICAgICAgICAgICAgdmFyIG9mZnNldCA9IHRpbWV6b25lWzJdO1xuICAgICAgICAgICAgaWYgKG9mZnNldC5sZW5ndGggPT09IDMpIHtcbiAgICAgICAgICAgICAgICBvZmZzZXQgPSAnMCcgKyBvZmZzZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob2Zmc2V0Lmxlbmd0aCA8PSAyKSB7XG4gICAgICAgICAgICAgICAgaG91cnMgPSAwO1xuICAgICAgICAgICAgICAgIG1pbnV0ZXMgPSBwYXJzZUludChvZmZzZXQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBob3VycyA9IHBhcnNlSW50KG9mZnNldC5zbGljZSgwLCAyKSk7XG4gICAgICAgICAgICAgICAgbWludXRlcyA9IHBhcnNlSW50KG9mZnNldC5zbGljZSgyLCA0KSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aW1lem9uZSA9IGlzbzg2MDFQYXJ0c1syMV07XG4gICAgICAgICAgICBpZiAoIXRpbWV6b25lKSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgbm8gaG91ci9taW51dGUgd2FzIHByb3ZpZGVkLCB0aGUgZGF0ZSBpcyBHTVRcbiAgICAgICAgICAgICAgICByZXR1cm4gIWlzbzg2MDFQYXJ0c1sxMl0gPyAwIDogbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aW1lem9uZSA9PT0gJ3onIHx8IHRpbWV6b25lID09PSAnWicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNpZ24gPSBpc284NjAxUGFydHNbMjJdO1xuICAgICAgICAgICAgaWYgKHRpbWV6b25lLmluZGV4T2YoJzonKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBob3VycyA9IHBhcnNlSW50KGlzbzg2MDFQYXJ0c1syM10pO1xuICAgICAgICAgICAgICAgIG1pbnV0ZXMgPSBwYXJzZUludChpc284NjAxUGFydHNbMjRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaG91cnMgPSAwO1xuICAgICAgICAgICAgICAgIG1pbnV0ZXMgPSBwYXJzZUludChpc284NjAxUGFydHNbMjNdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gKGhvdXJzICogNjAgKyBtaW51dGVzKSAqIChzaWduID09PSAnLScgPyAxIDogLTEpO1xuICAgIH1cblxuICAgIHZhbGlkYXRvci5pc0RhdGUgPSBmdW5jdGlvbiAoc3RyKSB7XG4gICAgICAgIHZhciBub3JtYWxpemVkRGF0ZSA9IG5ldyBEYXRlKERhdGUucGFyc2Uoc3RyKSk7XG4gICAgIC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bmVhcmJ5IGNvbG9uc1xuICAgICAgICBkYXlPclllYXJNYXRjaGVzID0gc3RyLm1hdGNoKC8oXnxbXjpcXGRdKVsyM11cXGQoW146XFxkXXwkKS9nKTtcbiAgICAgICAgaWYgKCFkYXlPclllYXJNYXRjaGVzKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBkYXlPclllYXIgPSBkYXlPclllYXJNYXRjaGVzLm1hcChmdW5jdGlvbihkaWdpdFN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIGRpZ2l0U3RyaW5nLm1hdGNoKC9cXGQrL2cpWzBdO1xuICAgICAgICB9KS5qb2luKCcvJyk7XG5cbiAgICAgICAgeWVhciA9IFN0cmluZyhub3JtYWxpemVkRGF0ZS5nZXRGdWxsWWVhcigpKS5zbGljZSgtMik7XG4gICAgICAgIGlmIChkYXlPclllYXIgPT09IGRheSB8fCBkYXlPclllYXIgPT09IHllYXIpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKChkYXlPclllYXIgPT09IChkYXkgKyAnLycgKyB5ZWFyKSkgfHwgKGRheU9yWWVhciA9PT0gKHllYXIgKyAnLycgKyBkYXkpKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNBZnRlciA9IGZ1bmN0aW9uIChzdHIsIGRhdGUpIHtcbiAgICAgICAgdmFyIGNvbXBhcmlzb24gPSB2YWxpZGF0b3IudG9EYXRlKGRhdGUgfHwgbmV3IERhdGUoKSlcbiAgICAgICAgICAsIG9yaWdpbmFsID0gdmFsaWRhdG9yLnRvRGF0ZShzdHIpO1xuICAgICAgICByZXR1cm4gISEob3JpZ2luYWwgJiYgY29tcGFyaXNvbiAmJiBvcmlnaW5hbCA+IGNvbXBhcmlzb24pO1xuICAgIH07X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ZGF0b3IuaXNXaGl0ZWxpc3RlZCA9IGZ1bmN0aW9uIChzdHIsIGNoYXJzKSB7XG4gICAgICAgIGZvciAodmFyIGkgPSBzdHIubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgICAgIGlmIChjaGFycy5pbmRleE9mKHN0cltpXSkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfTtcblxuICAgIHZhbGlkYXRvci5pc0NyZWRpdENhcmQgPSBmdW5jdGlvbiAoc3RyKSB7XG4gICAgICAgIHZhciBzYW5pdGl6ZWQgPSBzdHIucmVwbGFjZSgvW14wLTldKy9nLCAnJyk7XG4gICAgICAgIGlmICghY3JlZGl0Q2FyZC50ZXN0KHNhbml0aXplZCkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgc3VtID0gMCwgZGlnaXQsIHRtcE51bSwgc2hvdWxkRG91YmxlO1xuICAgICAgICBmb3IgKHZhciBpID0gc2FuaXRpemVkLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7XG4gICAgICAgICAgICBkaWdpdCA9IHNhbml0aXplZC5zdWJzdHJpbmcoaSwgKGkgKyAxKSk7XG4gICAgICAgICAgICB0bXBOdW0gPSBwYXJzZUludChkaWdpdCwgMTApO1xuICAgICAgICAgICAgaWYgKHNob3VsZERvdWJsZSkge1xuICAgICAgICAgICAgICAgIHRtcE51bSAqPSAyO1xuICAgICAgICAgICAgICAgIGlmICh0bXBOdW0gPj0gMTApIHtcbiAgICAgICAgICAgICAgICAgICAgc3VtICs9ICgodG1wTnVtICUgMTApICsgMSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgc3VtICs9IHRtcE51bTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHN1bSArPSB0bXBOdW07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaG91bGREb3VibGUgPSAhc2hvdWxkRG91YmxlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAhISgoc3VtICUgMTApID09PSAwID8gc2FuaXRpemVkIDogZmFsc2UpO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNJU0lOID0gZnVuY3Rpb24gKHN0cikge1xuICAgICAgICBpZiAoIWlzaW4udGVzdChzdHIpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgY2hlY2tzdW1TdHIgPSBzdHIucmVwbGFjZSgvW0EtWl0vZywgZnVuY3Rpb24oY2hhcmFjdGVyKSB7XG4gICAgICAgICAgICByZXR1cm4gcGFyc2VJbnQoY2hhcmFjdGVyLCAzNik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHZhciBzdW0gPSAwLCBkaWdpdCwgdG1wTnVtLCBzaG91bGREb3VibGUgPSB0cnVlO1xuICAgICAgICBmb3IgKHZhciBpID0gY2hlY2tzdW1TdHIubGVuZ3RoIC0gMjsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgICAgIGRpZ2l0ID0gY2hlY2tzdW1TdHIuc3Vic3RyaW5nKGksIChpICsgMSkpO1xuICAgICAgICAgICAgdG1wTnVtID0gcGFyc2VJbnQoZGlnaXQsIDEwKTtcbiAgICAgICAgICAgIGlmIChzaG91bGREb3VibGUpIHtcbiAgICAgICAgICAgICAgICB0bXBOdW0gKj0gMjtcbiAgICAgICAgICAgICAgICBpZiAodG1wTnVtID49IDEwKSB7XG4gICAgICAgICAgICAgICAgICAgIHN1bSArPSB0bXBOdW0gKyAxO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN1bSArPSB0bXBOdW07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzdW0gKz0gdG1wTnVtO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2hvdWxkRG91YmxlID0gIXNob3VsZERvdWJsZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBwYXJzZUludChzdHIuc3Vic3RyKHN0ci5sZW5ndGggLSAxKSwgMTApID09PSAoMTAwMDAgLSBzdW0pICUgMTA7XG4gICAgfTtcblxuICAgIHZhbGlkYXRvci5pc0lTQk4gPSBmdW5jdGlvbiAoc3RyLCB2ZXJzaW9uKSB7XG4gICAgICAgIHZlcnNpb24gPSB2YWxpZGF0b3IudG9TdHJpbmcodmVyc2lvbik7XG4gICAgICAgIGlmICghdmVyc2lvbikge1xuICAgICAgICAgICAgcmV0dXJuIHZhbGlkYXRvci5pc0lTQk4oc3RyLCAxMCkgfHwgdmFsaWRhdG9yLmlzSVNCTihzdHIsIDEzKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgc2FuaXRpemVkID0gc3RyLnJlcGxhY2UoL1tcXHMtXSsvZywgJycpXG4gICAgICAgICAgLCBjaGVja3N1bSA9IDAsIGk7XG4gICAgICAgIGlmICh2ZXJzaW9uID09PSAnMTAnKSB7XG4gICAgICAgICAgICBpZiAoIWlzYm4xME1heWJlLnRlc3Qoc2FuaXRpemVkKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA5OyBpKyspIHtcbiAgICAgICAgICAgICAgICBjaGVja3N1bSArPSAoaSArIDEpICogc2FuaXRpemVkLmNoYXJBdChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChzYW5pdGl6ZWQuY2hhckF0KDkpID09PSAnWCcpIHtcbiAgICAgICAgICAgICAgICBjaGVja3N1bSArPSAxMCAqIDEwO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjaGVja3N1bSArPSAxMCAqIHNhbml0aXplZC5jaGFyQXQoOSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoKGNoZWNrc3VtICUgMTEpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICEhc2FuaXRpemVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgIGlmICh2ZXJzaW9uID09PSAnMTMnKSB7XG4gICAgICAgICAgICBpZiAoIWlzYm4xM01heWJlLnRlc3Qoc2FuaXRpemVkKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBmYWN0b3IgPSBbIDEsIDMgXTtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAxMjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgY2hlY2tzdW0gKz0gZmFjdG9yW2kgJSAyXSAqIHNhbml0aXplZC5jaGFyQXQoaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc2FuaXRpemVkLmNoYXJBdCgxMikgLSAoKDEwIC0gKGNoZWNrc3VtICUgMTApKSAlIDEwKSA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAhIXNhbml0aXplZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfTtcblxuICAgIHZhbGlkYXRvci5pc01vYmlsZVBob25lID0gZnVuY3Rpb24oc3RyLCBsb2NhbGUpIHtcbiAgICAgICAgaWYgKGxvY2FsZSBpbiBwaG9uZXMpIHtcbiAgICAgICAgICAgIHJldHVybiBwaG9uZXNbbG9jYWxlXS50ZXN0KHN0cik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH07XG5cbiAgICB2YXIgZGVmYXVsdF9jdXJyZW5jeV9vcHRpb25zID0ge1xuICAgICAgICBzeW1ib2w6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BtZXJnZShvcHRpb25zLCBkZWZhdWx0X25vcm1hbGl6ZV9lbWFpbF9vcHRpb25zKTtcbiAgICAgICAgaWYgKCF2YWxpZGF0b3IuaXNFbWFpbChlbWFpbCkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgcGFydHMgPSBlbWFpbC5zcGxpdCgnQCcsIDIpO1xuICAgICAgICBwYXJ0c1sxXSA9IHBhcnRzWzFdLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgIGlmIChwYXJ0c1sxXSA9PT0gJ2dtYWlsLmNvbScgfHwgcGFydHNbMV0gPT09ICdnb29nbGVtYWlsLmNvbScpIHtcbiAgICAgICAgICAgIGlmIChvcHRpb25zLnJlbW92ZV9leHRlbnNpb24pIHtcbiAgICAgICAgICAgICAgICBwYXJ0c1swXSA9IHBhcnRzWzBdLnNwbGl0KCcrJylbMF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob3B0aW9ucy5yZW1vdmVfZG90cykge1xuICAgICAgICAgICAgICAgIHBhcnRzWzBdID0gcGFydHNbMF0ucmVwbGFjZSgvXFwuL2csICcnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghcGFydHNbMF0ubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFydHNbMF0gPSBwYXJ0c1swXS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgcGFydHNbMV0gPSAnZ21haWwuY29tJztcbiAgICAgICAgfSBlbHNlIGlmIChvcHRpb25zLmxvd2VyY2FzZSkge1xuICAgICAgICAgICAgcGFydHNbMF0gPSBwYXJ0c1swXS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBwYXJ0cy5qb2luKCdAJyk7XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIG1lcmdlKG9iaiw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X01JTklNVU06ICAgICAgICAgICAgICBcIlRvbyBmZXcgcHJvcGVydGllcyBkZWZpbmVkICh7MH0pLCBtaW5pbXVtIHsxfVwiLFxuICAgIE9CSkVDVF9QUk9QRVJUSUVTX01BWElNVU06ICAgICAgICAgICAgICBcIlRvbyBtYW55IHByb3BlcnRpZXMgZGVmaW5lZCAoezB9KSwgbWF4aW11bSB7MX1cIixcbiAgICBPQkpFQ1RfTUlTU0lOR19SRVFVSVJFRF9QUk9QRVJUWTogICAgICAgXCJNaXNzaW5nIHJlcXVpcmVkIHByb3BlcnR5OiB7MH1cIixcbiAgICBPQkpFQ1RfQURESVRJT05BTF9QUk9QRVJUSUVTOiAgICAgICAgICAgXCJBZGRpdGlvbmFsIHByb3BlcnRpZXMgbm90IGFsbG93ZWQ6IHswfVwiLFxuICAgIE9CSkVDVF9ERVBFTkRFTkNZX0tFWTogICAgICAgICAgICAgICAgICBcIkRlcGVuZGVuY3kgZmFpbGVkIC0ga2V5IG11c3QgZXhpc3Q6IHswfSAoZHVlIHRvIGtleTogezF9KVwiLFxuXG4gICAgLy8gU3RyaW5nIGVycm9yc1xuICAgIE1JTl9MRU5HVEg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIlN0cmluZyBpcyB0b28gc2hvcnQgKHswfSBjaGFycyksIG1pbmltdW0gezF9XCIsXG4gICAgTUFYX0xFTkdUSDogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiU3RyaW5nIGlzIHRvbyBsb25nICh7MH0gY2hhcnMpLCBtYXhpbXVtIHsxfVwiLFxuICAgIFBBVFRFUk46ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIlN0cmluZyBkb2VzIG5vdCBtYXRjaCBwYXR0ZXJuIHswfTogezF9XCIsXG5cbiAgICAvLyBTY2hlbWEgdmFsaWRhdGlvbiBlcnJvcnNcbiAgICBLRVlXT1JEX1RZUEVfRVhQRUNURUQ6ICAgICAgICAgICAgICAgICAgXCJLZXl3b3JkICd7MH0nIGlzIGV4cGVjdGVkIHRvIGJlIG9mIHR5cGUgJ3sxfSdcIixcbiAgICBLRVlXT1JEX1VOREVGSU5FRF9TVFJJQ1Q6ICAgICAgICAgICAgICAgXCJLZXl3b3JkICd7MH0nIG11c3QgYmUgZGVmaW5lZCBpbiBzdHJpY3QgbW9kZVwiLFxuICAgIEtFWVdPUkRfVU5FWFBFQ1RFRDogICAgICAgICAgICAgICAgICAgICBcIktleXdvcmQgJ3swfScgaXMgbm90IGV4cGVjdGVkIHRvIGFwcGVhciBpbiB0aGUgc2NoZW1hXCIsXG4gICAgS0VZV09SRF9NVVNUX0JFOiAgICAgICAgICAgICAgICAgICAgICAgIFwiS2V5d29yZCAnezB9JyBtdXN0IGJlIHsxfVwiLFxuICAgIEtFWVdPUkRfREVQRU5ERU5DWTogICAgICAgICAgICAgICAgICAgICBcIktleXdvcmQgJ3swfScgcmVxdWlyZXMga2V5d29yZCAnezF9J1wiLFxuICAgIEtFWVdPUkRfUEFUVEVSTjogICAgICAgICAgICAgICAgICAgICAgICBcIktleXdvcmQgJ3swfScgaXMgbm90IGEgdmFsaWQgUmVnRXhwIHBhdHRlcm46IHsxfVwiLFxuICAgIEtFWVdPUkRfVkFMVUVfVFlQRTogICAgICAgICAgICAgICAgICAgICBcIkVhY2ggZWxlbWVudCBvZiBrZXl3b3JkICd7MH0nIGFycmF5IG11c3QgYmUgYSAnezF9J1wiLFxuICAgIFVOS05PV05fRk9STUFUOiAgICAgICAgICAgICAgICAgICAgICAgICBcIlRoZXJlIGlzIG5vIHZhbGlkYXRpb24gZnVuY3Rpb24gZm9yIGZvcm1hdCAnezB9J1wiLFxuICAgIENVU1RPTV9NT0RFX0ZPUkNFX1BST1BFUlRJRVM6ICAgICAgICAgICBcInswfSBtdXN0IGRlZmluZSBhdCBsZWFzdCBvbmUgcHJvcGVydHkgaWYgcHJlc2VudFwiLFxuXG4gICAgLy8gUmVtb3RlIGVycm9yc1xuICAgIFJFRl9VTlJFU09MVkVEOiAgICAg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ICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSxcbiAgICBtYXhQcm9wZXJ0aWVzOiBmdW5jdGlvbiAocmVwb3J0LCBzY2hlbWEsIGpzb24pIHtcbiAgICAgICAgLy8gaHR0cDovL2pzb24tc2NoZW1hLm9yZy9sYXRlc3QvanNvbi1zY2hlbWEtdmFsaWRhdGlvbi5odG1sI3JmYy5zZWN0aW9uLjUuNC4xLjJcbiAgICAgICAgaWYgKFV0aWxzLndoYXRJcyhqc29uKSAhPT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHZhciBrZXlzQ291bnQgPSBPYmplY3Qua2V5cyhqc29uKS5sZW5ndGg7XG4gICAgICAgIGlmIChrZXlzQ291bnQgPiBzY2hlbWEubWF4UHJvcGVydGllcykge1xuICAgICAgICAgICAgcmVwb3J0LmFkZEVycm9yKFwiT0JKRUNUX1BST1BFUlRJRVNfTUFYSU1VTVwiLCBba2V5c0NvdW50LCBzY2hlbWEubWF4UHJvcGVydGllc10sIG51bGwsIHNjaGVtYS5kZXNjcmlwdGlvbik7XG4gICAgICAgIH1cbiAgICB9LFxuICAgIG1pblByb3BlcnRpZXM6IGZ1bmN0aW9uIChyZXBvcnQsIHNjaGVtYSwganNvbikge1xuICAgICAgICAvLyBodHRwOi8vanNvbi1zY2hlbWEub3JnL2xhdGVzdC9qc29uLXNjaGVtYS12YWxpZGF0aW9uLmh0bWwjcmZjLnNlY3Rpb24uNS40LjIuMlxuICAgICAgICBpZiAoVXRpbHMud2hhdElzKGpzb24pICE9PSBcIm9iamVjdFwiKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGtleXNDb3VudCA9IE9iamVjdC5rZXlzKGpzb24pLmxlbmd0aDtcbiAgICAgICAgaWYgKGtleXNDb3VudCA8IHNjaGVtYS5taW5Qcm9wZXJ0aWVzKSB7XG4gICAgICAgICAgICByZXBvcnQuYWRk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FkZGl0aW9uYWxQcm9wZXJ0aWVzID09PSBmYWxzZSkge1xuICAgICAgICAgICAgLy8gVGhlIHByb3BlcnR5IHNldCBvZiB0aGUganNvbiB0byB2YWxpZGF0ZS5cbiAgICAgICAgICAgIHZhciBzID0gT2JqZWN0LmtleXMoanNvbik7XG4gICAgICAgICAgICAvLyBUaGUgcHJvcGVydHkgc2V0IGZyb20gXCJwcm9wZXJ0aWVzXCIuXG4gICAgICAgICAgICB2YXIgcCA9IE9iamVjdC5rZXlzKHByb3BlcnRpZXMpO1xuICAgICAgICAgICAgLy8gVGhlIHByb3BlcnR5IHNldCBmcm9tIFwicGF0dGVyblByb3BlcnRpZXNcIi5cbiAgICAgICAgICAgIHZhciBwcCA9IE9iamVjdC5rZXlzKHBhdHRlcm5Qcm9wZXJ0aWVzKTtcbiAgICAgICAgICAgIC8vIHJlbW92ZSBmcm9tIFwic1wiIGFsbCBlbGVtZW50cyBvZiBcInBcIiwgaWYgYW55O1xuICAgICAgICAgICAgcyA9IFV0aWxzLmRpZmZlcmVuY2UocywgcCk7XG4gICAgICAgICAgICAvLyBmb3IgZWFjaCByZWdleCBpbiBcInBwXCIsIHJlbW92ZSBhbGwgZWxlbWVudHMgb2YgXCJzXCIgd2hpY2ggdGhpcyByZWdleCBtYXRjaGVzLlxuICAgICAgICAgICAgdmFyIGlkeCA9IHBwLmxlbmd0aDtcbiAgICAgICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgICAgIHZhciByZWdFeHAgPSBSZWdFeHAocHBbaWR4XSksXG4gICAgICAgICAgICAgICAgICAgIGlkeDIgPSBzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoaWR4Mi0tKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZWdFeHAudGVzdChzW2lkeDJdKSA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcy5zcGxpY2UoaWR4MiwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBWYWxpZGF0aW9uIG9mIHRoZSBqc29uIHN1Y2NlZWRzIGlmLCBhZnRlciB0aGVzZSB0d28gc3RlcHMsIHNldCBcInNcIiBpcyBlbXB0eS5cbiAgICAgICAgICAgIGlmIChzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAvLyBhc3N1bWVBZGRpdGlvbmFsIGNhbiBiZSBhbiBhcnJheSBvZiBhbGxvd2VkIHByb3BlcnRpZXNcbiAgICAgICAgICAgICAgICB2YXIgaWR4MyA9IHRoaXMub3B0aW9ucy5hc3N1bWVBZGRpdGlvbmFsLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAoaWR4Mykge1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoaWR4My0tKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW8gPSBzLmluZGV4T2YodGhpcy5vcHRpb25zLmFzc3VtZUFkZGl0aW9uYWxbaWR4M10pO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlvICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMuc3BsaWNlKGlvLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAocy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIk9CSkVDVF9BRERJVElPTkFMX1BST1BFUlRJRVNcIiwgW3NdLCBudWxsLCBzY2hlbWEuZGVzY3JpcHRpb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sXG4gICAgZGVwZW5kZW5jaWVzOiBmdW5jdGlvbiAocmVwb3J0LCBzY2hlbWEsIGpzb24pIHtcbiAgICAgICAgL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JvcGVydGllcyBpbiB0aGlzIGFycmF5XG4gICAgICAgICAgICAgICAgICAgIHZhciBpZHgyID0gZGVwZW5kZW5jeURlZmluaXRpb24ubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoaWR4Mi0tKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVxdWlyZWRQcm9wZXJ0eU5hbWUgPSBkZXBlbmRlbmN5RGVmaW5pdGlvbltpZHgyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqc29uW3JlcXVpcmVkUHJvcGVydHlOYW1lXSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwb3J0LmFkZEVycm9yKFwiT0JKRUNUX0RFUEVOREVOQ1lfS0VZXCIsIFtyZXF1aXJlZFByb3BlcnR5TmFtZSwgZGVwZW5kZW5jeU5hbWVdLCBudWxsLCBzY2hlbWEuZGVzY3JpcHRpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSxcbiAgICBlbnVtOiBmdW5jdGlvbiAocmVwb3J0LCBzY2hlbWEsIGpzb24pIHtcbiAgICAgICAgLy8gaHR0cDovL2pzb24tc2NoZW1hLm9yZy9sYXRlc3QvanNvbi1zY2hlbWEtdmFsaWRhdGlvbi5odG1sI3JmYy5zZWN0aW9uLjUuNS4xLjJcbiAgICAgICAgdmFyIG1hdGNoID0gZmFsc2UsXG4gICAgICAgICAgICBpZHggPSBzY2hlbWEuZW51bS5sZW5ndGg7XG4gICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgaWYgKFV0aWxzLmFyZUVxdWFsKGpzb24sIHNjaGVtYS5lbnVtW2lkeF0pKSB7XG4gICAgICAgICAgICAgICAgbWF0Y2ggPSB0cnVlO1xuICAgICAgICAgICAgICAgIGJy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2hlbWEpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc2NoZW1hID0gc2NoZW1hLl9fJHJlZlJlc29sdmVkO1xuICAgICAgICAgICAgICAgIGtleXMgPSBPYmplY3Qua2V5cyhzY2hlbWEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbWF4UmVmcy0tO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXhSZWZzID09PSAwKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJDaXJjdWxhciBkZXBlbmRlbmN5IGJ5ICRyZWYgcmVmZXJlbmNlcyFcIik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyB0eXBlIGNoZWNraW5nIGZpcnN0XG4gICAgLy8gaHR0cDovL2pzb24tc2NoZW1hLm9yZy9sYXRlc3QvanNvbi1zY2hlbWEtdmFsaWRhdGlvbi5odG1sI3JmYy5zZWN0aW9uLjUuNS4yLjJcbiAgICB2YXIganNvblR5cGUgPSBVdGlscy53aGF0SXMoanNvbik7XG4gICAgaWYgKHNjaGVtYS50eXBlKSB7XG4gICAgICAgIGlmICh0eXBlb2Ygc2NoZW1hLnR5cGUgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgIGlmIChqc29uVHlwZSAhPT0gc2NoZW1hLnR5cGUgJiYgKGpzb25UeXBlICE9PSBcImludGVnZXJcIiB8fCBzY2hlbWEudHlwZSAhPT0gXCJudW1iZXJcIikpIHtcbiAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJJTlZBTElEX1RZUEVcIiwgW3NjaGVtYS50eXBlLCBqc29uVHlwZV0sIG51bGwsIHNjaGVtYS5kZXNjcmlwdGlvbik7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5icmVha09uRmlyc3RFcnJvcikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHNjaGVtYS50eXBlLmluZGV4T2YoanNvblR5cGUpID09PSAtMSAmJiAoanNvblR5cGUgIT09IFwiaW50ZWdlclwiIHx8IHNjaGVtYS50eXBlLmluZGV4T2YoXCJudW1iZXJcIikgPT09IC0xKSkge1xuICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIklOVkFMSURfVFlQRVwiLCBbc2NoZW1hLnR5cGUsIGpzb25UeXBlXSwgbnVsbCwgc2NoZW1hLmRlc2NyaXB0aW9uKTtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmJyZWFrT25GaXJzdEVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBub3cgaXRlcmF0ZSBhbGwgdGhlIGtleXMgaW4gc2NoZW1hIGFuZCBleGVjdXRlIHZhbGlkYXRpb24gbWV0aG9kc1xuICAgIHZhciBpZHggPSBrZXlzLmxlbmd0aDtcbiAgICB3aGlsZSAoaWR4LS0pIHtcbiAgICAgICAgaWYgKEpzb25WYWxpZGF0b3JzW2tleXNbaWR4XV0pIHtcbiAgICAgICAgICAgIEpzb25WYWxpZGF0b3JzW2tleXNbaWR4XV0uY2FsbCh0aGlzLCByZXBvcnQsIHNjaGVtYSwganNvbik7XG4gICAgICAgICAgICBpZiAocmVwb3J0LmVycm9ycy5sZW5ndGggJiYgdGhpcy5vcHRpb25zLmJyZWFrT25GaXJzdEVycm9yKSB7IGJyZWFrOyB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAocmVwb3J0LmVycm9ycy5sZW5ndGggPT09IDAgfHwgdGhpcy5vcHRpb25zLmJyZWFrT25GaXJzdEVycm9yID09PSBmYWxzZSkge1xuICAgIC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B7XG4gICAgICAgICAgICAgICAgcmVwb3J0LmVycm9ycy5zcGxpY2UoaWR4LCAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHJlbWVtYmVyIGhvdyBtYW55IHdlcmUgY29tcGlsZWQgaW4gdGhlIGxhc3QgbG9vcFxuICAgICAgICBsYXN0TG9vcENvbXBpbGVkID0gY29tcGlsZWQ7XG5cbiAgICAgICAgLy8gY291bnQgaG93IG1hbnkgYXJlIGNvbXBpbGVkIG5vd1xuICAgICAgICBjb21waWxlZCA9IGNvbXBpbGVBcnJheU9mU2NoZW1hc0xvb3AuY2FsbCh0aGlzLCByZXBvcnQsIGFycik7XG5cbiAgICAgICAgLy8gZml4IF9fJG1pc3NpbmdSZWZlcmVuY2VzIGlmIHBvc3NpYmxlXG4gICAgICAgIGlkeCA9IGFyci5sZW5ndGg7XG4gICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgdmFyIHNjaCA9IGFycltpZHhdO1xuICAgICAgICAgICAgaWYgKHNjaC5fXyRtaXNzaW5nUmVmZXJlbmNlcykge1xuICAgICAgICAgICAgICAgIHZhciBpZHgyID0gc2NoLl9fJG1pc3NpbmdSZWZlcmVuY2VzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoaWR4Mi0tKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZWZPYmogPSBzY2guX18kbWlzc2luZ1JlZmVyZW5jZXNbaWR4Ml07XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXNwb25zZSA9IGZpbmRJZChhcnIsIHJlZk9iai5yZWYpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgbWlnaHQgY3JlYXRlIGNpcmN1bGFyIHJlZmVyZW5jZXNcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZk9iai5vYmpbXCJfX1wiICsgcmVmT2JqLmt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Zk9iaiA9IHJlZnNbaWR4XTtcbiAgICAgICAgdmFyIHJlc3BvbnNlID0gU2NoZW1hQ2FjaGUuZ2V0U2NoZW1hQnlVcmkuY2FsbCh0aGlzLCByZXBvcnQsIHJlZk9iai5yZWYsIHNjaGVtYSk7XG5cbiAgICAgICAgLy8gd2UgY2FuIHRyeSB0byB1c2UgY3VzdG9tIHNjaGVtYVJlYWRlciBpZiBhdmFpbGFibGVcbiAgICAgICAgaWYgKCFyZXNwb25zZSkge1xuICAgICAgICAgICAgdmFyIHNjaGVtYVJlYWRlciA9IHRoaXMuZ2V0U2NoZW1hUmVhZGVyKCk7XG4gICAgICAgICAgICBpZiAoc2NoZW1hUmVhZGVyKSB7XG4gICAgICAgICAgICAgICAgLy8gaXQncyBzdXBwb3NlZCB0byByZXR1cm4gYSB2YWxpZCBzY2hlbWFcbiAgICAgICAgICAgICAgICB2YXIgcyA9IHNjaGVtYVJlYWRlcihyZWZPYmoucmVmKTtcbiAgICAgICAgICAgICAgICBpZiAocykge1xuICAgICAgICAgICAgICAgICAgICAvLyBpdCBuZWVkcyB0byBoYXZlIHRoZSBpZFxuICAgICAgICAgICAgICAgICAgICBzLmlkID0gcmVmT2JqLnJlZjtcbiAgICAgICAgICAgICAgICAgICAgLy8gdHJ5IHRvIGNvbXBpbGUgdGhlIHNjaGVtYVxuICAgICAgICAgICAgICAgICAgICB2YXIgc3VicmVwb3J0ID0gbmV3IFJlcG9ydChyZXBvcnQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWV4cG9ydHMuY29tcGlsZVNjaGVtYS5jYWxsKHRoaXMsIHN1YnJlcG9ydCwgcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvcHkgZXJyb3JzIHRvIHJlcG9ydFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVwb3J0LmVycm9ycyA9IHJlcG9ydC5lcnJvcnMuY29uY2F0KHN1YnJlcG9ydC5lcnJvcnMpO1xuICAgICAgICAgICAgICAgICAgIC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ICAgICAgICAvLyBjdXN0b20gLSBmb3JjZVByb3BlcnRpZXNcbiAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5mb3JjZVByb3BlcnRpZXMgPT09IHRydWUgJiYga2V5cy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIkNVU1RPTV9NT0RFX0ZPUkNFX1BST1BFUlRJRVNcIiwgW1wicHJvcGVydGllc1wiXSk7XG4gICAgICAgIH1cbiAgICB9LFxuICAgIHBhdHRlcm5Qcm9wZXJ0aWVzOiBmdW5jdGlvbiAocmVwb3J0LCBzY2hlbWEpIHtcbiAgICAgICAgLy8gaHR0cDovL2pzb24tc2NoZW1hLm9yZy9sYXRlc3QvanNvbi1zY2hlbWEtdmFsaWRhdGlvbi5odG1sI3JmYy5zZWN0aW9uLjUuNC40LjFcbiAgICAgICAgaWYgKFV0aWxzLndoYXRJcyhzY2hlbWEucGF0dGVyblByb3BlcnRpZXMpICE9PSBcIm9iamVjdFwiKSB7XG4gICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1RZUEVfRVhQRUNURURcIiwgW1wicGF0dGVyblByb3BlcnRpZXNcIiwgXCJvYmplY3RcIl0pO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGtleXMgPSBPYmplY3Qua2V5cyhzY2hlbWEucGF0dGVyblByb3BlcnRpZXMpLFxuICAgICAgICAgICAgaWR4ID0ga2V5cy5sZW5ndGg7XG4gICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbaWR4XSxcbiAgICAgICAgICAgICAgICB2YWwgPSBzY2hlbWEucGF0dGVyblByb3BlcnRpZXNba2V5XTtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgUmVnRXhwKGtleSk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICA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Il0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIGtleXMgPSBPYmplY3Qua2V5cyhzY2hlbWEuZGVwZW5kZW5jaWVzKSxcbiAgICAgICAgICAgICAgICBpZHggPSBrZXlzLmxlbmd0aDtcbiAgICAgICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgICAgIHZhciBzY2hlbWFLZXkgPSBrZXlzW2lkeF0sXG4gICAgICAgICAgICAgICAgICAgIHNjaGVtYURlcGVuZGVuY3kgPSBzY2hlbWEuZGVwZW5kZW5jaWVzW3NjaGVtYUtleV0sXG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSBVdGlscy53aGF0SXMoc2NoZW1hRGVwZW5kZW5jeSk7XG5cbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQucGF0aC5wdXNoKFwiZGVwZW5kZW5jaWVzXCIpO1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQucGF0aC5wdXNoKHNjaGVtYUtleSk7XG4gICAgICAgICAgICAgICAgICAgIGV4cG9ydHMudmFsaWRhdGVTY2hlbWEuY2FsbCh0aGlzLCByZXBvcnQsIHNjaGVtYURlcGVuZGVuY3kpO1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQucGF0aC5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgcmVwb3J0LnBhdGgucG9wKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSBcImFycmF5XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGlkeDIgPSBzY2hlbWFEZXBlbmRlbmN5Lmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlkeDIgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfTVVTVF9CRVwiLCBbXCJkZXBlbmRlbmNpZXNcIiwgXCJub3QgZW1wdHkgYXJyYXlcIl0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChpZHgyLS0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc2NoZW1hRGVwZW5kZW5jeVtpZHgyXSAhPT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfVkFMVUVfVFlQRVwiLCBbXCJkZXBlbmRlbnNpY2VzXCIsIFwic3RyaW5nXCJdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoVXRpbHMuaXNVbmlxdWVBcnJheShzY2hlbWFEZXBlbmRlbmN5KSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfTVVTVF9CRVwiLCBbXCJkZXBlbmRlbmNpZXNcIiwgXCJhbiBhcnJheSB3aXRoIHVuaXF1ZSBpdGVtc1wiXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1ZBTFVFX1RZUEVcIiwgW1wiZGVwZW5kZW5jaWVzXCIsIFwib2JqZWN0IG9yIGFycmF5XCJdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9LFxuICAgIGVudW06IGZ1bmN0aW9uIChyZXBvcnQsIHNjaGVtYSkge1xuICAgICAgICAvLyBodHRwOi8vanNvbi1zY2hlbWEub3JnL2xhdGVzdC9qc29uLXNjaGVtYS12YWxpZGF0aW9uLmh0bWwjcmZjLnNlY3Rpb24uNS41LjEuMVxuICAgICAgICBpZiAoQX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m9FbXB0eVN0cmluZ3MgPT09IHRydWUpIHtcbiAgICAgICAgICAgIGlmIChzY2hlbWEudHlwZSA9PT0gXCJzdHJpbmdcIiB8fCBpc0FycmF5ICYmIHNjaGVtYS50eXBlLmluZGV4T2YoXCJzdHJpbmdcIikgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNjaGVtYS5taW5MZW5ndGggPT09IHVuZGVmaW5lZCAmJlxuICAgICAgICAgICAgICAgICAgICBzY2hlbWEuZW51bSA9PT0gdW5kZWZpbmVkICYmXG4gICAgICAgICAgICAgICAgICAgIHNjaGVtYS5mb3JtYXQgPT09IHVuZGVmaW5lZCkge1xuXG4gICAgICAgICAgICAgICAgICAgIHNjaGVtYS5taW5MZW5ndGggPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLm5vRW1wdHlBcnJheXMgPT09IHRydWUpIHtcbiAgICAgICAgICAgIGlmIChzY2hlbWEudHlwZSA9PT0gXCJhcnJheVwiIHx8IGlzQXJyYXkgJiYgc2NoZW1hLnR5cGUuaW5kZXhPZihcImFycmF5XCIpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmIChzY2hlbWEubWluSXRlbXMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICBzY2hlbWEubWluSXRlbXMgPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmZvcmNlUHJvcGVydGllcyA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgaWYgKHNjaGVtYS50eXBlID09PSBcIm9iamVjdFwiIHx8IGlzQXJyYXkgJiYgc2NoZW1hLnR5cGUuaW5kZXhPZihcIm9iamVjdFwiKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoc2NoZW1hLnByb3BlcnRpZXMgPT09IHVuZGVmaW5lZCAmJiBzY2hlbWEucGF0dGVyblByb3BlcnRpZXMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1VOREVGSU5FRF9TVFJJQ1RcIiwgW1wicHJvcGVydGllc1wiXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMuZm9yY2VJdGVtcyA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgaWYgKHNjaGVtYS50eXBlID09PSBcImFycmF5XCIgfHwgaXNBcnJheSAmJiBzY2hlbWEudHlwZS5pbmRleE9mKFwiYXJyYXlcIikgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNjaGVtYS5pdGVtcyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfVU5ERUZJTkVEX1NUUklDVFwiLCBbXCJpdGVtc1wiXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMuZm9yY2VNaW5JdGVtcyA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgaWYgKHNjaGVtYS50eXBlID09PSBcImFycmF5XCIgfHwgaXNBcnJheSAmJiBzY2hlbWEudHlwZS5pbmRleE9mKFwiYXJyYXlcIikgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNjaGVtYS5taW5JdGVtcyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfVU5ERUZJTkVEX1NUUklDVFwiLCBbXCJtaW5JdGVtc1wiXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMuZm9yY2VNYXhJdGVtcyA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgaWYgKHNjaGVtYS50eXBlID09PSBcImFycmF5XCIgfHwgaXNBcnJheSAmJiBzY2hlbWEudHlwZS5pbmRleE9mKFwiYXJyYXlcIikgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNjaGVtYS5tYXhJdGVtcyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfVU5ERUZJTkVEX1NUUklDVFwiLCBbXCJtYXhJdGVtc1wiXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMuZm9yY2VNaW5MZW5ndGggPT09IHRydWUpIHtcbiAgICAgICAgICAgIGlmIChzY2hlbWEudHlwZSA9PT0gXCJzdHJpbmdcIiB8fCBpc0FycmF5ICYmIHNjaGVtYS50eXBlLmluZGV4T2YoXCJzdHJpbmdcIikgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNjaGVtYS5taW5MZW5ndGggPT09IHVuZGVmaW5lZCAmJlxuICAgICAgICAgICAgICAgICAgICBzY2hlbWEuZm9ybWF0ID09PSB1bmRlZmluZWQgJiZcbiAgICAgICAgICAgICAgICAgICAgc2NoZW1hLmVudW0gPT09IHVuZGVmaW5lZCAmJlxuICAgICAgICAgICAgICAgICAgICBzY2hlbWEucGF0dGVybiA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfVU5ERUZJTkVEX1NUUklDVFwiLCBbXCJtaW5MZW5ndGhcIl0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmZvcmNlTWF4TGVuZ3R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y9sYXRlc3QvanNvbi1zY2hlbWEtdmFsaWRhdGlvbi5odG1sI3JmYy5zZWN0aW9uLjUuNS43LjFcbiAgICAgICAgaWYgKFV0aWxzLndoYXRJcyhzY2hlbWEuZGVmaW5pdGlvbnMpICE9PSBcIm9iamVjdFwiKSB7XG4gICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1RZUEVfRVhQRUNURURcIiwgW1wiZGVmaW5pdGlvbnNcIiwgXCJvYmplY3RcIl0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIGtleXMgPSBPYmplY3Qua2V5cyhzY2hlbWEuZGVmaW5pdGlvbnMpLFxuICAgICAgICAgICAgICAgIGlkeCA9IGtleXMubGVuZ3RoO1xuICAgICAgICAgICAgd2hpbGUgKGlkeC0tKSB7XG4gICAgICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbaWR4XSxcbiAgICAgICAgICAgICAgICAgICAgdmFsID0gc2NoZW1hLmRlZmluaXRpb25zW2tleV07XG4gICAgICAgICAgICAgICAgcmVwb3J0LnBhdGgucHVzaChcImRlZmluaXRpb25zXCIpO1xuICAgICAgICAgICAgICAgIHJlcG9ydC5wYXRoLnB1c2goa2V5KTtcbiAgICAgICAgICAgICAgICBleHBvcnRzLnZhbGlkYXRlU2NoZW1hLmNhbGwodGhpcywgcmVwb3J0LCB2YWwpO1xuICAgICAgICAgICAgICAgIHJlcG9ydC5wYXRoLnBvcCgpO1xuICAgICAgICAgICAgICAgIHJlcG9ydC5wYXRoLnBvcCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSxcbiAgICBmb3JtYXQ6IGZ1bmN0aW9uIChyZXBvcnQsIHNjaGVtYSkge1xuICAgICAgICBpZiAodHlwZW9mIHNjaGVtYS5mb3JtYXQgIT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfVFlQRV9FWFBFQ1RFRFw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VU5FWFBFQ1RFRFwiLCBba2V5XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAodGhpcy5vcHRpb25zLnBlZGFudGljQ2hlY2sgPT09IHRydWUpIHtcbiAgICAgICAgaWYgKHNjaGVtYS5lbnVtKSB7XG4gICAgICAgICAgICAvLyBicmVhayByZWN1cnNpb25cbiAgICAgICAgICAgIHZhciB0bXBTY2hlbWEgPSBVdGlscy5jbG9uZShzY2hlbWEpO1xuICAgICAgICAgICAgZGVsZXRlIHRtcFNjaGVtYS5lbnVtO1xuICAgICAgICAgICAgZGVsZXRlIHRtcFNjaGVtYS5kZWZhdWx0O1xuXG4gICAgICAgICAgICByZXBvcnQucGF0aC5wdXNoKFwiZW51bVwiKTtcbiAgICAgICAgICAgIGlkeCA9IHNjaGVtYS5lbnVtLmxlbmd0aDtcbiAgICAgICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgICAgIHJlcG9ydC5wYXRoLnB1c2goaWR4LnRvU3RyaW5nKCkpO1xuICAgICAgICAgICAgICAgIEpzb25WYWxpZGF0aW9uLnZhbGlkYXRlLmNhbGwodGhpcywgcmVwb3J0LCB0bXBTY2hlbWEsIHNjaGVtYS5lbnVtW2lkeF0pO1xuICAgICAgICAgICAgICAgIHJlcG9ydC5wYXRoLnBvcCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVwb3J0LnBhdGgucG9wKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc2NoZW1hLmRlZmF1bHQpIHtcbiAgICAgICAgICAgIHJlcG9ydC5wYXRoLnB1c2goXCJkZWZhdWx0XCIpO1xuICAgICAgICAgICAgSnNvblZhbGlkYXRpb24udmFsaWRhdGUuY2FsbCh0aGlzLCByZXBvcnQsIHNjaGVtYSwgc2NoZW1hLmRlZmF1bHQpO1xuICAgICAgICAgICAgcmVwb3J0LnBhdGgucG9wKCk7XG4gICAgICAgIH1cbiAgICB9XG5cbi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gKEFycmF5LmlzQXJyYXkoanNvbjEpICYmIEFycmF5LmlzQXJyYXkoanNvbjIpKSB7XG4gICAgICAgIC8vIGhhdmUgdGhlIHNhbWUgbnVtYmVyIG9mIGl0ZW1zOyBhbmRcbiAgICAgICAgaWYgKGpzb24xLmxlbmd0aCAhPT0ganNvbjIubGVuZ3RoKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgLy8gaXRlbXMgYXQgdGhlIHNhbWUgaW5kZXggYXJlIGVxdWFsIGFjY29yZGluZyB0byB0aGlzIGRlZmluaXRpb247IG9yXG4gICAgICAgIGxlbiA9IGpzb24xLmxlbmd0aDtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoIWFyZUVxdWFsKGpzb24xW2ldLCBqc29uMltpXSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgLy8gYm90aCBhcmUgb2JqZWN0cywgYW5kOlxuICAgIGlmIChleHBvcnRzLndoYXRJcyhqc29uMSkgPT09IFwib2JqZWN0XCIgJiYgZXhwb3J0cy53aGF0SXMoanNvbjIpID09PSBcIm9iamVjdFwiKSB7XG4gICAgICAgIC8vIGhhdmUgdGhlIHNhbWUgc2V0IG9mIHByb3BlcnR5IG5hbWVzOyBhbmRcbiAgICAgICAgdmFyIGtleXMxID0gT2JqZWN0LmtleXMoanNvbjEpO1xuICAgICAgICB2YXIga2V5czIgPSBPYmplY3Qua2V5cyhqc29uMik7XG4gICAgICAgIGlmICghYXJlRXF1YWwoa2V5czEsIGtleXMyKSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIC8vIHZhbHVlcyBmb3IgYSBzYW1lIHByb3BlcnR5IG5hbWUgYXJlIGVxdWFsIGFjY29yZGluZyB0byB0aGlzIGRlZmluaXRpb24uXG4gICAgICAgIGxlbiA9IGtleXMxLmxlbmd0aDtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoIWFyZUVxdWFsKGpzb24xW2tleXMxW2ldXSwganNvbjJba2V5czFbaV1dKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICByZXR1cm4gZmFsc2U7XG59O1xuXG5leHBvcnRzLmlzVW5pcXVlQXJyYXkgPSBmdW5jdGlvbiAoYXJyLCBpbmRleGVzKSB7XG4gICAgdmFyIGksIGosIGwgPSBhcnIubGVuZ3RoO1xuICAgIGZvciAoaSA9IDA7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgZm9yIChqID0gaSArIDE7IGogPCBsOyBqKyspIHtcbiAgICAgICAgICAgIGlmIChleHBvcnRzLmFyZUVxdWFsKGFycltpXSwgYXJyW2pdKSkge1xuICAgICAgICAgICAgICAgIGlmIChpbmRleGVzKSB7IGluZGV4ZXMucHVzaChpLCBqKTsgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gdHJ1ZTtcbn07XG5cbmV4cG9ydHMuZGlmZmVyZW5jZSA9IGZ1bmN0aW9uIChiaWdTZXQsIHN1YlNldCkge1xuICAgIHZhciBhcnIgPSBbXSxcbiAgICAgICAgaWR4ID0gYmlnU2V0Lmxlbmd0aDtcbiAgICB3aGlsZSAoaWR4LS0pIHtcbiAgICAgICAgaWYgKHN1YlNldC5pbmRleE9mKGJpZ1NldFtpZHhdKSA9PT0gLTEpIHtcbiAgICAgICAgICAgIGFyci5wdXNoKGJpZ1NldFtpZHhdKTtcbiAgICAgICAgfVxuICAg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A9IHZpc2l0ZWQuaW5kZXhPZihzcmMpO1xuICAgICAgICBpZiAoY2lkeCAhPT0gLTEpIHsgcmV0dXJuIGNsb25lZFtjaWR4XTsgfVxuXG4gICAgICAgIHZpc2l0ZWQucHVzaChzcmMpO1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShzcmMpKSB7XG4gICAgICAgICAgICByZXMgPSBbXTtcbiAgICAgICAgICAgIGNsb25lZC5wdXNoKHJlcyk7XG4gICAgICAgICAgICBpZHggPSBzcmMubGVuZ3RoO1xuICAgICAgICAgICAgd2hpbGUgKGlkeC0tKSB7XG4gICAgICAgICAgICAgICAgcmVzW2lkeF0gPSBjbG9uZURlZXAoc3JjW2lkeF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzID0ge307XG4gICAgICAgICAgICBjbG9uZWQucHVzaChyZXMpO1xuICAgICAgICAgICAgdmFyIGtleXMgPSBPYmplY3Qua2V5cyhzcmMpO1xuICAgICAgICAgICAgaWR4ID0ga2V5cy5sZW5ndGg7XG4gICAgICAgICAgICB3aGlsZSAoaWR4LS0pIHtcbiAgICAgICAgICAgICAgICB2YXIga2V5ID0ga2V5c1tpZHhdO1xuICAgICAgICAgICAgICAgIHJlc1trZXldID0gY2xvbmVEZWVwKHNyY1trZXldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH1cbiAgICByZXR1cm4gY2xvbmVEZWVwKHNyYyk7XG59O1xuXG4vKlxuICBmb2xsb3dpbmcgZnVuY3Rpb24gY29tZXMgZnJvbSBwdW55Y29kZS5qcyBsaWJyYXJ5XG4gIHNlZTogaHR0cHM6Ly9naXRodWIuY29tL2Jlc3RpZWpzL3B1bnljb2RlLmpzXG4qL1xuLypqc2hpbnQgLVcwMTYqL1xuLyoqXG4gKiBDcmVhdGVzIGFuIGFycmF5IGNvbnRhaW5pbmcgdGhlIG51bWVyaWMgY29kZS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YTtcbiAgICAgICAgICAgIGRlbGV0ZSBzY2hlbWEuJHJlZjtcbiAgICAgICAgICAgIGRlbGV0ZSBzY2hlbWEuX18kcmVmUmVzb2x2ZWQ7XG4gICAgICAgICAgICBmb3IgKGtleSBpbiBmcm9tKSB7XG4gICAgICAgICAgICAgICAgaWYgKGZyb20uaGFzT3duUHJvcGVydHkoa2V5KSkge1xuICAgICAgICAgICAgICAgICAgICB0b1trZXldID0gZnJvbVtrZXldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmb3IgKGtleSBpbiBzY2hlbWEpIHtcbiAgICAgICAgICAgIGlmIChzY2hlbWEuaGFzT3duUHJvcGVydHkoa2V5KSkge1xuICAgICAgICAgICAgICAgIGlmIChrZXkuaW5kZXhPZihcIl9fJFwiKSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgc2NoZW1hW2tleV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY2xlYW51cChzY2hlbWFba2V5XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcblxuICAgIGNsZWFudXAoc2NoZW1hKTtcbiAgICB2aXNpdGVkLmZvckVhY2goZnVuY3Rpb24gKHMpIHtcbiAgICAgICAgZGVsZXRlIHMuX19fJHZpc2l0ZWQ7XG4gICAgfSk7XG5cbiAgICB0aGlzLmxhc3RSZXBvcnQgPSByZXBvcnQ7XG4gICAgaWYgKHJlcG9ydC5pc1ZhbGlkKCkpIHtcbiAgICAgICAgcmV0dXJuIHNjaGVtYTtcbiAgICB9IGVsc2Uge1xuICAgICAgICB0aHJvdyB0aGlzLmdldExhc3RFcnJvcigpO1xuICAgIH1cbn07XG5aU2NoZW1hLnByb3RvdHlwZS5zZXRTY2hlbWFSZWFkZXIgPSBmdW5jdGlvbiAoc2NoZW1hUmVhZGVyKSB7XG4gICAg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AgICBcImlkXCI6IFwiaHR0cDovL2pzb24tc2NoZW1hLm9yZy9kcmFmdC0wNC9oeXBlci1zY2hlbWEjXCIsXG4gICAgXCJ0aXRsZVwiOiBcIkpTT04gSHlwZXItU2NoZW1hXCIsXG4gICAgXCJhbGxPZlwiOiBbXG4gICAgICAgIHtcbiAgICAgICAgICAgIFwiJHJlZlwiOiBcImh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvZHJhZnQtMDQvc2NoZW1hI1wiXG4gICAgICAgIH1cbiAgICBdLFxuICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiYWRkaXRpb25hbEl0ZW1zXCI6IHtcbiAgICAgICAgICAgIFwiYW55T2ZcIjogW1xuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiNcIlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcImJvb2xlYW5cIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjXCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVwZW5kZW5jaWVzXCI6IHtcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwiYW55T2ZcIjogW1xuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjXCJcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIlxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICAgIFwiYW55T2ZcIjogW1xuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiI1wiXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2NoZW1hQXJyYXlcIlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJkZWZpbml0aW9uc1wiOiB7XG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjXCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJwYXR0ZXJuUHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjXCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiNcIlxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBcImFsbE9mXCI6IHtcbiAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2NoZW1hQXJyYXlcIlxuICAgICAgICB9LFxuICAgICAgICBcImFueU9mXCI6IHtcbiAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2NoZW1hQXJyYXlcIlxuICAgICAgICB9LFxuICAgICAgICBcIm9uZU9mXCI6IHtcbiAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2NoZW1hQXJyYXlcIlxuICAgICAgICB9LFxuICAgICAgICBcIm5vdFwiOiB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjXCJcbiAgICAgICAgfSxcblxuICAgICAgICBcImxpbmtzXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2xpbmtEZXNjcmlwdGlvblwiXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwiZnJhZ21lbnRSZXNvbHV0aW9uXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWVkaWFcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJBIG1lZGlhIHR5cGUsIGFzIGRlc2NyaWJlZCBpbiBSRkMgMjA0NlwiLFxuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJiaW5hcnlFbmNvZGluZ1wiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJBIGNvbnRlbnQgZW5jb2Rpbmcgc2NoZW1lLCBhcyBkZXNjcmliZWQgaW4gUkZDIDIwNDVcIixcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwicGF0aFN0YXJ0XCI6IHtcbiAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJJbnN0YW5jZXMnIFVSSXMgbXVzdCBzdGFydCB3aXRoIHRoaXMgdmFsdWUgZm9yIHRoaXMgc2NoZW1hIHRvIGFwcGx5IHRvIHRoZW1cIixcbiAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgXCJmb3JtYXRcIjogXCJ1cmlcIlxuICAgICAgICB9XG4gICAgfSxcbiAgICBcImRlZmluaXRpb25zXCI6IHtcbiAgICAgICAgXCJzY2hlbWFBcnJheVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiI1wiXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwibGlua0Rlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICAgIFwidGl0bGVcIjogXCJMaW5rIERlc2NyaXB0aW9uIE9iamVjdFwiLFxuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCJocmVmXCIsIFwicmVsXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJocmVmXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcImEgVVJJIHRlbXBsYXRlLCBhcyBkZWZpbmVkIGJ5IFJGQyA2NTcwLCB3aXRoIHRoZSBhZGRpdGlvbiBvZiB0aGUgJCwgKCBhbmQgKSBjaGFyYWN0ZXJzIGZvciBwcmUtcHJvY2Vzc2luZ1wiLFxuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJyZWxcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwicmVsYXRpb24gdG8gdGhlIHRhcmdldCByZXNvdXJjZSBvZiB0aGUgbGlua1wiLFxuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJ0aXRsZVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJhIHRpdGxlIGZvciB0aGUgbGlua1wiLFxuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJ0YXJnZXRTY2hlbWFcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiSlNPTiBTY2hlbWEgZGVzY3JpYmluZyB0aGUgbGluayB0YXJnZXRcIixcbiAgICAgICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiI1wiXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBcIm1lZGlhVHlwZVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJtZWRpYSB0eXBlIChhcyBkZWZpbmVkIGJ5IFJGQyAyMDQ2KSBkZXNjcmliaW5nIHRoZSBsaW5rIHRhcmdldFwiLFxuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJtZXRob2RcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwibWV0aG9kIGZvciByZXF1ZXN0aW5nIHRoZSB0YXJnZXQgb2YgdGhlIGxpbmsgKGUuZy4gZm9yIEhUVFAgdGhpcyBtaWdodCBiZSBcXFwiR0VUXFxcIiBvciBcXFwiREVMRVRFXFxcIilcIixcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwiZW5jVHlwZVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJUaGUgbWVkaWEgdHlwZSBpbiB3aGljaCB0byBzdWJtaXQgZGF0YSBhbG9uZyB3aXRoIHRoZSByZXF1ZXN0XCIsXG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgICAgICAgICBcImRlZmF1bHRcIjogXCJhcHBsaWNhdGlvbi9qc29uXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwic2NoZW1hXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIlNjaGVtYSBkZXNjcmliaW5nIHRoZSBkYXRhIHRvIHN1Ym1pdCBhbG9uZyB3aXRoIHRoZSByZXF1ZXN0XCIsXG4gICAgICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiNcIlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cblxuIiwibW9kdWxlLmV4cG9ydHM9e1xuICAgIFwiaWRcIjogXCJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA0L3NjaGVtYSNcIixcbiAgICBcIiRzY2hlbWFcIjogXCJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA0L3NjaGVtYSNcIixcbiAgICBcImRlc2NyaXB0aW9uXCI6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Gllc1wiOiB7XG4gICAgICAgIFwiaWRcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgICBcImZvcm1hdFwiOiBcInVyaVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiJHNjaGVtYVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwiZm9ybWF0XCI6IFwidXJpXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ0aXRsZVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVmYXVsdFwiOiB7fSxcbiAgICAgICAgXCJtdWx0aXBsZU9mXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm51bWJlclwiLFxuICAgICAgICAgICAgXCJtaW5pbXVtXCI6IDAsXG4gICAgICAgICAgICBcImV4Y2x1c2l2ZU1pbmltdW1cIjogdHJ1ZVxuICAgICAgICB9LFxuICAgICAgICBcIm1heGltdW1cIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwibnVtYmVyXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJleGNsdXNpdmVNYXhpbXVtXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcImJvb2xlYW5cIixcbiAgICAgICAgICAgIFwiZGVmYXVsdFwiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcIm1pbmltdW1cIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwibnVtYmVyXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJleGNsdXNpdmVNaW5pbXVtXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcImJvb2xlYW5cIixcbiAgICAgICAgICAgIFw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H0sXG4gICAgICAgIFwidW5pcXVlSXRlbXNcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiLFxuICAgICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4UHJvcGVydGllc1wiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyXCIgfSxcbiAgICAgICAgXCJtaW5Qcm9wZXJ0aWVzXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJEZWZhdWx0MFwiIH0sXG4gICAgICAgIFwicmVxdWlyZWRcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3N0cmluZ0FycmF5XCIgfSxcbiAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7IFwidHlwZVwiOiBcImJvb2xlYW5cIiB9LFxuICAgICAgICAgICAgICAgIHsgXCIkcmVmXCI6IFwiI1wiIH1cbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJkZWZpbml0aW9uc1wiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogeyBcIiRyZWZcIjogXCIjXCIgfSxcbiAgICAgICAgICAgIFwiZGVmYXVsdFwiOiB7fVxuICAgICAgICB9LFxuICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHsgXCIkcmVmXCI6IFwiI1wiIH0sXG4gICAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJwYXR0ZXJuUHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogeyBcIiRyZWZcIjogXCIjXCIgfSxcbiAgICAgICAgICAgIFwiZGVmYXVsdFwiOiB7fVxuICAgICAgICB9LFxuICAgICAgICBcImRlcGVuZGVuY2llc1wiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwiYW55T2ZcIjogW1xuICAgICAgICAgICAgICAgICAgICB7IFwiJHJlZlwiOiBcIiNcIiB9LFxuICAgICAgICAgICAgICAgICAgICB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc3RyaW5nQXJyYXlcIiB9XG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBcImVudW1cIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgIFwibWluSXRlbXNcIjogMSxcbiAgICAgICAgICAgIFwidW5pcXVlSXRlbXNcIjogdHJ1ZVxuICAgICAgICB9LFxuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgICAgXCJhbnlPZlwiOiBbXG4gICAgICAgICAgICAgICAgeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NpbXBsZVR5cGVzXCIgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICAgICAgICAgIFwiaXRlbXNcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NpbXBsZVR5cGVzXCIgfSxcbiAgICAgICAgICAgICAgICAgIC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uICAgICAgICBcImF1dGhvcml6YXRpb25zXCI6IHsgXCIkcmVmXCI6IFwiYXV0aG9yaXphdGlvbk9iamVjdC5qc29uI1wiIH1cbiAgICB9LFxuICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgXCJkZWZpbml0aW9uc1wiOiB7XG4gICAgICAgIFwiYXBpT2JqZWN0XCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwicGF0aFwiLCBcIm9wZXJhdGlvbnNcIiBdLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcInBhdGhcIjoge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgICAgICAgICAgXCJmb3JtYXRcIjogXCJ1cmktdGVtcGxhdGVcIixcbiAgICAgICAgICAgICAgICAgICAgXCJwYXR0ZXJuXCI6IFwiXi9cIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH0sXG4gICAgICAgICAgICAgICAgXCJvcGVyYXRpb25zXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgICAgICAgICAgXCJpdGVtc1wiOiB7IFwiJHJlZlwiOiBcIm9wZXJhdGlvbk9iamVjdC5qc29uI1wiIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcIm1pbWVUeXBlQXJyYXlcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgIFwiaXRlbXNcIjoge1xuICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IFwibWltZS10eXBlXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHRydWVcbiAgICAgICAgfVxuICAgIH1cbn1cbiIsIm1vZHVsZS5leHBvcnRzPXtcbiAgICBcImlkXCI6IFwiaHR0cDovL3dvcmRuaWsuZ2l0aHViLmlvL3NjaGVtYXMvdjEuMi9hdXRob3JpemF0aW9uT2JqZWN0Lmpzb24jXCIsXG4gICAgXCIkc2NoZW1hXCI6IFwiaHR0cDovL2pzb24tc2NoZW1hLm9yZy9kcmFmdC0wNC9zY2hlbWEjXCIsXG4gICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwib25lT2ZcIjogW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvYmFzaWNBdXRoXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9hcGlLZXlcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL29hdXRoMlwiXG4gICAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICB9LFxuICAgIFwiZGVmaW5pdGlvbnNcIjoge1xuICAgICAgICBcImJhc2ljQXV0aFwiOiB7XG4gICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCJ0eXBlXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJiYXNpY0F1dGhcIiBdIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwiYXBpS2V5XCI6IHtcbiAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcInR5cGVcIiwgXCJwYXNzQXNcIiwgXCJrZXluYW1lXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJhcGlLZXlcIiBdIH0sXG4gICAgICAgICAgICAgICAgXCJwYXNzQXNcIjogeyBcImVudW1cIjogWyBcImhlYWRlclwiLCBcInF1ZXJ5XCIgXSB9LFxuICAgICAgICAgICAgICAgIFwia2V5bmFtZVwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwib2F1dGgyXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwidHlwZVwiLCBcImdyYW50VHlwZXNcIiBdLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcIm9hdXRoMlwiIF0gfSxcbiAgICAgICAgICAgICAgICBcInNjb3Blc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICAgICAgICAgIFwiaXRlbXNcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL29hdXRoMlNjb3BlXCIgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJncmFudFR5cGVz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FxuICAgICAgICB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcHJpbWl0aXZlVHlwZVwiIH0sXG4gICAgICAgIHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9tb2RlbFR5cGVcIiB9LFxuICAgICAgICB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvYXJyYXlUeXBlXCIgfVxuICAgIF0sXG4gICAgXCJkZWZpbml0aW9uc1wiOiB7XG4gICAgICAgIFwicmVmVHlwZVwiOiB7XG4gICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCIkcmVmXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCIkcmVmXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJ2b2lkVHlwZVwiOiB7XG4gICAgICAgICAgICBcImVudW1cIjogWyB7IFwidHlwZVwiOiBcInZvaWRcIiB9IF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJtb2RlbFR5cGVcIjoge1xuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwidHlwZVwiIF0sXG4gICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgICAgICAgICBcIm5vdFwiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcImVudW1cIjogWyBcImJvb2xlYW5cIiwgXCJpbnRlZ2VyXCIsIFwibnVtYmVyXCIsIFwic3RyaW5nXCIsIFwiYXJyYXlcIiBdXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcInByaW1pdGl2ZVR5cGVcIjoge1xuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwidHlwZVwiIF0sXG4gICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiZW51bVwiOiBbIFwiYm9vbGVhblwiLCBcImludGVnZXJcIiwgXCJudW1iZXJcIiwgXCJzdHJpbmdcIiBdXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBcImZvcm1hdFwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH0sXG4gICAgICAgICAgICAgICAgXCJkZWZhdWx0VmFsdWVcIjoge1xuICAgICAgICAgICAgICAgICAgICBcIm5vdFwiOiB7IFwidHlwZVwiOiBbIFwiYXJyYXlcIiwgXCJvYmplY3RcIiwgXCJudWxsXCIgXSB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBcImVudW1cIjoge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgICAgICAgICBcIml0ZW1zXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfSxcbiAgICAgICAgICAgICAgICAgICAgXCJtaW5JdGVtc1wiOiAxLFxuICAgICAgICAgICAgICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHRydWVcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwibWluaW11bVwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH0sXG4gICAgICAgICAgICAgICAgXCJtYXhpbXVtXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICAgICAgICBcImRlcGVuZGVuY2llc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJmb3JtYXRcIjoge1xuICAgICAgICAgICAgICAgICAgICBcIm9uZU9mXCI6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcImludGVnZXJcIiBdIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IHsgXCJlbnVtXCI6IFsgXCJpbnQzMlwiLCBcImludDY0XCIgXSB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcIm51bWJlclwiIF0gfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJmb3JtYXRcIjogeyBcImVudW1cIjogWyBcImZsb2F0XCIsIFwiZG91YmxlXCIgXSB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcInN0cmluZ1wiIF0gfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJmb3JtYXRcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJlbnVtXCI6IFsgXCJieXRlXCIsIFwiZGF0ZVwiLCBcImRhdGUtdGltZVwiIF1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJlbnVtXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7IFwiZW51bVwiOiBbIFwic3RyaW5nXCIgXSB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwibWluaW11bVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcImludGVnZXJcIiwgXCJudW1iZXJcIiBdIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJtYXhpbXVtXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7IFwiZW51bVwiOiBbIFwiaW50ZWdlclwiLCBcIm51bWJlclwiIF0gfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBcImFycmF5VHlwZVwiOiB7XG4gICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCJ0eXBlXCIsIFwiaXRlbXNcIiBdLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcImFycmF5XCIgXSB9LFxuICAgICAgICAgICAgICAgIFwiaXRlbXNcIjoge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgICAgICAgICBcIml0ZW1zXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9pdGVtc09iamVjdFwiIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwidW5pcXVlSXRlbXNcIjogeyBcInR5cGVcIjogXCJib29sZWFuXCIgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJpdGVtc09iamVjdFwiOiB7XG4gICAgICAgICAgICBcIm9uZU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcmVmVHlwZVwiXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwiYWxsT2ZcIjogW1xuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcHJpbWl0aXZlVHlwZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJmb3JtYXRcIjoge31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZ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RyaW5nXCIgfSxcbiAgICAgICAgICAgIFwidW5pcXVlSXRlbXNcIjogdHJ1ZSxcbiAgICAgICAgICAgIFwibWluSXRlbXNcIjogMVxuICAgICAgICB9LFxuICAgICAgICBcIm1pbmltdW1cIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICBcIm1heGltdW1cIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICBcIml0ZW1zXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9pdGVtc09iamVjdFwiIH0sXG4gICAgICAgIFwidW5pcXVlSXRlbXNcIjogeyBcInR5cGVcIjogXCJib29sZWFuXCIgfVxuICAgIH0sXG4gICAgXCJkZXBlbmRlbmNpZXNcIjoge1xuICAgICAgICBcImZvcm1hdFwiOiB7XG4gICAgICAgICAgICBcIm9uZU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcImludGVnZXJcIiBdIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBcImZvcm1hdFwiOiB7IFwiZW51bVwiOiBbIFwiaW50MzJcIiwgXCJpbnQ2NFwiIF0gfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcIm51bWJlclwiIF0gfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IHsgXCJlbnVtXCI6IFsgXCJmbG9hdFwiLCBcImRvdWJsZVwiIF0gfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcInN0cmluZ1wiIF0gfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImVudW1cIjogWyBcImJ5dGVcIiwgXCJkYXRlXCIsIFwiZGF0ZS10aW1lXCIgXVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICB9XG4gICAgfSxcbiAgICBcImRlZmluaXRpb25zXCI6IHtcbiAgICAgICAgXCJpdGVtc09iamVjdFwiOiB7XG4gICAgICAgICAgICBcIm9uZU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCIkcmVmXCIgXSxcbiAgICAgICAgICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiJHJlZlwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcImFsbE9mXCI6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHsgXCIkcmVmXCI6IFwiI1wiIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwidHlwZVwiIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHt9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImZvcm1hdFwiOiB7fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICB9XG4gICAgfVxufVxuIiwibW9kdWxlLmV4cG9ydHM9e1xuICAgIFwiaWRcIjogXCJodHRwOi8vd29yZG5pay5naXRodWIuaW8vc2NoZW1hcy92MS4yL2luZm9PYmplY3QuanNvbiNcIixcbiAgICBcIiRzY2hlbWFcIjogXCJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA0L3NjaGVtYSNcIixcbiAgICBcImRlc2NyaXB0aW9uXCI6IFwiaW5mbyBvYmplY3QgKHNlY3Rpb24gNS4xLjMpXCIsXG4gICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgXCJyZXF1aXJlZFwiOiBbIFwidGl0bGVcIiwgXCJkZXNjcmlwdGlvblwiIF0sXG4gICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJ0aXRsZVwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH0sXG4gICAgICAgIFwiZGVzY3JpcHRpb25cIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICBcInRlcm1zT2ZTZXJ2aWNlVXJsXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIsIFwiZm9ybWF0XCI6IFwidXJpXCIgfSxcbiAgICAgICAgXCJjb250YWN0XCI6IHsgXCJ0eXBlXCI6I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GlvbnMvYXV0aG9yaXphdGlvbkNvZGVcIiB9XG4gICAgfSxcbiAgICBcImRlZmluaXRpb25zXCI6IHtcbiAgICAgICAgXCJpbXBsaWNpdFwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcImxvZ2luRW5kcG9pbnRcIiBdLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcImxvZ2luRW5kcG9pbnRcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2xvZ2luRW5kcG9pbnRcIiB9LFxuICAgICAgICAgICAgICAgIFwidG9rZW5OYW1lXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJhdXRob3JpemF0aW9uQ29kZVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcInRva2VuRW5kcG9pbnRcIiwgXCJ0b2tlblJlcXVlc3RFbmRwb2ludFwiIF0sXG4gICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwidG9rZW5FbmRwb2ludFwiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdG9rZW5FbmRwb2ludFwiIH0sXG4gICAgICAgICAgICAgICAgXCJ0b2tlblJlcXVlc3RFbmRwb2ludFwiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdG9rZW5SZXF1ZXN0RW5kcG9pbnRcIiB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcImxvZ2luRW5kcG9pbnRcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCJ1cmxcIiBdLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcInVybFwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiLCBcImZvcm1hdFwiOiBcInVyaVwiIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwidG9rZW5FbmRwb2ludFwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcInVybFwiIF0sXG4gICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwidXJsXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIsIFwiZm9ybWF0XCI6IFwidXJpXCIgfSxcbiAgICAgICAgICAgICAgICBcInRva2VuTmFtZVwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwidG9rZW5SZXF1ZXN0RW5kcG9pbnRcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCJ1cmxcIiBdLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcInVybFwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiLCBcImZvcm1hdFwiOiBcInVyaVwiIH0sXG4gICAgICAgICAgICAgICAgXCJjbGllbnRJZ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ICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgICAgICAgICBcInBhdHRlcm5cIjogXCJeW2EtekEtWjAtOV9dKyRcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJhdXRob3JpemF0aW9uc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCJhdXRob3JpemF0aW9uT2JqZWN0Lmpzb24jL2RlZmluaXRpb25zL29hdXRoMlNjb3BlXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJwYXJhbWV0ZXJzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgICAgICAgICAgXCJpdGVtc1wiOiB7IFwiJHJlZlwiOiBcInBhcmFtZXRlck9iamVjdC5qc29uI1wiIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwicmVzcG9uc2VNZXNzYWdlc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICAgICAgICAgIFwiaXRlbXNcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3Jlc3BvbnNlTWVzc2FnZU9iamVjdFwifVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJwcm9kdWNlc1wiOiB7IFwiJHJl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gICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgIFwiaXRlbXNcIjoge1xuICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IFwibWltZS10eXBlXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHRydWVcbiAgICAgICAgfVxuICAgIH1cbn1cbiIsIm1vZHVsZS5leHBvcnRzPXtcbiAgICBcImlkXCI6IFwiaHR0cDovL3dvcmRuaWsuZ2l0aHViLmlvL3NjaGVtYXMvdjEuMi9wYXJhbWV0ZXJPYmplY3QuanNvbiNcIixcbiAgICBcIiRzY2hlbWFcIjogXCJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA0L3NjaGVtYSNcIixcbiAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICBcImFsbE9mXCI6IFtcbiAgICAgICAgeyBcIiRyZWZcIjogXCJkYXRhVHlwZUJhc2UuanNvbiNcIiB9LFxuICAgICAgICB7XG4gICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCJwYXJhbVR5cGVcIiwgXCJuYW1lXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJwYXJhbVR5cGVcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImVudW1cIjogWyBcInBhdGhcIiwgXCJxdWVyeVwiLCBcImJvZHlcIiwgXCJoZWFkZXJcIiwgXCJmb3JtXCIgXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJuYW1lXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfSxcbiAgICAgICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfSxcbiAgICAgICAgICAgICAgICBcInJlcXVpcmVkXCI6IHsgXCJ0eXBlXCI6IFwiYm9vbGVhblwiIH0sXG4gICAgICAgICAgICAgICAgXCJhbGxvd011bHRpcGxlXCI6IHsgXCJ0eXBlXCI6IFwiYm9vbGVhblwiIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcInR5cGUgRmlsZSByZXF1aXJlcyBzcGVjaWFsIHBhcmFtVHlwZSBhbmQgY29uc3VtZXNcIixcbiAgICAgICAgICAgIFwib25lT2ZcIjogW1xuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7IFwibm90XCI6IHsgXCJlbnVtXCI6IFsgXCJGaWxlXCIgXSB9IH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJGaWxlXCIgXSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJwYXJhbVR5cGVcIjogeyBcImVudW1cIjogWyBcImZvcm1cIiBdIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBcImNvbnN1bWVzXCI6IHsgXCJlbnVtXCI6IFsgXCJtdWx0aXBhcnQvZm9ybS1kYXRhXCIgXSB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgIH1cbiAgICBdXG59XG4iLCJtb2R1bGUuZXhwb3J0cz17XG4gICAgXCJpZFwiOiBcImh0dHA6Ly93b3JkbmlrLmdpdGh1Yi5pby9zY2hlbWFzL3YxLjIvcmVzb3VyY2VMaXN0aW5nLmpzb24jXCIsXG4gICAg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gICAgICBcImNvbnRhY3RcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvY29udGFjdFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibGljZW5zZVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9saWNlbnNlXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgXCJjb250YWN0XCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIkNvbnRhY3QgaW5mb3JtYXRpb24gZm9yIHRoZSBvd25lcnMgb2YgdGhlIEFQSS5cIixcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIm5hbWVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJUaGUgaWRlbnRpZnlpbmcgbmFtZSBvZiB0aGUgY29udGFjdCBwZXJzb24vb3JnYW5pemF0aW9uLlwiXG4gICAgICAgIH0sXG4gICAgICAgIFwidXJsXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiVGhlIFVSTCBwb2ludGluZyB0byB0aGUgY29udGFjdCBpbmZvcm1hdGlvbi5cIixcbiAgICAgICAgICBcImZvcm1hdFwiOiBcInVyaVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZW1haWxcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJUaGUgZW1haWwgYWRkcmVzcyBvZiB0aGUgY29udGFjdCBwZXJzb24vb3JnYW5pemF0aW9uLlwiLFxuICAgICAgICAgIFwiZm9ybWF0XCI6IFwiZW1haWxcIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwYXR0ZXJuUHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiXngtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ZlbmRvckV4dGVuc2lvblwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwibGljZW5zZVwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcIm5hbWVcIlxuICAgICAgXSxcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIm5hbWVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJUaGUgbmFtZSBvZiB0aGUgbGljZW5zZSB0eXBlLiBJdCdzIGVuY291cmFnZWQgdG8gdXNlIGFuIE9TSSBjb21wYXRpYmxlIGxpY2Vuc2UuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ1cmxcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJUaGUgVVJMIHBvaW50aW5nIHRvIHRoZSBsaWNlbnNlLlwiLFxuICAgICAgICAgIFwiZm9ybWF0XCI6IFwidXJpXCJcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBcInBhdGhzXCI6IHtcbiAgICAgIFwidH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AgICB9LFxuICAgIFwiZXhhbXBsZXNcIjoge1xuICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHRydWVcbiAgICB9LFxuICAgIFwibWltZVR5cGVcIjoge1xuICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICBcImRlc2NyaXB0aW9uXCI6IFwiVGhlIE1JTUUgdHlwZSBvZiB0aGUgSFRUUCBtZXNzYWdlLlwiXG4gICAgfSxcbiAgICBcIm9wZXJhdGlvblwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcInJlc3BvbnNlc1wiXG4gICAgICBdLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJ0YWdzXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgIFwiaXRlbXNcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIFwidW5pcXVlSXRlbXNcIjogdHJ1ZVxuICAgICAgICB9LFxuICAgICAgICBcInN1bW1hcnlcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJBIGJyaWVmIHN1bW1hcnkgb2YgdGhlIG9wZXJhdGlvbi5cIlxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0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nNlc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9yZXNwb25zZXNcIlxuICAgICAgICB9LFxuICAgICAgICBcInNjaGVtZXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2NoZW1lc0xpc3RcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlcHJlY2F0ZWRcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcImJvb2xlYW5cIixcbiAgICAgICAgICBcImRlZmF1bHRcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJzZWN1cml0eVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zZWN1cml0eVwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwicGF0aEl0ZW1cIjoge1xuICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlLFxuICAgICAgXCJwYXR0ZXJuUHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiXngtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ZlbmRvckV4dGVuc2lvblwiXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIiRyZWZcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZ2V0XCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL29wZXJhdGlvblwiXG4gICAgICAgIH0sXG4gICAgICAgIFwicHV0XCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL29wZXJhdGlvblwiXG4gICAgICAgIH0sXG4gICAgICAgIFwicG9zdFwiOiB7XG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9ucy9yZXNwb25zZVZhbHVlXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJeeC1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdmVuZG9yRXh0ZW5zaW9uXCJcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFwibm90XCI6IHtcbiAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICAgIFwiXngtXCI6IHtcbiAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdmVuZG9yRXh0ZW5zaW9uXCJcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwicmVzcG9uc2VWYWx1ZVwiOiB7XG4gICAgICBcIm9uZU9mXCI6IFtcbiAgICAgICAge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcmVzcG9uc2VcIlxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9qc29uUmVmZXJlbmNlXCJcbiAgICAgICAgfVxuICAgICAgXVxuICAgIH0sXG4gICAgXCJyZXNwb25zZVwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcImRlc2NyaXB0aW9uXCJcbiAgICAgIF0sXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcInNjaGVtYVwiOiB7XG4gICAgICAgICAgXCJvbmVPZlwiOiBbXG4gICAgICAgICAgICB7XG4g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gXCJ0eXBlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwibnVtYmVyXCIsXG4gICAgICAgICAgICBcImludGVnZXJcIixcbiAgICAgICAgICAgIFwiYm9vbGVhblwiLFxuICAgICAgICAgICAgXCJhcnJheVwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImZvcm1hdFwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9wcmltaXRpdmVzSXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcImNvbGxlY3Rpb25Gb3JtYXRcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvY29sbGVjdGlvbkZvcm1hdFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVmYXVsdFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9kZWZhdWx0XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhpbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21heGltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcImV4Y2x1c2l2ZU1heGltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZXhjbHVzaXZlTWF4aW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWluaW11bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9taW5pbXVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJleGNsdXNpdmVNaW5pbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2V4Y2x1c2l2ZU1pbmltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcIm1heExlbmd0aFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9tYXhMZW5ndGhcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1pbkxlbmd0aFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9taW5MZW5ndGhcIlxuICAgICAgICB9LFxuICAgICAgICBcInBhdHRlcm5cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcGF0dGVyblwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4SXRlbXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWF4SXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1pbkl0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbkl0ZW1zXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ1bmlxdWVJdGVtc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy91bmlxdWVJdGVtc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZW51bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9lbnVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtdWx0aXBsZU9mXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL211bHRpcGxlT2ZcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwYXR0Z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ICAgIFwic3RyaW5nXCIsXG4gICAgICAgICAgICBcIm51bWJlclwiLFxuICAgICAgICAgICAgXCJib29sZWFuXCIsXG4gICAgICAgICAgICBcImludGVnZXJcIixcbiAgICAgICAgICAgIFwiYXJyYXlcIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJmb3JtYXRcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiaXRlbXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcHJpbWl0aXZlc0l0ZW1zXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJjb2xsZWN0aW9uRm9ybWF0XCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2NvbGxlY3Rpb25Gb3JtYXRcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlZmF1bHRcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZGVmYXVsdFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4aW11bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9tYXhpbXVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJleGNsdXNpdmVNYXhpbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2V4Y2x1c2l2ZU1heGltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcIm1pbmltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWluaW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXhjbHVzaXZlTWluaW11bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9leGNsdXNpdmVNaW5pbXVtXCJcbiAgICAgICAgfSxcbiAg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iRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ZlbmRvckV4dGVuc2lvblwiXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcInJlcXVpcmVkXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIkRldGVybWluZXMgd2hldGhlciBvciBub3QgdGhpcyBwYXJhbWV0ZXIgaXMgcmVxdWlyZWQgb3Igb3B0aW9uYWwuXCIsXG4gICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwiaW5cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJEZXRlcm1pbmVzIHRoZSBsb2NhdGlvbiBvZiB0aGUgcGFyYW1ldGVyLlwiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcInF1ZXJ5XCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVzY3JpcHRpb25cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJBIGJyaWVmIGRlc2NyaXB0aW9uIG9mIHRoZSBwYXJhbWV0ZXIuIFRoaXMgY291bGQgY29udGFpbiBleGFtcGxlcyBvZiB1c2UuICBHaXRIdWIgRmxhdm9yZWQgTWFya2Rvd24gaXMgYWxsb3dlZC5cIlxuICAgICAgICB9LFxuICAgICAgICBcIm5hbWVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJUaGUgbmFtZSBvZiB0aGUgcGFyYW1ldGVyLlwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiYWxsb3dFbXB0eVZhbHVlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJhbGxvd3Mgc2VuZGluZyBhIHBhcmFtZXRlciBieSBuYW1lIG9ubHkgb3Igd2l0aCBhbiBlbXB0eSB2YWx1ZS5cIlxuICAgICAgICB9LFxuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcInN0cmluZ1wiLFxuICAgICAgICAgICAgXCJudW1iZXJcIixcbiAgICAgICAgICAgIFwiYm9vbGVhblwiLFxuICAgICAgICAgICAgXCJpbnRlZ2VyXCIsXG4gICAgICAgICAgICBcImFycmF5XCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZm9ybWF0XCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ByaW1pdGl2ZXNJdGVtc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiY29sbGVjdGlvbkZvcm1hdFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9jb2xsZWN0aW9uRm9ybWF0V2l0aE11bHRpXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZWZhdWx0XCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2RlZmF1bHRcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1heGltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWF4aW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIF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luaXRpb25zL2VudW1cIlxuICAgICAgICB9LFxuICAgICAgICBcIm11bHRpcGxlT2ZcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbXVsdGlwbGVPZlwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwiZm9ybURhdGFQYXJhbWV0ZXJTdWJTY2hlbWFcIjoge1xuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJyZXF1aXJlZFwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJEZXRlcm1pbmVzIHdoZXRoZXIgb3Igbm90IHRoaXMgcGFyYW1ldGVyIGlzIHJlcXVpcmVkIG9yIG9wdGlvbmFsLlwiLFxuICAgICAgICAgIFwiZGVmYXVsdFwiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcImluXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiRGV0ZXJtaW5lcyB0aGUgbG9jYXRpb24gb2YgdGhlIHBhcmFtZXRlci5cIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJmb3JtRGF0YVwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiQSBicmllZiBkZXNjcmlwdGlvbiBvZiB0aGUgcGFyYW1ldGVyLiBUaGlzIGNvdWxkIGNvbnRhaW4gZXhhbXBsZXMgb2YgdXNlLiAgR2l0SHViIEZsYXZvcmVkIE1hcmtkb3duIGlzIGFsbG93ZWQuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJuYW1lXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiVGhlIG5hbWUgb2YgdGhlIHBhcmFtZXRlci5cIlxuICAgICAgICB9LFxuICAgICAgICBcImFsbG93RW1wdHlWYWx1ZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiLFxuICAgICAgICAgIFwiZGVmYXVsdFwiOiBmYWxzZSxcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiYWxsb3dzIHNlbmRpbmcgYSBwYXJhbWV0ZXIgYnkgbmFtZSBvbmx5IG9yIHdpdGggYW4gZW1wdHkgdmFsdWUuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ0eXBlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwibnVtYmVyXCIsXG4gICAgICAgICAgICBcImJvb2xlYW5cIixcbiAgICAgICAgICAgIFwiaW50ZWdlclwiLFxuICAgICAgICAgICAgXCJhcnJheVwiLFxuICAgICAgICAgICAgXCJmaWxlXCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZm9ybWF0XCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ByaW1p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AgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiRGV0ZXJtaW5lcyB3aGV0aGVyIG9yIG5vdCB0aGlzIHBhcmFtZXRlciBpcyByZXF1aXJlZCBvciBvcHRpb25hbC5cIlxuICAgICAgICB9LFxuICAgICAgICBcImluXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiRGV0ZXJtaW5lcyB0aGUgbG9jYXRpb24gb2YgdGhlIHBhcmFtZXRlci5cIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJwYXRoXCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVzY3JpcHRpb25cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJBIGJyaWVmIGRlc2NyaXB0aW9uIG9mIHRoZSBwYXJhbWV0ZXIuIFRoaXMgY291bGQgY29udGFpbiBleGFtcGxlcyBvZiB1c2UuICBHaXRIdWIgRmxhdm9yZWQgTWFya2Rvd24gaXMgYWxsb3dlZC5cIlxuICAgICAgICB9LFxuICAgICAgICBcIm5hbWVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJUaGUgbmFtZSBvZiB0aGUgcGFyYW1ldGVyLlwiXG4gICAgICAgIH0sXG4gICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwic3RyaW5nXCIsXG4gICAgICAgICAgICBcIm51bWJlclwiLFxuICAgICAgICAgICAgXCJib29sZWFuXCIsXG4gICAgICAgICAgICBcImludGVnZXJcIixcbiAgICAgICAgICAgIFwiYXJyYXlcIlxuICAgICAgIC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ICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWluTGVuZ3RoXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJwYXR0ZXJuXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3BhdHRlcm5cIlxuICAgICAgICB9LFxuICAgICAgICBcIm1heEl0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21heEl0ZW1zXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtaW5JdGVtc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9taW5JdGVtc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwidW5pcXVlSXRlbXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdW5pcXVlSXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcImVudW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZW51bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibXVsdGlwbGVPZlwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9tdWx0aXBsZU9mXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgXCJub25Cb2R5UGFyYW1ldGVyXCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJyZXF1aXJlZFwiOiBbXG4gICAgICAgIFwibmFtZVwiLFxuICAgICAgICBcImluXCIsXG4gICAgICAgIFwidHlwZVwiXG4gICAgICBdLFxuICAgICAgXCJvbmVPZlwiOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2hlYWRlclBhcmFtZXRlclN1YlNjaGVtYVwiXG4gICAgICAgIH0sXG4gICAgICAgIH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zL3NjaGVtYVwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBdLFxuICAgICAgICAgIFwiZGVmYXVsdFwiOiB7fVxuICAgICAgICB9LFxuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcImh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvZHJhZnQtMDQvc2NoZW1hIy9wcm9wZXJ0aWVzL3R5cGVcIlxuICAgICAgICB9LFxuICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zY2hlbWFcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgICAgXCJtaW5JdGVtc1wiOiAxLFxuICAgICAgICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYVwiXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICBdLFxuICAgICAgICAgIFwiZGVmYXVsdFwiOiB7fVxuICAgICAgICB9LFxuICAgICAgICBcImFsbE9mXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgIFwibWluSXRlbXNcIjogMSxcbiAgICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2NoZW1hXCJcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYVwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJkaXNjcmltaW5hdG9yXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcInJlYWRPbmx5XCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwieG1sXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3htbFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXh0ZXJuYWxEb2NzXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2V4dGVybmFsRG9jc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXhhbXBsZVwiOiB7fVxuICAgICAgfSxcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2VcbiAgICB9LFxuICAgIFwiZmlsZVNjaGVtYVwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJBIGRldGVybWluaXN0aWMgdmVyc2lvbiBvZiBhIEpTT04gU2NoZW1hIG9iamVjdC5cIixcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJyZXF1aXJlZFwiOiBbXG4gICAgICA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ybmFsRG9jc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9leHRlcm5hbERvY3NcIlxuICAgICAgICB9LFxuICAgICAgICBcImV4YW1wbGVcIjoge31cbiAgICAgIH0sXG4gICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlXG4gICAgfSxcbiAgICBcInByaW1pdGl2ZXNJdGVtc1wiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcInN0cmluZ1wiLFxuICAgICAgICAgICAgXCJudW1iZXJcIixcbiAgICAgICAgICAgIFwiaW50ZWdlclwiLFxuICAgICAgICAgICAgXCJib29sZWFuXCIsXG4gICAgICAgICAgICBcImFycmF5XCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZm9ybWF0XCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ByaW1pdGl2ZXNJdGVtc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiY29sbGVjdGlvbkZvcm1hdFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9jb2xsZWN0aW9uRm9ybWF0XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZWZhdWx0XCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2RlZmF1bHRcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1heGltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWF4aW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXhjbHVzaXZlTWF4aW11bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9leGNsdXNpdmVNYXhpbXVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtaW5pbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbmltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcImV4Y2x1c2l2ZU1pbmltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZXhjbHVzaXZlTWluaW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4TGVuZ3RoXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21heExlbmd0aFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWluTGVuZ3RoXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbkxlbmd0aFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwicGF0dGVyblwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9wYXR0ZXJuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhJdGVtc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9tYXhJdGVtc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWluSXRlbXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWluSXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3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sc2UsXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIm5hbWVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwibmFtZXNwYWNlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcInByZWZpeFwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJhdHRyaWJ1dGVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcImJvb2xlYW5cIixcbiAgICAgICAgICBcImRlZmF1bHRcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJ3cmFwcGVkXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBcInBhdHRlcm5Qcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJeeC1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdmVuZG9yRXh0ZW5zaW9uXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgXCJ0YWdcIjoge1xuICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlLFxuICAgICAgXCJyZXF1aXJlZFwiOiBbXG4gICAgICAgIFwibmFtZVwiXG4gICAgICBdLFxuICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJuYW1lXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcImV4dGVybmFsRG9jc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9leHRlcm5hbERvY3NcIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwYXR0ZXJuUHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiXngtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ZlbmRvckV4dGVuc2lvblwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwic2VjdXJpdHlEZWZpbml0aW9uc1wiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIm9uZU9mXCI6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2Jhc2ljQXV0aGVudGljYXRpb25TZWN1cml0eVwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2FwaUtleVNlY3VyaXR5XCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvb2F1dGgySW1wbGljaXRTZWN1cml0eVwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL29hdXRoMlBhc3N3b3JkU2VjdXJpdHlcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9vYXV0aDJBcHBsaWNhdGlvblNlY3VyaXR5XCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvb2F1dGgyQWNjZXNzQ29kZVNlY3VyaXR5XCJcbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwiYmFzaWNBdXRoZW50aWNhdGlvblNlY3VyaXR5XCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcInR5cGVcIlxuICAgICAgXSxcbiAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwiYmFzaWNcIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXNjcmlwdGlvblwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBcImFwaUtleVNlY3VyaXR5XCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcInR5cGVcIixcbiAgICAgICAgXCJuYW1lXCIsXG4gICAgICAgIFwiaW5cIlxuICAgICAgXSxcbiAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwiYXBpS2V5XCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwibmFtZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJpblwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwiaGVhZGVyXCIsXG4gICAgICAgICAgICBcInF1ZXJ5XCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVzY3JpcHRpb25cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBcInBhdHRlcm5Qcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJeeC1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdmVuZG9yRXh0ZW5zaW9uXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgXCJvYXV0aDJJbXBsaWNpdFNlY3VyaXR5XCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcInR5cGVcIixcbiAgICAgICAgXCJmbG93XCIsXG4gICAgICAgIFwiYXV0aG9yaXphdGlvblVybFwiXG4gICAgICBdLFxuICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJ0eXBlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJvYXV0aDJcIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJmbG93XCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJpbXBsaWNpdFwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcInNjb3Blc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9vYXV0aDJTY29wZXNcIlxuICAgICAgICB9LFxuICAgICAgICBcImF1dGhvcml6YXRpb25VcmxcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZm9ybWF0XCI6IFwidXJpXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXNjcmlwdGlvblwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBcIm9hdXRoMlBhc3N3b3JkU2VjdXJpdHlcIjoge1xuICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlLFxuICAgICAgXCJyZXF1aXJlZFwiOiBbXG4gICAgICAgIFwidHlwZVwiLFxuICAgICAgICBcImZsb3dcIixcbiAgICAgICAgXCJ0b2tlblVybFwiXG4gICAgICBdLFxuICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJ0eXBlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJvYXV0aDJcIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJmbG93XCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJwYXNzd29yZFwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcInNjb3Blc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9vYXV0aDJTY29wZXNcIlxuICAgICAgICB9LFxuICAgICAgICBcInRva2VuVXJsXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImZvcm1hdFwiOiBcInVyaVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVzY3JpcHRpb25cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBcInBhdHRlcm5Qcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJeeC1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdmVuZG9yRXh0ZW5zaW9uXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgXCJvYXV0aDJBcHBsaWNhdGlvblNlY3VyaXR5XCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcInR5cGVcIixcbiAgICAgICAgXCJmbG93XCIsXG4gICAgICAgIFwidG9rZW5VcmxcIlxuICAgICAgXSxcbiAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwib2F1dGgyXCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZmxvd1wiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwiYXBwbGljYXRpb25cIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJzY29wZXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvb2F1dGgyU2NvcGVzXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ0b2tlblVybFwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJmb3JtYXRcIjogXCJ1cmlcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwYXR0ZXJuUHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiXngtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ZlbmRvckV4dGVuc2lvblwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwib2F1dGgyQWNjZXNzQ29kZVNlY3VyaXR5XCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcInR5cGVcIixcbiAgICAgICAgXCJmbG93XCIsXG4gICAgICAgIFwiYXV0aG9yaXphdGlvblVybFwiLFxuICAgICAgICBcInRva2VuVXJsXCJcbiAgICAgIF0sXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcIm9hdXRoMlwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImZsb3dcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcImFjY2Vzc0NvZGVcIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJzY29wZXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvb2F1dGgyU2NvcGVzXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJhdXRob3JpemF0aW9uVXJsXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImZvcm1hdFwiOiBcInVyaVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwidG9rZW5VcmxcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZm9ybWF0XCI6IFwidXJpXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXNjcmlwdGlvblwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBcIm9hdXRoMlNjb3Blc1wiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwiYWRkaXRpb25hb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YmVyXCIsIFwib2JqZWN0XCIsIFwic3RyaW5nXCIgXVxuICAgICAgICB9LFxuICAgICAgICBcInN0cmluZ0FycmF5XCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICBcIml0ZW1zXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfSxcbiAgICAgICAgICAgIFwibWluSXRlbXNcIjogMSxcbiAgICAgICAgICAgIFwidW5pcXVlSXRlbXNcIjogdHJ1ZVxuICAgICAgICB9XG4gICAgfSxcbiAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcImlkXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgXCJmb3JtYXRcIjogXCJ1cmlcIlxuICAgICAgICB9LFxuICAgICAgICBcIiRzY2hlbWFcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgICBcImZvcm1hdFwiOiBcInVyaVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwidGl0bGVcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXNjcmlwdGlvblwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlZmF1bHRcIjoge30sXG4gICAgICAgIFwibXVsdGlwbGVPZlwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJudW1iZXJcIixcbiAgICAgICAgICAgIFwibWluaW11bVwiOiAwLFxuICAgICAgICAgICAgXCJleGNsdXNpdmVNaW5pbXVtXCI6IHRydWVcbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhpbXVtXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm51bWJlclwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXhjbHVzaXZlTWF4aW11bVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgICBcImRlZmF1bHRcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJtaW5pbXVtXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm51bWJlclwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXhjbHVzaXZlTWluaW11bVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgICBcImRlZmF1bHRcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhMZW5ndGhcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3Bvc2l0aXZlSW50ZWdlclwiIH0sXG4gICAgICAgIFwibWluTGVuZ3RoXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJEZWZhdWx0MFwiIH0sXG4gICAgICAgIFwicGF0dGVyblwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwiZm9ybWF0XCI6IFwicmVnZXhcIlxuICAgICAgICB9LFxuICAgICAgICBcImFkZGl0aW9uYWxJdGVtc1wiOiB7XG4gICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7IFwidHlwZVwiOiBcImJvb2xlYW5cIiB9LFxuICAgICAgICAgICAgICAgIHsgXCIkcmVmXCI6IFwiI1wiIH1cbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7IFwiJHJlZlwiOiBcIiNcIiB9LFxuICAgICAgICAgICAgICAgIHsgXCIkcmV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IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHsgXCIkcmVmXCI6IFwiI1wiIH0sXG4gICAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7IFwiJHJlZlwiOiBcIiNcIiB9LFxuICAgICAgICAgICAgXCJkZWZhdWx0XCI6IHt9XG4gICAgICAgIH0sXG4gICAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHsgXCIkcmVmXCI6IFwiI1wiIH0sXG4gICAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXBlbmRlbmNpZXNcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICAgICAgeyBcIiRyZWZcIjogXCIjXCIgfSxcbiAgICAgICAgICAgICAgICAgICAgeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3N0cmluZ0FycmF5XCIgfVxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJlbnVtXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICBcIm1pbkl0ZW1zXCI6IDEsXG4gICAgICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHRydWVcbiAgICAgICAgfSxcbiAgICAgICAgXCJ0eXBlXCI6IHtcbiAgICAgICAgICAgIFwiYW55T2ZcIjogW1xuICAgICAgICAgICAgICAgIHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zaW1wbGVUeXBlc1wiIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgICAgICAgICBcIml0ZW1zXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zaW1wbGVUeXBlc1wiIH0sXG4gICAgICAgICAgICAgICAgICAgIFwibWluSXRlbXNcIjogMSxcbiAgICAgICAgICAgICAgICAgICAgXCJ1bmlxdWVJdGVtc1wiOiB0cnVlXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImFsbE9mXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zY2hlbWFBcnJheVwiIH0sXG4gICAgICAgIFwiYW55T2ZcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYUFycmF5XCIgfSxcbiAgICAgICAgXCJvbmVPZlwiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2NoZW1hQXJyYXlcIiB9LFxuICAgICAgICBcIm5vdFwiOiB7IFwiJHJlZlwiOiBcIiNcIiB9XG4gICAgfSxcbiAgICBcImRlcGVuZGVuY2llc1wiOiB7XG4gICAgICAgIFwiZXhjbHVzaXZlTWF4aW11bVwiOiBbIFwibWF4aW11bVwiIF0sXG4gICAgICAgIFwiZXhjbHVzaXZlTWluaW11bVwiOiBbIFwibWluaW11bVwiIF1cbiAgICB9LFxuICAgIFwiZGVmYXVsdFwiOiB7fVxufVxuIl19 +//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlc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biAgICAgIG1ldGFkYXRhLmN5Y2xpY2FsID0gbGluZWFnZS5sZW5ndGggPiAxICYmIGxpbmVhZ2VbMF0gPT09IGlkO1xuICAgIH1cblxuICAgIC8vIFN3YWdnZXIgMS4yIGRvZXMgbm90IGFsbG93IG11bHRpcGxlIGluaGVyaXRhbmNlIHdoaWxlIFN3YWdnZXIgMi4wKyBkb2VzXG4gICAgaWYgKG1ldGFkYXRhLnBhcmVudHMubGVuZ3RoID4gMSAmJiBzd2FnZ2VyVmVyc2lvbiA9PT0gJzEuMicpIHtcbiAgICAgIGNyZWF0ZUVycm9yT3JXYXJuaW5nKCdNVUxUSVBMRV8nICsgY29kZSArICdfSU5IRVJJVEFOQ0UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NoaWxkICcgKyBjb2RlLnRvTG93ZXJDYXNlKCkgKyAnIGlzIHN1YiB0eXBlIG9mIG11bHRpcGxlIG1vZGVsczogJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICBfLm1hcChtZXRhZGF0YS5wYXJlbnRzLCBmdW5jdGlvbiAocGFyZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXREaXNwbGF5SWQocGFyZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJyAmJiAnKSwgZGVmUGF0aCwgcmVzdWx0cy5lcnJvcnMpO1xuICAgIH1cblxuICAgIGlmIChtZXRhZGF0YS5jeWNsaWNhbCkge1xuICAgICAgY3JlYXRlRXJyb3JPcldhcm5pbmcoJ0NZQ0xJQ0FMXycgKyBjb2RlICsgJ19JTkhFUklUQU5DRScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICBtc2dQcmVmaXggKyAnIGhhcyBhIGNpcmN1bGFyIGluaGVyaXRhbmNlOiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5tYXAobGluZWFnZSwgZnVuY3Rpb24gKGRlcCkge1xuICAgICAgICAgICAgICA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JyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IHZhbGlkYXRlIHRoZSBBUEkgRGVjbGFyYXRpb25zIGlmIHRoZSBBUEkgaXMgMS4yIGFuZCB0aGUgUmVzb3VyY2UgTGlzdGluZyB3YXMgdmFsaWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFyZXN1bHRzICYmIHNwZWMudmVyc2lvbiA9PT0gJzEuMicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHRzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhcm5pbmdzOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwaURlY2xhcmF0aW9uczogW11cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXN5bmMubWFwKGFwaURlY2xhcmF0aW9ucywgZnVuY3Rpb24gKGFwaURlY2xhcmF0aW9uLCBjYWxsYmFjazIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkYXRlQWdhaW5zdFNjaGVtYShzcGVjLCAnYXBpRGVjbGFyYXRpb24uanNvbicsIGFwaURlY2xhcmF0aW9uLCBjYWxsYmFjazIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uIChlcnIsIGFsbFJlc3VsdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uZWFjaChhbGxSZXN1bHRzLCBmdW5jdGlvbiAocmVzdWx0LCBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHRzLmFwaURlY2xhcmF0aW9uc1tpbmRleF0gPSByZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sodW5kZWZpbmVkLCByZXN1bHRzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayh1bmRlZmluZWQsIHJlc3VsdHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbn07XG5cbi8qKlxuICogQ3JlYXRlcyBhIG5ldyBTd2FnZ2VyIHNwZWNpZmljYXRpb24gb2JqZWN0LlxuICpcbiAqIEBwYXJhbSB7c3RyaW5nfSB2ZXJzaW9uIC0gVGhlIFN3YWdnZXIgdmVyc2lvblxuICpcbiAqIEBjb25zdHJ1Y3RvclxuICovXG52YXIgU3BlY2lmaWNhdGlvbiA9IGZ1bmN0aW9uICh2ZXJzaW9uKSB7XG4gIHZhciB0aGF0ID0gdGhpcztcbiAgdmFyIGNyZWF0ZVZhbGlkYXRvcnMgPSBmdW5jdGlvbiAoc3BlYywgdmFsaWRhdG9yc01hcCkge1xuICAgIHJldHVybiBfLnJlZHVjZSh2YWxpZGF0b3JzTWFwLCBmdW5jdGlvbiAocmVzdWx0LCBzY2hlbWFzLCBzY2hlbWFOYW1lKSB7XG4gICAgICByZXN1bHRbc2NoZW1hTmFtZV0gPSBoZWxwZXJzLmNyZWF0ZUpzb25WYWxpZGF0b3Ioc2NoZW1hcyk7XG5cbiAgICAgIHJldHVybiByZXN1bH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icmVhaztcbiAgICAgIGNhc2UgJ2ludGVnZXInOlxuICAgICAgICAvLyBDb2VyY2UgdGhlIHZhbHVlIG9ubHkgZm9yIFN3YWdnZXIgMS4yXG4gICAgICAgIGlmICh2ZXJzaW9uID09PSAnMS4yJyAmJiBfLmlzU3RyaW5nKHZhbCkpIHtcbiAgICAgICAgICB2YWwgPSBOdW1iZXIodmFsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJlc3VsdCA9IF8uaXNGaW5pdGUodmFsKSAmJiAoTWF0aC5yb3VuZCh2YWwpID09PSB2YWwpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ251bWJlcic6XG4gICAgICAgIC8vIENvZXJjZSB0aGUgdmFsdWUgb25seSBmb3IgU3dhZ2dlciAxLjJcbiAgICAgICAgaWYgKHZlcnNpb24gPT09ICcxLjInICYmIF8uaXNTdHJpbmcodmFsKSkge1xuICAgICAgICAgIHZhbCA9IE51bWJlcih2YWwpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmVzdWx0ID0gXy5pc0Zpbml0ZSh2YWwpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ3N0cmluZyc6XG4gICAgICAgIGlmICghXy5pc1VuZGVmaW5lZChmb3JtYXQpKSB7XG4gICAgICAgICAgc3dpdGNoIChmb3JtYXQpIHtcbiAgICAgICAgICBjYXNlICdkYXRlJzpcbiAgICAgICAgICAgIHJlc3VsdCA9IGlzVmFsaWREYXRlKHZhbCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdkYXRlLXRpbWUnOlxuICAgICAgICAgICAgcmVzdWx0ID0gaXNWYWxpZERhdGVUaW1lKHZhbCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICd2b2lkJzpcbiAgICAgICAgcmVzdWx0ID0gXy5pc1VuZGVmaW5lZCh2YWwpO1xuICAgICAgICBicmV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yIHJvb3QgPSB0eXBlb2Ygc2VsZiA9PT0gJ29iamVjdCcgJiYgc2VsZi5zZWxmID09PSBzZWxmICYmIHNlbGYgfHxcbiAgICAgICAgICAgIHR5cGVvZiBnbG9iYWwgPT09ICdvYmplY3QnICYmIGdsb2JhbC5nbG9iYWwgPT09IGdsb2JhbCAmJiBnbG9iYWwgfHxcbiAgICAgICAgICAgIHRoaXM7XG5cbiAgICBpZiAocm9vdCAhPSBudWxsKSB7XG4gICAgICAgIHByZXZpb3VzX2FzeW5jID0gcm9vdC5hc3luYztcbiAgICB9XG5cbiAgICBhc3luYy5ub0NvbmZsaWN0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByb290LmFzeW5jID0gcHJldmlvdXNfYXN5bmM7XG4gICAgICAgIHJldHVybiBhc3luYztcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gb25seV9vbmNlKGZuKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGlmIChmbiA9PT0gbnVsbCkgdGhyb3cgbmV3IEVycm9yKFwiQ2FsbGJhY2sgd2FzIGFscmVhZHkgY2FsbGVkLlwiKTtcbiAgICAgICAgICAgIGZuLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICBmbiA9IG51bGw7XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX29uY2UoZm4pIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgaWYgKGZuID09PSBudWxsKSByZXR1cm47XG4gICAgICAgICAgICBmbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICAgICAgZm4gPSBudWxsO1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIC8vLy8gY3Jvc3MtYnJvd3NlciBjb21wYXRpYmxpdHkgZnVuY3Rpb25zIC8vLy9cblxuICAgIHZhciBfdG9TdHJpbmcgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO1xuXG4gICAgdmFyIF9pc0FycmF5ID0gQXJyYXkuaXNBcnJheSB8fCBmdW5jdGlvbiAob2JqKSB7XG4gICAgICAgIHJldHVybiBfdG9TdHJpbmcuY2FsbChvYmopID09PSAnW29iamVjdCBBcnJheV0nO1xuICAgIH07XG5cbiAgICAvLyBQb3J0ZWQgZnJvbSB1bmRlcnNjb3JlLmpzIGlzT2JqZWN0XG4gICAgdmFyIF9pc09iamVjdCA9IGZ1bmN0aW9uKG9iaikge1xuICAgICAgICB2YXIgdHlwZSA9IHR5cGVvZiBvYmo7XG4gICAgICAgIHJldHVybiB0eXBlID09PSAnZnVuY3Rpb24nIHx8IHR5cGUgPT09ICdvYmplY3QnICYmICEhb2JqO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBfaXNBcnJheUxpa2UoYXJyKSB7XG4gICAgICAgIHJldHVybiBfaXNBcnJheShhcnIpIHx8IChcbiAgICAgICAgICAgIC8vIGhhcyBhIHBvc2l0aXZlIGludGVnZXIgbGVuZ3RoIHByb3BlcnR5XG4gICAgICAgICAgICB0eXBlb2YgYXJyLmxlbmd0aCA9PT0gXCJudW1iZXJcIiAmJlxuICAgICAgICAgICAgYXJyLmxlbmd0aCA+PSAwICYmXG4gICAgICAgICAgICBhcnIubGVuZ3RoICUgMSA9PT0gMFxuICAgICAgICApO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIF9hcnJheUVhY2goYXJyLCBpdGVyYXRvcikge1xuICAgICAgICB2YXIgaW5kZXggPSAtMSxcbiAgICAgICAgICAgIGxlbmd0aCA9IGFyci5sZW5ndGg7XG5cbiAgICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGl0ZXJhdG9yKGFycltpbmRleF0sIGluZGV4LCBhcnIpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX21hcChhcnIsIGl0ZXJhdG9yKSB7XG4gICAgICAgIHZhciBpbmRleCA9I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9rZXlzID0gT2JqZWN0LmtleXMgfHwgZnVuY3Rpb24gKG9iaikge1xuICAgICAgICB2YXIga2V5cyA9IFtdO1xuICAgICAgICBmb3IgKHZhciBrIGluIG9iaikge1xuICAgICAgICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShrKSkge1xuICAgICAgICAgICAgICAgIGtleXMucHVzaChrKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ga2V5cztcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gX2tleUl0ZXJhdG9yKGNvbGwpIHtcbiAgICAgICAgdmFyIGkgPSAtMTtcbiAgICAgICAgdmFyIGxlbjtcbiAgICAgICAgdmFyIGtleXM7XG4gICAgICAgIGlmIChfaXNBcnJheUxpa2UoY29sbCkpIHtcbiAgICAgICAgICAgIGxlbiA9IGNvbGwubGVuZ3RoO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIG5leHQoKSB7XG4gICAgICAgICAgICAgICAgaSsrO1xuICAgICAgICAgICAgICAgIHJldHVybiBpIDwgbGVuID8gaSA6IG51bGw7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAga2V5cyA9IF9rZXlzKGNvbGwpO1xuICAgICAgICAgICAgbGVuID0ga2V5cy5sZW5ndGg7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gbmV4dCgpIHtcbiAgICAgICAgICAgICAgICBpKys7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGkgPCBsZW4gPyBrZXlzW2ldIDogbnVsbDtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBTaW1pbGFyIHRvIEVTNidzIHJlc3QgcGFyYW0gKGh0dHA6Ly9hcml5YS5vZmlsYWJzLmNvbS8yMDEzLzAzL2VzNi1hbmQtcmVzdC1wYXJhbWV0ZXIuaHRtbClcbiAgICAvLyBUaGlzIGFjY3VtdWxhdGVz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FjaE9mID1cbiAgICBhc3luYy5lYWNoT2YgPSBmdW5jdGlvbiAob2JqZWN0LCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgY2FsbGJhY2sgPSBfb25jZShjYWxsYmFjayB8fCBub29wKTtcbiAgICAgICAgb2JqZWN0ID0gb2JqZWN0IHx8IFtdO1xuXG4gICAgICAgIHZhciBpdGVyID0gX2tleUl0ZXJhdG9yKG9iamVjdCk7XG4gICAgICAgIHZhciBrZXksIGNvbXBsZXRlZCA9IDA7XG5cbiAgICAgICAgd2hpbGUgKChrZXkgPSBpdGVyKCkpICE9IG51bGwpIHtcbiAgICAgICAgICAgIGNvbXBsZXRlZCArPSAxO1xuICAgICAgICAgICAgaXRlcmF0b3Iob2JqZWN0W2tleV0sIGtleSwgb25seV9vbmNlKGRvbmUpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjb21wbGV0ZWQgPT09IDApIGNhbGxiYWNrKG51bGwpO1xuXG4gICAgICAgIGZ1bmN0aW9uIGRvbmUoZXJyKSB7XG4gICAgICAgICAgICBjb21wbGV0ZWQtLTtcbiAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhlcnIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gQ2hlY2sga2V5IGlzIG51bGwgaW4gY2FzZSBpdGVyYXRvciBpc24ndCBleGhhdXN0ZWRcbiAgICAgICAgICAgIC8vIGFuZCBkb25lIHJlc29sdmVkIHN5bmNocm9ub3VzbHkuXG4gICAgICAgICAgICBlbHNlIGlmIChrZXkgPT09IG51bGwgJiYgY29tcGxldGVkIDw9IDApIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBhc3luYy5mb3JFYWNoT2ZTZXJpZXMgPVxuICAgIGFzeW5jLmVhY2hPZlNlcmllcyA9IGZ1bmN0aW9uIChvYmosIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICBjYWxsYmFjayA9IF9vbmNlKGNhbGxiYWNrIHx8IG5vb3ApO1xuICAgICAgICBvYmogPSBvYmogfHwgW107XG4gICAgICAgIHZhciBuZXh0S2V5ID0gX2tleUl0ZXJhdG9yKG9iaik7XG4gICAgICAgIHZhciBrZXkgPSBuZXh0S2V5KCk7XG4gICAgICAgIGZ1bmN0aW9uIGl0ZXJhdGUoKSB7XG4gICAgICAgICAgICB2YXIgc3luYyA9IHRydWU7XG4gICAgICAgICAgICBpZiAoa2V5ID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKG51bGwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaXRlcmF0b3Iob2JqW2tleV0sIGtleSwgb25seV9vbmNlKGZ1bmN0aW9uIChlcnIpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBrZXkgPSBuZXh0S2V5KCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChrZXkgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzeW5jKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXN5bmMuc2V0SW1tZWRpYXRlKGl0ZXJhdGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVyYXRlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICBzeW5jID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgaXRlcmF0ZSgpO1xuICAgIH07XG5cblxuXG4gICAgYXN5bmMuZm9yRWFjaE9mTGltaXQgPVxuICAgIGFzeW5jLmVhY2hPZkxpbWl0ID0gZnVuY3Rpb24gKG9iaiwgbGltaXQsIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICBfZWFjaE9mTGltaXQobGltaXQpKG9iaiwgaXRlcmF0b3IsIGNhbGxiYWNrKTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gX2VhY2hPZkxpbWl0KGxpbWl0KSB7XG5cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChvYmosIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgY2FsbGJhY2sgPSBfb25jZShjYWxsYmFjayB8fCBub29wKTtcbiAgICAgICAgICAgIG9iaiA9IG9iaiB8fCBbXTtcbiAgICAgICAgICAgIHZhciBuZXh0S2V5ID0gX2tleUl0ZXJhdG9yKG9iaik7XG4gICAgICAgICAgICBpZiAobGltaXQgPD0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBkb25lID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgcnVubmluZyA9IDA7XG4gICAgICAgICAgICB2YXIgZXJyb3JlZCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAoZnVuY3Rpb24gcmVwbGVuaXNoICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoZG9uZSAmJiBydW5uaW5nIDw9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKG51bGwpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHdoaWxlIChydW5uaW5nIDwgbGltaXQgJiYgIWVycm9yZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGtleSA9IG5leHRLZXkoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGtleSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVubmluZyA8PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sobnVsbCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcnVubmluZyArPSAxO1xuICAgICAgICAgICAgICAgICAgICBpdGVyYXRvcihvYmpba2V5XSwga2V5LCBvbmx5X29uY2UoZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcnVubmluZyAtPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXBsZW5pc2goKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pKCk7XG4gICAgICAgIH07XG4gICAgfVxuXG5cbiAgICBmdW5jdGlvbiBkb1BhcmFsbGVsKGZuKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAob2JqLCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgIHJldHVybiBmbihhc3luYy5lYWNoT2YsIG9iaiwgaXRlcmF0b3IsIGNhbGxiYWNrKTtc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ICAgfTtcblxuICAgIGFzeW5jLnRyYW5zZm9ybSA9IGZ1bmN0aW9uIChhcnIsIG1lbW8sIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMykge1xuICAgICAgICAgICAgY2FsbGJhY2sgPSBpdGVyYXRvcjtcbiAgICAgICAgICAgIGl0ZXJhdG9yID0gbWVtbztcbiAgICAgICAgICAgIG1lbW8gPSBfaXNBcnJheShhcnIpID8gW10gOiB7fTtcbiAgICAgICAgfVxuXG4gICAgICAgIGFzeW5jLmVhY2hPZihhcnIsIGZ1bmN0aW9uKHYsIGssIGNiKSB7XG4gICAgICAgICAgICBpdGVyYXRvcihtZW1vLCB2LCBrLCBjYik7XG4gICAgICAgIH0sIGZ1bmN0aW9uKGVycikge1xuICAgICAgICAgICAgY2FsbGJhY2soZXJyLCBtZW1vKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIF9maWx0ZXIoZWFjaGZuLCBhcnIsIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICB2YXIgcmVzdWx0cyA9IFtdO1xuICAgICAgICBlYWNoZm4oYXJyLCBmdW5jdGlvbiAoeCwgaW5kZXgsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICBpdGVyYXRvcih4LCBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdHMucHVzaCh7aW5kZXg6IGluZGV4LCB2YWx1ZTogeH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYWxsYmFjaygpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNhbGxiYWNrKF9tYXAocmVzdWx0cy5zb3J0KGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGEu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lKCkge1xuICAgICAgICAgICAgICAgIGlmIChjYikgY2IoZ2V0UmVzdWx0KGZhbHNlLCB2b2lkIDApKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGl0ZXJhdGVlKHgsIF8sIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFjYikgcmV0dXJuIGNhbGxiYWNrKCk7XG4gICAgICAgICAgICAgICAgaXRlcmF0b3IoeCwgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNiICYmIGNoZWNrKHYpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYihnZXRSZXN1bHQodHJ1ZSwgeCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2IgPSBpdGVyYXRvciA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA+IDMpIHtcbiAgICAgICAgICAgICAgICBlYWNoZm4oYXJyLCBsaW1pdCwgaXRlcmF0ZWUsIGRvbmUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjYiA9IGl0ZXJhdG9yO1xuICAgICAgICAgICAgICAgIGl0ZXJhdG9yID0gbGltaXQ7XG4gICAgICAgICAgICAgICAgZWFjaGZuKGFyciwgaXRlcmF0ZWUsIGRvbmUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jLmFueSA9XG4gICAgYXN5bmMuc29tZSA9IF9jcmVhdGVUZXN0ZXIoYXN5bmMuZWFjaE9mLCB0b0Jvb2wsIGlkZW50aXR5KTtcblxuICAgIGFzeW5jLnNvbWVMaW1pdCA9IF9jcmVhdGVUZXN0ZXIoYXN5bmMuZWFjaE9mTGltaXQsI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ICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sIGZ1bmN0aW9uIChlcnIsIHJlc3VsdHMpIHtcbiAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soZXJyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKG51bGwsIF9tYXAocmVzdWx0cy5zb3J0KGNvbXBhcmF0b3IpLCBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geC52YWx1ZTtcbiAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfSk7XG5cbiAgICAgICAgZnVuY3Rpb24gY29tcGFyYXRvcihsZWZ0LCByaWdodCkge1xuICAgICAgICAgICAgdmFyIGEgPSBsZWZ0LmNyaXRlcmlhLCBiID0gcmlnaHQuY3JpdGVyaWE7XG4gICAgICAgICAgICByZXR1cm4gYSA8IGIgPyAtMSA6IGEgPiBiID8gMSA6IDA7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYXN5bmMuYXV0byA9IGZ1bmN0aW9uICh0YXNrcywgY29uY3VycmVuY3ksIGNhbGxiYWNrKSB7XG4gICAgICAgIGlmICh0eXBlb2YgYXJndW1lbnRzWzFdID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAvLyBjb25jdXJyZW5jeSBpcyBvcHRpb25hbCwgc2hpZnQgdGhlIGFyZ3MuXG4gICAgICAgICAgICBjYWxsYmFjayA9IGNvbmN1cnJlbmN5O1xuICAgICAgICAgICAgY29uY3VycmVuY3kgPSBudWxsO1xuICAgICAgICB9XG4gICAgICAgIGNhbGxiYWNrID0gX29uY2UoY2FsbGJhY2sgfHwgbm9vcCk7XG4gICAgICAgIHZhciBrZXlzID0gX2tleXModGFza3MpO1xuICAgICAgICB2YXIgcmVtYWluaW5nVGFza3MgPSBrZXlzLmxlbmd0aDtcbiAgICAgICAgaWYgKCFyZW1haW5pbmdUYXNrcykge1xuICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKG51bGwpO1xuICAgICAgICB9XG4gICAgICAgIGlmICghY29uY3VycmVuY3kpIHtcbiAgICAgICAgICAgIGNvbmN1cnJlbmN5ID0gcmVtYWluaW5nVGFza3M7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgcmVzdWx0cyA9IHt9O1xuICAgICAgICB2YXIgcnVubmluZ1Rhc2tzID0gMDtcblxuICAgICAgICB2YXIgaGFzRXJyb3IgPSBmYWxzZTtcblxuICAgICAgICB2YXIgbGlzdGVuZXJzID0gW107XG4gICAgICAgIGZ1bmN0aW9uIGFkZExpc3RlbmVyKGZuKSB7XG4gICAgICAgICAgICBsaXN0ZW5lcnMudW5zaGlmdChmbik7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gcmVtb3ZlTGlzdGVuZXIoZm4pIHtcbiAgICAgICAgICAgIHZhciBpZHggPSBfaW5kZXhPZihsaXN0ZW5lcnMsIGZuKTtcbiAgICAgICAgICAgIGlmIChpZHggPj0gMCkgbGlzdGVuZXJzLnNwbGljZShpZHgsIDEpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHRhc2tDb21wbGV0ZSgpIHtcbiAgICAgICAgICAgIHJlbWFpbmluZ1Rhc2tzLS07XG4gICAgICAgICAgICBfYXJyYXlFYWNoKGxpc3RlbmVycy5zbGljZSgwKSwgZnVuY3Rpb24gKGZuKSB7XG4gICAgICAgICAgICAgICAgZm4oKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgYWRkTGlzdGVuZXIoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKCFyZW1haW5pbmdUYXNrcykge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKG51bGwsIHJlc3VsdHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICBfYXJyYXlFYWNoKGtleXMsIGZ1bmN0aW9uIChrKSB7XG4gICAgICAgICAgICBpZiAoaGFzRXJyb3IpIHJldHVybjtcbiAgICAgICAgICAgIHZhciB0YXNrID0gX2lzQXJyYXkodGFza3Nba10pID8gdGFza3Nba106IFt0YXNrc1trXV07XG4gICAgICAgICAgICB2YXIgdGFza0NhbGxiYWNrID0gX3Jlc3RQYXJhbShmdW5jdGlvbihlcnIsIGFyZ3MpIHtcbiAgICAgICAgICAgICAgICBydW5uaW5nVGFza3MtLTtcbiAgICAgICAgICAgICAgICBpZiAoYXJncy5sZW5ndGggPD0gMSkge1xuICAgICAgICAgICAgICAgICAgICBhcmdzID0gYXJnc1swXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc2FmZVJlc3VsdHMgPSB7fTtcbiAgICAgICAgICAgICAgICAgICAgX2ZvckVhY2hPZihyZXN1bHRzLCBmdW5jdGlvbih2YWwsIHJrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhZmVSZXN1bHRzW3JrZXldID0gdmFsO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgc2FmZVJlc3VsdHNba10gPSBhcmdzO1xuICAgICAgICAgICAgICAgICAgICBoYXNFcnJvciA9IHRydWU7XG5cbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soZXJyLCBzYWZlUmVzdWx0cyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRzW2tdID0gYXJncztcbiAgICAgICAgICAgICAgICAgICAgYXN5bmMuc2V0SW1tZWRpYXRlKHRhc2tDb21wbGV0ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB2YXIgcmVxdWlyZXMgPSB0YXNrLnNsaWNlKDAsIHRhc2subGVuZ3RoIC0gMSk7XG4gICAgICAgICAgICAvLyBwcmV2ZW50IGRlYWQtbG9ja3NcbiAgICAgICAgICAgIHZhciBsZW4gPSByZXF1aXJlcy5sZW5ndGg7XG4gICAgICAgICAgICB2YXIgZGVwO1xuICAgICAgICAgICAgd2hpbGUgKGxlbi0tKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEoZGVwID0gdGFza3NbcmVxdWlyZXNbbGVuXV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSGFzIG5vbmV4aXN0ZW50IGRlcGVuZGVuY3kgaW4gJyArIHJlcXVpcmVzLmpvaW4oJywgJykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoX2lzQXJyYXkoZGVwKSAmJiBfaW5kZXhPZihkZXAsIGspID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdIYXMgY3ljbGljIGRlcGVuZGVuY2llcycpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIHJlYWR5KCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBydW5uaW5nVGFza3MgPCBjb25jdXJyZW5jeSAmJiBfcmVkdWNlKHJlcXVpcmVzLCBmdW5jdGlvbiAoYSwgeCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKGEgJiYgcmVzdWx0cy5oYXNPd25Qcm9wZXJ0eSh4KSk7XG4gICAgICAgICAgICAgICAgfSwgdHJ1ZSkgJiYgIXJlc3VsdHMuaGFzT3duUHJvcGVydHkoayk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocmVhZHkoKSkge1xuICAgICAgICAgICAgICAgIHJ1bm5pbmdUYXNrcysrO1xuICAgICAgICAgICAgICAgIHRhc2tbdGFzay5sZW5ndGggLSAxXSh0YXNrQ2FsbGJhY2ssIHJlc3VsdHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgYWRkTGlzdGVuZXIobGlzdGVuZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gbGlzdGVuZXIoKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlYWR5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcnVubmluZ1Rhc2tzKys7XG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZUxpc3RlbmVyKGxpc3RlbmVyKTtcbiAgICAgICAgICAgICAgICAgICAgdGFza1t0YXNrLmxlbmd0aCAtIDFdKHRhc2tDYWxsYmFjaywgcmVzdWx0cyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuXG5cblxuICAgIGFzeW5jLnJldHJ5ID0gZnVuY3Rpb24odGltZXMsIHRhc2ssIGNhbGxiYWNrKSB7XG4gICAgICAgIHZhciBERUZBVUxUX1RJTUVTID0gNTtcbiAgICAgICAgdmFyIERFRkFVTFRfSU5URVJWQUwgPSAwO1xuXG4gICAgICAgIHZhciBhdHRlbXB0cyA9IFtdO1xuXG4gICAgICAgIHZhciBvcHRzID0ge1xuICAgICAgICAgICAgdGltZXM6IERFRkFVTFRfVElNRVMsXG4gICAgICAgICAgICBpbnRlcnZhbDogREVGQVVMVF9JTlRFUlZBTFxuICAgICAgICB9O1xuXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlVGltZXMoYWNjLCB0KXtcbiAgICAgICAgICAgIGlmKHR5cGVvZiB0ID09PSAnbnVtYmVyJyl7XG4gICAgICAgICAgICAgICAgYWNjLnRpbWVzID0gcGFyc2VJbnQodCwgMTApIHx8IERFRkFVTFRfVElNRVM7XG4gICAgICAgICAgICB9IGVsc2UgaWYodHlwZW9mIHQgPT09ICdvYmplY3QnKXtcbiAgICAgICAgICAgICAgICBhY2MudGltZXMgPSBwYXJzZUlud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GZ1bmN0aW9uIHJldHJ5QXR0ZW1wdCh0YXNrLCBmaW5hbEF0dGVtcHQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oc2VyaWVzQ2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICAgICAgdGFzayhmdW5jdGlvbihlcnIsIHJlc3VsdCl7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZXJpZXNDYWxsYmFjayghZXJyIHx8IGZpbmFsQXR0ZW1wdCwge2VycjogZXJyLCByZXN1bHQ6IHJlc3VsdH0pO1xuICAgICAgICAgICAgICAgICAgICB9LCB3cmFwcGVkUmVzdWx0cyk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gcmV0cnlJbnRlcnZhbChpbnRlcnZhbCl7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHNlcmllc0NhbGxiYWNrKXtcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpe1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VyaWVzQ2FsbGJhY2sobnVsbCk7XG4gICAgICAgICAgICAgICAgICAgIH0sIGludGVydmFsKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB3aGlsZSAob3B0cy50aW1lcykge1xuXG4gICAgICAgICAgICAgICAgdmFyIGZpbmFsQXR0ZW1wdCA9ICEob3B0cy50aW1lcy09MSk7XG4gICAgICAgICAgICAgICAgYXR0ZW1wdHMucHVzaChyZXRyeUF0dGVtcHQob3B0cy50YXNrLCBmaW5hbEF0dGVtcHQpKTtcbiAgICAgICAgICAgICAgICBpZighZmluYWxBdHRlbXB0ICYmIG9wdHMuaW50ZXJ2YWwgPiAwKXtcbiAgICAgICAgICAgICAgICAgICAgYXR0ZW1wdHMucHVzaChyZXRyeUludGVydmFsKG9wdHMuaW50ZXJ2YWwpKTtcbiAgICA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nIpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgW2Vycl0uY29uY2F0KGFyZ3MpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBuZXh0ID0gaXRlcmF0b3IubmV4dCgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAobmV4dCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXJncy5wdXNoKHdyYXBJdGVyYXRvcihuZXh0KSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhcmdzLnB1c2goY2FsbGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVuc3VyZUFzeW5jKGl0ZXJhdG9yKS5hcHBseShudWxsLCBhcmdzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICB3cmFwSXRlcmF0b3IoYXN5bmMuaXRlcmF0b3IodGFza3MpKSgpO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBfcGFyYWxsZWwoZWFjaGZuLCB0YXNrcywgY2FsbGJhY2spIHtcbiAgICAgICAgY2FsbGJhY2sgPSBjYWxsYmFjayB8fCBub29wO1xuICAgICAgICB2YXIgcmVzdWx0cyA9IF9pc0FycmF5TGlrZSh0YXNrcykgPyBbXSA6IHt9O1xuXG4gICAgICAgIGVhY2hmbih0YXNrcywgZnVuY3Rpb24gKHRhc2ssIGtleSwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgIHRhc2soX3Jlc3RQYXJhbShmdW5jdGlvbiAoZXJyLCBhcmdzKSB7XG4gICAgICAgICAgICAgICAgaWYgKGFyZ3MubGVuZ3RoIDw9IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJncyA9IGFyZ3NbMF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlc3VsdHNba2V5XSA9IGFyZ3M7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2soZXJyKTtcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfSwgZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgY2FsbGJhY2soZXJyLCByZXN1bHRzKTtcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMucGFyYWxsZWwgPSBmdW5jdGlvbiAodGFza3MsIGNhbGxiYWNrKSB7XG4gICAgICAgIF9wYXJhbGxlbChhc3luYy5lYWNoT2YsIHRhc2tzLCBjYWxsYmFjayk7XG4gICAgfTtcblxuICAgIGFzeW5jLnBhcmFsbGVsTGltaXQgPSBmdW5jdGlvbih0YXNrcywgbGltaXQsIGNhbGxiYWNrKSB7XG4gICAgICAgIF9wYXJhbGxlbChfZWFjaE9mTGltaXQobGltaXQpLCB0YXNrcywgY2FsbGJhY2spO1xuICAgIH07XG5cbiAgICBhc3luYy5zZXJpZXMgPSBmdW5jdGlvbih0YXNrcywgY2FsbGJhY2spIHtcbiAgICAgICAgX3BhcmFsbGVsKGFzeW5jLmVhY2hPZlNlcmllcywgdGFza3MsIGNhbGxiYWNrKTtcbiAgICB9O1xuXG4gICAgYXN5bmMuaXRlcmF0b3IgPSBmdW5jdGlvbiAodGFza3MpIHtcbiAgICAgICAgZnVuY3Rpb24gbWFrZUNhbGxiYWNrKGluZGV4KSB7XG4gICAgICAgICAgICBmdW5jdGlvbiBmbigpIHtcbiAgICAgICAgICAgICAgICBpZiAodGFza3MubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRhc2tzW2luZGV4XS5hcHBseShudWxsLCBhcmd1bWVudHMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZm4ubmV4dCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm4ubmV4dCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKGluZGV4IDwgdGFza3MubGVuZ3RoIC0gMSkgPyBtYWtlQ2FsbGJhY2soaW5kZXggKyAxKTogbnVsbDtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXR1cm4gZm47XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG1ha2VDYWxsYmFjaygwKTtcbiAgICB9O1xuXG4gICAgYXN5bmMuYXBwbHkgPSBfcmVzdFBhcmFtKGZ1bmN0aW9uIChmbiwgYXJncykge1xuICAgICAgICByZXR1cm4gX3Jlc3RQYXJhbShmdW5jdGlvbiAoY2FsbEFyZ3MpIHtcbiAgICAgICAgICAgIHJldHVybiBmbi5hcHBseShcbiAgICAgICAgICAgICAgICBudWxsLCBhcmdzLmNvbmNhdChjYWxsQXJncylcbiAgICAgICAgICAgICk7XG4gICAgICAgIH0pO1xuICAgIH0pO1xuXG4gICAgZnVuY3Rpb24gX2NvbmNhdChlYWNoZm4sIGFyciwgZm4sIGNhbGxiYWNrKSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICAgICAgZWFjaGZuKGFyciwgZnVuY3Rpb24gKHgsIGluZGV4LCBjYikge1xuICAgICAgICAgICAgZm4oeCwgZnVuY3Rpb24gKGVyciwgeSkge1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdC5jb25jYXQoeSB8fCBbXSk7XG4gICAgICAgICAgICAgICAgY2IoZXJyKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LCBmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgICAgICBjYWxsYmFjayhlcnIsIHJlc3VsdCk7XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBhc3luYy5jb25jYXQgPSBkb1BhcmFsbGVsKF9jb25jYXQpO1xuICAgIGFzeW5jLmNvbmNhdFNlcmllcyA9IGRvU2VyaWVzKF9jb25jYXQpO1xuXG4gICAgYXN5bmMud2hpbHN0ID0gZnVuY3Rpb24gKHRlc3QsIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICBjYWxsYmFjayA9IGNhbGxiYWNrIHx8IG5vb3A7XG4gICAgICAgIGlmICh0ZXN0KCkpIHtcbiAgICAgICAgICAgIHZhciBuZXh0ID0gX3Jlc3RQYXJhbShmdW5jdGlvbihlcnIsIGFyZ3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0ZXN0LmFwcGx5KHRoaXMsIGFyZ3MpKSB7XG4gICAgICAgICAgICAgICAgICAgIGl0ZXJhdG9yKG5leHQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLmFwcGx5KG51bGwsIFtudWxsXS5jb25jYXQoYXJncykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaXRlcmF0b3IobmV4dCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBhc3luYy5kb1doaWxzdCA9IGZ1bmN0aW9uIChpdGVyYXRvciwgdGVzdCwgY2FsbGJhY2spIHtcbiAgICAgICAgdmFyIGNhbGxzID0gMDtcbiAgICAgICAgcmV0dXJuIGFzeW5jLndoaWxzdChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiArK2NhbGxzIDw9IDEgfHwgdGVzdC5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICB9LCBpdGVyYXRvciwgY2FsbGJhY2spO1xuICAgIH07XG5cbiAgICBhc3luYy51bnRpbCA9IGZ1bmN0aW9uICh0ZXN0LCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgcmV0dXJuIGFzeW5jLndoaWxzdChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiAhdGVzdC5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICB9LCBpdGVyYXRvciwgY2FsbGJhY2spO1xuICAgIH07XG5cbiAgICBhc3luYy5kb1VudGlsID0gZnVuY3Rpb24gKGl0ZXJhdG9yLCB0ZXN0LCBjYWxsYmFjaykge1xuICAgICAgICByZXR1cm4gYXN5bmMuZG9XaGlsc3QoaXRlcmF0b3IsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuICF0ZXN0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIH0sIGNhbGxiYWNrKTtcbiAgICB9O1xuXG4gICAgYXN5bmMuZHVyaW5nID0gZnVuY3Rpb24gKHRlc3QsIGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgICAgICBjYWxsYmFjayA9IGNhbGxiYWNrIHx8IG5vb3A7XG5cbiAgICAgICAgdmFyIG5leHQgPSBfcmVzdFBhcmFtKGZ1bmN0aW9uKGVyciwgYXJncykge1xuICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGFyZ3MucHVzaChjaGVjayk7XG4gICAgICAgICAgICAgICAgdGVzdC5hcHBseSh0aGlzLCBhcmdzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgdmFyIGNoZWNrID0gZnVuY3Rpb24oZXJyLCB0cnV0aCkge1xuICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRydXRoKSB7XG4gICAgICAgICAgICAgICAgaXRlcmF0b3IobmV4dCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKG51bGwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHRlc3QoY2hlY2spO1xuICAgIH07XG5cbiAgICBhc3luYy5kb0R1cmluZyA9IGZ1bmN0aW9uIChpdGVyYXRvciwgdGVzdCwgY2FsbGJhY2spIHtcbiAgICAgICAgdmFyIGNhbGxzID0gMDtcbiAgICAgICAgYXN5bmMuZHVyaW5nKGZ1bmN0aW9uKG5leHQpIHtcbiAgICAgICAgICAgIGlmIChjYWxscysrIDwgMSkge1xuICAgICAgICAgICAgICAgIG5leHQobnVsbCwgdHJ1ZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRlc3QuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwgaXRlcmF0b3IsIGNhbGxiYWNrKTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gX3F1ZXVlKHdvcmtlciwgY29uY3VycmVuY3ksIHBheWxvYWQpIHtcbiAgICAgICAgaWYgKGNvbmN1cnJlbmN5ID09IG51bGwpIHtcbiAgICAgICAgICAgIGNvbmN1cnJlbmN5ID0gMTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmKGNvbmN1cnJlbmN5ID09PSAwKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0NvbmN1cnJlbmN5IG11c3Qgbm90IGJlIHplcm8nKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfaW5zZXJ0KHEsIGRhdGEsIHBvcywgY2FsbGJhY2spIHtcbiAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsICYmIHR5cGVvZiBjYWxsYmFjayAhPT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwidGFzayBjYWxsYmFjayBtdXN0IGJlIGEgZnVuY3Rpb25cIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBxLnN0YXJ0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKCFfaXNBcnJheShkYXRhKSkge1xuICAgICAgICAgICAgICAgIGRhdGEgPSBbZGF0YV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZihkYXRhLmxlbmd0aCA9PT0gMCAmJiBxLmlkbGUoKSkge1xuICAgICAgICAgICAgICAgIC8vIGNhbGwgZHJhaW4gaW1tZWRpYXRlbHkgaWYgdGhlcmUgYXJlIG5vIHRhc2tzXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFzeW5jLnNldEltbWVkaWF0ZShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgcS5kcmFpbigpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgX2FycmF5RWFjaChkYXRhLCBmdW5jdGlvbih0YXNrKSB7XG4gICAgICAgICAgICAgICAgdmFyIGl0ZW0gPSB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGE6IHRhc2ssXG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiBjYWxsYmFjayB8fCBub29wXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIGlmIChwb3MpIHtcbiAgICAgICAgICAgICAgICAgICAgcS50YXNrcy51bnNoaWZ0KGl0ZW0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHEudGFza3MucHVzaChpdGVtKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAocS50YXNrcy5sZW5ndGggPT09IHEuY29uY3VycmVuY3kpIHtcbiAgICAgICAgICAgICAgICAgICAgcS5zYXR1cmF0ZWQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGFzeW5jLnNldEltbWVkaWF0ZShxLnByb2Nlc3MpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9uZXh0KHEsIHRhc2tzKSB7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKXtcbiAgICAgICAgICAgICAgICB3b3JrZXJzIC09IDE7XG5cbiAgICAgICAgICAgICAgICB2YXIgcmVtb3ZlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHZhciBhcmdzID0gYXJndW1lbnRzO1xuICAgICAgICAgICAgICAgIF9hcnJheUVhY2godGFza3MsIGZ1bmN0aW9uICh0YXNrKSB7XG4gICAgICAgICAgICAgICAgICAgIF9hcnJheUVhY2god29ya2Vyc0xpc3QsIGZ1bmN0aW9uICh3b3JrZXIsIGluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAod29ya2VyID09PSB0YXNrICYmICFyZW1vdmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd29ya2Vyc0xpc3Quc3BsaWNlKGluZGV4LCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGFzay5jYWxsYmFjay5hcHBseSh0YXNrLCBhcmdzKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBpZiAocS50YXNrcy5sZW5ndGggKyB3b3JrZXJzID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHEuZHJhaW4oKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcS5wcm9jZXNzKCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHdvcmtlcnMgPSAwO1xuICAgICAgICB2YXIgd29ya2Vyc0xpc3QgPSBbXTtcbiAgICAgICAgdmFyIHEgPSB7XG4gICAgICAgICAgICB0YXNrczogW10sXG4gICAgICAgICAgICBjb25jdXJyZW5jeTogY29uY3VycmVuY3ksXG4gICAgICAgICAgICBwYXlsb2FkOiBwYXlsb2FkLFxuICAgICAgICAgICAgc2F0dXJhdGVkOiBub29wLFxuICAgICAgICAgICAgZW1wdHk6IG5vb3AsXG4gICAgICAgICAgICBkcmFpbjogbm9vcCxcbiAgICAgICAgICAgIHN0YXJ0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgcGF1c2VkOiBmYWxzZSxcbiAgICAgICAgICAgIHB1c2g6IGZ1bmN0aW9uIChkYXRhLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIF9pbnNlcnQocSwgZGF0YSwgZmFsc2UsIGNhbGxiYWNrKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBraWxsOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcS5kcmFpbiA9IG5vb3A7XG4gICAgICAgICAgICAgICAgcS50YXNrcyA9IFtdO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHVuc2hpZnQ6IGZ1bmN0aW9uIChkYXRhLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIF9pbnNlcnQocSwgZGF0YSwgdHJ1ZSwgY2FsbGJhY2spO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHByb2Nlc3M6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB3aGlsZSghcS5wYXVzZWQgJiYgd29ya2VycyA8IHEuY29uY3VycmVuY3kgJiYgcS50YXNrcy5sZW5ndGgpe1xuXG4gICAgICAgICAgICAgICAgICAgIHZhciB0YXNrcyA9IHEucGF5bG9hZCA/XG4gICAgICAgICAgICAgICAgICAgICAgICBxLnRhc2tzLnNwbGljZSgwLCBxLnBheWxvYWQpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHEudGFza3Muc3BsaWNlKDAsIHEudGFza3MubGVuZ3RoKTtcblxuICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YSA9IF9tYXAodGFza3MsIGZ1bmN0aW9uICh0YXNrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGFzay5kYXRhO1xuICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAocS50YXNrcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHEuZW1wdHkoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB3b3JrZXJzICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIHdvcmtlcnNMaXN0LnB1c2godGFza3NbMF0pO1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2IgPSBvbmx5X29uY2UoX25leHQocSwgdGFza3MpKTtcbiAgICAgICAgICAgICAgICAgICAgd29ya2VyKGRhdGEsIGNiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGVuZ3RoOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHEudGFza3MubGVuZ3RoO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJ1bm5pbmc6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VycztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB3b3JrZXJzTGlzdDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB3b3JrZXJzTGlzdDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpZGxlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcS50YXNrcy5sZW5ndGggKyB3b3JrZXJzID09PSAwO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHBhdXNlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcS5wYXVzZWQgPSB0cnVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlc3VtZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmIChxLnBhdXNlZCA9PT0gZmFsc2UpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgcS5wYXVzZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB2YXIgcmVzdW1lQ291bnQgPSBNYXRoLm1pbihxLmNvbmN1cnJlbmN5LCBxLnRhc2tzLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgLy8gTmVlZCB0byBjYWxsIHEucHJvY2VzcyBvbmNlIHBlciBjb25jdXJyZW50XG4gICAgICAgICAgICAgICAgLy8gd29ya2VyIHRvIHByZXNlcnZlIGZ1bGwgY29uY3VycmVuY3kgYWZ0ZXIgcGF1c2VcbiAgICAgICAgICAgICAgICBmb3IgKHZhciB3ID0gMTsgdyA8PSByZXN1bWVDb3VudDsgdysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGFzeW5jLnNldEltbWVkaWF0ZShxLnByb2Nlc3MpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHE7XG4gICAgfVxuXG4gICAgYXN5bmMucXVldWUgPSBmdW5jdGlvbiAod29ya2VyLCBjb25jdXJyZW5jeSkge1xuICAgICAgICB2YXIgcSA9IF9xdWV1ZShmdW5jdGlvbiAoaXRlbXMsIGNiKSB7XG4gICAgICAgICAgICB3b3JrZXIoaXRlbXNbMF0sIGNiKTtcbiAgICAgICAgfSwgY29uY3VycmVuY3ksIDEpO1xuXG4gICAgICAgIHJldHVybiBxO1xuICAgIH07XG5cbiAgICBhc3luYy5wcmlvcml0eVF1ZXVlID0gZnVuY3Rpb24gKHdvcmtlciwgY29uY3VycmVuY3kpIHtcblxuICAgICAgICBmdW5jdGlvbiBfY29tcGFyZVRhc2tzKGEsIGIpe1xuICAgICAgICAgICAgcmV0dXJuIGEucHJpb3JpdHkgLSBiLnByaW9yaXR5O1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gX2JpbmFyeVNlYXJjaChzZXF1ZW5jZSwgaXRlbSwgY29tcGFyZSkge1xuICAgICAgICAgICAgdmFyIGJlZyA9IC0xLFxuICAgICAgICAgICAgICAgIGVuZCA9IHNlcXVlbmNlLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICB3aGlsZSAoYmVnIDwgZW5kKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1pZCA9IGJlZyArICgoZW5kIC0gYmVnICsgMSkgPj4+IDEpO1xuICAgICAgICAgICAgICAgIGlmIChjb21wYXJlKGl0ZW0sIHNlcXVlbmNlW21pZF0pID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYmVnID0gbWlkO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGVuZCA9IG1pZCAtIDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGJlZztcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIF9pbnNlcnQocSwgZGF0YSwgcHJpb3JpdHksIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCAmJiB0eXBlb2YgY2FsbGJhY2sgIT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcInRhc2sgY2FsbGJhY2sgbXVzdCBiZSBhIGZ1bmN0aW9uXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcS5zdGFydGVkID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICghX2lzQXJyYXkoZGF0YSkpIHtcbiAgICAgICAgICAgICAgICBkYXRhID0gW2RhdGFdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYoZGF0YS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICAvLyBjYWxsIGRyYWluIGltbWVkaWF0ZWx5IGlmIHRoZXJlIGFyZSBubyB0YXNrc1xuICAgICAgICAgICAgICAgIHJldHVybiBhc3luYy5zZXRJbW1lZGlhdGUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIHEuZHJhaW4oKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF9hcnJheUVhY2goZGF0YSwgZnVuY3Rpb24odGFzaykge1xuICAgICAgICAgICAgICAgIHZhciBpdGVtID0ge1xuICAgICAgICAgICAgICAgICAgICBkYXRhOiB0YXNrLFxuICAgICAgICAgICAgICAgICAgICBwcmlvcml0eTogcHJpb3JpdHksXG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiB0eXBlb2YgY2FsbGJhY2sgPT09ICdmdW5jdGlvbicgPyBjYWxsYmFjayA6IG5vb3BcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgcS50YXNrcy5zcGxpY2UoX2JpbmFyeVNlYXJjaChxLnRhc2tzLCBpdGVtLCBfY29tcGFyZVRhc2tzKSArIDEsIDAsIGl0ZW0pO1xuXG4gICAgICAgICAgICAgICAgaWYgKHEudGFza3MubGVuZ3RoID09PSBxLmNvbmN1cnJlbmN5KSB7XG4gICAgICAgICAgICAgICAgICAgIHEuc2F0dXJhdGVkKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFzeW5jLnNldEltbWVkaWF0ZShxLnByb2Nlc3MpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTdGFydCB3aXRoIGEgbm9ybWFsIHF1ZXVlXG4gICAgICAgIHZhciBxID0gYXN5bmMucXVldWUod29ya2VyLCBjb25jdXJyZW5jeSk7XG5cbiAgICAgICAgLy8gT3ZlcnJpZGUgcHVzaCB0byBhY2NlcHQgc2Vjb25kIHBhcmFtZXRlciByZXByZXNlbnRpbmcgcHJpb3JpdHlcbiAgICAgICAgcS5wdXNoID0gZnVuY3Rpb24gKGRhdGEsIHByaW9yaXR5LCBjYWxsYmFjaykge1xuICAgICAgICAgICAgX2luc2VydChxLCBkYXRhLCBwcmlvcml0eSwgY2FsbGJhY2spO1xuICAgICAgICB9O1xuXG4gICAgICAgIC8vIFJlbW92ZSB1bnNoaWZ0IGZ1bmN0aW9uXG4gICAgICAgIGRlbGV0ZSBxLnVuc2hpZnQ7XG5cbiAgICAgICAgcmV0dXJuIHE7XG4gICAgfTtcblxuICAgIGFzeW5jLmNhcmdvID0gZnVuY3Rpb24gKHdvcmtlciwgcGF5bG9hZCkge1xuICAgICAgICByZXR1cm4gX3F1ZXVlKHdvcmtlciwgMSwgcGF5bG9hZCk7XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIF9jb25zb2xlX2ZuKG5hbWUpIHtcbiAgICAgICAgcmV0dXJuIF9yZXN0UGFyYW0oZnVuY3Rpb24gKGZuLCBhcmdzKSB7XG4gICAgICAgICAgICBmbi5hcHBseShudWxsLCBhcmdzLmNvbmNhdChbX3Jlc3RQYXJhbShmdW5jdGlvbiAoZXJyLCBhcmdzKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb25zb2xlID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uc29sZS5lcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChjb25zb2xlW25hbWVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfYXJyYXlFYWNoKGFyZ3MsIGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZVtuYW1lXSh4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSldKSk7XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBhc3luYy5sb2cgPSBfY29uc29sZV9mbignbG9nJyk7XG4gICAgYXN5bmMuZGlyID0gX2NvbnNvbGVfZm4oJ2RpcicpO1xuICAgIC8qYXN5bmMuaW5mbyA9IF9jb25zb2xlX2ZuKCdpbmZvJyk7XG4gICAgYXN5bmMud2FybiA9IF9jb25zb2xlX2ZuKCd3YXJuJyk7XG4gICAgYXN5bmMuZXJyb3IgPSBfY29uc29sZV9mbignZXJyb3InKTsqL1xuXG4gICAgYXN5bmMubWVtb2l6ZSA9IGZ1bmN0aW9uIChmbiwgaGFzaGVyKSB7XG4gICAgICAgIHZhciBtZW1vID0ge307XG4gICAgICAgIHZhciBxdWV1ZXMgPSB7fTtcbiAgICAgICAgdmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG4gICAgICAgIGhhc2hlciA9IGhhc2hlciB8fCBpZGVudGl0eTtcbiAgICAgICAgdmFyIG1lbW9pemVkID0gX3Jlc3RQYXJhbShmdW5jdGlvbiBtZW1vaXplZChhcmdzKSB7XG4gICAgICAgICAgICB2YXIgY2FsbGJhY2sgPSBhcmdzLnBvcCgpO1xuICAgICAgICAgICAgdmFyIGtleSA9IGhhc2hlci5hcHBseShudWxsLCBhcmdzKTtcbiAgICAgICAgICAgIGlmIChoYXMuY2FsbChtZW1vLCBrZXkpKSB7ICAgXG4gICAgICAgICAgICAgICAgYXN5bmMuc2V0SW1tZWRpYXRlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgbWVtb1trZXldKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGhhcy5jYWxsKHF1ZXVlcywga2V5KSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlc1trZXldLnB1c2goY2FsbGJhY2spO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcXVldWVzW2tleV0gPSBbY2FsbGJhY2tdO1xuICAgICAgICAgICAgICAgIGZuLmFwcGx5KG51bGwsIGFyZ3MuY29uY2F0KFtfcmVzdFBhcmFtKGZ1bmN0aW9uIChhcmdzKSB7XG4gICAgICAgICAgICAgICAgICAgIG1lbW9ba2V5XSA9IGFyZ3M7XG4gICAgICAgICAgICAgICAgICAgIHZhciBxID0gcXVldWVzW2tleV07XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBxdWV1ZXNba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIGwgPSBxLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcVtpXS5hcHBseShudWxsLCBhcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgbWVtb2l6ZWQubWVtbyA9IG1lbW87XG4gICAgICAgIG1lbW9pemVkLnVubWVtb2l6ZWQgPSBmbjtcbiAgICAgICAgcmV0dXJuIG1lbW9pemVkO1xuICAgIH07XG5cbiAgICBhc3luYy51bm1lbW9pemUgPSBmdW5jdGlvbiAoZm4pIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiAoZm4udW5tZW1vaXplZCB8fCBmbikuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgfTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gX3RpbWVzKG1hcHBlcikge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGNvdW50LCBpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgIG1hcHBlcihfcmFuZ2UoY291bnQpLCBpdGVyYXRvciwgY2FsbGJh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AgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmdW5jdGlvbiAoZXJyLCByZXN1bHRzKSB7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2suYXBwbHkodGhhdCwgW2Vycl0uY29uY2F0KHJlc3VsdHMpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYXN5bmMuY29tcG9zZSA9IGZ1bmN0aW9uICgvKiBmdW5jdGlvbnMuLi4gKi8pIHtcbiAgICAgICAgcmV0dXJuIGFzeW5jLnNlcS5hcHBseShudWxsLCBBcnJheS5wcm90b3R5cGUucmV2ZXJzZS5jYWxsKGFyZ3VtZW50cykpO1xuICAgIH07XG5cblxuICAgIGZ1bmN0aW9uIF9hcHBseUVhY2goZWFjaGZuKSB7XG4gICAgICAgIHJldHVybiBfcmVzdFBhcmFtKGZ1bmN0aW9uKGZucywgYXJncykge1xuICAgICAgICAgICAgdmFyIGdvID0gX3Jlc3RQYXJhbShmdW5jdGlvbihhcmdzKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRoYXQgPSB0aGlzO1xuICAgICAgICAgICAgICAgIHZhciBjYWxsYmFjayA9IGFyZ3MucG9wKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVhY2hmbihmbnMsIGZ1bmN0aW9uIChmbiwgXywgY2IpIHtcbiAgICAgICAgICAgICAgICAgICAgZm4uYXBwbHkodGhhdCwgYXJncy5jb25jYXQoW2NiXSkpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY2FsbGJhY2spO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAoYXJncy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZ28uYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZ287XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jLmFwcGx5RWFjaCA9IF9hcHBseUVhY2goYXN5bmMuZWFjaE9mKTtcbiAgICBhc3luYy5hcHBseUVhY2hTZXJpZXMgPSBfYXBwbHlFYWNoKGFzeW5jLmVhY2hPZlNlcmllcyk7XG5cblxuICAgIGFzeW5jLmZvcmV2ZXIgPSBmdW5jdGlvbiAoZm4sIGNhbGxiYWNrKSB7XG4gICAgICAgIHZhciBkb25lID0gb25seV9vbmNlKGNhbGxiYWNrIHx8IG5vb3ApO1xuICAgICAgICB2YXIgdGFzayA9IGVuc3VyZUFzeW5jKGZuKTtcbiAgICAgICAgZnVuY3Rpb24gbmV4dChlcnIpIHtcbiAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZG9uZShlcnIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGFzayhuZXh0KTtcbiAgICAgICAgfVxuICAgICAgICBuZXh0KCk7XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIGVuc3VyZUFzeW5jKGZuKSB7XG4gICAgICAgIHJldHVybiBfcmVzdFBhcmFtKGZ1bmN0aW9uIChhcmdzKSB7XG4gICAgICAgICAgICB2YXIgY2FsbGJhY2sgPSBhcmdzLnBvcCgpO1xuICAgICAgICAgICAgYXJncy5wdXNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5uZXJBcmdzID0gYXJndW1lbnRzO1xuICAgICAgICAgICAgICAgIGlmIChzeW5jKSB7XG4gICAgICAgICAgICAgICAgICAgIGFzeW5jLnNldEltbWVkaWF0ZShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjay5hcHBseShudWxsLCBpbm5lckFyZ3MpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjay5hcHBseShudWxsLCBpbm5lckFyZ3MpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdmFyIHN5bmMgPSB0cnVlO1xuICAgICAgICAgICAgZm4uYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgICAgICBzeW5jID0gZmFsc2U7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jLmVuc3VyZUFzeW5jID0gZW5zdXJlQXN5bmM7XG5cbiAgICBhc3luYy5jb25zdGFudCA9IF9yZXN0UGFyYW0oZnVuY3Rpb24odmFsdWVzKSB7XG4gICAgICAgIHZhciBhcmdzID0gW251bGxdLmNvbmNhdCh2YWx1ZXMpO1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGNhbGxiYWNrKSB7XG4gICAgICAgICAgICByZXR1cm4gY2FsbGJhY2suYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgIH07XG4gICAgfSk7XG5cbiAgICBhc3luYy53cmFwU3luYyA9XG4gICAgYXN5bmMuYXN5bmNpZnkgPSBmdW5jdGlvbiBhc3luY2lmeShmdW5jKSB7XG4gICAgICAgIHJldHVybiBfcmVzdFBhcmFtKGZ1bmN0aW9uIChhcmdzKSB7XG4gICAgICAgICAgICB2YXIgY2FsbGJhY2sgPSBhcmdzLnBvcCgpO1xuICAgICAgICAgICAgdmFyIHJlc3VsdDtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZnVuYy5hcHBseSh0aGlzLCBhcmdzKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBpZiByZXN1bHQgaXMgUHJvbWlzZSBvYmplY3RcbiAgICAgICAgICAgIGlmIChfaXNPYmplY3QocmVzdWx0KSAmJiB0eXBlb2YgcmVzdWx0LnRoZW4gPT09IFwiZnVuY3Rpb25cIikge1xuICAgICA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Q0FSUklBR0VfUkVUVVJOICAgICAgIT09IGNoYXJhY3RlciAmJlxuICAgICAgICAgQ0hBUl9DT01NQSAgICAgICAgICAgICAgICAhPT0gY2hhcmFjdGVyICYmXG4gICAgICAgICBDSEFSX0xFRlRfU1FVQVJFX0JSQUNLRVQgICE9PSBjaGFyYWN0ZXIgJiZcbiAgICAgICAgIENIQVJfUklHSFRfU1FVQVJFX0JSQUNLRVQgIT09IGNoYXJhY3RlciAmJlxuICAgICAgICAgQ0hBUl9MRUZUX0NVUkxZX0JSQUNLRVQgICAhPT0gY2hhcmFjdGVyICYmXG4gICAgICAgICBDSEFSX1JJR0hUX0NVUkxZX0JSQUNLRVQgICE9PSBjaGFyYWN0ZXIgJiZcbiAgICAgICAgIENIQVJfU0hBUlAgICAgICAgICAgICAgICAgIT09IGNoYXJhY3RlciAmJlxuICAgICAgICAgQ0hBUl9BTVBFUlNBTkQgICAgICAgICAgICAhPT0gY2hhcmFjdGVyICYmXG4gICAgICAgICBDSEFSX0FTVEVSSVNLICAgICAgICAgICAgICE9PSBjaGFyYWN0ZXIgJiZcbiAgICAgICAgIENIQVJfRVhDTEFNQVRJT04gICAgICAgICAgIT09IGNoYXJhY3RlciAmJlxuICAgICAgICAgQ0hBUl9WRVJUSUNBTF9MSU5FICAgICAgICAhPT0gY2hhcmFjdGVyICYmXG4gICAgICAgICBDSEFSX0dSRUFURVJfVEhBTiAgICAgICAgICE9PSBjaGFyYWN0ZXIgJiZcbiAgICAgICAgIENIQVJfU0lOR0xFX1FVT1RFICAgICAgICAgIT09IGNoYXJhY3RlciAmJlxuICAgICAgICAgQ0hBUl9ET1VCTEVfUVVPVEUgICAgICAgICAhPT0gY2hhcmFjdGVyICYmXG4gICAgICAgICBDSEFSX1BFUkNFTlQgICAgICAgICAgICAgICE9PSBjaGFyYWN0ZXIgJiZcbiAgICAgICAgIENIQVJfQ09MT04gICAgICAgICAgICAgICAgIT09IGNoYXJhY3RlciAmJlxuICAgICAgICAgIUVTQ0FQ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IChjID09PSAweDA5LyogVGFiICovKSB8fFxuICAgICAgICAgKGMgPT09IDB4MjAvKiBTcGFjZSAqLykgfHxcbiAgICAgICAgIChjID09PSAweDBBLyogTEYgKi8pIHx8XG4gICAgICAgICAoYyA9PT0gMHgwRC8qIENSICovKTtcbn1cblxuZnVuY3Rpb24gaXNfRkxPV19JTkRJQ0FUT1IoYykge1xuICByZXR1cm4gMHgyQy8qICwgKi8gPT09IGMgfHxcbiAgICAgICAgIDB4NUIvKiBbICovID09PSBjIHx8XG4gICAgICAgICAweDVELyogXSAqLyA9PT0gYyB8fFxuICAgICAgICAgMHg3Qi8qIHsgKi8gPT09IGMgfHxcbiAgICAgICAgIDB4N0QvKiB9ICovID09PSBjO1xufVxuXG5mdW5jdGlvbiBmcm9tSGV4Q29kZShjKSB7XG4gIHZhciBsYztcblxuICBpZiAoKDB4MzAvKiAwICovIDw9IGMpICYmIChjIDw9IDB4MzkvKiA5ICovKSkge1xuICAgIHJldHVybiBjIC0gMHgzMDtcbiAgfVxuXG4gIC8qZXNsaW50LWRpc2FibGUgbm8tYml0d2lzZSovXG4gIGxjID0gYyB8IDB4MjA7XG5cbiAgaWYgKCgweDYxLyogYSAqLyA8PSBsYykgJiYgKGxjIDw9IDB4NjYvKiBmICovKSkge1xuICAgIHJldHVybiBsYyAtIDB4NjEgKyAxMDtcbiAgfVxuXG4gIHJldHVybiAtMTtcbn1cblxuZnVuY3Rpb24gZXNjYXBlZEhleExlbihjKSB7XG4gIGlmIChjID09PSAweDc4LyogeCAqLykgeyByZXR1cm4gMjsgfVxuICBpZiAoYyA9PT0gMHg3NS8qIHUgKi8pIHsgcmV0dXJuIDQ7IH1cbiAgaWYgKGMgPT09IDB4NTUvKiBVICovKSB7IHJldHVybiA4OyB9XG4gIHJldHVybiAwO1xufVxuXG5mdW5jdGlvbiBmcm9tRGVjaW1hbENvZGUoYykge1xuICBpZiAoKDB4MzAvKiAwICovIDw9IGMpICYmIChjIDw9IDB4MzkvKiA5ICovKSkge1xuICAgIHJldHVybiBjIC0gMHgzMDtcbiAgfVxuXG4gIHJldHVybiAtMTtcbn1cblxuZnVuY3Rpb24gc2ltcGxlRXNjYXBlU2VxdWVuY2UoYykge1xuICByZXR1cm4gKGMgPT09IDB4MzAvKiAwICovKSA/ICdcXHgwMCcgOlxuICAgICAgICAoYyA9PT0gMHg2MS8qIGEgKi8pID8gJ1xceDA3JyA6XG4gICAgICAgIChjID09PSAweDYyLyogYiAqLykgPyAnXFx4MDgnIDpcbiAgICAgICAgKGMgPT09IDB4NzQvKiB0ICovKSA/ICdcXHgwOScgOlxuICAgICAgICAoYyA9PT0gMHgwOS8qIFRhYiAqLykgPyAnXFx4MDknIDpcbiAgICAgICAgKGMgPT09IDB4NkUvKiBuICovKSA/ICdcXHgwQScgOlxuICAgICAgICAoYyA9PT0gMHg3Ni8qIHYgKi8pID8gJ1xceDBCJyA6XG4gICAgICAgIChjID09PSAweDY2LyogZiAqLykgPyAnXFx4MEMnIDpcbiAgICAgICAgKGMgPT09IDB4NzIvKiByICovKSA/ICdcXHgwRCcgOlxuICAgICAgICAoYyA9PT0gMHg2NS8qIGUgKi8pID8gJ1xceDFCJyA6XG4gICAgICAgIChjID09PSAweDIwLyogU3BhY2UgKi8pID8gJyAnIDpcbiAgICAgICAgKGMgPT09IDB4MjIvKiBcIiAqLykgPyAnXFx4MjInIDpcbiAgICAgICAgKGMgPT09IDB4MkYvKiAvICovKSA/ICcvJyA6XG4gICAgICAgIChjID09PSAweDVDLyogXFwgKi8pID8gJ1xceDVDJyA6XG4gICAgICAgIChjID09PSAweDRFLyogTiAqLykgPyAnXFx4ODUnIDpcbiAgICAgICAgKGMgPT09IDB4NUYvKiBfICovKSA/ICdcXHhBMCcgOlxuICAgICAgICAoYyA9PT0gMHg0Qy8qIEwgKi8pID8gJ1xcdTIwMjgnIDpcbiAgICAgICAgKGMgPT09IDB4NTAvKiBQICovKSA/ICdcXHUyMDI5JyA6ICcnO1xufVxuXG5mdW5jdGlvbiBja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SAgICAgICAgICAgICB8fFxuICAgICAgaXNfRkxPV19JTkRJQ0FUT1IoY2gpICAgICAgICB8fFxuICAgICAgMHgyMy8qICMgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyNi8qICYgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyQS8qICogKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyMS8qICEgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHg3Qy8qIHwgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgzRS8qID4gKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyNy8qICcgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyMi8qIFwiICovICAgICAgICAgICA9PT0gY2ggfHxcbiAgICAgIDB4MjUvKiAlICovICAgICAgICAgICA9PT0gY2ggfHxcbiAgICAgIDB4NDAvKiBAICovICAgICAgICAgICA9PT0gY2ggfHxcbiAgICAgIDB4NjAvKiBgICovICAgICAgICAgICA9PT0gY2gpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICBpZiAoMHgzRi8qID8gKi8gPT09IGNoIHx8IDB4MkQvKiAtICovID09PSBjaCkge1xuICAgIGZvbGxvd2luZyA9IHN0YXRlLmlucHV0LmNoYXJDb2RlQXQoc3RhdGUucG9zaXRpb24gKyAxKTtcblxuICAgIGlmIChpc19XU19PUl9FT0woZm9sbG93aW5nKSB8fFxuICAgICAgICB3aXRoaW5GbG93Q29sbGVjdGlvbiAmJiBpc19GTE9XX0lORElDQVRPUihmb2xsb3dpbmcpKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG5cbiAgc3RhdGUua2luZCA9ICdzY2FsYXInO1xuICBzdGF0ZS5yZXN1bHQgPSAnJztcbiAgY2FwdHVyZVN0YXJ0ID0gY2FwdHVyZUVuZCA9IHN0YXRlLnBvc2l0aW9uO1xuICBoYXNQZW5kaW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aXRzID0gZmFsc2UsXG4gICAgICBjaDtcblxuICBpZiAoIW1heCkgeyByZXR1cm4gZmFsc2U7IH1cblxuICBjaCA9IGRhdGFbaW5kZXhdO1xuXG4gIC8vIHNpZ25cbiAgaWYgKGNoID09PSAnLScgfHwgY2ggPT09ICcrJykge1xuICAgIGNoID0gZGF0YVsrK2luZGV4XTtcbiAgfVxuXG4gIGlmIChjaCA9PT0gJzAnKSB7XG4gICAgLy8gMFxuICAgIGlmIChpbmRleCArIDEgPT09IG1heCkgeyByZXR1cm4gdHJ1ZTsgfVxuICAgIGNoID0gZGF0YVsrK2luZGV4XTtcblxuICAgIC8vIGJhc2UgMiwgYmFzZSA4LCBiYXNlIDE2XG5cbiAgICBpZiAoY2ggPT09ICdiJykge1xuICAgICAgLy8gYmFzZSAyXG4gICAgICBpbmRleCsrO1xuXG4gICAgICBmb3IgKDsgaW5kZXggPCBtYXg7IGluZGV4KyspIHtcbiAgICAgICAgY2ggPSBkYXRhW2luZGV4XTtcbiAgICAgICAgaWYgKGNoID09PSAnXycpIHsgY29udGludWU7IH1cbiAgICAgICAgaWYgKGNoICE9PSAnMCcgJiYgY2ggIT09ICcxJykge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBoYXNEaWdpdHMgPSB0cnVlO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGhhc0RpZ2l0cztcbiAgICB9XG5cblxuICAgIGlmIChjaCA9PT0gJ3gnKSB7XG4gICAgICAvLyBiYXNlIDE2XG4gICAgICBpbmRleCsrO1xuXG4gICAgICBmb3IgKDsgaW5kZXggPCBtYXg7IGluZGV4KyspIHtcbiAgICAgICAgY2ggPSBkYXRhW2luZGV4XTtcbiAgICAgICAgaWYgKGNoID09PSAnXycpIHsgY29udGludWU7IH1cbiAgICAgICAgaWYgKCFpc0hleENvZGUoZGF0YS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICA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gZmFsc2U7XG4gIH1cblxuICB0cnkge1xuICAgIHZhciBzb3VyY2UgPSAnKCcgKyBkYXRhICsgJyknLFxuICAgICAgICBhc3QgICAgPSBlc3ByaW1hLnBhcnNlKHNvdXJjZSwgeyByYW5nZTogdHJ1ZSB9KTtcblxuICAgIGlmICgnUHJvZ3JhbScgICAgICAgICAgICAgIT09IGFzdC50eXBlICAgICAgICAgfHxcbiAgICAgICAgMSAgICAgICAgICAgICAgICAgICAgICE9PSBhc3QuYm9keS5sZW5ndGggIHx8XG4gICAgICAgICdFeHByZXNzaW9uU3RhdGVtZW50JyAhPT0gYXN0LmJvZHlbMF0udHlwZSB8fFxuICAgICAgICAnRnVuY3Rpb25FeHByZXNzaW9uJyAgIT09IGFzdC5ib2R5WzBdLmV4cHJlc3Npb24udHlwZSkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIHJldHVybiB0cnVlO1xuICB9IGNhdGNoIChlcnIpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbn1cblxuZnVuY3Rpb24gY29uc3RydWN0SmF2YXNjcmlwdEZ1bmN0aW9uKGRhdGEpIHtcbiAgLypqc2xpbnQgZXZpbDp0cnVlKi9cblxuICB2YXIgc291cmNlID0gJygnICsgZGF0YSArICcpJyxcbiAgICAgIGFzdCAgICA9IGVzcHJpbWEucGFyc2Uoc291cmNlLCB7IHJhbmdlOiB0cnVlIH0pLFxuICAgICAgcGFyYW1zID0gW10sXG4gICAgICBib2R5O1xuXG4gIGlmICgnUHJvZ3JhbScgICAgICAgICAgICAgIT09IGFzdC50eXBlICAgICAgICAgfHxcbiAgICAgIDEgICAgICAgICAgICAgICAgICAgICAhPT0gYXN0LmJvZHkubGVuZ3RoICB8fFxuICAgICAgJ0V4cHJlc3Npb25TdGF0ZW1lbnQnICE9PSBhc3QuYm9keVswXS50eXBlIHx8XG4gICAgICAnRnVuY3Rpb25FeHByZXNzaW9uJyAgIT09IGFzdC5ib2R5WzBdLmV4c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ICsgLy8gWzFdIHllYXJcbiAgJy0oWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICArIC8vIFsyXSBtb250aFxuICAnLShbMC05XVswLTldPyknICAgICAgICAgICAgICAgICAgICsgLy8gWzNdIGRheVxuICAnKD86KD86W1R0XXxbIFxcXFx0XSspJyAgICAgICAgICAgICAgKyAvLyAuLi5cbiAgJyhbMC05XVswLTldPyknICAgICAgICAgICAgICAgICAgICArIC8vIFs0XSBob3VyXG4gICc6KFswLTldWzAtOV0pJyAgICAgICAgICAgICAgICAgICAgKyAvLyBbNV0gbWludXRlXG4gICc6KFswLTldWzAtOV0pJyAgICAgICAgICAgICAgICAgICAgKyAvLyBbNl0gc2Vjb25kXG4gICcoPzpcXFxcLihbMC05XSopKT8nICAgICAgICAgICAgICAgICArIC8vIFs3XSBmcmFjdGlvblxuICAnKD86WyBcXFxcdF0qKFp8KFstK10pKFswLTldWzAtOV0/KScgKyAvLyBbOF0gdHogWzldIHR6X3NpZ24gWzEwXSB0el9ob3VyXG4gICcoPzo6KFswLTldWzAtOV0pKT8pKT8pPyQnKTsgICAgICAgICAvLyBbMTFdIHR6X21pbnV0ZVxuXG5mdW5jdGlvbiByZXNvbHZlWWFtbFRpbWVzdGFtcChkYXRhKSB7XG4gIGlmIChudWxsID09PSBkYXRhKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgaWYgKFlBTUxfVElNRVNUQU1QX1JFR0VYUC5leGVjKGRhdGEpID09PSBudWxsKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgcmV0dXJuIHRydWU7XG59XG5cbmZ1bmN0aW9uIGNvbnN0cnVjdFlhbWxUaW1lc3RhbXAoZGF0YSkge1xuICB2YXIgbWF0Y2gsIHllYXIsIG1vbnRoLCBkYXksIGhvdXIsIG1pbnV0ZSwgc2Vjb25kLCBmcmFjdGlvbiA9IDAsXG4gICAgICBkZWx0YSA9IG51bGwsIHR6X2hvdXIsIHR6X21pb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AgICAgICAgICAgICAgICAgIGRvYyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNUeXBlKHJlZkRldGFpbHMudXJpRGV0YWlscy5mcmFnbWVudCwgJ1VuZGVmaW5lZCcpID9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbXSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aEZyb21QdHIoZGVjb2RlVVJJKHJlZkRldGFpbHMudXJpRGV0YWlscy5mcmFnbWVudCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZEZXRhaWxzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRzLmNvbmNhdChsb2NhdGlvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudFB0cnMuY29uY2F0KHJlZkZ1bGxQdHIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxSZWZzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRpcmVjdCk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgICAgICAgcmVmRGV0YWlscy5lcnJvciA9IGVyci5tZXNzYWdlO1xuICAgICAgICAgICAgICAgICAgcmVmRGV0YWlscy5taXNzaW5nID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChyZWZGdWxsUHRyLmluZGV4T2YobG9jYXRpb24gKyAnLycpICE9PSAwICYmIHJlZkZ1bGxQdHIgIT09IGxvY2F0aW9uICYmXG4gICAgICAgICAgICAgIHN1YkRvY1B0ci5pbmRleE9mKGxvY2F0aW9uICsgJy8nKSAhPT0gMCAmJiBzdWJEb2NQdHIgIT09IGxvY2F0aW9uKSB7XG4gICAgICAgICAgICBpZiAobG9jYXRpb24uaW5kZXhPZihzdWJEb2NQdHIgKyAnLycpICE9PSAwKSB7XG4gICAgICAgICAgICAgIGFsbFRhc2tzID0gYWxsVGFza3NcbiAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gcHJvY2Vzc1N1YkRvY3VtZW50KCdsb2NhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iaixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aEZyb21QdHIobG9jYXRpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZEZXRhaWxzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRzLmNvbmNhdChsb2NhdGlvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudFB0cnMuY29uY2F0KHJlZkZ1bGxQdHIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxSZWZzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRpcmVjdCB8fCAobG9jYXRpb24uaW5kZXhPZihzdWJEb2NQdHIgKyAnLycpID09PSAtMSAmJiBsb2NhdGlvbiAhPT0gc3ViRG9jUHRyKSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlb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nJvcihlcnIuc3RhY2spO1xuICogICB9KTtcbiAqXG4gKiBAZXhhbXBsZVxuICogLy8gRXhhbXBsZSB1c2luZyBvcHRpb25zLnByZXBhcmVSZXF1ZXN0IHRvIHByb3ZpZGUgYXV0aGVudGljYXRpb24gZGV0YWlscyBmb3IgYSByZW1vdGVseSBzZWN1cmUgVVJMXG4gKlxuICogUGF0aExvYWRlclxuICogICAubG9hZCgnaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS9yZXBvcy93aGl0bG9ja2pjL3BhdGgtbG9hZGVyJywge1xuICogICAgIHByZXBhcmVSZXF1ZXN0OiBmdW5jdGlvbiAocmVxLCBjYWxsYmFjaykge1xuICogICAgICAgcmVxLmF1dGgoJ215LXVzZXJuYW1lJywgJ215LXBhc3N3b3JkJyk7XG4gKiAgICAgICBjYWxsYmFjayh1bmRlZmluZWQsIHJlcSk7XG4gKiAgICAgfVxuICogICB9KVxuICogICAudGhlbihKU09OLnBhcnNlKVxuICogICAudGhlbihmdW5jdGlvbiAoZG9jdW1lbnQpIHtcbiAqICAgICBjb25zb2xlLmxvZyhkb2N1bWVudC5mdWxsX25hbWUgKyAnOiAnICsgZG9jdW1lbnQuZGVzY3JpcHRpb24pO1xuICogICB9LCBmdW5jdGlvbiAoZXJyKSB7XG4gKiAgICAgY29uc29sZS5lcnJvcihlcnIuc3RhY2spO1xuICogICB9KTtcbiAqXG4gKiBAZXhhbXBsZVxuICogLy8gRXhhbXBsZSBsb2FkaW5nIGEgWUFNTCBmaWxlXG4gKlxuICogUGF0aExvYWRlclxuICogICAubG9hZCgnL1VzZXJzL25vdC15b3UvcHJvamVjdHMvcGF0aC1sb2FkZXIvLnRyYXZpcy55bWwnKVxuICogICAudGhlbihZQU1MLnNhZmVMb2FkKVxuICogICAudGhlbihmdW5jdGlvbiAoZG9jdW1lbnQpIHtcbiAqICAgICBjb25zb2xlLmxvZygncGF0aC1sb2FkZXIgdXNlcyB0aGUnLCBkb2N1bWVudC5sYW5ndWFnZS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dGlvbik7XG5cbiAgICAgICAgbG9hZGVyLmxvYWQobG9jYXRpb24sIG9wdGlvbnMgfHwge30sIGZ1bmN0aW9uIChlcnIsIGRvY3VtZW50KSB7XG4gICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgcmVqZWN0KGVycik7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc29sdmUoZG9jdW1lbnQpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9KTtcbiAgICB9KVxuICAgIC50aGVuKGZ1bmN0aW9uIChyZXMpIHtcbiAgICAgIGlmIChvcHRpb25zLnByb2Nlc3NDb250ZW50KSB7XG4gICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgLy8gRm9yIGNvbnNpc3RlbmN5IGJldHdlZW4gZmlsZSBhbmQgaHR0cCwgYWx3YXlzIHNlbmQgYW4gb2JqZWN0IHdpdGggYSAndGV4dCcgcHJvcGVydHkgY29udGFpbmluZyB0aGUgcmF3XG4gICAgICAgICAgLy8gc3RyaW5nIHZhbHVlIGJlaW5nIHByb2Nlc3NlZC5cbiAgICAgICAgICBvcHRpb25zLnByb2Nlc3NDb250ZW50KHR5cGVvZiByZXMgPT09ICdvYmplY3QnID8gcmVzIDoge3RleHQ6IHJlc30sIGZ1bmN0aW9uIChlcnIsIHByb2Nlc3NlZCkge1xuICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocHJvY2Vzc2VkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBJZiB0aGVyZSB3YXMgbm8gY29udGVudCBwcm9jZXNzb3IsIHdlIHdpbGwgYXNzdW1lIHRoYXQ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lKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGRlZmF1bHRzIHRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICAqICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gICogICAgICAgIC5zZW5kKCduYW1lPXRvYmknKVxuICAqICAgICAgICAuc2VuZCgnc3BlY2llcz1mZXJyZXQnKVxuICAqICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqIEBwYXJhbSB7U3R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mN0aW9uICgpIHtcbiAgICB2YXIgcGFyZW50cyA9IFtdLCBub2RlcyA9IFtdO1xuICAgIFxuICAgIHJldHVybiAoZnVuY3Rpb24gY2xvbmUgKHNyYykge1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBhcmVudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmIChwYXJlbnRzW2ldID09PSBzcmMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZXNbaV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGlmICh0eXBlb2Ygc3JjID09PSAnb2JqZWN0JyAmJiBzcmMgIT09IG51bGwpIHtcbiAgICAgICAgICAgIHZhciBkc3QgPSBjb3B5KHNyYyk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIHBhcmVudHMucHVzaChzcmMpO1xuICAgICAgICAgICAgbm9kZXMucHVzaChkc3QpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBmb3JFYWNoKG9iamVjdEtleXMoc3JjKSwgZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgICAgIGRzdFtrZXldID0gY2xvbmUoc3JjW2tleV0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIHBhcmVudHMucG9wKCk7XG4gICAgICAgICAgICBub2Rlcy5wb3AoKTtcbiAgICAgICAgICAgIHJldHVybiBkc3Q7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gc3JjO1xuICAgICAgICB9XG4gICAgfSkodGhpcy52YWx1ZSk7XG59O1xuXG5mdW5jdGlvbiB3YWxrIChyb290LCBjYiwgaW1tdXRhYmxlKSB7XG4gICAgdmFyIHBhdGggPSBbXTtcbiAgICB2YXIgcGFyZW50cyA9IFtdO1xuICAgIHZhciBhbGl2ZSA9IHRydWU7XG4gICAgXG4gICAgcmV0dXJuIChmdW5jdGlvbiB3YWxrZXIgKG5vZGVfKSB7XG4gICAgICAgIHZhciBub2RlID0gaW1tdXRhYmxlID8gY29weShub2RlXykgOiBub2RlXztcbiAgICAgICAgdmFyIG1vZGlmaWVycyA9IHt9O1xuICAgICAgICBcbiAgICAgICAgdmFyIGtlZXBHb2luZyA9IHRydWU7XG4gICAgICAgIFxuICAgICAgICB2YXIgc3RhdGUgPSB7XG4gICAgICAgICAgICBub2RlIDogbm9kZSxcbiAgICAgICAgICAgIG5vZGVfIDogbm9kZV8sXG4gICAgICAgICAgICBwYXRoIDogW10uY29uY2F0KHBhdGgpLFxuICAgICAgICAgICAgcGFyZW50IDogcGFyZW50c1twYXJlbnRzLmxlbmd0aCAtIDFdLFxuICAgICAgICAgICAgcGFyZW50cyA6IHBhcmVudHMsXG4gICAgICAgICAgICBrZXkgOiBwYXRoLnNsaWNlKC0xKVswXSxcbiAgICAgICAgICAgIGlzUm9vdCA6IHBhdGgubGVuZ3RoID09PSAwLFxuICAgICAgICAgICAgbGV2ZWwgOiBwYXRoLmxlbmd0aCxcbiAgICAgICAgICAgIGNpcmN1bGFyIDogbnVsbCxcbiAgICAgICAgICAgIHVwZGF0ZSA6IGZ1bmN0aW9uICh4LCBzdG9wSGVyZSkge1xuICAgICAgICAgICAgICAgIGlmICghc3RhdGUuaXNSb290KSB7XG4gICAgICAgICAgICAgICAgICAgIHN0YXRlLnBhcmVudC5ub2RlW3N0YXRlLmtleV0gPSB4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzdGF0ZS5ub2RlID0geDtcbiAgICAgICAgICAgICAgICBpZiAoc3RvcEhlcmUpIGtlZXBHb2luZyA9IGZhbHNlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdkZWxldGUnIDogZnVuY3Rpb24gKHN0b3BIZXJlKSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlIHN0YXRlLnBhcmVudC5ub2RlW3N0YXRlLmtleV07XG4gICAgICAgICAgICAgICAgaWYgKHN0b3BIZXJlKSBrZWVwR29pbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICByZW1vdmUgOiBmdW5jdGlvbiAoc3RvcEhlcmUpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNBcnJheShzdGF0ZS5wYXJlbnQubm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUucGFyZW50Lm5vZGUuc3BsaWNlKHN0YXRlLmtleSwgMSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgc3RhdGUucGFyZW50Lm5vZGVbc3RhdGUua2V5XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHN0b3BIZXJlKSBrZWVwR29pbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBrZXlzIDogbnVsbCxcbiAgICAgICAgICAgIGJlZm9yZSA6IGZ1bmN0aW9uIChmKSB7IG1vZGlmaWVycy5iZWZvcmUgPSBmIH0sXG4gICAgICAgICAgICBhZnRlciA6IGZ1bmN0aW9uIChmKSB7IG1vZGlmaWVycy5hZnRlciA9IGYgfSxcbiAgICAgICAgICAgIHByZSA6IGZ1bmN0aW9uIChmKSB7IG1vZGlmaWVycy5wcmUgPSBmIH0sXG4gICAgICAgICAgICBwb3N0IDogZnVuY3Rpb24gKGYpIHsgbW9kaWZpZXJzLnBvc3QgPSBmIH0sXG4gICAgICAgICAgICBzdG9wIDogZnVuY3Rpb24gKCkgeyBhbGl2ZSA9IGZhbHNlIH0sXG4gICAgICAgICAgICBibG9jayA6IGZ1bmN0aW9uICgpIHsga2VlcEdvaW5nID0gZmFsc2UgfVxuICAgICAgICB9O1xuICAgICAgICBcbiAgICAgICAgaWYgKCFhbGl2ZSkgcmV0dXJuIHN0YXRlO1xuICAgICAgICBcbiAgICAgICAgZnVuY3Rpb24gdXBkYXRlU3RhdGUoKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHN0YXRlLm5vZGUgPT09ICdvYmplY3QnICYmIHN0YXRlLm5vZGUgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXN0YXRlLmtleXMgfHwgc3RhdGUubm9kZV8gIT09IHN0YXRlLm5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUua2V5cyA9IG9iamVjdEtleXMoc3RhdGUubm9kZSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgc3RhdGUuaXNMZWFmID0gc3RhdGUua2V5cy5sZW5ndGggPT0gMDtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBhcmVudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmVudHNbaV0ubm9kZV8gPT09IG5vZGVfKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZS5jaXJjdWxhciA9IHBhcmVudHNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHN0YXRlLmlzTGVhZiA9IHRydWU7XG4gICAgICAgICAgICAgICAgc3RhdGUua2V5cyA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIHN0YXRlLm5vdExlYWYgPSAhc3RhdGUuaXNMZWFmO1xuICAgICAgICAgICAgc3RhdGUubm90Um9vdCA9ICFzdGF0ZS5pc1Jvb3Q7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIHVwZGF0ZVN0YXRlKCk7XG4gICAgICAgIFxuICAgICAgICAvLyB1c2UgcmV0dXJuIHZhbHVlcyB0byB1cGRhdGUgaWYgZGVmaW5lZFxuICAgICAgICB2YXIgcmV0ID0gY2IuY2FsbChzdGF0ZSwgc3RhdGUubm9kZSk7XG4gICAgICAgIGlmIChyZXQgIT09IHVuZGVmaW5lZCAmJiBzdGF0ZS51cGRhdGUpIHN0YXRlLnVwZGF0ZShyZXQpO1xuICAgICAgICBcbiAgICAgICAgaWYgKG1vZGlmaWVycy5iZWZvcmUpIG1vZGlmaWVycy5iZWZvcmUuY2FsbChzdGF0ZSwgc3RhdGUubm9kZSk7XG4gICAgICAgIFxuICAgICAgICBpZiAoIWtlZXBHb2luZykgcmV0dXJuIHN0YXRlO1xuICAgICAgICBcbiAgICAgICAgaWYgKHR5cGVvZiBzdGF0ZS5ub2RlID09ICdvYmplY3QnXG4gICAgICAgICYmIHN0YXRlLm5vZGUgIT09IG51bGwgJiYgIXN0YXRlLmNpcmN1bGFyKSB7XG4gICAgICAgICAgICBwYXJlbnRzLnB1c2goc3RhdGUpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICB1cGRhdGVTdGF0ZSgpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBmb3JFYWNoKHN0YXRlLmtleXMsIGZ1bmN0aW9uIChrZXksIGkpIHtcbiAgICAgICAgICAgICAgICBwYXRoLnB1c2goa2V5KTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICBpZiAobW9kaWZpZXJzLnByZSkgbW9kaWZpZXJzLnByZS5jYWxsKHN0YXRlLCBzdGF0ZS5ub2RlW2tleV0sIGtleSk7XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgdmFyIGNoaWxkID0gd2Fsa2VyKHN0YXRlLm5vZGVba2V5XSk7XG4gICAgICAgICAgICAgICAgaWYgKGltbXV0YWJsZSAmJiBoYXNPd25Qcm9wZXJ0eS5jYWxsKHN0YXRlLm5vZGUsIGtleSkpIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUubm9kZVtrZXldID0gY2hpbGQubm9kZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgY2hpbGQuaXNMYXN0ID0gaSA9PSBzdGF0ZS5rZXlzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICAgICAgY2hpbGQuaXNGaXJzdCA9IGkgPT0gMDtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICBpZiAobW9kaWZpZXJzLnBvc3QpIG1vZGlmaWVycy5wb3N0LmNhbGwoc3RhdGUsIGNoaWxkKTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICBwYXRoLnBvcCgpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBwYXJlbnRzLnBvcCgpO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICBpZiAobW9kaWZpZXJzLmFmdGVyKSBtb2RpZmllcnMuYWZ0ZXIuY2FsbChzdGF0ZSwgc3RhdGUubm9kZSk7XG4gICAgICAgIFxuICAgICAgICByZXR1cm4gc3RhdGU7XG4gICAgfSkocm9vdCkubm9kZTtcbn1cblxuZnVuY3Rpb24gY29weSAoc3JjKSB7XG4gICAgaWYgKHR5cGVvZiBzcmMgPT09ICdvYmplY3QnICYmIHNyYyAhPT0gbnVsbCkge1xuICAgICAgICB2YXIgZHN0O1xuICAgICAgICBcbiAgICAgICAgaWYgKGlzQXJyYXkoc3JjKSkge1xuICAgICAgICAgICAgZHN0ID0gW107XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoaXNEYXRlKHNyYykpIHtcbiAgICAgICAgICAgIGRzdCA9IG5ldyBEYXRlKHNyYy5nZXRUaW1lID8gc3JjLmdldFRpbWUoKSA6IHNyYyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoaXNSZWdFeHAoc3JjKSkge1xuICAgICAgICAgICAgZHN0ID0gbmV3IFJlZ0V4cChzcmMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGlzRXJyb3Ioc3JjKSkge1xuICAgICAgICAgICAgZHN0ID0geyBtZXNzYWdlOiBzcmMubWVzc2FnZSB9O1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGlzQm9vbGVhbihzcmMpKSB7XG4gICAgICAgICAgICBkc3QgPSBuZXcgQm9vbGVhbihzcmMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGlzTnVtYmVyKHNyYykpIHtcbiAgICAgICAgICAgIGRzdCA9IG5ldyBOdW1iZXIoc3JjKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpc1N0cmluZyhzcmMpKSB7XG4gICAgICAgICAgICBkc3QgPSBuZXcgU3RyaW5nKHNyYyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoT2JqZWN0LmNyZWF0ZSAmJiBPYmplY3QuZ2V0UHJvdG90eXBlT2YpIHtcbiAgICAgICAgICAgIGRzdCA9IE9iamVjdC5jcmVhdGUoT2JqZWN0LmdldFByb3RvdHlwZU9mKHNyYykpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHNyYy5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XG4gICAgICAgICAgICBkc3QgPSB7fTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhciBwcm90byA9XG4gICAgICAgICAgICAgICAgKHNyYy5jb25zdHJ1Y3RvciAmJiBzcmMuY29uc3RydWN0b3IucHJvdG90eXBlKVxuICAgICAgICAgICAgICAgIHx8IHNyYy5fX3Byb3RvX19cbiAgICAgICAgICAgICAgICB8fCB7fVxuICAgICAgICAgICAgO1xuICAgICAgICAgICAgdmFyIFQgPSBmdW5jdGlvbiAoKSB7fTtcbiAgICAgICAgICAgIFQucHJvdG90eXBlID0gcHJvdG87XG4gICAgICAgICAgICBkc3QgPSBuZXcgVDtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgZm9yRWFjaChvYmplY3RLZXlzKHNyYyksIGZ1bmN0aW9uIChrZXkp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SA6IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKG9iaikpKSA6IFtdO1xyXG4gICAgfVxyXG4gICAgVVJJLlNDSEVNRVNbXCJtYWlsdG9cIl0gPSB7XHJcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChjb21wb25lbnRzLCBvcHRpb25zKSB7XHJcbiAgICAgICAgICAgIGlmIChVUkkuVkFMSURBVEVfU1VQUE9SVCAmJiAhY29tcG9uZW50cy5lcnJvcikge1xyXG4gICAgICAgICAgICAgICAgaWYgKGNvbXBvbmVudHMucGF0aCAmJiAhVE8udGVzdChjb21wb25lbnRzLnBhdGgpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50cy5lcnJvciA9IFwiRW1haWwgYWRkcmVzcyBpcyBub3QgdmFsaWRcIjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNvbXBvbmVudHMucXVlcnkgJiYgIUhGSUVMRFMudGVzdChjb21wb25lbnRzLnF1ZXJ5KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuZXJyb3IgPSBcIkhlYWRlciBmaWVsZHMgYXJlIGludmFsaWRcIjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB2YXIgdG8gPSBjb21wb25lbnRzLnRvID0gKGNvbXBvbmVudHMucGF0aCA/IGNvbXBvbmVudHMucGF0aC5zcGxpdChcIixcIikgOiBbXSk7XHJcbiAgICAgICAgICAgIGNvbXBvbmVudHMucGF0aCA9IHVuZGVmaW5lZDtcclxuICAgICAgICAgICAgaWYgKGNvbXBvbmVudHMucXVlcnkpIHtcclxuICAgICAgICAgICAgICAgIHZhciB1bmtub3duSGVhZGVycyA9IGZhbHNlLCBoZWFkZXJzID0ge307XHJcbiAgICAgICAgICAgICAgICB2YXIgaGZpZWxkcyA9IGNvbXBvbmVudHMucXVlcnkuc3BsaXQoXCImXCIpO1xyXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgeCA9IDAsIHhsID0gaGZpZWxkcy5sZW5ndGg7IHggPCB4bDsgKyt4KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhmaWVsZCA9IGhmaWVsZHNbeF0uc3BsaXQoXCI9XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoaGZpZWxkWzBdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJ0b1wiOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvQWRkcnMgPSBoZmllbGRbMV0uc3BsaXQoXCIsXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeF8xID0gMCwgeGxfMSA9IHRvQWRkcnMubGVuZ3RoOyB4XzEgPCB4bF8xOyArK3hfMSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvLnB1c2godG9BZGRyc1t4XzFdKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwic3ViamVjdFwiOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50cy5zdWJqZWN0ID0gVVJJLnVuZXNjYXBlQ29tcG9uZW50KGhmaWVsZFsxXSwgb3B0aW9ucyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcImJvZHlcIjpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuYm9keSA9IFVSSS51bmVzY2FwZUNvbXBvbmVudChoZmllbGRbMV0sIG9wdGlvbnMpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmtub3duSGVhZGVycyA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzW1VSSS51bmVzY2FwZUNvbXBvbmVudChoZmllbGRbMF0sIG9wdGlvbnMpXSA9IFVSSS51bmVzY2FwZUNvbXBvbmVudChoZmllbGRbMV0sIG9wdGlvbnMpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKHVua25vd25IZWFkZXJzKVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuaGVhZGVycyA9IGhlYWRlcnM7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29tcG9uZW50cy5xdWVyeSA9IHVuZGVmaW5lZDtcclxuICAgICAgICAgICAgZm9yICh2YXIgeCA9IDAsIHhsID0gdG8ubGVuZ3RoOyB4IDwgeGw7ICsreCkge1xyXG4gICAgICAgICAgICAgICAgdmFyIGFkZHIgPSB0b1t4XS5zcGxpdChcIkBcIik7XHJcbiAgICAgICAgICAgICAgICBhZGRyWzBdID0gVVJJLnVuZXNjYXBlQ29tcG9uZW50KGFkZHJbMF0pO1xyXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwdW55Y29kZSAhPT0gXCJ1bmRlZmluZWRcIiAmJiAhb3B0aW9ucy51bmljb2RlU3VwcG9ydCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vY29udmVydCBVbmljb2RlIElETiAtPiBBU0NJSSBJRE5cclxuICAgICAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRyWzFdID0gcHVueWNvZGUudG9BU0NJSShVUkkudW5lc2NhcGVDb21wb25lbnQoYWRkclsxXSwgb3B0aW9ucykudG9Mb3dlckNhc2UoKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuZXJyb3IgPSBjb21wb25lbnRzLmVycm9yIHx8IFwiRW1haWwgYWRkcmVzcydzIGRvbWFpbiBuYW1lIGNhbiBub3QgYmUgY29udmVydGVkIHRvIEFTQ0lJIHZpYSBwdW55Y29kZTogXCIgKyBlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGFkZHJbMV0gPSBVUkkudW5lc2NhcGVDb21wb25lbnQoYWRkclsxXSwgb3B0aW9ucykudG9Mb3dlckNhc2UoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHRvW3hdID0gYWRkci5qb2luKFwiQFwiKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gY29tcG9uZW50cztcclxuICAgICAgICB9LFxyXG4gICAgICAgIHNlcmlhbGl6ZTogZnVuY3Rpb24gKGNvbXBvbmVudHMsIG9wdGlvbnMpIHtcclxuICAgICAgICAgICAgdmFyIHRvID0gdG9BcnJheShjb21wb25lbnRzLnRvKTtcclxuICAgICAgICAgICAgaWYgKHRvKSB7XHJcbiAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMCwgeGwgPSB0by5sZW5ndGg7IHggPCB4bDsgKyt4KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRvQWRkciA9IFN0cmluZyh0b1t4XSk7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIGF0SWR4ID0gdG9BZGRyLmxhc3RJbmRleE9mKFwiQFwiKTtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgbG9jYWxQYXJ0ID0gdG9BZGRyLnNsaWNlKDAsIGF0SWR4KTtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgZG9tYWluID0gdG9BZGRyLnNsaWNlKGF0SWR4ICsgMSk7XHJcbiAgICAgICAgICAgICAgICAgICAgbG9jYWxQYXJ0ID0gbG9jYWxQYXJ0LnJlcGxhY2UoUENUX0VOQ09ERUQsIGRlY29kZVVucmVzZXJ2ZWQpLnJlcGxhY2UoUENUX0VOQ09ERUQsIHRvVXBwZXJDYXNlKS5yZXBsYWNlKE5PVF9MT0NBTF9QQVJULCBVUkkucGN0RW5jQ2hhcik7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwdW55Y29kZSAhPT0gXCJ1bmRlZmluZWRcIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnZlcnQgSUROIHZpYSBwdW55Y29kZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9tYWluID0gKCFvcHRpb25zLmlyaSA/IHB1bnljb2RlLnRvQVNDSUkoVVJJLnVuZXNjYXBlQ29tcG9uZW50KGRvbWFpbiwgb3B0aW9ucykudG9Mb3dlckNhc2UoKSkgOiBwdW55Y29kZS50b1VuaWNvZGUoZG9tYWluKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuZXJyb3IgPSBjb21wb25lbnRzLmVycm9yIHx8IFwiRW1haWwgYWRkcmVzcydzIGRvbWFpbiBuYW1lIGNhbiBub3QgYmUgY29udmVydGVkIHRvIFwiICsgKCFvcHRpb25zLmlyaSA/IFwiQVNDSUlcIiA6IFwiVW5pY29kZVwiKSArIFwiIHZpYSBwdW55Y29kZTogXCIgKyBlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkb21haW4gPSBkb21haW4ucmVwbGFjZShQQ1RfRU5DT0RFRCwgZGVjb2RlVW5yZXNlcnZlZCkudG9Mb3dlckNhc2UoKS5yZXBsYWNlKFBDVF9FTkNPREVELCB0b1VwcGVyQ2FzZSkucmVwbGFjZShOT1RfRE9NQUlOLCBVUkkucGN0RW5jQ2hhcik7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHRvW3hdID0gbG9jYWxQYXJ0ICsgXCJAXCIgKyBkb21haW47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnBhdGggPSB0by5qb2luKFwiLFwiKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB2YXIgaGVhZGVycyA9IGNvbXBvbmVudHMuaGVhZGVycyA9IGNvbXBvbmVudHMuaGVhZGVycyB8fCB7fTtcclxuICAgICAgICAgICAgaWYgKGNvbXBvbmVudHMuc3ViamVjdClcclxuICAgICAgICAgICAgICAgIGhlYWRlcnNbXCJzdWJqZWN0XCJdID0gY29tcG9uZW50cy5zdWJqZWN0O1xyXG4gICAgICAgICAgICBpZiAoY29tcG9uZW50cy5ib2R5KVxyXG4gICAgICAgICAgICAgICAgaGVhZGVyc1tcImJvZHlcIl0gPSBjb21wb25lbnRzLmJvZHk7XHJcbiAgICAgICAgICAgIHZhciBmaWVsZHMgPSBbXTtcclxuICAgICAgICAgICAgZm9yICh2YXIgbmFtZV8xIGluIGhlYWRlcnMpIHtcclxuICAgICAgICAgICAgICAgIGlmIChoZWFkZXJzW25hbWVfMV0gIT09IE9bbmFtZV8xXSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGZpZWxkcy5wdXNoKG5hbWVfMS5yZXBsYWNlKFBDVF9FTkNPREVELCBkZWNvZGVVbnJlc2VydmVkKS5yZXBsYWNlKFBDVF9FTk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gICAgIH1cclxuICAgICAgICAgICAgICAgIG1hdGNoZXMgPSBjb21wb25lbnRzLnBhdGgubWF0Y2goVVJOX1BBUlNFKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAobWF0Y2hlcykge1xyXG4gICAgICAgICAgICAgICAgc2NoZW1lID0gXCJ1cm46XCIgKyBtYXRjaGVzWzFdLnRvTG93ZXJDYXNlKCk7XHJcbiAgICAgICAgICAgICAgICBzY2hlbWVIYW5kbGVyID0gVVJJLlNDSEVNRVNbc2NoZW1lXTtcclxuICAgICAgICAgICAgICAgIC8vaW4gb3JkZXIgdG8gc2VyaWFsaXplIHByb3Blcmx5LCBcclxuICAgICAgICAgICAgICAgIC8vZXZlcnkgVVJOIG11c3QgaGF2ZSBhIHNlcmlhbGl6ZXIgdGhhdCBjYWxscyB0aGUgVVJOIHNlcmlhbGl6ZXIgXHJcbiAgICAgICAgICAgICAgICBpZiAoIXNjaGVtZUhhbmRsZXIpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2NyZWF0ZSBmYWtlIHNjaGVtZSBoYW5kbGVyXHJcbiAgICAgICAgICAgICAgICAgICAgc2NoZW1lSGFuZGxlciA9IFVSSS5TQ0hFTUVTW3NjaGVtZV0gPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoY29tcG9uZW50cywgb3B0aW9ucykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvbmVudHM7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZTogVVJJLlNDSEVNRVNbXCJ1cm5cIl0uc2VyaWFsaXplXHJcbiAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuc2NoZW1lID0gc2NoZW1lO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5wYXRoID0gbWF0Y2hlc1syXTtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMgPSBzY2hlbWVIYW5kbGVyLnBhcnNlKGNvbXBvbmVudHMsIG9wdGlvbnMpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5lcnJvciA9IGNvbXBvbmVudHMuZXJyb3IgfHwgXCJVUk4gY2FuIG5vdCBiZSBwYXJzZWQuXCI7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGNvbXBvbmVudHM7XHJcbiAgICAgICAgfSxcclxuICAgICAgICBzZXJpYWxpemU6IGZ1bmN0aW9uIChjb21wb25lbnRzLCBvcHRpb25zKSB7XHJcbiAgICAgICAgICAgIHZhciBzY2hlbWUgPSBjb21wb25lbnRzLnNjaGVtZSB8fCBvcHRpb25zLnNjaGVtZSwgbWF0Y2hlcztcclxuICAgICAgICAgICAgaWYgKHNjaGVtZSAmJiBzY2hlbWUgIT09IFwidXJuXCIpIHtcclxuICAgICAgICAgICAgICAgIHZhciBtYXRjaGVzID0gc2NoZW1lLm1hdGNoKFVSTl9TQ0hFTUUpO1xyXG4gICAgICAgICAgICAgICAgaWYgKCFtYXRjaGVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2hlcyA9IFtcInVybjpcIiArIHNjaGVtZSwgc2NoZW1lXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuc2NoZW1lID0gXCJ1cm5cIjtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucGF0aCA9IG1hdGNoZXNbMV0gKyBcIjpcIiArIChjb21wb25lbnRzLnBhdGggPyBjb21wb25lbnRzLnBhdGgucmVwbGFjZShVUk5fRVhDTFVERUQsIHBjdEVuY0NoYXIpIDogXCJcIik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGNvbXBvbmVudHM7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIC8vUkZDIDQxMjJcclxuICAgIFVSSS5TQ0hFTUVTW1widXJuOnV1aWRcIl0gPSB7XHJcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChjb21wb25lbnRzLCBvcHRpb25zKSB7XHJcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy50b2xlcmFudCAmJiAoIWNvbXBvbmVudHMucGF0aCB8fCAhY29tcG9uZW50cy5wYXRoLm1hdGNoKFVVSUQpKSkge1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5lcnJvciA9IGNvbXBvbmVudHMuZXJyb3IgfHwgXCJVVUlEIGlzIG5vdCB2YWxpZC5cIjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gY29tcG9uZW50cztcclxuICAgICAgICB9LFxyXG4gICAgICAgIHNlcmlhbGl6ZTogZnVuY3Rpb24gKGNvbXBvbmVudHMsIG9wdGlvbnMpIHtcclxuICAgICAgICAgICAgLy9lbnN1cmUgVVVJRCBpcyB2YWxpZFxyXG4gICAgICAgICAgICBpZiAoIW9wdGlvbnMudG9sZXJhbnQgJiYgKCFjb21wb25lbnRzLnBhdGggfHwgIWNvbXBvbmVudHMucGF0aC5tYXRjaChVVUlEKSkpIHtcclxuICAgICAgICAgICAgICAgIC8vaW52YWxpZCBVVUlEcyBjYW4gbm90IGhhdmUgdGhpcyBzY2hlbWVcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuc2NoZW1lID0gdW5kZWZpbmVkO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy9ub3JtYWxpemUgVVVJRFxyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5wYXRoID0gKGNvbXBvbmVudHMucGF0aCB8fCBcIlwiKS50b0xvd2VyQ2FzZSgpO1xyXG4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VVJJX19JUklfU1VQUE9SVCA9IHRydWU7XHJcbi8qKlxyXG4gKiBDb21waWxlciBzd2l0Y2ggZm9yIHN1cHBvcnRpbmcgVVJJIHZhbGlkYXRpb25cclxuICogQGRlZmluZSB7Ym9vbGVhbn1cclxuICovXHJcbnZhciBVUklfX1ZBTElEQVRFX1NVUFBPUlQgPSB0cnVlO1xyXG52YXIgVVJJID0gKGZ1bmN0aW9uICgpIHtcclxuICAgIGZ1bmN0aW9uIG1lcmdlKCkge1xyXG4gICAgICAgIHZhciBzZXRzID0gW107XHJcbiAgICAgICAgZm9yICh2YXIgX2kgPSAwOyBfaSA8IGFyZ3VtZW50cy5sZW5ndGg7IF9pKyspIHtcclxuICAgICAgICAgICAgc2V0c1tfaSAtIDBdID0gYXJndW1lbnRzW19pXTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHNldHMubGVuZ3RoID4gMSkge1xyXG4gICAgICAgICAgICBzZXRzWzBdID0gc2V0c1swXS5zbGljZSgwLCAtMSk7XHJcbiAgICAgICAgICAgIHZhciB4bCA9IHNldHMubGVuZ3RoIC0gMTtcclxuICAgICAgICAgICAgZm9yICh2YXIgeCA9IDE7IHggPCB4bDsgKyt4KSB7XHJcbiAgICAgICAgICAgICAgICBzZXRzW3hdID0gc2V0c1t4XS5zbGljZSgxLCAtMSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgc2V0c1t4bF0gPSBzZXRzW3hsXS5zbGljZSgxKTtcclxuICAgICAgICAgICAgcmV0dXJuIHNldHMuam9pbignJyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICByZXR1cm4gc2V0c1swXTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBmdW5jdGlvbiBzdWJleHAoc3RyKSB7XHJcbiAgICAgICAgcmV0dXJuIFwiKD86XCIgKyBzdHIgKyBcIilcIjtcclxuICAgIH1cclxuICAgIGZ1bmN0aW9uIGJ1aWxk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SAoaSA8IGlsKSB7XHJcbiAgICAgICAgICAgIGMgPSBwYXJzZUludChzdHIuc3Vic3RyKGkgKyAxLCAyKSwgMTYpO1xyXG4gICAgICAgICAgICBpZiAoYyA8IDEyOCkge1xyXG4gICAgICAgICAgICAgICAgbmV3U3RyICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoYyk7XHJcbiAgICAgICAgICAgICAgICBpICs9IDM7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoYyA+PSAxOTQgJiYgYyA8IDIyNCkge1xyXG4gICAgICAgICAgICAgICAgaWYgKChpbCAtIGkpID49IDYpIHtcclxuICAgICAgICAgICAgICAgICAgICBjMiA9IHBhcnNlSW50KHN0ci5zdWJzdHIoaSArIDQsIDIpLCAxNik7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV3U3RyICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoKChjICYgMzEpIDw8IDYpIHwgKGMyICYgNjMpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIG5ld1N0ciArPSBzdHIuc3Vic3RyKGksIDYpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaSArPSA2O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKGMgPj0gMjI0KSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoKGlsIC0gaSkgPj0gOSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGMyID0gcGFyc2VJbnQoc3RyLnN1YnN0cihpICsgNCwgMiksIDE2KTtcclxuICAgICAgICAgICAgICAgICAgICBjMyA9IHBhcnNlSW50KHN0ci5zdWJzdHIoaSArIDcsIDIpLCAxNik7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV3U3RyICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoKChjICYgMTUpIDw8IDEyKSB8ICgoYzIgJiA2MykgPDwgNikgfCAoYzMgJiA2MykpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV3U3RyICs9IHN0ci5zdWJzdHIoaSwgOSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpICs9IDk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBuZXdTdHIgKz0gc3RyLnN1YnN0cihpLCAzKTtcclxuICAgICAgICAgICAgICAgIGkgKz0gMztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbmV3U3RyO1xyXG4gICAgfVxyXG4gICAgZnVuY3Rpb24gdHlwZU9mKG8pIHtcclxuICAgICAgICByZXR1cm4gbyA9PT0gdW5kZWZpbmVkID8gXCJ1bmRlZmluZWRcIiA6IChvID09PSBudWxsID8gXCJudWxsXCIgOiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwobykuc3BsaXQoXCIgXCIpLnBvcCgpLnNwbGl0KFwiXVwiKS5zaGlmdCgpLnRvTG93ZXJDYXNlKCkpO1xyXG4gICAgfVxyXG4gICAgZnVuY3Rpb24gdG9VcHBlckNhc2Uoc3RyKSB7XHJcbiAgICAgICAgcmV0dXJuIHN0ci50b1VwcGVyQ2FzZSgpO1xyXG4gICAgfVxyXG4gICAgdmFyIFNDSEVNRVMgPSB7fTtcclxuICAgIGZ1bmN0aW9uIF9ub3JtYWxpemVDb21wb25lbnRFbmNvZGluZyhjb21wb25lbnRzLCBwcm90b2NvbCkge1xyXG4gICAgICAgIGZ1bmN0aW9uIGRlY29kZVVucmVzZXJ2ZWQoc3RyKSB7XHJcbiAgICAgICAgICAgIHZhciBkZWNTdHIgPSBwY3REZWNDaGFycyhzdHIpO1xyXG4gICAgICAgICAgICByZXR1cm4gKCFkZWNTdHIubW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XHJcbiAgICAgICAgdmFyIHByb3RvY29sID0gKFVSSV9fSVJJX1NVUFBPUlQgJiYgb3B0aW9ucy5pcmkgIT09IGZhbHNlID8gSVJJX1BST1RPQ09MIDogVVJJX1BST1RPQ09MKSwgbWF0Y2hlcywgcGFyc2VFcnJvciA9IGZhbHNlLCBjb21wb25lbnRzID0ge30sIHNjaGVtZUhhbmRsZXI7XHJcbiAgICAgICAgaWYgKG9wdGlvbnMucmVmZXJlbmNlID09PSBcInN1ZmZpeFwiKVxyXG4gICAgICAgICAgICB1cmlTdHJpbmcgPSAob3B0aW9ucy5zY2hlbWUgPyBvcHRpb25zLnNjaGVtZSArIFwiOlwiIDogXCJcIikgKyBcIi8vXCIgKyB1cmlTdHJpbmc7XHJcbiAgICAgICAgaWYgKFVSSV9fVkFMSURBVEVfU1VQUE9SVCkge1xyXG4gICAgICAgICAgICBtYXRjaGVzID0gdXJpU3RyaW5nLm1hdGNoKHByb3RvY29sLlVSSV9SRUYpO1xyXG4gICAgICAgICAgICBpZiAobWF0Y2hlcykge1xyXG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoZXNbMV0pIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2dlbmVyaWMgVVJJXHJcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2hlcyA9IG1hdGNoZXMuc2xpY2UoMSwgMTApO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9yZWxhdGl2ZSBVUklcclxuICAgICAgICAgICAgICAgICAgICBtYXRjaGVzID0gbWF0Y2hlcy5zbGljZSgxMCwgMTkpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICghbWF0Y2hlcykge1xyXG4gICAgICAgICAgICAgICAgcGFyc2VFcnJvciA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICBpZiAoIW9wdGlvbnMudG9sZXJhbnQpXHJcbiAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50cy5lcnJvciA9IGNvbXBvbmVudHMuZXJyb3IgfHwgXCJVUkkgaXMgbm90IHN0cmljdGx5IHZhbGlkLlwiO1xyXG4gICAgICAgICAgICAgICAgbWF0Y2hlcyA9IHVyaVN0cmluZy5tYXRjaChVUklfUEFSU0UpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBtYXRjaGVzID0gdXJpU3RyaW5nLm1hdGNoKFVSSV9QQVJTRSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChtYXRjaGVzKSB7XHJcbiAgICAgICAgICAgIGlmIChOT19NQVRDSF9JU19VTkRFRklORUQpIHtcclxuICAgICAgICAgICAgICAgIC8vc3RvcmUgZWFjaCBjb21wb25lbnRcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMuc2NoZW1lID0gbWF0Y2hlc1sxXTtcclxuICAgICAgICAgICAgICAgIC8vY29tcG9uZW50cy5hdXRob3JpdHkgPSBtYXRjaGVzWzJdO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy51c2VyaW5mbyA9IG1hdGNoZXNbM107XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLmhvc3QgPSBtYXRjaGVzWzRdO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5wb3J0ID0gcGFyc2VJbnQobWF0Y2hlc1s1XSwgMTApO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5wYXRoID0gbWF0Y2hlc1s2XSB8fCBcIlwiO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5xdWVyeSA9IG1hdGNoZXNbN107XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLmZyYWdtZW50ID0gbWF0Y2hlc1s4XTtcclxuICAgICAgICAgICAgICAgIC8vZml4IHBvcnQgbnVtYmVyXHJcbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4oY29tcG9uZW50cy5wb3J0KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucG9ydCA9IG1hdGNoZXNbNV07XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvL3N0b3JlIGVhY2ggY29tcG9uZW50XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnNjaGVtZSA9IG1hdGNoZXNbMV0gfHwgdW5kZWZpbmVkO1xyXG4gICAgICAgICAgICAgICAgLy9jb21wb25lbnRzLmF1dGhvcml0eSA9ICh1cmlTdHJpbmcuaW5kZXhPZihcIi8vXCIpICE9PSAtMSA/IG1hdGNoZXNbMl0gOiB1bmRlZmluZWQpO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy51c2VyaW5mbyA9ICh1cmlTdHJpbmcuaW5kZXhPZihcIkBcIikgIT09IC0xID8gbWF0Y2hlc1szXSA6IHVuZGVmaW5lZCk7XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLmhvc3QgPSAodXJpU3RyaW5nLmluZGV4T2YoXCIvL1wiKSAhPT0gLTEgPyBtYXRjaGVzWzRdIDogdW5kZWZpbmVkKTtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucG9ydCA9IHBhcnNlSW50KG1hdGNoZXNbNV0sIDEwKTtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucGF0aCA9IG1hdGNoZXNbNl0gfHwgXCJcIjtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucXVlcnkgPSAodXJpU3RyaW5nLmluZGV4T2YoXCI/XCIpICE9PSAtMSA/IG1hdGNoZXNbN10gOiB1bmRlZmluZWQpO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5mcmFnbWVudCA9ICh1cmlTdHJpbmcuaW5kZXhPZihcIiNcIikgIT09IC0xID8gbWF0Y2hlc1s4XSA6IHVuZGVmaW5lZCk7XHJcbiAgICAgICAgICAgICAgICAvL2ZpeCBwb3J0IG51bWJlclxyXG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKGNvbXBvbmVudHMucG9ydCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRzLnBvcnQgPSAodXJpU3RyaW5nLm1hdGNoKC9cXC9cXC8oPzoufFxcbikqXFw6KD86XFwvfFxcP3xcXCN8JCkvKSA/IG1hdGNoZXNbNF0gOiB1bmRlZmluZWQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vZGV0ZXJtaW5lIHJlZmVyZW5jZSB0eXBlXHJcbiAgICAgICAgICAgIGlmIChjb21wb25lbnRzLnNjaGVtZSA9PT0gdW5kZWZpbmVkICYmIGNvbXBvbmVudHMudXNlcmluZm8gPT09IHVuZGVmaW5lZCAmJiBjb21wb25lbnRzLmhvc3QgPT09IHVuZGVmaW5lZCAmJiBjb21wb25lbnRzLnBvcnQgPT09IHVuZGVmaW5lZCAmJiAhY29tcG9uZW50cy5wYXRoICYmIGNvbXBvbmVudHMucXVlcnkgPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5yZWZlcmVuY2UgPSBcInNhbWUtZG9jdW1lbnRcIjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChjb21wb25lbnRzLnNjaGVtZSA9PT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnJlZmVyZW5jZSA9IFwicmVsYXRpdmVcIjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChjb21wb25lbnRzLmZyYWdtZW50ID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucmVmZXJlbmNlID0gXCJhYnNvbHV0ZVwiO1xyXG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3N0ICYmIChvcHRpb25zLmRvbWFpbkhvc3QgfHwgKHNjaGVtZUhhbmRsZXIgJiYgc2NoZW1lSGFuZGxlci5kb21haW5Ib3N0KSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2NvbnZlcnQgVW5pY29kZSBJRE4gLT4gQVNDSUkgSUROXHJcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50cy5ob3N0ID0gcHVueWNvZGUudG9BU0NJSShjb21wb25lbnRzLmhvc3QucmVwbGFjZShwcm90b2NvbC5QQ1RfRU5DT0RFRCwgcGN0RGVjQ2hhcnMpLnRvTG93ZXJDYXNlKCkpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRzLmVycm9yID0gY29tcG9uZW50cy5lcnJvciB8fCBcIkhvc3QncyBkb21haW4gbmFtZSBjYW4gbm90IGJlIGNvbnZlcnRlZCB0byBBU0NJSSB2aWEgcHVueWNvZGU6IFwiICsgZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvL2NvbnZlcnQgSVJJIC0+IFVSSVxyXG4gICAgICAgICAgICAgICAgX25vcm1hbGl6ZUNvbXBvbmVudEVuY29kaW5nKGNvbXBvbmVudHMsIFVSSV9QUk9UT0NPTCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvL25vcm1hbGl6ZSBlbmNvZGluZ3NcclxuICAgICAgICAgICAgICAgIF9ub3JtYWxpemVDb21wb25lbnRFbmNvZGluZyhjb21wb25lbnRzLCBwcm90b2NvbCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy9wZXJmb3JtIHNjaGVtZSBzcGVjaWZpYyBwYXJzaW5nXHJcbiAgICAgICAgICAgIGlmIChzY2hlbWVIYW5kbGVyICYmIHNjaGVtZUhhbmRsZXIucGFyc2UpIHtcclxuICAgICAgICAgICAgICAgIHNjaGVtZUhhbmRsZXIucGFyc2UoY29tcG9uZW50cywgb3B0aW9ucyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHBhcnNlRXJyb3IgPSB0cnVlO1xyXG4gICAgICAgICAgICBjb21wb25lbnRzLmVycm9yID0gY29tcG9uZW50cy5lcnJvciB8fCBcIlVSSSBjYW4gbm90IGJlIHBhcnNlZC5cIjtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGNvbXBvbmVudHM7XHJcbiAgICB9XHJcbiAgICA7XHJcbiAgICBmdW5jdGlvbiBfcmVjb21wb3NlQXV0aG9yaXR5KGNvbXBvbmVudHMsIG9wdGlvbnMpIHtcclxuICAgICAgICB2YXIgdXJpVG9rZW5zID0gW107XHJcbiAgICAgICAgaWYgKGNvbXBvbmVudHMudXNlcmluZm8gIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICB1cmlUb2tlbnMucHVzaChjb21wb25lbnRzLnVzZXJpbmZvKTtcclxuICAgICAgICAgICAgdXJpVG9rZW5zLnB1c2goXCJAXCIpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoY29tcG9uZW50cy5ob3N0ICE9PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgdXJpVG9rZW5zLnB1c2goY29tcG9uZW50cy5ob3N0KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHR5cGVvZiBjb21wb25lbnRzLnBvcnQgPT09IFwibnVtYmVyXCIpIHtcclxuICAgICAgICAgICAgdXJpVG9rZW5zLnB1c2goXCI6XCIpO1xyXG4gICAgICAgICAgICB1cmlUb2tlbnMucHVzaChjb21wb25lbnRzLnBvcnQudG9TdHJpbmcoMTApKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHVyaVRva2Vucy5sZW5ndGggPyB1cmlUb2tlbnMuam9pbihcIlwiKSA6IHVuZGVmaW5lZDtcclxuICAgIH1cclxuICAgIDtcclxuICAgIGZ1bmN0aW9uIHJlbW92ZURvdFNlZ21lbnRzKGlucHV0KSB7XHJcbiAgICAgICAgdmFyIG91dHB1dCA9IFtdLCBzO1xyXG4gICAgICAgIHdoaWxlIChpbnB1dC5sZW5ndGgpIHtcclxuICAgICAgICAgICAgaWYgKGlucHV0Lm1hdGNoKFJEUzEpKSB7XHJcbiAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnJlcGxhY2UoUkRTMSwgXCJcIik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoaW5wdXQubWF0Y2goUkRTMikpIHtcclxuICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQucmVwbGFjZShSRFMyLCBcIi9cIik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoaW5wdXQubWF0Y2goUkRTMykpIHtcclxuICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQucmVwbGFjZShSRFMzLCBcIi9cIik7XHJcbiAgICAgICAgICAgICAgICBvdXRwdXQucG9wKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoaW5wdXQgPT09IFwiLlwiIHx8IGlucHV0ID09PSBcIi4uXCIpIHtcclxuICAgICAgICAgICAgICAgIGlucHV0ID0gXCJcIjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHMgPSBpbnB1dC5tYXRjaChSRFM1KVswXTtcclxuICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQuc2xpY2Uocy5sZW5ndGgpO1xyXG4gICAgICAgICAgICAgICAgb3V0cHV0LnB1c2gocyk7XHJcbiAgICAgICAg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AgICAgICAgICAvL2NvbnZlcnQgSUROIHZpYSBwdW55Y29kZVxyXG4gICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5ob3N0ID0gKCFvcHRpb25zLmlyaSA/IHB1bnljb2RlLnRvQVNDSUkoY29tcG9uZW50cy5ob3N0LnJlcGxhY2UocHJvdG9jb2wuUENUX0VOQ09ERUQsIHBjdERlY0NoYXJzKS50b0xvd2VyQ2FzZSgpKSA6IHB1bnljb2RlLnRvVW5pY29kZShjb21wb25lbnRzLmhvc3QpKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXRjaCAoZSkge1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5lcnJvciA9IGNvbXBvbmVudHMuZXJyb3IgfHwgXCJIb3N0J3MgZG9tYWluIG5hbWUgY2FuIG5vdCBiZSBjb252ZXJ0ZWQgdG8gXCIgKyAoIW9wdGlvbnMuaXJpID8gXCJBU0NJSVwiIDogXCJVbmljb2RlXCIpICsgXCIgdmlhIHB1bnljb2RlOiBcIiArIGU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgLy9ub3JtYWxpemUgZW5jb2RpbmdcclxuICAgICAgICBfbm9ybWFsaXplQ29tcG9uZW50RW5jb2RpbmcoY29tcG9uZW50cywgcHJvdG9jb2wpO1xyXG4gICAgICAgIGlmIChvcHRpb25zLnJlZmVyZW5jZSAhPT0gXCJzdWZmaXhcIiAmJiBjb21wb25lbnRzLnNjaGVtZSkge1xyXG4gICAgICAgICAgICB1cmlUb2tlbnMucHVzaChjb21wb25lbnRzLnNjaGVtZSk7XHJcbiAgICAgICAgICAgIHVyaVRva2Vucy5wdXNoKFwiOlwiKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgYXV0aG9yaXR5ID0gX3JlY29tcG9zZUF1dGhvcml0eShjb21wb25lbnRzLCBvcHRpb25zKTtcclxuICAgICAgICBpZiAoYXV0aG9yaXR5ICE9PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgaWYgKG9wdGlvbnMucmVmZXJlbmNlICE9PSBcInN1ZmZpeFwiKSB7XHJcbiAgICAgICAgICAgICAgICB1cmlUb2tlbnMucHVzaChcIi8vXCIpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHVyaVRva2Vucy5wdXNoKGF1dGhvcml0eSk7XHJcbiAgICAgICAgICAgIGlmIChjb21wb25lbnRzLnBhdGggJiYgY29tcG9uZW50cy5wYXRoLmNoYXJBdCgwKSAhPT0gXCIvXCIpIHtcclxuICAgICAgICAgICAgICAgIHVyaVRva2Vucy5wdXNoKFwiL1wiKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoY29tcG9uZW50cy5wYXRoICE9PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgcyA9IGNvbXBvbmVudHMucGF0aDtcclxuICAgICAgICAgICAgaWYgKCFvcHRpb25zLmFic29sdXRlUGF0aCAmJiAoIXNjaGVtZUhhbmRsZXIgfHwgIXNjaGVtZUhhbmRsZXIuYWJzb2x1dGVQYXRoKSkge1xyXG4gICAgICAgICAgICAgICAgcyA9IHJlbW92ZURvdFNlZ21lbnRzKHMpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChhdXRob3JpdHkgPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgcyA9IHMucmVwbGFjZSgvXlxcL1xcLy8sIFwiLyUyRlwiKTsgLy9kb24ndCBhbGxvdyB0aGUgcGF0aCB0byBzdGFydCB3aXRoIFwiLy9cIlxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHVyaVRva2Vucy5wdXNoKHMpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoY29tcG9uZW50cy5xdWVyeSAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgIHVyaVRva2Vucy5wdXNoKFwiP1w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uc2NoZW1lO1xyXG4gICAgICAgICAgICAvL3RhcmdldC5hdXRob3JpdHkgPSByZWxhdGl2ZS5hdXRob3JpdHk7XHJcbiAgICAgICAgICAgIHRhcmdldC51c2VyaW5mbyA9IHJlbGF0aXZlLnVzZXJpbmZvO1xyXG4gICAgICAgICAgICB0YXJnZXQuaG9zdCA9IHJlbGF0aXZlLmhvc3Q7XHJcbiAgICAgICAgICAgIHRhcmdldC5wb3J0ID0gcmVsYXRpdmUucG9ydDtcclxuICAgICAgICAgICAgdGFyZ2V0LnBhdGggPSByZW1vdmVEb3RTZWdtZW50cyhyZWxhdGl2ZS5wYXRoKTtcclxuICAgICAgICAgICAgdGFyZ2V0LnF1ZXJ5ID0gcmVsYXRpdmUucXVlcnk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBpZiAocmVsYXRpdmUudXNlcmluZm8gIT09IHVuZGVmaW5lZCB8fCByZWxhdGl2ZS5ob3N0ICE9PSB1bmRlZmluZWQgfHwgcmVsYXRpdmUucG9ydCAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICAvL3RhcmdldC5hdXRob3JpdHkgPSByZWxhdGl2ZS5hdXRob3JpdHk7XHJcbiAgICAgICAgICAgICAgICB0YXJnZXQudXNlcmluZm8gPSByZWxhdGl2ZS51c2VyaW5mbztcclxuICAgICAgICAgICAgICAgIHRhcmdldC5ob3N0ID0gcmVsYXRpdmUuaG9zdDtcclxuICAgICAgICAgICAgICAgIHRhcmdldC5wb3J0ID0gcmVsYXRpdmUucG9ydDtcclxuICAgICAgICAgICAgICAgIHRhcmdldC5wYXRoID0gcmVtb3ZlRG90U2VnbWVudHMocmVsYXRpdmUucGF0aCk7XHJcbiAgICAgICAgICAgICAgICB0YXJnZXQucXVlcnkgPSByZWxhdGl2ZS5xdWVyeTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGlmICghcmVsYXRpdmUucGF0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldC5wYXRoID0gYmFzZS5wYXRoO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZWxhdGl2ZS5xdWVyeSAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldC5xdWVyeSA9IHJlbGF0aXZlLnF1ZXJ5O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LnF1ZXJ5ID0gYmFzZS5xdWVyeTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRpdmUucGF0aC5jaGFyQXQoMCkgPT09IFwiL1wiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldC5wYXRoID0gcmVtb3ZlRG90U2VnbWVudHMocmVsYXRpdmUucGF0aCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGJhc2UudXNlcmluZm8gIT09IHVuZGVmaW5lZCB8fCBiYXNlLmhvc3QgIT09IHVuZGVmaW5lZCB8fCBiYXNlLnBvcnQgIT09IHVuZGVmaW5lZCkgJiYgIWJhc2UucGF0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LnBhdGggPSBcIi9cIiArIHJlbGF0aXZlLnBhdGg7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWJhc2UucGF0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LnBhdGggPSByZWxhdGl2ZS5wYXRoO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LnBhdGggPSBiYXNlLnBhdGguc2xpY2UoMCwgYmFzZS5wYXRoLmxhc3RJbmRleE9mKFwiL1wiKSArIDEpICsgcmVsYXRpdmUucGF0aDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXQucGF0aCA9IHJlbW92ZURvdFNlZ21lbnRzKHRhcmdldC5wYXRoKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LnF1ZXJ5ID0gcmVsYXRpdmUucXVlcnk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvL3RhcmdldC5hdXRob3JpdHkgPSBiYXNlLmF1dGhvcml0eTtcclxuICAgICAgICAgICAgICAgIHRhcmdldC51c2VyaW5mbyA9IGJhc2UudXNlcmluZm87XHJcbiAgICAgICAgICAgICAgICB0YXJnZXQuaG9zdCA9IGJhc2UuaG9zdDtcclxuICAgICAgICAgICAgICAgIHRhcmdldC5wb3J0ID0gYmFzZS5wb3J0O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRhcmdldC5zY2hlbWUgPSBiYXNlLnNjaGVtZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGFyZ2V0LmZyYWdtZW50ID0gcmVsYXRpdmUuZnJhZ21lbnQ7XHJcbiAgICAgICAgcmV0dXJuIHRhcmdldDtcclxuICAgIH1cclxuICAgIDtcclxuICAgIGZ1bmN0aW9uIHJlc29sdmUoYmFzZVVSSSwgcmVsYXRpdmVVUkksIG9wdGlvbnMpIHtcclxuICAgICAgICByZXR1cm4gc2VyaWFsaXplKHJlc29sdmVDb21wb25lbnRz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XlswLTlBLUZdezh9LVswLTlBLUZdezR9LTVbMC05QS1GXXszfS1bODlBQl1bMC05QS1GXXszfS1bMC05QS1GXXsxMn0kL2lcbiAgICAgICwgYWxsOiAvXlswLTlBLUZdezh9LVswLTlBLUZdezR9LVswLTlBLUZdezR9LVswLTlBLUZdezR9LVswLTlBLUZdezEyfSQvaVxuICAgIH07XG5cbiAgICB2YXIgYWxwaGEgPSB7XG4gICAgICAgICdlbi1VUyc6IC9eW0EtWl0rJC9pLFxuICAgICAgICAnZGUtREUnOiAvXltBLVrDhMOWw5zDn10rJC9pLFxuICAgICAgfVxuICAgICAgLCBhbHBoYW51bWVyaWMgPSB7XG4gICAgICAgICdlbi1VUyc6IC9eWzAtOUEtWl0rJC9pLFxuICAgICAgICAnZGUtREUnOiAvXlswLTlBLVrDhMOWw5zDn10rJC9pXG4gICAgICB9XG4gICAgICAsIG51bWVyaWMgPSAvXlstK10/WzAtOV0rJC9cbiAgICAgICwgaW50ID0gL14oPzpbLStdPyg/OjB8WzEtOV1bMC05XSopKSQvXG4gICAgICAsIGZsb2F0ID0gL14oPzpbLStdPyg/OlswLTldKykpPyg/OlxcLlswLTldKik/KD86W2VFXVtcXCtcXC1dPyg/OlswLTldKykpPyQvXG4gICAgICAsIGhleGFkZWNpbWFsID0gL15bMC05QS1GXSskL2lcbiAgICAgICwgZGVjaW1hbCA9IC9eWy0rXT8oWzAtOV0rfFxcLlswLTldK3xbMC05XStcXC5bMC05XSspJC9cbiAgICAgICwgaGV4Y29sb3IgPSAvXiM/KFswLTlBLUZdezN9fFswLTlBLUZdezZ9KSQvaTtcblxuICAgIHZhciBhc2NpaSA9IC9eW1xceDAwLVxceDdGXSskL1xuICAgICAgLCBtdWx0aWJ5dGUgPSAvW15cXHgwMC1cXHg3Rl0vXG4gICAgICAsIGZ1bGxXaWR0aCA9IC9bXlxcdTAwMjAtXFx1MDA3RVxcdUZGNjEtXFx1RkY5RlxcdUZGQTAtXFx1RkZEQ1xcdUZGRTgtXFx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sbCBiZSBhbiBlcnJvciBzb29uLicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgaW5wdXQgPT09ICdvYmplY3QnICYmIGlucHV0ICE9PSBudWxsKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGlucHV0LnRvU3RyaW5nID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC50b1N0cmluZygpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpbnB1dCA9ICdbb2JqZWN0IE9iamVjdF0nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09PSBudWxsIHx8IHR5cGVvZiBpbnB1dCA9PT0gJ3VuZGVmaW5lZCcgfHwgKGlzTmFOKGlucHV0KSAmJiAhaW5wdXQubGVuZ3RoKSkge1xuICAgICAgICAgICAgaW5wdXQgPSAnJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gJycgKyBpbnB1dDtcbiAgICB9O1xuXG4gICAgdmFsaWRhdG9yLnRvRGF0ZSA9IGZ1bmN0aW9uIChkYXRlKSB7XG4gICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoZGF0ZSkgPT09ICdbb2JqZWN0IERhdGVdJykge1xuICAgICAgICAgICAgcmV0dXJuIGRhdGU7XG4gICAgICAgIH1cbiAgICAgICAgZGF0ZSA9IERhdGUucGFyc2UoZGF0ZSk7XG4gICAgICAgIHJldHVybiAhaXNOYU4oZGF0ZSkgPyBuZXcgRGF0ZShkYXRlKSA6IG51bGw7XG4gICAgfTtcblxuICAgIHZhbGlkYXRvci50b0Zsb2F0ID0gZnVuY3Rpb24gKHN0cikge1xuICAgICAgICByZXR1cm4gcGFyc2VGbG9hdChzdHIpO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IudG9JbnQgPSBmdW5jdGlvbiAoc3RyLCByYWRp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iAgICAgICwgcmVxdWlyZV9wcm90b2NvbDogZmFsc2VcbiAgICAgICwgcmVxdWlyZV92YWxpZF9wcm90b2NvbDogdHJ1ZVxuICAgICAgLCBhbGxvd191bmRlcnNjb3JlczogZmFsc2VcbiAgICAgICwgYWxsb3dfdHJhaWxpbmdfZG90OiBmYWxzZVxuICAgICAgLCBhbGxvd19wcm90b2NvbF9yZWxhdGl2ZV91cmxzOiBmYWxzZVxuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNVUkwgPSBmdW5jdGlvbiAodXJsLCBvcHRpb25zKSB7XG4gICAgICAgIGlmICghdXJsIHx8IHVybC5sZW5ndGggPj0gMjA4MyB8fCAvXFxzLy50ZXN0KHVybCkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodXJsLmluZGV4T2YoJ21haWx0bzonKSA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIG9wdGlvbnMgPSBtZXJnZShvcHRpb25zLCBkZWZhdWx0X3VybF9vcHRpb25zKTtcbiAgICAgICAgdmFyIHByb3RvY29sLCBhdXRoLCBob3N0LCBob3N0bmFtZSwgcG9ydCxcbiAgICAgICAgICAgIHBvcnRfc3RyLCBzcGxpdDtcbiAgICAgICAgc3BsaXQgPSB1cmwuc3BsaXQoJzovLycpO1xuICAgICAgICBpZiAoc3BsaXQubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgcHJvdG9jb2wgPSBzcGxpdC5zaGlmdCgpO1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMucmVxdWlyZV92YWxpZF9wcm90b2NvbCAmJiBvcHRpb25zLnByb3RvY29scy5pbmRleE9mKHByb3RvY29sKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAob3B0aW9ucy5yZXF1aXJlX3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9ydF9zdHIsIDEwKTtcbiAgICAgICAgICAgIGlmICghL15bMC05XSskLy50ZXN0KHBvcnRfc3RyKSB8fCBwb3J0IDw9IDAgfHwgcG9ydCA+IDY1NTM1KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghdmFsaWRhdG9yLmlzSVAoaG9zdCkgJiYgIXZhbGlkYXRvci5pc0ZRRE4oaG9zdCwgb3B0aW9ucykgJiZcbiAgICAgICAgICAgICAgICBob3N0ICE9PSAnbG9jYWxob3N0Jykge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChvcHRpb25zLmhvc3Rfd2hpdGVsaXN0ICYmXG4gICAgICAgICAgICAgICAgb3B0aW9ucy5ob3N0X3doaXRlbGlzdC5pbmRleE9mKGhvc3QpID09PSAtMSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChvcHRpb25zLmhvc3RfYmxhY2tsaXN0ICYmXG4gICAgICAgICAgICAgICAgb3B0aW9ucy5ob3N0X2JsYWNrbGlzdC5pbmRleE9mKGhvc3QpICE9PSAtMSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNNQUNBZGRyZXNzID0gZnVuY3Rpb24gKHN0cikge1xuICAgICAgICByZXR1cm4gbWFjQWRkcmVzcy50ZXN0KHN0cik7XG4gICAgfTtcblxuICAgIHZhbGlkYXRvci5pc0lQID0gZnVuY3Rpb24gKHN0ciwgdmVyc2lvbikge1xuICAgICAgICB2ZXJzaW9uID0gdmVyc2lvbiA/IHZlcnNpb24gKyAnJyA6ICcnO1xuICAgICAgICBpZiAoIXZlcnNpb24pIHtcbiAgICAgICAgICAgIHJldHVybiB2YWxp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sb2Nrcy5sZW5ndGggLSAxXSwgNCk7XG4gICAgICAgICAgICB2YXIgZXhwZWN0ZWROdW1iZXJPZkJsb2NrcyA9IGZvdW5kSVB2NFRyYW5zaXRpb25CbG9jayA/IDcgOiA4O1xuXG4gICAgICAgICAgICBpZiAoYmxvY2tzLmxlbmd0aCA+IGV4cGVjdGVkTnVtYmVyT2ZCbG9ja3MpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuXG4gICAgICAgICAgICAvLyBpbml0aWFsIG9yIGZpbmFsIDo6XG4gICAgICAgICAgICBpZiAoc3RyID09PSAnOjonKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN0ci5zdWJzdHIoMCwgMikgPT09ICc6OicpIHtcbiAgICAgICAgICAgICAgICBibG9ja3Muc2hpZnQoKTtcbiAgICAgICAgICAgICAgICBibG9ja3Muc2hpZnQoKTtcbiAgICAgICAgICAgICAgICBmb3VuZE9taXNzaW9uQmxvY2sgPSB0cnVlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChzdHIuc3Vic3RyKHN0ci5sZW5ndGggLSAyKSA9PT0gJzo6Jykge1xuICAgICAgICAgICAgICAgIGJsb2Nrcy5wb3AoKTtcbiAgICAgICAgICAgICAgICBibG9ja3MucG9wKCk7XG4gICAgICAgICAgICAgICAgZm91bmRPbWlzc2lvbkJsb2NrID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBibG9ja3MubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICAvLyB0ZXN0IGZvciBhIDo6IHdoaWNoIGNhbiBub3QgYmUgYXQgdGhlIHN0cmluZyBzdGFydC9lbmRcbiAgICAgICAgICAgICAgICAvLyBzaW5jZSB0aG9zZSBjYXNlcyBoYXZlIGJlZW4gaGFuZGxlZCBhYm92ZVxuICAgICAgICAgICAgICAgIGlmIChibG9ja3NbaV0gPT09ICcnICYmIGkgPiAwICYmIGkgPCBibG9ja3MubGVuZ3RoIC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmb3VuZE9taXNzaW9uQmxvY2spXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7IC8vIG11bHRpcGxlIDo6IGluIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgZm91bmRPbWlzc2lvbkJsb2NrID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZvdW5kSVB2NFRyYW5zaXRpb25CbG9jayAmJiBpID09IGJsb2Nrcy5sZW5ndGggLSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGl0IGhhcyBiZWVuIGNoZWNrZWQgYmVmb3JlIHRoYXQgdGhlIGxhc3RcbiAgICAgICAgICAgICAgICAgICAgLy8gYmxvY2sgaXMgYSB2YWxpZCBJUHY0IGFkZHJlc3NcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFpcHY2QmxvY2sudGVzdChibG9ja3NbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChmb3VuZE9taXNzaW9uQmxvY2spIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gYmxvY2tzLmxlbmd0aCA+PSAxO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gYmxvY2tzLmxlbmd0aCA9PT0gZXhwZWN0ZWROdW1iZXJPZkJsb2NrcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfTtcblxuICAgIHZhciBkZWZhdWx0X2ZxZG5fb3B0aW9ucyA9IHtcbiAgICAgICAgcmVxdWlyZV90bGQ6IHRydWVcbiAgICAgICwgYWxsb3dfdW5kZXJzY29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IHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcGFydCA9IHBhcnQucmVwbGFjZSgvXy9nLCAnJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIS9eW2EtelxcdTAwYTEtXFx1ZmZmZjAtOS1dKyQvaS50ZXN0KHBhcnQpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKC9bXFx1ZmYwMS1cXHVmZjVlXS8udGVzdChwYXJ0KSkge1xuICAgICAgICAgICAgICAgIC8vIGRpc2FsbG93IGZ1bGwtd2lkdGggY2hhcnNcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocGFydFswXSA9PT0gJy0nIHx8IHBhcnRbcGFydC5sZW5ndGggLSAxXSA9PT0gJy0nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHBhcnQuaW5kZXhPZignLS0tJykgPj0gMCAmJiBwYXJ0LnNsaWNlKDAsIDQpICE9PSAneG4tLScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfTtcblxuICAgIHZhbGlkYXRvci5pc0Jvb2xlYW4gPSBmdW5jdGlvbihzdHIpIHtcbiAgICAgICAgcmV0dXJuIChbJ3RydWUnLCAnZmFsc2UnLCAnMScsICcwJ10uaW5kZXhPZihzdHIpID49IDApO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNBbHBoYSA9IGZ1bmN0aW9uIChzdHIsIGxvY2FsZSkge1xuICAgICAgICBsb2NhbGUgPSBsb2NhbGUgfHwgJ2VuLVVTJztcbiAgICAgICAgcmV0dXJuIGFscGhhW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RoIC0gMTtcbiAgICAgICAgcmV0dXJuIGxlbiA+PSBtaW4gJiYgKHR5cGVvZiBtYXggPT09ICd1bmRlZmluZWQnIHx8IGxlbiA8PSBtYXgpO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNVVUlEID0gZnVuY3Rpb24gKHN0ciwgdmVyc2lvbikge1xuICAgICAgICB2YXIgcGF0dGVybiA9IHV1aWRbdmVyc2lvbiA/IHZlcnNpb24gOiAnYWxsJ107XG4gICAgICAgIHJldHVybiBwYXR0ZXJuICYmIHBhdHRlcm4udGVzdChzdHIpO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBnZXRUaW1lem9uZU9mZnNldChzdHIpIHtcbiAgICAgICAgdmFyIGlzbzg2MDFQYXJ0cyA9IHN0ci5tYXRjaChpc284NjAxKVxuICAgICAgICAgICwgdGltZXpvbmUsIHNpZ24sIGhvdXJzLCBtaW51dGVzO1xuICAgICAgICBpZiAoIWlzbzg2MDFQYXJ0cykge1xuICAgICAgICAgICAgc3RyID0gc3RyLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICB0aW1lem9uZSA9IHN0ci5tYXRjaCgvKD86XFxzfGdtdFxccyopKC18XFwrKShcXGR7MSw0fSkoXFxzfCQpLyk7XG4gICAgICAgICAgICBpZiAoIXRpbWV6b25lKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0ci5pbmRleE9mKCdnbXQnKSAhPT0gLTEgPyAwIDogbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNpZ24gPSB0aW1lem9uZVsxXTtcbiAgICAgICAgICAgIHZhciBvZmZzZXQgPSB0aW1lem9uZVsyXTtcbiAgICAgICAgICAgIGlmIChvZmZzZXQubGVuZ3RoID09PSAzKSB7XG4gICAgICAgICAgICAgICAgb2Zmc2V0ID0gJzAnICsgb2Zmc2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG9mZnNldC5sZW5ndGggPD0gMikge1xuICAgICAgICAgICAgICAgIGhvdXJzID0gMDtcbiAgICAgICAgICAgICAgICBtaW51dGVzID0gcGFyc2VJbnQob2Zmc2V0KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaG91cnMgPSBwYXJzZUludChvZmZzZXQuc2xpY2UoMCwgMikpO1xuICAgICAgICAgICAgICAgIG1pbnV0ZXMgPSBwYXJzZUludChvZmZzZXQuc2xpY2UoMiwgNCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGltZXpvbmUgPSBpc284NjAxUGFydHNbMjFdO1xuICAgICAgICAgICAgaWYgKCF0aW1lem9uZSkge1xuICAgICAgICAgICAgICAgIC8vIGlmIG5vIGhvdXIvbWludXRlIHdhcyBwcm92aWRlZCwgdGhlIGRhdGUgaXMgR01UXG4gICAgICAgICAgICAgICAgcmV0dXJuICFpc284NjAxUGFydHNbMTJdID8gMCA6IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGltZXpvbmUgPT09ICd6JyB8fCB0aW1lem9uZSA9PT0gJ1onKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWduID0gaXNvODYwMVBhcnRzWzIyXTtcbiAgICAgICAgICAgIGlmICh0aW1lem9uZS5pbmRleE9mKCc6JykgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgaG91cnMgPSBwYXJzZUludChpc284NjAxUGFydHNbMjNdKTtcbiAgICAgICAgICAgICAgICBtaW51dGVzID0gcGFyc2VJbnQoaXNvODYwMVBhcnRzWzI0XSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGhvdXJzID0gMDtcbiAgICAgICAgICAgICAgICBtaW51dGVzID0gcGFyc2VJbnQoaXNvODYwMVBhcnRzWzIzXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dX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gICAgIHZhciBjb21wYXJpc29uID0gdmFsaWRhdG9yLnRvRGF0ZShkYXRlIHx8IG5ldyBEYXRlKCkpXG4gICAgICAgICAgLCBvcmlnaW5hbCA9IHZhbGlkYXRvci50b0RhdGUoc3RyKTtcbiAgICAgICAgcmV0dXJuICEhKG9yaWdpbmFsICYmIGNvbXBhcmlzb24gJiYgb3JpZ2luYWwgPiBjb21wYXJpc29uKTtcbiAgICB9O1xuXG4gICAgdmFsaWRhdG9yLmlzQmVmb3JlID0gZnVuY3Rpb24gKHN0ciwgZGF0ZSkge1xuICAgICAgICB2YXIgY29tcGFyaXNvbiA9IHZhbGlkYXRvci50b0RhdGUoZGF0ZSB8fCBuZXcgRGF0ZSgpKVxuICAgICAgICAgICwgb3JpZ2luYWwgPSB2YWxpZGF0b3IudG9EYXRlKHN0cik7XG4gICAgICAgIHJldHVybiAhIShvcmlnaW5hbCAmJiBjb21wYXJpc29uICYmIG9yaWdpbmFsIDwgY29tcGFyaXNvbik7XG4gICAgfTtcblxuICAgIHZhbGlkYXRvci5pc0luID0gZnVuY3Rpb24gKHN0ciwgb3B0aW9ucykge1xuICAgICAgICB2YXIgaTtcbiAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvcHRpb25zKSA9PT0gJ1tvYmplY3QgQXJyYXldJykge1xuICAgICAgICAgICAgdmFyIGFycmF5ID0gW107XG4gICAgICAgICAgICBmb3IgKGkgaW4gb3B0aW9ucykge1xuICAgICAgICAgICAgICAgIGFycmF5W2ldID0gdmFsaWRhdG9yLnRvU3RyaW5nKG9wdGlvbnNbaV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycmF5LmluZGV4T2Yoc3RyKSA+PSAwO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBvcHRpb25zID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgcmV0dXJuIG9wdGlvbnMuaGFzT3duUHJvcGVydHkoc3RyKTtcbiAgICAgICAgfSBlbHNlIGlmIChvcHRpb25zICYmIHR5cGVvZiBvcHRpb25zLmluZGV4T2YgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIHJldHVybiBvcHRpb25zLmluZGV4T2Yoc3RyKSA+PSAwO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9O1xuXG4gICAgdmFsaWRhdG9yLmlzV2hpdGVsaXN0ZWQgPSBmdW5jdGlvbiAoc3RyLCBjaGFycykge1xuICAgICAgICBmb3IgKHZhciBpID0gc3RyLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7XG4gICAgICAgICAgICBpZiAoY2hhcnMuaW5kZXhPZihzdHJbaV0pID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNDcmVkaXRDYXJkID0gZnVuY3Rpb24gKHN0cikge1xuICAgICAgICB2YXIgc2FuaXRpemVkID0gc3RyLnJlcGxhY2UoL1teMC05XSsvZywgJycpO1xuICAgICAgICBpZiAoIWNyZWRpdENhcmQudGVzdChzYW5pdGl6ZWQpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHN1bSA9IDAsIGRpZ2l0LCB0bXBOdW0sIHNob3VsZERvdWJsZTtcbiAgICAgICAgZm9yICh2YXIgaSA9IHNhbml0aXplZC5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xuICAgICAgICAgICAgZGlnaXQgPSBzYW5pdGl6ZWQuc3Vic3RyaW5nKGksIChpICsgMSkpO1xuICAgICAgICAgICAgdG1wTnVtID0gcGFyc2VJbnQoZGlnaXQsIDEwKTtcbiAgICAgICAgICAgIGlmIChzaG91bGREb3VibGUpIHtcbiAgICAgICAgICAgICAgICB0bXBOdW0gKj0gMjtcbiAgICAgICAgICAgICAgICBpZiAodG1wTnVtID49IDEwKSB7XG4gICAgICAgICAgICAgICAgICAgIHN1bSArPSAoKHRtcE51bSAlIDEwKSArIDEpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN1bSArPSB0bXBOdW07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzdW0gKz0gdG1wTnVtO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2hvdWxkRG91YmxlID0gIXNob3VsZERvdWJsZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gISEoKHN1bSAlIDEwKSA9PT0gMCA/IHNhbml0aXplZCA6IGZhbHNlKTtcbiAgICB9O1xuXG4gICAgdmFsaWRhdG9yLmlzSVNJTiA9IGZ1bmN0aW9uIChzdHIpIHtcbiAgICAgICAgaWYgKCFpc2luLnRlc3Qoc3RyKSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGNoZWNrc3VtU3RyID0gc3RyLnJlcGxhY2UoL1tBLVpdL2csIGZ1bmN0aW9uKGNoYXJhY3Rlcikge1xuICAgICAgICAgICAgcmV0dXJuIHBhcnNlSW50KGNoYXJhY3RlciwgMzYpO1xuICAgICAgICB9KTtcblxuICAgICAgICB2YXIgc3VtID0gMCwgZGlnaXQsIHRtcE51bSwgc2hvdWxkRG91YmxlID0gdHJ1ZTtcbiAgICAgICAgZm9yICh2YXIgaSA9IGNoZWNrc3VtU3RyLmxlbmd0aCAtIDI7IGkgPj0gMDsgaS0tKSB7XG4gICAgICAgICAgICBkaWdpdCA9IGNoZWNrc3VtU3RyLnN1YnN0cmluZyhpLCAoaSArIDEpKTtcbiAgICAgICAgICAgIHRtcE51bSA9IHBhcnNlSW50KGRpZ2l0LCAxMCk7XG4gICAgICAgICAgICBpZiAoc2hvdWxkRG91YmxlKSB7XG4gICAgICAgICAgICAgICAgdG1wTnVtICo9IDI7XG4gICAgICAgICAgICAgICAgaWYgKHRtcE51bSA+PSAxMCkge1xuICAgICAgICAgICAgICAgICAgICBzdW0gKz0gdG1wTnVtICsgMTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdW0gKz0gdG1wTnVtO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3VtICs9IHRtcE51bTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNob3VsZERvdWJsZSA9ICFzaG91bGREb3VibGU7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcGFyc2VJbnQoc3RyLnN1YnN0cihzdHIubGVuZ3RoIC0gMSksIDEwKSA9PT0gKDEwMDAwIC0gc3VtKSAlIDEwO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNJU0JOID0gZnVuY3Rpb24gKHN0ciwgdmVyc2lvbikge1xuICAgICAgICB2ZXJzaW9uID0gdmVyc2lvbiA/IHZlcnNpb24gKyAnJyA6ICcnO1xuICAgICAgICBpZiAoIXZlcnNpb24pIHtcbiAgICAgICAgICAgIHJldHVybiB2YWxpZGF0b3IuaXNJU0JOKHN0ciwgMTApIHx8IHZhbGlkYXRvci5pc0lTQk4oc3RyLCAxMyk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHNhbml0aXplZCA9IHN0ci5yZXBsYWNlKC9bXFxzLV0rL2csICcnKVxuICAgICAgICAgICwgY2hlY2tzdW0gPSAwLCBpO1xuICAgICAgICBpZiAodmVyc2lvbiA9PT0gJzEwJykge1xuICAgICAgICAgICAgaWYgKCFpc2JuMTBNYXliZS50ZXN0KHNhbml0aXplZCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgOTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgY2hlY2tzdW0gKz0gKGkgKyAxKSAqIHNhbml0aXplZC5jaGFyQXQoaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc2FuaXRpemVkLmNoYXJBdCg5KSA9PT0gJ1gnKSB7XG4gICAgICAgICAgICAgICAgY2hlY2tzdW0gKz0gMTAgKiAxMDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY2hlY2tzdW0gKz0gMTAgKiBzYW5pdGl6ZWQuY2hhckF0KDkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKChjaGVja3N1bSAlIDExKSA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAhIXNhbml0aXplZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlICBpZiAodmVyc2lvbiA9PT0gJzEzJykge1xuICAgICAgICAgICAgaWYgKCFpc2JuMTNNYXliZS50ZXN0KHNhbml0aXplZCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgZmFjdG9yID0gWyAxLCAzIF07XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTI7IGkrKykge1xuICAgICAgICAgICAgICAgIGNoZWNrc3VtICs9IGZhY3RvcltpICUgMl0gKiBzYW5pdGl6ZWQuY2hhckF0KGkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHNhbml0aXplZC5jaGFyQXQoMTIpIC0gKCgxMCAtIChjaGVja3N1bSAlIDEwKSkgJSAxMCkgPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gISFzYW5pdGl6ZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH07XG5cbiAgICB2YWxpZGF0b3IuaXNNb2JpbGVQaG9uZSA9IGZ1bmN0aW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ge1xuICAgICAgICBsb3dlcmNhc2U6IHRydWUsXG4gICAgICAgIHJlbW92ZV9kb3RzOiB0cnVlLFxuICAgICAgICByZW1vdmVfZXh0ZW5zaW9uOiB0cnVlXG4gICAgfTtcblxuICAgIHZhbGlkYXRvci5ub3JtYWxpemVFbWFpbCA9IGZ1bmN0aW9uIChlbWFpbCwgb3B0aW9ucykge1xuICAgICAgICBvcHRpb25zID0gbWVyZ2Uob3B0aW9ucywgZGVmYXVsdF9ub3JtYWxpemVfZW1haWxfb3B0aW9ucyk7XG4gICAgICAgIGlmICghdmFsaWRhdG9yLmlzRW1haWwoZW1haWwpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHBhcnRzID0gZW1haWwuc3BsaXQoJ0AnLCAyKTtcbiAgICAgICAgcGFydHNbMV0gPSBwYXJ0c1sxXS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICBpZiAocGFydHNbMV0gPT09ICdnbWFpbC5jb20nIHx8IHBhcnRzWzFdID09PSAnZ29vZ2xlbWFpbC5jb20nKSB7XG4gICAgICAgICAgICBpZiAob3B0aW9ucy5yZW1vdmVfZXh0ZW5zaW9uKSB7XG4gICAgICAgICAgICAgICAgcGFydHNbMF0gPSBwYXJ0c1swXS5zcGxpdCgnKycpWzBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG9wdGlvbnMucmVtb3ZlX2RvdHMpIHtcbiAgICAgICAgICAgICAgICBwYXJ0c1swXSA9IHBhcnRzWzBdLnJlcGxhY2UoL1xcLi9nLCAnJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIXBhcnRzWzBdLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcnRzWzBdID0gcGFydHNbMF0udG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgIHBhcnRzWzFdID0gJ2dtYWlsLmNvbSc7XG4gICAgICAgIH0gZWxzZSBpZiAob3B0aW9ucy5sb3dlcmNhc2UpIHtcbiAgICAgICAgICAgIHBhcnRzWzBdID0gcGFydHNbMF0udG9Mb3dlckNhc2UoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcGFydHMuam9pbignQCcpO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBtZXJnZShvYmosIGRlZmF1bHRzKSB7XG4gICAgICAgIG9iaiA9IG9iaiB8fCB7fTtcbiAgICAgICAgZm9yICh2YXIga2V5IGluIGRlZmF1bHRzKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG9ialtrZXldID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIG9ialtrZXldID0gZGVmYXVsdHNba2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb2JqO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGN1cnJlbmN5UmVnZXgob3B0aW9ucykge1xuICAgICAgICB2YXIgc3ltYm9sID0gJyhcXFxcJyArIG9wdGlvbnMuc3ltYm9sLnJlcGxhY2UoL1xcLi9nLCAnXFxcXC4nKSArICcpJyArIChvcHRpb25zLnJlcXVpcmVfc3ltYm9sID8gJycgOiAnPycpXG4gICAgICAgICAgICAsIG5lZ2F0aXZlID0gJy0/J1xuICAgICAgICAgICAgLCB3aG9sZV9kb2xsYXJfYW1vdW50X3dpdGhvdXRfc2VwID0gJ1sxLTldXFxcXGQqJ1xuICAgICAgICAgICAgLCB3aG9sZV9kb2xsYXJfYW1vdW50X3dpdGhfc2VwID0gJ1sxLTldXFxcXGR7MCwyfShcXFxcJyArIG9wdGlvbnMudGhvdXNhbmRzX3NlcGFyYXRvciArICdcXFxcZHszfSkqJ1xuICAgICAgICAgICAgLCB2YWxpZF93aG9sZV9kb2xsYXJfYW1vdW50cyA9IFsnMCcsIHdob2xlX2RvbGxhcl9hbW91bnRfd2l0aG91dF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yKSB7XG4gICAgICAgICAgICBwYXR0ZXJuID0gJyggKD8hXFxcXC0pKT8nICsgcGF0dGVybjtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChvcHRpb25zLmFsbG93X3NwYWNlX2FmdGVyX3N5bWJvbCkge1xuICAgICAgICAgICAgcGF0dGVybiA9ICcgPycgKyBwYXR0ZXJuO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKG9wdGlvbnMuYWxsb3dfc3BhY2VfYWZ0ZXJfZGlnaXRzKSB7XG4gICAgICAgICAgICBwYXR0ZXJuICs9ICcoICg/ISQpKT8nO1xuICAgICAgICB9XG4gICAgICAgIGlmIChvcHRpb25zLnN5bWJvbF9hZnRlcl9kaWdpdHMpIHtcbiAgICAgICAgICAgIHBhdHRlcm4gKz0gc3ltYm9sO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcGF0dGVybiA9IHN5bWJvbCArIHBhdHRlcm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9wdGlvbnMuYWxsb3dfbmVnYXRpdmVzKSB7XG4gICAgICAgICAgICBpZiAob3B0aW9ucy5wYXJlbnNfZm9yX25lZ2F0aXZlcykge1xuICAgICAgICAgICAgICAgIHBhdHRlcm4gPSAnKFxcXFwoJyArIHBhdHRlcm4gKyAnXFxcXCl8JyArIHBhdHRlcm4gKyAnKSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICghKG9wdGlvbnMubmVnYXRpdmVfc2lnbl9iZWZvcmVfZGlnaXRzIHx8IG9wdGlvbnMubmVnYXRpdmVfc2lnbl9hZnRlcl9kaWdpdHMpKSB7XG4gICAgICAgICAgICAgICAgcGF0dGVybiA9IG5lZ2F0aXZlICsgcGF0dGVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3IFJlZ0V4cChcbiAgICAgICAgICAgICdeJyArXG4gICAgICAgICAgICAvLyBlbnN1cmUgdGhlcmUncyBhIGRvbGxhciBhbmQvb3IgZGVjaW1hbCBhbW91bnQsIGFuZCB0aGF0IGl0IGRvZXNuJ3Qgc3RhcnQgd2l0aCBhIHNwYWNlIG9yIGEgbmVnYXRpdmUgc2lnbiBmb2xsb3dlZCBieSBhIHNwYWNlXG4gICAgICAgICAgICAnKD8hLT8gKSg/PS4qXFxcXGQpJyArXG4gICAgICAgICAgICBwYXR0ZXJuICtcbiAgICAgICAgICAgICckJ1xuICAgICAgICApO1xuICAgIH1cblxuICAgIHZhbGlkYXRvci5pbml0KCk7XG5cbiAgICByZXR1cm4gdmFsaWRhdG9yO1xuXG59KTtcbiIsIlwidXNlIHN0cmljdFwiO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHtcblxuICAgIElOVkFMSURfVFlQRTogICAgICAgICAgICAgICAgICAgICAgICAgICBcIkV4cGVjdGVkIHR5cGUgezB9IGJ1dCBmb3VuZCB0eXBlIHsxfVwiLFxuICAgIElOVkFMSURfRk9STUFUOiAgICAgICAgICAgICAgICAgICAgICAgICBcIk9iamVjdCBkaWRuJ3QgcGFzcyB2YWxpZGF0aW9uIGZvciBmb3JtYXQgezB9OiB7MX1cIixcbiAgICBFTlVNX01JU01BVENIOiAgICAgICAgICAgICAgICAgICAgICAgICAgXCJObyBlbnVtIG1hdGNoIGZvcjogezB9XCIsXG4gICAgQU5ZX09GX01JU1NJTkc6ICAgICAgICAgICAgICAgICAgICAgICAgIFwiRGF0YSBkb2VzIG5vdCBtYXRjaCBhbnkgc2NoZW1hcyBmcm9tICdhbnlPZidcIixcbiAgICBPTkVfT0ZfTUlTU0lORzogICAgICAgICAgICAgICAgICAgICAgICAgXCJEYXRhIGRvZXMgbm90IG1hdGNoIGFueSBzY2hlbWFzIGZyb20gJ29uZU9mJ1wiLFxuICAgIE9ORV9PRl9NVUxUSVBMRTogICAgICAgICAgICAgICAgICAgICAgICBcIkRhdGEgaXMgdmFsaWQgYWdhaW5zdCBtb3JlIHRoYW4gb25lIHNjaGVtYSBmcm9tICdvbmVPZidcIixcbiAgICBOT1RfUEFTU0VEOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJEYXRhIG1hdGNoZXMgc2NoZW1hIGZyb20gJ25vdCdcIixcblxuICAgIC8vIEFycmF5IGVycm9yc1xuICAgIEFSUkFZX0xFTkdUSF9TSE9SVDogICAgICAgICAgICAgICAgICAgICBcIkFycmF5IGlzIHRvbyBzaG9ydCAoezB9KSwgbWluaW11bSB7MX1cIixcbiAgICBBUlJBWV9MRU5HVEhfTE9ORzogICAgICAgICAgICAgICAgICAgICAgXCJBcnJheSBpcyB0b28gbG9uZyAoezB9KSwgbWF4aW11bSB7MX1cIixcbiAgICBBUlJBWV9VTklRVUU6ICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJBcnJheSBpdGVtcyBhcmUgbm90IHVuaXF1ZSAoaW5kZXhlcyB7MH0gYW5kIHsxfSlcIixcbiAgICBBUlJBWV9BRERJVElPTkFMX0lURU1TOiAgICAgICAgICAgICAgICAgXCJBZGRpdGlvbmFsIGl0ZW1zIG5vdCBhbGxvd2VkXCIsXG5cbiAgICAvLyBOdW1lcmljIGVycm9yc1xuICAgIE1VTFRJUExFX09GOiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIlZhbHVlIHswfSBpcyBub3QgYSBtdWx0aXBsZSBvZiB7MX1cIixcbiAgICBNSU5JTVVNOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJWYWx1ZSB7MH0gaXMgbGVzcyB0aGFuIG1pbmltdW0gezF9XCIsXG4gICAgTUlOSU1VTV9FWENMVVNJVkU6ICAgICAgICAgICAgICAgICAgICAgIFwiVmFsdWUgezB9IGlzIGVxdWFsIG9yIGxlc3MgdGhhbiBleGNsdXNpdmUgbWluaW11bSB7MX1cIixcbiAgICBNQVhJTVVNOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJWYWx1ZSB7MH0gaXMgZ3JlYXRlciB0aGFuIG1heGltdW0gezF9XCIsXG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ggWiBpbiB1cHBlciBjYXNlIGFuZCBhIHRocm91Z2ggeiBpbiBsb3dlciBjYXNlXG4gICAgICAgICAgICB2YXIgbGV0dGVyID0gL1thLXpBLVpdLztcblxuICAgICAgICAgICAgPGxldC1kaWc+IDo6PSA8bGV0dGVyPiB8IDxkaWdpdD5cbiAgICAgICAgICAgIHZhciBsZXREaWcgPSAvWzAtOWEtekEtWl0vO1xuXG4gICAgICAgICAgICA8bGV0LWRpZy1oeXA+IDo6PSA8bGV0LWRpZz4gfCBcIi1cIlxuICAgICAgICAgICAgdmFyIGxldERpZ0h5cCA9IC9bLTAtOWEtekEtWl0vO1xuXG4gICAgICAgICAgICA8bGRoLXN0cj4gOjo9IDxsZXQtZGlnLWh5cD4gfCA8bGV0LWRpZy1oeXA+IDxsZGgtc3RyPlxuICAgICAgICAgICAgdmFyIGxkaFN0ciA9IC9bLTAtOWEtekEtWl0rLztcblxuICAgICAgICAgICAgPGxhYmVsPiA6Oj0gPGxldHRlcj4gWyBbIDxsZGgtc3RyPiBdIDxsZXQtZGlnPiBdXG4gICAgICAgICAgICB2YXIgbGFiZWwgPSAvW2EtekEtWl0oKFstMC05YS16QS1aXSspP1swLTlhLXpBLVpdKT8vO1xuXG4gICAgICAgICAgICA8c3ViZG9tYWluPiA6Oj0gPGxhYmVsPiB8IDxzdWJkb21haW4+IFwiLlwiIDxsYWJlbD5cbiAgICAgICAgICAgIHZhciBzdWJkb21haW4gPSAvXlthLXpBLVpdKChbLTAtOWEtekEtWl0rKT9bMC05YS16QS1aXSk/KFxcLlthLXpBLVpdKChbLTAtOWEtekEtWl0rKT9bMC05YS16QS1aXSk/KSokLztcblxuICAgICAgICAgICAgPGRvbWFpbj4gOjo9IDxzdWJkb21haW4+IHwgXCIgXCJcbiAgICAgICAgICAgIHZhciBkb21haW4gPSBudWxsO1xuICAgICAgICAqL1xuICAgICAgICB2YXIgdmFsaWQgPSAvXlthLXpBLVpdKChbLTAtOWEtekEtWl0rKT9bMC05YS16QS1aX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gICAgICAgICBpZHgyID0gcy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgd2hpbGUgKGlkeDItLSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVnRXhwLnRlc3Qoc1tpZHgyXSkgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHMuc3BsaWNlKGlkeDIsIDEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVmFsaWRhdGlvbiBvZiB0aGUganNvbiBzdWNjZWVkcyBpZiwgYWZ0ZXIgdGhlc2UgdHdvIHN0ZXBzLCBzZXQgXCJzXCIgaXMgZW1wdHkuXG4gICAgICAgICAgICBpZiAocy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgLy8gYXNzdW1lQWRkaXRpb25hbCBjYW4gYmUgYW4gYXJyYXkgb2YgYWxsb3dlZCBwcm9wZXJ0aWVzXG4gICAgICAgICAgICAgICAgdmFyIGlkeDMgPSB0aGlzLm9wdGlvbnMuYXNzdW1lQWRkaXRpb25hbC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWYgKGlkeDMpIHtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGlkeDMtLSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlvID0gcy5pbmRleE9mKHRoaXMub3B0aW9ucy5hc3N1bWVBZGRpdGlvbmFsW2lkeDNdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbyAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLnNwbGljZShpbywgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJPQkp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zLnZhbGlkYXRlLmNhbGwodGhpcywgcmVwb3J0LCBkZXBlbmRlbmN5RGVmaW5pdGlvbiwganNvbik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gQXJyYXlcbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgZGVwZW5kZW5jeSBpcyBhbiBhcnJheSwgb2JqZWN0IG5lZWRzIHRvIGhhdmUgYWxsIHByb3BlcnRpZXMgaW4gdGhpcyBhcnJheVxuICAgICAgICAgICAgICAgICAgICB2YXIgaWR4MiA9IGRlcGVuZGVuY3lEZWZpbml0aW9uLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGlkeDItLSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcXVpcmVkUHJvcGVydHlOYW1lID0gZGVwZW5kZW5jeURlZmluaXRpb25baWR4Ml07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoanNvbltyZXF1aXJlZFByb3BlcnR5TmFtZV0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIk9CSkVDVF9ERVBFTkRFTkNZX0tFWVwiLCBbcmVxdWlyZWRQcm9wZXJ0eU5hbWUsIGRlcGVuZGVuY3lOYW1lXSwgbnVsbCwgc2NoZW1hLmRlc2NyaXB0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sXG4gICAgZW51bTogZnVuY3Rpb24gKHJlcG9ydCwgc2NoZW1hLCBqc29uKSB7XG4gICAgICAgIC8vIGh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvbGF0ZXN0L2pzb24tc2NoZW1hLXZhbGlkYXRpb24uaHRtbCNyZmMuc2VjdGlvbi41LjUuMS4yXG4gICAgICAgIHZhciBtYXRjaCA9IGZhb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kge1xuICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIlJFRl9VTlJFU09MVkVEXCIsIFtzY2hlbWEuJHJlZl0sIG51bGwsIHNjaGVtYS5kZXNjcmlwdGlvbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNjaGVtYS5fXyRyZWZSZXNvbHZlZCA9PT0gc2NoZW1hKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNjaGVtYSA9IHNjaGVtYS5fXyRyZWZSZXNvbHZlZDtcbiAgICAgICAgICAgICAgICBrZXlzID0gT2JqZWN0LmtleXMoc2NoZW1hKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG1heFJlZnMtLTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWF4UmVmcyA9PT0gMCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiQ2lyY3VsYXIgZGVwZW5kZW5jeSBieSAkcmVmIHJlZmVyZW5jZXMhXCIpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gdHlwZSBjaGVja2luZyBmaXJzdFxuICAgIC8vIGh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvbGF0ZXN0L2pzb24tc2NoZW1hLXZhbGlkYXRpb24uaHRtbCNyZmMuc2VjdGlvbi41LjUuMi4yXG4gICAgdmFyIGpzb25UeXBlID0gVXRpbHMud2hhdElzKGpzb24pO1xuICAgIGlmIChzY2hlbWEudHlwZSkge1xuICAgICAgICBpZiAodHlwZW9mIHNjaGVtYS50eXBlID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICBpZiAoanNvblR5cGUgIT09IHNjaGVtYS50eXBlICYmIChqc29uVHlwZSAhPT0gXCJpbnRlZ2VyXCIgfHwgc2NoZW1hLnR5cGUgIT09IFwibnVtYmVyXCIpKSB7XG4gICAgICAgICAgICAgICAgcmVwb3J0LmFkZEVycm9yKFwiSU5WQUxJRF9UWVBFXCIsIFtzY2hlbWEudHlwZSwganNvblR5cGVdLCBudWxsLCBzY2hlbWEuZGVzY3JpcHRpb24pO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLm9wdGlvbnMuYnJlYWtPbkZpcnN0RXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChzY2hlbWEudHlwZS5pbmRleE9mKGpzb25UeXBlKSA9PT0gLTEgJiYgKGpzb25UeXBlICE9PSBcImludGVnZXJcIiB8fCBzY2hlbWEudHlwZS5pbmRleE9mKFwibnVtYmVyXCIpID09PSAtMSkpIHtcbiAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJJTlZBTElEX1RZUEVcIiwgW3NjaGVtYS50eXBlLCBqc29uVHlwZV0sIG51bGwsIHNjaGVtYS5kZXNjcmlwdGlvbik7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5icmVha09uRmlyc3RFcnJvcikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gbm93IGl0ZXJhdGUgYWxsIHRoZSBrZXlzIGluIHNjaGVtYSBhbmQgZXhlY3V0ZSB2YWxpZGF0aW9uIG1ldGhvZHNcbiAgICB2YXIgaWR4ID0ga2V5cy5sZW5ndGg7XG4gICAgd2hpbGUgKGlkeC0tKSB7XG4gICAgICAgIGlmIChKc29uVmFsaWRhdG9yc1trZXlzW2lkeF1dKSB7XG4gICAgICAgICAgICBKc29uVmFsaWRhdG9yc1trZXlzW2lkeF1dLmNhbGwodGhpcywgcmVwb3J0LCBzY2hlbWEsIGpzb24pO1xuICAgIC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gPSBqb2luZWRTY29wZSArIHJlZjtcbiAgICByZXMgPSByZXMucmVwbGFjZSgvIyMvLCBcIiNcIik7XG4gICAgcmV0dXJuIHJlcztcbn1cblxuZnVuY3Rpb24gY29sbGVjdFJlZmVyZW5jZXMob2JqLCByZXN1bHRzLCBzY29wZSwgcGF0aCkge1xuICAgIHJlc3VsdHMgPSByZXN1bHRzIHx8IFtdO1xuICAgIHNjb3BlID0gc2NvcGUgfHwgW107XG4gICAgcGF0aCA9IHBhdGggfHwgW107XG5cbiAgICBpZiAodHlwZW9mIG9iaiAhPT0gXCJvYmplY3RcIiB8fCBvYmogPT09IG51bGwpIHtcbiAgICAgICAgcmV0dXJuIHJlc3VsdHM7XG4gICAgfVxuXG4gICAgaWYgKHR5cGVvZiBvYmouaWQgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgc2NvcGUucHVzaChvYmouaWQpO1xuICAgIH1cblxuICAgIGlmICh0eXBlb2Ygb2JqLiRyZWYgPT09IFwic3RyaW5nXCIgJiYgdHlwZW9mIG9iai5fXyRyZWZSZXNvbHZlZCA9PT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICByZXN1bHRzLnB1c2goe1xuICAgICAgICAgICAgcmVmOiBtZXJnZVJlZmVyZW5jZShzY29wZSwgb2JqLiRyZWYpLFxuICAgICAgICAgICAga2V5OiBcIiRyZWZcIixcbiAgICAgICAgICAgIG9iajogb2JqLFxuICAgICAgICAgICAgcGF0aDogcGF0aC5zbGljZSgwKVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgaWYgKHR5cGVvZiBvYmouJHNjaGVtYSA9PT0gXCJzdHJpbmdcIiAmJiB0eXBlb2Ygb2JqLl9fJHNjaGVtYVJlc29sdmVkID09PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgIHJlc3VsdHMucHVzaCh7XG4gICAgICAgICAgICByZWY6IG1lcmdlUmVmZXJlbmNlKHNjb3BlLCBvYmouJHNjaGVtYSksXG4gICAgICAgICAgICBrZXk6IFwiJHNjaGVtYVwiLFxuICAgICAgICAgICAgb2JqOiBvYmosXG4gICAgICAgICAgICBwYXRoOiBwYXRoLnNsaWNlKDApXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHZhciBpZHg7XG4gICAgaWYgKEFycmF5LmlzQXJyYXkob2JqKSkge1xuICAgICAgICBpZHggPSBvYmoubGVuZ3RoO1xuICAgICAgICB3aGlsZSAoaWR4LS0pIHtcbiAgICAgICAgICAgIHBhdGgucHVzaChpZHgudG9TdHJpbmcoKSk7XG4gICAgICAgICAgICBjb2xsZWN0UmVmZXJlbmNlcyhvYmpbaWR4XSwgcmVzdWx0cywgc2NvcGUsIHBhdGgpO1xuICAgICAgICAgICAgcGF0aC5wb3AoKTtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICAgICAgaWR4ID0ga2V5cy5sZW5ndGg7XG4gICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgLy8gZG8gbm90IHJlY3Vyc2UgdGhyb3VnaCByZXNvbHZlZCByZWZlcmVuY2VzIGFuZCBvdGhlciB6LXNjaGVtYSBwcm9wc1xuICAgICAgICAgICAgaWYgKGtleXNbaWR4XS5pbmRleE9mKFwiX18kXCIpID09PSAwKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICBwYXRoLnB1c2goa2V5c1tpZHhdKTtcbiAgICAgICAgICAgIGNvbGxlY3RSZWZlcmVuY2VzKG9ialtrZXlzW2lkeF1dLCByZXN1bHRzLCBzY29wZSwgcGF0aCk7XG4gICAgICAgICAgICBwYXRoLnBvcCgpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKHR5cGVvZiBvYmouaWQgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgc2NvcGUucG9wKCk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHJlc3VsdHM7XG59XG5cbnZhciBjb21waWxlQXJ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aW5kSWQoYXJyLCByZWZPYmoucmVmKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIG1pZ2h0IGNyZWF0ZSBjaXJjdWxhciByZWZlcmVuY2VzXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZPYmoub2JqW1wiX19cIiArIHJlZk9iai5rZXkgKyBcIlJlc29sdmVkXCJdID0gcmVzcG9uc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpdCdzIHJlc29sdmVkIG5vdyBzbyBkZWxldGUgaXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjaC5fXyRtaXNzaW5nUmVmZXJlbmNlcy5zcGxpY2UoaWR4MiwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNjaC5fXyRtaXNzaW5nUmVmZXJlbmNlcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHNjaC5fXyRtaXNzaW5nUmVmZXJlbmNlcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBrZWVwIHJlcGVhdGluZyBpZiBub3QgYWxsIGNvbXBpbGVkIGFuZCBhdCBsZWFzdCBvbmUgbW9yZSB3YXMgY29tcGlsZWQgaW4gdGhlIGxhc3QgbG9vcFxuICAgIH0gd2hpbGUgKGNvbXBpbGVkICE9PSBhcnIubGVuZ3RoICYmIGNvbXBpbGVkICE9PSBsYXN0TG9vcENvbXBpbGVkKTtcblxuICAgIHJldHVybiByZXBvcnQuaXNWYWxpZCgpO1xuXG59O1xuXG5leHBvcnRzLmNvbXBpbGVTY2hlbWEgPSBmdW5jdGlvbiAocmVwb3J0LCBzY2hlbWEpIHtcblxuICAgIHJlcG9ydC5jb21tb25FcnJvck1lc3NhZ2UgPSBcIlNDSEVNQ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pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBjb3B5IGVycm9ycyB0byByZXBvcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydC5lcnJvcnMgPSByZXBvcnQuZXJyb3JzLmNvbmNhdChzdWJyZXBvcnQuZXJyb3JzKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gU2NoZW1hQ2FjaGUuZ2V0U2NoZW1hQnlVcmkuY2FsbCh0aGlzLCByZXBvcnQsIHJlZk9iai5yZWYsIHNjaGVtYSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXJlc3BvbnNlKSB7XG5cbiAgICAgICAgICAgIHZhciBoYXNOb3RWYWxpZCA9IHJlcG9ydC5oYXNFcnJvcihcIlJFTU9URV9OT1RfVkFMSURcIiwgW3JlZk9iai5yZWZdKTtcbiAgICAgICAgICAgIHZhciBpc0Fic29sdXRlID0gVXRpbHMuaXNBYnNvbHV0ZVVyaShyZWZPYmoucmVmKTtcbiAgICAgICAgICAgIHZhciBpc0Rvd25sb2FkZWQgPSBmYWxzZTtcbiAgICAgICAgICAgIHZhciBpZ25vcmVVbnJlc29sdmFibGVSZW1vdGVzID0gdGhpcy5vcHRpb25zLmlnbm9yZVVucmVzb2x2YWJsZVJlZmVyZW5jZXMgPT09IHRydWU7XG5cbiAgICAgICAgICAgIGlmIChpc0Fic29sdXRlKSB7XG4gICAgICAgICAgICAgICAgLy8gd2Ugc2hvdWxkbid0IGFkZCBVTlJFU09MVkFCTEVfUkVGRVJFTkNFIGZvciBzY2hlbWFzIHdlIGFscmVhZHkgaGF2ZSBkb3dubG9hZGVkXG4gICAgICAgICAgICAgICAgLy8gYW5kIHNldCB0aHJvdWdoIHNldFJlbW90ZVJlZmVyZW5jZSBtZXRob2RcbiAgIC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ykgIT09IFwib2JqZWN0XCIpIHtcbiAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfVFlQRV9FWFBFQ1RFRFwiLCBbXCJwcm9wZXJ0aWVzXCIsIFwib2JqZWN0XCJdKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMoc2NoZW1hLnByb3BlcnRpZXMpLFxuICAgICAgICAgICAgaWR4ID0ga2V5cy5sZW5ndGg7XG4gICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbaWR4XSxcbiAgICAgICAgICAgICAgICB2YWwgPSBzY2hlbWEucHJvcGVydGllc1trZXldO1xuICAgICAgICAgICAgcmVwb3J0LnBhdGgucHVzaChcInByb3BlcnRpZXNcIik7XG4gICAgICAgICAgICByZXBvcnQucGF0aC5wdXNoKGtleSk7XG4gICAgICAgICAgICBleHBvcnRzLnZhbGlkYXRlU2NoZW1hLmNhbGwodGhpcywgcmVwb3J0LCB2YWwpO1xuICAgICAgICAgICAgcmVwb3J0LnBhdGgucG9wKCk7XG4gICAgICAgICAgICByZXBvcnQucGF0aC5wb3AoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGN1c3RvbSAtIHN0cmljdCBtb2RlXG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMuZm9yY2VBZGRpdGlvbmFsID09PSB0cnVlICYmIHNjaGVtYS5hZGRpdGlvbmFsUHJvcGVydGllcyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1VOREVGSU5FRF9TVFJJQ1RcIiwgW1wiYWRkaXRpb25hbFByb3BlcnRpZXNcIl0pO1xuICAgICAgICB9XG4gICAgICAgIC8vIGN1c3RvbWUgLSBhc3N1bWUgZGVmaW5lZCBmYWxzZSBtb2RlXG4gICAgICAgIGlmICh0aGl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UuMVxuICAgICAgICBpZiAoVXRpbHMud2hhdElzKHNjaGVtYS5kZXBlbmRlbmNpZXMpICE9PSBcIm9iamVjdFwiKSB7XG4gICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1RZUEVfRVhQRUNURURcIiwgW1wiZGVwZW5kZW5jaWVzXCIsIFwib2JqZWN0XCJdKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMoc2NoZW1hLmRlcGVuZGVuY2llcyksXG4gICAgICAgICAgICAgICAgaWR4ID0ga2V5cy5sZW5ndGg7XG4gICAgICAgICAgICB3aGlsZSAoaWR4LS0pIHtcbiAgICAgICAgICAgICAgICB2YXIgc2NoZW1hS2V5ID0ga2V5c1tpZHhdLFxuICAgICAgICAgICAgICAgICAgICBzY2hlbWFEZXBlbmRlbmN5ID0gc2NoZW1hLmRlcGVuZGVuY2llc1tzY2hlbWFLZXldLFxuICAgICAgICAgICAgICAgICAgICB0eXBlID0gVXRpbHMud2hhdElzKHNjaGVtYURlcGVuZGVuY3kpO1xuXG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFwib2JqZWN0XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVwb3J0LnBhdGgucHVzaChcImRlcGVuZGVuY2llc1wiKTtcbiAgICAgICAgICAgICAgICAgICAgcmVwb3J0LnBhdGgucHVzaChzY2hlbWFLZXkpO1xuICAgICAgICAgICAgICAgICAgICBleHBvcnRzLnZhbGlkYXRlU2NoZW1hLmNhbGwodGhpcywgcmVwb3J0LCBzY2hlbWFEZXBlbmRlbmN5KTtcbiAgICAgICAgICAgICAgICAgICAgcmVwb3J0LnBhdGgucG9wKCk7XG4gICAgICAgICAgICAgICAgICAgIHJlcG9ydC5wYXRoLnBvcCgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gXCJhcnJheVwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpZHgyID0gc2NoZW1hRGVwZW5kZW5jeS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpZHgyID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX01VU1RfQkVcIiwgW1wiZGVwZW5kZW5jaWVzXCIsIFwibm90IGVtcHR5IGFycmF5XCJdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoaWR4Mi0tKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHNjaGVtYURlcGVuZGVuY3lbaWR4Ml0gIT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1ZBTFVFX1RZUEVcIiwgW1wiZGVwZW5kZW5zaWNlc1wiLCBcInN0cmluZ1wiXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKFV0aWxzLmlzVW5pcXVlQXJyYXkoc2NoZW1hRGVwZW5kZW5jeSkgPT09IGZhbHNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX01VU1RfQkVcIiwgW1wiZGVwZW5kZW5jaWVzXCIsIFwiYW4gYXJyYXkgd2l0aCB1bmlxdWUgaXRlbXNcIl0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVwb3J0LmFkZEVycm9yKFwiS0VZV09SRF9WQUxVRV9UWVBFXCIsIFtcImRlcGVuZGVuY2llc1wiLCBcIm9iamVjdCBvciBhcnJheVwiXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4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9iamVjdFwiLCBcInN0cmluZ1wiXSxcbiAgICAgICAgICAgIHByaW1pdGl2ZVR5cGVTdHIgPSBwcmltaXRpdmVUeXBlcy5qb2luKFwiLFwiKSxcbiAgICAgICAgICAgIGlzQXJyYXkgPSBBcnJheS5pc0FycmF5KHNjaGVtYS50eXBlKTtcblxuICAgICAgICBpZiAoaXNBcnJheSkge1xuICAgICAgICAgICAgdmFyIGlkeCA9IHNjaGVtYS50eXBlLmxlbmd0aDtcbiAgICAgICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgICAgIGlmIChwcmltaXRpdmVUeXBlcy5pbmRleE9mKHNjaGVtYS50eXBlW2lkeF0pID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1RZUEVfRVhQRUNURURcIiwgW1widHlwZVwiLCBwcmltaXRpdmVUeXBlU3RyXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKFV0aWxzLmlzVW5pcXVlQXJyYXkoc2NoZW1hLnR5cGUpID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfTVVTVF9CRVwiLCBbXCJ0eXBlXCIsIFwiYW4gb2JqZWN0IHdpdGggdW5pcXVlIHByb3BlcnRpZXNcIl0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBzY2hlbWEudHlwZSA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgaWYgKHByaW1pdGl2ZVR5cGVzLmluZGV4T2Yoc2NoZW1hLnR5cGUpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfVFlQRV9FWFBFQ1RFRFwiLCBbXCJ0eXBlXCIsIHByaW1pdGl2ZVR5cGVTdHJdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlcG9ydC5hZGRFcnJvcihcIktFWVdPUkRfVFlQRV9FWFBFQ1RFRFwiLCBbXCJ0eXBlXCIsIFtcInN0cmluZ1wiLCBcImFycmF5XCJdXSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLm5vRW1wdHlTdHJpbmdzID09PSB0cnVlKSB7XG4gICAgICAgICAgICBpZiAoc2NoZW1hLnR5cGUgPT09IFwic3RyaW5nXCIgfHwgaXNBcnJheSAmJiBzY2hlbWEudHlwZS5pbmRleE9mKFwic3RyaW5nXCIpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmIChzY2hlbWEubWluTGVuZ3RoID09PSB1bmRlZmluZWQgJiZcbiAgICAgICAgICAgICAgICAgICAgc2NoZW1hLmVudW0gPT09IHVuZGVmaW5lZCAmJlxuICAgICAgICAgICAgICAgICAgICBzY2hlbWEuZm9ybWF0ID09PSB1bmRlZmluZWQpIHtcblxuICAgICAgICAgICAgICAgICAgICBzY2hlbWEubWluTGVuZ3RoID0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5ub0VtcHR5QXJyYXlzID09PSB0cnVlKSB7XG4gICAgICAgICAgICBpZiAoc2NoZW1hLnR5cGUgPT09IFwiYXJyYXlcIiB8fCBpc0FycmF5ICYmIHNjaGVtYS50eXBlLmluZGV4T2YoXCJhcnJheVwiKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoc2NoZW1hLm1pbkl0ZW1zID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgc2NoZW1hLm1pbkl0ZW1zID0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5mb3JjZVByb3BlcnRpZXMgPT09IHRydWUpIHtcbiAgICAgICAgICAgIGlmIChzY2hlbWEudHlwZSA9PT0gXCJvYmplY3RcIiB8fCBpc0FycmF5ICYmIHNjaGVtYS50eXBlLmluZGV4T2YoXCJvYmplY3RcIikgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNjaGVtYS5wcm9wZXJ0aWVzID09PSB1bmRlZmluZWQgJiYgc2NoZW1hLnBhdHRlcm5Qcm9wZXJ0aWVzID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVwb3J0LmFkZEVycm9yKFwiS0VZV09SRF9VTkRFRklORURfU1RSSUNUXCIsIFtcInByb3BlcnRpZXNcIl0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmZvcmNlSXRlbXMgPT09IHRydWUpIHtcbiAgICAgICAgICAgIGlmIChzY2hlbWEudHlwZSA9PT0gXCJhcnJheVwiIHx8IGlzQXJyYXkgJiYgc2NoZW1hLnR5cGUuaW5kZXhPZihcImFycmF5XCIpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmIChzY2hlbWEuaXRlbXMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1VOREVGSU5FRF9TVFJJQ1RcIiwgW1wiaXRlbXNcIl0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmZvcmNlTWluSXRlbXMgPT09IHRydWUpIHtcbiAgICAgICAgICAgIGlmIChzY2hlbWEudHlwZSA9PT0gXCJhcnJheVwiIHx8IGlzQXJyYXkgJiYgc2NoZW1hLnR5cGUuaW5kZXhPZihcImFycmF5XCIpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmIChzY2hlbWEubWluSXRlbXMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1VOREVGSU5FRF9TVFJJQ1RcIiwgW1wibWluSXRlbXNcIl0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmZvcmNlTWF4SXRlbXMgPT09IHRydWUpIHtcbiAgICAgICAgICAgIGlmIChzY2hlbWEudHlwZSA9PT0gXCJhcnJheVwiIHx8IGlzQXJyYXkgJiYgc2NoZW1hLnR5cGUuaW5kZXhPZihcImFycmF5XCIpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmIChzY2hlbWEubWF4SXRlbXMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1VOREVGSU5FRF9TVFJJQ1RcIiwgW1wibWF4SXRlbXNcIl0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmZvcmNlTWluTGVuZ3RoID09PSB0cnVlKSB7XG4gICAgICAgICAgICBpZiAoc2NoZW1hLnR5cGUgPT09IFwic3RyaW5nXCIgfHwgaXNBcnJheSAmJiBzY2hlbWEudHlwZS5pbmRleE9mKFwic3RyaW5nXCIpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmIChzY2hlbWEubWluTGVuZ3RoID09PSB1bmRlZmluZWQgJiZcbiAgICAgICAgICAgICAgICAgICAgc2NoZW1hLmZvcm1hdCA9PT0gdW5kZWZpbmVkICYmXG4gICAgICAgICAgICAgICAgICAgIHNjaGVtYS5lbnVtID09PSB1bmRlZmluZWQgJiZcbiAgICAgICAgICAgICAgICAgICAgc2NoZW1hLnBhdHRlcm4gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1VOREVGSU5FRF9TVFJJQ1RcIiwgW1wibWluTGVuZ3RoXCJdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5mb3JjZU1heExlbmd0aCA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgaWYgKHNjaGVtYS50eXBlID09PSBcInN0cmluZ1wiIHx8IGlzQXJyYXkgJiYgc2NoZW1hLnR5cGUuaW5kZXhPZihcInN0cmluZ1wiKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoc2NoZW1hLm1heExlbmd0aCA9PT0gdW5kZWZpbmVkICYmXG4gICAgICAgICAgICAgICAgICAgIHNjaGVtYS5mb3JtYXQgPT09IHVuZGVmaW5lZCAmJlxuICAgICAgICAgICAgICAgICAgICBzY2hlbWEuZW51bSA9PT0gdW5kZWZpbmVkICYmXG4gICAgICAgICAgICAgICAgICAgIHNjaGVtYS5wYXR0ZXJuID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVwb3J0LmFkZEVycm9yKFwiS0VZV09SRF9VTkRFRklORURfU1RSSUNUXCIsIFtcIm1heExlbmd0aFwiXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSxcbiAgICBhbGxPZjogZnVuY3Rpb24gKHJlcG9ydCwgc2NoZW1hKSB7XG4gICAgICAgIC8vIGh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvbGF0ZXN0L2pzb24tc2NoZW1hLXZhbGlkYXRpb24uaHRtbCNyZmMuc2VjdGlvbi41LjUuMy4xXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KHNjaGVtYS5hbGxPZikgPT09IGZhbHNlKSB7XG4gICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1RZUEVfRVhQRUNURURcIiwgW1wiYW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ICAgICAgICAgIHJlcG9ydC5wYXRoLnBvcCgpO1xuICAgICAgICB9XG4gICAgfSxcbiAgICBkZWZpbml0aW9uczogZnVuY3Rpb24gKHJlcG9ydCwgc2NoZW1hKSB7XG4gICAgICAgIC8vIGh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvbGF0ZXN0L2pzb24tc2NoZW1hLXZhbGlkYXRpb24uaHRtbCNyZmMuc2VjdGlvbi41LjUuNy4xXG4gICAgICAgIGlmIChVdGlscy53aGF0SXMoc2NoZW1hLmRlZmluaXRpb25zKSAhPT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgcmVwb3J0LmFkZEVycm9yKFwiS0VZV09SRF9UWVBFX0VYUEVDVEVEXCIsIFtcImRlZmluaXRpb25zXCIsIFwib2JqZWN0XCJdKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMoc2NoZW1hLmRlZmluaXRpb25zKSxcbiAgICAgICAgICAgICAgICBpZHggPSBrZXlzLmxlbmd0aDtcbiAgICAgICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgICAgIHZhciBrZXkgPSBrZXlzW2lkeF0sXG4gICAgICAgICAgICAgICAgICAgIHZhbCA9IHNjaGVtYS5kZWZpbml0aW9uc1trZXldO1xuICAgICAgICAgICAgICAgIHJlcG9ydC5wYXRoLnB1c2goXCJkZWZpbml0aW9uc1wiKTtcbiAgICAgICAgICAgICAgICByZXBvcnQucGF0aC5wdXNoKGtleSk7XG4gICAgICAgICAgICAgICAgZXhwb3J0cy52YWxpZGF0ZVNjaGVtYS5jYWxsKHRoaXMsIHJlcG9ydCwgdmFsKTtcbiAgICAgICAgICAgICAgICByZXBvcnQucGF0aC5wb3AoKTtcbiAgICAgICAgICAgICAgICByZXBvcnQucGF0aC5wb3AoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sXG4gICAgZm9ybWF0OiBmdW5jdGlvbiAoc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c2NoZW1hcyA9IHNjaGVtYXMuY29uY2F0KHNjaGVtYS5hbGxPZik7IH1cbiAgICAgICAgICAgIHNjaGVtYXMuZm9yRWFjaChmdW5jdGlvbiAoc2NoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFzY2gudHlwZSkgeyBzY2gudHlwZSA9IHNjaGVtYS50eXBlOyB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAvLyBlbmQgaXNzdWUgIzM2XG4gICAgICAgIGlmIChzY2hlbWEuZW51bSA9PT0gdW5kZWZpbmVkICYmXG4gICAgICAgICAgICBzY2hlbWEudHlwZSA9PT0gdW5kZWZpbmVkICYmXG4gICAgICAgICAgICBzY2hlbWEuYW55T2YgPT09IHVuZGVmaW5lZCAmJlxuICAgICAgICAgICAgc2NoZW1hLm9uZU9mID09PSB1bmRlZmluZWQgJiZcbiAgICAgICAgICAgIHNjaGVtYS5ub3QgPT09IHVuZGVmaW5lZCAmJlxuICAgICAgICAgICAgc2NoZW1hLiRyZWYgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcmVwb3J0LmFkZEVycm9yKFwiS0VZV09SRF9VTkRFRklORURfU1RSSUNUXCIsIFtcInR5cGVcIl0pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmFyIGtleXMgPSBPYmplY3Qua2V5cyhzY2hlbWEpLFxuICAgICAgICBpZHggPSBrZXlzLmxlbmd0aDtcbiAgICB3aGlsZSAoaWR4LS0pIHtcbiAgICAgICAgdmFyIGtleSA9IGtleXNbaWR4XTtcbiAgICAgICAgaWYgKGtleS5pbmRleE9mKFwiX19cIikgPT09IDApIHsgY29udGludWU7IH1cbiAgICAgICAgaWYgKFNjaGVtYVZhbGlkYXRvcnNba2V5XSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBTY2hlbWFWYWxpZGF0b3JzW2tleV0uY2FsbCh0aGlzLCByZXBvcnQsIHNjaGVtYSk7XG4gICAgICAgIH0gZWxzZSBpZiAoIWhhc1BhcmVudFNjaGVtYSkge1xuICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5ub0V4dHJhS2V5d29yZHMgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICByZXBvcnQuYWRkRXJyb3IoXCJLRVlXT1JEX1VORVhQRUNURURcIiwgW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKHRoaXMub3B0aW9ucy5wZWRhbnRpY0NoZWNrID09PSB0cnVlKSB7XG4gICAgICAgIGlmIChzY2hlbWEuZW51bSkge1xuICAgICAgICAgICAgLy8gYnJlYWsgcmVjdXJzaW9uXG4gICAgICAgICAgICB2YXIgdG1wU2NoZW1hID0gVXRpbHMuY2xvbmUoc2NoZW1hKTtcbiAgICAgICAgICAgIGRlbGV0ZSB0bXBTY2hlbWEuZW51bTtcbiAgICAgICAgICAgIGRlbGV0ZSB0bXBTY2hlbWEuZGVmYXVsdDtcblxuICAgICAgICAgICAgcmVwb3J0LnBhdGgucHVzaChcImVudW1cIik7XG4gICAgICAgICAgICBpZHggPSBzY2hlbWEuZW51bS5sZW5ndGg7XG4gICAgICAgICAgICB3aGlsZSAoaWR4LS0pIHtcbiAgICAgICAgICAgICAgICByZXBvcnQucGF0aC5wdXNoKGlkeC50b1N0cmluZygpKTtcbiAgICAgICAgICAgICAgICBKc29uVmFsaWRhdGlvbi52YWxpZGF0ZS5jYWxsKHRoaXMsIHJlcG9ydCwgdG1wU2NoZW1hLCBzY2hlbWEuZW51bVtpZHhdKTtcbiAgICAgICAgICAgICAgICByZXBvcnQucGF0aC5wb3AoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlcG9ydC5wYXRoLnBvcCgpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHNjaGVtYS5kZWZhdWx0KSB7XG4gICAgICAgICAgICByZXBvcnQucGF0aC5wdXNoKFwiZGVmYXVsdFwiKTtcbiAgICAgICAgICAgIEpzb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0FycmF5KHdoYXQpO1xuICAgIH1cblxuICAgIGlmICh0byA9PT0gXCJudW1iZXJcIikge1xuICAgICAgICBpZiAoTnVtYmVyLmlzRmluaXRlKHdoYXQpKSB7XG4gICAgICAgICAgICBpZiAod2hhdCAlIDEgPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gXCJpbnRlZ2VyXCI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBcIm51bWJlclwiO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChOdW1iZXIuaXNOYU4od2hhdCkpIHtcbiAgICAgICAgICAgIHJldHVybiBcIm5vdC1hLW51bWJlclwiO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBcInVua25vd24tbnVtYmVyXCI7XG4gICAgfVxuXG4gICAgcmV0dXJuIHRvOyAvLyB1bmRlZmluZWQsIGJvb2xlYW4sIHN0cmluZywgZnVuY3Rpb25cblxufTtcblxuZXhwb3J0cy5hcmVFcXVhbCA9IGZ1bmN0aW9uIGFyZUVxdWFsKGpzb24xLCBqc29uMikge1xuICAgIC8vIGh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvbGF0ZXN0L2pzb24tc2NoZW1hLWNvcmUuaHRtbCNyZmMuc2VjdGlvbi4zLjZcblxuICAgIC8vIFR3byBKU09OIHZhbHVlcyBhcmUgc2FpZCB0byBiZSBlcXVhbCBpZiBhbmQgb25seSBpZjpcbiAgICAvLyBib3RoIGFyZSBudWxsczsgb3JcbiAgICAvLyBib3RoIGFyZSBib29sZWFucywgYW5kIGhhdmUgdGhlIHNhbWUgdmFsdWU7IG9yXG4gICAgLy8gYm90aCBhcmUgc3RyaW5ncywgYW5kIGhhdmUgdGhlIHNhbWUgdmFsdWU7IG9yXG4gICAgLy8gYm90aCBhcmUgbnVtYmVycywgYW5kIGhhdmUgdGhlIHNhbWUgbWF0aGVtYXRpY2FsIHZhbHVlOyBvclxuICAgIGlmIChqc29uMSA9PT0ganNvbjIpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgdmFyIGksIGxlbjtcblxuICAgIC8vIGJvdGggYXJlIGFycmF5cywgYW5kOlxuICAgIGlmIChBcnJheS5pc0FycmF5KGpzb24xKSAmJiBBcnJheS5pc0FycmF5KGpzb24yKSkge1xuICAgICAgICAvLyBoYXZlIHRoZSBzYW1lIG51bWJlciBvZiBpdGVtczsgYW5kXG4gICAgICAgIGlmIChqc29uMS5sZW5ndGggIT09IGpzb24yLmxlbmd0aCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIC8vIGl0ZW1zIGF0IHRoZSBzYW1lIGluZGV4IGFyZSBlcXVhbCBhY2NvcmRpbmcgdG8gdGhpcyBkZWZpbml0aW9uOyBvclxuICAgICAgICBsZW4gPSBqc29uMS5sZW5ndGg7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkrKykge1xuICAgICAgICAgICAgaWYgKCFhcmVFcXVhbChqc29uMVtpXSwganNvbjJbaV0pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8vIGJvdGggYXJlIG9iamVjdHMsIGFuZDpcbiAgICBpZiAoZXhwb3J0cy53aGF0SXMoanNvbjEpID09PSBcIm9iamVjdFwiICYmIGV4cG9ydHMud2hhdElzKGpzb24yKSA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAvLyBoYXZlIHRoZSBzYW1lIHNldCBvZiBwcm9wZXJ0eSBuYW1lczsgYW5kXG4gICAgICAgIHZhciBrZXlzMSA9IE9iamVjdC5rZXlzKGpzb24xKTtcbiAgICAgICAgdmFyIGtleXMyID0gT2JqZWN0LmtleXMoanNvbjIpO1xuICAgICAgICBpZiAoIWFyZUVxdWFsKGtleXMxLCBrZXlzM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zcmMgIT09IFwib2JqZWN0XCIgfHwgc3JjID09PSBudWxsKSB7IHJldHVybiBzcmM7IH1cbiAgICAgICAgdmFyIHJlcywgaWR4LCBjaWR4O1xuXG4gICAgICAgIGNpZHggPSB2aXNpdGVkLmluZGV4T2Yoc3JjKTtcbiAgICAgICAgaWYgKGNpZHggIT09IC0xKSB7IHJldHVybiBjbG9uZWRbY2lkeF07IH1cblxuICAgICAgICB2aXNpdGVkLnB1c2goc3JjKTtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoc3JjKSkge1xuICAgICAgICAgICAgcmVzID0gW107XG4gICAgICAgICAgICBjbG9uZWQucHVzaChyZXMpO1xuICAgICAgICAgICAgaWR4ID0gc3JjLmxlbmd0aDtcbiAgICAgICAgICAgIHdoaWxlIChpZHgtLSkge1xuICAgICAgICAgICAgICAgIHJlc1tpZHhdID0gY2xvbmVEZWVwKHNyY1tpZHhdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlcyA9IHt9O1xuICAgICAgICAgICAgY2xvbmVkLnB1c2gocmVzKTtcbiAgICAgICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMoc3JjKTtcbiAgICAgICAgICAgIGlkeCA9IGtleXMubGVuZ3RoO1xuICAgICAgICAgICAgd2hpbGUgKGlkeC0tKSB7XG4gICAgICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbaWR4XTtcbiAgICAgICAgICAgICAgICByZXNba2V5XSA9IGNsb25lRGVlcChzcmNba2V5XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlcztcbiAgICB9XG4gICAgcmV0dXJuIGNsb25lRGVlcChzcmMpO1xufTtcblxuLypcbiAgZm9sbG93aW5nIGZ1bmN0aW9uIGNvbWVzIGZyb20gcHVueWNvZGUuanMgbGlicmFyeVxuICBzZWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9iZXN0aWVqcy9wd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5fXyRyZWZSZXNvbHZlZCkge1xuICAgICAgICAgICAgdmFyIGZyb20gPSBzY2hlbWEuX18kcmVmUmVzb2x2ZWQ7XG4gICAgICAgICAgICB2YXIgdG8gPSBzY2hlbWE7XG4gICAgICAgICAgICBkZWxldGUgc2NoZW1hLiRyZWY7XG4gICAgICAgICAgICBkZWxldGUgc2NoZW1hLl9fJHJlZlJlc29sdmVkO1xuICAgICAgICAgICAgZm9yIChrZXkgaW4gZnJvbSkge1xuICAgICAgICAgICAgICAgIGlmIChmcm9tLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9ba2V5XSA9IGZyb21ba2V5XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChrZXkgaW4gc2NoZW1hKSB7XG4gICAgICAgICAgICBpZiAoc2NoZW1hLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgICAgICBpZiAoa2V5LmluZGV4T2YoXCJfXyRcIikgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHNjaGVtYVtrZXldO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNsZWFudXAoc2NoZW1hW2tleV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjbGVhbnVwKHNjaGVtYSk7XG4gICAgdmlzaXRlZC5mb3JFYWNoKGZ1bmN0aW9uIChzKSB7XG4gICAgICAgIGRlbGV0ZSBzLl9fXyR2aXNpdGVkO1xuICAgIH0pO1xuXG4gICAgdGhpcy5sYXN0UmVwb3J0ID0gcmVwb3J0O1xuICAgIGlmIChyZXBvcnQuaXNWYWxpZCgpKSB7XG4gICAgICAgIHJldHVybiBzY2hlbWE7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdGhyb3cgdGhpcy5nZXRMYXN0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G4iLCJtb2R1bGUuZXhwb3J0cz17XG4gICAgXCIkc2NoZW1hXCI6IFwiaHR0cDovL2pzb24tc2NoZW1hLm9yZy9kcmFmdC0wNC9oeXBlci1zY2hlbWEjXCIsXG4gICAgXCJpZFwiOiBcImh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvZHJhZnQtMDQvaHlwZXItc2NoZW1hI1wiLFxuICAgIFwidGl0bGVcIjogXCJKU09OIEh5cGVyLVNjaGVtYVwiLFxuICAgIFwiYWxsT2ZcIjogW1xuICAgICAgICB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA0L3NjaGVtYSNcIlxuICAgICAgICB9XG4gICAgXSxcbiAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcImFkZGl0aW9uYWxJdGVtc1wiOiB7XG4gICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcImJvb2xlYW5cIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjXCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgXCJhbnlPZlwiOiBbXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiI1wiXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImRlcGVuZGVuY2llc1wiOiB7XG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiI1wiXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCJcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiNcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYUFycmF5XCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVmaW5pdGlvbnNcIjoge1xuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiI1wiXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiI1wiXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjXCJcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJhbGxPZlwiOiB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYUFycmF5XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJhbnlPZlwiOiB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYUFycmF5XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJvbmVPZlwiOiB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYUFycmF5XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJub3RcIjoge1xuICAgICAgICAgICAgXCIkcmVmXCI6IFwiI1wiXG4gICAgICAgIH0sXG5cbiAgICAgICAgXCJsaW5rc1wiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9saW5rRGVzY3JpcHRpb25cIlxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBcImZyYWdtZW50UmVzb2x1dGlvblwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1lZGlhXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiQSBtZWRpYSB0eXBlLCBhcyBkZXNjcmliZWQgaW4gUkZDIDIwNDZcIixcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwiYmluYXJ5RW5jb2RpbmdcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiQSBjb250ZW50IGVuY29kaW5nIHNjaGVtZSwgYXMgZGVzY3JpYmVkIGluIFJGQyAyMDQ1XCIsXG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBcInBhdGhTdGFydFwiOiB7XG4gICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiSW5zdGFuY2VzJyBVUklzIG11c3Qgc3RhcnQgd2l0aCB0aGlzIHZhbHVlIGZvciB0aGlzIHNjaGVtYSB0byBhcHBseSB0byB0aGVtXCIsXG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwiZm9ybWF0XCI6IFwidXJpXCJcbiAgICAgICAgfVxuICAgIH0sXG4gICAgXCJkZWZpbml0aW9uc1wiOiB7XG4gICAgICAgIFwic2NoZW1hQXJyYXlcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgIFwiaXRlbXNcIjoge1xuICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiNcIlxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBcImxpbmtEZXNjcmlwdGlvblwiOiB7XG4gICAgICAgICAgICBcInRpdGxlXCI6IFwiTGluayBEZXNjcmlwdGlvbiBPYmplY3RcIixcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwiaHJlZlwiLCBcInJlbFwiIF0sXG4gICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwiaHJlZlwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJhIFVSSSB0ZW1wbGF0ZSwgYXMgZGVmaW5lZCBieSBSRkMgNjU3MCwgd2l0aCB0aGUgYWRkaXRpb24gb2YgdGhlICQsICggYW5kICkgY2hhcmFjdGVycyBmb3IgcHJlLXByb2Nlc3NpbmdcIixcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwicmVsXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcInJlbGF0aW9uIHRvIHRoZSB0YXJnZXQgcmVzb3VyY2Ugb2YgdGhlIGxpbmtcIixcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwidGl0bGVcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiYSB0aXRsZSBmb3IgdGhlIGxpbmtcIixcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwidGFyZ2V0U2NoZW1hXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIkpTT04gU2NoZW1hIGRlc2NyaWJpbmcgdGhlIGxpbmsgdGFyZ2V0XCIsXG4gICAgICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiNcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJtZWRpYVR5cGVcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwibWVkaWEgdHlwZSAoYXMgZGVmaW5lZCBieSBSRkMgMjA0NikgZGVzY3JpYmluZyB0aGUgbGluayB0YXJnZXRcIixcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwibWV0aG9kXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIm1ldGhvZCBmb3IgcmVxdWVzdGluZyB0aGUgdGFyZ2V0IG9mIHRoZSBsaW5rIChlLmcuIGZvciBIVFRQIHRoaXMgbWlnaHQgYmUgXFxcIkdFVFxcXCIgb3IgXFxcIkRFTEVURVxcXCIpXCIsXG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBcImVuY1R5cGVcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiVGhlIG1lZGlhIHR5cGUgaW4gd2hpY2ggdG8gc3VibWl0IGRhdGEgYWxvbmcgd2l0aCB0aGUgcmVxdWVzdFwiLFxuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgICAgICAgICAgXCJkZWZhdWx0XCI6IFwiYXBwbGljYXRpb24vanNvblwiXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBcInNjaGVtYVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJTY2hlbWEgZGVzY3JpYmluZyB0aGUgZGF0YSB0byBzdWJtaXQgYWxvbmcgd2l0aCB0aGUgcmVxdWVzdFwiLFxuICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjXCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59XG5cbiIsIm1vZHVsZS5leHBvcnRzPXtcbiAgICBcImlkXCI6IFwiaHR0cDovL2pzb24tc2NoZW1hLm9yZy9kcmFmdC0wNC9zY2hlbWEjXCIsXG4gICAgXCIkc2NoZW1hXCI6IFwiaHR0cDovL2pzb24tc2NoZW1hLm9yZy9kcmFmdC0wNC9zY2hlbWEjXCIsXG4gICAgXCJkZXNjcmlwdGlvblwiOiBcIkNvcmUgc2NoZW1hIG1ldGEtc2NoZW1hXCIsXG4gICAgXCJkZWZpbml0aW9uc1wiOiB7XG4gICAgICAgIFwic2NoZW1hQXJyYXlcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgIFwibWluSXRlbXNcIjogMSxcbiAgICAgICAgICAgIFwiaXRlbXNcIjogeyBcIiRyZWZcIjogXCIjXCIgfVxuICAgICAgICB9LFxuICAgICAgICBcInBvc2l0aXZlSW50ZWdlclwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJpbnRlZ2VyXCIsXG4gICAgICAgICAgICBcIm1pbmltdW1cIjogMFxuICAgICAgICB9LFxuICAgICAgICBcInBvc2l0aXZlSW50ZWdlckRlZmF1bHQwXCI6IHtcbiAgICAgICAgICAgIFwiYWxsT2ZcIjogWyB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyXCIgfSwgeyBcImRlZmF1bHRcIjogMCB9IF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJzaW1wbGVUeXBlc1wiOiB7XG4gICAgICAgICAgICBcImVudW1cIjogWyBcImFycmF5XCIsIFwiYm9vbGVhblwiLCBcImludGVnZXJcIiwgXCJudWxsXCIsIFwibnVtYmVyXCIsIFwib2JqZWN0XCIsIFwic3RyaW5nXCIgXVxuICAgICAgICB9LFxuICAgICAgICBcInN0cmluZ0FycmF5XCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICBcIml0ZW1zXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfSxcbiAgICAgICAgICAgIFwibWluSXRlbXNcIjogMSxcbiAgICAgICAgICAgIFwidW5pcXVlSXRlbXNcIjogdHJ1ZVxuICAgICAgICB9XG4gICAgfSxcbiAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcImlkXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgXCJmb3JtYXRcIjogXCJ1cmlcIlxuICAgICAgICB9LFxuICAgICAgICBcIiRzY2hlbWFcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgICBcImZvcm1hdFwiOiBcInVyaVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwidGl0bGVcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXNjcmlwdGlvblwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlZmF1bHRcIjoge30sXG4gICAgICAgIFwibXVsdGlwbGVPZlwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJudW1iZXJcIixcbiAgICAgICAgICAgIFwibWluaW11bVwiOiAwLFxuICAgICAgICAgICAgXCJleGNsdXNpdmVNaW5pbXVtXCI6IHRydWVcbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhpbXVtXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm51bWJlclwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXhjbHVzaXZlTWF4aW11bVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgICBcImRlZmF1bHRcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJtaW5pbXVtXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm51bWJlclwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXhjbHVzaXZlTWluaW11bVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgICBcImRlZmF1bHRcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhMZW5ndGhcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3Bvc2l0aXZlSW50ZWdlclwiIH0sXG4gICAgICAgIFwibWluTGVuZ3RoXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJEZWZhdWx0MFwiIH0sXG4gICAgICAgIFwicGF0dGVyblwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwiZm9ybWF0XCI6IFwicmVnZXhcIlxuICAgICAgICB9LFxuICAgICAgICBcImFkZGl0aW9uYWxJdGVtc1wiOiB7XG4gICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7IFwidHlwZVwiOiBcImJvb2xlYW5cIiB9LFxuICAgICAgICAgICAgICAgIHsgXCIkcmVmXCI6IFwiI1wiIH1cbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7IFwiJHJlZlwiOiBcIiNcIiB9LFxuICAgICAgICAgICAgICAgIHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zY2hlbWFBcnJheVwiIH1cbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhJdGVtc1wiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyXCIgfSxcbiAgICAgICAgXCJtaW5JdGVtc1wiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcG9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iBcIiNcIiB9LFxuICAgICAgICAgICAgXCJkZWZhdWx0XCI6IHt9XG4gICAgICAgIH0sXG4gICAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHsgXCIkcmVmXCI6IFwiI1wiIH0sXG4gICAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXBlbmRlbmNpZXNcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICAgICAgeyBcIiRyZWZcIjogXCIjXCIgfSxcbiAgICAgICAgICAgICAgICAgICAgeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3N0cmluZ0FycmF5XCIgfVxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJlbnVtXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICBcIm1pbkl0ZW1zXCI6IDEsXG4gICAgICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHRydWVcbiAgICAgICAgfSxcbiAgICAgICAgXCJ0eXBlXCI6IHtcbiAgICAgICAgICAgIFwiYW55T2ZcIjogW1xuICAgICAgICAgICAgICAgIHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zaW1wbGVUeXBlc1wiIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgICAgICAgICBcIml0ZW1zXCI6IHsgXCIkcmVmXCI6IFwiIy9kZW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VQYXRoXCIsIFwiYXBpc1wiIF0sXG4gICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJzd2FnZ2VyVmVyc2lvblwiOiB7IFwiZW51bVwiOiBbIFwiMS4yXCIgXSB9LFxuICAgICAgICBcImFwaVZlcnNpb25cIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICBcImJhc2VQYXRoXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgXCJmb3JtYXRcIjogXCJ1cmlcIixcbiAgICAgICAgICAgIFwicGF0dGVyblwiOiBcIl5odHRwcz86Ly9cIlxuICAgICAgICB9LFxuICAgICAgICBcInJlc291cmNlUGF0aFwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwiZm9ybWF0XCI6IFwidXJpXCIsXG4gICAgICAgICAgICBcInBhdHRlcm5cIjogXCJeL1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiYXBpc1wiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgXCJpdGVtc1wiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvYXBpT2JqZWN0XCIgfVxuICAgICAgICB9LFxuICAgICAgICBcIm1vZGVsc1wiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIm1vZGVsc09iamVjdC5qc29uI1wiXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwicHJvZHVjZXNcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbWVUeXBlQXJyYXlcIiB9LFxuICAgICAgICBcImNvbnN1bWVzXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9taW1lVHlwZUFycmF5XCIgfSxcbiAgICAgICAgXCJhdXRob3JpemF0aW9uc1wiOiB7IFwiJHJlZlwiOiBcImF1dGhvcml6YXRpb25PYmplY3QuanNvbiNcIiB9XG4gICAgfSxcbiAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlLFxuICAgIFwiZGVmaW5pdGlvbnNcIjoge1xuICAgICAgICBcImFwaU9iamVjdFwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcInBhdGhcIiwgXCJvcGVyYXRpb25zXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJwYXRoXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IFwidXJpLXRlbXBsYXRlXCIsXG4gICAgICAgICAgICAgICAgICAgIFwicGF0dGVyblwiOiBcIl4vXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICAgICAgICAgIFwib3BlcmF0aW9uc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICAgICAgICAgIFwiaXRlbXNcIjogeyBcIiRyZWZcIjogXCJvcGVyYXRpb25PYmplY3QuanNvbiNcIiB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJtaW1lVHlwZUFycmF5XCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgICAgICBcImZvcm1hdFwiOiBcIm1pbWUtdHlwZVwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJ1bmlxdWVJdGVtc1wiOiB0cnVlXG4gICAgICAgIH1cbiAgICB9XG59XG4iLCJtb2R1bGUuZXhwb3J0cz17XG4gICAgXCJpZFwiOiBcImh0dHA6Ly93b3JkbmlrLmdpdGh1Yi5pby9zY2hlbWFzL3YxLjIvYXV0aG9yaXphdGlvbk9iamVjdC5qc29uI1wiLFxuICAgIFwiJHNjaGVtYVwiOiBcImh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvZHJhZnQtMDQvc2NoZW1hI1wiLFxuICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIm9uZU9mXCI6IFtcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2Jhc2ljQXV0aFwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvYXBpS2V5XCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9vYXV0aDJcIlxuICAgICAgICAgICAgfVxuICAgICAgICBdXG4gICAgfSxcbiAgICBcImRlZmluaXRpb25zXCI6IHtcbiAgICAgICAgXCJiYXNpY0F1dGhcIjoge1xuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwidHlwZVwiIF0sXG4gICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7IFwiZW51bVwiOiBbIFwiYmFzaWNBdXRoXCIgXSB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcImFwaUtleVwiOiB7XG4gICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCJ0eXBlXCIsIFwicGFzc0FzXCIsIFwia2V5bmFtZVwiIF0sXG4gICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7IFwiZW51bVwiOiBbIFwiYXBpS2V5XCIgXSB9LFxuICAgICAgICAgICAgICAgIFwicGFzc0FzXCI6IHsgXCJlbnVtXCI6IFsgXCJoZWFkZXJcIiwgXCJxdWVyeVwiIF0gfSxcbiAgICAgICAgICAgICAgICBcImtleW5hbWVcIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcIm9hdXRoMlwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcInR5cGVcIiwgXCJncmFudFR5cGVzXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJvYXV0aDJcIiBdIH0sXG4gICAgICAgICAgICAgICAgXCJzY29wZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgICAgICAgICBcIml0ZW1zXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9vYXV0aDJTY29wZVwiIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwi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vaWRUeXBlXCIgfSxcbiAgICAgICAgeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ByaW1pdGl2ZVR5cGVcIiB9LFxuICAgICAgICB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbW9kZWxUeXBlXCIgfSxcbiAgICAgICAgeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2FycmF5VHlwZVwiIH1cbiAgICBdLFxuICAgIFwiZGVmaW5pdGlvbnNcIjoge1xuICAgICAgICBcInJlZlR5cGVcIjoge1xuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwiJHJlZlwiIF0sXG4gICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwiJHJlZlwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwidm9pZFR5cGVcIjoge1xuICAgICAgICAgICAgXCJlbnVtXCI6IFsgeyBcInR5cGVcIjogXCJ2b2lkXCIgfSBdXG4gICAgICAgIH0sXG4gICAgICAgIFwibW9kZWxUeXBlXCI6IHtcbiAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcInR5cGVcIiBdLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgICAgICAgICAgXCJub3RcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJlbnVtXCI6IFsgXCJib29sZWFuXCIsIFwiaW50ZWdlclwiLCBcIm51bWJlclwiLCBcInN0cmluZ1wiLCBcImFycmF5XCIgXVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJwcmltaXRpdmVUeXBlXCI6IHtcbiAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcInR5cGVcIiBdLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgICAgICAgICAgICBcImVudW1cIjogWyBcImJvb2xlYW5cIiwgXCJpbnRlZ2VyXCIsIFwibnVtYmVyXCIsIFwic3RyaW5nXCIgXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJmb3JtYXRcIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICAgICAgICAgIFwiZGVmYXVsdFZhbHVlXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJub3RcIjogeyBcInR5cGVcIjogWyBcImFycmF5XCIsIFwib2JqZWN0XCIsIFwibnVsbFwiIF0gfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCJlbnVtXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgICAgICAgICAgXCJpdGVtc1wiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH0sXG4gICAgICAgICAgICAgICAgICAgIFwibWluSXRlbXNcIjogMSxcbiAgICAgICAgICAgICAgICAgICAgXCJ1bmlxdWVJdGVtc1wiOiB0cnVlXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBcIm1pbmltdW1cIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICAgICAgICAgIFwibWF4aW11bVwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlLFxuICAgICAgICAgICAgXCJkZXBlbmRlbmNpZXNcIjoge1xuICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJvbmVPZlwiOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJpbnRlZ2VyXCIgXSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImZvcm1hdFwiOiB7IFwiZW51bVwiOiBbIFwiaW50MzJcIiwgXCJpbnQ2NFwiIF0gfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJudW1iZXJcIiBdIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IHsgXCJlbnVtXCI6IFsgXCJmbG9hdFwiLCBcImRvdWJsZVwiIF0gfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJzdHJpbmdcIiBdIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZW51bVwiOiBbIFwiYnl0ZVwiLCBcImRhdGVcIiwgXCJkYXRlLXRpbWVcIiBdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwiZW51bVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcInN0cmluZ1wiIF0gfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBcIm1pbmltdW1cIjoge1xuICAgICAgICAgICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJpbnRlZ2VyXCIsIFwibnVtYmVyXCIgXSB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwibWF4aW11bVwiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcImVudW1cIjogWyBcImludGVnZXJcIiwgXCJudW1iZXJcIiBdIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJhcnJheVR5cGVcIjoge1xuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwidHlwZVwiLCBcIml0ZW1zXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJhcnJheVwiIF0gfSxcbiAgICAgICAgICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgICAgICAgICAgXCJpdGVtc1wiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvaXRlbXNPYmplY3RcIiB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHsgXCJ0eXBlXCI6IFwiYm9vbGVhblwiIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwiaXRlbXNPYmplY3RcIjoge1xuICAgICAgICAgICAgXCJvbmVPZlwiOiBbXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3JlZlR5cGVcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcImFsbE9mXCI6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ByaW1pdGl2ZVR5cGVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjoge30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZm9ybWF0XCI6IHt9XG4gICAgICAgICAgICAgICAgICAg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cIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgXCJpdGVtc1wiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH0sXG4gICAgICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHRydWUsXG4gICAgICAgICAgICBcIm1pbkl0ZW1zXCI6IDFcbiAgICAgICAgfSxcbiAgICAgICAgXCJtaW5pbXVtXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfSxcbiAgICAgICAgXCJtYXhpbXVtXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfSxcbiAgICAgICAgXCJpdGVtc1wiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvaXRlbXNPYmplY3RcIiB9LFxuICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHsgXCJ0eXBlXCI6IFwiYm9vbGVhblwiIH1cbiAgICB9LFxuICAgIFwiZGVwZW5kZW5jaWVzXCI6IHtcbiAgICAgICAgXCJmb3JtYXRcIjoge1xuICAgICAgICAgICAgXCJvbmVPZlwiOiBbXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJpbnRlZ2VyXCIgXSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJmb3JtYXRcIjogeyBcImVudW1cIjogWyBcImludDMyXCIsIFwiaW50NjRcIiBdIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJudW1iZXJcIiBdIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBcImZvcm1hdFwiOiB7IFwiZW51bVwiOiBbIFwiZmxvYXRcIiwgXCJkb3VibGVcIiBdIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJzdHJpbmdcIiBdIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBcImZvcm1hdFwiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJlbnVtXCI6IFsgXCJieXRlXCIsIFwiZGF0ZVwiLCBcImRhdGUtdGltZVwiIF1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgfVxuICAgIH0sXG4gICAgXCJkZWZpbml0aW9uc1wiOiB7XG4gICAgICAgIFwiaXRlbXNPYmplY3RcIjoge1xuICAgICAgICAgICAgXCJvbmVPZlwiOiBbXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwiJHJlZlwiIF0sXG4gICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2VcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgXCJhbGxPZlwiOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICB7IFwiJHJlZlwiOiBcIiNcIiB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcInR5cGVcIiBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJmb3JtYXRcIjoge31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgfVxuICAgIH1cbn1cbiIsIm1vZHVsZS5leHBvcnRzPXtcbiAgICBcImlkXCI6IFwiaHR0cDovL3dvcmRuaWsuZ2l0aHViLmlvL3NjaGVtYXMvdjEuMi9pbmZvT2JqZWN0Lmpzb24jXCIsXG4gICAgXCIkc2NoZW1hXCI6IFwiaHR0cDovL2pzb24tc2NoZW1hLm9yZy9kcmFmdC0wNC9zY2hlbWEjXCIsXG4gICAgXCJkZXNjcmlwdGlvblwiOiBcImluZm8gb2JqZWN0IChzZWN0aW9uIDUuMS4zKVwiLFxuICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgIFwicmVxdWlyZWRcIjogWyBcInRpdGxlXCIsIFwiZGVzY3JpcHRpb25cIiBdLFxuICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwidGl0bGVcIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHsgXCJ0eXBlXCI6IFwic3RyaW5nXCIgfSxcbiAgICAgICAgXCJ0ZXJtc09mU2VydmljZVVybFwiOiB7IFwidHlwZVwi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BlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgIFwiaXRlbXNcIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICAgICAgXCJ1bmlxdWVJdGVtc1wiOiB0cnVlXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGlzY3JpbWluYXRvclwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH1cbiAgICB9LFxuICAgIFwiZGVwZW5kZW5jaWVzXCI6IHtcbiAgICAgICAgXCJzdWJUeXBlc1wiOiBbIFwiZGlzY3JpbWluYXRvclwiIF1cbiAgICB9LFxuICAgIFwiZGVmaW5pdGlvbnNcIjoge1xuICAgICAgICBcInByb3BlcnR5T2JqZWN0XCI6IHtcbiAgICAgICAgICAgIFwiYWxsT2ZcIjogW1xuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgXCJub3RcIjogeyBcIiRyZWZcIjogXCIjXCIgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBcIiRyZWZcIjogXCJkYXRhVHlwZUJhc2UuanNvbiNcIlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgfVxuICAgIH1cbn1cblxuIiwibW9kdWxlLmV4cG9ydHM9e1xuICAgIFwiaWRcIjogXCJodHRwOi8vd29yZG5pay5naXRodWIuaW8vc2NoZW1hcy92MS4yL29hdXRoMkdyYW50VHlwZS5qc29uI1wiLFxuICAgIFwiJHNjaGVtYVwiOiBcImh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvZHJhZnQtMDQvc2NoZW1hI1wiLFxuICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgIFwibWluUHJvcGVydGllc1wiOiAxLFxuICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiaW1wbGljaXRcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2ltcGxpY2l0XCIg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biAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJsb2dpbkVuZHBvaW50XCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwidXJsXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJ1cmxcIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiwgXCJmb3JtYXRcIjogXCJ1cmlcIiB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcInRva2VuRW5kcG9pbnRcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICAgICAgICBcInJlcXVpcmVkXCI6IFsgXCJ1cmxcIiBdLFxuICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICBcInVybFwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiLCBcImZvcm1hdFwiOiBcInVyaVwiIH0sXG4gICAgICAgICAgICAgICAgXCJ0b2tlbk5hbWVcIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcInRva2VuUmVxdWVzdEVuZHBvaW50XCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiBbIFwidXJsXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJ1cmxcIjogeyBcInR5cGVcIjogXCJz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R5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICAgICAgICAgIFwibmlja25hbWVcIjoge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgICAgICAgICAgXCJwYXR0ZXJuXCI6IFwiXlthLXpBLVowLTlfXSskXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwiYXV0aG9yaXphdGlvbnNcIjoge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiYXV0aG9yaXphdGlvbk9iamVjdC5qc29uIy9kZWZpbml0aW9ucy9vYXV0aDJTY29wZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwicGFyYW1ldGVyc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICAgICAgICAgIFwiaXRlbXNcIjogeyBcIiRyZWZcIjogXCJwYXJhbWV0ZXJPYmplY3QuanNvbiNcIiB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBcInJlc3BvbnNlTWVzc2FnZXNcIjoge1xuICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgICAgICAgICBcIml0ZW1zXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9yZXNwb25zZU1lc3NhZ2VPYmplY3RcIn1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIFwicHJvZHVjZXNcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbWVUeXBlQXJyYXlcIiB9LFxuICAgICAgICAgICAgICAgIFwiY29uc3VtZXNcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbWVUeXBlQXJyYXlcIiB9LFxuICAgICAgICAgICAgICAgIFwiZGVwcmVjYXRlZFwiOiB7IFwiZW51bVwiOiBbIFwidHJ1ZVwiLCBcImZhbHNlXCIgXSB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICBdLFxuICAgIFwiZGVmaW5pdGlvbnNcIjoge1xuICAgICAgICBcInJlc3BvbnNlTWVzc2FnZU9iamVjdFwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwicmVxdWlyZWRcIjogWyBcImNvZGVcIiwgXCJtZXNzYWdlXCIgXSxcbiAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJjb2RlXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9yZmMyNjE2c2VjdGlvbjEwXCIgfSxcbiAgICAgICAgICAgICAgICBcIm1lc3NhZ2VcIjogeyBcInR5cGVcIjogXCJzdHJpbmdcIiB9LFxuICAgICAgICAgICAgICAgIFwicmVzcG9uc2VNb2RlbFwiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJyZmMyNjE2c2VjdGlvbjEwXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcImludGVnZXJcIixcbiAgICAgICAgICAgIFwibWluaW11bVwiOiAxMDAsXG4gICAgICAgICAgICBcIm1heGltdW1cIjogNjAwLFxuICAgICAgICAgICAgXCJleGNsdXNpdmVNYXhpbXVtXCI6IHRydWVcbiAgICAgICAgfSxc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1wiIH0sXG4gICAgICAgICAgICAgICAgXCJyZXF1aXJlZFwiOiB7IFwidHlwZVwiOiBcImJvb2xlYW5cIiB9LFxuICAgICAgICAgICAgICAgIFwiYWxsb3dNdWx0aXBsZVwiOiB7IFwidHlwZVwiOiBcImJvb2xlYW5cIiB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJ0eXBlIEZpbGUgcmVxdWlyZXMgc3BlY2lhbCBwYXJhbVR5cGUgYW5kIGNvbnN1bWVzXCIsXG4gICAgICAgICAgICBcIm9uZU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcInR5cGVcIjogeyBcIm5vdFwiOiB7IFwiZW51bVwiOiBbIFwiRmlsZVwiIF0gfSB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwidHlwZVwiOiB7IFwiZW51bVwiOiBbIFwiRmlsZVwiIF0gfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwicGFyYW1UeXBlXCI6IHsgXCJlbnVtXCI6IFsgXCJmb3JtXCIgXSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJjb25zdW1lc1wiOiB7IFwiZW51bVwiOiBbIFwibXVsdGlwYXJ0L2Zvcm0tZGF0YVwiIF0gfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICB9XG4gICAgXVxufVxuIiwibW9kdWxlLmV4cG9ydHM9e1xuICAgIFwiaWRcIjogXCJodHRwOi8vd29yZG5pay5naXRodWIuaW8vc2NoZW1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ICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3BhcmFtZXRlcnNMaXN0XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJyZXNwb25zZXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcmVzcG9uc2VzXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJzY2hlbWVzXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtZXNMaXN0XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXByZWNhdGVkXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwic2VjdXJpdHlcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2VjdXJpdHlcIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBcInBhdGhJdGVtXCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCIkcmVmXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcImdldFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9vcGVyYXRpb25cIlxuICAgICAgICB9LFxuICAgICAgICBcInB1dFwiOiB7XG4gICA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aW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJzY2hlbWFcIjoge1xuICAgICAgICAgIFwib25lT2ZcIjogW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYVwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2ZpbGVTY2hlbWFcIlxuICAgICAgICAgICAgfVxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJoZWFkZXJzXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2hlYWRlcnNcIlxuICAgICAgICB9LFxuICAgICAgICBcImV4YW1wbGVzXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2V4YW1wbGVzXCJcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICBcInBhdHRlcm5Qcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJeeC1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdmVuZG9yRXh0ZW5zaW9uXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgXCJoZWFkZXJzXCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvaGVhZGVyXCJcbiAgICAgIH1cbiAgICB9LFxuICAgIFwiaGVhZGVyXCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcInR5cGVcIlxuICAgICAgXSxcbiAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwic3RyaW5nXCIsXG4gICAgICAgICAgICBcIm51bWJlclwiLFxuICAgICAgICAgICAgXCJpbnRlZ2VyXCIsXG4gICAgICAgICAgICBcImJvb2xlYW5cIixcbiAgICAgICAgICAgIFwiYXJyYXlcIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJmb3JtYXRcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiaXRlbXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcHJpbWl0aXZlc0l0ZW1zXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJjb2xsZWN0aW9uRm9ybWF0XCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2NvbGxlY3Rpb25Gb3JtYXRcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlZmF1bHRcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZGVmYXVsdFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4aW11bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9tYXhpbXVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJleGNsdXNpdmVNYXhpbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2V4Y2x1c2l2ZU1heGltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcIm1pbmltdW1cIjoge1xuICAgICAgICAgIFwi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FwiXngtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ZlbmRvckV4dGVuc2lvblwiXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcInJlcXVpcmVkXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIkRldGVybWluZXMgd2hldGhlciBvciBub3QgdGhpcyBwYXJhbWV0ZXIgaXMgcmVxdWlyZWQgb3Igb3B0aW9uYWwuXCIsXG4gICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwiaW5cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZGVzY3JpcHRpb25cIjogXCJEZXRlcm1pbmVzIHRoZSBsb2NhdGlvbiBvZiB0aGUgcGFyYW1ldGVyLlwiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcImhlYWRlclwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiQSBicmllZiBkZXNjcmlwdGlvbiBvZiB0aGUgcGFyYW1ldGVyLiBUaGlzIGNvdWxkIGNvbnRhaW4gZXhhbXBsZXMgb2YgdXNlLiAgR2l0SHViIEZsYXZvcmVkIE1hcmtkb3duIGlzIGFsbG93ZWQuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJuYW1lXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiVGhlIG5hbWUgb2YgdGhlIHBhcmFtZXRlci5cIlxuICAgICAgICB9LFxuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcInN0cmluZ1wiLFxuICAgICAgICAgICAgXCJudW1iZXJcIixcbiAgICAgICAgICAgIFwiYm9vbGVhblwiLFxuICAgICAgICAgICAgXCJpbnRlZ2VyXCIsXG4gICAgICAgICAgICBcImFycmF5XCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZm9ybWF0XCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ByaW1pdGl2ZXNJdGVtc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiY29sbGVjdGlvbkZvcm1hdFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9jb2xsZWN0aW9uRm9ybWF0XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZWZhdWx0XCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2RlZmF1bHRcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1heGltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWF4aW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXhjbHVzaXZlTWF4aW11bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9leGNsdXNpdmVNYXhpbXVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtaW5pbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbmltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcImV4Y2x1c2l2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gICAgICBcImRlc2NyaXB0aW9uXCI6IFwiVGhlIG5hbWUgb2YgdGhlIHBhcmFtZXRlci5cIlxuICAgICAgICB9LFxuICAgICAgICBcImFsbG93RW1wdHlWYWx1ZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiLFxuICAgICAgICAgIFwiZGVmYXVsdFwiOiBmYWxzZSxcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiYWxsb3dzIHNlbmRpbmcgYSBwYXJhbWV0ZXIgYnkgbmFtZSBvbmx5IG9yIHdpdGggYW4gZW1wdHkgdmFsdWUuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ0eXBlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwibnVtYmVyXCIsXG4gICAgICAgICAgICBcImJvb2xlYW5cIixcbiAgICAgICAgICAgIFwiaW50ZWdlclwiLFxuICAgICAgICAgICAgXCJhcnJheVwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImZvcm1hdFwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9wcmltaXRpdmVzSXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcImNvbGxlY3Rpb25Gb3JtYXRcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvY29sbGVjdGlvbkZvcm1hdFdpdGhNdWx0aVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVmYXVsdFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9kZWZhdWx0XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhpbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21heGltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcImV4Y2x1c2l2ZU1heGltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZXhjbHVzaXZlTWF4aW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWluaW11bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9taW5pbXVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJleGNsdXNpdmVNaW5pbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2V4Y2x1c2l2ZU1pbmltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcIm1heExlbmd0aFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9tYXhMZW5ndGhcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1pbkxlbmd0aFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9taW5MZW5ndGhcIlxuICAgICAgICB9LFxuICAgICAgICBcInBhdHRlcm5cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcGF0dGVyblwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4SXRlbXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWF4SXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1pbkl0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbkl0ZW1zXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ1bmlxdWVJdGVtc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwi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gIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXNjcmlwdGlvblwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIkEgYnJpZWYgZGVzY3JpcHRpb24gb2YgdGhlIHBhcmFtZXRlci4gVGhpcyBjb3VsZCBjb250YWluIGV4YW1wbGVzIG9mIHVzZS4gIEdpdEh1YiBGbGF2b3JlZCBNYXJrZG93biBpcyBhbGxvd2VkLlwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibmFtZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIlRoZSBuYW1lIG9mIHRoZSBwYXJhbWV0ZXIuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJhbGxvd0VtcHR5VmFsdWVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcImJvb2xlYW5cIixcbiAgICAgICAgICBcImRlZmF1bHRcIjogZmFsc2UsXG4gICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcImFsbG93cyBzZW5kaW5nIGEgcGFyYW1ldGVyIGJ5IG5hbWUgb25seSBvciB3aXRoIGFuIGVtcHR5IHZhbHVlLlwiXG4gICAgICAgIH0sXG4gICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwic3RyaW5nXCIsXG4gICAgICAgICAgICBcIm51bWJlclwiLFxuICAgICAgICAgICAgXCJib29sZWFuXCIsXG4gICAgICAgICAgICBcImludGVnZXJcIixcbiAgICAgICAgICAgIFwiYXJyYXlcIixcbiAgICAgICAgICAgIFwiZmlsZVwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImZvcm1hdFwiOiB7XG4gICAgICAgICAgXCJ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xuICAgICAgICB9LFxuICAgICAgICBcInBhdHRlcm5cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcGF0dGVyblwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4SXRlbXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWF4SXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1pbkl0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbkl0ZW1zXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ1bmlxdWVJdGVtc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy91bmlxdWVJdGVtc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZW51bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9lbnVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtdWx0aXBsZU9mXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL211bHRpcGxlT2ZcIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBcInBhdGhQYXJhbWV0ZXJTdWJTY2hlbWFcIjoge1xuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJyZXF1aXJlZFwiOiBbXG4gICAgICAgIFwicmVxdWlyZWRcIlxuICAgICAgXSxcbiAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwicmVxdWlyZWRcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcImJvb2xlYW5cIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgIF0sXG4gICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIkRldGVybWluZXMgd2hldGhlciBvciBub3QgdGhpcyBwYXJhbWV0ZXIgaXMgcmVxdWlyZWQgb3Igb3B0aW9uYWwuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJpblwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJkZXNjcmlwdGlvblwiOiBcIkRldGVybWluZXMgdGhlIGxvY2F0aW9uIG9mIHRoZSBwYXJhbWV0ZXIuXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwicGF0aFwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiQSBicmllZiBkZXNjcmlwdGlvbiBvZiB0aGUgcGFyYW1ldGVyLiBUaGlzIGNvdWxkIGNvbnRhaW4gZXhhbXBsZXMgb2YgdXNlLiAgR2l0SHViIEZsYXZvcmVkIE1hcmtkb3duIGlzIGFsbG93ZWQuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJuYW1lXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImRlc2NyaXB0aW9uXCI6IFwiVGhlIG5hbWUgb2YgdGhlIHBhcmFtZXRlci5cIlxuICAgICAgICB9LFxuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcInN0cmluZ1wiLFxuICAgICAgICAgICAgXCJudW1iZXJcIixcbiAgICAgICAgICAgIFwiYm9vbGVhblwiLFxuICAgICAgICAgICAgXCJpbnRlZ2VyXCIsXG4gICAgICAgICAgICBcImFycmF5XCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZm9ybWF0XCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcIml0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ByaW1pdGl2ZXNJdGVtc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiY29sbGVjdGlvbkZvcm1hdFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9jb2xsZWN0aW9uRm9ybWF0XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZWZhdWx0XCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2RlZmF1bHRcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1heGltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWF4aW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZXhjbHVzaXZlTWF4aW11bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9leGNsdXNpdmVNYXhpbXVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtaW5pbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbmltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcImV4Y2x1c2l2ZU1pbmltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZXhjbHVzaXZlTWluaW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4TGVuZ3RoXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21heExlbmd0aFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWluTGVuZ3RoXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21pbkxlbmd0aFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwicGF0dGVyblwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9wYXR0ZXJuXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhJdGVtc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9tYXhJdGVtc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWluSXRlbXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWluSXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3VuaXF1ZUl0ZW1zXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJlbnVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2VudW1cIlxuICAgICAgICB9LFxuICAgICAgICBcIm11bHRpcGxlT2ZcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbXVsdGlwbGVPZlwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwibm9uQm9keVBhcmFtZXRlclwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcIm5hbWVcIixcbiAgICAgICAgXCJpblwiLFxuICAgICAgICBcInR5cGVcIlxuICAgICAgXSxcbiAgICAgIFwib25lT2ZcIjogW1xuICAgICAgICB7XG4gICAgICAgICA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6IHtcbiAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zY2hlbWFcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiXG4gICAgICAgICAgICB9XG4gICAgICAgICAgXSxcbiAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJ0eXBlXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA0L3NjaGVtYSMvcHJvcGVydGllcy90eXBlXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgXCJhbnlPZlwiOiBbXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2NoZW1hXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIFwidHlwZVwiOiBcImFycmF5XCIsXG4gICAgICAgICAgICAgIFwibWluSXRlbXNcIjogMSxcbiAgICAgICAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zY2hlbWFcIlxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgXSxcbiAgICAgICAgICBcImRlZmF1bHRcIjoge31cbiAgICAgICAgfSxcbiAgICAgICAgXCJhbGxPZlwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICBcIm1pbkl0ZW1zXCI6IDEsXG4gICAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYVwiXG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjoge1xuICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zY2hlbWFcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAgXCJkZWZhdWx0XCI6IHt9XG4gICAgICAgIH0sXG4gICAgICAgIFwiZGlzY3JpbWluYXRvclwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJyZWFkT25seVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiLFxuICAgICAgICAgIFwiZGVmYXVsdFwiOiBmYWxzZVxuICAgICAgICB9LFxuICAgICAgICBcInhtbFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy94bWxcIlxuICAgICAgICB9LFxuICAgICAgICBcImV4dGVybmFsRG9jc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9leHRlcm5hbERvY3NcIlxuICAgICAgICB9LFxuICAgICAgICBcImV4YW1wbGVcIjoge31cbiAgICAgIH0sXG4gICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlXG4gICAgfSxcbiAgICBcImZpbGVTY2hlbWFcIjoge1xuICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICBcImRlc2NyaXB0aW9uXCI6IFwiQSBkZXRlcm1pbmlzdGljIHZlcnNpb24gb2YgYSBKU09OIFNjaGVtYSBvYmplY3QuXCIsXG4gICAgICBcInBhdHRlcm5Qcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJeeC1cIjoge1xuICAgICAgICAgIFwiJHJl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uICAgICAgICAgIFwidHlwZVwiOiBcImJvb2xlYW5cIixcbiAgICAgICAgICBcImRlZmF1bHRcIjogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgXCJleHRlcm5hbERvY3NcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZXh0ZXJuYWxEb2NzXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJleGFtcGxlXCI6IHt9XG4gICAgICB9LFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZVxuICAgIH0sXG4gICAgXCJwcmltaXRpdmVzSXRlbXNcIjoge1xuICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlLFxuICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJ0eXBlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwibnVtYmVyXCIsXG4gICAgICAgICAgICBcImludGVnZXJcIixcbiAgICAgICAgICAgIFwiYm9vbGVhblwiLFxuICAgICAgICAgICAgXCJhcnJheVwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImZvcm1hdFwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJpdGVtc1wiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9wcmltaXRpdmVzSXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcImNvbGxlY3Rpb25Gb3JtYXRcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvY29sbGVjdGlvbkZvcm1hdFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVmYXVsdFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9kZWZhdWx0XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtYXhpbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL21heGltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcImV4Y2x1c2l2ZU1heGltdW1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZXhjbHVzaXZlTWF4aW11bVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWluaW11bVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9taW5pbXVtXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJleGNsdXNpdmVNaW5pbXVtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL2V4Y2x1c2l2ZU1pbmltdW1cIlxuICAgICAgICB9LFxuICAgICAgICBcIm1heExlbmd0aFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9tYXhMZW5ndGhcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1pbkxlbmd0aFwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9taW5MZW5ndGhcIlxuICAgICAgICB9LFxuICAgICAgICBcInBhdHRlcm5cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcGF0dGVyblwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4SXRlbXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvbWF4SXRlbXNcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1pbkl0ZW1zXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2R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AgIH0sXG4gICAgXCJ4bWxcIjoge1xuICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IGZhbHNlLFxuICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJuYW1lXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9LFxuICAgICAgICBcIm5hbWVzcGFjZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJwcmVmaXhcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiYXR0cmlidXRlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJib29sZWFuXCIsXG4gICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwid3JhcHBlZFwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiLFxuICAgICAgICAgIFwiZGVmYXVsdFwiOiBmYWxzZVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwYXR0ZXJuUHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiXngtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ZlbmRvckV4dGVuc2lvblwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwidGFnXCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcIm5hbWVcIlxuICAgICAgXSxcbiAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwibmFtZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXNjcmlwdGlvblwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJleHRlcm5hbERvY3NcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvZXh0ZXJuYWxEb2NzXCJcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBcInNlY3VyaXR5RGVmaW5pdGlvbnNcIjoge1xuICAgICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgICBcImFkZGl0aW9uYWxQcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJvbmVPZlwiOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9iYXNpY0F1dGhlbnRpY2F0aW9uU2VjdXJpdHlcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9hcGlLZXlTZWN1cml0eVwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL29hdXRoMkltcGxpY2l0U2VjdXJpdHlcIlxuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9vYXV0aDJQYXNzd29yZFNlY3VyaXR5XCJcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvb2F1dGgyQXBwbGljYXRpb25TZWN1cml0eVwiXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL29hdXRoMkFjY2Vzc0NvZGVTZWN1cml0eVwiXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9XG4gICAgfSxcbiAgICBcImJhc2ljQXV0aGVudGljYXRpb25TZWN1cml0eVwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICBcInJlcXVpcmVkXCI6IFtcbiAgICAgICAgXCJ0eXBlXCJcbiAgICAgIF0sXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcImJhc2ljXCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVzY3JpcHRpb25cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBcInBhdHRlcm5Qcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJeeC1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdmVuZG9yRXh0ZW5zaW9uXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgXCJhcGlLZXlTZWN1cml0eVwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICBcInJlcXVpcmVkXCI6IFtcbiAgICAgICAgXCJ0eXBlXCIsXG4gICAgICAgIFwibmFtZVwiLFxuICAgICAgICBcImluXCJcbiAgICAgIF0sXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcImFwaUtleVwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcIm5hbWVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiaW5cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcImhlYWRlclwiLFxuICAgICAgICAgICAgXCJxdWVyeVwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwYXR0ZXJuUHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiXngtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ZlbmRvckV4dGVuc2lvblwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwib2F1dGgySW1wbGljaXRTZWN1cml0eVwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICBcInJlcXVpcmVkXCI6IFtcbiAgICAgICAgXCJ0eXBlXCIsXG4gICAgICAgIFwiZmxvd1wiLFxuICAgICAgICBcImF1dGhvcml6YXRpb25VcmxcIlxuICAgICAgXSxcbiAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwib2F1dGgyXCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZmxvd1wiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwiaW1wbGljaXRcIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJzY29wZXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvb2F1dGgyU2NvcGVzXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJhdXRob3JpemF0aW9uVXJsXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImZvcm1hdFwiOiBcInVyaVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVzY3JpcHRpb25cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBcInBhdHRlcm5Qcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJeeC1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdmVuZG9yRXh0ZW5zaW9uXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgXCJvYXV0aDJQYXNzd29yZFNlY3VyaXR5XCI6IHtcbiAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiBmYWxzZSxcbiAgICAgIFwicmVxdWlyZWRcIjogW1xuICAgICAgICBcInR5cGVcIixcbiAgICAgICAgXCJmbG93XCIsXG4gICAgICAgIFwidG9rZW5VcmxcIlxuICAgICAgXSxcbiAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwib2F1dGgyXCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwiZmxvd1wiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJlbnVtXCI6IFtcbiAgICAgICAgICAgIFwicGFzc3dvcmRcIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJzY29wZXNcIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvb2F1dGgyU2NvcGVzXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ0b2tlblVybFwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJmb3JtYXRcIjogXCJ1cmlcIlxuICAgICAgICB9LFxuICAgICAgICBcImRlc2NyaXB0aW9uXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIlxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgXCJwYXR0ZXJuUHJvcGVydGllc1wiOiB7XG4gICAgICAgIFwiXngtXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3ZlbmRvckV4dGVuc2lvblwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIFwib2F1dGgyQXBwbGljYXRpb25TZWN1cml0eVwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICBcInJlcXVpcmVkXCI6IFtcbiAgICAgICAgXCJ0eXBlXCIsXG4gICAgICAgIFwiZmxvd1wiLFxuICAgICAgICBcInRva2VuVXJsXCJcbiAgICAgIF0sXG4gICAgICBcInByb3BlcnRpZXNcIjoge1xuICAgICAgICBcInR5cGVcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcIm9hdXRoMlwiXG4gICAgICAgICAgXVxuICAgICAgICB9LFxuICAgICAgICBcImZsb3dcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZW51bVwiOiBbXG4gICAgICAgICAgICBcImFwcGxpY2F0aW9uXCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwic2NvcGVzXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL29hdXRoMlNjb3Blc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwidG9rZW5VcmxcIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgIFwiZm9ybWF0XCI6IFwidXJpXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZXNjcmlwdGlvblwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFwicGF0dGVyblByb3BlcnRpZXNcIjoge1xuICAgICAgICBcIl54LVwiOiB7XG4gICAgICAgICAgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy92ZW5kb3JFeHRlbnNpb25cIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBcIm9hdXRoMkFjY2Vzc0NvZGVTZWN1cml0eVwiOiB7XG4gICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogZmFsc2UsXG4gICAgICBcInJlcXVpcmVkXCI6IFtcbiAgICAgICAgXCJ0eXBlXCIsXG4gICAgICAgIFwiZmxvd1wiLFxuICAgICAgICBcImF1dGhvcml6YXRpb25VcmxcIixcbiAgICAgICAgXCJ0b2tlblVybFwiXG4gICAgICBdLFxuICAgICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJ0eXBlXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJvYXV0aDJcIlxuICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJmbG93XCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImVudW1cIjogW1xuICAgICAgICAgICAgXCJhY2Nlc3NDb2RlXCJcbiAgICAgICAgICBdXG4gICAgICAgIH0sXG4gICAgICAgIFwic2NvcGVzXCI6IHtcbiAgICAgICAgICBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL29hdXRoMlNjb3Blc1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiYXV0aG9yaXphdGlvblVybFwiOiB7XG4gICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgXCJmb3JtYXRcIjogXCJ1cmlcIlxuICAgICAgICB9LFxuICAgICAgICBcInRva2VuVXJsXCI6IHtcbiAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICBcImZvcm1hdFwiOiBcInVyaVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVzY3JpcHRpb25cIjoge1xuICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBcInBhdHRlcm5Qcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJeeC1cIjoge1xuICAgICAgICAgIFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvdmVuZG9yRXh0ZW5zaW9uXCJcbiAgICAgICAgfVxuICAgICAgfV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cnJheVwiLCBcImJvb2xlYW5cIiwgXCJpbnRlZ2VyXCIsIFwibnVsbFwiLCBcIm51bWJlclwiLCBcIm9iamVjdFwiLCBcInN0cmluZ1wiIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJzdHJpbmdBcnJheVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgXCJpdGVtc1wiOiB7IFwidHlwZVwiOiBcInN0cmluZ1wiIH0sXG4gICAgICAgICAgICBcIm1pbkl0ZW1zXCI6IDEsXG4gICAgICAgICAgICBcInVuaXF1ZUl0ZW1zXCI6IHRydWVcbiAgICAgICAgfVxuICAgIH0sXG4gICAgXCJ0eXBlXCI6IFwib2JqZWN0XCIsXG4gICAgXCJwcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgXCJpZFwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJzdHJpbmdcIixcbiAgICAgICAgICAgIFwiZm9ybWF0XCI6IFwidXJpXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCIkc2NoZW1hXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiLFxuICAgICAgICAgICAgXCJmb3JtYXRcIjogXCJ1cmlcIlxuICAgICAgICB9LFxuICAgICAgICBcInRpdGxlXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcInN0cmluZ1wiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVzY3JpcHRpb25cIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJkZWZhdWx0XCI6IHt9LFxuICAgICAgICBcIm11bHRpcGxlT2ZcIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwibnVtYmVyXCIsXG4gICAgICAgICAgICBcIm1pbmltdW1cIjogMCxcbiAgICAgICAgICAgIFwiZXhjbHVzaXZlTWluaW11bVwiOiB0cnVlXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4aW11bVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJudW1iZXJcIlxuICAgICAgICB9LFxuICAgICAgICBcImV4Y2x1c2l2ZU1heGltdW1cIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiLFxuICAgICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwibWluaW11bVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJudW1iZXJcIlxuICAgICAgICB9LFxuICAgICAgICBcImV4Y2x1c2l2ZU1pbmltdW1cIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYm9vbGVhblwiLFxuICAgICAgICAgICAgXCJkZWZhdWx0XCI6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIFwibWF4TGVuZ3RoXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJcIiB9LFxuICAgICAgICBcIm1pbkxlbmd0aFwiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyRGVmYXVsdDBcIiB9LFxuICAgICAgICBcInBhdHRlcm5cIjoge1xuICAgICAgICAgICAgXCJ0eXBlXCI6IFwic3RyaW5nXCIsXG4gICAgICAgICAgICBcImZvcm1hdFwiOiBcInJlZ2V4XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJhZGRpdGlvbmFsSXRlbXNcIjoge1xuICAgICAgICAgICAgXCJhbnlPZlwiOiBbXG4gICAgICAgICAgICAgICAgeyBcInR5cGVcIjogXCJib29sZWFuXCIgfSxcbiAgICAgICAgICAgICAgICB7IFwiJHJlZlwiOiBcIiNcIiB9XG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgXCJkZWZhdWx0XCI6IHt9XG4gICAgICAgIH0sXG4gICAgICAgIFwiaXRlbXNcIjoge1xuICAgICAg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wiZGVmYXVsdFwiOiB7fVxuICAgICAgICB9LFxuICAgICAgICBcImRlZmluaXRpb25zXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7IFwiJHJlZlwiOiBcIiNcIiB9LFxuICAgICAgICAgICAgXCJkZWZhdWx0XCI6IHt9XG4gICAgICAgIH0sXG4gICAgICAgIFwicHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJvYmplY3RcIixcbiAgICAgICAgICAgIFwiYWRkaXRpb25hbFByb3BlcnRpZXNcIjogeyBcIiRyZWZcIjogXCIjXCIgfSxcbiAgICAgICAgICAgIFwiZGVmYXVsdFwiOiB7fVxuICAgICAgICB9LFxuICAgICAgICBcInBhdHRlcm5Qcm9wZXJ0aWVzXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7IFwiJHJlZlwiOiBcIiNcIiB9LFxuICAgICAgICAgICAgXCJkZWZhdWx0XCI6IHt9XG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVwZW5kZW5jaWVzXCI6IHtcbiAgICAgICAgICAgIFwidHlwZVwiOiBcIm9iamVjdFwiLFxuICAgICAgICAgICAgXCJhZGRpdGlvbmFsUHJvcGVydGllc1wiOiB7XG4gICAgICAgICAgICAgICAgXCJhbnlPZlwiOiBbXG4gICAgICAgICAgICAgICAgICAgIHsgXCIkcmVmXCI6IFwiI1wiIH0sXG4gICAgICAgICAgICAgICAgICAgIHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zdHJpbmdBcnJheVwiIH1cbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwiZW51bVwiOiB7XG4gICAgICAgICAgICBcInR5cGVcIjogXCJhcnJheVwiLFxuICAgICAgICAgICAgXCJtaW5JdGVtc1wiOiAxLFxuICAgICAgICAgICAgXCJ1bmlxdWVJdGVtc1wiOiB0cnVlXG4gICAgICAgIH0sXG4gICAgICAgIFwidHlwZVwiOiB7XG4gICAgICAgICAgICBcImFueU9mXCI6IFtcbiAgICAgICAgICAgICAgICB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2ltcGxlVHlwZXNcIiB9LFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgXCJ0eXBlXCI6IFwiYXJyYXlcIixcbiAgICAgICAgICAgICAgICAgICAgXCJpdGVtc1wiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2ltcGxlVHlwZXNcIiB9LFxuICAgICAgICAgICAgICAgICAgICBcIm1pbkl0ZW1zXCI6IDEsXG4gICAgICAgICAgICAgICAgICAgIFwidW5pcXVlSXRlbXNcIjogdHJ1ZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgfSxcbiAgICAgICAgXCJhbGxPZlwiOiB7IFwiJHJlZlwiOiBcIiMvZGVmaW5pdGlvbnMvc2NoZW1hQXJyYXlcIiB9LFxuICAgICAgICBcImFueU9mXCI6IHsgXCIkcmVmXCI6IFwiIy9kZWZpbml0aW9ucy9zY2hlbWFBcnJheVwiIH0sXG4gICAgICAgIFwib25lT2ZcIjogeyBcIiRyZWZcIjogXCIjL2RlZmluaXRpb25zL3NjaGVtYUFycmF5XCIgfSxcbiAgICAgICAgXCJub3RcIjogeyBcIiRyZWZcIjogXCIjXCIgfVxuICAgIH0sXG4gICAgXCJkZXBlbmRlbmNpZXNcIjoge1xuICAgICAgICBcImV4Y2x1c2l2ZU1heGltdW1cIjogWyBcIm1heGltdW1cIiBdLFxuICAgICAgICBcImV4Y2x1c2l2ZU1pbmltdW1cIjogWyBcIm1pbmltdW1cIiBdXG4gICAgfSxcbiAgICBcImRlZmF1bHRcIjoge31cbn1cbiJdfQ== diff --git a/docs/Middleware.md b/docs/Middleware.md index 3dd35f4dd6..6a45352d93 100644 --- a/docs/Middleware.md +++ b/docs/Middleware.md @@ -233,6 +233,9 @@ object keys are the handler name _({ControllerName}_{HandlerFunctionName}) and t found. When `true`, we will ignore the missing handler and send the request downstream. * **options.useStubs:** `[boolean]` Whether or not stub handlers should be used for routes with no defined controller or the controller could not be found. +* **options.injected:** `[object]` If the require() result of loading a module is a function itself, it is assumed +this function is a generator/construction helper and the options.injected property will be passed. This allows for +application level IoC to facilitate unit testing. **Returns** diff --git a/docs/QuickStart.md b/docs/QuickStart.md index 934561e8b2..72b7aa49f0 100644 --- a/docs/QuickStart.md +++ b/docs/QuickStart.md @@ -386,7 +386,11 @@ var serverPort = 3000; // swaggerRouter configuration var options = { controllers: './controllers', - useStubs: process.env.NODE_ENV === 'development' ? true : false // Conditionally turn on stubs (mock mode) + useStubs: process.env.NODE_ENV === 'development' ? true : false, // Conditionally turn on stubs (mock mode) + injected: { + // Optional - Set any values here that get passed + // to controllers that return a function from require(). + } }; // The Swagger document (require it, build it programmatically, fetch it from a URL, ...) diff --git a/examples/2.0/index.js b/examples/2.0/index.js index b4d6c88faa..b1f8436fc5 100644 --- a/examples/2.0/index.js +++ b/examples/2.0/index.js @@ -9,7 +9,11 @@ var serverPort = 3000; // swaggerRouter configuration var options = { controllers: './controllers', - useStubs: process.env.NODE_ENV === 'development' ? true : false // Conditionally turn on stubs (mock mode) + useStubs: process.env.NODE_ENV === 'development' ? true : false, // Conditionally turn on stubs (mock mode) + injected: { + // Optional - Set any values here that get passed + // to controllers that return a function from require(). + } }; // The Swagger document (require it, build it programmatically, fetch it from a URL, ...) diff --git a/middleware/swagger-router.js b/middleware/swagger-router.js index 5429760ab8..fa9ebbdc9a 100644 --- a/middleware/swagger-router.js +++ b/middleware/swagger-router.js @@ -58,7 +58,7 @@ var getHandlerName = function (req) { return handlerName; }; -var handlerCacheFromDir = function (dirOrDirs) { +var handlerCacheFromDir = function (dirOrDirs, injected) { var handlerCache = {}; var jsFileRegex = /\.(coffee|js)$/; var dirs = []; @@ -79,6 +79,14 @@ var handlerCacheFromDir = function (dirOrDirs) { if (file.match(jsFileRegex)) { controller = require(path.resolve(path.join(dir, controllerName))); + // If controller require()'s as a function, then execute it. + // and pass in our options.dependencies + if (_.isFunction(controller)) { + debug(' %s - resolved as function, executing to obtain instance.:', + path.resolve(path.join(dir, file))); + controller = controller(injected); + } + debug(' %s%s:', path.resolve(path.join(dir, file)), (_.isPlainObject(controller) ? '' : ' (not an object, skipped)')); @@ -374,7 +382,7 @@ exports = module.exports = function (options) { handlerCache = options.controllers; } else { // Create the handler cache from the modules in the controllers directory - handlerCache = handlerCacheFromDir(options.controllers); + handlerCache = handlerCacheFromDir(options.controllers, options.injected); } return function swaggerRouter (req, res, next) { diff --git a/test/1.2/test-middleware-swagger-router.js b/test/1.2/test-middleware-swagger-router.js index 98b58eaf35..13dd1d51e5 100644 --- a/test/1.2/test-middleware-swagger-router.js +++ b/test/1.2/test-middleware-swagger-router.js @@ -42,7 +42,8 @@ var petJson = _.cloneDeep(require('../../samples/1.2/pet.json')); var storeJson = _.cloneDeep(require('../../samples/1.2/store.json')); var userJson = _.cloneDeep(require('../../samples/1.2/user.json')); var optionsWithControllersDir = { - controllers: path.join(__dirname, '..', 'controllers') + controllers: path.join(__dirname, '..', 'controllers'), + injected: { value: true } }; var samplePet = { category: { @@ -109,7 +110,8 @@ describe('Swagger Router Middleware v1.2', function () { controllers: [ path.join(__dirname, '..', 'controllers'), path.join(__dirname, '..', 'controllers2') - ] + ], + injected: { value: true } } }, function (app) { request(app) @@ -120,7 +122,7 @@ describe('Swagger Router Middleware v1.2', function () { }); it('should do routing when options.controllers is a valid controller map', function (done) { - var controller = require('../controllers/Users'); + var controller = require('../controllers/Users')({ value: true }); helpers.createServer([rlJson, [petJson, storeJson, userJson]], { swaggerRouterOptions: { diff --git a/test/1.2/test-middleware-swagger-ui.js b/test/1.2/test-middleware-swagger-ui.js index c3fee482d5..2863860749 100644 --- a/test/1.2/test-middleware-swagger-ui.js +++ b/test/1.2/test-middleware-swagger-ui.js @@ -53,7 +53,7 @@ describe('Swagger UI Middleware v1.2', function () { }, {}); async.map(Object.keys(pathMap), function (path, callback) { - helpers.createServer([rlJson, [petJson, storeJson, userJson]], {}, function (app) { + helpers.createServer([rlJson, [petJson, storeJson, userJson]], { injected: { value: true }}, function (app) { request(app) .get(path) .expect(200) @@ -97,7 +97,7 @@ describe('Swagger UI Middleware v1.2', function () { }); it('should serve Swagger UI at /docs by default', function (done) { - helpers.createServer([rlJson, [petJson, storeJson, userJson]], {}, function (app) { + helpers.createServer([rlJson, [petJson, storeJson, userJson]], { injected: { value: true }}, function (app) { request(app) .get('/docs/') // Trailing slash to avoid a 303 .expect(200) diff --git a/test/2.0/test-middleware-swagger-router.js b/test/2.0/test-middleware-swagger-router.js index c5de066597..d13e072d08 100644 --- a/test/2.0/test-middleware-swagger-router.js +++ b/test/2.0/test-middleware-swagger-router.js @@ -40,7 +40,8 @@ var helpers = require('../helpers'); var petStoreJson = _.cloneDeep(require('../../samples/2.0/petstore.json')); var optionsWithControllersDir = { - controllers: path.join(__dirname, '..', 'controllers') + controllers: path.join(__dirname, '..', 'controllers'), + injected: { value: true } }; var samplePet = { category: { @@ -108,7 +109,8 @@ describe('Swagger Router Middleware v2.0', function () { controllers: [ path.join(__dirname, '..', 'controllers'), path.join(__dirname, '..', 'controllers2') - ] + ], + injected: { value: true } } }, function (app) { request(app) @@ -120,7 +122,7 @@ describe('Swagger Router Middleware v2.0', function () { it('should do routing when options.controllers is a valid controller map', function (done) { var cPetStoreJson = _.cloneDeep(petStoreJson); - var controller = require('../controllers/Users'); + var controller = require('../controllers/Users')({ value: true }); // Use Users controller cPetStoreJson.paths['/pets/{id}'].get['x-swagger-router-controller'] = 'Users'; @@ -142,7 +144,7 @@ describe('Swagger Router Middleware v2.0', function () { it('should do routing when only operationId is given', function (done) { var cPetStoreJson = _.cloneDeep(petStoreJson); - var controller = require('../controllers/Users'); + var controller = require('../controllers/Users')({ value: true }); // Use Users controller delete cPetStoreJson.paths['/pets/{id}'].get['x-swagger-router-controller']; diff --git a/test/controllers/Users.js b/test/controllers/Users.js index 9b58e05197..b9a994edf4 100644 --- a/test/controllers/Users.js +++ b/test/controllers/Users.js @@ -24,8 +24,27 @@ 'use strict'; -var response = module.exports.response = 'controllers/Users swagger-router OK'; +var response = 'controllers/Users swagger-router OK'; -module.exports.getById = module.exports._getById = function getById (req, res) { +var getById = function getById (req, res) { res.end(response); }; + +module.exports = function generator(injected) { + if (!injected) { + throw new Error('injected should be set.'); + } else if (!injected.value) { + throw new Error('injected should have a sub-value set'); + } + + return { + getById, + _getById: getById, + getInjected(req, res) { + res.end(injected.value); + }, + response + }; +}; + +module.exports.response = response;