rsnext/packages/next/compiled/@vercel/nft/index.js

12 lines
283 KiB
JavaScript
Raw Normal View History

(()=>{var __webpack_modules__={234:(e,t,r)=>{"use strict";e.exports=t;t.mockS3Http=r(6476).get_mockS3Http();t.mockS3Http("on");const a=t.mockS3Http("get");const o=r(7147);const s=r(1017);const u=r(6444);const c=r(7081);c.disableProgress();const d=r(251);const f=r(2361).EventEmitter;const p=r(3837).inherits;const h=["clean","install","reinstall","build","rebuild","package","testpackage","publish","unpublish","info","testbinary","reveal","configure"];const v={};c.heading="node-pre-gyp";if(a){c.warn(`mocking s3 to ${process.env.node_pre_gyp_mock_s3}`)}Object.defineProperty(t,"find",{get:function(){return r(846).find},enumerable:true});function Run({package_json_path:e="./package.json",argv:t}){this.package_json_path=e;this.commands={};const r=this;h.forEach((e=>{r.commands[e]=function(t,a){c.verbose("command",e,t);return require("./"+e)(r,t,a)}}));this.parseArgv(t);this.binaryHostSet=false}p(Run,f);t.Run=Run;const _=Run.prototype;_.package=r(7399);_.configDefs={help:Boolean,arch:String,debug:Boolean,directory:String,proxy:String,loglevel:String};_.shorthands={release:"--no-debug",C:"--directory",debug:"--debug",j:"--jobs",silent:"--loglevel=silent",silly:"--loglevel=silly",verbose:"--loglevel=verbose"};_.aliases=v;_.parseArgv=function parseOpts(e){this.opts=u(this.configDefs,this.shorthands,e);this.argv=this.opts.argv.remain.slice();const t=this.todo=[];e=this.argv.map((e=>{if(e in this.aliases){e=this.aliases[e]}return e}));e.slice().forEach((r=>{if(r in this.commands){const a=e.splice(0,e.indexOf(r));e.shift();if(t.length>0){t[t.length-1].args=a}t.push({name:r,args:[]})}}));if(t.length>0){t[t.length-1].args=e.splice(0)}let r=this.package_json_path;if(this.opts.directory){r=s.join(this.opts.directory,r)}this.package_json=JSON.parse(o.readFileSync(r));this.todo=d.expand_commands(this.package_json,this.opts,t);const a="npm_config_";Object.keys(process.env).forEach((e=>{if(e.indexOf(a)!==0)return;const t=process.env[e];if(e===a+"loglevel"){c.level=t}else{e=e.substring(a.length);if(e==="argv"){if(this.opts.argv&&this.opts.argv.remain&&this.opts.argv.remain.length){}else{this.opts[e]=t}}else{this.opts[e]=t}}}));if(this.opts.loglevel){c.level=this.opts.loglevel}c.resume()};_.setBinaryHostProperty=function(e){if(this.binaryHostSet){return this.package_json.binary.host}const t=this.package_json;if(!t||!t.binary||t.binary.host){return""}if(!t.binary.staging_host||!t.binary.production_host){return""}let r="production_host";if(e==="publish"){r="staging_host"}const a=process.env.node_pre_gyp_s3_host;if(a==="staging"||a==="production"){r=`${a}_host`}else if(this.opts["s3_host"]==="staging"||this.opts["s3_host"]==="production"){r=`${this.opts["s3_host"]}_host`}else if(this.opts["s3_host"]||a){throw new Error(`invalid s3_host ${this.opts["s3_host"]||a}`)}t.binary.host=t.binary[r];this.binaryHostSet=true;return t.binary.host};_.usage=function usage(){const e=[""," Usage: node-pre-gyp <command> [options]",""," where <command> is one of:",h.map((e=>" - "+e+" - "+require("./"+e).usage)).join("\n"),"","node-pre-gyp@"+this.version+" "+s.resolve(__dirname,".."),"node@"+process.versions.node].join("\n");return e};Object.defineProperty(_,"version",{get:function(){return this.package.version},enumerable:true})},846:(e,t,r)=>{"use strict";const a=r(234);const o=r(2998);const s=r(251);const u=r(7147).existsSync||r(1017).existsSync;const c=r(1017);e.exports=t;t.usage="Finds the require path for the node-pre-gyp installed module";t.validate=function(e,t){o.validate_config(e,t)};t.find=function(e,t){if(!u(e)){throw new Error(e+"does not exist")}const r=new a.Run({package_json_path:e,argv:process.argv});r.setBinaryHostProperty();const d=r.package_json;o.validate_config(d,t);let f;if(s.get_napi_build_versions(d,t)){f=s.get_best_napi_build_version(d,t)}t=t||{};if(!t.module_root)t.module_root=c.dirname(e);const p=o.evaluate(d,t,f);return p.module}},251:(e,t,r)=>{"use strict";const a=r(7147);e.exports=t;const o=process.version.substr(1).replace(/-.*$/,"").split(".").map((e=>+e));const s=["build","clean","configure","package","publish","reveal","testb
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var t=Object.getOwnPropertySymbols;var r=Object.prototype.hasOwnProperty;var a=Object.prototype.propertyIsEnumerable;function toObject(e){if(e===null||e===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function shouldUseNative(){try{if(!Object.assign){return false}var e=new String("abc");e[5]="de";if(Object.getOwnPropertyNames(e)[0]==="5"){return false}var t={};for(var r=0;r<10;r++){t["_"+String.fromCharCode(r)]=r}var a=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if(a.join("")!=="0123456789"){return false}var o={};"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e}));if(Object.keys(Object.assign({},o)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(e){return false}}e.exports=shouldUseNative()?Object.assign:function(e,o){var s;var u=toObject(e);var c;for(var d=1;d<arguments.length;d++){s=Object(arguments[d]);for(var f in s){if(r.call(s,f)){u[f]=s[f]}}if(t){c=t(s);for(var p=0;p<c.length;p++){if(a.call(s,c[p])){u[c[p]]=s[c[p]]}}}}return u}},9748:e=>{"use strict";if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){e.exports={nextTick:nextTick}}else{e.exports=process}function nextTick(e,t,r,a){if(typeof e!=="function"){throw new TypeError('"callback" argument must be a function')}var o=arguments.length;var s,u;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function afterTickOne(){e.call(null,t)}));case 3:return process.nextTick((function afterTickTwo(){e.call(null,t,r)}));case 4:return process.nextTick((function afterTickThree(){e.call(null,t,r,a)}));default:s=new Array(o-1);u=0;while(u<s.length){s[u++]=arguments[u]}return process.nextTick((function afterTick(){e.apply(null,s)}))}}},8771:(e,t,r)=>{"use strict";var a=r(9748);var o=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var s=Object.create(r(8297));s.inherits=r(3193);var u=r(9227);var c=r(3471);s.inherits(Duplex,u);{var d=o(c.prototype);for(var f=0;f<d.length;f++){var p=d[f];if(!Duplex.prototype[p])Duplex.prototype[p]=c.prototype[p]}}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);u.call(this,e);c.call(this,e);if(e&&e.readable===false)this.readable=false;if(e&&e.writable===false)this.writable=false;this.allowHalfOpen=true;if(e&&e.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function onend(){if(this.allowHalfOpen||this._writableState.ended)return;a.nextTick(onEndNT,this)}function onEndNT(e){e.end()}Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function(e){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=e;this._writableState.destroyed=e}});Duplex.prototype._destroy=function(e,t){this.push(null);this.end();a.nextTick(t,e)}},6288:(e,t,r)=>{"use strict";e.exports=PassThrough;var a=r(5241);var o=Object.create(r(8297));o.inherits=r(3193);o.inherits(PassThrough,a);function PassThrough(e){if(!(this instanceof PassThrough))return new PassThrough(e);a.call(this,e)}PassThrough.prototype._transform=function(e,t,r){r(null,e)}},9227:(e,t,r)=>{"use strict";var a=r(9748);e.exports=Readable;var o=r(6116);var s;Readable.ReadableState=ReadableState;var u=r(2361).EventEmitter;var EElistenerCount=function(e,t){return e.listeners(t).length};var c=r(7474);var d=r(7455).Buffer;var f=global.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return d.from(e)}function _isUint8Array(e){return d.isBuffer(e)||e instanceof f}var p=Object.create(r(8297));p.inherits=r(3193);var h=r(3837);var v=void 0;if(h&&h.debuglog){v=h.debuglog("stream")}else{v=function(){}}var _=r(7255);var g=r(4567);var y;p.in
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/var isNumber=function(e){if(typeof e==="number"){return e-e===0}if(typeof e==="string"&&e.trim()!==""){return Number.isFinite?Number.isFinite(+e):isFinite(+e)}return false};const toRegexRange=(e,t,r)=>{if(isNumber(e)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(t===void 0||e===t){return String(e)}if(isNumber(t)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let a=Object.assign({relaxZeros:true},r);if(typeof a.strictZeros==="boolean"){a.relaxZeros=a.strictZeros===false}let o=String(a.relaxZeros);let s=String(a.shorthand);let u=String(a.capture);let c=String(a.wrap);let d=e+":"+t+"="+o+s+u+c;if(toRegexRange.cache.hasOwnProperty(d)){return toRegexRange.cache[d].result}let f=Math.min(e,t);let p=Math.max(e,t);if(Math.abs(f-p)===1){let r=e+"|"+t;if(a.capture){return`(${r})`}if(a.wrap===false){return r}return`(?:${r})`}let h=hasPadding(e)||hasPadding(t);let v={min:e,max:t,a:f,b:p};let _=[];let g=[];if(h){v.isPadded=h;v.maxLen=String(v.max).length}if(f<0){let e=p<0?Math.abs(p):1;g=splitToPatterns(e,Math.abs(f),v,a);f=v.a=0}if(p>=0){_=splitToPatterns(f,p,v,a)}v.negatives=g;v.positives=_;v.result=collatePatterns(g,_,a);if(a.capture===true){v.result=`(${v.result})`}else if(a.wrap!==false&&_.length+g.length>1){v.result=`(?:${v.result})`}toRegexRange.cache[d]=v;return v.result};function collatePatterns(e,t,r){let a=filterPatterns(e,t,"-",false,r)||[];let o=filterPatterns(t,e,"",false,r)||[];let s=filterPatterns(e,t,"-?",true,r)||[];let u=a.concat(s).concat(o);return u.join("|")}function splitToRanges(e,t){let r=1;let a=1;let o=countNines(e,r);let s=new Set([t]);while(e<=o&&o<=t){s.add(o);r+=1;o=countNines(e,r)}o=countZeros(t+1,a)-1;while(e<o&&o<=t){s.add(o);a+=1;o=countZeros(t+1,a)-1}s=[...s];s.sort(compare);return s}function rangeToPattern(e,t,r){if(e===t){return{pattern:e,count:[],digits:0}}let a=zip(e,t);let o=a.length;let s="";let u=0;for(let e=0;e<o;e++){let[t,o]=a[e];if(t===o){s+=t}else if(t!=="0"||o!=="9"){s+=toCharacterClass(t,o,r)}else{u++}}if(u){s+=r.shorthand===true?"\\d":"[0-9]"}return{pattern:s,count:[u],digits:o}}function splitToPatterns(e,t,r,a){let o=splitToRanges(e,t);let s=[];let u=e;let c;for(let e=0;e<o.length;e++){let t=o[e];let d=rangeToPattern(String(u),String(t),a);let f="";if(!r.isPadded&&c&&c.pattern===d.pattern){if(c.count.length>1){c.count.pop()}c.count.push(d.count[0]);c.string=c.pattern+toQuantifier(c.count);u=t+1;continue}if(r.isPadded){f=padZeros(t,r,a)}d.string=f+d.pattern+toQuantifier(d.count);s.push(d);u=t+1;c=d}return s}function filterPatterns(e,t,r,a,o){let s=[];for(let o of e){let{string:e}=o;if(!a&&!contains(t,"string",e)){s.push(r+e)}if(a&&contains(t,"string",e)){s.push(r+e)}}return s}function zip(e,t){let r=[];for(let a=0;a<e.length;a++)r.push([e[a],t[a]]);return r}function compare(e,t){return e>t?1:t>e?-1:0}function contains(e,t,r){return e.some((e=>e[t]===r))}function countNines(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function countZeros(e,t){return e-e%Math.pow(10,t)}function toQuantifier(e){let[t=0,r=""]=e;if(r||t>1){return`{${t+(r?","+r:"")}}`}return""}function toCharacterClass(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function hasPadding(e){return/^-?(0+)\d/.test(e)}function padZeros(e,t,r){if(!t.isPadded){return e}let a=Math.abs(t.maxLen-String(e).length);let o=r.relaxZeros!==false;switch(a){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:{return o?`0{0,${a}}`:`0{${a}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};var R=toRegexRange;const isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);const transform=e=>t=>e===true?Number(t):String(t);const isValidValue=e=>typeof e==="number"||typeof e==="string"&&e!=="";const isNumber$1=e=>Number.isInteger(+e);const zeros=e=>{let t=`${e}`;let r=-1;if(t[0]==="-")t=t.slice(1);if(t==="0")return false;while(t[++r]==="0");return r>0};const stringify$1=(e,t,r)=>{if(typeof e==="string"||typeof t==="string"){return true}return r.stringify===true};const pad=(e,t,r)=>{if(t>0){let