create-deckdeckgo
Advanced tools
Comparing version 1.0.1 to 1.2.0
@@ -0,1 +1,13 @@ | ||
<a name="1.2.0"></a> | ||
# 1.2.0 (2020-08-28) | ||
### Features | ||
- repo `deckdeckgo-starter` renamed to `starter-kit` | ||
### Fix | ||
- Google Fonts with `.svg` extension | ||
<a name="1.0.1"></a> | ||
@@ -2,0 +14,0 @@ |
#! /usr/bin/env node | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("readline")),n=require("https"),r=e(require("fs")),i=require("path"),o=e(i),s=e(require("zlib")),a=e(require("util")),l=e(require("stream")),c=e(require("events")),f=e(require("buffer")),u=require("child_process");let d=!("NO_COLOR"in process.env)&&"0"!==process.env.FORCE_COLOR&&("win32"===process.platform||null!=process.stdout&&process.stdout.isTTY&&process.env.TERM&&"dumb"!==process.env.TERM);const h=(e,t,n,r)=>i=>d?e+(~(i+="").indexOf(t,4)?i.replace(n,r):i)+t:i,p=(e,t)=>h(`[${e}m`,`[${t}m`,new RegExp(`\\x1b\\[${t}m`,"g"),`[${e}m`);var m={options:Object.defineProperty({},"enabled",{get:()=>d,set:e=>d=e}),reset:p(0,0),bold:h("[1m","[22m",/\x1b\[22m/g,"[22m[1m"),dim:h("[2m","[22m",/\x1b\[22m/g,"[22m[2m"),italic:p(3,23),underline:p(4,24),inverse:p(7,27),hidden:p(8,28),strikethrough:p(9,29),black:p(30,39),red:p(31,39),green:p(32,39),yellow:p(33,39),blue:p(34,39),magenta:p(35,39),cyan:p(36,39),white:p(37,39),gray:p(90,39),bgBlack:p(40,49),bgRed:p(41,49),bgGreen:p(42,49),bgYellow:p(43,49),bgBlue:p(44,49),bgMagenta:p(45,49),bgCyan:p(46,49),bgWhite:p(47,49),blackBright:p(90,39),redBright:p(91,39),greenBright:p(92,39),yellowBright:p(93,39),blueBright:p(94,39),magentaBright:p(95,39),cyanBright:p(96,39),whiteBright:p(97,39),bgBlackBright:p(100,49),bgRedBright:p(101,49),bgGreenBright:p(102,49),bgYellowBright:p(103,49),bgBlueBright:p(104,49),bgMagentaBright:p(105,49),bgCyanBright:p(106,49),bgWhiteBright:p(107,49)},y=m.bold,g=m.red,v=m.yellow,w=m.cyan;var E,S=(E=Object.freeze({__proto__:null,default:["|/-\\","⠂-–—–-","◐◓◑◒","◴◷◶◵","◰◳◲◱","▖▘▝▗","■□▪▫","▌▀▐▄","▉▊▋▌▍▎▏▎▍▌▋▊▉","▁▃▄▅▆▇█▇▆▅▄▃","←↖↑↗→↘↓↙","┤┘┴└├┌┬┐","◢◣◤◥",".oO°Oo.",".oO@*",["🌍","🌎","🌏"],"◡◡ ⊙⊙ ◠◠","☱☲☴","⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏","⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓","⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆","⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋","⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁","⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈","⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈","⢄⢂⢁⡁⡈⡐⡠","⢹⢺⢼⣸⣇⡧⡗⡏","⣾⣽⣻⢿⡿⣟⣯⣷","⠁⠂⠄⡀⢀⠠⠐⠈",["🌑","🌒","🌓","🌔","🌕","🌝","🌖","🌗","🌘","🌚"],["🕛","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚"]]}))&&E.default||E,x=0,b=60;function C(e){this.clearLine(this.stream),this.stream.write(e)}var z=function(e){if(!(this instanceof z))return new z(e);"string"==typeof e?e={text:e}:e||(e={}),this.text=e.text||"",this.setSpinnerString(x),this.setSpinnerDelay(b),this.onTick=e.onTick||C,this.stream=e.stream||process.stdout};z.spinners=S,z.setDefaultSpinnerString=function(e){return x=e,this},z.setDefaultSpinnerDelay=function(e){return b=e,this},z.prototype.start=function(){if(this.stream===process.stdout&&!0!==this.stream.isTTY)return this;var e=0,t=this,n=function(){var n=t.text.indexOf("%s")>-1?t.text.replace("%s",t.chars[e]):t.chars[e]+" "+t.text;t.onTick(n),e=++e%t.chars.length};return n(),this.id=setInterval(n,this.delay),this},z.prototype.isSpinning=function(){return void 0!==this.id},z.prototype.setSpinnerDelay=function(e){return this.delay=e,this},z.prototype.setSpinnerString=function(e){const t=function(e,t){if(!function(e){return"number"==typeof e&&e%1==0}(e))return e+"";var n=z.spinners.length;return e=(e=e>=n?0:e)<0?n+e:e,z.spinners[e]}(e,this.spinners);return this.chars=Array.isArray(t)?t:t.split(""),this},z.prototype.setSpinnerTitle=function(e){return this.text=e,this},z.prototype.stop=function(e){return!1===this.isSpinning||(clearInterval(this.id),this.id=void 0,e&&this.clearLine(this.stream)),this},z.prototype.clearLine=function(e){return t.clearLine(e,0),t.cursorTo(e,0),this};var k=z,L=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function I(e,t={}){return new Promise((r,i)=>{n.get(e,t,e=>{if(302===e.statusCode)I(e.headers.location).then(r,i);else{const t=[];e.on("data",e=>t.push(e)),e.on("end",()=>{r(Buffer.concat(t))}),e.on("error",i)}})})}function O(e,t,i){return new Promise((s,a)=>L(this,void 0,void 0,(function*(){const l=r.createWriteStream(t+o.sep+i);l.on("open",()=>{n.get(e,e=>{e.on("error",e=>{a(e)}),e.pipe(l)})}).on("error",e=>{a(e)}).on("finish",()=>{s()})})))}var B=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function N(e){return new Promise((t,n)=>B(this,void 0,void 0,(function*(){try{const n=require("inquirer"),i=[{type:"confirm",name:"font",message:"Do you want to use a Google Font for your presentation?",default:!1}];if((yield n.prompt(i)).font){const t=yield function(){return new Promise((e,t)=>B(this,void 0,void 0,(function*(){const n=new k(y("Fetching fonts list..."));n.setSpinnerString(18),n.start();try{let t=null;const r=yield function(){return new Promise((e,t)=>B(this,void 0,void 0,(function*(){try{const n=yield I("https://api.deckdeckgo.com/googlefonts/");if(n){const t=JSON.parse(n.toString("utf8"));if(t&&t.key&&t.key.length>0)return void e(t.key)}t("No Google Fonts key found")}catch(e){t(e)}})))}(),i=yield function(e){return I(`https://www.googleapis.com/webfonts/v1/webfonts?key=${e}`)}(r);i&&(t=JSON.parse(i.toString("utf8"))),n.stop(!0),e(t)}catch(e){n.stop(!0),t(e)}})))}();if(t&&t.items&&t.items.length>0){const n=yield function(e){return new Promise((t,n)=>B(this,void 0,void 0,(function*(){try{let n,r=!0;for(;r;){const t=yield M(e),i=yield P(t);n=i.font,r=i.searchAgain}t(n)}catch(e){n(e)}})))}(t);if(n){const t=yield function(e){return new Promise((t,n)=>B(this,void 0,void 0,(function*(){try{if(!e||!e.subsets||e.subsets.length<=0)return void t(void 0);if(1===e.subsets.length)return void t(e.subsets);const n=require("inquirer"),r=[{type:"checkbox",name:"fontSubsets",message:"Select charsets",choices:e.subsets,default:["latin"]}],i=yield n.prompt(r);t(i.fontSubsets)}catch(e){n(e)}})))}(n),i=yield function(e){return new Promise((t,n)=>B(this,void 0,void 0,(function*(){try{if(!e||!e.variants||e.variants.length<=0)return void t(void 0);const n=require("inquirer"),r=[{type:"checkbox",name:"fontVariants",message:"Select styles",choices:e.variants,default:["regular"]}],i=yield n.prompt(r);t(i.fontVariants)}catch(e){n(e)}})))}(n),o=yield function(e,t,n){return new Promise((r,i)=>B(this,void 0,void 0,(function*(){const o=new k(y("Downloading font..."));o.setSpinnerString(18),o.start();try{if(e&&t&&t.length>0&&n&&n.length>0){const i=[];i.push(U(e.family,n,t,"Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)")),i.push(U(e.family,n,t,"Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36")),i.push(U(e.family,n,t,"Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)")),i.push(U(e.family,n,t,"Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_2; en-gb) AppleWebKit/526+ (KHTML, like Gecko) Version/3.1 iPhone")),i.push(U(e.family,n,t,"Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3"));const o=yield Promise.all(i);o&&o.length>0?r({eot:o[0],woff2:o.length>1?o[1]:null,woff:o.length>2?o[2]:null,ttf:o.length>3?o[3]:null,svg:o.length>4?o[4]:null}):r(null)}else console.log("No font to fetch.\n");o.stop(!0),r()}catch(e){o.stop(!0),console.error(e),i(e)}})))}(n,i,t),s=yield function(e,t){return new Promise((n,i)=>B(this,void 0,void 0,(function*(){if(!e||!t)return void n(null);if(!(t.eot||t.woff2||t.woff||t.ttf||t.svg))return void n(null);const o=new k(y("Downloading font..."));o.setSpinnerString(18),o.start();try{yield function(e){return new Promise(t=>{r.existsSync(e)||r.mkdirSync(e),t()})}(e);const i=[];i.push(F(e,t.eot)),i.push(F(e,t.woff2)),i.push(F(e,t.woff)),i.push(F(e,t.ttf)),i.push(F(e,t.svg));const s=yield Promise.all(i);s&&s.length>0?n({eot:s[0],woff2:s.length>1?s[1]:null,woff:s.length>2?s[2]:null,ttf:s.length>3?s[3]:null,svg:s.length>4?s[4]:null}):n(null),o.stop(!0),n(t)}catch(e){o.stop(!0),console.error(e),i(e)}})))}(e+"/src/assets/fonts/",o);yield function(e,t,n){return new Promise((i,o)=>B(this,void 0,void 0,(function*(){if(!(e&&t&&t.family&&n))return void i();const s=new k(y("Writing to CSS files..."));s.setSpinnerString(18),s.start();try{yield function(e,t,n){return new Promise((i,o)=>B(this,void 0,void 0,(function*(){try{let s="";if(n.eot&&(s+=n.eot),n.woff2&&(s+=n.woff2),n.woff&&(s+=n.woff),n.ttf&&(s+=n.ttf),n.svg&&(s+=n.svg),!s||0===s.length)return void i();s+=function(e){let t="\n:root {\n";return t+=`--ion-font-family: "${e}";\n`,t+="}\n\n* {\n",t+=`font-family: "${e}";\n`,t+=`--ion-font-family: "${e}";\n`,t+="}\n",t}(t),r.writeFile(e,s,e=>{e?o(e):i()})}catch(e){o(e)}})))}(e+"/src/css/google-fonts.css",t.family,n),yield function(e){return new Promise((t,n)=>B(this,void 0,void 0,(function*(){try{r.appendFile(e,"\n\nimport './css/google-fonts.css';",e=>{e?n(e):t()}),t()}catch(e){n(e)}})))}(e+"/src/index.js"),s.stop(!0),i()}catch(e){s.stop(!0),o(e)}})))}(e,n,s)}}}t()}catch(e){n(e)}})))}function U(e,t,n,r){return new Promise((i,o)=>B(this,void 0,void 0,(function*(){try{let o=null;const s=yield function(e,t,n,r){return I(`https://fonts.googleapis.com/css?family=${e}:${t.join(",")}&subset=${n.join(",")}`,{headers:{"User-Agent":r}})}(e,n,t,r);s&&(o=s.toString("utf8")),i(o)}catch(e){o(e)}})))}function F(e,t){return new Promise((n,r)=>B(this,void 0,void 0,(function*(){if(!t||t.length<=0)n(null);else try{let r=t;const i=/(url\()(.*?)(\))/gm;let o;for(;o=i.exec(t);)if(o&&o.length>=2){const t=o[0],n=o[2],i=/(?:.+\/)(.+)/gm.exec(n);if(i&&i.length>=1){let o=i[1];const s=/(kit=)(.*?)(&)/gm.exec(n);s&&s.length>=2&&(o=s[2]),yield O(n,e,o),r=r.replace(t,`url(/assets/fonts/${o})`)}}n(r)}catch(e){r(e)}})))}function P(e){return new Promise((t,n)=>B(this,void 0,void 0,(function*(){try{const n=require("inquirer");let r;e&&e.length>0&&(r=e.map(e=>e.family)),(!r||r.length<=0)&&(r=[]);const i=r.length>0?"Select the font":"No font found";r.push("Search again","Skip");const o=[{type:"list",name:"fontName",message:i,choices:r}],s=yield n.prompt(o);if(s&&"Search again"===s.fontName)t({searchAgain:!0});else if(s&&"Skip"===s.fontName)t({searchAgain:!1});else if(e&&e.length>0){const n=e.find(e=>e.family&&e.family.toLowerCase().indexOf(s.fontName.toLowerCase())>-1);t({searchAgain:!1,font:n})}else t({searchAgain:!1})}catch(e){n(e)}})))}function M(e){return new Promise((t,n)=>B(this,void 0,void 0,(function*(){try{const n=require("inquirer"),r=[{type:"input",name:"fontName",message:"Search a Google font (min. 3 characters)?",validate:e=>!!(e&&e.length>=3)||"Please provide at least 3 characters for the font's family name"}],i=yield n.prompt(r),o=e.items.filter(e=>e.family&&e.family.toLowerCase().indexOf(i.fontName.toLowerCase())>-1);t(o)}catch(e){n(e)}})))}var T=_;function _(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}function D(e){e.pending+=1;var t=!1;return function(r){if(t)throw new Error("callback called twice");if(t=!0,e.error=e.error||r,e.pending-=1,e.waiting.length>0&&e.pending<e.max)R(e,e.waiting.shift());else if(0===e.pending){var i=e.listeners;e.listeners=[],i.forEach(n)}};function n(t){t(e.error)}}function R(e,t){t(D(e))}_.prototype.go=function(e){this.pending<this.max?R(this,e):this.waiting.push(e)},_.prototype.wait=function(e){0===this.pending?e(this.error):this.listeners.push(e)},_.prototype.hold=function(){return D(this)};var W=l.Readable,q=l.Writable,A=l.PassThrough,G=c.EventEmitter,$=function(e,t){return new V(e,t)},K=function(e,t){return new Y(e,t)},j=V,H=Y;function Y(e,t){t=t||{},G.call(this),this.fd=e,this.pend=new T,this.pend.max=1,this.refCount=0,this.autoClose=!!t.autoClose}function X(e,t){t=t||{},W.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start,this.destroyed=!1}function J(e,t){t=t||{},q.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=null==t.end?1/0:+t.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}function V(e,t){G.call(this),t=t||{},this.refCount=0,this.buffer=e,this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}a.inherits(Y,G),Y.prototype.read=function(e,t,n,i,o){var s=this;s.pend.go((function(a){r.read(s.fd,e,t,n,i,(function(e,t,n){a(),o(e,t,n)}))}))},Y.prototype.write=function(e,t,n,i,o){var s=this;s.pend.go((function(a){r.write(s.fd,e,t,n,i,(function(e,t,n){a(),o(e,t,n)}))}))},Y.prototype.createReadStream=function(e){return new X(this,e)},Y.prototype.createWriteStream=function(e){return new J(this,e)},Y.prototype.ref=function(){this.refCount+=1},Y.prototype.unref=function(){var e=this;if(e.refCount-=1,!(e.refCount>0)){if(e.refCount<0)throw new Error("invalid unref");e.autoClose&&r.close(e.fd,(function(t){t?e.emit("error",t):e.emit("close")}))}},a.inherits(X,W),X.prototype._read=function(e){var t=this;if(!t.destroyed){var n=Math.min(t._readableState.highWaterMark,e);if(null!=t.endOffset&&(n=Math.min(n,t.endOffset-t.pos)),n<=0)return t.destroyed=!0,t.push(null),void t.context.unref();t.context.pend.go((function(e){if(t.destroyed)return e();var i=new Buffer(n);r.read(t.context.fd,i,0,n,t.pos,(function(n,r){n?t.destroy(n):0===r?(t.destroyed=!0,t.push(null),t.context.unref()):(t.pos+=r,t.push(i.slice(0,r))),e()}))}))}},X.prototype.destroy=function(e){this.destroyed||(e=e||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",e),this.context.unref())},a.inherits(J,q),J.prototype._write=function(e,t,n){var i=this;if(!i.destroyed){if(i.pos+e.length>i.endOffset){var o=new Error("maximum file length exceeded");return o.code="ETOOBIG",i.destroy(),void n(o)}i.context.pend.go((function(t){if(i.destroyed)return t();r.write(i.context.fd,e,0,e.length,i.pos,(function(e,r){e?(i.destroy(),t(),n(e)):(i.bytesWritten+=r,i.pos+=r,i.emit("progress"),t(),n())}))}))}},J.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())},a.inherits(V,G),V.prototype.read=function(e,t,n,r,i){var o=r+n,s=o-this.buffer.length,a=s>0?s:n;this.buffer.copy(e,t,r,o),setImmediate((function(){i(null,a)}))},V.prototype.write=function(e,t,n,r,i){e.copy(this.buffer,r,t,t+n),setImmediate((function(){i(null,n,e)}))},V.prototype.createReadStream=function(e){var t=new A(e=e||{});t.destroyed=!1,t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var n=this.buffer.slice(t.start,t.pos),r=0;;){var i=r+this.maxChunkSize;if(i>=n.length){r<n.length&&t.write(n.slice(r,n.length));break}t.write(n.slice(r,i)),r=i}return t.end(),t.destroy=function(){t.destroyed=!0},t},V.prototype.createWriteStream=function(e){var t=this,n=new q(e=e||{});return n.start=e.start||0,n.endOffset=null==e.end?this.buffer.length:+e.end,n.bytesWritten=0,n.pos=n.start,n.destroyed=!1,n._write=function(e,r,i){if(!n.destroyed){var o=n.pos+e.length;if(o>n.endOffset){var s=new Error("maximum file length exceeded");return s.code="ETOOBIG",n.destroyed=!0,void i(s)}e.copy(t.buffer,n.pos,0,e.length),n.bytesWritten+=e.length,n.pos=o,n.emit("progress"),i()}},n.destroy=function(){n.destroyed=!0},n},V.prototype.ref=function(){this.refCount+=1},V.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};var Z={createFromBuffer:$,createFromFd:K,BufferSlicer:j,FdSlicer:H},Q=f.Buffer,ee=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function te(e){if(Q.isBuffer(e))return e;var t="function"==typeof Q.alloc&&"function"==typeof Q.from;if("number"==typeof e)return t?Q.alloc(e):new Q(e);if("string"==typeof e)return t?Q.from(e):new Q(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function ne(e){var t=te(4);return t.writeInt32BE(e,0),t}function re(e,t){e=te(e),Q.isBuffer(t)&&(t=t.readUInt32BE(0));for(var n=-1^~~t,r=0;r<e.length;r++)n=ee[255&(n^e[r])]^n>>>8;return-1^n}function ie(){return ne(re.apply(null,arguments))}"undefined"!=typeof Int32Array&&(ee=new Int32Array(ee)),ie.signed=function(){return re.apply(null,arguments)},ie.unsigned=function(){return re.apply(null,arguments)>>>0};var oe=ie,se=c.EventEmitter,ae=l.Transform,le=l.PassThrough,ce=l.Writable,fe=function(e,t,n){"function"==typeof t&&(n=t,t=null);null==t&&(t={});t.autoClose=!1,null==t.lazyEntries&&(t.lazyEntries=!1);null==t.decodeStrings&&(t.decodeStrings=!0);null==t.validateEntrySizes&&(t.validateEntrySizes=!0);null==t.strictFileNames&&(t.strictFileNames=!1);!function(e,t,n,r){"function"==typeof n&&(r=n,n=null);null==n&&(n={});null==n.autoClose&&(n.autoClose=!0);null==n.lazyEntries&&(n.lazyEntries=!1);null==n.decodeStrings&&(n.decodeStrings=!0);var i=!!n.decodeStrings;null==n.validateEntrySizes&&(n.validateEntrySizes=!0);null==n.strictFileNames&&(n.strictFileNames=!1);null==r&&(r=xe);if("number"!=typeof t)throw new Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER)throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");e.ref();var o=Math.min(65557,t),s=we(o),a=t-s.length;me(e,s,0,o,a,(function(l){if(l)return r(l);for(var c=o-22;c>=0;c-=1)if(101010256===s.readUInt32LE(c)){var f=s.slice(c),u=f.readUInt16LE(4);if(0!==u)return r(new Error("multi-disk zip files are not supported: found disk number: "+u));var d=f.readUInt16LE(10),h=f.readUInt32LE(16),p=f.readUInt16LE(20),m=f.length-22;if(p!==m)return r(new Error("invalid comment length. expected: "+m+". found: "+p));var y=i?Ee(f,22,f.length,!1):f.slice(22);if(65535!==d&&4294967295!==h)return r(null,new ue(e,h,t,d,y,n.autoClose,n.lazyEntries,i,n.validateEntrySizes,n.strictFileNames));var g=we(20),v=a+c-g.length;return void me(e,g,0,g.length,v,(function(o){if(o)return r(o);if(117853008!==g.readUInt32LE(0))return r(new Error("invalid zip64 end of central directory locator signature"));var s=Se(g,8),a=we(56);me(e,a,0,a.length,s,(function(o){return o?r(o):101075792!==a.readUInt32LE(0)?r(new Error("invalid zip64 end of central directory record signature")):(d=Se(a,32),h=Se(a,48),r(null,new ue(e,h,t,d,y,n.autoClose,n.lazyEntries,i,n.validateEntrySizes,n.strictFileNames)))}))}))}r(new Error("end of central directory record signature not found"))}))}(Z.createFromBuffer(e,{maxChunkSize:65536}),e.length,t,n)};function ue(e,t,n,r,i,o,s,a,l,c){var f=this;se.call(f),f.reader=e,f.reader.on("error",(function(e){he(f,e)})),f.reader.once("close",(function(){f.emit("close")})),f.readEntryCursor=t,f.fileSize=n,f.entryCount=r,f.comment=i,f.entriesRead=0,f.autoClose=!!o,f.lazyEntries=!!s,f.decodeStrings=!!a,f.validateEntrySizes=!!l,f.strictFileNames=!!c,f.isOpen=!0,f.emittedError=!1,f.lazyEntries||f._readEntry()}function de(e,t){e.autoClose&&e.close(),he(e,t)}function he(e,t){e.emittedError||(e.emittedError=!0,e.emit("error",t))}function pe(){}function me(e,t,n,r,i,o){if(0===r)return setImmediate((function(){o(null,we(0))}));e.read(t,n,r,i,(function(e,t){return e?o(e):t<r?o(new Error("unexpected EOF")):void o()}))}function ye(e){ae.call(this),this.actualByteCount=0,this.expectedByteCount=e}function ge(){se.call(this),this.refCount=0}function ve(e){le.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}a.inherits(ue,se),ue.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())},ue.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()},ue.prototype._readEntry=function(){var e=this;if(e.entryCount!==e.entriesRead){if(!e.emittedError){var t=we(46);me(e.reader,t,0,t.length,e.readEntryCursor,(function(n){if(n)return de(e,n);if(!e.emittedError){var r=new pe,i=t.readUInt32LE(0);if(33639248!==i)return de(e,new Error("invalid central directory file header signature: 0x"+i.toString(16)));if(r.versionMadeBy=t.readUInt16LE(4),r.versionNeededToExtract=t.readUInt16LE(6),r.generalPurposeBitFlag=t.readUInt16LE(8),r.compressionMethod=t.readUInt16LE(10),r.lastModFileTime=t.readUInt16LE(12),r.lastModFileDate=t.readUInt16LE(14),r.crc32=t.readUInt32LE(16),r.compressedSize=t.readUInt32LE(20),r.uncompressedSize=t.readUInt32LE(24),r.fileNameLength=t.readUInt16LE(28),r.extraFieldLength=t.readUInt16LE(30),r.fileCommentLength=t.readUInt16LE(32),r.internalFileAttributes=t.readUInt16LE(36),r.externalFileAttributes=t.readUInt32LE(38),r.relativeOffsetOfLocalHeader=t.readUInt32LE(42),64&r.generalPurposeBitFlag)return de(e,new Error("strong encryption is not supported"));e.readEntryCursor+=46,t=we(r.fileNameLength+r.extraFieldLength+r.fileCommentLength),me(e.reader,t,0,t.length,e.readEntryCursor,(function(n){if(n)return de(e,n);if(!e.emittedError){var i=0!=(2048&r.generalPurposeBitFlag);r.fileName=e.decodeStrings?Ee(t,0,r.fileNameLength,i):t.slice(0,r.fileNameLength);var o=r.fileNameLength+r.extraFieldLength,s=t.slice(r.fileNameLength,o);r.extraFields=[];for(var a=0;a<s.length-3;){var l=s.readUInt16LE(a+0),c=s.readUInt16LE(a+2),f=a+4,u=f+c;if(u>s.length)return de(e,new Error("extra field length exceeds extra field buffer size"));var d=we(c);s.copy(d,0,f,u),r.extraFields.push({id:l,data:d}),a=u}if(r.fileComment=e.decodeStrings?Ee(t,o,o+r.fileCommentLength,i):t.slice(o,o+r.fileCommentLength),r.comment=r.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1,4294967295===r.uncompressedSize||4294967295===r.compressedSize||4294967295===r.relativeOffsetOfLocalHeader){var h=null;for(a=0;a<r.extraFields.length;a++){if(1===(m=r.extraFields[a]).id){h=m.data;break}}if(null==h)return de(e,new Error("expected zip64 extended information extra field"));var p=0;if(4294967295===r.uncompressedSize){if(p+8>h.length)return de(e,new Error("zip64 extended information extra field does not include uncompressed size"));r.uncompressedSize=Se(h,p),p+=8}if(4294967295===r.compressedSize){if(p+8>h.length)return de(e,new Error("zip64 extended information extra field does not include compressed size"));r.compressedSize=Se(h,p),p+=8}if(4294967295===r.relativeOffsetOfLocalHeader){if(p+8>h.length)return de(e,new Error("zip64 extended information extra field does not include relative header offset"));r.relativeOffsetOfLocalHeader=Se(h,p),p+=8}}if(e.decodeStrings)for(a=0;a<r.extraFields.length;a++){var m;if(28789===(m=r.extraFields[a]).id){if(m.data.length<6)continue;if(1!==m.data.readUInt8(0))continue;var y=m.data.readUInt32LE(1);if(oe.unsigned(t.slice(0,r.fileNameLength))!==y)continue;r.fileName=Ee(m.data,5,m.data.length,!0);break}}if(e.validateEntrySizes&&0===r.compressionMethod){var g=r.uncompressedSize;if(r.isEncrypted()&&(g+=12),r.compressedSize!==g){var v="compressed/uncompressed size mismatch for stored file: "+r.compressedSize+" != "+r.uncompressedSize;return de(e,new Error(v))}}if(e.decodeStrings){e.strictFileNames||(r.fileName=r.fileName.replace(/\\/g,"/"));var w=function(e){if(-1!==e.indexOf("\\"))return"invalid characters in fileName: "+e;if(/^[a-zA-Z]:/.test(e)||/^\//.test(e))return"absolute path: "+e;if(-1!==e.split("/").indexOf(".."))return"invalid relative path: "+e;return null}(r.fileName,e.validateFileNameOptions);if(null!=w)return de(e,new Error(w))}e.emit("entry",r),e.lazyEntries||e._readEntry()}}))}}))}}else setImmediate((function(){e.autoClose&&e.close(),e.emittedError||e.emit("end")}))},ue.prototype.openReadStream=function(e,t,n){var r=this,i=0,o=e.compressedSize;if(null==n)n=t,t={};else{if(null!=t.decrypt){if(!e.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(!1!==t.decrypt)throw new Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()&&!1!==t.decompress)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}if(null!=t.decompress){if(!e.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!1!==t.decompress&&!0!==t.decompress)throw new Error("invalid options.decompress value: "+t.decompress)}if(null!=t.start||null!=t.end){if(e.isCompressed()&&!1!==t.decompress)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(e.isEncrypted()&&!1!==t.decrypt)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(null!=t.start){if((i=t.start)<0)throw new Error("options.start < 0");if(i>e.compressedSize)throw new Error("options.start > entry.compressedSize")}if(null!=t.end){if((o=t.end)<0)throw new Error("options.end < 0");if(o>e.compressedSize)throw new Error("options.end > entry.compressedSize");if(o<i)throw new Error("options.end < options.start")}}if(!r.isOpen)return n(new Error("closed"));if(e.isEncrypted()&&!1!==t.decrypt)return n(new Error("entry is encrypted, and options.decrypt !== false"));r.reader.ref();var a=we(30);me(r.reader,a,0,a.length,e.relativeOffsetOfLocalHeader,(function(l){try{if(l)return n(l);var c=a.readUInt32LE(0);if(67324752!==c)return n(new Error("invalid local file header signature: 0x"+c.toString(16)));var f,u=a.readUInt16LE(26),d=a.readUInt16LE(28),h=e.relativeOffsetOfLocalHeader+a.length+u+d;if(0===e.compressionMethod)f=!1;else{if(8!==e.compressionMethod)return n(new Error("unsupported compression method: "+e.compressionMethod));f=null==t.decompress||t.decompress}var p=h,m=p+e.compressedSize;if(0!==e.compressedSize&&m>r.fileSize)return n(new Error("file data overflows file bounds: "+p+" + "+e.compressedSize+" > "+r.fileSize));var y=r.reader.createReadStream({start:p+i,end:p+o}),g=y;if(f){var v=!1,w=s.createInflateRaw();y.on("error",(function(e){setImmediate((function(){v||w.emit("error",e)}))})),y.pipe(w),r.validateEntrySizes?(g=new ye(e.uncompressedSize),w.on("error",(function(e){setImmediate((function(){v||g.emit("error",e)}))})),w.pipe(g)):g=w,g.destroy=function(){v=!0,w!==g&&w.unpipe(g),y.unpipe(w),y.destroy()}}n(null,g)}finally{r.reader.unref()}}))},pe.prototype.getLastModDate=function(){return e=this.lastModFileDate,t=this.lastModFileTime,new Date(1980+(e>>9&127),(e>>5&15)-1,31&e,t>>11&31,t>>5&63,2*(31&t),0);var e,t},pe.prototype.isEncrypted=function(){return 0!=(1&this.generalPurposeBitFlag)},pe.prototype.isCompressed=function(){return 8===this.compressionMethod},a.inherits(ye,ae),ye.prototype._transform=function(e,t,n){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var r="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return n(new Error(r))}n(null,e)},ye.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return e(new Error(t))}e()},a.inherits(ge,se),ge.prototype.ref=function(){this.refCount+=1},ge.prototype.unref=function(){var e=this;if(e.refCount-=1,!(e.refCount>0)){if(e.refCount<0)throw new Error("invalid unref");e.close((function(t){if(t)return e.emit("error",t);e.emit("close")}))}},ge.prototype.createReadStream=function(e){var t=e.start,n=e.end;if(t===n){var r=new le;return setImmediate((function(){r.end()})),r}var i=this._readStreamForRange(t,n),o=!1,s=new ve(this);i.on("error",(function(e){setImmediate((function(){o||s.emit("error",e)}))})),s.destroy=function(){i.unpipe(s),s.unref(),i.destroy()};var a=new ye(n-t);return s.on("error",(function(e){setImmediate((function(){o||a.emit("error",e)}))})),a.destroy=function(){o=!0,s.unpipe(a),s.destroy()},i.pipe(s).pipe(a)},ge.prototype._readStreamForRange=function(e,t){throw new Error("not implemented")},ge.prototype.read=function(e,t,n,r,i){var o=this.createReadStream({start:r,end:r+n}),s=new ce,a=0;s._write=function(n,r,i){n.copy(e,t+a,0,n.length),a+=n.length,i()},s.on("finish",i),o.on("error",(function(e){i(e)})),o.pipe(s)},ge.prototype.close=function(e){setImmediate(e)},a.inherits(ve,le),ve.prototype._flush=function(e){this.unref(),e()},ve.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var we;function Ee(e,t,n,r){if(r)return e.toString("utf8",t,n);for(var i="",o=t;o<n;o++)i+="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "[e[o]];return i}function Se(e,t){var n=e.readUInt32LE(t);return 4294967296*e.readUInt32LE(t+4)+n}function xe(e){if(e)throw e}function be(e,t){return new Promise((n,i)=>{fe(e,{lazyEntries:!0},function(e,t,n){return(i,s)=>{if(i)throw i;s.readEntry(),s.on("entry",t=>{let n;if(t.fileName.indexOf("/")>-1){const r=t.fileName.split("/");r[0]=e,n=r.join(o.sep)}else n=e+o.sep+t.fileName;n[n.length-1]===o.sep?s.readEntry():function e(t,n){if("."===t)return n();r.stat(t,i=>{if(null==i)return n();const s=o.dirname(t);e(s,()=>{r.mkdir(t,n)})})}(o.dirname(n),()=>{s.openReadStream(t,(e,t)=>{if(e)throw e;t.on("end",()=>{s.readEntry()}),t.pipe(r.createWriteStream(n))})})}),s.once("error",n),s.once("end",()=>{t()})}}(t,n,i))})}we="function"==typeof Buffer.allocUnsafe?function(e){return Buffer.allocUnsafe(e)}:function(e){return new Buffer(e)};const Ce=[];function ze(){Ce&&Ce.length>0&&Ce.forEach(e=>e.kill("SIGINT"))}var ke=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};!function(){ke(this,void 0,void 0,(function*(){const e=process.argv.slice(2),t=e.indexOf("--help")>=0||e.indexOf("-h")>=0;if(e.indexOf("--info")>=0)return console.log("create-deckdeckgo:",require("../package.json").version,"\n"),0;if(t)return console.log("Usage:\nnpm init deckdeckgo\n"),0;!function(){try{const e=process.version.replace("v","").split("."),t=parseInt(e[0],10),n=parseInt(e[1],10);(t<8||8===t&&n<9)&&console.log(v(`Your current version of Node is ${process.version}, however the recommendation is a minimum of Node 8.x LTS.`))}catch(e){console.error(`\n${g("✖")} ${e.message}\n`)}}();try{const e=[{type:"input",name:"folder",message:"What's your project name (will be use to create a new folder)?",default:"deckdeckgo",validate:e=>!!(e&&e.length>0)||"Please provide a presentation's name"},{type:"input",name:"title",message:"What's your presentation name (max. 45 characters, will be use for meta tags and manifest information)?",default:"DeckDeckGo",validate:e=>!!(e&&e.length>0&&e.length<=45)||"Your presentation's name should be at least one character and max. 45"},{type:"input",name:"description",message:"What's your presentation about (its description)?",default:"Create a lightweight presentation using Web Components 🚀"},{type:"input",name:"author",message:"What's your name (will be use for the author meta information)?",default:"David"},{type:"list",name:"editing",message:"What method do you want to use to edit your presentation?",choices:["HTML","Markdown"],default:0}];console.log("\nCool, let's kick start a new "+w("DeckDeckGo")+" presentation\n"),require("inquirer").prompt(e).then(e=>ke(this,void 0,void 0,(function*(){console.log("\nYour inputs:\n"),console.log(JSON.stringify(e,null," ")+"\n"),yield function(e){return new Promise((t,n)=>ke(this,void 0,void 0,(function*(){try{yield function(e){return new Promise((t,n)=>ke(this,void 0,void 0,(function*(){try{const n=new k(y("[1/3] Creating your presentation..."));n.setSpinnerString(18),n.start(),function e(t){r.existsSync(t)&&(r.readdirSync(t).forEach(n=>{const o=i.join(t,n);r.lstatSync(o).isDirectory()?e(o):r.unlinkSync(o)}),r.rmdirSync(t))}(e.folder);const o=yield"Markdown"===e.editing?I("https://github.com/deckgo/deckdeckgo-starter/archive/markdown.zip"):I("https://github.com/deckgo/deckdeckgo-starter/archive/master.zip");yield be(o,e.folder),n.stop(!0),t()}catch(e){n(e)}})))}(e),yield function(e){return new Promise((t,n)=>ke(this,void 0,void 0,(function*(){try{const n=new k(y("[2/3] Installing dependencies..."));n.setSpinnerString(18),n.start(),yield function(e,t,n="ignore"){return new Promise((r,i)=>{const o=u.spawn("npm",[e],{shell:!0,stdio:n,cwd:t});o.once("exit",()=>r()),o.once("error",i),Ce.push(o)})}("ci",e.folder),n.stop(!0),t()}catch(e){n(e)}})))}(e),yield function(e){return new Promise((t,n)=>ke(this,void 0,void 0,(function*(){try{const n=new k(y("[3/3] Updating presentation..."));n.setSpinnerString(18),n.start(),function(e){const t=[e.folder+"/src/index.html",e.folder+"/src/manifest.json",e.folder+"/webpack.config.js"];"Markdown"===e.editing&&t.push(e.folder+"/src/index.md");const n=require("replace");n({regex:"{{DECKDECKGO_TITLE}}",replacement:e.title,paths:t,recursive:!1,silent:!0}),n({regex:"{{DECKDECKGO_SHORT_NAME}}",replacement:e.title&&e.title.length>12?e.title.substr(0,12):e.title,paths:t,recursive:!1,silent:!0}),n({regex:"{{DECKDECKGO_DESCRIPTION}}",replacement:e.description,paths:t,recursive:!1,silent:!0}),n({regex:"{{DECKDECKGO_AUTHOR}}",replacement:e.description,paths:t,recursive:!1,silent:!0})}(e),n.stop(!0),t()}catch(e){n(e)}})))}(e),t()}catch(e){n(e)}})))}(e),console.log("Coolio, Your presentation is initialized.\n"),yield N(e.folder),console.log("\nTo develop your slides, edit "+w(e.folder+("Markdown"===e.editing?"/src/index.md":"/src/index.html"))+"\n"),console.log("Run "+w("npm run start")+" in the newly created folder "+w(e.folder)+" to serve your presentation locally at the address "+w("http://localhost:3000")+"\n"),console.log("Find this presentation in the remote control with the keyword: "+w(e.title)+"\n"),console.log("If you rather like not to use the remote control while developing your deck, run "+w("npm run start-no-remote")+" instead of the previous command\n"),console.log('Dive deeper with the "Getting Started" guide at '+w("https://docs.deckdeckgo.com")+"\n")})))}catch(e){console.error(`\n${g("✖")} ${e.message}\n`)}ze()}))}(); | ||
var e=require("readline"),t=require("https"),n=require("fs"),r=require("path"),i=require("zlib"),o=require("util"),s=require("stream"),a=require("events"),l=require("buffer"),f=require("child_process");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(e),d=u(n),p=u(r),h=u(i),m=u(o),y=u(s),g=u(a),v=u(l);let w=!("NO_COLOR"in process.env)&&("FORCE_COLOR"in process.env||"win32"===process.platform||null!=process.stdout&&process.stdout.isTTY&&process.env.TERM&&"dumb"!==process.env.TERM);const E=(e,t,n,r)=>i=>w?e+(~(i+="").indexOf(t,4)?i.replace(n,r):i)+t:i,S=(e,t)=>E(`[${e}m`,`[${t}m`,new RegExp(`\\x1b\\[${t}m`,"g"),`[${e}m`),x=(Object.defineProperty({},"enabled",{get:()=>w,set:e=>w=e}),E("[1m","[22m",/\x1b\[22m/g,"[22m[1m")),C=S(31,39),b=S(33,39),z=S(36,39);var L,k=(L=Object.freeze({__proto__:null,default:["|/-\\","⠂-–—–-","◐◓◑◒","◴◷◶◵","◰◳◲◱","▖▘▝▗","■□▪▫","▌▀▐▄","▉▊▋▌▍▎▏▎▍▌▋▊▉","▁▃▄▅▆▇█▇▆▅▄▃","←↖↑↗→↘↓↙","┤┘┴└├┌┬┐","◢◣◤◥",".oO°Oo.",".oO@*",["🌍","🌎","🌏"],"◡◡ ⊙⊙ ◠◠","☱☲☴","⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏","⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓","⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆","⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋","⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁","⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈","⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈","⢄⢂⢁⡁⡈⡐⡠","⢹⢺⢼⣸⣇⡧⡗⡏","⣾⣽⣻⢿⡿⣟⣯⣷","⠁⠂⠄⡀⢀⠠⠐⠈",["🌑","🌒","🌓","🌔","🌕","🌝","🌖","🌗","🌘","🌚"],["🕛","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚"]]}))&&L.default||L,I=0,O=60;function N(e){this.clearLine(this.stream),this.stream.write(e)}var U=function(e){if(!(this instanceof U))return new U(e);"string"==typeof e?e={text:e}:e||(e={}),this.text=e.text||"",this.setSpinnerString(I),this.setSpinnerDelay(O),this.onTick=e.onTick||N,this.stream=e.stream||process.stdout};U.spinners=k,U.setDefaultSpinnerString=function(e){return I=e,this},U.setDefaultSpinnerDelay=function(e){return O=e,this},U.prototype.start=function(){if(this.stream===process.stdout&&!0!==this.stream.isTTY)return this;var e=0,t=this,n=function(){var n=t.text.indexOf("%s")>-1?t.text.replace("%s",t.chars[e]):t.chars[e]+" "+t.text;t.onTick(n),e=++e%t.chars.length};return n(),this.id=setInterval(n,this.delay),this},U.prototype.isSpinning=function(){return void 0!==this.id},U.prototype.setSpinnerDelay=function(e){return this.delay=e,this},U.prototype.setSpinnerString=function(e){const t=function(e,t){if(!function(e){return"number"==typeof e&&e%1==0}(e))return e+"";var n=U.spinners.length;return e=(e=e>=n?0:e)<0?n+e:e,U.spinners[e]}(e,this.spinners);return this.chars=Array.isArray(t)?t:t.split(""),this},U.prototype.setSpinnerTitle=function(e){return this.text=e,this},U.prototype.stop=function(e){return!1===this.isSpinning||(clearInterval(this.id),this.id=void 0,e&&this.clearLine(this.stream)),this},U.prototype.clearLine=function(e){return c.default.clearLine(e,0),c.default.cursorTo(e,0),this};var F=U,P=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function M(e,n={}){return new Promise((r,i)=>{t.get(e,n,e=>{if(302===e.statusCode)M(e.headers.location).then(r,i);else{const t=[];e.on("data",e=>t.push(e)),e.on("end",()=>{r(Buffer.concat(t))}),e.on("error",i)}})})}function T(e,n,r){return new Promise((i,o)=>P(this,void 0,void 0,(function*(){const s=d.default.createWriteStream(n+p.default.sep+r);s.on("open",()=>{t.get(e,e=>{e.on("error",e=>{o(e)}),e.pipe(s)})}).on("error",e=>{o(e)}).on("finish",()=>{i()})})))}var _=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function B(e){return new Promise((t,n)=>_(this,void 0,void 0,(function*(){try{const n=require("inquirer"),r=[{type:"confirm",name:"font",message:"Do you want to use a Google Font for your presentation?",default:!1}];if((yield n.prompt(r)).font){const t=yield function(){return new Promise((e,t)=>_(this,void 0,void 0,(function*(){const n=new F(x("Fetching fonts list..."));n.setSpinnerString(18),n.start();try{let t=null;const r=yield function(){return new Promise((e,t)=>_(this,void 0,void 0,(function*(){try{const n=yield M("https://api.deckdeckgo.com/googlefonts/");if(n){const t=JSON.parse(n.toString("utf8"));if(t&&t.key&&t.key.length>0)return void e(t.key)}t("No Google Fonts key found")}catch(e){t(e)}})))}(),i=yield function(e){return M("https://www.googleapis.com/webfonts/v1/webfonts?key="+e)}(r);i&&(t=JSON.parse(i.toString("utf8"))),n.stop(!0),e(t)}catch(e){n.stop(!0),t(e)}})))}();if(t&&t.items&&t.items.length>0){const n=yield function(e){return new Promise((t,n)=>_(this,void 0,void 0,(function*(){try{let n,r=!0;for(;r;){const t=yield q(e),i=yield W(t);n=i.font,r=i.searchAgain}t(n)}catch(e){n(e)}})))}(t);if(n){const t=yield function(e){return new Promise((t,n)=>_(this,void 0,void 0,(function*(){try{if(!e||!e.subsets||e.subsets.length<=0)return void t(void 0);if(1===e.subsets.length)return void t(e.subsets);const n=require("inquirer"),r=[{type:"checkbox",name:"fontSubsets",message:"Select charsets",choices:e.subsets,default:["latin"]}],i=yield n.prompt(r);t(i.fontSubsets)}catch(e){n(e)}})))}(n),r=yield function(e){return new Promise((t,n)=>_(this,void 0,void 0,(function*(){try{if(!e||!e.variants||e.variants.length<=0)return void t(void 0);const n=require("inquirer"),r=[{type:"checkbox",name:"fontVariants",message:"Select styles",choices:e.variants,default:["regular"]}],i=yield n.prompt(r);t(i.fontVariants)}catch(e){n(e)}})))}(n),i=yield function(e,t,n){return new Promise((r,i)=>_(this,void 0,void 0,(function*(){const o=new F(x("Downloading font..."));o.setSpinnerString(18),o.start();try{if(e&&t&&t.length>0&&n&&n.length>0){const i=[];i.push(D(e.family,n,t,"Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)")),i.push(D(e.family,n,t,"Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36")),i.push(D(e.family,n,t,"Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)")),i.push(D(e.family,n,t,"Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_2; en-gb) AppleWebKit/526+ (KHTML, like Gecko) Version/3.1 iPhone")),i.push(D(e.family,n,t,"Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3"));const o=yield Promise.all(i);o&&o.length>0?r({eot:o[0],woff2:o.length>1?o[1]:null,woff:o.length>2?o[2]:null,ttf:o.length>3?o[3]:null,svg:o.length>4?o[4]:null}):r(null)}else console.log("No font to fetch.\n");o.stop(!0),r()}catch(e){o.stop(!0),console.error(e),i(e)}})))}(n,r,t),o=yield function(e,t){return new Promise((n,r)=>_(this,void 0,void 0,(function*(){if(!e||!t)return void n(null);if(!(t.eot||t.woff2||t.woff||t.ttf||t.svg))return void n(null);const i=new F(x("Downloading font..."));i.setSpinnerString(18),i.start();try{yield function(e){return new Promise(t=>{d.default.existsSync(e)||d.default.mkdirSync(e),t()})}(e);const r=[];r.push(R(e,t.eot)),r.push(R(e,t.woff2)),r.push(R(e,t.woff)),r.push(R(e,t.ttf)),r.push(R(e,t.svg));const o=yield Promise.all(r);o&&o.length>0?n({eot:o[0],woff2:o.length>1?o[1]:null,woff:o.length>2?o[2]:null,ttf:o.length>3?o[3]:null,svg:o.length>4?o[4]:null}):n(null),i.stop(!0),n(t)}catch(e){i.stop(!0),console.error(e),r(e)}})))}(e+"/src/assets/fonts/",i);yield function(e,t,n){return new Promise((r,i)=>_(this,void 0,void 0,(function*(){if(!(e&&t&&t.family&&n))return void r();const o=new F(x("Writing to CSS files..."));o.setSpinnerString(18),o.start();try{yield function(e,t,n){return new Promise((r,i)=>_(this,void 0,void 0,(function*(){try{let o="";if(n.eot&&(o+=n.eot),n.woff2&&(o+=n.woff2),n.woff&&(o+=n.woff),n.ttf&&(o+=n.ttf),n.svg&&(o+=n.svg),!o||0===o.length)return void r();o+=function(e){let t="\n:root {\n";return t+=`--ion-font-family: "${e}";\n`,t+="}\n\n* {\n",t+=`font-family: "${e}";\n`,t+=`--ion-font-family: "${e}";\n`,t+="}\n",t}(t),d.default.writeFile(e,o,e=>{e?i(e):r()})}catch(e){i(e)}})))}(e+"/src/css/google-fonts.css",t.family,n),yield function(e){return new Promise((t,n)=>_(this,void 0,void 0,(function*(){try{d.default.appendFile(e,"\n\nimport './css/google-fonts.css';",e=>{e?n(e):t()}),t()}catch(e){n(e)}})))}(e+"/src/index.js"),o.stop(!0),r()}catch(e){o.stop(!0),i(e)}})))}(e,n,o)}}}t()}catch(e){n(e)}})))}function D(e,t,n,r){return new Promise((i,o)=>_(this,void 0,void 0,(function*(){try{let o=null;const s=yield function(e,t,n,r){return M(`https://fonts.googleapis.com/css?family=${e}:${t.join(",")}&subset=${n.join(",")}`,{headers:{"User-Agent":r}})}(e,n,t,r);s&&(o=s.toString("utf8")),i(o)}catch(e){o(e)}})))}function R(e,t){return new Promise((n,r)=>_(this,void 0,void 0,(function*(){if(!t||t.length<=0)n(null);else try{let r=t;const i=/(url\()(.*?)(\))/gm;let o;for(;o=i.exec(t);)if(o&&o.length>=2){const t=o[0],n=o[2],i=/(?:.+\/)(.+)/gm.exec(n);if(i&&i.length>=1){let o=i[1];const s=/(kit=)(.*?)(&)/gm.exec(n);s&&s.length>=2&&(o=s[2]+".svg"),yield T(n,e,o),r=r.replace(t,`url(/assets/fonts/${o})`)}}n(r)}catch(e){r(e)}})))}function W(e){return new Promise((t,n)=>_(this,void 0,void 0,(function*(){try{const n=require("inquirer");let r;e&&e.length>0&&(r=e.map(e=>e.family)),(!r||r.length<=0)&&(r=[]);const i=r.length>0?"Select the font":"No font found";r.push("Search again","Skip");const o=[{type:"list",name:"fontName",message:i,choices:r}],s=yield n.prompt(o);if(s&&"Search again"===s.fontName)t({searchAgain:!0});else if(s&&"Skip"===s.fontName)t({searchAgain:!1});else if(e&&e.length>0){const n=e.find(e=>e.family&&e.family.toLowerCase().indexOf(s.fontName.toLowerCase())>-1);t({searchAgain:!1,font:n})}else t({searchAgain:!1})}catch(e){n(e)}})))}function q(e){return new Promise((t,n)=>_(this,void 0,void 0,(function*(){try{const n=require("inquirer"),r=[{type:"input",name:"fontName",message:"Search a Google font (min. 3 characters)?",validate:e=>!!(e&&e.length>=3)||"Please provide at least 3 characters for the font's family name"}],i=yield n.prompt(r),o=e.items.filter(e=>e.family&&e.family.toLowerCase().indexOf(i.fontName.toLowerCase())>-1);t(o)}catch(e){n(e)}})))}var A=G;function G(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}function $(e){e.pending+=1;var t=!1;return function(r){if(t)throw new Error("callback called twice");if(t=!0,e.error=e.error||r,e.pending-=1,e.waiting.length>0&&e.pending<e.max)K(e,e.waiting.shift());else if(0===e.pending){var i=e.listeners;e.listeners=[],i.forEach(n)}};function n(t){t(e.error)}}function K(e,t){t($(e))}G.prototype.go=function(e){this.pending<this.max?K(this,e):this.waiting.push(e)},G.prototype.wait=function(e){0===this.pending?e(this.error):this.listeners.push(e)},G.prototype.hold=function(){return $(this)};var j=y.default.Readable,H=y.default.Writable,Y=y.default.PassThrough,X=g.default.EventEmitter,J=function(e,t){return new re(e,t)},V=function(e,t){return new ee(e,t)},Z=re,Q=ee;function ee(e,t){t=t||{},X.call(this),this.fd=e,this.pend=new A,this.pend.max=1,this.refCount=0,this.autoClose=!!t.autoClose}function te(e,t){t=t||{},j.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start,this.destroyed=!1}function ne(e,t){t=t||{},H.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=null==t.end?1/0:+t.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}function re(e,t){X.call(this),t=t||{},this.refCount=0,this.buffer=e,this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}m.default.inherits(ee,X),ee.prototype.read=function(e,t,n,r,i){var o=this;o.pend.go((function(s){d.default.read(o.fd,e,t,n,r,(function(e,t,n){s(),i(e,t,n)}))}))},ee.prototype.write=function(e,t,n,r,i){var o=this;o.pend.go((function(s){d.default.write(o.fd,e,t,n,r,(function(e,t,n){s(),i(e,t,n)}))}))},ee.prototype.createReadStream=function(e){return new te(this,e)},ee.prototype.createWriteStream=function(e){return new ne(this,e)},ee.prototype.ref=function(){this.refCount+=1},ee.prototype.unref=function(){var e=this;if(e.refCount-=1,!(e.refCount>0)){if(e.refCount<0)throw new Error("invalid unref");e.autoClose&&d.default.close(e.fd,(function(t){t?e.emit("error",t):e.emit("close")}))}},m.default.inherits(te,j),te.prototype._read=function(e){var t=this;if(!t.destroyed){var n=Math.min(t._readableState.highWaterMark,e);if(null!=t.endOffset&&(n=Math.min(n,t.endOffset-t.pos)),n<=0)return t.destroyed=!0,t.push(null),void t.context.unref();t.context.pend.go((function(e){if(t.destroyed)return e();var r=new Buffer(n);d.default.read(t.context.fd,r,0,n,t.pos,(function(n,i){n?t.destroy(n):0===i?(t.destroyed=!0,t.push(null),t.context.unref()):(t.pos+=i,t.push(r.slice(0,i))),e()}))}))}},te.prototype.destroy=function(e){this.destroyed||(e=e||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",e),this.context.unref())},m.default.inherits(ne,H),ne.prototype._write=function(e,t,n){var r=this;if(!r.destroyed){if(r.pos+e.length>r.endOffset){var i=new Error("maximum file length exceeded");return i.code="ETOOBIG",r.destroy(),void n(i)}r.context.pend.go((function(t){if(r.destroyed)return t();d.default.write(r.context.fd,e,0,e.length,r.pos,(function(e,i){e?(r.destroy(),t(),n(e)):(r.bytesWritten+=i,r.pos+=i,r.emit("progress"),t(),n())}))}))}},ne.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())},m.default.inherits(re,X),re.prototype.read=function(e,t,n,r,i){var o=r+n,s=o-this.buffer.length,a=s>0?s:n;this.buffer.copy(e,t,r,o),setImmediate((function(){i(null,a)}))},re.prototype.write=function(e,t,n,r,i){e.copy(this.buffer,r,t,t+n),setImmediate((function(){i(null,n,e)}))},re.prototype.createReadStream=function(e){var t=new Y(e=e||{});t.destroyed=!1,t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var n=this.buffer.slice(t.start,t.pos),r=0;;){var i=r+this.maxChunkSize;if(i>=n.length){r<n.length&&t.write(n.slice(r,n.length));break}t.write(n.slice(r,i)),r=i}return t.end(),t.destroy=function(){t.destroyed=!0},t},re.prototype.createWriteStream=function(e){var t=this,n=new H(e=e||{});return n.start=e.start||0,n.endOffset=null==e.end?this.buffer.length:+e.end,n.bytesWritten=0,n.pos=n.start,n.destroyed=!1,n._write=function(e,r,i){if(!n.destroyed){var o=n.pos+e.length;if(o>n.endOffset){var s=new Error("maximum file length exceeded");return s.code="ETOOBIG",n.destroyed=!0,void i(s)}e.copy(t.buffer,n.pos,0,e.length),n.bytesWritten+=e.length,n.pos=o,n.emit("progress"),i()}},n.destroy=function(){n.destroyed=!0},n},re.prototype.ref=function(){this.refCount+=1},re.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};var ie={createFromBuffer:J,createFromFd:V,BufferSlicer:Z,FdSlicer:Q},oe=v.default.Buffer,se=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function ae(e){if(oe.isBuffer(e))return e;var t="function"==typeof oe.alloc&&"function"==typeof oe.from;if("number"==typeof e)return t?oe.alloc(e):new oe(e);if("string"==typeof e)return t?oe.from(e):new oe(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function le(e){var t=ae(4);return t.writeInt32BE(e,0),t}function fe(e,t){e=ae(e),oe.isBuffer(t)&&(t=t.readUInt32BE(0));for(var n=-1^~~t,r=0;r<e.length;r++)n=se[255&(n^e[r])]^n>>>8;return-1^n}function ue(){return le(fe.apply(null,arguments))}"undefined"!=typeof Int32Array&&(se=new Int32Array(se)),ue.signed=function(){return fe.apply(null,arguments)},ue.unsigned=function(){return fe.apply(null,arguments)>>>0};var ce=ue,de=g.default.EventEmitter,pe=y.default.Transform,he=y.default.PassThrough,me=y.default.Writable,ye=function(e,t,n){"function"==typeof t&&(n=t,t=null);null==t&&(t={});t.autoClose=!1,null==t.lazyEntries&&(t.lazyEntries=!1);null==t.decodeStrings&&(t.decodeStrings=!0);null==t.validateEntrySizes&&(t.validateEntrySizes=!0);null==t.strictFileNames&&(t.strictFileNames=!1);!function(e,t,n,r){"function"==typeof n&&(r=n,n=null);null==n&&(n={});null==n.autoClose&&(n.autoClose=!0);null==n.lazyEntries&&(n.lazyEntries=!1);null==n.decodeStrings&&(n.decodeStrings=!0);var i=!!n.decodeStrings;null==n.validateEntrySizes&&(n.validateEntrySizes=!0);null==n.strictFileNames&&(n.strictFileNames=!1);null==r&&(r=Ie);if("number"!=typeof t)throw new Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER)throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");e.ref();var o=22,s=65535,a=Math.min(o+s,t),l=ze(a),f=t-l.length;Se(e,l,0,a,f,(function(s){if(s)return r(s);for(var u=a-o;u>=0;u-=1)if(101010256===l.readUInt32LE(u)){var c=l.slice(u),d=c.readUInt16LE(4);if(0!==d)return r(new Error("multi-disk zip files are not supported: found disk number: "+d));var p=c.readUInt16LE(10),h=c.readUInt32LE(16),m=c.readUInt16LE(20),y=c.length-o;if(m!==y)return r(new Error("invalid comment length. expected: "+y+". found: "+m));var g=i?Le(c,22,c.length,!1):c.slice(22);if(65535!==p&&4294967295!==h)return r(null,new ge(e,h,t,p,g,n.autoClose,n.lazyEntries,i,n.validateEntrySizes,n.strictFileNames));var v=ze(20),w=f+u-v.length;return void Se(e,v,0,v.length,w,(function(o){if(o)return r(o);if(117853008!==v.readUInt32LE(0))return r(new Error("invalid zip64 end of central directory locator signature"));var s=ke(v,8),a=ze(56);Se(e,a,0,a.length,s,(function(o){return o?r(o):101075792!==a.readUInt32LE(0)?r(new Error("invalid zip64 end of central directory record signature")):(p=ke(a,32),h=ke(a,48),r(null,new ge(e,h,t,p,g,n.autoClose,n.lazyEntries,i,n.validateEntrySizes,n.strictFileNames)))}))}))}r(new Error("end of central directory record signature not found"))}))}(ie.createFromBuffer(e,{maxChunkSize:65536}),e.length,t,n)};function ge(e,t,n,r,i,o,s,a,l,f){var u=this;de.call(u),u.reader=e,u.reader.on("error",(function(e){we(u,e)})),u.reader.once("close",(function(){u.emit("close")})),u.readEntryCursor=t,u.fileSize=n,u.entryCount=r,u.comment=i,u.entriesRead=0,u.autoClose=!!o,u.lazyEntries=!!s,u.decodeStrings=!!a,u.validateEntrySizes=!!l,u.strictFileNames=!!f,u.isOpen=!0,u.emittedError=!1,u.lazyEntries||u._readEntry()}function ve(e,t){e.autoClose&&e.close(),we(e,t)}function we(e,t){e.emittedError||(e.emittedError=!0,e.emit("error",t))}function Ee(){}function Se(e,t,n,r,i,o){if(0===r)return setImmediate((function(){o(null,ze(0))}));e.read(t,n,r,i,(function(e,t){return e?o(e):t<r?o(new Error("unexpected EOF")):void o()}))}function xe(e){pe.call(this),this.actualByteCount=0,this.expectedByteCount=e}function Ce(){de.call(this),this.refCount=0}function be(e){he.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}m.default.inherits(ge,de),ge.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())},ge.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()},ge.prototype._readEntry=function(){var e=this;if(e.entryCount!==e.entriesRead){if(!e.emittedError){var t=ze(46);Se(e.reader,t,0,t.length,e.readEntryCursor,(function(n){if(n)return ve(e,n);if(!e.emittedError){var r=new Ee,i=t.readUInt32LE(0);if(33639248!==i)return ve(e,new Error("invalid central directory file header signature: 0x"+i.toString(16)));if(r.versionMadeBy=t.readUInt16LE(4),r.versionNeededToExtract=t.readUInt16LE(6),r.generalPurposeBitFlag=t.readUInt16LE(8),r.compressionMethod=t.readUInt16LE(10),r.lastModFileTime=t.readUInt16LE(12),r.lastModFileDate=t.readUInt16LE(14),r.crc32=t.readUInt32LE(16),r.compressedSize=t.readUInt32LE(20),r.uncompressedSize=t.readUInt32LE(24),r.fileNameLength=t.readUInt16LE(28),r.extraFieldLength=t.readUInt16LE(30),r.fileCommentLength=t.readUInt16LE(32),r.internalFileAttributes=t.readUInt16LE(36),r.externalFileAttributes=t.readUInt32LE(38),r.relativeOffsetOfLocalHeader=t.readUInt32LE(42),64&r.generalPurposeBitFlag)return ve(e,new Error("strong encryption is not supported"));e.readEntryCursor+=46,t=ze(r.fileNameLength+r.extraFieldLength+r.fileCommentLength),Se(e.reader,t,0,t.length,e.readEntryCursor,(function(n){if(n)return ve(e,n);if(!e.emittedError){var i=0!=(2048&r.generalPurposeBitFlag);r.fileName=e.decodeStrings?Le(t,0,r.fileNameLength,i):t.slice(0,r.fileNameLength);var o=r.fileNameLength+r.extraFieldLength,s=t.slice(r.fileNameLength,o);r.extraFields=[];for(var a=0;a<s.length-3;){var l=s.readUInt16LE(a+0),f=s.readUInt16LE(a+2),u=a+4,c=u+f;if(c>s.length)return ve(e,new Error("extra field length exceeds extra field buffer size"));var d=ze(f);s.copy(d,0,u,c),r.extraFields.push({id:l,data:d}),a=c}if(r.fileComment=e.decodeStrings?Le(t,o,o+r.fileCommentLength,i):t.slice(o,o+r.fileCommentLength),r.comment=r.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1,4294967295===r.uncompressedSize||4294967295===r.compressedSize||4294967295===r.relativeOffsetOfLocalHeader){var p=null;for(a=0;a<r.extraFields.length;a++){if(1===(m=r.extraFields[a]).id){p=m.data;break}}if(null==p)return ve(e,new Error("expected zip64 extended information extra field"));var h=0;if(4294967295===r.uncompressedSize){if(h+8>p.length)return ve(e,new Error("zip64 extended information extra field does not include uncompressed size"));r.uncompressedSize=ke(p,h),h+=8}if(4294967295===r.compressedSize){if(h+8>p.length)return ve(e,new Error("zip64 extended information extra field does not include compressed size"));r.compressedSize=ke(p,h),h+=8}if(4294967295===r.relativeOffsetOfLocalHeader){if(h+8>p.length)return ve(e,new Error("zip64 extended information extra field does not include relative header offset"));r.relativeOffsetOfLocalHeader=ke(p,h),h+=8}}if(e.decodeStrings)for(a=0;a<r.extraFields.length;a++){var m;if(28789===(m=r.extraFields[a]).id){if(m.data.length<6)continue;if(1!==m.data.readUInt8(0))continue;var y=m.data.readUInt32LE(1);if(ce.unsigned(t.slice(0,r.fileNameLength))!==y)continue;r.fileName=Le(m.data,5,m.data.length,!0);break}}if(e.validateEntrySizes&&0===r.compressionMethod){var g=r.uncompressedSize;if(r.isEncrypted()&&(g+=12),r.compressedSize!==g){var v="compressed/uncompressed size mismatch for stored file: "+r.compressedSize+" != "+r.uncompressedSize;return ve(e,new Error(v))}}if(e.decodeStrings){e.strictFileNames||(r.fileName=r.fileName.replace(/\\/g,"/"));var w=function(e){if(-1!==e.indexOf("\\"))return"invalid characters in fileName: "+e;if(/^[a-zA-Z]:/.test(e)||/^\//.test(e))return"absolute path: "+e;if(-1!==e.split("/").indexOf(".."))return"invalid relative path: "+e;return null}(r.fileName,e.validateFileNameOptions);if(null!=w)return ve(e,new Error(w))}e.emit("entry",r),e.lazyEntries||e._readEntry()}}))}}))}}else setImmediate((function(){e.autoClose&&e.close(),e.emittedError||e.emit("end")}))},ge.prototype.openReadStream=function(e,t,n){var r=this,i=0,o=e.compressedSize;if(null==n)n=t,t={};else{if(null!=t.decrypt){if(!e.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(!1!==t.decrypt)throw new Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()&&!1!==t.decompress)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}if(null!=t.decompress){if(!e.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!1!==t.decompress&&!0!==t.decompress)throw new Error("invalid options.decompress value: "+t.decompress)}if(null!=t.start||null!=t.end){if(e.isCompressed()&&!1!==t.decompress)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(e.isEncrypted()&&!1!==t.decrypt)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(null!=t.start){if((i=t.start)<0)throw new Error("options.start < 0");if(i>e.compressedSize)throw new Error("options.start > entry.compressedSize")}if(null!=t.end){if((o=t.end)<0)throw new Error("options.end < 0");if(o>e.compressedSize)throw new Error("options.end > entry.compressedSize");if(o<i)throw new Error("options.end < options.start")}}if(!r.isOpen)return n(new Error("closed"));if(e.isEncrypted()&&!1!==t.decrypt)return n(new Error("entry is encrypted, and options.decrypt !== false"));r.reader.ref();var s=ze(30);Se(r.reader,s,0,s.length,e.relativeOffsetOfLocalHeader,(function(a){try{if(a)return n(a);var l=s.readUInt32LE(0);if(67324752!==l)return n(new Error("invalid local file header signature: 0x"+l.toString(16)));var f,u=s.readUInt16LE(26),c=s.readUInt16LE(28),d=e.relativeOffsetOfLocalHeader+s.length+u+c;if(0===e.compressionMethod)f=!1;else{if(8!==e.compressionMethod)return n(new Error("unsupported compression method: "+e.compressionMethod));f=null==t.decompress||t.decompress}var p=d,m=p+e.compressedSize;if(0!==e.compressedSize&&m>r.fileSize)return n(new Error("file data overflows file bounds: "+p+" + "+e.compressedSize+" > "+r.fileSize));var y=r.reader.createReadStream({start:p+i,end:p+o}),g=y;if(f){var v=!1,w=h.default.createInflateRaw();y.on("error",(function(e){setImmediate((function(){v||w.emit("error",e)}))})),y.pipe(w),r.validateEntrySizes?(g=new xe(e.uncompressedSize),w.on("error",(function(e){setImmediate((function(){v||g.emit("error",e)}))})),w.pipe(g)):g=w,g.destroy=function(){v=!0,w!==g&&w.unpipe(g),y.unpipe(w),y.destroy()}}n(null,g)}finally{r.reader.unref()}}))},Ee.prototype.getLastModDate=function(){return e=this.lastModFileDate,t=this.lastModFileTime,new Date(1980+(e>>9&127),(e>>5&15)-1,31&e,t>>11&31,t>>5&63,2*(31&t),0);var e,t},Ee.prototype.isEncrypted=function(){return 0!=(1&this.generalPurposeBitFlag)},Ee.prototype.isCompressed=function(){return 8===this.compressionMethod},m.default.inherits(xe,pe),xe.prototype._transform=function(e,t,n){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var r="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return n(new Error(r))}n(null,e)},xe.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return e(new Error(t))}e()},m.default.inherits(Ce,de),Ce.prototype.ref=function(){this.refCount+=1},Ce.prototype.unref=function(){var e=this;if(e.refCount-=1,!(e.refCount>0)){if(e.refCount<0)throw new Error("invalid unref");e.close((function(t){if(t)return e.emit("error",t);e.emit("close")}))}},Ce.prototype.createReadStream=function(e){var t=e.start,n=e.end;if(t===n){var r=new he;return setImmediate((function(){r.end()})),r}var i=this._readStreamForRange(t,n),o=!1,s=new be(this);i.on("error",(function(e){setImmediate((function(){o||s.emit("error",e)}))})),s.destroy=function(){i.unpipe(s),s.unref(),i.destroy()};var a=new xe(n-t);return s.on("error",(function(e){setImmediate((function(){o||a.emit("error",e)}))})),a.destroy=function(){o=!0,s.unpipe(a),s.destroy()},i.pipe(s).pipe(a)},Ce.prototype._readStreamForRange=function(e,t){throw new Error("not implemented")},Ce.prototype.read=function(e,t,n,r,i){var o=this.createReadStream({start:r,end:r+n}),s=new me,a=0;s._write=function(n,r,i){n.copy(e,t+a,0,n.length),a+=n.length,i()},s.on("finish",i),o.on("error",(function(e){i(e)})),o.pipe(s)},Ce.prototype.close=function(e){setImmediate(e)},m.default.inherits(be,he),be.prototype._flush=function(e){this.unref(),e()},be.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var ze;function Le(e,t,n,r){if(r)return e.toString("utf8",t,n);for(var i="",o=t;o<n;o++)i+="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "[e[o]];return i}function ke(e,t){var n=e.readUInt32LE(t);return 4294967296*e.readUInt32LE(t+4)+n}function Ie(e){if(e)throw e}function Oe(e,t){return new Promise((n,r)=>{ye(e,{lazyEntries:!0},function(e,t,n){return(r,i)=>{if(r)throw r;i.readEntry(),i.on("entry",t=>{let n;if(t.fileName.indexOf("/")>-1){const r=t.fileName.split("/");r[0]=e,n=r.join(p.default.sep)}else n=e+p.default.sep+t.fileName;n[n.length-1]===p.default.sep?i.readEntry():function e(t,n){if("."===t)return n();d.default.stat(t,r=>{if(null==r)return n();const i=p.default.dirname(t);e(i,()=>{d.default.mkdir(t,n)})})}(p.default.dirname(n),()=>{i.openReadStream(t,(e,t)=>{if(e)throw e;t.on("end",()=>{i.readEntry()}),t.pipe(d.default.createWriteStream(n))})})}),i.once("error",n),i.once("end",()=>{t()})}}(t,n,r))})}ze="function"==typeof Buffer.allocUnsafe?function(e){return Buffer.allocUnsafe(e)}:function(e){return new Buffer(e)};const Ne=[];function Ue(){Ne&&Ne.length>0&&Ne.forEach(e=>e.kill("SIGINT"))}var Fe=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};!function(){Fe(this,void 0,void 0,(function*(){const e=process.argv.slice(2),t=e.indexOf("--help")>=0||e.indexOf("-h")>=0;if(e.indexOf("--info")>=0)return console.log("create-deckdeckgo:",require("../package.json").version,"\n"),0;if(t)return console.log("Usage:\nnpm init deckdeckgo\n"),0;!function(){try{const e=process.version.replace("v","").split("."),t=parseInt(e[0],10),n=parseInt(e[1],10);(t<8||8===t&&n<9)&&console.log(b(`Your current version of Node is ${process.version}, however the recommendation is a minimum of Node 8.x LTS.`))}catch(e){console.error(`\n${C("✖")} ${e.message}\n`)}}();try{const e=[{type:"input",name:"folder",message:"What's your project name (will be use to create a new folder)?",default:"deckdeckgo",validate:e=>!!(e&&e.length>0)||"Please provide a presentation's name"},{type:"input",name:"title",message:"What's your presentation name (max. 45 characters, will be use for meta tags and manifest information)?",default:"DeckDeckGo",validate:e=>!!(e&&e.length>0&&e.length<=45)||"Your presentation's name should be at least one character and max. 45"},{type:"input",name:"description",message:"What's your presentation about (its description)?",default:"Create a lightweight presentation using Web Components 🚀"},{type:"input",name:"author",message:"What's your name (will be use for the author meta information)?",default:"David"},{type:"list",name:"editing",message:"What method do you want to use to edit your presentation?",choices:["HTML","Markdown"],default:0}];console.log("\nCool, let's kick start a new "+z("DeckDeckGo")+" presentation\n");require("inquirer").prompt(e).then(e=>Fe(this,void 0,void 0,(function*(){console.log("\nYour inputs:\n"),console.log(JSON.stringify(e,null," ")+"\n"),yield function(e){return new Promise((t,n)=>Fe(this,void 0,void 0,(function*(){try{yield function(e){return new Promise((t,n)=>Fe(this,void 0,void 0,(function*(){try{const n=new F(x("[1/3] Creating your presentation..."));n.setSpinnerString(18),n.start(),function e(t){d.default.existsSync(t)&&(d.default.readdirSync(t).forEach(n=>{const i=r.join(t,n);d.default.lstatSync(i).isDirectory()?e(i):d.default.unlinkSync(i)}),d.default.rmdirSync(t))}(e.folder);const i=yield"Markdown"===e.editing?M("https://github.com/deckgo/starter-kit/archive/markdown.zip"):M("https://github.com/deckgo/starter-kit/archive/master.zip");yield Oe(i,e.folder),n.stop(!0),t()}catch(e){n(e)}})))}(e),yield function(e){return new Promise((t,n)=>Fe(this,void 0,void 0,(function*(){try{const n=new F(x("[2/3] Installing dependencies..."));n.setSpinnerString(18),n.start(),yield function(e,t,n="ignore"){return new Promise((r,i)=>{const o=f.spawn("npm",[e],{shell:!0,stdio:n,cwd:t});o.once("exit",()=>r()),o.once("error",i),Ne.push(o)})}("ci",e.folder),n.stop(!0),t()}catch(e){n(e)}})))}(e),yield function(e){return new Promise((t,n)=>Fe(this,void 0,void 0,(function*(){try{const n=new F(x("[3/3] Updating presentation..."));n.setSpinnerString(18),n.start(),function(e){const t=[e.folder+"/src/index.html",e.folder+"/src/manifest.json",e.folder+"/webpack.config.js"];"Markdown"===e.editing&&t.push(e.folder+"/src/index.md");const n=require("replace");n({regex:"{{DECKDECKGO_TITLE}}",replacement:e.title,paths:t,recursive:!1,silent:!0}),n({regex:"{{DECKDECKGO_SHORT_NAME}}",replacement:e.title&&e.title.length>12?e.title.substr(0,12):e.title,paths:t,recursive:!1,silent:!0}),n({regex:"{{DECKDECKGO_DESCRIPTION}}",replacement:e.description,paths:t,recursive:!1,silent:!0}),n({regex:"{{DECKDECKGO_AUTHOR}}",replacement:e.description,paths:t,recursive:!1,silent:!0})}(e),n.stop(!0),t()}catch(e){n(e)}})))}(e),t()}catch(e){n(e)}})))}(e),console.log("Coolio, Your presentation is initialized.\n"),yield B(e.folder),console.log("\nTo develop your slides, edit "+z(e.folder+("Markdown"===e.editing?"/src/index.md":"/src/index.html"))+"\n"),console.log("Run "+z("npm run start")+" in the newly created folder "+z(e.folder)+" to serve your presentation locally at the address "+z("http://localhost:3000")+"\n"),console.log("Find this presentation in the remote control with the keyword: "+z(e.title)+"\n"),console.log("If you rather like not to use the remote control while developing your deck, run "+z("npm run start-no-remote")+" instead of the previous command\n"),console.log('Dive deeper with the "Getting Started" guide at '+z("https://docs.deckdeckgo.com")+"\n")})))}catch(e){console.error(`\n${C("✖")} ${e.message}\n`)}Ue()}))}(); |
{ | ||
"name": "create-deckdeckgo", | ||
"version": "1.0.1", | ||
"version": "1.2.0", | ||
"description": "Quickly create a new DeckDeckGo presentation: npm init deckdeckgo", | ||
@@ -26,12 +26,12 @@ "main": "dist/index.js", | ||
"@types/cli-spinner": "^0.2.0", | ||
"@types/inquirer": "6.5.0", | ||
"@types/inquirer": "7.3.1", | ||
"@types/yauzl": "^2.9.1", | ||
"rollup": "^2.3.3", | ||
"rollup": "^2.26.6", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"terser": "^4.6.10", | ||
"tslint": "^6.1.1", | ||
"terser": "^5.2.1", | ||
"tslint": "^6.1.3", | ||
"tslint-ionic-rules": "0.0.21", | ||
"typescript": "^3.8.3" | ||
"typescript": "^4.0.2" | ||
}, | ||
@@ -55,7 +55,7 @@ "author": "David Dal Busco", | ||
"cli-spinner": "^0.2.10", | ||
"colorette": "^1.1.0", | ||
"inquirer": "^7.1.0", | ||
"replace": "^1.1.5", | ||
"colorette": "^1.2.1", | ||
"inquirer": "^7.3.3", | ||
"replace": "^1.2.0", | ||
"yauzl": "^2.10.0" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
43943
4
Updatedcolorette@^1.2.1
Updatedinquirer@^7.3.3
Updatedreplace@^1.2.0