UNPKG

casefu-generator

Version:
99 lines (85 loc) 84 kB
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=22)}([function(e,t){e.exports=require("path")},function(e,t){e.exports=require("fs")},function(e,t,n){var r,o,i=n(1),a=n(27),s=n(29),c=n(31),u=n(13);function l(e,t){Object.defineProperty(e,r,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(r=Symbol.for("graceful-fs.queue"),o=Symbol.for("graceful-fs.previous")):(r="___graceful-fs.queue",o="___graceful-fs.previous");var p=function(){};if(u.debuglog?p=u.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(p=function(){var e=u.format.apply(u,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!i[r]){var f=global[r]||[];l(i,f),i.close=function(e){function t(t,n){return e.call(i,t,(function(e){e||y(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,o,{value:e}),t}(i.close),i.closeSync=function(e){function t(t){e.apply(i,arguments),y()}return Object.defineProperty(t,o,{value:e}),t}(i.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){p(i[r]),n(17).equal(i[r].length,0)}))}function m(e){a(e),e.gracefulify=m,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?("function"==typeof o&&o.apply(this,arguments),y()):d([e,[n,r,o]])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,o){"function"==typeof r&&(o=r,r=null);return function e(t,r,o,i){return n(t,r,o,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?("function"==typeof i&&i.apply(this,arguments),y()):d([e,[t,r,o,i]])}))}(e,t,r,o)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,o){"function"==typeof n&&(o=n,n=null);return function e(t,n,o,i){return r(t,n,o,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?("function"==typeof i&&i.apply(this,arguments),y()):d([e,[t,n,o,i]])}))}(e,t,n,o)});var o=e.readdir;function i(t){return o.apply(e,t)}if(e.readdir=function(e,t,n){var r=[e];"function"!=typeof t?r.push(t):n=t;return r.push((function(e,t){t&&t.sort&&t.sort();!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?("function"==typeof n&&n.apply(this,arguments),y()):d([i,[r]])})),i(r)},"v0.8"===process.version.substr(0,4)){var c=s(e);h=c.ReadStream,b=c.WriteStream}var u=e.ReadStream;u&&(h.prototype=Object.create(u.prototype),h.prototype.open=function(){var e=this;$(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var l=e.WriteStream;l&&(b.prototype=Object.create(l.prototype),b.prototype.open=function(){var e=this;$(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return b},set:function(e){b=e},enumerable:!0,configurable:!0});var p=h;Object.defineProperty(e,"FileReadStream",{get:function(){return p},set:function(e){p=e},enumerable:!0,configurable:!0});var f=b;function h(e,t){return this instanceof h?(u.apply(this,arguments),this):h.apply(Object.create(h.prototype),arguments)}function b(e,t){return this instanceof b?(l.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var g=e.open;function $(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,o){return g(t,n,r,(function(i,a){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?("function"==typeof o&&o.apply(this,arguments),y()):d([e,[t,n,r,o]])}))}(e,t,n,r)}return e.open=$,e}function d(e){p("ENQUEUE",e[0].name,e[1]),i[r].push(e)}function y(){var e=i[r].shift();e&&(p("RETRY",e[0].name,e[1]),e[0].apply(null,e[1]))}global[r]||l(global,i[r]),e.exports=m(c(i)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!i.__patched&&(e.exports=m(i),i.__patched=!0)},function(e,t,n){"use strict";t.fromCallback=function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise((n,r)=>{e.call(this,...t,(e,t)=>null!=e?r(e):n(t))});e.apply(this,t)}),"name",{value:e.name})},t.fromPromise=function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then(e=>n(null,e),n)}),"name",{value:e.name})}},function(e,t){const n={smallserial:"smallint",serial:"integer",bigserial:"bigint",identity:"bigint"},r=e=>(e||"").toLowerCase().replace(/[m*]/g,"n").replace(/0..n/g,"n").replace(/1..1/g,"1"),o=([e,{status:t}])=>["APK","NPK","FPK","PK"].includes(t),i=([e,{status:t}])=>["V"].includes(t),a=([e,{status:t}])=>["FPK","FK","OFK"].includes(t)||["1","0..1"].includes(r(t).split(" : ")[1]),s=e=>!(([e,{status:t}])=>["n","1..n"].includes(r(t).split(" : ")[1]))(e),c=([e,{dataType:t}])=>t&&0===t.indexOf("enum: "),u=([e,{status:t}])=>"S"===t,l=e=>u(e)&&c(e),p=([e,{dataType:t}])=>t&&["date"].includes(t.toLowerCase()),f=([e,{dataType:t}])=>t&&["timestamp","datetime","smalldatetime","time"].filter(e=>0===t.toLowerCase().indexOf(e)).length>0,m=e=>p(e)||f(e),d=([e,{dataType:t}])=>t&&(["tinyint","smallint","int2","year","integer","int","mediumint","int4","signed","bigint","int8","long","real","double precision","smallserial","serial","bigserial","identity","binary_float","binary_double"].includes(t.toLowerCase())||["decimal","dec","numeric","number","double","float","float8","real","float4"].filter(e=>0===t.toLowerCase().indexOf(e)).length>0),y=(e,t)=>{let n=t.match(e);for(;n;)t=n[1].trim(),n=t.match(e);return t},h=e=>{let t=y(/`#([^`]*)`/,e);return t=y(/\[[^\]]*]\(#([^)]*)\)/,t),t},b=e=>Object.keys(e.sections).filter(t=>"entity"===e.sections[t].type),g=(e,t)=>Object.entries(e.entityAttributes[t]||{}),$=(e,t)=>{const n=g(e,t).filter(o);return n.length>0?n[0]:null},S=(e,t)=>{const r=$(e,t);if(r){const[,{dataType:t}]=r,o=h(t);if(o!==t)return S(e,o);return n[t.toLowerCase()]||t}return"bigint"},v=(e,t,n)=>{const r=g(e,t).filter(s),a=r.filter(o).length>0,c=r.filter(i).length>0,u=[],l=[];return a?c||l.push(["version",{status:"V",dataType:"bigint"}]):(u.push(["id",{status:"APK",dataType:n}]),c||u.push(["version",{status:"V",dataType:"bigint"}])),u.concat(r,l)},w=(e,t)=>v(e,t,"bigint").filter(e=>!i(e)),E=e=>(t,n)=>w(t,n).filter(e),k=E(a),x=E(c),T=E(l),O=E(p),C=E(f),j=E(m),P=e=>(t,n)=>E(e)(t,n).length>0,F=P(a),R=P(c),N=P(l),L=P(p),D=P(f),A=P(m),_=P(d),M=(e,t)=>{const n=b(e).map(n=>g(e,n).filter(a).filter(([,{dataType:e}])=>h(e)===t).map(e=>[n,e]));return[].concat(...n)};e.exports={entityCodes:b,attributeEntries:g,isPrimaryKey:o,isVersion:i,isToOne:a,isUnique:([e,{status:t}])=>["NK","BK","U","OU"].includes(t),isNotNull:([e,{status:t}])=>["FK","NK","BK","U","M","V","S"].includes(t)||["1","1..n"].includes(r(t).split(" : ")[1]),isEnum:c,isStatus:u,isStatusEnum:l,isDate:p,isDateTime:f,isTemporal:m,isNumber:d,extractEntityCodeFromRef:h,explicitPKAttEntry:$,getPKDataTypeForFK:S,ownAttributeEntries:v,userAttributeEntries:w,referredLabelAttribute:(e,t)=>{const n=w(e,t).filter(e=>!o(e));return n.length>0?n[0]:[]},enumValues:({dataType:e})=>e.trim().substring("enum: ".length).split(",").map(e=>e.trim()).map(e=>e.replace(/\s+/g,"_")),filterToOne:k,filterEnum:x,filterStatusEnum:T,filterDate:O,filterDateTime:C,filterTemporal:j,hasToOne:F,hasEnum:R,hasStatusEnum:N,hasDate:L,hasDateTime:D,hasTemporal:A,hasNumber:_,toOneTargets:M,isToOneTarget:(e,t)=>M(e,t).length>0,primaryKey:(e,t)=>E(o)(e,t)[0]}},function(e,t,n){"use strict";const r=n(3).fromPromise,{makeDir:o,makeDirSync:i}=n(33),a=r(o);e.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}},function(e,t,n){const{paramCase:r,sentenceCase:o,noCase:i,camelCase:a,pascalCase:s}=n(12),c=n(16);e.exports={pkg:e=>r(e),url:e=>r(c(e)),label:e=>o(e),labelPlural:e=>o(c(e)),labelLower:e=>i(e),codeLower:e=>a(e),codeUpper:e=>s(e),codePlural:e=>s(c(e)),codePluralLower:e=>a(c(e))}},function(e,t,n){"use strict";const r=n(3).fromPromise,o=n(9);e.exports={pathExists:r((function(e){return o.access(e).then(()=>!0).catch(()=>!1)})),pathExistsSync:o.existsSync}},function(e,t){e.exports={distinct:(e,t,n)=>n.indexOf(e)===t}},function(e,t,n){"use strict";const r=n(3).fromCallback,o=n(2),i=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(e=>"function"==typeof o[e]);Object.keys(o).forEach(e=>{"promises"!==e&&(t[e]=o[e])}),i.forEach(e=>{t[e]=r(o[e])}),t.exists=function(e,t){return"function"==typeof t?o.exists(e,t):new Promise(t=>o.exists(e,t))},t.read=function(e,t,n,r,i,a){return"function"==typeof a?o.read(e,t,n,r,i,a):new Promise((a,s)=>{o.read(e,t,n,r,i,(e,t,n)=>{if(e)return s(e);a({bytesRead:t,buffer:n})})})},t.write=function(e,t,...n){return"function"==typeof n[n.length-1]?o.write(e,t,...n):new Promise((r,i)=>{o.write(e,t,...n,(e,t,n)=>{if(e)return i(e);r({bytesWritten:t,buffer:n})})})},"function"==typeof o.writev&&(t.writev=function(e,t,...n){return"function"==typeof n[n.length-1]?o.writev(e,t,...n):new Promise((r,i)=>{o.writev(e,t,...n,(e,t,n)=>{if(e)return i(e);r({bytesWritten:t,buffers:n})})})}),"function"==typeof o.realpath.native&&(t.realpath.native=r(o.realpath.native))},function(e,t,n){"use strict";const r=n(9),o=n(0),i=n(13),a=n(19)("10.5.0"),s=e=>a?r.stat(e,{bigint:!0}):r.stat(e),c=e=>a?r.statSync(e,{bigint:!0}):r.statSync(e);function u(e,t){return Promise.all([s(e),s(t).catch(e=>{if("ENOENT"===e.code)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}function l(e,t){if(t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev){if(a||t.ino<Number.MAX_SAFE_INTEGER)return!0;if(t.size===e.size&&t.mode===e.mode&&t.nlink===e.nlink&&t.atimeMs===e.atimeMs&&t.mtimeMs===e.mtimeMs&&t.ctimeMs===e.ctimeMs&&t.birthtimeMs===e.birthtimeMs)return!0}return!1}function p(e,t){const n=o.resolve(e).split(o.sep).filter(e=>e),r=o.resolve(t).split(o.sep).filter(e=>e);return n.reduce((e,t,n)=>e&&r[n]===t,!0)}function f(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}e.exports={checkPaths:function(e,t,n,r){i.callbackify(u)(e,t,(o,i)=>{if(o)return r(o);const{srcStat:a,destStat:s}=i;return s&&l(a,s)?r(new Error("Source and destination must not be the same.")):a.isDirectory()&&p(e,t)?r(new Error(f(e,t,n))):r(null,{srcStat:a,destStat:s})})},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:o}=function(e,t){let n;const r=c(e);try{n=c(t)}catch(e){if("ENOENT"===e.code)return{srcStat:r,destStat:null};throw e}return{srcStat:r,destStat:n}}(e,t);if(o&&l(r,o))throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&p(e,t))throw new Error(f(e,t,n));return{srcStat:r,destStat:o}},checkParentPaths:function e(t,n,i,s,c){const u=o.resolve(o.dirname(t)),p=o.resolve(o.dirname(i));if(p===u||p===o.parse(p).root)return c();const m=(r,o)=>r?"ENOENT"===r.code?c():c(r):l(n,o)?c(new Error(f(t,i,s))):e(t,n,p,s,c);a?r.stat(p,{bigint:!0},m):r.stat(p,m)},checkParentPathsSync:function e(t,n,r,i){const a=o.resolve(o.dirname(t)),s=o.resolve(o.dirname(r));if(s===a||s===o.parse(s).root)return;let u;try{u=c(s)}catch(e){if("ENOENT"===e.code)return;throw e}if(l(n,u))throw new Error(f(t,r,i));return e(t,n,s,i)},isSrcSubdir:p}},function(e,t,n){"use strict";const r=n(3).fromCallback,o=n(36);e.exports={remove:r(o),removeSync:o.sync}},function(e,t,n){"use strict";n.r(t),n.d(t,"camelCaseTransform",(function(){return m})),n.d(t,"camelCaseTransformMerge",(function(){return d})),n.d(t,"camelCase",(function(){return y})),n.d(t,"capitalCaseTransform",(function(){return g})),n.d(t,"capitalCase",(function(){return $})),n.d(t,"constantCase",(function(){return w})),n.d(t,"dotCase",(function(){return k})),n.d(t,"headerCase",(function(){return T})),n.d(t,"noCase",(function(){return c})),n.d(t,"paramCase",(function(){return C})),n.d(t,"pascalCaseTransform",(function(){return l})),n.d(t,"pascalCaseTransformMerge",(function(){return p})),n.d(t,"pascalCase",(function(){return f})),n.d(t,"pathCase",(function(){return P})),n.d(t,"sentenceCaseTransform",(function(){return R})),n.d(t,"sentenceCase",(function(){return N})),n.d(t,"snakeCase",(function(){return L}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;function i(e){return e.toLowerCase()}var a=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],s=/[^A-Z0-9]+/gi;function c(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,r=void 0===n?a:n,o=t.stripRegexp,c=void 0===o?s:o,l=t.transform,p=void 0===l?i:l,f=t.delimiter,m=void 0===f?" ":f,d=u(u(e,r,"$1\0$2"),c,"\0"),y=0,h=d.length;"\0"===d.charAt(y);)y++;for(;"\0"===d.charAt(h-1);)h--;return d.slice(y,h).split("\0").map(p).join(m)}function u(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function l(e,t){var n=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function p(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function f(e,t){return void 0===t&&(t={}),c(e,o({delimiter:"",transform:l},t))}function m(e,t){return 0===t?e.toLowerCase():l(e,t)}function d(e,t){return 0===t?e.toLowerCase():p(e)}function y(e,t){return void 0===t&&(t={}),f(e,r({transform:m},t))} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var h=function(){return(h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;function b(e){return e.charAt(0).toUpperCase()+e.substr(1)}function g(e){return b(e.toLowerCase())}function $(e,t){return void 0===t&&(t={}),c(e,h({delimiter:" ",transform:g},t))} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var S=function(){return(S=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;function v(e){return e.toUpperCase()}function w(e,t){return void 0===t&&(t={}),c(e,S({delimiter:"_",transform:v},t))} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var E=function(){return(E=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;function k(e,t){return void 0===t&&(t={}),c(e,E({delimiter:"."},t))} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var x=function(){return(x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;function T(e,t){return void 0===t&&(t={}),$(e,x({delimiter:"-"},t))} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var O=function(){return(O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;function C(e,t){return void 0===t&&(t={}),function(e,t){return void 0===t&&(t={}),c(e,O({delimiter:"."},t))}(e,O({delimiter:"-"},t))} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var j=function(){return(j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;function P(e,t){return void 0===t&&(t={}),function(e,t){return void 0===t&&(t={}),c(e,j({delimiter:"."},t))}(e,j({delimiter:"/"},t))} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var F=function(){return(F=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;Object.create;function R(e,t){var n=e.toLowerCase();return 0===t?b(n):n}function N(e,t){return void 0===t&&(t={}),c(e,F({delimiter:" ",transform:R},t))}function L(e,t){return void 0===t&&(t={}),k(e,E({delimiter:"_"},t))}},function(e,t){e.exports=require("util")},function(e,t){e.exports={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:o}={}){const i=n?t:"";return JSON.stringify(e,r,o).replace(/\n/g,t)+i},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}}},function(e,t,n){"use strict";const r=n(3).fromCallback,o=n(2),i=n(0),a=n(5),s=n(7).pathExists;e.exports={outputFile:r((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const c=i.dirname(e);s(c,(i,s)=>i?r(i):s?o.writeFile(e,t,n,r):void a.mkdirs(c,i=>{if(i)return r(i);o.writeFile(e,t,n,r)}))})),outputFileSync:function(e,...t){const n=i.dirname(e);if(o.existsSync(n))return o.writeFileSync(e,...t);a.mkdirsSync(n),o.writeFileSync(e,...t)}}},function(e,t,n){e.exports=function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function c(e,t){return e.replace(t[0],(function(n,r){var o=s(t[1],arguments);return a(""===n?e[r-1]:n,o)}))}function u(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return c(t,i)}return t}function l(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?a(r,o):e.hasOwnProperty(o)?a(r,e[o]):u(o,r,n)}}function p(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&u(o,o,n)===o}}function f(e,t,n){return(n?t+" ":"")+(1===t?f.singular(e):f.plural(e))}return f.plural=l(o,r,e),f.isPlural=p(o,r,e),f.singular=l(r,o,t),f.isSingular=p(r,o,t),f.addPluralRule=function(t,n){e.push([i(t),n])},f.addSingularRule=function(e,n){t.push([i(e),n])},f.addUncountableRule=function(e){"string"!=typeof e?(f.addPluralRule(e,"$0"),f.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},f.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return f.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return f.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return f.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(f.addUncountableRule),f}()},function(e,t){e.exports=require("assert")},function(e,t,n){"use strict";e.exports={copySync:n(32)}},function(e,t){e.exports=e=>{const t=process.versions.node.split(".").map(e=>parseInt(e,10));return e=e.split(".").map(e=>parseInt(e,10)),t[0]>e[0]||t[0]===e[0]&&(t[1]>e[1]||t[1]===e[1]&&t[2]>=e[2])}},function(e,t,n){"use strict";const r=n(2);e.exports={utimesMillis:function(e,t,n,o){r.open(e,"r+",(e,i)=>{if(e)return o(e);r.futimes(i,t,n,e=>{r.close(i,t=>{o&&o(e||t)})})})},utimesMillisSync:function(e,t,n){const o=r.openSync(e,"r+");return r.futimesSync(o,t,n),r.closeSync(o)}}},function(e,t,n){"use strict";const r=n(3).fromCallback;e.exports={copy:r(n(34))}},function(e,t,n){const{generate:r}=n(23);e.exports={generate:r}},function(e,t,n){const r=n(1),{inspect:o}=n(13),{generatePostgres:i}=n(24),{generateReact:a}=n(25),s=n(66);e.exports={generate:(e,t,n,c)=>{console.log("Generating for setup:",o(t,{depth:null})),r.existsSync(c)||r.mkdirSync(c,{recursive:!0});const{generate:u}=t;if(u){const{database:t,frontend:r}=u;"Postgres"===t&&i(e,c),"React"===r&&a(e,n,c)}s.generate(t,c),console.log("Generating finished successfully.")}}},function(e,t,n){const r=n(1),o=n(0),{snakeCase:i}=n(12),a=n(16),{entityCodes:s,attributeEntries:c,isPrimaryKey:u,isToOne:l,isUnique:p,isNotNull:f,isEnum:m,extractEntityCodeFromRef:d,explicitPKAttEntry:y,getPKDataTypeForFK:h,ownAttributeEntries:b,enumValues:g}=n(4),$=e=>i(a(e)),S=(e,t)=>{const[n,{dataType:r}]=t;if(l(t)&&!u(t)){const t=d(r),o=y(e,t),a=o?o[0]:"id";return i(`${n} ${a}`)}return i(n)},v=(e,t)=>t=>` ${S(e,t)} ${((e,t,n)=>{const[,r]=n;let o=r.dataType||"text";if(l(n)){const t=d(o);o=h(e,t)}return m(n)&&(o="text"),u(n)?o+" primary key":f(n)?o+" not null":""+o})(e,0,t)}`,w=e=>t=>c(e,t).filter(l).map(((e,t)=>n=>{const[r,{dataType:o}]=n,a=$(t),s=S(e,n),c=d(o||"text"),u=$(c);return`\nalter table ${a}\n add constraint fk_${a}__${i(r)} foreign key (${s}) references ${u} on delete cascade;`})(e,t)).join(""),E=(e,t)=>c(e,t).filter(p).map(((e,t)=>n=>{const r=$(t),o=S(e,n);return`\ncreate unique index ui_${r}__${o} on ${r} (${o});`})(e,t)).join(""),k=(e,t)=>c(e,t).filter(m).map(((e,t)=>n=>{const[,r]=n,o=g(r).map(e=>`'${e}'`).join(", ");return`\nalter table ${$(t)}\n add constraint ck_${$(t)}__${S(e,n)} check ( ${S(e,n)} in (${o}) );`})(e,t)).join(""),x=e=>t=>`-- Entity: ${e.sections[t].name}\ncreate table ${$(t)}\n(\n${((e,t)=>b(e,t,"bigserial").map(v(e)).join(",\n"))(e,t)}\n);${E(e,t)}${k(e,t)}`;e.exports={generatePostgres:(e,t)=>{((e,t)=>{console.log('- Generating Postgres "create-tables.sql"');const n=`-- Tables\n---------\n\n${s(e).map(x(e)).join("\n\n")+"\n"}\n\n-- Foreign keys\n---------------\n${s(e).map(w(e)).filter(e=>""!==e).join("")+"\n"}`,i=o.join(t,"postgres");r.mkdirSync(i,{recursive:!0}),r.writeFileSync(o.join(i,"create-tables.sql"),n)})(e,t),(e=>{console.log('- Generating Postgres "Dockerfile"');r.writeFileSync(o.join(e,"postgres","Dockerfile"),"FROM postgres\nCOPY create-tables.sql /docker-entrypoint-initdb.d/\n")})(t)}}},function(e,t,n){const r=n(26),o=n(0),{generateIndexHtml:i}=n(52),{generateHeaderJs:a}=n(53),{generateAppJs:s}=n(54),{generateEntities:c}=n(55),{generateLocalStorageJs:u}=n(64),{generatePackageJson:l}=n(65);e.exports={generateReact:(e,t,n)=>{((e,t)=>{console.log("- Copying React static content"),r.ensureDirSync(t),r.copySync(o.join(e,"static","react"),t)})(t,n),i(e,n),a(e,n),s(e,n),c(e,n),u(e,n),l(e,n)}}},function(e,t,n){"use strict";e.exports={...n(9),...n(18),...n(21),...n(35),...n(37),...n(43),...n(5),...n(48),...n(50),...n(15),...n(7),...n(11)};const r=n(1);Object.getOwnPropertyDescriptor(r,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>r.promises})},function(e,t,n){var r=n(28),o=process.cwd,i=null,a=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||(i=o.call(process)),i};try{process.cwd()}catch(e){}var s=process.chdir;process.chdir=function(e){i=null,s.call(process,e)},e.exports=function(e){r.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,o){e.open(t,r.O_WRONLY|r.O_SYMLINK,n,(function(t,r){t?o&&o(t):e.fchmod(r,n,(function(t){e.close(r,(function(e){o&&o(t||e)}))}))}))},e.lchmodSync=function(t,n){var o,i=e.openSync(t,r.O_WRONLY|r.O_SYMLINK,n),a=!0;try{o=e.fchmodSync(i,n),a=!1}finally{if(a)try{e.closeSync(i)}catch(e){}else e.closeSync(i)}return o}}(e);e.lutimes||function(e){r.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,n,o,i){e.open(t,r.O_SYMLINK,(function(t,r){t?i&&i(t):e.futimes(r,n,o,(function(t){e.close(r,(function(e){i&&i(t||e)}))}))}))},e.lutimesSync=function(t,n,o){var i,a=e.openSync(t,r.O_SYMLINK),s=!0;try{i=e.futimesSync(a,n,o),s=!1}finally{if(s)try{e.closeSync(a)}catch(e){}else e.closeSync(a)}return i}):(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=o(e.chmodSync),e.fchmodSync=o(e.fchmodSync),e.lchmodSync=o(e.lchmodSync),e.stat=c(e.stat),e.fstat=c(e.fstat),e.lstat=c(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.lchown||(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===a&&(e.rename=(t=e.rename,function(n,r,o){var i=Date.now(),a=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){e.stat(r,(function(e,i){e&&"ENOENT"===e.code?t(n,r,s):o(c)}))}),a),void(a<100&&(a+=10));o&&o(c)}))}));var t;function n(t){return t?function(n,r,o){return t.call(e,n,r,(function(e){l(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function o(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!l(e))throw e}}:t}function i(t){return t?function(n,r,o,i){return t.call(e,n,r,o,(function(e){l(e)&&(e=null),i&&i.apply(this,arguments)}))}:t}function s(t){return t?function(n,r,o){try{return t.call(e,n,r,o)}catch(e){if(!l(e))throw e}}:t}function c(t){return t?function(n,r,o){function i(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),o&&o.apply(this,arguments)}return"function"==typeof r&&(o=r,r=null),r?t.call(e,n,r,i):t.call(e,n,i)}:t}function u(t){return t?function(n,r){var o=r?t.call(e,n,r):t.call(e,n);return o.uid<0&&(o.uid+=4294967296),o.gid<0&&(o.gid+=4294967296),o}:t}function l(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read=function(t){function n(n,r,o,i,a,s){var c;if(s&&"function"==typeof s){var u=0;c=function(l,p,f){if(l&&"EAGAIN"===l.code&&u<10)return u++,t.call(e,n,r,o,i,a,c);s.apply(this,arguments)}}return t.call(e,n,r,o,i,a,c)}return n.__proto__=t,n}(e.read),e.readSync=(p=e.readSync,function(t,n,r,o,i){for(var a=0;;)try{return p.call(e,t,n,r,o,i)}catch(e){if("EAGAIN"===e.code&&a<10){a++;continue}throw e}});var p}},function(e,t){e.exports=require("constants")},function(e,t,n){var r=n(30).Stream;e.exports=function(e){return{ReadStream:function t(n,o){if(!(this instanceof t))return new t(n,o);r.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,o=o||{};for(var a=Object.keys(o),s=0,c=a.length;s<c;s++){var u=a[s];this[u]=o[u]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){i._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return i.emit("error",e),void(i.readable=!1);i.fd=t,i.emit("open",t),i._read()}))},WriteStream:function t(n,o){if(!(this instanceof t))return new t(n,o);r.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var i=Object.keys(o),a=0,s=i.length;a<s;a++){var c=i[a];this[c]=o[c]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}},function(e,t){e.exports=require("stream")},function(e,t,n){"use strict";e.exports=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:e.__proto__};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t}},function(e,t,n){"use strict";const r=n(2),o=n(0),i=n(5).mkdirsSync,a=n(20).utimesMillisSync,s=n(10);function c(e,t,n,i){if(!i.filter||i.filter(t,n))return function(e,t,n,i){const a=(i.dereference?r.statSync:r.lstatSync)(t);if(a.isDirectory())return function(e,t,n,o,i){if(!t)return function(e,t,n,o){return r.mkdirSync(n),p(t,n,o),l(n,e)}(e.mode,n,o,i);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${o}' with directory '${n}'.`);return p(n,o,i)}(a,e,t,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return function(e,t,n,o,i){return t?function(e,t,n,o){if(o.overwrite)return r.unlinkSync(n),u(e,t,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,o,i):u(e,n,o,i)}(a,e,t,n,i);if(a.isSymbolicLink())return function(e,t,n,i){let a=r.readlinkSync(t);i.dereference&&(a=o.resolve(process.cwd(),a));if(e){let e;try{e=r.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return r.symlinkSync(a,n);throw e}if(i.dereference&&(e=o.resolve(process.cwd(),e)),s.isSrcSubdir(a,e))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${e}'.`);if(r.statSync(n).isDirectory()&&s.isSrcSubdir(e,a))throw new Error(`Cannot overwrite '${e}' with '${a}'.`);return function(e,t){return r.unlinkSync(t),r.symlinkSync(e,t)}(a,n)}return r.symlinkSync(a,n)}(e,t,n,i)}(e,t,n,i)}function u(e,t,n,o){return r.copyFileSync(t,n),o.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){l(e,128|t)}(n,e);(function(e,t){const n=r.statSync(e);a(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),l(n,e.mode)}function l(e,t){return r.chmodSync(e,t)}function p(e,t,n){r.readdirSync(e).forEach(r=>function(e,t,n,r){const i=o.join(t,e),a=o.join(n,e),{destStat:u}=s.checkPathsSync(i,a,"copy");return c(u,i,a,r)}(r,e,t,n))}e.exports=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:a,destStat:u}=s.checkPathsSync(e,t,"copy");return s.checkParentPathsSync(e,a,t,"copy"),function(e,t,n,a){if(a.filter&&!a.filter(t,n))return;const s=o.dirname(n);r.existsSync(s)||i(s);return c(e,t,n,a)}(u,e,t,n)}},function(e,t,n){"use strict";const r=n(9),o=n(0),i=n(19)("10.12.0"),a=e=>{if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(o.parse(e).root,""))){const t=new Error("Path contains invalid characters: "+e);throw t.code="EINVAL",t}}},s=e=>("number"==typeof e&&(e={mode:e}),{mode:511,...e}),c=e=>{const t=new Error(`operation not permitted, mkdir '${e}'`);return t.code="EPERM",t.errno=-4048,t.path=e,t.syscall="mkdir",t};e.exports.makeDir=async(e,t)=>{if(a(e),t=s(t),i){const n=o.resolve(e);return r.mkdir(n,{mode:t.mode,recursive:!0})}const n=async e=>{try{await r.mkdir(e,t.mode)}catch(t){if("EPERM"===t.code)throw t;if("ENOENT"===t.code){if(o.dirname(e)===e)throw c(e);if(t.message.includes("null bytes"))throw t;return await n(o.dirname(e)),n(e)}try{if(!(await r.stat(e)).isDirectory())throw new Error("The path is not a directory")}catch{throw t}}};return n(o.resolve(e))},e.exports.makeDirSync=(e,t)=>{if(a(e),t=s(t),i){const n=o.resolve(e);return r.mkdirSync(n,{mode:t.mode,recursive:!0})}const n=e=>{try{r.mkdirSync(e,t.mode)}catch(t){if("EPERM"===t.code)throw t;if("ENOENT"===t.code){if(o.dirname(e)===e)throw c(e);if(t.message.includes("null bytes"))throw t;return n(o.dirname(e)),n(e)}try{if(!r.statSync(e).isDirectory())throw new Error("The path is not a directory")}catch{throw t}}};return n(o.resolve(e))}},function(e,t,n){"use strict";const r=n(2),o=n(0),i=n(5).mkdirs,a=n(7).pathExists,s=n(20).utimesMillis,c=n(10);function u(e,t,n,r,s){const c=o.dirname(n);a(c,(o,a)=>o?s(o):a?p(e,t,n,r,s):void i(c,o=>o?s(o):p(e,t,n,r,s)))}function l(e,t,n,r,o,i){Promise.resolve(o.filter(n,r)).then(a=>a?e(t,n,r,o,i):i(),e=>i(e))}function p(e,t,n,r,o){return r.filter?l(f,e,t,n,r,o):f(e,t,n,r,o)}function f(e,t,n,o,i){(o.dereference?r.stat:r.lstat)(t,(a,s)=>a?i(a):s.isDirectory()?function(e,t,n,o,i,a){if(!t)return function(e,t,n,o,i){r.mkdir(n,r=>{if(r)return i(r);h(t,n,o,t=>t?i(t):y(n,e,i))})}(e.mode,n,o,i,a);if(t&&!t.isDirectory())return a(new Error(`Cannot overwrite non-directory '${o}' with directory '${n}'.`));return h(n,o,i,a)}(s,e,t,n,o,i):s.isFile()||s.isCharacterDevice()||s.isBlockDevice()?function(e,t,n,o,i,a){return t?function(e,t,n,o,i){if(!o.overwrite)return o.errorOnExist?i(new Error(`'${n}' already exists`)):i();r.unlink(n,r=>r?i(r):m(e,t,n,o,i))}(e,n,o,i,a):m(e,n,o,i,a)}(s,e,t,n,o,i):s.isSymbolicLink()?g(e,t,n,o,i):void 0)}function m(e,t,n,o,i){r.copyFile(t,n,r=>r?i(r):o.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return y(e,128|t,n)}(n,e,o=>o?r(o):d(e,t,n,r));return d(e,t,n,r)}(e.mode,t,n,i):y(n,e.mode,i))}function d(e,t,n,o){!function(e,t,n){r.stat(e,(e,r)=>e?n(e):s(t,r.atime,r.mtime,n))}(t,n,t=>t?o(t):y(n,e,o))}function y(e,t,n){return r.chmod(e,t,n)}function h(e,t,n,o){r.readdir(e,(r,i)=>r?o(r):b(i,e,t,n,o))}function b(e,t,n,r,i){const a=e.pop();return a?function(e,t,n,r,i,a){const s=o.join(n,t),u=o.join(r,t);c.checkPaths(s,u,"copy",(t,o)=>{if(t)return a(t);const{destStat:c}=o;p(c,s,u,i,t=>t?a(t):b(e,n,r,i,a))})}(e,a,t,n,r,i):i()}function g(e,t,n,i,a){r.readlink(t,(t,s)=>t?a(t):(i.dereference&&(s=o.resolve(process.cwd(),s)),e?void r.readlink(n,(t,u)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?r.symlink(s,n,a):a(t):(i.dereference&&(u=o.resolve(process.cwd(),u)),c.isSrcSubdir(s,u)?a(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):e.isDirectory()&&c.isSrcSubdir(u,s)?a(new Error(`Cannot overwrite '${u}' with '${s}'.`)):function(e,t,n){r.unlink(t,o=>o?n(o):r.symlink(e,t,n))}(s,n,a))):r.symlink(s,n,a)))}e.exports=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),c.checkPaths(e,t,"copy",(o,i)=>{if(o)return r(o);const{srcStat:a,destStat:s}=i;c.checkParentPaths(e,a,t,"copy",o=>o?r(o):n.filter?l(u,s,e,t,n,r):u(s,e,t,n,r))})}},function(e,t,n){"use strict";const r=n(3).fromCallback,o=n(2),i=n(0),a=n(5),s=n(11),c=r((function(e,t){t=t||function(){},o.readdir(e,(n,r)=>{if(n)return a.mkdirs(e,t);r=r.map(t=>i.join(e,t)),function e(){const n=r.pop();if(!n)return t();s.remove(n,n=>{if(n)return t(n);e()})}()})}));function u(e){let t;try{t=o.readdirSync(e)}catch{return a.mkdirsSync(e)}t.forEach(t=>{t=i.join(e,t),s.removeSync(t)})}e.exports={emptyDirSync:u,emptydirSync:u,emptyDir:c,emptydir:c}},function(e,t,n){"use strict";const r=n(2),o=n(0),i=n(17),a="win32"===process.platform;function s(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{e[t]=e[t]||r[t],e[t+="Sync"]=e[t]||r[t]}),e.maxBusyTries=e.maxBusyTries||3}function c(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),i(e,"rimraf: missing path"),i.strictEqual(typeof e,"string","rimraf: path should be a string"),i.strictEqual(typeof n,"function","rimraf: callback function required"),i(t,"rimraf: invalid options argument provided"),i.strictEqual(typeof t,"object","rimraf: options should be object"),s(t),u(e,t,(function o(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&r<t.maxBusyTries){r++;return setTimeout(()=>u(e,t,o),100*r)}"ENOENT"===i.code&&(i=null)}n(i)}))}function u(e,t,n){i(e),i(t),i("function"==typeof n),t.lstat(e,(r,o)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&a?l(e,t,r,n):o&&o.isDirectory()?f(e,t,r,n):void t.unlink(e,r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return a?l(e,t,r,n):f(e,t,r,n);if("EISDIR"===r.code)return f(e,t,r,n)}return n(r)}))}function l(e,t,n,r){i(e),i(t),i("function"==typeof r),t.chmod(e,438,o=>{o?r("ENOENT"===o.code?null:n):t.stat(e,(o,i)=>{o?r("ENOENT"===o.code?null:n):i.isDirectory()?f(e,t,n,r):t.unlink(e,r)})})}function p(e,t,n){let r;i(e),i(t);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?d(e,t,n):t.unlinkSync(e)}function f(e,t,n,r){i(e),i(t),i("function"==typeof r),t.rmdir(e,a=>{!a||"ENOTEMPTY"!==a.code&&"EEXIST"!==a.code&&"EPERM"!==a.code?a&&"ENOTDIR"===a.code?r(n):r(a):function(e,t,n){i(e),i(t),i("function"==typeof n),t.readdir(e,(r,i)=>{if(r)return n(r);let a,s=i.length;if(0===s)return t.rmdir(e,n);i.forEach(r=>{c(o.join(e,r),t,r=>{if(!a)return r?n(a=r):void(0==--s&&t.rmdir(e,n))})})})}(e,t,r)})}function m(e,t){let n;s(t=t||{}),i(e,"rimraf: missing path"),i.strictEqual(typeof e,"string","rimraf: path should be a string"),i(t,"rimraf: missing options"),i.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&a&&p(e,t,n)}try{n&&n.isDirectory()?d(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return a?p(e,t,n):d(e,t,n);if("EISDIR"!==n.code)throw n;d(e,t,n)}}function d(e,t,n){i(e),i(t);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(i(e),i(t),t.readdirSync(e).forEach(n=>m(o.join(e,n),t)),!a){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch{}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}e.exports=c,c.sync=m},function(e,t,n){"use strict";const r=n(38),o=n(39),i=n(40);e.exports={createFile:r.createFile,createFileSync:r.createFileSync,ensureFile:r.createFile,ensureFileSync:r.createFileSync,createLink:o.createLink,createLinkSync:o.createLinkSync,ensureLink:o.createLink,ensureLinkSync:o.createLinkSync,createSymlink:i.createSymlink,createSymlinkSync:i.createSymlinkSync,ensureSymlink:i.createSymlink,ensureSymlinkSync:i.createSymlinkSync}},function(e,t,n){"use strict";const r=n(3).fromCallback,o=n(0),i=n(2),a=n(5);e.exports={createFile:r((function(e,t){function n(){i.writeFile(e,"",e=>{if(e)return t(e);t()})}i.stat(e,(r,s)=>{if(!r&&s.isFile())return t();const c=o.dirname(e);i.stat(c,(e,r)=>{if(e)return"ENOENT"===e.code?a.mkdirs(c,e=>{if(e)return t(e);n()}):t(e);r.isDirectory()?n():i.readdir(c,e=>{if(e)return t(e)})})})})),createFileSync:function(e){let t;try{t=i.statSync(e)}catch{}if(t&&t.isFile())return;const n=o.dirname(e);try{i.statSync(n).isDirectory()||i.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;a.mkdirsSync(n)}i.writeFileSync(e,"")}}},function(e,t,n){"use strict";const r=n(3).fromCallback,o=n(0),i=n(2),a=n(5),s=n(7).pathExists;e.exports={createLink:r((function(e,t,n){function r(e,t){i.link(e,t,e=>{if(e)return n(e);n(null)})}s(t,(c,u)=>c?n(c):u?n(null):void i.lstat(e,i=>{if(i)return i.message=i.message.replace("lstat","ensureLink"),n(i);const c=o.dirname(t);s(c,(o,i)=>o?n(o):i?r(e,t):void a.mkdirs(c,o=>{if(o)return n(o);r(e,t)}))}))})),createLinkSync:function(e,t){if(i.existsSync(t))return;try{i.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=o.dirname(t);return i.existsSync(n)||a.mkdirsSync(n),i.linkSync(e,t)}}},function(e,t,n){"use strict";const r=n(3).fromCallback,o=n(0),i=n(2),a=n(5)