@shopify/create-hydrogen 5.0.15 → 5.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/assets/hydrogen/starter/CHANGELOG.md +215 -0
  2. package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +1 -1
  3. package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +17 -6
  4. package/dist/assets/hydrogen/starter/app/entry.server.tsx +2 -3
  5. package/dist/assets/hydrogen/starter/app/root.tsx +9 -5
  6. package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +0 -1
  7. package/dist/assets/hydrogen/starter/app/routes/_index.tsx +2 -2
  8. package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +17 -17
  9. package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +3 -3
  10. package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +2 -2
  11. package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +6 -6
  12. package/dist/assets/hydrogen/starter/app/routes/account.tsx +2 -2
  13. package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +2 -2
  14. package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +2 -2
  15. package/dist/assets/hydrogen/starter/app/routes/blogs._index.tsx +2 -2
  16. package/dist/assets/hydrogen/starter/app/routes/cart.tsx +5 -3
  17. package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +2 -2
  18. package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +2 -2
  19. package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +2 -2
  20. package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +2 -2
  21. package/dist/assets/hydrogen/starter/app/routes/policies.$handle.tsx +2 -2
  22. package/dist/assets/hydrogen/starter/app/routes/policies._index.tsx +2 -2
  23. package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +2 -2
  24. package/dist/assets/hydrogen/starter/app/routes/search.tsx +1 -2
  25. package/dist/assets/hydrogen/starter/eslint.config.js +261 -0
  26. package/dist/assets/hydrogen/starter/guides/predictiveSearch/predictiveSearch.md +3 -3
  27. package/dist/assets/hydrogen/starter/guides/search/search.md +3 -3
  28. package/dist/assets/hydrogen/starter/package.json +25 -13
  29. package/dist/assets/hydrogen/starter/server.ts +3 -2
  30. package/dist/assets/hydrogen/starter/tsconfig.json +5 -1
  31. package/dist/assets/hydrogen/starter/vite.config.ts +7 -0
  32. package/dist/assets/hydrogen/vite/package.json +1 -1
  33. package/dist/assets/hydrogen/vite/vite.config.js +0 -1
  34. package/dist/{chunk-QOJXU774.js → chunk-MRCNSQHM.js} +390 -395
  35. package/dist/chunk-ULLCPMX6.js +3 -0
  36. package/dist/create-app.js +795 -1003
  37. package/dist/{del-KPQQ4LCD.js → del-G73TN4QI.js} +1 -1
  38. package/dist/{error-handler-GXLCBIP5.js → error-handler-NJUXGHGG.js} +1 -1
  39. package/package.json +1 -1
  40. package/dist/assets/hydrogen/starter/.eslintignore +0 -5
  41. package/dist/assets/hydrogen/starter/.eslintrc.cjs +0 -19
  42. package/dist/chunk-3657J2ZN.js +0 -3
