vbapm 0.6.3-alpha → 0.6.12
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.
- package/README.md +57 -14
- package/lib/_commonjsHelpers-553b27b3.js +1 -2
- package/lib/{src/build → build}/component.d.ts +0 -1
- package/lib/build-project-59d26ffa.js +3 -0
- package/lib/build-target-d6327f6f.js +9 -0
- package/lib/{src/config.d.ts → config.d.ts} +2 -2
- package/lib/create-project-0813adf7.js +10 -0
- package/lib/debug.js +1 -2
- package/lib/{src/env.d.ts → env.d.ts} +1 -0
- package/lib/{export-project-55168787.js → export-project-59836888.js} +1 -2
- package/lib/export-target-902b2548.js +4 -0
- package/lib/get-target-cf4af796.js +11 -0
- package/lib/index-4386ff9f.js +5 -0
- package/lib/index-4ce3d28b.js +6 -0
- package/lib/index-72c1a91d.js +3 -0
- package/lib/index-c5b5f6d1.js +2 -0
- package/lib/{src/index.d.ts → index.d.ts} +1 -0
- package/lib/index.js +1 -2
- package/lib/init-project-74a9b860.js +15 -0
- package/lib/installer-2f42d28c.js +21 -0
- package/lib/installer.d.ts +8 -0
- package/lib/load-from-project-6be3cab9.js +5 -0
- package/lib/{src/lockfile → lockfile}/lockfile.d.ts +2 -2
- package/lib/once-5205b917.js +1 -0
- package/lib/project-d784a14d.js +29 -0
- package/lib/{src/resolve → resolve}/resolver.d.ts +1 -1
- package/lib/run-macro-c5a7bb2d.js +1 -0
- package/lib/sat-solver-01db5ebc.js +1 -0
- package/lib/test-project-b0a5536b.js +1 -0
- package/lib/tmp-14f9d850.js +9 -0
- package/lib/toml-patch.es-6bd2145d.js +1 -2
- package/lib/{src/utils → utils}/fs.d.ts +0 -1
- package/lib/{src/utils → utils}/hash.d.ts +0 -1
- package/lib/{src/utils → utils}/run.d.ts +1 -1
- package/lib/{src/utils → utils}/xml.d.ts +0 -1
- package/lib/{src/utils → utils}/zip.d.ts +0 -1
- package/lib/vbapm-build-8e2c88c7.js +9 -0
- package/lib/vbapm-export-af350c94.js +7 -0
- package/lib/vbapm-init-131ea380.js +16 -0
- package/lib/vbapm-new-e3409051.js +17 -0
- package/lib/vbapm-run-795f5167.js +10 -0
- package/lib/vbapm-test-dc8aad3b.js +15 -0
- package/lib/vbapm-version-3b5a838c.js +8 -0
- package/lib/vbapm.js +34 -0
- package/lib/workbook-xml-5b96eac5.js +2 -0
- package/package.json +61 -35
- package/run-scripts/run.ps1 +88 -81
- package/lib/_commonjsHelpers-553b27b3.js.map +0 -1
- package/lib/build-project-55e5df48.js +0 -4
- package/lib/build-project-55e5df48.js.map +0 -1
- package/lib/build-target-283e1e7d.js +0 -10
- package/lib/build-target-283e1e7d.js.map +0 -1
- package/lib/create-project-905598ca.js +0 -11
- package/lib/create-project-905598ca.js.map +0 -1
- package/lib/debug.js.map +0 -1
- package/lib/export-project-55168787.js.map +0 -1
- package/lib/export-target-c9ddd2fa.js +0 -5
- package/lib/export-target-c9ddd2fa.js.map +0 -1
- package/lib/get-target-23b8cc04.js +0 -12
- package/lib/get-target-23b8cc04.js.map +0 -1
- package/lib/index-35cff1d5.js +0 -38
- package/lib/index-35cff1d5.js.map +0 -1
- package/lib/index-87f55e79.js +0 -4
- package/lib/index-87f55e79.js.map +0 -1
- package/lib/index-b49bd5b2.js +0 -2
- package/lib/index-b49bd5b2.js.map +0 -1
- package/lib/index-c97017db.js +0 -2
- package/lib/index-c97017db.js.map +0 -1
- package/lib/index-d9ba3ba0.js +0 -6
- package/lib/index-d9ba3ba0.js.map +0 -1
- package/lib/index-ffbba08f.js +0 -3
- package/lib/index-ffbba08f.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/inherits-713f4554.js +0 -2
- package/lib/inherits-713f4554.js.map +0 -1
- package/lib/init-project-a62cb644.js +0 -16
- package/lib/init-project-a62cb644.js.map +0 -1
- package/lib/load-from-project-e6530a69.js +0 -6
- package/lib/load-from-project-e6530a69.js.map +0 -1
- package/lib/minimatch-3a1d1fa9.js +0 -2
- package/lib/minimatch-3a1d1fa9.js.map +0 -1
- package/lib/once-9eb67b4f.js +0 -2
- package/lib/once-9eb67b4f.js.map +0 -1
- package/lib/project-d43b4e0c.js +0 -30
- package/lib/project-d43b4e0c.js.map +0 -1
- package/lib/run-macro-f4aa7c14.js +0 -2
- package/lib/run-macro-f4aa7c14.js.map +0 -1
- package/lib/sat-solver-01d6409e.js +0 -2
- package/lib/sat-solver-01d6409e.js.map +0 -1
- package/lib/src/installer.d.ts +0 -3
- package/lib/test-project-d4f237d1.js +0 -2
- package/lib/test-project-d4f237d1.js.map +0 -1
- package/lib/text-ba532b40.js +0 -10
- package/lib/text-ba532b40.js.map +0 -1
- package/lib/tmp-bc08ebcf.js +0 -10
- package/lib/tmp-bc08ebcf.js.map +0 -1
- package/lib/toml-patch.es-6bd2145d.js.map +0 -1
- package/lib/vba-blocks-build-a717fcdb.js +0 -10
- package/lib/vba-blocks-build-a717fcdb.js.map +0 -1
- package/lib/vba-blocks-export-7e2c75cc.js +0 -8
- package/lib/vba-blocks-export-7e2c75cc.js.map +0 -1
- package/lib/vba-blocks-init-54531020.js +0 -17
- package/lib/vba-blocks-init-54531020.js.map +0 -1
- package/lib/vba-blocks-new-3210d92c.js +0 -18
- package/lib/vba-blocks-new-3210d92c.js.map +0 -1
- package/lib/vba-blocks-run-ab9d4ad4.js +0 -11
- package/lib/vba-blocks-run-ab9d4ad4.js.map +0 -1
- package/lib/vba-blocks-test-da5dba90.js +0 -16
- package/lib/vba-blocks-test-da5dba90.js.map +0 -1
- package/lib/vba-blocks-version-e1b3c35a.js +0 -9
- package/lib/vba-blocks-version-e1b3c35a.js.map +0 -1
- package/lib/vba-blocks.js +0 -43
- package/lib/vba-blocks.js.map +0 -1
- package/lib/workbook-xml-69fff4ae.js +0 -3
- package/lib/workbook-xml-69fff4ae.js.map +0 -1
- /package/lib/{src/actions → actions}/build-project.d.ts +0 -0
- /package/lib/{src/actions → actions}/create-project.d.ts +0 -0
- /package/lib/{src/actions → actions}/export-project.d.ts +0 -0
- /package/lib/{src/actions → actions}/increment-version.d.ts +0 -0
- /package/lib/{src/actions → actions}/init-project.d.ts +0 -0
- /package/lib/{src/actions → actions}/run-macro.d.ts +0 -0
- /package/lib/{src/actions → actions}/test-project.d.ts +0 -0
- /package/lib/{src/addin.d.ts → addin.d.ts} +0 -0
- /package/lib/{src/bin/vba-blocks-build.d.ts → bin/vbapm-build.d.ts} +0 -0
- /package/lib/{src/bin/vba-blocks-export.d.ts → bin/vbapm-export.d.ts} +0 -0
- /package/lib/{src/bin/vba-blocks-init.d.ts → bin/vbapm-init.d.ts} +0 -0
- /package/lib/{src/bin/vba-blocks-new.d.ts → bin/vbapm-new.d.ts} +0 -0
- /package/lib/{src/bin/vba-blocks-run.d.ts → bin/vbapm-run.d.ts} +0 -0
- /package/lib/{src/bin/vba-blocks-test.d.ts → bin/vbapm-test.d.ts} +0 -0
- /package/lib/{src/bin/vba-blocks-version.d.ts → bin/vbapm-version.d.ts} +0 -0
- /package/lib/{src/bin/vba-blocks.d.ts → bin/vbapm.d.ts} +0 -0
- /package/lib/{src/build → build}/apply-changeset.d.ts +0 -0
- /package/lib/{src/build → build}/build-graph.d.ts +0 -0
- /package/lib/{src/build → build}/changeset.d.ts +0 -0
- /package/lib/{src/build → build}/compare-build-graphs.d.ts +0 -0
- /package/lib/{src/build → build}/index.d.ts +0 -0
- /package/lib/{src/build → build}/load-from-export.d.ts +0 -0
- /package/lib/{src/build → build}/load-from-project.d.ts +0 -0
- /package/lib/{src/build → build}/stage-build-graph.d.ts +0 -0
- /package/lib/{src/build → build}/transform-build-graph.d.ts +0 -0
- /package/lib/{src/build → build}/transforms/editor-config.d.ts +0 -0
- /package/lib/{src/cache.d.ts → cache.d.ts} +0 -0
- /package/lib/{src/debug.d.ts → debug.d.ts} +0 -0
- /package/lib/{src/errors.d.ts → errors.d.ts} +0 -0
- /package/lib/{src/lockfile → lockfile}/index.d.ts +0 -0
- /package/lib/{src/lockfile → lockfile}/is-lockfile-valid.d.ts +0 -0
- /package/lib/{src/manifest → manifest}/dependency.d.ts +0 -0
- /package/lib/{src/manifest → manifest}/index.d.ts +0 -0
- /package/lib/{src/manifest → manifest}/reference.d.ts +0 -0
- /package/lib/{src/manifest → manifest}/source.d.ts +0 -0
- /package/lib/{src/manifest → manifest}/target.d.ts +0 -0
- /package/lib/{src/manifest → manifest}/version.d.ts +0 -0
- /package/lib/{src/messages.d.ts → messages.d.ts} +0 -0
- /package/lib/{src/professional → professional}/sources/git-source.d.ts +0 -0
- /package/lib/{src/professional → professional}/workspace.d.ts +0 -0
- /package/lib/{src/project.d.ts → project.d.ts} +0 -0
- /package/lib/{src/reporter.d.ts → reporter.d.ts} +0 -0
- /package/lib/{src/resolve → resolve}/dependency-graph.d.ts +0 -0
- /package/lib/{src/resolve → resolve}/index.d.ts +0 -0
- /package/lib/{src/resolve → resolve}/latest-solver.d.ts +0 -0
- /package/lib/{src/resolve → resolve}/sat-solver.d.ts +0 -0
- /package/lib/{src/sources → sources}/index.d.ts +0 -0
- /package/lib/{src/sources → sources}/path-source.d.ts +0 -0
- /package/lib/{src/sources → sources}/registration.d.ts +0 -0
- /package/lib/{src/sources → sources}/registry-source.d.ts +0 -0
- /package/lib/{src/sources → sources}/source.d.ts +0 -0
- /package/lib/{src/targets → targets}/add-target.d.ts +0 -0
- /package/lib/{src/targets → targets}/build-target.d.ts +0 -0
- /package/lib/{src/targets → targets}/export-target.d.ts +0 -0
- /package/lib/{src/targets → targets}/get-target.d.ts +0 -0
- /package/lib/{src/targets → targets}/index.d.ts +0 -0
- /package/lib/{src/targets → targets}/project-info.d.ts +0 -0
- /package/lib/{src/targets → targets}/transform-target.d.ts +0 -0
- /package/lib/{src/targets → targets}/transforms/core-xml.d.ts +0 -0
- /package/lib/{src/targets → targets}/transforms/workbook-xml.d.ts +0 -0
- /package/lib/{src/utils → utils}/async-map.d.ts +0 -0
- /package/lib/{src/utils → utils}/download.d.ts +0 -0
- /package/lib/{src/utils → utils}/get-staging.d.ts +0 -0
- /package/lib/{src/utils → utils}/git.d.ts +0 -0
- /package/lib/{src/utils → utils}/github.d.ts +0 -0
- /package/lib/{src/utils → utils}/has.d.ts +0 -0
- /package/lib/{src/utils → utils}/interop.d.ts +0 -0
- /package/lib/{src/utils → utils}/is.d.ts +0 -0
- /package/lib/{src/utils → utils}/noop.d.ts +0 -0
- /package/lib/{src/utils → utils}/observable.d.ts +0 -0
- /package/lib/{src/utils → utils}/parallel.d.ts +0 -0
- /package/lib/{src/utils → utils}/path.d.ts +0 -0
- /package/lib/{src/utils → utils}/pipe.d.ts +0 -0
- /package/lib/{src/utils → utils}/stdout-file.d.ts +0 -0
- /package/lib/{src/utils → utils}/text.d.ts +0 -0
- /package/lib/{src/utils → utils}/toml.d.ts +0 -0
- /package/lib/{src/utils → utils}/unique.d.ts +0 -0
- /package/lib/{src/utils → utils}/without.d.ts +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t=require("./installer-2f42d28c.js"),e=require("path"),n=require("fs"),r=require("./_commonjsHelpers-553b27b3.js"),i=require("util"),s=require("stream"),a=require("string_decoder");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var c=o(e),u=o(n),l=o(i),h=o(s),p=o(a);const f={excel:["xlsx","xlsm","xlam"]},m={excel:t.join(t.env.addins,"vbapm.xlam")},d={};for(const[t,e]of Object.entries(f))for(const n of e)d[n]=t;function g(e,n,r={}){const i=y(n.type);return{application:i,addin:m[i],file:t.join(r.staging?e.paths.staging:e.paths.build,n.filename)}}function y(e){e=e.replace(".","");const n=d[e];if(!n)throw new t.CliError(t.ErrorCode.AddinUnsupportedType,`The target type "${e} is not currently supported.`);return n}const b=(t,e,n)=>{const r=t instanceof RegExp?v(t,n):t,i=e instanceof RegExp?v(e,n):e,s=null!==r&&null!=i&&E(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},v=(t,e)=>{const n=e.match(t);return n?n[0]:null},E=(t,e,n)=>{let r,i,s,a,o,c=n.indexOf(t),u=n.indexOf(e,c+1),l=c;if(c>=0&&u>0){if(t===e)return[c,u];for(r=[],s=n.length;l>=0&&!o;){if(l===c)r.push(l),c=n.indexOf(t,l+1);else if(1===r.length){const t=r.pop();void 0!==t&&(o=[t,u])}else i=r.pop(),void 0!==i&&i<s&&(s=i,a=u),u=n.indexOf(e,l+1);l=c<u&&c>=0?c:u}r.length&&void 0!==a&&(o=[s,a])}return o},T="\0SLASH"+Math.random()+"\0",w="\0OPEN"+Math.random()+"\0",_="\0CLOSE"+Math.random()+"\0",A="\0COMMA"+Math.random()+"\0",N="\0PERIOD"+Math.random()+"\0",x=new RegExp(T,"g"),O=new RegExp(w,"g"),S=new RegExp(_,"g"),C=new RegExp(A,"g"),I=new RegExp(N,"g"),D=/\\\\/g,P=/\\{/g,F=/\\}/g,M=/\\,/g,j=/\\./g,R=1e5;function k(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function L(t){return t.replace(x,"\\").replace(O,"{").replace(S,"}").replace(C,",").replace(I,".")}function B(t){if(!t)return[""];const e=[],n=b("{","}",t);if(!n)return t.split(",");const{pre:r,body:i,post:s}=n,a=r.split(",");a[a.length-1]+="{"+i+"}";const o=B(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function K(t,e={}){if(!t)return[];const{max:n=R}=e;return"{}"===t.slice(0,2)&&(t="\\{\\}"+t.slice(2)),W(function(t){return t.replace(D,T).replace(P,w).replace(F,_).replace(M,A).replace(j,N)}(t),n,!0).map(L)}function G(t){return"{"+t+"}"}function U(t){return/^-?0\d/.test(t)}function $(t,e){return t<=e}function V(t,e){return t>=e}function W(t,e,n){const r=[],i=b("{","}",t);if(!i)return[t];const s=i.pre,a=i.post.length?W(i.post,e,!1):[""];if(/\$$/.test(i.pre))for(let t=0;t<a.length&&t<e;t++){const e=s+"{"+i.body+"}"+a[t];r.push(e)}else{const o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=o||c,l=i.body.indexOf(",")>=0;if(!u&&!l)return i.post.match(/,(?!,).*\}/)?W(t=i.pre+"{"+i.body+_+i.post,e,!0):[t];let h,p;if(u)h=i.body.split(/\.\./);else if(h=B(i.body),1===h.length&&void 0!==h[0]&&(h=W(h[0],e,!1).map(G),1===h.length))return a.map(t=>i.pre+h[0]+t);if(u&&void 0!==h[0]&&void 0!==h[1]){const t=k(h[0]),e=k(h[1]),n=Math.max(h[0].length,h[1].length);let r=3===h.length&&void 0!==h[2]?Math.abs(k(h[2])):1,i=$;e<t&&(r*=-1,i=V);const s=h.some(U);p=[];for(let a=t;i(a,e);a+=r){let t;if(c)t=String.fromCharCode(a),"\\"===t&&(t="");else if(t=String(a),s){const e=n-t.length;if(e>0){const n=new Array(e+1).join("0");t=a<0?"-"+n+t.slice(1):n+t}}p.push(t)}}else{p=[];for(let t=0;t<h.length;t++)p.push.apply(p,W(h[t],e,!1))}for(let t=0;t<p.length;t++)for(let i=0;i<a.length&&r.length<e;i++){const e=s+p[t]+a[i];(!n||u||e)&&r.push(e)}}return r}const z=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},q={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Y=t=>t.replace(/[[\]\\-]/g,"\\$&"),X=t=>t.join(""),H=(t,e)=>{const n=e;if("["!==t.charAt(n))throw new Error("not in a brace expression");const r=[],i=[];let s=n+1,a=!1,o=!1,c=!1,u=!1,l=n,h="";t:for(;s<t.length;){const e=t.charAt(s);if("!"!==e&&"^"!==e||s!==n+1){if("]"===e&&a&&!c){l=s+1;break}if(a=!0,"\\"!==e||c){if("["===e&&!c)for(const[e,[a,c,u]]of Object.entries(q))if(t.startsWith(e,s)){if(h)return["$.",!1,t.length-n,!0];s+=e.length,u?i.push(a):r.push(a),o=o||c;continue t}c=!1,h?(e>h?r.push(Y(h)+"-"+Y(e)):e===h&&r.push(Y(e)),h="",s++):t.startsWith("-]",s+1)?(r.push(Y(e+"-")),s+=2):t.startsWith("-",s+1)?(h=e,s+=2):(r.push(Y(e)),s++)}else c=!0,s++}else u=!0,s++}if(l<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(0===i.length&&1===r.length&&/^\\?.$/.test(r[0])&&!u){const t=2===r[0].length?r[0].slice(-1):r[0];return[(p=t,p.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,l-n,!1]}var p;const f="["+(u?"^":"")+X(r)+"]",m="["+(u?"":"^")+X(i)+"]";return[r.length&&i.length?"("+f+"|"+m+")":r.length?f:m,o,l-n,!0]},Q=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!0}={})=>n?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),J=new Set(["!","?","+","*","@"]),Z=t=>J.has(t),tt="(?!\\.)",et=new Set(["[","."]),nt=new Set(["..","."]),rt=new Set("().*{}+?[]^$\\!"),it=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),st="[^/]",at=st+"*?",ot=st+"+?";class ct{type;#t;#e;#n=!1;#r=[];#i;#s;#a;#o=!1;#c;#u;#l=!1;constructor(t,e,n={}){this.type=t,t&&(this.#e=!0),this.#i=e,this.#t=this.#i?this.#i.#t:this,this.#c=this.#t===this?n:this.#t.#c,this.#a=this.#t===this?[]:this.#t.#a,"!"!==t||this.#t.#o||this.#a.push(this),this.#s=this.#i?this.#i.#r.length:0}get hasMagic(){if(void 0!==this.#e)return this.#e;for(const t of this.#r)if("string"!=typeof t&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return void 0!==this.#u?this.#u:this.type?this.#u=this.type+"("+this.#r.map(t=>String(t)).join("|")+")":this.#u=this.#r.map(t=>String(t)).join("")}#h(){if(this!==this.#t)throw new Error("should only call on root");if(this.#o)return this;let t;for(this.toString(),this.#o=!0;t=this.#a.pop();){if("!"!==t.type)continue;let e=t,n=e.#i;for(;n;){for(let r=e.#s+1;!n.type&&r<n.#r.length;r++)for(const e of t.#r){if("string"==typeof e)throw new Error("string part in extglob AST??");e.copyIn(n.#r[r])}e=n,n=e.#i}}return this}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof ct&&e.#i===this))throw new Error("invalid part: "+e);this.#r.push(e)}}toJSON(){const t=null===this.type?this.#r.slice().map(t=>"string"==typeof t?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#o&&"!"===this.#i?.type)&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#i?.isStart())return!1;if(0===this.#s)return!0;const t=this.#i;for(let e=0;e<this.#s;e++){const n=t.#r[e];if(!(n instanceof ct&&"!"===n.type))return!1}return!0}isEnd(){if(this.#t===this)return!0;if("!"===this.#i?.type)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();const t=this.#i?this.#i.#r.length:0;return this.#s===t-1}copyIn(t){"string"==typeof t?this.push(t):this.push(t.clone(this))}clone(t){const e=new ct(this.type,t);for(const t of this.#r)e.copyIn(t);return e}static#p(t,e,n,r){let i=!1,s=!1,a=-1,o=!1;if(null===e.type){let c=n,u="";for(;c<t.length;){const n=t.charAt(c++);if(i||"\\"===n)i=!i,u+=n;else if(s)c===a+1?"^"!==n&&"!"!==n||(o=!0):"]"!==n||c===a+2&&o||(s=!1),u+=n;else if("["!==n){if(!r.noext&&Z(n)&&"("===t.charAt(c)){e.push(u),u="";const i=new ct(n,e);c=ct.#p(t,i,c,r),e.push(i);continue}u+=n}else s=!0,a=c,o=!1,u+=n}return e.push(u),c}let c=n+1,u=new ct(null,e);const l=[];let h="";for(;c<t.length;){const n=t.charAt(c++);if(i||"\\"===n)i=!i,h+=n;else if(s)c===a+1?"^"!==n&&"!"!==n||(o=!0):"]"!==n||c===a+2&&o||(s=!1),h+=n;else if("["!==n){if(Z(n)&&"("===t.charAt(c)){u.push(h),h="";const e=new ct(n,u);u.push(e),c=ct.#p(t,e,c,r);continue}if("|"!==n){if(")"===n)return""===h&&0===e.#r.length&&(e.#l=!0),u.push(h),h="",e.push(...l,u),c;h+=n}else u.push(h),h="",l.push(u),u=new ct(null,e)}else s=!0,a=c,o=!1,h+=n}return e.type=null,e.#e=void 0,e.#r=[t.substring(n-1)],c}static fromGlob(t,e={}){const n=new ct(null,void 0,e);return ct.#p(t,n,0,e),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();const t=this.toString(),[e,n,r,i]=this.toRegExpSource();if(!(r||this.#e||this.#c.nocase&&!this.#c.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const s=(this.#c.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${e}$`,s),{_src:e,_glob:t})}get options(){return this.#c}toRegExpSource(t){const e=t??!!this.#c.dot;if(this.#t===this&&this.#h(),!this.type){const n=this.isStart()&&this.isEnd()&&!this.#r.some(t=>"string"!=typeof t),r=this.#r.map(e=>{const[r,i,s,a]="string"==typeof e?ct.#f(e,this.#e,n):e.toRegExpSource(t);return this.#e=this.#e||s,this.#n=this.#n||a,r}).join("");let i="";if(this.isStart()&&"string"==typeof this.#r[0]){if(!(1===this.#r.length&&nt.has(this.#r[0]))){const n=et,s=e&&n.has(r.charAt(0))||r.startsWith("\\.")&&n.has(r.charAt(2))||r.startsWith("\\.\\.")&&n.has(r.charAt(4)),a=!e&&!t&&n.has(r.charAt(0));i=s?"(?!(?:^|/)\\.\\.?(?:$|/))":a?tt:""}}let s="";this.isEnd()&&this.#t.#o&&"!"===this.#i?.type&&(s="(?:$|\\/)");return[i+r+s,Q(r),this.#e=!!this.#e,this.#n]}const n="*"===this.type||"+"===this.type,r="!"===this.type?"(?:(?!(?:":"(?:";let i=this.#m(e);if(this.isStart()&&this.isEnd()&&!i&&"!"!==this.type){const t=this.toString();return this.#r=[t],this.type=null,this.#e=void 0,[t,Q(this.toString()),!1,!1]}let s=!n||t||e?"":this.#m(!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let a="";if("!"===this.type&&this.#l)a=(this.isStart()&&!e?tt:"")+ot;else{a=r+i+("!"===this.type?"))"+(!this.isStart()||e||t?"":tt)+at+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&s?")":"*"===this.type&&s?")?":`)${this.type}`)}return[a,Q(i),this.#e=!!this.#e,this.#n]}#m(t){return this.#r.map(e=>{if("string"==typeof e)throw new Error("string type in extglob ast??");const[n,r,i,s]=e.toRegExpSource(t);return this.#n=this.#n||s,n}).filter(t=>!(this.isStart()&&this.isEnd()&&!t)).join("|")}static#f(t,e,n=!1){let r=!1,i="",s=!1,a=!1;for(let o=0;o<t.length;o++){const c=t.charAt(o);if(r)r=!1,i+=(rt.has(c)?"\\":"")+c;else if("*"!==c)if(a=!1,"\\"!==c){if("["===c){const[n,r,a,c]=H(t,o);if(a){i+=n,s=s||r,o+=a-1,e=e||c;continue}}"?"!==c?i+=it(c):(i+=st,e=!0)}else o===t.length-1?i+="\\\\":r=!0;else{if(a)continue;a=!0,i+=n&&/^[*]+$/.test(t)?ot:at,e=!0}}return[i,Q(t),!!e,s]}}const ut=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!1}={})=>n?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),lt=(t,e,n={})=>(z(e),!(!n.nocomment&&"#"===e.charAt(0))&&new Gt(e,n).match(t)),ht=/^\*+([^+@!?\*\[\(]*)$/,pt=t=>e=>!e.startsWith(".")&&e.endsWith(t),ft=t=>e=>e.endsWith(t),mt=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),dt=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),gt=/^\*+\.\*+$/,yt=t=>!t.startsWith(".")&&t.includes("."),bt=t=>"."!==t&&".."!==t&&t.includes("."),vt=/^\.\*+$/,Et=t=>"."!==t&&".."!==t&&t.startsWith("."),Tt=/^\*+$/,wt=t=>0!==t.length&&!t.startsWith("."),_t=t=>0!==t.length&&"."!==t&&".."!==t,At=/^\?+([^+@!?\*\[\(]*)?$/,Nt=([t,e=""])=>{const n=Ct([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},xt=([t,e=""])=>{const n=It([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},Ot=([t,e=""])=>{const n=It([t]);return e?t=>n(t)&&t.endsWith(e):n},St=([t,e=""])=>{const n=Ct([t]);return e?t=>n(t)&&t.endsWith(e):n},Ct=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},It=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},Dt="object"==typeof process&&process?"object"==typeof process.env&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Pt="win32"===Dt?{sep:"\\"}.sep:{sep:"/"}.sep;lt.sep=Pt;const Ft=Symbol("globstar **");lt.GLOBSTAR=Ft;const Mt=(t,e={})=>n=>lt(n,t,e);lt.filter=Mt;const jt=(t,e={})=>Object.assign({},t,e),Rt=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return lt;const e=lt;return Object.assign((n,r,i={})=>e(n,r,jt(t,i)),{Minimatch:class extends e.Minimatch{constructor(e,n={}){super(e,jt(t,n))}static defaults(n){return e.defaults(jt(t,n)).Minimatch}},AST:class extends e.AST{constructor(e,n,r={}){super(e,n,jt(t,r))}static fromGlob(n,r={}){return e.AST.fromGlob(n,jt(t,r))}},unescape:(n,r={})=>e.unescape(n,jt(t,r)),escape:(n,r={})=>e.escape(n,jt(t,r)),filter:(n,r={})=>e.filter(n,jt(t,r)),defaults:n=>e.defaults(jt(t,n)),makeRe:(n,r={})=>e.makeRe(n,jt(t,r)),braceExpand:(n,r={})=>e.braceExpand(n,jt(t,r)),match:(n,r,i={})=>e.match(n,r,jt(t,i)),sep:e.sep,GLOBSTAR:Ft})};lt.defaults=Rt;const kt=(t,e={})=>(z(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:K(t,{max:e.braceExpandMax}));lt.braceExpand=kt;const Lt=(t,e={})=>new Gt(t,e).makeRe();lt.makeRe=Lt;const Bt=(t,e,n={})=>{const r=new Gt(e,n);return t=t.filter(t=>r.match(t)),r.options.nonull&&!t.length&&t.push(e),t};lt.match=Bt;const Kt=/[?*]|[+@!]\(.*?\)|\[|\]/;class Gt{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){z(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Dt,this.isWindows="win32"===this.platform;this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(t=>this.slashSplit(t));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((t,e,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&Kt.test(t[2])||Kt.test(t[3])),n=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map(t=>this.parse(t))];if(n)return[t[0],...t.slice(1).map(t=>this.parse(t))]}return t.map(t=>this.parse(t))});if(this.debug(this.pattern,r),this.set=r.filter(t=>-1===t.indexOf(!1)),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)"**"===t[e][n]&&(t[e][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let n=e;for(;"**"===t[n+1];)n++;n!==e&&t.splice(e,n-e)}return t})}levelOneOptimize(t){return t.map(t=>(t=t.reduce((t,e)=>{const n=t[t.length-1];return"**"===e&&"**"===n?t:".."===e&&n&&".."!==n&&"."!==n&&"**"!==n?(t.pop(),t):(t.push(e),t)},[]),0===t.length?[""]:t))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const r=t[n];1===n&&""===r&&""===t[0]||("."!==r&&""!==r||(e=!0,t.splice(n,1),n--))}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let n=0;for(;-1!==(n=t.indexOf("..",n+1));){const r=t[n-1];r&&"."!==r&&".."!==r&&"**"!==r&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let r=-1;for(;-1!==(r=n.indexOf("**",r+1));){let i=r;for(;"**"===n[i+1];)i++;i>r&&n.splice(r+1,i-r);let s=n[r+1];const a=n[r+2],o=n[r+3];if(".."!==s)continue;if(!a||"."===a||".."===a||!o||"."===o||".."===o)continue;e=!0,n.splice(r,1);const c=n.slice(0);c[r]="**",t.push(c),r--}if(!this.preserveMultipleSlashes){for(let t=1;t<n.length-1;t++){const r=n[t];1===t&&""===r&&""===n[0]||("."!==r&&""!==r||(e=!0,n.splice(t,1),t--))}"."!==n[0]||2!==n.length||"."!==n[1]&&""!==n[1]||(e=!0,n.pop())}let i=0;for(;-1!==(i=n.indexOf("..",i+1));){const t=n[i-1];if(t&&"."!==t&&".."!==t&&"**"!==t){e=!0;const t=1===i&&"**"===n[i+1]?["."]:[];n.splice(i-1,2,...t),0===n.length&&n.push(""),i-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const r=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);if(r){t[e]=[],t[n]=r;break}}return t.filter(t=>t.length)}partsMatch(t,e,n=!1){let r=0,i=0,s=[],a="";for(;r<t.length&&i<e.length;)if(t[r]===e[i])s.push("b"===a?e[i]:t[r]),r++,i++;else if(n&&"**"===t[r]&&e[i]===t[r+1])s.push(t[r]),r++;else if(n&&"**"===e[i]&&t[r]===e[i+1])s.push(e[i]),i++;else if("*"!==t[r]||!e[i]||!this.options.dot&&e[i].startsWith(".")||"**"===e[i]){if("*"!==e[i]||!t[r]||!this.options.dot&&t[r].startsWith(".")||"**"===t[r])return!1;if("a"===a)return!1;a="b",s.push(e[i]),r++,i++}else{if("b"===a)return!1;a="a",s.push(t[r]),r++,i++}return t.length===e.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let r=0;r<t.length&&"!"===t.charAt(r);r++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){const r=this.options;if(this.isWindows){const n="string"==typeof t[0]&&/^[a-z]:$/i.test(t[0]),r=!n&&""===t[0]&&""===t[1]&&"?"===t[2]&&/^[a-z]:$/i.test(t[3]),i="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),s=r?3:n?0:void 0,a=!i&&""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])?3:i?0:void 0;if("number"==typeof s&&"number"==typeof a){const[n,r]=[t[s],e[a]];n.toLowerCase()===r.toLowerCase()&&(e[a]=n,a>s?e=e.slice(a):s>a&&(t=t.slice(s)))}}const{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var s=0,a=0,o=t.length,c=e.length;s<o&&a<c;s++,a++){this.debug("matchOne loop");var u=e[a],l=t[s];if(this.debug(e,u,l),!1===u)return!1;if(u===Ft){this.debug("GLOBSTAR",[e,u,l]);var h=s,p=a+1;if(p===c){for(this.debug("** at the end");s<o;s++)if("."===t[s]||".."===t[s]||!r.dot&&"."===t[s].charAt(0))return!1;return!0}for(;h<o;){var f=t[h];if(this.debug("\nglobstar while",t,h,e,p,f),this.matchOne(t.slice(h),e.slice(p),n))return this.debug("globstar found match!",h,o,f),!0;if("."===f||".."===f||!r.dot&&"."===f.charAt(0)){this.debug("dot detected!",t,h,e,p);break}this.debug("globstar swallow a segment, and continue"),h++}return!(!n||(this.debug("\n>>> no match, partial?",t,h,e,p),h!==o))}let i;if("string"==typeof u?(i=l===u,this.debug("string match",u,l,i)):(i=u.test(l),this.debug("pattern match",u,l,i)),!i)return!1}if(s===o&&a===c)return!0;if(s===o)return n;if(a===c)return s===o-1&&""===t[s];throw new Error("wtf?")}braceExpand(){return kt(this.pattern,this.options)}parse(t){z(t);const e=this.options;if("**"===t)return Ft;if(""===t)return"";let n,r=null;(n=t.match(Tt))?r=e.dot?_t:wt:(n=t.match(ht))?r=(e.nocase?e.dot?dt:mt:e.dot?ft:pt)(n[1]):(n=t.match(At))?r=(e.nocase?e.dot?xt:Nt:e.dot?Ot:St)(n):(n=t.match(gt))?r=e.dot?bt:yt:(n=t.match(vt))&&(r=Et);const i=ct.fromGlob(t,this.options).toMMPattern();return r&&"object"==typeof i&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=new Set(e.nocase?["i"]:[]);let i=t.map(t=>{const e=t.map(t=>{if(t instanceof RegExp)for(const e of t.flags.split(""))r.add(e);return"string"==typeof t?t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):t===Ft?Ft:t._src});e.forEach((t,r)=>{const i=e[r+1],s=e[r-1];t===Ft&&s!==Ft&&(void 0===s?void 0!==i&&i!==Ft?e[r+1]="(?:\\/|"+n+"\\/)?"+i:e[r]=n:void 0===i?e[r-1]=s+"(?:\\/|\\/"+n+")?":i!==Ft&&(e[r-1]=s+"(?:\\/|\\/"+n+"\\/)"+i,e[r+1]=Ft))});const i=e.filter(t=>t!==Ft);if(this.partial&&i.length>=1){const t=[];for(let e=1;e<=i.length;e++)t.push(i.slice(0,e).join("/"));return"(?:"+t.join("|")+")"}return i.join("/")}).join("|");const[s,a]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+a+"$",this.partial&&(i="^(?:\\/|"+s+i.slice(1,-1)+a+")$"),this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...r].join(""))}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const r=this.slashSplit(t);this.debug(this.pattern,"split",r);const i=this.set;this.debug(this.pattern,"set",i);let s=r[r.length-1];if(!s)for(let t=r.length-2;!s&&t>=0;t--)s=r[t];for(let t=0;t<i.length;t++){const a=i[t];let o=r;n.matchBase&&1===a.length&&(o=[s]);if(this.matchOne(o,a,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return lt.defaults(t).Minimatch}}lt.AST=ct,lt.Minimatch=Gt,lt.escape=ut,lt.unescape=Q;var Ut=Object.freeze({__proto__:null,minimatch:lt,sep:Pt,GLOBSTAR:Ft,filter:Mt,defaults:Rt,braceExpand:kt,makeRe:Lt,match:Bt,Minimatch:Gt,AST:ct,escape:ut,unescape:Q}),$t=r.getAugmentedNamespace(Ut),Vt=function(){function t(t){this.matchers=t.map(function(t){return"string"==typeof t?new $t.Minimatch(t):t})}return t.prototype.match=function(t){for(var e=0;e<this.matchers.length;e++)if(this.matchers[e].match(t))return!0;return!1},t.prototype.mayContain=function(t){for(var e=t.split(/\/|\\/g).filter(Boolean),n=0;n<this.matchers.length;n++)for(var r=this.matchers[n],i=0;i<r.set.length;i++)if(r.matchOne(e,r.set[i],!0))return!0;return!1},t}();function Wt(t,e){const n=qt(e);let r;return r=n.includeBasePath?function(t){return t.basePath.split(c.default.sep).join("/").replace(/\/+$/,"")+"/"+t.relativePath}:function(t){return t.relativePath},Ht(t,n,null,[]).map(r)}function zt(t){return void 0!==t}function qt(t){let e={};return Array.isArray(t)?e.globs=t:t&&(e=t),e}function Yt(t,e){return null==t?void 0:t.map(t=>"string"==typeof t?new $t.Minimatch(t,e):t)}function Xt(t,e){const n=t.relativePath,r=e.relativePath;return n===r?0:n<r?-1:1}function Ht(t,e,n,r){var i;const s=null!==(i=e.fs)&&void 0!==i?i:u.default,a=function(t){return null==t?"":"/"!==t.slice(-1)?t+"/":t}(n),o=s.realpathSync(t+"/"+a);if(r.indexOf(o)>=0)return[];r.push(o);try{const n=e.globOptions,i=zt(n)?Yt(e.ignore,n):e.ignore,o=zt(n)?Yt(e.globs,n):e.globs;let c,l,h=[];if(i&&(l=new Vt(i)),o&&(c=new Vt(o)),c&&!c.mayContain(a))return h;const p=s.readdirSync(t+"/"+a).map(e=>{let n=a+e;if(l&&l.match(n))return;let r=function(t,e=u.default){try{return e.statSync(t)}catch(t){if(null!==t&&"object"==typeof t&&["ENOENT","ENOTDIR","EPERM"].includes(t.code))return;throw t}}(t+"/"+n,s);return r&&r.isDirectory()?new Wt.Entry(n+"/",t,r.mode,r.size,r.mtime.getTime()):new Wt.Entry(n,t,r&&r.mode||0,r&&r.size||0,r&&r.mtime.getTime()||0)}).filter(zt),f=p.sort(Xt);for(let n=0;n<f.length;++n){let i=f[n];i.isDirectory()?(!1===e.directories||c&&!c.match(i.relativePath)||h.push(i),h=h.concat(Ht(t,e,i.relativePath,r))):c&&!c.match(i.relativePath)||h.push(i)}return h}finally{r.pop()}}!function(t){t.entries=function(t,e){const n=qt(e);return Ht((r=t,"/"!==c.default.sep?r.split(c.default.sep).join("/"):r),n,null,[]);var r};t.Entry=class{constructor(t,e,n,r,i){this.relativePath=t,this.basePath=e,this.mode=n,this.size=r,this.mtime=i}get fullPath(){return`${this.basePath}/${this.relativePath}`}isDirectory(){return(this.mode&u.default.constants.S_IFMT)===u.default.constants.S_IFDIR}}}(Wt||(Wt={}));var Qt=Wt;function Jt(...t){return async e=>{let n=e;for(const e of t)n=await e(n);return n}}var Zt=Object.prototype.hasOwnProperty,te=ee;function ee(t){if(!(this instanceof ee))throw new TypeError("Constructor PseudoMap requires 'new'");if(this.clear(),t)if(t instanceof ee||"function"==typeof Map&&t instanceof Map)t.forEach(function(t,e){this.set(e,t)},this);else{if(!Array.isArray(t))throw new TypeError("invalid argument");t.forEach(function(t){this.set(t[0],t[1])},this)}}function ne(t,e){return t===e||t!=t&&e!=e}function re(t,e,n){this.key=t,this.value=e,this._index=n}function ie(t,e){for(var n=0,r="_"+e,i=r;Zt.call(t,i);i=r+n++)if(ne(t[i].key,e))return t[i]}ee.prototype.forEach=function(t,e){e=e||this,Object.keys(this._data).forEach(function(n){"size"!==n&&t.call(e,this._data[n].value,this._data[n].key)},this)},ee.prototype.has=function(t){return!!ie(this._data,t)},ee.prototype.get=function(t){var e=ie(this._data,t);return e&&e.value},ee.prototype.set=function(t,e){!function(t,e,n){for(var r=0,i="_"+e,s=i;Zt.call(t,s);s=i+r++)if(ne(t[s].key,e))return void(t[s].value=n);t.size++,t[s]=new re(e,n,s)}(this._data,t,e)},ee.prototype.delete=function(t){var e=ie(this._data,t);e&&(delete this._data[e._index],this._data.size--)},ee.prototype.clear=function(){var t=Object.create(null);t.size=0,Object.defineProperty(this,"_data",{value:t,enumerable:!1,configurable:!0,writable:!1})},Object.defineProperty(ee.prototype,"size",{get:function(){return this._data.size},set:function(t){},enumerable:!0,configurable:!0}),ee.prototype.values=ee.prototype.keys=ee.prototype.entries=function(){throw new Error("iterators are not implemented in this version")};var se=r.createCommonjsModule(function(t){"pseudomap"===process.env.npm_package_name&&"test"===process.env.npm_lifecycle_script&&(process.env.TEST_PSEUDOMAP="true"),"function"!=typeof Map||process.env.TEST_PSEUDOMAP?t.exports=te:t.exports=Map}),ae=oe;function oe(t){var e=this;if(e instanceof oe||(e=new oe),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach(function(t){e.push(t)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}function ce(t,e){t.tail=new le(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function ue(t,e){t.head=new le(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function le(t,e,n,r){if(!(this instanceof le))return new le(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}oe.Node=le,oe.create=oe,oe.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null},oe.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},oe.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},oe.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)ce(this,arguments[t]);return this.length},oe.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)ue(this,arguments[t]);return this.length},oe.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},oe.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},oe.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;null!==n;r++)t.call(e,n.value,r,this),n=n.next},oe.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;null!==n;r--)t.call(e,n.value,r,this),n=n.prev},oe.prototype.get=function(t){for(var e=0,n=this.head;null!==n&&e<t;e++)n=n.next;if(e===t&&null!==n)return n.value},oe.prototype.getReverse=function(t){for(var e=0,n=this.tail;null!==n&&e<t;e++)n=n.prev;if(e===t&&null!==n)return n.value},oe.prototype.map=function(t,e){e=e||this;for(var n=new oe,r=this.head;null!==r;)n.push(t.call(e,r.value,this)),r=r.next;return n},oe.prototype.mapReverse=function(t,e){e=e||this;for(var n=new oe,r=this.tail;null!==r;)n.push(t.call(e,r.value,this)),r=r.prev;return n},oe.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=t(n,r.value,i),r=r.next;return n},oe.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=t(n,r.value,i),r=r.prev;return n},oe.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},oe.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},oe.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new oe;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;null!==i&&r<t;r++)i=i.next;for(;null!==i&&r<e;r++,i=i.next)n.push(i.value);return n},oe.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new oe;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;null!==i&&r>e;r--)i=i.prev;for(;null!==i&&r>t;r--,i=i.prev)n.push(i.value);return n},oe.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};var he,pe=_e,fe=(he="function"==typeof Symbol&&"1"!==process.env._nodeLRUCacheForceNoSymbol?function(t){return Symbol(t)}:function(t){return"_"+t})("max"),me=he("length"),de=he("lengthCalculator"),ge=he("allowStale"),ye=he("maxAge"),be=he("dispose"),ve=he("noDisposeOnSet"),Ee=he("lruList"),Te=he("cache");function we(){return 1}function _e(t){if(!(this instanceof _e))return new _e(t);"number"==typeof t&&(t={max:t}),t||(t={});var e=this[fe]=t.max;(!e||"number"!=typeof e||e<=0)&&(this[fe]=1/0);var n=t.length||we;"function"!=typeof n&&(n=we),this[de]=n,this[ge]=t.stale||!1,this[ye]=t.maxAge||0,this[be]=t.dispose,this[ve]=t.noDisposeOnSet||!1,this.reset()}function Ae(t,e,n,r){var i=n.value;xe(t,i)&&(Se(t,n),t[ge]||(i=void 0)),i&&e.call(r,i.value,i.key,t)}function Ne(t,e,n){var r=t[Te].get(e);if(r){var i=r.value;xe(t,i)?(Se(t,r),t[ge]||(i=void 0)):n&&t[Ee].unshiftNode(r),i&&(i=i.value)}return i}function xe(t,e){if(!e||!e.maxAge&&!t[ye])return!1;var n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[ye]&&n>t[ye]}function Oe(t){if(t[me]>t[fe])for(var e=t[Ee].tail;t[me]>t[fe]&&null!==e;){var n=e.prev;Se(t,e),e=n}}function Se(t,e){if(e){var n=e.value;t[be]&&t[be](n.key,n.value),t[me]-=n.length,t[Te].delete(n.key),t[Ee].removeNode(e)}}function Ce(t,e,n,r,i){this.key=t,this.value=e,this.length=n,this.now=r,this.maxAge=i||0}Object.defineProperty(_e.prototype,"max",{set:function(t){(!t||"number"!=typeof t||t<=0)&&(t=1/0),this[fe]=t,Oe(this)},get:function(){return this[fe]},enumerable:!0}),Object.defineProperty(_e.prototype,"allowStale",{set:function(t){this[ge]=!!t},get:function(){return this[ge]},enumerable:!0}),Object.defineProperty(_e.prototype,"maxAge",{set:function(t){(!t||"number"!=typeof t||t<0)&&(t=0),this[ye]=t,Oe(this)},get:function(){return this[ye]},enumerable:!0}),Object.defineProperty(_e.prototype,"lengthCalculator",{set:function(t){"function"!=typeof t&&(t=we),t!==this[de]&&(this[de]=t,this[me]=0,this[Ee].forEach(function(t){t.length=this[de](t.value,t.key),this[me]+=t.length},this)),Oe(this)},get:function(){return this[de]},enumerable:!0}),Object.defineProperty(_e.prototype,"length",{get:function(){return this[me]},enumerable:!0}),Object.defineProperty(_e.prototype,"itemCount",{get:function(){return this[Ee].length},enumerable:!0}),_e.prototype.rforEach=function(t,e){e=e||this;for(var n=this[Ee].tail;null!==n;){var r=n.prev;Ae(this,t,n,e),n=r}},_e.prototype.forEach=function(t,e){e=e||this;for(var n=this[Ee].head;null!==n;){var r=n.next;Ae(this,t,n,e),n=r}},_e.prototype.keys=function(){return this[Ee].toArray().map(function(t){return t.key},this)},_e.prototype.values=function(){return this[Ee].toArray().map(function(t){return t.value},this)},_e.prototype.reset=function(){this[be]&&this[Ee]&&this[Ee].length&&this[Ee].forEach(function(t){this[be](t.key,t.value)},this),this[Te]=new se,this[Ee]=new ae,this[me]=0},_e.prototype.dump=function(){return this[Ee].map(function(t){if(!xe(this,t))return{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}},this).toArray().filter(function(t){return t})},_e.prototype.dumpLru=function(){return this[Ee]},_e.prototype.inspect=function(t,e){var n="LRUCache {",r=!1;this[ge]&&(n+="\n allowStale: true",r=!0);var i=this[fe];i&&i!==1/0&&(r&&(n+=","),n+="\n max: "+l.default.inspect(i,e),r=!0);var s=this[ye];s&&(r&&(n+=","),n+="\n maxAge: "+l.default.inspect(s,e),r=!0);var a=this[de];a&&a!==we&&(r&&(n+=","),n+="\n length: "+l.default.inspect(this[me],e),r=!0);var o=!1;return this[Ee].forEach(function(t){o?n+=",\n ":(r&&(n+=",\n"),o=!0,n+="\n ");var i=l.default.inspect(t.key).split("\n").join("\n "),c={value:t.value};t.maxAge!==s&&(c.maxAge=t.maxAge),a!==we&&(c.length=t.length),xe(this,t)&&(c.stale=!0),c=l.default.inspect(c,e).split("\n").join("\n "),n+=i+" => "+c}),(o||r)&&(n+="\n"),n+="}"},_e.prototype.set=function(t,e,n){var r=(n=n||this[ye])?Date.now():0,i=this[de](e,t);if(this[Te].has(t)){if(i>this[fe])return Se(this,this[Te].get(t)),!1;var s=this[Te].get(t).value;return this[be]&&(this[ve]||this[be](t,s.value)),s.now=r,s.maxAge=n,s.value=e,this[me]+=i-s.length,s.length=i,this.get(t),Oe(this),!0}var a=new Ce(t,e,i,r,n);return a.length>this[fe]?(this[be]&&this[be](t,e),!1):(this[me]+=a.length,this[Ee].unshift(a),this[Te].set(t,this[Ee].head),Oe(this),!0)},_e.prototype.has=function(t){return!!this[Te].has(t)&&!xe(this,this[Te].get(t).value)},_e.prototype.get=function(t){return Ne(this,t,!0)},_e.prototype.peek=function(t){return Ne(this,t,!1)},_e.prototype.pop=function(){var t=this[Ee].tail;return t?(Se(this,t),t.value):null},_e.prototype.del=function(t){Se(this,this[Te].get(t))},_e.prototype.load=function(t){this.reset();for(var e=Date.now(),n=t.length-1;n>=0;n--){var r=t[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var s=i-e;s>0&&this.set(r.k,r.v,s)}}},_e.prototype.prune=function(){var t=this;this[Te].forEach(function(e,n){Ne(t,n,!1)})};var Ie=function(t,e){e=e||10;var n=[],r="",i=RegExp;return function t(s,a){if(a>e)return;if("function"==typeof s||void 0===s)return;if("object"!=typeof s||!s||s instanceof i)return void(r+=s);if(-1!==n.indexOf(s)||a===e)return;n.push(s),r+="{",Object.keys(s).forEach(function(e,n,i){if("_"!==e.charAt(0)){var o=typeof s[e];"function"!==o&&"undefined"!==o&&(r+=e,t(s[e],a+1))}})}(t,0),r};var De=r.createCommonjsModule(function(t,e){var n="object"==typeof process?process.platform:"win32";t?t.exports=l:e.minimatch=l,l.Minimatch=h,l.cache=new pe({max:100});var r=l.GLOBSTAR=h.GLOBSTAR={},i="[^/]",s=i+"*?",a="().*{}+?[]^$\\!".split("").reduce(function(t,e){return t[e]=!0,t},{});var o=/\/+/;function u(t,e){t=t||{},e=e||{};var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n}function l(t,e,n){if("string"!=typeof e)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===e.charAt(0))&&(""===e.trim()?""===t:new h(e,n).match(t))}function h(t,e){if(!(this instanceof h))return new h(t,e);if("string"!=typeof t)throw new TypeError("glob pattern string required");e||(e={}),"win32"===n&&(t=t.split("\\").join("/"));var r=t+"\n"+Ie(e),i=l.cache.get(r);if(i)return i;l.cache.set(r,this),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}l.monkeyPatch=function(){var t=Object.getOwnPropertyDescriptor(String.prototype,"match"),e=t.value;t.value=function(t){return t instanceof h?t.match(this):e.call(this,t)},Object.defineProperty(String.prototype,t)},l.filter=function(t,e){return e=e||{},function(n,r,i){return l(n,t,e)}},l.defaults=function(t){if(!t||!Object.keys(t).length)return l;var e=l,n=function(n,r,i){return e.minimatch(n,r,u(t,i))};return n.Minimatch=function(n,r){return new e.Minimatch(n,u(t,r))},n},h.defaults=function(t){return t&&Object.keys(t).length?l.defaults(t).Minimatch:h},h.prototype.make=function(){if(this._made)return;var t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();e.debug&&console.error(this.pattern,n);n=this.globParts=n.map(function(t){return t.split(o)}),e.debug&&console.error(this.pattern,n);n=n.map(function(t,e,n){return t.map(this.parse,this)},this),e.debug&&console.error(this.pattern,n);n=n.filter(function(t){return-1===t.indexOf(!1)}),e.debug&&console.error(this.pattern,n);this.set=n},h.prototype.parseNegate=function(){var t=this.pattern,e=!1,n=this.options,r=0;if(n.nonegate)return;for(var i=0,s=t.length;i<s&&"!"===t.charAt(i);i++)e=!e,r++;r&&(this.pattern=t.substr(r));this.negate=e},l.braceExpand=function(t,e){return new h(t,e).braceExpand()},h.prototype.braceExpand=function t(e,n){if(n=n||this.options,void 0===(e=void 0===e?this.pattern:e))throw new Error("undefined pattern");if(n.nobrace||!e.match(/\{.*\}/))return[e];var r=!1;if("{"!==e.charAt(0)){for(var i=null,s=0,a=e.length;s<a;s++){if("\\"===(b=e.charAt(s)))r=!r;else if("{"===b&&!r){i=e.substr(0,s);break}}return null===i?[e]:t(e.substr(s),n).map(function(t){return i+t})}var o=e.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(o){var c=t(e.substr(o[0].length),n),u=+o[1],l=+o[2],h=u>l?-1:1,p=[];for(s=u;s!=l+h;s+=h)for(var f=0,m=c.length;f<m;f++)p.push(s+c[f]);return p}s=1;var d=1,g=(p=[],"");r=!1;function y(){p.push(g),g=""}t:for(s=1,a=e.length;s<a;s++){var b=e.charAt(s);if(r)r=!1,g+="\\"+b;else switch(b){case"\\":r=!0;continue;case"{":d++,g+="{";continue;case"}":if(0===--d){y(),s++;break t}g+=b;continue;case",":1===d?y():g+=b;continue;default:g+=b;continue}}if(0!==d)return t("\\"+e,n);c=t(e.substr(s),n);var v=1===p.length;p=p.map(function(e){return t(e,n)}),p=p.reduce(function(t,e){return t.concat(e)}),v&&(p=p.map(function(t){return"{"+t+"}"}));var E=[];for(s=0,a=p.length;s<a;s++)for(f=0,m=c.length;f<m;f++)E.push(p[s]+c[f]);return E},h.prototype.parse=function(t,e){var n=this.options;if(!n.noglobstar&&"**"===t)return r;if(""===t)return"";var o,c,u,l="",h=!!n.nocase,f=!1,m=[],d=!1,g=-1,y=-1,b="."===t.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";function v(){if(c){switch(c){case"*":l+=s,h=!0;break;case"?":l+=i,h=!0;break;default:l+="\\"+c}c=!1}}for(var E,T=0,w=t.length;T<w&&(E=t.charAt(T));T++)if(n.debug&&console.error("%s\t%s %s %j",t,T,l,E),f&&a[E])l+="\\"+E,f=!1;else switch(E){case"/":return!1;case"\\":v(),f=!0;continue;case"?":case"*":case"+":case"@":case"!":if(n.debug&&console.error("%s\t%s %s %j <-- stateChar",t,T,l,E),d){"!"===E&&T===y+1&&(E="^"),l+=E;continue}v(),c=E,n.noext&&v();continue;case"(":if(d){l+="(";continue}if(!c){l+="\\(";continue}o=c,m.push({type:o,start:T-1,reStart:l.length}),l+="!"===c?"(?:(?!":"(?:",c=!1;continue;case")":if(d||!m.length){l+="\\)";continue}switch(h=!0,l+=")",o=m.pop().type){case"!":l+="[^/]*?)";break;case"?":case"+":case"*":l+=o}continue;case"|":if(d||!m.length||f){l+="\\|",f=!1;continue}l+="|";continue;case"[":if(v(),d){l+="\\"+E;continue}d=!0,y=T,g=l.length,l+=E;continue;case"]":if(T===y+1||!d){l+="\\"+E,f=!1;continue}h=!0,d=!1,l+=E;continue;default:v(),f?f=!1:!a[E]||"^"===E&&d||(l+="\\"),l+=E}if(d){var _=t.substr(y+1),A=this.parse(_,p);l=l.substr(0,g)+"\\["+A[0],h=h||A[1]}for(;u=m.pop();){var N=l.slice(u.reStart+3);N=N.replace(/((?:\\{2})*)(\\?)\|/g,function(t,e,n){return n||(n="\\"),e+e+n+"|"});var x="*"===u.type?s:"?"===u.type?i:"\\"+u.type;h=!0,l=l.slice(0,u.reStart)+x+"\\("+N}v(),f&&(l+="\\\\");var O=!1;switch(l.charAt(0)){case".":case"[":case"(":O=!0}""!==l&&h&&(l="(?=.)"+l);O&&(l=b+l);if(e===p)return[l,h];if(!h)return function(t){return t.replace(/\\(.)/g,"$1")}(t);var S=n.nocase?"i":"",C=new RegExp("^"+l+"$",S);return C._glob=t,C._src=l,C};var p={};l.makeRe=function(t,e){return new h(t,e||{}).makeRe()},h.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1;var e=this.options,n=e.noglobstar?s:e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=e.nocase?"i":"",a=t.map(function(t){return t.map(function(t){return t===r?n:"string"==typeof t?function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(t):t._src}).join("\\/")}).join("|");a="^(?:"+a+")$",this.negate&&(a="^(?!"+a+").*$");try{return this.regexp=new RegExp(a,i)}catch(t){return this.regexp=!1}},l.match=function(t,e,n){var r=new h(e,n);return t=t.filter(function(t){return r.match(t)}),n.nonull&&!t.length&&t.push(e),t},h.prototype.match=function(t,e){if(this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;var r=this.options;"win32"===n&&(t=t.split("\\").join("/"));t=t.split(o),r.debug&&console.error(this.pattern,"split",t);for(var i=this.set,s=0,a=i.length;s<a;s++){var c=i[s];if(this.matchOne(t,c,e))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate},h.prototype.matchOne=function(t,e,n){var i=this.options;i.debug&&console.error("matchOne",{this:this,file:t,pattern:e}),i.matchBase&&1===e.length&&(t=c.default.basename(t.join("/")).split("/")),i.debug&&console.error("matchOne",t.length,e.length);for(var s=0,a=0,o=t.length,u=e.length;s<o&&a<u;s++,a++){i.debug&&console.error("matchOne loop");var l,h=e[a],p=t[s];if(i.debug&&console.error(e,h,p),!1===h)return!1;if(h===r){i.debug&&console.error("GLOBSTAR",[e,h,p]);var f=s,m=a+1;if(m===u){for(i.debug&&console.error("** at the end");s<o;s++)if("."===t[s]||".."===t[s]||!i.dot&&"."===t[s].charAt(0))return!1;return!0}t:for(;f<o;){var d=t[f];if(i.debug&&console.error("\nglobstar while",t,f,e,m,d),this.matchOne(t.slice(f),e.slice(m),n))return i.debug&&console.error("globstar found match!",f,o,d),!0;if("."===d||".."===d||!i.dot&&"."===d.charAt(0)){i.debug&&console.error("dot detected!",t,f,e,m);break t}i.debug&&console.error("globstar swallow a segment, and continue"),f++}return!(!n||f!==o)}if("string"==typeof h?(l=i.nocase?p.toLowerCase()===h.toLowerCase():p===h,i.debug&&console.error("string match",h,p,l)):(l=p.match(h),i.debug&&console.error("pattern match",h,p,l)),!l)return!1}if(s===o&&a===u)return!0;if(s===o)return n;if(a===u)return s===o-1&&""===t[s];throw new Error("wtf?")}}),Pe=r.createCommonjsModule(function(t,e){var n=r.commonjsGlobal&&r.commonjsGlobal.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,s){function a(t){try{c(r.next(t))}catch(t){s(t)}}function o(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(a,o)}c((r=r.apply(t,e||[])).next())})},i=r.commonjsGlobal&&r.commonjsGlobal.__generator||function(t,e){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=r.commonjsGlobal&&r.commonjsGlobal.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=s(u.default),o={section:/^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,param:/^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,comment:/^\s*[#;].*$/};function c(t){var e={},n=null,r=[[n,e]];return t.split(/\r\n|\r|\n/).forEach(function(t){var i;o.comment.test(t)||(o.param.test(t)?(i=t.match(o.param),e[i[1]]=i[2]):o.section.test(t)&&(i=t.match(o.section),n=i[1],e={},r.push([n,e])))}),r}e.parse=function(t){return n(this,void 0,void 0,function(){return i(this,function(e){return[2,new Promise(function(e,n){a.readFile(t,"utf8",function(t,r){t?n(t):e(c(r))})})]})})},e.parseSync=function(t){return c(a.readFileSync(t,"utf8"))},e.parseString=c}),Fe={name:"editorconfig",version:"0.15.3",description:"EditorConfig File Locator and Interpreter for Node.js",keywords:["editorconfig","core"],main:"src/index.js",contributors:["Hong Xu (topbug.net)","Jed Mao (https://github.com/jedmao/)","Trey Hunner (http://treyhunner.com)"],directories:{bin:"./bin",lib:"./lib"},scripts:{clean:"rimraf dist",prebuild:"npm run clean",build:"tsc",pretest:"npm run lint && npm run build && npm run copy && cmake .",test:"ctest .","pretest:ci":"npm run pretest","test:ci":"ctest -VV --output-on-failure .",lint:"npm run eclint && npm run tslint",eclint:'eclint check --indent_size ignore "src/**"',tslint:"tslint --project tsconfig.json --exclude package.json",copy:"cpy .npmignore LICENSE README.md CHANGELOG.md dist && cpy bin/* dist/bin && cpy src/lib/fnmatch*.* dist/src/lib",prepub:"npm run lint && npm run build && npm run copy",pub:"npm publish ./dist"},repository:{type:"git",url:"git://github.com/editorconfig/editorconfig-core-js.git"},bugs:"https://github.com/editorconfig/editorconfig-core-js/issues",author:"EditorConfig Team",license:"MIT",dependencies:{commander:"^2.19.0","lru-cache":"^4.1.5",semver:"^5.6.0",sigmund:"^1.0.1"},devDependencies:{"@types/mocha":"^5.2.6","@types/node":"^10.12.29","@types/semver":"^5.5.0","cpy-cli":"^2.0.0",eclint:"^2.8.1",mocha:"^5.2.0",rimraf:"^2.6.3",should:"^13.2.3",tslint:"^5.13.1",typescript:"^3.3.3333"}},Me=r.createCommonjsModule(function(e,n){var i=r.commonjsGlobal&&r.commonjsGlobal.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,s){function a(t){try{c(r.next(t))}catch(t){s(t)}}function o(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(a,o)}c((r=r.apply(t,e||[])).next())})},s=r.commonjsGlobal&&r.commonjsGlobal.__generator||function(t,e){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},a=r.commonjsGlobal&&r.commonjsGlobal.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},o=r.commonjsGlobal&&r.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var l=a(u.default),h=a(c.default),p=a(t.semver),f=o(De);n.parseString=Pe.parseString;var m=o(Fe),d={end_of_line:!0,indent_style:!0,indent_size:!0,insert_final_newline:!0,trim_trailing_whitespace:!0,charset:!0};function g(t,e){var n=[];do{t=h.dirname(t),n.push(h.join(t,e.config))}while(t!==e.root);return n}function y(t,e){return void 0===t&&(t={}),{config:t.config||".editorconfig",version:t.version||m.default.version,root:h.resolve(t.root||h.parse(e).root)}}function b(t,e,n){return function(t,e){return"indent_style"in t&&"tab"===t.indent_style&&!("indent_size"in t)&&p.gte(e,"0.10.0")&&(t.indent_size="tab"),"indent_size"in t&&!("tab_width"in t)&&"tab"!==t.indent_size&&(t.tab_width=t.indent_size),"indent_size"in t&&"tab_width"in t&&"tab"===t.indent_size&&(t.indent_size=t.tab_width),t}(t.reverse().reduce(function(t,n){var r=h.dirname(n.name);return n.contents.forEach(function(n){var i=n[0],s=n[1];if(i){var a=function(t,e){switch(e.indexOf("/")){case-1:e="**/"+e;break;case 0:e=e.substring(1)}return h.join(t,e)}(r,i);(function(t,e){return e=e.replace(/\*\*/g,"{*,**/**/**}"),f.default(t,e,{matchBase:!0,dot:!0,noext:!0})})(e,a)&&(t=function(t,e){for(var n in void 0===t&&(t={}),void 0===e&&(e={}),e)if(e.hasOwnProperty(n)){var r=e[n],i=n.toLowerCase(),s=r;d[i]&&(s=r.toLowerCase());try{s=JSON.parse(r)}catch(t){}null==r&&(s=String(r)),t[i]=s}return t}(t,s))}}),t},{}),n.version)}function v(t){var e=[];for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=Pe.parseString(r.contents);if(e.push({name:r.name,contents:i}),"true"===(i[0][1].root||"").toLowerCase())break}return e}function E(t){return i(this,void 0,void 0,function(){return s(this,function(e){return[2,Promise.all(t.map(function(t){return new Promise(function(e){l.readFile(t,"utf8",function(n,r){e({name:t,contents:n?"":r})})})}))]})})}function T(t,e){void 0===e&&(e={});var n=h.resolve(t);return[n,y(e,n)]}n.parseFromFiles=function(t,e,n){return void 0===n&&(n={}),i(this,void 0,void 0,function(){var r,i,a;return s(this,function(s){return r=T(t,n),i=r[0],a=r[1],[2,e.then(v).then(function(t){return b(t,i,a)})]})})},n.parseFromFilesSync=function(t,e,n){void 0===n&&(n={});var r=T(t,n),i=r[0],s=r[1];return b(v(e),i,s)},n.parse=function(t,e){return void 0===e&&(e={}),i(this,void 0,void 0,function(){var n,r,i;return s(this,function(s){return n=T(t,e),r=n[0],i=n[1],[2,E(g(r,i)).then(v).then(function(t){return b(t,r,i)})]})})},n.parseSync=function(t,e){void 0===e&&(e={});var n=T(t,e),r=n[0],i=n[1];return b(v(function(t){var e,n=[];return t.forEach(function(t){try{e=l.readFileSync(t,"utf8")}catch(t){e=""}n.push({name:t,contents:e})}),n}(g(r,i))),r,i)}});const je=t.env.debug("vbapm:editor-config"),Re=new Map;async function ke(n){const{end_of_line:r,trim_trailing_whitespace:i,insert_final_newline:s}=await async function(t){const n=e.extname(t.filename);if(Re.has(n))return Re.get(n);const r=await Me.parse(t.filename);return Re.set(n,r),je(`Formatting ${n} with`,r),r}(n),a="lf"===r?"\n":"\r\n",o=n.code.split(t.BY_LINE).map(i?Le:Be).join(a);return n.code=s?function(t){"\n"!==t[t.length-1]&&(t+="\n");return t}(o):o,n}function Le(t){return t.trimEnd()}function Be(t){return t}var Ke=Object.freeze({__proto__:null,toCompiled:async function(t){return t},toSrc:async function(e){const{name:n,references:r,fromDependencies:i}=e;return{name:n,components:await t.parallel(e.components,ke),references:r,fromDependencies:i}}});const Ge=[Ke];Jt(...Ge.map(t=>t.toCompiled).filter(Boolean));const Ue=Jt(...Ge.map(t=>t.toSrc).filter(Boolean));var $e,Ve,We=r.createCommonjsModule(function(t,e){!function(t){t.parser=function(t,e){return new r(t,e)},t.SAXParser=r,t.SAXStream=s,t.createStream=function(t,e){return new s(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function r(e,i){if(!(this instanceof r))return new r(e,i);var s=this;!function(t){for(var e=0,r=n.length;e<r;e++)t[n[e]]=""}(s),s.q=s.c="",s.bufferCheckPosition=t.MAX_BUFFER_LENGTH,s.opt=i||{},s.opt.lowercase=s.opt.lowercase||s.opt.lowercasetags,s.looseCase=s.opt.lowercase?"toLowerCase":"toUpperCase",s.tags=[],s.closed=s.closedRoot=s.sawRoot=!1,s.tag=s.error=null,s.strict=!!e,s.noscript=!(!e&&!s.opt.noscript),s.state=N.BEGIN,s.strictEntities=s.opt.strictEntities,s.ENTITIES=s.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),s.attribList=[],s.opt.xmlns&&(s.ns=Object.create(l)),s.trackPosition=!1!==s.opt.position,s.trackPosition&&(s.position=s.line=s.column=0),O(s,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(t){function e(){}return e.prototype=t,new e}),Object.keys||(Object.keys=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e}),r.prototype={end:function(){P(this)},write:function(e){var r=this;if(this.error)throw this.error;if(r.closed)return D(r,"Cannot write after close. Assign an onready handler.");if(null===e)return P(r);"object"==typeof e&&(e=e.toString());var i=0,s="";for(;s=G(e,i++),r.c=s,s;)switch(r.trackPosition&&(r.position++,"\n"===s?(r.line++,r.column=0):r.column++),r.state){case N.BEGIN:if(r.state=N.BEGIN_WHITESPACE,"\ufeff"===s)continue;K(r,s);continue;case N.BEGIN_WHITESPACE:K(r,s);continue;case N.TEXT:if(r.sawRoot&&!r.closedRoot){for(var c=i-1;s&&"<"!==s&&"&"!==s;)(s=G(e,i++))&&r.trackPosition&&(r.position++,"\n"===s?(r.line++,r.column=0):r.column++);r.textNode+=e.substring(c,i-1)}"<"!==s||r.sawRoot&&r.closedRoot&&!r.strict?(y(s)||r.sawRoot&&!r.closedRoot||F(r,"Text data outside of root node."),"&"===s?r.state=N.TEXT_ENTITY:r.textNode+=s):(r.state=N.OPEN_WAKA,r.startTagPosition=r.position);continue;case N.SCRIPT:"<"===s?r.state=N.SCRIPT_ENDING:r.script+=s;continue;case N.SCRIPT_ENDING:"/"===s?r.state=N.CLOSE_TAG:(r.script+="<"+s,r.state=N.SCRIPT);continue;case N.OPEN_WAKA:if("!"===s)r.state=N.SGML_DECL,r.sgmlDecl="";else if(y(s));else if(E(f,s))r.state=N.OPEN_TAG,r.tagName=s;else if("/"===s)r.state=N.CLOSE_TAG,r.tagName="";else if("?"===s)r.state=N.PROC_INST,r.procInstName=r.procInstBody="";else{if(F(r,"Unencoded <"),r.startTagPosition+1<r.position){var u=r.position-r.startTagPosition;s=new Array(u).join(" ")+s}r.textNode+="<"+s,r.state=N.TEXT}continue;case N.SGML_DECL:(r.sgmlDecl+s).toUpperCase()===a?(S(r,"onopencdata"),r.state=N.CDATA,r.sgmlDecl="",r.cdata=""):r.sgmlDecl+s==="--"?(r.state=N.COMMENT,r.comment="",r.sgmlDecl=""):(r.sgmlDecl+s).toUpperCase()===o?(r.state=N.DOCTYPE,(r.doctype||r.sawRoot)&&F(r,"Inappropriately located doctype declaration"),r.doctype="",r.sgmlDecl=""):">"===s?(S(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=N.TEXT):b(s)?(r.state=N.SGML_DECL_QUOTED,r.sgmlDecl+=s):r.sgmlDecl+=s;continue;case N.SGML_DECL_QUOTED:s===r.q&&(r.state=N.SGML_DECL,r.q=""),r.sgmlDecl+=s;continue;case N.DOCTYPE:">"===s?(r.state=N.TEXT,S(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=s,"["===s?r.state=N.DOCTYPE_DTD:b(s)&&(r.state=N.DOCTYPE_QUOTED,r.q=s));continue;case N.DOCTYPE_QUOTED:r.doctype+=s,s===r.q&&(r.q="",r.state=N.DOCTYPE);continue;case N.DOCTYPE_DTD:r.doctype+=s,"]"===s?r.state=N.DOCTYPE:b(s)&&(r.state=N.DOCTYPE_DTD_QUOTED,r.q=s);continue;case N.DOCTYPE_DTD_QUOTED:r.doctype+=s,s===r.q&&(r.state=N.DOCTYPE_DTD,r.q="");continue;case N.COMMENT:"-"===s?r.state=N.COMMENT_ENDING:r.comment+=s;continue;case N.COMMENT_ENDING:"-"===s?(r.state=N.COMMENT_ENDED,r.comment=I(r.opt,r.comment),r.comment&&S(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+s,r.state=N.COMMENT);continue;case N.COMMENT_ENDED:">"!==s?(F(r,"Malformed comment"),r.comment+="--"+s,r.state=N.COMMENT):r.state=N.TEXT;continue;case N.CDATA:"]"===s?r.state=N.CDATA_ENDING:r.cdata+=s;continue;case N.CDATA_ENDING:"]"===s?r.state=N.CDATA_ENDING_2:(r.cdata+="]"+s,r.state=N.CDATA);continue;case N.CDATA_ENDING_2:">"===s?(r.cdata&&S(r,"oncdata",r.cdata),S(r,"onclosecdata"),r.cdata="",r.state=N.TEXT):"]"===s?r.cdata+="]":(r.cdata+="]]"+s,r.state=N.CDATA);continue;case N.PROC_INST:"?"===s?r.state=N.PROC_INST_ENDING:y(s)?r.state=N.PROC_INST_BODY:r.procInstName+=s;continue;case N.PROC_INST_BODY:if(!r.procInstBody&&y(s))continue;"?"===s?r.state=N.PROC_INST_ENDING:r.procInstBody+=s;continue;case N.PROC_INST_ENDING:">"===s?(S(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=N.TEXT):(r.procInstBody+="?"+s,r.state=N.PROC_INST_BODY);continue;case N.OPEN_TAG:E(m,s)?r.tagName+=s:(M(r),">"===s?k(r):"/"===s?r.state=N.OPEN_TAG_SLASH:(y(s)||F(r,"Invalid character in tag name"),r.state=N.ATTRIB));continue;case N.OPEN_TAG_SLASH:">"===s?(k(r,!0),L(r)):(F(r,"Forward-slash in opening tag not followed by >"),r.state=N.ATTRIB);continue;case N.ATTRIB:if(y(s))continue;">"===s?k(r):"/"===s?r.state=N.OPEN_TAG_SLASH:E(f,s)?(r.attribName=s,r.attribValue="",r.state=N.ATTRIB_NAME):F(r,"Invalid attribute name");continue;case N.ATTRIB_NAME:"="===s?r.state=N.ATTRIB_VALUE:">"===s?(F(r,"Attribute without value"),r.attribValue=r.attribName,R(r),k(r)):y(s)?r.state=N.ATTRIB_NAME_SAW_WHITE:E(m,s)?r.attribName+=s:F(r,"Invalid attribute name");continue;case N.ATTRIB_NAME_SAW_WHITE:if("="===s)r.state=N.ATTRIB_VALUE;else{if(y(s))continue;F(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",S(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===s?k(r):E(f,s)?(r.attribName=s,r.state=N.ATTRIB_NAME):(F(r,"Invalid attribute name"),r.state=N.ATTRIB)}continue;case N.ATTRIB_VALUE:if(y(s))continue;b(s)?(r.q=s,r.state=N.ATTRIB_VALUE_QUOTED):(F(r,"Unquoted attribute value"),r.state=N.ATTRIB_VALUE_UNQUOTED,r.attribValue=s);continue;case N.ATTRIB_VALUE_QUOTED:if(s!==r.q){"&"===s?r.state=N.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=s;continue}R(r),r.q="",r.state=N.ATTRIB_VALUE_CLOSED;continue;case N.ATTRIB_VALUE_CLOSED:y(s)?r.state=N.ATTRIB:">"===s?k(r):"/"===s?r.state=N.OPEN_TAG_SLASH:E(f,s)?(F(r,"No whitespace between attributes"),r.attribName=s,r.attribValue="",r.state=N.ATTRIB_NAME):F(r,"Invalid attribute name");continue;case N.ATTRIB_VALUE_UNQUOTED:if(!v(s)){"&"===s?r.state=N.ATTRIB_VALUE_ENTITY_U:r.attribValue+=s;continue}R(r),">"===s?k(r):r.state=N.ATTRIB;continue;case N.CLOSE_TAG:if(r.tagName)">"===s?L(r):E(m,s)?r.tagName+=s:r.script?(r.script+="</"+r.tagName,r.tagName="",r.state=N.SCRIPT):(y(s)||F(r,"Invalid tagname in closing tag"),r.state=N.CLOSE_TAG_SAW_WHITE);else{if(y(s))continue;T(f,s)?r.script?(r.script+="</"+s,r.state=N.SCRIPT):F(r,"Invalid tagname in closing tag."):r.tagName=s}continue;case N.CLOSE_TAG_SAW_WHITE:if(y(s))continue;">"===s?L(r):F(r,"Invalid characters in closing tag");continue;case N.TEXT_ENTITY:case N.ATTRIB_VALUE_ENTITY_Q:case N.ATTRIB_VALUE_ENTITY_U:var l,h;switch(r.state){case N.TEXT_ENTITY:l=N.TEXT,h="textNode";break;case N.ATTRIB_VALUE_ENTITY_Q:l=N.ATTRIB_VALUE_QUOTED,h="attribValue";break;case N.ATTRIB_VALUE_ENTITY_U:l=N.ATTRIB_VALUE_UNQUOTED,h="attribValue"}";"===s?(r[h]+=B(r),r.entity="",r.state=l):E(r.entity.length?g:d,s)?r.entity+=s:(F(r,"Invalid character in entity name"),r[h]+="&"+r.entity+s,r.entity="",r.state=l);continue;default:throw new Error(r,"Unknown state: "+r.state)}r.position>=r.bufferCheckPosition&&function(e){for(var r=Math.max(t.MAX_BUFFER_LENGTH,10),i=0,s=0,a=n.length;s<a;s++){var o=e[n[s]].length;if(o>r)switch(n[s]){case"textNode":C(e);break;case"cdata":S(e,"oncdata",e.cdata),e.cdata="";break;case"script":S(e,"onscript",e.script),e.script="";break;default:D(e,"Max buffer length exceeded: "+n[s])}i=Math.max(i,o)}var c=t.MAX_BUFFER_LENGTH-i;e.bufferCheckPosition=c+e.position}(r);return r}
|
|
2
|
+
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;C(t=this),""!==t.cdata&&(S(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(S(t,"onscript",t.script),t.script="")}};try{e=h.default.Stream}catch(t){e=function(){}}var i=t.EVENTS.filter(function(t){return"error"!==t&&"end"!==t});function s(t,n){if(!(this instanceof s))return new s(t,n);e.apply(this),this._parser=new r(t,n),this.writable=!0,this.readable=!0;var a=this;this._parser.onend=function(){a.emit("end")},this._parser.onerror=function(t){a.emit("error",t),a._parser.error=null},this._decoder=null,i.forEach(function(t){Object.defineProperty(a,"on"+t,{get:function(){return a._parser["on"+t]},set:function(e){if(!e)return a.removeAllListeners(t),a._parser["on"+t]=e,e;a.on(t,e)},enumerable:!0,configurable:!1})})}s.prototype=Object.create(e.prototype,{constructor:{value:s}}),s.prototype.write=function(t){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(t)){if(!this._decoder){var e=p.default.StringDecoder;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},s.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},s.prototype.on=function(t,n){var r=this;return r._parser["on"+t]||-1===i.indexOf(t)||(r._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),r.emit.apply(r,e)}),e.prototype.on.call(r,t,n)};var a="[CDATA[",o="DOCTYPE",c="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",l={xml:c,xmlns:u},f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,g=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function y(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function b(t){return'"'===t||"'"===t}function v(t){return">"===t||y(t)}function E(t,e){return t.test(e)}function T(t,e){return!E(t,e)}var w,_,A,N=0;for(var x in t.STATE={BEGIN:N++,BEGIN_WHITESPACE:N++,TEXT:N++,TEXT_ENTITY:N++,OPEN_WAKA:N++,SGML_DECL:N++,SGML_DECL_QUOTED:N++,DOCTYPE:N++,DOCTYPE_QUOTED:N++,DOCTYPE_DTD:N++,DOCTYPE_DTD_QUOTED:N++,COMMENT_STARTING:N++,COMMENT:N++,COMMENT_ENDING:N++,COMMENT_ENDED:N++,CDATA:N++,CDATA_ENDING:N++,CDATA_ENDING_2:N++,PROC_INST:N++,PROC_INST_BODY:N++,PROC_INST_ENDING:N++,OPEN_TAG:N++,OPEN_TAG_SLASH:N++,ATTRIB:N++,ATTRIB_NAME:N++,ATTRIB_NAME_SAW_WHITE:N++,ATTRIB_VALUE:N++,ATTRIB_VALUE_QUOTED:N++,ATTRIB_VALUE_CLOSED:N++,ATTRIB_VALUE_UNQUOTED:N++,ATTRIB_VALUE_ENTITY_Q:N++,ATTRIB_VALUE_ENTITY_U:N++,CLOSE_TAG:N++,CLOSE_TAG_SAW_WHITE:N++,SCRIPT:N++,SCRIPT_ENDING:N++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r}),t.STATE)t.STATE[t.STATE[x]]=x;function O(t,e,n){t[e]&&t[e](n)}function S(t,e,n){t.textNode&&C(t),O(t,e,n)}function C(t){t.textNode=I(t.opt,t.textNode),t.textNode&&O(t,"ontext",t.textNode),t.textNode=""}function I(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function D(t,e){return C(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,O(t,"onerror",e),t}function P(t){return t.sawRoot&&!t.closedRoot&&F(t,"Unclosed root tag"),t.state!==N.BEGIN&&t.state!==N.BEGIN_WHITESPACE&&t.state!==N.TEXT&&D(t,"Unexpected end"),C(t),t.c="",t.closed=!0,O(t,"onend"),r.call(t,t.strict,t.opt),t}function F(t,e){if("object"!=typeof t||!(t instanceof r))throw new Error("bad call to strictFail");t.strict&&D(t,e)}function M(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,S(t,"onopentagstart",n)}function j(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),r=n[0],i=n[1];return e&&"xmlns"===t&&(r="xmlns",i=""),{prefix:r,local:i}}function R(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=j(t.attribName,!0),n=e.prefix,r=e.local;if("xmlns"===n)if("xml"===r&&t.attribValue!==c)F(t,"xml: prefix must be bound to "+c+"\nActual: "+t.attribValue);else if("xmlns"===r&&t.attribValue!==u)F(t,"xmlns: prefix must be bound to "+u+"\nActual: "+t.attribValue);else{var i=t.tag,s=t.tags[t.tags.length-1]||t;i.ns===s.ns&&(i.ns=Object.create(s.ns)),i.ns[r]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,S(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function k(t,e){if(t.opt.xmlns){var n=t.tag,r=j(t.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(F(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=r.prefix);var i=t.tags[t.tags.length-1]||t;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach(function(e){S(t,"onopennamespace",{prefix:e,uri:n.ns[e]})});for(var s=0,a=t.attribList.length;s<a;s++){var o=t.attribList[s],c=o[0],u=o[1],l=j(c,!0),h=l.prefix,p=l.local,f=""===h?"":n.ns[h]||"",m={name:c,value:u,prefix:h,local:p,uri:f};h&&"xmlns"!==h&&!f&&(F(t,"Unbound namespace prefix: "+JSON.stringify(h)),m.uri=h),t.tag.attributes[c]=m,S(t,"onattribute",m)}t.attribList.length=0}t.tag.isSelfClosing=!!e,t.sawRoot=!0,t.tags.push(t.tag),S(t,"onopentag",t.tag),e||(t.noscript||"script"!==t.tagName.toLowerCase()?t.state=N.TEXT:t.state=N.SCRIPT,t.tag=null,t.tagName=""),t.attribName=t.attribValue="",t.attribList.length=0}function L(t){if(!t.tagName)return F(t,"Weird empty close tag."),t.textNode+="</>",void(t.state=N.TEXT);if(t.script){if("script"!==t.tagName)return t.script+="</"+t.tagName+">",t.tagName="",void(t.state=N.SCRIPT);S(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var r=n;e--;){if(t.tags[e].name===r)break;F(t,"Unexpected close tag")}if(e<0)return F(t,"Unmatched closing tag: "+t.tagName),t.textNode+="</"+t.tagName+">",void(t.state=N.TEXT);t.tagName=n;for(var i=t.tags.length;i-- >e;){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,S(t,"onclosetag",t.tagName);var a={};for(var o in s.ns)a[o]=s.ns[o];var c=t.tags[t.tags.length-1]||t;t.opt.xmlns&&s.ns!==c.ns&&Object.keys(s.ns).forEach(function(e){var n=s.ns[e];S(t,"onclosenamespace",{prefix:e,uri:n})})}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=N.TEXT}function B(t){var e,n=t.entity,r=n.toLowerCase(),i="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[r]?t.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(e)||i.toLowerCase()!==n?(F(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function K(t,e){"<"===e?(t.state=N.OPEN_WAKA,t.startTagPosition=t.position):y(e)||(F(t,"Non-whitespace before first tag."),t.textNode=e,t.state=N.TEXT)}function G(t,e){var n="";return e<t.length&&(n=t.charAt(e)),n}N=t.STATE,String.fromCodePoint||(w=String.fromCharCode,_=Math.floor,A=function(){var t,e,n=[],r=-1,i=arguments.length;if(!i)return"";for(var s="";++r<i;){var a=Number(arguments[r]);if(!isFinite(a)||a<0||a>1114111||_(a)!==a)throw RangeError("Invalid code point: "+a);a<=65535?n.push(a):(t=55296+((a-=65536)>>10),e=a%1024+56320,n.push(t,e)),(r+1===i||n.length>16384)&&(s+=w.apply(null,n),n.length=0)}return s},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A)}(e)}),ze=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},qe=ze,Ye=function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n},Xe=function(t,e){t in e&&"boolean"==typeof e[t]||(e[t]=!1)},He=function(t){(!("spaces"in t)||"number"!=typeof t.spaces&&"string"!=typeof t.spaces)&&(t.spaces=0)},Qe=function(t){"alwaysArray"in t&&("boolean"==typeof t.alwaysArray||qe(t.alwaysArray))||(t.alwaysArray=!1)},Je=function(t,e){t+"Key"in e&&"string"==typeof e[t+"Key"]||(e[t+"Key"]=e.compact?"_"+t:t)},Ze=ze;function tn(t){var e=Number(t);if(!isNaN(e))return e;var n=t.toLowerCase();return"true"===n||"false"!==n&&t}function en(t,e){var n;if($e.compact){if(!Ve[$e[t+"Key"]]&&(Ze($e.alwaysArray)?-1!==$e.alwaysArray.indexOf($e[t+"Key"]):$e.alwaysArray)&&(Ve[$e[t+"Key"]]=[]),Ve[$e[t+"Key"]]&&!Ze(Ve[$e[t+"Key"]])&&(Ve[$e[t+"Key"]]=[Ve[$e[t+"Key"]]]),t+"Fn"in $e&&"string"==typeof e&&(e=$e[t+"Fn"](e,Ve)),"instruction"===t&&("instructionFn"in $e||"instructionNameFn"in $e))for(n in e)if(e.hasOwnProperty(n))if("instructionFn"in $e)e[n]=$e.instructionFn(e[n],n,Ve);else{var r=e[n];delete e[n],e[$e.instructionNameFn(n,r,Ve)]=r}Ze(Ve[$e[t+"Key"]])?Ve[$e[t+"Key"]].push(e):Ve[$e[t+"Key"]]=e}else{Ve[$e.elementsKey]||(Ve[$e.elementsKey]=[]);var i={};if(i[$e.typeKey]=t,"instruction"===t){for(n in e)if(e.hasOwnProperty(n))break;i[$e.nameKey]="instructionNameFn"in $e?$e.instructionNameFn(n,e,Ve):n,$e.instructionHasAttributes?(i[$e.attributesKey]=e[n][$e.attributesKey],"instructionFn"in $e&&(i[$e.attributesKey]=$e.instructionFn(i[$e.attributesKey],n,Ve))):("instructionFn"in $e&&(e[n]=$e.instructionFn(e[n],n,Ve)),i[$e.instructionKey]=e[n])}else t+"Fn"in $e&&(e=$e[t+"Fn"](e,Ve)),i[$e[t+"Key"]]=e;$e.addParent&&(i[$e.parentKey]=Ve),Ve[$e.elementsKey].push(i)}}function nn(t){var e;if("attributesFn"in $e&&t&&(t=$e.attributesFn(t,Ve)),($e.trim||"attributeValueFn"in $e||"attributeNameFn"in $e||$e.nativeTypeAttributes)&&t)for(e in t)if(t.hasOwnProperty(e)&&($e.trim&&(t[e]=t[e].trim()),$e.nativeTypeAttributes&&(t[e]=tn(t[e])),"attributeValueFn"in $e&&(t[e]=$e.attributeValueFn(t[e],e,Ve)),"attributeNameFn"in $e)){var n=t[e];delete t[e],t[$e.attributeNameFn(e,t[e],Ve)]=n}return t}function rn(t){var e={};if(t.body&&("xml"===t.name.toLowerCase()||$e.instructionHasAttributes)){for(var n,r=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(n=r.exec(t.body));)e[n[1]]=n[2]||n[3]||n[4];e=nn(e)}if("xml"===t.name.toLowerCase()){if($e.ignoreDeclaration)return;Ve[$e.declarationKey]={},Object.keys(e).length&&(Ve[$e.declarationKey][$e.attributesKey]=e),$e.addParent&&(Ve[$e.declarationKey][$e.parentKey]=Ve)}else{if($e.ignoreInstruction)return;$e.trim&&(t.body=t.body.trim());var i={};$e.instructionHasAttributes&&Object.keys(e).length?(i[t.name]={},i[t.name][$e.attributesKey]=e):i[t.name]=t.body,en("instruction",i)}}function sn(t,e){var n;if("object"==typeof t&&(e=t.attributes,t=t.name),e=nn(e),"elementNameFn"in $e&&(t=$e.elementNameFn(t,Ve)),$e.compact){var r;if(n={},!$e.ignoreAttributes&&e&&Object.keys(e).length)for(r in n[$e.attributesKey]={},e)e.hasOwnProperty(r)&&(n[$e.attributesKey][r]=e[r]);!(t in Ve)&&(Ze($e.alwaysArray)?-1!==$e.alwaysArray.indexOf(t):$e.alwaysArray)&&(Ve[t]=[]),Ve[t]&&!Ze(Ve[t])&&(Ve[t]=[Ve[t]]),Ze(Ve[t])?Ve[t].push(n):Ve[t]=n}else Ve[$e.elementsKey]||(Ve[$e.elementsKey]=[]),(n={})[$e.typeKey]="element",n[$e.nameKey]=t,!$e.ignoreAttributes&&e&&Object.keys(e).length&&(n[$e.attributesKey]=e),$e.alwaysChildren&&(n[$e.elementsKey]=[]),Ve[$e.elementsKey].push(n);n[$e.parentKey]=Ve,Ve=n}function an(t){$e.ignoreText||(t.trim()||$e.captureSpacesBetweenElements)&&($e.trim&&(t=t.trim()),$e.nativeType&&(t=tn(t)),$e.sanitize&&(t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")),en("text",t))}function on(t){$e.ignoreComment||($e.trim&&(t=t.trim()),en("comment",t))}function cn(t){var e=Ve[$e.parentKey];$e.addParent||delete Ve[$e.parentKey],Ve=e}function un(t){$e.ignoreCdata||($e.trim&&(t=t.trim()),en("cdata",t))}function ln(t){$e.ignoreDoctype||(t=t.replace(/^ /,""),$e.trim&&(t=t.trim()),en("doctype",t))}function hn(t){t.note=t}var pn=function(t,e){var n=We.parser(!0,{}),r={};if(Ve=r,$e=function(t){return $e=Ye(t),Xe("ignoreDeclaration",$e),Xe("ignoreInstruction",$e),Xe("ignoreAttributes",$e),Xe("ignoreText",$e),Xe("ignoreComment",$e),Xe("ignoreCdata",$e),Xe("ignoreDoctype",$e),Xe("compact",$e),Xe("alwaysChildren",$e),Xe("addParent",$e),Xe("trim",$e),Xe("nativeType",$e),Xe("nativeTypeAttributes",$e),Xe("sanitize",$e),Xe("instructionHasAttributes",$e),Xe("captureSpacesBetweenElements",$e),Qe($e),Je("declaration",$e),Je("instruction",$e),Je("attributes",$e),Je("text",$e),Je("comment",$e),Je("cdata",$e),Je("doctype",$e),Je("type",$e),Je("name",$e),Je("elements",$e),Je("parent",$e),$e}(e),n.opt={strictEntities:!0},n.onopentag=sn,n.ontext=an,n.oncomment=on,n.onclosetag=cn,n.onerror=hn,n.oncdata=un,n.ondoctype=ln,n.onprocessinginstruction=rn,n.write(t).close(),r[$e.elementsKey]){var i=r[$e.elementsKey];delete r[$e.elementsKey],r[$e.elementsKey]=i,delete r.text}return r};var fn,mn,dn=ze;function gn(t,e,n){return(!n&&t.spaces?"\n":"")+Array(e+1).join(t.spaces)}function yn(t,e,n){if(e.ignoreAttributes)return"";"attributesFn"in e&&(t=e.attributesFn(t,mn,fn));var r,i,s,a,o=[];for(r in t)t.hasOwnProperty(r)&&null!==t[r]&&void 0!==t[r]&&(a=e.noQuotesForNativeAttributes&&"string"!=typeof t[r]?"":'"',i=(i=""+t[r]).replace(/"/g,"""),s="attributeNameFn"in e?e.attributeNameFn(r,i,mn,fn):r,o.push(e.spaces&&e.indentAttributes?gn(e,n+1,!1):" "),o.push(s+"="+a+("attributeValueFn"in e?e.attributeValueFn(i,r,mn,fn):i)+a));return t&&Object.keys(t).length&&e.spaces&&e.indentAttributes&&o.push(gn(e,n,!1)),o.join("")}function bn(t,e,n){return fn=t,mn="xml",e.ignoreDeclaration?"":"<?xml"+yn(t[e.attributesKey],e,n)+"?>"}function vn(t,e,n){if(e.ignoreInstruction)return"";var r;for(r in t)if(t.hasOwnProperty(r))break;var i="instructionNameFn"in e?e.instructionNameFn(r,t[r],mn,fn):r;if("object"==typeof t[r])return fn=t,mn=i,"<?"+i+yn(t[r][e.attributesKey],e,n)+"?>";var s=t[r]?t[r]:"";return"instructionFn"in e&&(s=e.instructionFn(s,r,mn,fn)),"<?"+i+(s?" "+s:"")+"?>"}function En(t,e){return e.ignoreComment?"":"\x3c!--"+("commentFn"in e?e.commentFn(t,mn,fn):t)+"--\x3e"}function Tn(t,e){return e.ignoreCdata?"":"<![CDATA["+("cdataFn"in e?e.cdataFn(t,mn,fn):t.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function wn(t,e){return e.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in e?e.doctypeFn(t,mn,fn):t)+">"}function _n(t,e){return e.ignoreText?"":(t=(t=(t=""+t).replace(/&/g,"&")).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"textFn"in e?e.textFn(t,mn,fn):t)}function An(t,e,n,r){return t.reduce(function(t,i){var s=gn(e,n,r&&!t);switch(i.type){case"element":return t+s+function(t,e,n){fn=t,mn=t.name;var r=[],i="elementNameFn"in e?e.elementNameFn(t.name,t):t.name;r.push("<"+i),t[e.attributesKey]&&r.push(yn(t[e.attributesKey],e,n));var s=t[e.elementsKey]&&t[e.elementsKey].length||t[e.attributesKey]&&"preserve"===t[e.attributesKey]["xml:space"];return s||(s="fullTagEmptyElementFn"in e?e.fullTagEmptyElementFn(t.name,t):e.fullTagEmptyElement),s?(r.push(">"),t[e.elementsKey]&&t[e.elementsKey].length&&(r.push(An(t[e.elementsKey],e,n+1)),fn=t,mn=t.name),r.push(e.spaces&&function(t,e){var n;if(t.elements&&t.elements.length)for(n=0;n<t.elements.length;++n)switch(t.elements[n][e.typeKey]){case"text":if(e.indentText)return!0;break;case"cdata":if(e.indentCdata)return!0;break;case"instruction":if(e.indentInstruction)return!0;break;default:return!0}return!1}(t,e)?"\n"+Array(n+1).join(e.spaces):""),r.push("</"+i+">")):r.push("/>"),r.join("")}(i,e,n);case"comment":return t+s+En(i[e.commentKey],e);case"doctype":return t+s+wn(i[e.doctypeKey],e);case"cdata":return t+(e.indentCdata?s:"")+Tn(i[e.cdataKey],e);case"text":return t+(e.indentText?s:"")+_n(i[e.textKey],e);case"instruction":var a={};return a[i[e.nameKey]]=i[e.attributesKey]?i:i[e.instructionKey],t+(e.indentInstruction?s:"")+vn(a,e,n)}},"")}function Nn(t,e,n){var r;for(r in t)if(t.hasOwnProperty(r))switch(r){case e.parentKey:case e.attributesKey:break;case e.textKey:if(e.indentText||n)return!0;break;case e.cdataKey:if(e.indentCdata||n)return!0;break;case e.instructionKey:if(e.indentInstruction||n)return!0;break;case e.doctypeKey:case e.commentKey:default:return!0}return!1}function xn(t,e,n,r,i){fn=t,mn=e;var s="elementNameFn"in n?n.elementNameFn(e,t):e;if(null==t||""===t)return"fullTagEmptyElementFn"in n&&n.fullTagEmptyElementFn(e,t)||n.fullTagEmptyElement?"<"+s+"></"+s+">":"<"+s+"/>";var a=[];if(e){if(a.push("<"+s),"object"!=typeof t)return a.push(">"+_n(t,n)+"</"+s+">"),a.join("");t[n.attributesKey]&&a.push(yn(t[n.attributesKey],n,r));var o=Nn(t,n,!0)||t[n.attributesKey]&&"preserve"===t[n.attributesKey]["xml:space"];if(o||(o="fullTagEmptyElementFn"in n?n.fullTagEmptyElementFn(e,t):n.fullTagEmptyElement),!o)return a.push("/>"),a.join("");a.push(">")}return a.push(On(t,n,r+1,!1)),fn=t,mn=e,e&&a.push((i?gn(n,r,!1):"")+"</"+s+">"),a.join("")}function On(t,e,n,r){var i,s,a,o=[];for(s in t)if(t.hasOwnProperty(s))for(a=dn(t[s])?t[s]:[t[s]],i=0;i<a.length;++i){switch(s){case e.declarationKey:o.push(bn(a[i],e,n));break;case e.instructionKey:o.push((e.indentInstruction?gn(e,n,r):"")+vn(a[i],e,n));break;case e.attributesKey:case e.parentKey:break;case e.textKey:o.push((e.indentText?gn(e,n,r):"")+_n(a[i],e));break;case e.cdataKey:o.push((e.indentCdata?gn(e,n,r):"")+Tn(a[i],e));break;case e.doctypeKey:o.push(gn(e,n,r)+wn(a[i],e));break;case e.commentKey:o.push(gn(e,n,r)+En(a[i],e));break;default:o.push(gn(e,n,r)+xn(a[i],s,e,n,Nn(a[i],e)))}r=r&&!o.length}return o.join("")}var Sn=function(t,e){e=function(t){var e=Ye(t);return Xe("ignoreDeclaration",e),Xe("ignoreInstruction",e),Xe("ignoreAttributes",e),Xe("ignoreText",e),Xe("ignoreComment",e),Xe("ignoreCdata",e),Xe("ignoreDoctype",e),Xe("compact",e),Xe("indentText",e),Xe("indentCdata",e),Xe("indentAttributes",e),Xe("indentInstruction",e),Xe("fullTagEmptyElement",e),Xe("noQuotesForNativeAttributes",e),He(e),"number"==typeof e.spaces&&(e.spaces=Array(e.spaces+1).join(" ")),Je("declaration",e),Je("instruction",e),Je("attributes",e),Je("text",e),Je("comment",e),Je("cdata",e),Je("doctype",e),Je("type",e),Je("name",e),Je("elements",e),e}(e);var n=[];return fn=t,mn="_root_",e.compact?n.push(On(t,e,0,!0)):(t[e.declarationKey]&&n.push(bn(t[e.declarationKey],e,0)),t[e.elementsKey]&&t[e.elementsKey].length&&n.push(An(t[e.elementsKey],e,0,!n.length))),n.join("")},Cn=pn,In=Sn;function Dn(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),Cn(t,{compact:!1})}function Pn(t,e){return In(t,e)}function Fn(t,e){return function(t,e){return t&&t.find(e)}(t,t=>t.name===e)}const Mn=t.env.debug("vbapm:target.transforms.core-xml"),jn=/docProps[\/,\\]core\.xml/i;function Rn(t,...e){t=t.slice();for(const n of e){const e=t.indexOf(n);t.splice(e,1)}return t}const kn=t.env.debug("vbapm:target.transforms.workbook-xml"),Ln=/xl[\/,\\]workbook\.xml/i;exports.addins=m,exports.createDocument=async function(n,r,i={}){const{application:s,addin:a,file:o}=g(n,r,i),c=!t.env.isWindows&&!i.staging;let u=c?t.join(n.paths.staging,r.filename):o;return await t.mkdirs_1.ensureDir(e.dirname(u)),await t.run(s,i.addin||a,"Build.CreateDocument",[JSON.stringify({path:u})]),c&&(await t.mkdirs_1.ensureDir(e.dirname(o)),await t.copy.copy(u,o)),o},exports.dist=Qt,exports.exportTo=async function(n,r,i,s={}){let{application:a,addin:o,file:c}=g(n,r);if(!t.env.isWindows){const n=t.join(i,"staged",r.filename);await t.pathExists_1.pathExists(n)||(await t.mkdirs_1.ensureDir(e.dirname(n)),await t.copy.copy(c,n)),c=n}await t.run(a,s.addin||o,"Build.ExportTo",[JSON.stringify({file:c,staging:i})])},exports.extensionToApplication=y,exports.importGraph=async function(e,n,r,i,s={}){const{application:a,addin:o}=g(e,n),{name:c,components:u,references:l}=r;await t.run(a,s.addin||o,"Build.ImportGraph",[JSON.stringify({file:i,name:c,src:u,references:l})])},exports.toSrc=Ue,exports.transformCoreXml=function(t){if(!jn.test(t.path))return t;const e=Dn(t.data.toString("utf8")),n=Fn(e.elements,"cp:coreProperties");if(n){const t=Fn(n.elements,"cp:lastModifiedBy"),e=Fn(n.elements,"dc:creator");t&&e&&(t.elements[0].text=e.elements[0].text);const r=Fn(n.elements,"dcterms:modified"),i=Fn(n.elements,"dcterms:created");r&&i&&(r.elements[0].text=i.elements[0].text)}else Mn("Warning: cp:coreProperties not found, unable to transform core.xml");return t.data=Buffer.from(Pn(e)),t},exports.transformWorkbookXml=function(t){if(!Ln.test(t.path))return t;const e=Dn(t.data.toString("utf8")),n=Fn(e.elements,"workbook");if(n){const t=Fn(n.elements,"mc:AlternateContent"),e=Fn(t&&t.elements,"mc:Choice"),r=Fn(e&&e.elements,"x15ac:absPath");r&&(r.attributes.url="");const i=Fn(n.elements,"bookViews");i&&(n.elements=Rn(n.elements,i));const s=Fn(n.elements,"fileVersion");s&&(n.elements=Rn(n.elements,s));const a=Fn(n.elements,"calcPr");a&&(a.attributes.calcId="0")}else kn("Warning: workbook not found, unable to transform workbook.xml");return t.data=Buffer.from(Pn(e)),t};
|
package/package.json
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vbapm",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
4
4
|
"description": "A package manager and build tool for VBA",
|
|
5
|
+
"repository": "https://github.com/vbapm/core.git",
|
|
5
6
|
"contributors": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
7
|
+
"Martin Leduc <31558169+DecimalTurn@users.noreply.github.com> (https://github.com/DecimalTurn)",
|
|
8
|
+
"Tim Hall <tim.hall.engr@gmail.com> (https://github.com/timhall)"
|
|
8
9
|
],
|
|
9
10
|
"license": "MIT",
|
|
10
|
-
"homepage": "https://github.com/vbapm/core",
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/vbapm/core.git"
|
|
14
|
-
},
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=18.0.0"
|
|
17
|
-
},
|
|
18
11
|
"bin": {
|
|
19
|
-
"
|
|
20
|
-
"vba": "lib/
|
|
12
|
+
"vbapm": "lib/vbapm.js",
|
|
13
|
+
"vba": "lib/vbapm.js"
|
|
21
14
|
},
|
|
22
15
|
"main": "lib/index.js",
|
|
23
16
|
"types": "lib/src/index.d.ts",
|
|
@@ -34,17 +27,23 @@
|
|
|
34
27
|
"LICENSE",
|
|
35
28
|
"README.md"
|
|
36
29
|
],
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18.0.0"
|
|
32
|
+
},
|
|
37
33
|
"scripts": {
|
|
38
34
|
"format": "prettier --write \"**/*.{ts,js}\"",
|
|
35
|
+
"format:check": "prettier --check \"**/*.{ts,js}\"",
|
|
39
36
|
"test": "jest --runInBand",
|
|
40
37
|
"typecheck": "tsc",
|
|
38
|
+
"deps": "npm i",
|
|
39
|
+
"dev": "run-s deps typecheck format:check test build:cli",
|
|
41
40
|
"test:e2e": "jest --config e2e.config.js --runInBand",
|
|
42
|
-
"build": "rimraf lib && rollup -c
|
|
41
|
+
"build": "rimraf lib && rollup -c",
|
|
42
|
+
"build:lib": "run-s build && tsc -p tsconfig.build.json",
|
|
43
|
+
"build:cli": "run-s build && node scripts/ensure-vendor",
|
|
43
44
|
"build:dev": "cross-env NODE_ENV=development rollup -c",
|
|
44
45
|
"build:addins": "cd addins && node --no-warnings ../scripts/build-addins",
|
|
45
|
-
"build:bootstrap": "cd scripts/bootstrap && node --no-warnings ../../lib/
|
|
46
|
-
"prepublishOnly": "npm run build",
|
|
47
|
-
"postversion": "git push && git push --tags",
|
|
46
|
+
"build:bootstrap": "cd scripts/bootstrap && node --no-warnings ../../lib/vbapm build",
|
|
48
47
|
"clean": "rimraf lib && rimraf dist && rimraf addins/build"
|
|
49
48
|
},
|
|
50
49
|
"jest": {
|
|
@@ -53,13 +52,19 @@
|
|
|
53
52
|
"testPathIgnorePatterns": [
|
|
54
53
|
"/node_modules/",
|
|
55
54
|
"/lib/"
|
|
56
|
-
]
|
|
55
|
+
],
|
|
56
|
+
"moduleNameMapper": {
|
|
57
|
+
"^@timhall/dedent$": "<rootDir>/node_modules/@timhall/dedent/dist/dedent.js"
|
|
58
|
+
},
|
|
59
|
+
"snapshotFormat": {
|
|
60
|
+
"escapeString": true,
|
|
61
|
+
"printBasicPrototype": true
|
|
62
|
+
}
|
|
57
63
|
},
|
|
58
64
|
"dependencies": {
|
|
59
|
-
"@decimalturn/toml-patch": "^0.7.0",
|
|
60
65
|
"@timhall/ansi-colors": "^5.0.0",
|
|
61
66
|
"@timhall/dedent": "^0.9.1",
|
|
62
|
-
"archiver": "^
|
|
67
|
+
"archiver": "^7.0.1",
|
|
63
68
|
"conf": "^3",
|
|
64
69
|
"date-fns": "^2",
|
|
65
70
|
"debug": "^4",
|
|
@@ -67,7 +72,7 @@
|
|
|
67
72
|
"editorconfig": "^0.15.3",
|
|
68
73
|
"env-paths": "^2",
|
|
69
74
|
"fs-extra": "^7",
|
|
70
|
-
"isomorphic-git": "^1.
|
|
75
|
+
"isomorphic-git": "^1.37.1",
|
|
71
76
|
"logic-solver": "^2",
|
|
72
77
|
"meant": "^1.0",
|
|
73
78
|
"mri": "^1",
|
|
@@ -76,13 +81,12 @@
|
|
|
76
81
|
"pretty-hrtime": "^1",
|
|
77
82
|
"sanitize-filename": "^1",
|
|
78
83
|
"semver": "^5",
|
|
79
|
-
"tmp": "^0.
|
|
80
|
-
"
|
|
84
|
+
"tmp": "^0.2.5",
|
|
85
|
+
"@decimalturn/toml-patch": "^0.7",
|
|
86
|
+
"walk-sync": "^4.0.1",
|
|
81
87
|
"xml-js": "^1.6"
|
|
82
88
|
},
|
|
83
89
|
"devDependencies": {
|
|
84
|
-
"@octokit/core": "^3.1.4",
|
|
85
|
-
"@octokit/rest": "^16.21.1",
|
|
86
90
|
"@rollup/plugin-commonjs": "^15.1.0",
|
|
87
91
|
"@rollup/plugin-json": "^4.1.0",
|
|
88
92
|
"@rollup/plugin-node-resolve": "^9.0.0",
|
|
@@ -90,27 +94,49 @@
|
|
|
90
94
|
"@rollup/plugin-typescript": "^6.0.0",
|
|
91
95
|
"@types/archiver": "^2",
|
|
92
96
|
"@types/fs-extra": "^5",
|
|
93
|
-
"@types/
|
|
94
|
-
"@types/
|
|
95
|
-
"@types/node": "^
|
|
96
|
-
"@types/node-fetch": "^2.1.7",
|
|
97
|
+
"@types/jest": "^29",
|
|
98
|
+
"@types/node": "^22",
|
|
99
|
+
"@types/node-fetch": "^2.6.13",
|
|
97
100
|
"@types/semver": "^5",
|
|
98
101
|
"@types/tmp": "^0.0",
|
|
99
102
|
"aws-sdk": "^2.562.0",
|
|
100
103
|
"builtin-modules": "^3.0.0",
|
|
101
104
|
"cross-env": "^5",
|
|
102
105
|
"dotenv": "^7.0.0",
|
|
103
|
-
"
|
|
104
|
-
"jest": "^26.6.1",
|
|
106
|
+
"jest": "^29",
|
|
105
107
|
"mustache": "^3",
|
|
106
108
|
"npm-run-all": "^4",
|
|
107
|
-
"prettier": "^
|
|
108
|
-
"rimraf": "^
|
|
109
|
+
"prettier": "^3",
|
|
110
|
+
"rimraf": "^6.1.3",
|
|
109
111
|
"rollup": "^2.32.1",
|
|
110
112
|
"rollup-plugin-terser": "^7.0.2",
|
|
111
|
-
"ts-jest": "^
|
|
113
|
+
"ts-jest": "^29",
|
|
112
114
|
"tslib": "^1.9.3",
|
|
113
|
-
"typescript": "^
|
|
115
|
+
"typescript": "^5",
|
|
114
116
|
"url-join": "^4.0.1"
|
|
117
|
+
},
|
|
118
|
+
"overrides": {
|
|
119
|
+
"minimatch": "^10.2.1"
|
|
120
|
+
},
|
|
121
|
+
"json-comments": {
|
|
122
|
+
"tips": "You may install the JsonComments plugin to enable commenting functionality for JSON files, see: https://github.com/zhangfisher/json_comments_extension",
|
|
123
|
+
"package.json": {
|
|
124
|
+
"scripts.format": "Formats all .ts and .js files using Prettier",
|
|
125
|
+
"scripts.format:check": "Checks all .ts and .js files with Prettier",
|
|
126
|
+
"scripts.test": "Runs Jest tests in a single thread",
|
|
127
|
+
"scripts.typecheck": "Runs the TypeScript compiler to check for type errors",
|
|
128
|
+
"scripts.test:e2e": "Runs end-to-end tests using a specific Jest configuration",
|
|
129
|
+
"scripts.build:lib": "Core build: rollup bundle + .d.ts generation (used by both npm and standalone channels)",
|
|
130
|
+
"scripts.build:cli": "Standalone CLI build: rollup bundle (no sourcemaps, no .d.ts) + fetch vendored Node binary",
|
|
131
|
+
"scripts.build:dev": "Allows to quickly rebuild the project in development mode with environment variables set for easier debugging of the js/ts code",
|
|
132
|
+
"scripts.build:addins": "Builds the add-ins by running a custom build script in the addins directory",
|
|
133
|
+
"scripts.build:bootstrap": "Update the bootstrap file (used to build the addin) by using the latest addin build (inception!)",
|
|
134
|
+
"scripts.clean": "Removes generated files from lib, dist, and addins/build directories",
|
|
135
|
+
"devDependencies.cross-env": "Used to set environment variables in a cross-platform-compatible way for build scripts",
|
|
136
|
+
"overrides": "Pins vulnerable transitive dependencies to patched versions to remove critical npm audit findings without large upstream upgrades.",
|
|
137
|
+
"overrides.minimist": "Prototype pollution fix, mainly needed for ts-jest/handlebars transitive chain.",
|
|
138
|
+
"overrides.underscore": "Arbitrary code execution mitigation, mainly needed for logic-solver transitive dependency.",
|
|
139
|
+
"overrides.shell-quote": "Command injection advisory mitigation, mainly needed for npm-run-all transitive dependency."
|
|
140
|
+
}
|
|
115
141
|
}
|
|
116
142
|
}
|
package/run-scripts/run.ps1
CHANGED
|
@@ -12,52 +12,76 @@ param(
|
|
|
12
12
|
[string[]]$MacroArgs
|
|
13
13
|
)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
# -------
|
|
16
|
+
# Helpers
|
|
17
|
+
# -------
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
function Unescape {
|
|
20
|
+
param([string]$Value)
|
|
21
|
+
return $Value -replace '\^q', '"'
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
function GetFileBase {
|
|
25
|
+
param([string]$Path)
|
|
26
|
+
return [System.IO.Path]::GetFileName($Path)
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
$
|
|
27
|
-
|
|
28
|
-
$UnescapedArgs += Unescape $arg
|
|
29
|
+
function GetFileName {
|
|
30
|
+
param([string]$Path)
|
|
31
|
+
return [System.IO.Path]::GetFileNameWithoutExtension($Path)
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
function Fail {
|
|
35
|
+
param([string]$Message)
|
|
36
|
+
PrintLn "{`"success`":false,`"errors`":[`"$Message`"]}"
|
|
37
|
+
exit 1
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function Print {
|
|
41
|
+
param([string]$Message)
|
|
42
|
+
[Console]::Out.Write($Message)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function PrintLn {
|
|
46
|
+
param([string]$Message)
|
|
47
|
+
[Console]::Out.WriteLine($Message)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function PrintErr {
|
|
51
|
+
param([string]$Message)
|
|
52
|
+
[Console]::Error.Write($Message)
|
|
53
|
+
}
|
|
33
54
|
|
|
34
55
|
# -------
|
|
35
|
-
# Run
|
|
56
|
+
# Run Macro
|
|
36
57
|
# -------
|
|
37
58
|
|
|
38
|
-
|
|
59
|
+
# Note: Do NOT name parameters "$Args" — it conflicts with the PowerShell
|
|
60
|
+
# automatic variable $args and can silently become an empty array.
|
|
61
|
+
|
|
62
|
+
function RunMacro {
|
|
39
63
|
param(
|
|
40
|
-
[
|
|
41
|
-
[string]$
|
|
42
|
-
[string]$
|
|
43
|
-
[string[]]$Args
|
|
64
|
+
[object]$ExcelApp,
|
|
65
|
+
[string]$MacroName,
|
|
66
|
+
[string[]]$MacroArgValues
|
|
44
67
|
)
|
|
45
68
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
69
|
+
$numArgs = if ($MacroArgValues) { $MacroArgValues.Count } else { 0 }
|
|
70
|
+
switch ($numArgs) {
|
|
71
|
+
0 { return $ExcelApp.Run($MacroName) }
|
|
72
|
+
1 { return $ExcelApp.Run($MacroName, $MacroArgValues[0]) }
|
|
73
|
+
2 { return $ExcelApp.Run($MacroName, $MacroArgValues[0], $MacroArgValues[1]) }
|
|
74
|
+
3 { return $ExcelApp.Run($MacroName, $MacroArgValues[0], $MacroArgValues[1], $MacroArgValues[2]) }
|
|
75
|
+
4 { return $ExcelApp.Run($MacroName, $MacroArgValues[0], $MacroArgValues[1], $MacroArgValues[2], $MacroArgValues[3]) }
|
|
76
|
+
5 { return $ExcelApp.Run($MacroName, $MacroArgValues[0], $MacroArgValues[1], $MacroArgValues[2], $MacroArgValues[3], $MacroArgValues[4]) }
|
|
77
|
+
6 { return $ExcelApp.Run($MacroName, $MacroArgValues[0], $MacroArgValues[1], $MacroArgValues[2], $MacroArgValues[3], $MacroArgValues[4], $MacroArgValues[5]) }
|
|
78
|
+
7 { return $ExcelApp.Run($MacroName, $MacroArgValues[0], $MacroArgValues[1], $MacroArgValues[2], $MacroArgValues[3], $MacroArgValues[4], $MacroArgValues[5], $MacroArgValues[6]) }
|
|
79
|
+
8 { return $ExcelApp.Run($MacroName, $MacroArgValues[0], $MacroArgValues[1], $MacroArgValues[2], $MacroArgValues[3], $MacroArgValues[4], $MacroArgValues[5], $MacroArgValues[6], $MacroArgValues[7]) }
|
|
80
|
+
9 { return $ExcelApp.Run($MacroName, $MacroArgValues[0], $MacroArgValues[1], $MacroArgValues[2], $MacroArgValues[3], $MacroArgValues[4], $MacroArgValues[5], $MacroArgValues[6], $MacroArgValues[7], $MacroArgValues[8]) }
|
|
81
|
+
10 { return $ExcelApp.Run($MacroName, $MacroArgValues[0], $MacroArgValues[1], $MacroArgValues[2], $MacroArgValues[3], $MacroArgValues[4], $MacroArgValues[5], $MacroArgValues[6], $MacroArgValues[7], $MacroArgValues[8], $MacroArgValues[9]) }
|
|
58
82
|
}
|
|
59
83
|
|
|
60
|
-
|
|
84
|
+
return $null
|
|
61
85
|
}
|
|
62
86
|
|
|
63
87
|
# -------
|
|
@@ -74,9 +98,9 @@ class Excel {
|
|
|
74
98
|
$this.OpenExcel()
|
|
75
99
|
}
|
|
76
100
|
|
|
77
|
-
[string] Run([string]$
|
|
78
|
-
$this.OpenWorkbook($
|
|
79
|
-
$result = RunMacro $this.App $
|
|
101
|
+
[string] Run([string]$FilePath, [string]$MacroName, [string[]]$MacroArgValues) {
|
|
102
|
+
$this.OpenWorkbook($FilePath)
|
|
103
|
+
$result = RunMacro $this.App $MacroName $MacroArgValues
|
|
80
104
|
|
|
81
105
|
return $result
|
|
82
106
|
}
|
|
@@ -142,70 +166,53 @@ class Excel {
|
|
|
142
166
|
}
|
|
143
167
|
|
|
144
168
|
# -------
|
|
145
|
-
# Run
|
|
169
|
+
# Run
|
|
146
170
|
# -------
|
|
147
171
|
|
|
148
|
-
function
|
|
172
|
+
function Run {
|
|
149
173
|
param(
|
|
150
|
-
[
|
|
151
|
-
[string]$
|
|
152
|
-
[string
|
|
174
|
+
[string]$AppName,
|
|
175
|
+
[string]$FilePath,
|
|
176
|
+
[string]$MacroName,
|
|
177
|
+
[string[]]$MacroArgValues
|
|
153
178
|
)
|
|
154
179
|
|
|
155
|
-
$
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
10 { return $App.Run($Command, $Args[0], $Args[1], $Args[2], $Args[3], $Args[4], $Args[5], $Args[6], $Args[7], $Args[8], $Args[9]) }
|
|
180
|
+
switch ($AppName) {
|
|
181
|
+
"excel" {
|
|
182
|
+
$excel = [Excel]::new()
|
|
183
|
+
try {
|
|
184
|
+
$result = $excel.Run($FilePath, $MacroName, $MacroArgValues)
|
|
185
|
+
} finally {
|
|
186
|
+
$excel.Dispose()
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
default {
|
|
190
|
+
Fail "ERROR #3: Unsupported App `"$AppName`""
|
|
191
|
+
}
|
|
168
192
|
}
|
|
169
193
|
|
|
170
|
-
|
|
194
|
+
PrintLn $result
|
|
171
195
|
}
|
|
172
196
|
|
|
173
197
|
# -------
|
|
174
|
-
#
|
|
198
|
+
# Main
|
|
175
199
|
# -------
|
|
176
200
|
|
|
177
|
-
|
|
178
|
-
param([string]$Value)
|
|
179
|
-
return $Value -replace '\^q', '"'
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function GetFileBase {
|
|
183
|
-
param([string]$Path)
|
|
184
|
-
return [System.IO.Path]::GetFileName($Path)
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function GetFileName {
|
|
188
|
-
param([string]$Path)
|
|
189
|
-
return [System.IO.Path]::GetFileNameWithoutExtension($Path)
|
|
190
|
-
}
|
|
201
|
+
$ErrorActionPreference = 'Stop'
|
|
191
202
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
PrintLn "{`"success`":false,`"errors`":[`"$Message`"]}"
|
|
195
|
-
exit 1
|
|
203
|
+
if (-not $AppName -or -not $File -or -not $Command) {
|
|
204
|
+
Fail "ERROR #1: Invalid Input (appname, file, and macro are required)"
|
|
196
205
|
}
|
|
197
206
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
[Console]::Out.Write($Message)
|
|
207
|
+
if ($MacroArgs.Count -gt 10) {
|
|
208
|
+
Fail "ERROR #2: Invalid Input (only 10 arguments are supported)"
|
|
201
209
|
}
|
|
202
210
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
211
|
+
# Unescape arguments
|
|
212
|
+
$UnescapedArgs = @()
|
|
213
|
+
foreach ($arg in $MacroArgs) {
|
|
214
|
+
$UnescapedArgs += Unescape $arg
|
|
206
215
|
}
|
|
207
216
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
[Console]::Error.Write($Message)
|
|
211
|
-
}
|
|
217
|
+
Run $AppName $File $Command $UnescapedArgs
|
|
218
|
+
exit 0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_commonjsHelpers-553b27b3.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|