@@ -0,0 +1,3 @@
1
+ import { createRequire as __createRequire } from 'module';globalThis.require = __createRequire(import.meta.url);
2
+ import{a as bt,b as Fe}from"./chunk-2RCBZ7OV.js";import{a as I,c as N,i as h}from"./chunk-MNT4XW23.js";var Pe=N((Sr,Te)=>{"use strict";h();Te.exports=e=>{let t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}});var $e=N((vr,Re)=>{"use strict";h();Re.exports=(...e)=>[...new Set([].concat(...e))]});var Le=N(q=>{"use strict";h();var{promisify:xt}=I("util"),Ae=I("fs");async function ie(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await xt(Ae[e])(r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function oe(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return Ae[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}q.isFile=ie.bind(null,"stat","isFile");q.isDirectory=ie.bind(null,"stat","isDirectory");q.isSymlink=ie.bind(null,"lstat","isSymbolicLink");q.isFileSync=oe.bind(null,"statSync","isFile");q.isDirectorySync=oe.bind(null,"statSync","isDirectory");q.isSymlinkSync=oe.bind(null,"lstatSync","isSymbolicLink")});var Ge=N((Fr,ce)=>{"use strict";h();var M=I("path"),Ne=Le(),De=e=>e.length>1?`{${e.join(",")}}`:e[0],Ie=(e,t)=>{let r=e[0]==="!"?e.slice(1):e;return M.isAbsolute(r)?r:M.join(t,r)},Ot=(e,t)=>M.extname(e)?`**/${e}`:`**/${e}.${De(t)}`,je=(e,t)=>{if(t.files&&!Array.isArray(t.files))throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof t.files}\``);if(t.extensions&&!Array.isArray(t.extensions))throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof t.extensions}\``);return t.files&&t.extensions?t.files.map(r=>M.posix.join(e,Ot(r,t.extensions))):t.files?t.files.map(r=>M.posix.join(e,`**/${r}`)):t.extensions?[M.posix.join(e,`**/*.${De(t.extensions)}`)]:[M.posix.join(e,"**")]};ce.exports=async(e,t)=>{if(t={cwd:process.cwd(),...t},typeof t.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);let r=await Promise.all([].concat(e).map(async n=>await Ne.isDirectory(Ie(n,t.cwd))?je(n,t):n));return[].concat.apply([],r)};ce.exports.sync=(e,t)=>{if(t={cwd:process.cwd(),...t},typeof t.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);let r=[].concat(e).map(n=>Ne.isDirectorySync(Ie(n,t.cwd))?je(n,t):n);return[].concat.apply([],r)}});var Ue=N((Pr,Ke)=>{"use strict";h();function Ce(e){return Array.isArray(e)?e:[e]}var ue="",qe=" ",se="\\",Ft=/^\s+$/,Tt=/(?:[^\\]|^)\\$/,Pt=/^\\!/,Rt=/^\\#/,$t=/\r?\n/g,At=/^\.*\/|^\.+$/,ae="/",ke="node-ignore";typeof Symbol<"u"&&(ke=Symbol.for("node-ignore"));var Me=ke,Lt=(e,t,r)=>Object.defineProperty(e,t,{value:r}),Nt=/([0-z])-([0-z])/g,Ye=()=>!1,Dt=e=>e.replace(Nt,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:ue),It=e=>{let{length:t}=e;return e.slice(0,t-t%2)},jt=[[/^\uFEFF/,()=>ue],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?qe:ue)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+qe}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>se],[/\\\\/g,()=>se],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===se?`\\[${r}${It(n)}${o}`:o==="]"&&n.length%2===0?`[${Dt(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],We=Object.create(null),Gt=(e,t)=>{let r=We[e];return r||(r=jt.reduce((n,[o,s])=>n.replace(o,s.bind(e)),e),We[e]=r),t?new RegExp(r,"i"):new RegExp(r)},de=e=>typeof e=="string",Ct=e=>e&&de(e)&&!Ft.test(e)&&!Tt.test(e)&&e.indexOf("#")!==0,qt=e=>e.split($t),le=class{constructor(t,r,n,o){this.origin=t,this.pattern=r,this.negative=n,this.regex=o}},Mt=(e,t)=>{let r=e,n=!1;e.indexOf("!")===0&&(n=!0,e=e.substr(1)),e=e.replace(Pt,"!").replace(Rt,"#");let o=Gt(e,t);return new le(r,e,n,o)},Wt=(e,t)=>{throw new t(e)},j=(e,t,r)=>de(e)?e?j.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),Xe=e=>At.test(e);j.isNotRelative=Xe;j.convert=e=>e;var fe=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Lt(this,Me,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[Me]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(Ct(t)){let r=Mt(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,Ce(de(t)?qt(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,r){let n=!1,o=!1;return this._rules.forEach(s=>{let{negative:d}=s;if(o===d&&n!==o||d&&!n&&!o&&!r)return;s.regex.test(t)&&(n=!d,o=d)}),{ignored:n,unignored:o}}_test(t,r,n,o){let s=t&&j.convert(t);return j(s,t,this._allowRelativePaths?Ye:Wt),this._t(s,r,n,o)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(ae)),o.pop(),!o.length)return r[t]=this._testOne(t,n);let s=this._t(o.join(ae)+ae,r,n,o);return r[t]=s.ignored?s:this._testOne(t,n)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return Ce(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},U=e=>new fe(e),kt=e=>j(e&&j.convert(e),e,Ye);U.isPathValid=kt;U.default=U;Ke.exports=U;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");j.convert=e;let t=/^[a-z]:\//i;j.isNotRelative=r=>t.test(r)||Xe(r)}});var Ze=N(($r,pe)=>{"use strict";h();var{promisify:Yt}=I("util"),Be=I("fs"),G=I("path"),ze=Fe(),Xt=Ue(),K=Pe(),He=["**/node_modules/**","**/flow-typed/**","**/coverage/**","**/.git"],Kt=Yt(Be.readFile),Ut=e=>t=>t.startsWith("!")?"!"+G.posix.join(e,t.slice(1)):G.posix.join(e,t),Bt=(e,t)=>{let r=K(G.relative(t.cwd,G.dirname(t.fileName)));return e.split(/\r?\n/).filter(Boolean).filter(n=>!n.startsWith("#")).map(Ut(r))},Ve=e=>{let t=Xt();for(let r of e)t.add(Bt(r.content,{cwd:r.cwd,fileName:r.filePath}));return t},zt=(e,t)=>{if(e=K(e),G.isAbsolute(t)){if(K(t).startsWith(e))return t;throw new Error(`Path ${t} is not in cwd ${e}`)}return G.join(e,t)},Qe=(e,t)=>r=>e.ignores(K(G.relative(t,zt(t,r.path||r)))),Ht=async(e,t)=>{let r=G.join(t,e),n=await Kt(r,"utf8");return{cwd:t,filePath:r,content:n}},Vt=(e,t)=>{let r=G.join(t,e),n=Be.readFileSync(r,"utf8");return{cwd:t,filePath:r,content:n}},Je=({ignore:e=[],cwd:t=K(process.cwd())}={})=>({ignore:e,cwd:t});pe.exports=async e=>{e=Je(e);let t=await ze("**/.gitignore",{ignore:He.concat(e.ignore),cwd:e.cwd}),r=await Promise.all(t.map(o=>Ht(o,e.cwd))),n=Ve(r);return Qe(n,e.cwd)};pe.exports.sync=e=>{e=Je(e);let r=ze.sync("**/.gitignore",{ignore:He.concat(e.ignore),cwd:e.cwd}).map(o=>Vt(o,e.cwd)),n=Ve(r);return Qe(n,e.cwd)}});var tt=N((Lr,et)=>{"use strict";h();var{Transform:Qt}=I("stream"),B=class extends Qt{constructor(){super({objectMode:!0})}},ye=class extends B{constructor(t){super(),this._filter=t}_transform(t,r,n){this._filter(t)&&this.push(t),n()}},he=class extends B{constructor(){super(),this._pushed=new Set}_transform(t,r,n){this._pushed.has(t)||(this.push(t),this._pushed.add(t)),n()}};et.exports={FilterStream:ye,UniqueStream:he}});var or=N((Dr,W)=>{"use strict";h();var nt=I("fs"),z=$e(),Jt=bt(),H=Fe(),V=Ge(),ge=Ze(),{FilterStream:Zt,UniqueStream:er}=tt(),it=()=>!1,rt=e=>e[0]==="!",tr=e=>{if(!e.every(t=>typeof t=="string"))throw new TypeError("Patterns must be a string or an array of strings")},rr=(e={})=>{if(!e.cwd)return;let t;try{t=nt.statSync(e.cwd)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},nr=e=>e.stats instanceof nt.Stats?e.path:e,Q=(e,t)=>{e=z([].concat(e)),tr(e),rr(t);let r=[];t={ignore:[],expandDirectories:!0,...t};for(let[n,o]of e.entries()){if(rt(o))continue;let s=e.slice(n).filter(p=>rt(p)).map(p=>p.slice(1)),d={...t,ignore:t.ignore.concat(s)};r.push({pattern:o,options:d})}return r},ir=(e,t)=>{let r={};return e.options.cwd&&(r.cwd=e.options.cwd),Array.isArray(e.options.expandDirectories)?r={...r,files:e.options.expandDirectories}:typeof e.options.expandDirectories=="object"&&(r={...r,...e.options.expandDirectories}),t(e.pattern,r)},me=(e,t)=>e.options.expandDirectories?ir(e,t):[e.pattern],ot=e=>e&&e.gitignore?ge.sync({cwd:e.cwd,ignore:e.ignore}):it,we=e=>t=>{let{options:r}=e;return r.ignore&&Array.isArray(r.ignore)&&r.expandDirectories&&(r.ignore=V.sync(r.ignore)),{pattern:t,options:r}};W.exports=async(e,t)=>{let r=Q(e,t),n=async()=>t&&t.gitignore?ge({cwd:t.cwd,ignore:t.ignore}):it,o=async()=>{let O=await Promise.all(r.map(async A=>{let i=await me(A,V);return Promise.all(i.map(we(A)))}));return z(...O)},[s,d]=await Promise.all([n(),o()]),p=await Promise.all(d.map(O=>H(O.pattern,O.options)));return z(...p).filter(O=>!s(nr(O)))};W.exports.sync=(e,t)=>{let r=Q(e,t),n=[];for(let d of r){let p=me(d,V.sync).map(we(d));n.push(...p)}let o=ot(t),s=[];for(let d of n)s=z(s,H.sync(d.pattern,d.options));return s.filter(d=>!o(d))};W.exports.stream=(e,t)=>{let r=Q(e,t),n=[];for(let p of r){let O=me(p,V.sync).map(we(p));n.push(...O)}let o=ot(t),s=new Zt(p=>!o(p)),d=new er;return Jt(n.map(p=>H.stream(p.pattern,p.options))).pipe(s).pipe(d)};W.exports.generateGlobTasks=Q;W.exports.hasMagic=(e,t)=>[].concat(e).some(r=>H.isDynamicPattern(r,t));W.exports.gitignore=ge});var st=N((jr,ct)=>{"use strict";h();var C=I("constants"),cr=process.cwd,J=null,sr=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return J||(J=cr.call(process)),J};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Ee=process.chdir,process.chdir=function(e){J=null,Ee.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ee));var Ee;ct.exports=ar;function ar(e){C.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=d(e.chownSync),e.fchownSync=d(e.fchownSync),e.lchownSync=d(e.lchownSync),e.chmodSync=o(e.chmodSync),e.fchmodSync=o(e.fchmodSync),e.lchmodSync=o(e.lchmodSync),e.stat=p(e.stat),e.fstat=p(e.fstat),e.lstat=p(e.lstat),e.statSync=O(e.statSync),e.fstatSync=O(e.fstatSync),e.lstatSync=O(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(i,f,u){u&&process.nextTick(u)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(i,f,u,c){c&&process.nextTick(c)},e.lchownSync=function(){}),sr==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(i){function f(u,c,l){var E=Date.now(),m=0;i(u,c,function _(D){if(D&&(D.code==="EACCES"||D.code==="EPERM")&&Date.now()-E<6e4){setTimeout(function(){e.stat(c,function(L,X){L&&L.code==="ENOENT"?i(u,c,_):l(D)})},m),m<100&&(m+=10);return}l&&l(D)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,i),f}(e.rename)),e.read=typeof e.read!="function"?e.read:function(i){function f(u,c,l,E,m,_){var D;if(_&&typeof _=="function"){var L=0;D=function(X,xe,Oe){if(X&&X.code==="EAGAIN"&&L<10)return L++,i.call(e,u,c,l,E,m,D);_.apply(this,arguments)}}return i.call(e,u,c,l,E,m,D)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,i),f}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(i){return function(f,u,c,l,E){for(var m=0;;)try{return i.call(e,f,u,c,l,E)}catch(_){if(_.code==="EAGAIN"&&m<10){m++;continue}throw _}}}(e.readSync);function t(i){i.lchmod=function(f,u,c){i.open(f,C.O_WRONLY|C.O_SYMLINK,u,function(l,E){if(l){c&&c(l);return}i.fchmod(E,u,function(m){i.close(E,function(_){c&&c(m||_)})})})},i.lchmodSync=function(f,u){var c=i.openSync(f,C.O_WRONLY|C.O_SYMLINK,u),l=!0,E;try{E=i.fchmodSync(c,u),l=!1}finally{if(l)try{i.closeSync(c)}catch{}else i.closeSync(c)}return E}}function r(i){C.hasOwnProperty("O_SYMLINK")&&i.futimes?(i.lutimes=function(f,u,c,l){i.open(f,C.O_SYMLINK,function(E,m){if(E){l&&l(E);return}i.futimes(m,u,c,function(_){i.close(m,function(D){l&&l(_||D)})})})},i.lutimesSync=function(f,u,c){var l=i.openSync(f,C.O_SYMLINK),E,m=!0;try{E=i.futimesSync(l,u,c),m=!1}finally{if(m)try{i.closeSync(l)}catch{}else i.closeSync(l)}return E}):i.futimes&&(i.lutimes=function(f,u,c,l){l&&process.nextTick(l)},i.lutimesSync=function(){})}function n(i){return i&&function(f,u,c){return i.call(e,f,u,function(l){A(l)&&(l=null),c&&c.apply(this,arguments)})}}function o(i){return i&&function(f,u){try{return i.call(e,f,u)}catch(c){if(!A(c))throw c}}}function s(i){return i&&function(f,u,c,l){return i.call(e,f,u,c,function(E){A(E)&&(E=null),l&&l.apply(this,arguments)})}}function d(i){return i&&function(f,u,c){try{return i.call(e,f,u,c)}catch(l){if(!A(l))throw l}}}function p(i){return i&&function(f,u,c){typeof u=="function"&&(c=u,u=null);function l(E,m){m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),c&&c.apply(this,arguments)}return u?i.call(e,f,u,l):i.call(e,f,l)}}function O(i){return i&&function(f,u){var c=u?i.call(e,f,u):i.call(e,f);return c&&(c.uid<0&&(c.uid+=4294967296),c.gid<0&&(c.gid+=4294967296)),c}}function A(i){if(!i||i.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(i.code==="EINVAL"||i.code==="EPERM"))}}});var lt=N((Cr,ut)=>{"use strict";h();var at=I("stream").Stream;ut.exports=ur;function ur(e){return{ReadStream:t,WriteStream:r};function t(n,o){if(!(this instanceof t))return new t(n,o);at.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var d=Object.keys(o),p=0,O=d.length;p<O;p++){var A=d[p];this[A]=o[A]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}e.open(this.path,this.flags,this.mode,function(i,f){if(i){s.emit("error",i),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);at.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 s=Object.keys(o),d=0,p=s.length;d<p;d++){var O=s[d];this[O]=o[O]}if(this.start!==void 0){if(typeof this.start!="number")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=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var dt=N((Mr,ft)=>{"use strict";h();ft.exports=fr;var lr=Object.getPrototypeOf||function(e){return e.__proto__};function fr(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:lr(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var gr=N((kr,ve)=>{"use strict";h();var b=I("fs"),dr=st(),pr=lt(),yr=dt(),Z=I("util"),$,te;typeof Symbol=="function"&&typeof Symbol.for=="function"?($=Symbol.for("graceful-fs.queue"),te=Symbol.for("graceful-fs.previous")):($="___graceful-fs.queue",te="___graceful-fs.previous");function hr(){}function ht(e,t){Object.defineProperty(e,$,{get:function(){return t}})}var k=hr;Z.debuglog?k=Z.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(k=function(){var e=Z.format.apply(Z,arguments);e="GFS4: "+e.split(/\n/).join(`
3
+ GFS4: `),console.error(e)});b[$]||(pt=global[$]||[],ht(b,pt),b.close=function(e){function t(r,n){return e.call(b,r,function(o){o||yt(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(t,te,{value:e}),t}(b.close),b.closeSync=function(e){function t(r){e.apply(b,arguments),yt()}return Object.defineProperty(t,te,{value:e}),t}(b.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){k(b[$]),I("assert").equal(b[$].length,0)}));var pt;global[$]||ht(global,b[$]);ve.exports=Se(yr(b));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!b.__patched&&(ve.exports=Se(b),b.__patched=!0);function Se(e){dr(e),e.gracefulify=Se,e.createReadStream=xe,e.createWriteStream=Oe;var t=e.readFile;e.readFile=r;function r(a,g,y){return typeof g=="function"&&(y=g,g=null),T(a,g,y);function T(P,F,v,x){return t(P,F,function(w){w&&(w.code==="EMFILE"||w.code==="ENFILE")?Y([T,[P,F,v],w,x||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=o;function o(a,g,y,T){return typeof y=="function"&&(T=y,y=null),P(a,g,y,T);function P(F,v,x,w,R){return n(F,v,x,function(S){S&&(S.code==="EMFILE"||S.code==="ENFILE")?Y([P,[F,v,x,w],S,R||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=d);function d(a,g,y,T){return typeof y=="function"&&(T=y,y=null),P(a,g,y,T);function P(F,v,x,w,R){return s(F,v,x,function(S){S&&(S.code==="EMFILE"||S.code==="ENFILE")?Y([P,[F,v,x,w],S,R||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var p=e.copyFile;p&&(e.copyFile=O);function O(a,g,y,T){return typeof y=="function"&&(T=y,y=0),P(a,g,y,T);function P(F,v,x,w,R){return p(F,v,x,function(S){S&&(S.code==="EMFILE"||S.code==="ENFILE")?Y([P,[F,v,x,w],S,R||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var A=e.readdir;e.readdir=f;var i=/^v[0-5]\./;function f(a,g,y){typeof g=="function"&&(y=g,g=null);var T=i.test(process.version)?function(v,x,w,R){return A(v,P(v,x,w,R))}:function(v,x,w,R){return A(v,x,P(v,x,w,R))};return T(a,g,y);function P(F,v,x,w){return function(R,S){R&&(R.code==="EMFILE"||R.code==="ENFILE")?Y([T,[F,v,x],R,w||Date.now(),Date.now()]):(S&&S.sort&&S.sort(),typeof x=="function"&&x.call(this,R,S))}}}if(process.version.substr(0,4)==="v0.8"){var u=pr(e);_=u.ReadStream,L=u.WriteStream}var c=e.ReadStream;c&&(_.prototype=Object.create(c.prototype),_.prototype.open=D);var l=e.WriteStream;l&&(L.prototype=Object.create(l.prototype),L.prototype.open=X),Object.defineProperty(e,"ReadStream",{get:function(){return _},set:function(a){_=a},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return L},set:function(a){L=a},enumerable:!0,configurable:!0});var E=_;Object.defineProperty(e,"FileReadStream",{get:function(){return E},set:function(a){E=a},enumerable:!0,configurable:!0});var m=L;Object.defineProperty(e,"FileWriteStream",{get:function(){return m},set:function(a){m=a},enumerable:!0,configurable:!0});function _(a,g){return this instanceof _?(c.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function D(){var a=this;ne(a.path,a.flags,a.mode,function(g,y){g?(a.autoClose&&a.destroy(),a.emit("error",g)):(a.fd=y,a.emit("open",y),a.read())})}function L(a,g){return this instanceof L?(l.apply(this,arguments),this):L.apply(Object.create(L.prototype),arguments)}function X(){var a=this;ne(a.path,a.flags,a.mode,function(g,y){g?(a.destroy(),a.emit("error",g)):(a.fd=y,a.emit("open",y))})}function xe(a,g){return new e.ReadStream(a,g)}function Oe(a,g){return new e.WriteStream(a,g)}var vt=e.open;e.open=ne;function ne(a,g,y,T){return typeof y=="function"&&(T=y,y=null),P(a,g,y,T);function P(F,v,x,w,R){return vt(F,v,x,function(S,Er){S&&(S.code==="EMFILE"||S.code==="ENFILE")?Y([P,[F,v,x,w],S,R||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}return e}function Y(e){k("ENQUEUE",e[0].name,e[1]),b[$].push(e),_e()}var ee;function yt(){for(var e=Date.now(),t=0;t<b[$].length;++t)b[$][t].length>2&&(b[$][t][3]=e,b[$][t][4]=e);_e()}function _e(){if(clearTimeout(ee),ee=void 0,b[$].length!==0){var e=b[$].shift(),t=e[0],r=e[1],n=e[2],o=e[3],s=e[4];if(o===void 0)k("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-o>=6e4){k("TIMEOUT",t.name,r);var d=r.pop();typeof d=="function"&&d.call(null,n)}else{var p=Date.now()-s,O=Math.max(s-o,1),A=Math.min(O*1.2,100);p>=A?(k("RETRY",t.name,r),t.apply(null,r.concat([o]))):b[$].push(e)}ee===void 0&&(ee=setTimeout(_e,0))}}});var mr=N((Xr,gt)=>{"use strict";h();gt.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Et=N((Ur,wt)=>{"use strict";h();wt.exports=mt;function mt(e,t){if(e&&t)return mt(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),o=0;o<n.length;o++)n[o]=arguments[o];var s=e.apply(this,n),d=n[n.length-1];return typeof s=="function"&&s!==d&&Object.keys(d).forEach(function(p){s[p]=d[p]}),s}}});var wr=N((zr,be)=>{"use strict";h();var St=Et();be.exports=St(re);be.exports.strict=St(_t);re.proto=re(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return re(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return _t(this)},configurable:!0})});function re(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function _t(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});export{mr as a,Pe as b,or as c,gr as d,Et as e,wr as f};