@inkeep/open-knowledge 0.28.0-beta.0 → 0.28.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +24 -9
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/awk2-BBAGSFUB-Clvg_OoV.mjs +1 -0
  5. package/dist/chunk-2TRDZQLB-C2G-sahM.mjs +18 -0
  6. package/dist/{chunk-UNYNJIFU-HSzsM3a6.mjs → chunk-3BS5SKQH-HZ1-1bfb.mjs} +36 -36
  7. package/dist/{chunk-YS3AZT3J-DwQ3GyQR.mjs → chunk-3H6UQG3A-DdNaIxPm.mjs} +9 -9
  8. package/dist/{chunk-XORM457F-CJbQLVgU.mjs → chunk-6Z5SFZXK-C3WlMqq-.mjs} +53 -53
  9. package/dist/{chunk-YNYSPYQ5-DHter9G3.mjs → chunk-B74TABJS-DlbqoTuk.mjs} +13 -13
  10. package/dist/{chunk-FEIOJCZD-D6YUa1Xl.mjs → chunk-BGSUD5R5-DQ0_iOyO.mjs} +2 -2
  11. package/dist/{chunk-F55TLFGB-AEzanSfe.mjs → chunk-DBKNVD4L-BVx-WyDG.mjs} +2 -2
  12. package/dist/{chunk-BRGMQKJV-DtyxDw61.mjs → chunk-HKLCLINH-DwmCAW4U.mjs} +16 -16
  13. package/dist/chunk-HL6NGDO2-978327U5.mjs +24 -0
  14. package/dist/{chunk-LPQPILI2-GOcK96AE.mjs → chunk-K6LIBGJA-DpjaSGfc.mjs} +2 -2
  15. package/dist/{chunk-BBXLRYSX-OVlWa2B-.mjs → chunk-KRBPSX3W-nYEMVABW.mjs} +2 -2
  16. package/dist/chunk-KX3P26DQ-Cli1PSKS.mjs +2 -0
  17. package/dist/{chunk-SYMJJMQ4-DUF5hY-A.mjs → chunk-PXTK5WE2-B17f9YTq.mjs} +1 -1
  18. package/dist/{chunk-J642UCRS-C1PS8Hwf.mjs → chunk-SNN4IESC-C-P75V1I.mjs} +2 -2
  19. package/dist/chunk-TP4BZANS-eJW0TOjs.mjs +21 -0
  20. package/dist/{chunk-YFG2CMIF-DBRGs_rZ.mjs → chunk-V5MWI2OL-CDEVEp7K.mjs} +2 -2
  21. package/dist/chunk-XKWWSDBF-XuPgN5BP.mjs +37 -0
  22. package/dist/{chunk-NYQYO467-KfHLMnUW.mjs → chunk-YMMW5UAP-uYgeXT56.mjs} +5 -5
  23. package/dist/chunk-YULBWSET-BYBVdNmi.mjs +14 -0
  24. package/dist/{chunk-OL3S66CO-CBdL6pp1.mjs → chunk-ZZO3UDB3-CdVtmXn4.mjs} +2 -2
  25. package/dist/cli.mjs +7 -7
  26. package/dist/constants-DQ9gCjtp.mjs +2 -0
  27. package/dist/{dist-CgMyk9vp.mjs → dist-Cj2f9yMz.mjs} +1 -1
  28. package/dist/{dist-C_yx5tj0.mjs → dist-Dzsbf2ES.mjs} +159 -161
  29. package/dist/expansion-VBDYWVZR-k3W3Rc7R.mjs +1 -0
  30. package/dist/expr-YYCVMXE3-CHnBeIXW.mjs +1 -0
  31. package/dist/file-IGDTDPLG-DQaFkvTu.mjs +1 -0
  32. package/dist/find-DH2ALKQS-6y8KktlA.mjs +1 -0
  33. package/dist/{flag-coverage-QT4N2Z44-BlPYKPtd.mjs → flag-coverage-6JEX67RU-BqC6mFKB.mjs} +2 -2
  34. package/dist/{git-handle-Bhgrj9qX-DBwQr-02.mjs → git-handle-B4hCEi7c-CXOP12Ds.mjs} +2 -2
  35. package/dist/git-handle-DG8d2xCi-C_CAAChL.mjs +1 -0
  36. package/dist/grep-2HUTXO5U-Dbnjl3Iq.mjs +1 -0
  37. package/dist/index.d.mts +30 -1
  38. package/dist/index.mjs +1 -1
  39. package/dist/{init-ivEBwK7y.mjs → init-CylIL2_d.mjs} +24 -24
  40. package/dist/init-iEaa5yZe.mjs +1 -0
  41. package/dist/jq-LYZFFBZB-CSF_TJhe.mjs +1 -0
  42. package/dist/{js-exec-M6UR76J5-ZESSNIAK.mjs → js-exec-VXN6TZ7U-fCXuAS2-.mjs} +2 -2
  43. package/dist/{loader-u0w9n8j8.mjs → loader-DL7cugZT.mjs} +2 -2
  44. package/dist/loader-Dnu5tSEp.mjs +1 -0
  45. package/dist/preview-B5POtWPo.mjs +1 -0
  46. package/dist/{preview-DuGdXEFZ.mjs → preview-Bn8zUTY3.mjs} +2 -2
  47. package/dist/public/assets/SettingsDialogBody-BX4GP2gS.js +7 -0
  48. package/dist/public/assets/{index-BY2yEG8q.js → index-Br8R5akq.js} +3 -3
  49. package/dist/public/index.html +1 -1
  50. package/dist/{python3-AUFTPCU6-B7_jrPM3.mjs → python3-DNGS4G3E-bGzU9nm-.mjs} +2 -2
  51. package/dist/{repair-launch-json-GbJKeEYH.mjs → repair-launch-json-BkY5nlM0.mjs} +2 -2
  52. package/dist/repair-mcp-configs-Cz6iXpxD.mjs +2 -0
  53. package/dist/repair-skills-BwkQh3gJ.mjs +1 -0
  54. package/dist/repair-skills-DDLj2RIs.mjs +3 -0
  55. package/dist/rg-XNF3R3II-ivb6d3Sm.mjs +1 -0
  56. package/dist/sed-JAPPVBEU-BvDbOHs0.mjs +1 -0
  57. package/dist/{sqlite3-56UMWEY3-DNmhrHQv.mjs → sqlite3-TE5AIOTF-DW7pT7NE.mjs} +1 -1
  58. package/dist/{src-Cc1qY4l3.mjs → src-DL-hUlrv.mjs} +3 -3
  59. package/dist/{start-FRD4_VQ8.mjs → start-OiE8Ork3.mjs} +2 -2
  60. package/dist/start-uZWiX6-B.mjs +1 -0
  61. package/dist/tar-MZQD7NO4-46pC0DHj.mjs +1 -0
  62. package/dist/{write-project-skill-GLroKiE7.mjs → write-project-skill-C7UNscN7.mjs} +3 -3
  63. package/dist/xan-UD7JYIL2-DnWVVFeC.mjs +1 -0
  64. package/dist/xan-view-OW2TB7Z3-DBl8NjSB.mjs +1 -0
  65. package/dist/yq-OAKYHSXH-CpYttz-E.mjs +1 -0
  66. package/package.json +1 -1
  67. package/dist/awk2-POPGKRAI-6Q9HKhoL.mjs +0 -1
  68. package/dist/chunk-CR5AFCPT-BD_awIEP.mjs +0 -24
  69. package/dist/chunk-HWBSOZZR-DaPTwPxK.mjs +0 -37
  70. package/dist/chunk-OARHFVLG-Csb_cJVS.mjs +0 -21
  71. package/dist/chunk-VLGZJRPG-CHtdu0KZ.mjs +0 -17
  72. package/dist/chunk-XHM67O4N-2lBQUjKO.mjs +0 -2
  73. package/dist/chunk-YCFVLTST-CKzPj8PR.mjs +0 -13
  74. package/dist/constants-CrfIfZxB.mjs +0 -2
  75. package/dist/expansion-ENLSRCXJ-C5xjxYTl.mjs +0 -1
  76. package/dist/expr-5T3UU5KE-DrJUreFq.mjs +0 -1
  77. package/dist/file-ZIGAJ4YS-D07ChhI1.mjs +0 -1
  78. package/dist/find-TPUOAIUQ-ZPOxwUwf.mjs +0 -1
  79. package/dist/git-handle-DjEtQkHv-DQXg1XhZ.mjs +0 -1
  80. package/dist/grep-3AIAIJVR-Bh6KBg6d.mjs +0 -1
  81. package/dist/init-D4mCPnC2.mjs +0 -1
  82. package/dist/jq-ODXZBPLY-D3tmTL1R.mjs +0 -1
  83. package/dist/loader-ByJ07pxk.mjs +0 -1
  84. package/dist/preview-BSeDAUIf.mjs +0 -1
  85. package/dist/public/assets/SettingsDialogBody-BGLGfDpN.js +0 -7
  86. package/dist/repair-mcp-configs-DLSIsucG.mjs +0 -2
  87. package/dist/repair-skills-B-VIYM77.mjs +0 -1
  88. package/dist/repair-skills-DJmyw_aE.mjs +0 -3
  89. package/dist/rg-FOQSCCX3-ViKChHv5.mjs +0 -1
  90. package/dist/sed-VFTTATXJ-BfHBQ11q.mjs +0 -1
  91. package/dist/start-B-djBhNq.mjs +0 -1
  92. package/dist/tar-ANUBEFJY-Db9qg5B2.mjs +0 -1
  93. package/dist/xan-BXDXYEIB-I8yansvE.mjs +0 -1
  94. package/dist/xan-view-ECQUO7AJ-DJhdCPf3.mjs +0 -1
  95. package/dist/yq-MJMAR36V-BXyMiYfX.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import{t as e}from"./chunk-YNYSPYQ5-DHter9G3.mjs";import{c as t,d as n,f as r,h as i,i as a,o,u as s}from"./chunk-GFQRA5P5-DigWkxW2.mjs";function c(e,t){for(;t<e.length;){if(e[t]===`\\`&&e[t+1]===`
1
+ import{t as e}from"./chunk-B74TABJS-DlbqoTuk.mjs";import{c as t,d as n,f as r,h as i,i as a,o,u as s}from"./chunk-GFQRA5P5-DigWkxW2.mjs";function c(e,t){for(;t<e.length;){if(e[t]===`\\`&&e[t+1]===`
2
2
  `){t+=2;continue}if(/\s/.test(e[t])){t++;continue}break}return t}var l=[`=`,`+=`,`-=`,`*=`,`/=`,`%=`,`<<=`,`>>=`,`&=`,`|=`,`^=`];function u(e){if(e.includes(`#`)){let[t,n]=e.split(`#`),r=Number.parseInt(t,10);if(r<2||r>64)return NaN;if(r<=36){let e=Number.parseInt(n,r);return e>2**53-1?2**53-1:e}let i=0;for(let e of n){let t;if(/[0-9]/.test(e))t=e.charCodeAt(0)-48;else if(/[a-z]/.test(e))t=e.charCodeAt(0)-97+10;else if(/[A-Z]/.test(e))t=e.charCodeAt(0)-65+36;else if(e===`@`)t=62;else if(e===`_`)t=63;else return NaN;if(t>=r)return NaN;if(i=i*r+t,i>2**53-1)return 2**53-1}return i}if(e.startsWith(`0x`)||e.startsWith(`0X`)){let t=Number.parseInt(e.slice(2),16);return t>2**53-1?2**53-1:t}if(e.startsWith(`0`)&&e.length>1&&/^[0-9]+$/.test(e)){if(/[89]/.test(e))return NaN;let t=Number.parseInt(e,8);return t>2**53-1?2**53-1:t}let t=Number.parseInt(e,10);return t>2**53-1?2**53-1:t}function d(e,t,n,r){if(n.slice(r,r+3)!==`$((`)return null;let i=r+3,a=1,o=i;for(;i<n.length-1&&a>0;)n[i]===`(`&&n[i+1]===`(`?(a++,i+=2):n[i]===`)`&&n[i+1]===`)`?(a--,a>0&&(i+=2)):i++;let{expr:s}=e(t,n.slice(o,i),0);return i+=2,{expr:{type:`ArithNested`,expression:s},pos:i}}function f(e,t){if(e.slice(t,t+2)!==`$'`)return null;let n=t+2,r=``;for(;n<e.length&&e[n]!==`'`;)if(e[n]===`\\`&&n+1<e.length){let t=e[n+1];switch(t){case`n`:r+=`
3
3
  `;break;case`t`:r+=` `;break;case`r`:r+=`\r`;break;case`\\`:r+=`\\`;break;case`'`:r+=`'`;break;default:r+=t}n+=2}else r+=e[n],n++;e[n]===`'`&&n++;let i=Number.parseInt(r,10);return{expr:{type:`ArithNumber`,value:Number.isNaN(i)?0:i},pos:n}}function p(e,t){if(e.slice(t,t+2)!==`$"`)return null;let n=t+2,r=``;for(;n<e.length&&e[n]!==`"`;)e[n]===`\\`&&n+1<e.length?(r+=e[n+1],n+=2):(r+=e[n],n++);e[n]===`"`&&n++;let i=Number.parseInt(r,10);return{expr:{type:`ArithNumber`,value:Number.isNaN(i)?0:i},pos:n}}function m(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`"`){for(n++;n<e.length&&e[n]!==`"`;)e[n]===`\\`&&n+1<e.length?(t+=e[n+1],n+=2):(t+=e[n],n++);n<e.length&&n++}else t+=e[n],n++;return t}function h(e,t){let n=m(t),{expr:r,pos:i}=v(e,n,0),a=c(n,i);if(a<n.length){let e=t.slice(a).trim();if(e)return{type:`ArithmeticExpression`,originalText:t,expression:{type:`ArithSyntaxError`,errorToken:e,message:`${e}: syntax error: invalid arithmetic operator (error token is "${e}")`}}}return{type:`ArithmeticExpression`,expression:r,originalText:t}}function g(e,t){return{expr:{type:`ArithSyntaxError`,errorToken:e,message:`syntax error: operand expected (error token is "${e}")`},pos:t}}function _(e,t){return c(e,t)>=e.length}function v(e,t,n){return ee(e,t,n)}function ee(e,t,n){let{expr:r,pos:i}=y(e,t,n);for(i=c(t,i);t[i]===`,`;){if(i++,_(t,i))return g(`,`,i);let{expr:n,pos:a}=y(e,t,i);r={type:`ArithBinary`,operator:`,`,left:r,right:n},i=c(t,a)}return{expr:r,pos:i}}function y(e,t,n){let{expr:r,pos:i}=te(e,t,n);if(i=c(t,i),t[i]===`?`){i++;let{expr:n,pos:a}=v(e,t,i);if(i=c(t,a),t[i]===`:`){i++;let{expr:a,pos:o}=v(e,t,i);return{expr:{type:`ArithTernary`,condition:r,consequent:n,alternate:a},pos:o}}}return{expr:r,pos:i}}function te(e,t,n){let{expr:r,pos:i}=ne(e,t,n);for(;i=c(t,i),t.slice(i,i+2)===`||`;){if(i+=2,_(t,i))return g(`||`,i);let{expr:n,pos:a}=ne(e,t,i);r={type:`ArithBinary`,operator:`||`,left:r,right:n},i=a}return{expr:r,pos:i}}function ne(e,t,n){let{expr:r,pos:i}=re(e,t,n);for(;i=c(t,i),t.slice(i,i+2)===`&&`;){if(i+=2,_(t,i))return g(`&&`,i);let{expr:n,pos:a}=re(e,t,i);r={type:`ArithBinary`,operator:`&&`,left:r,right:n},i=a}return{expr:r,pos:i}}function re(e,t,n){let{expr:r,pos:i}=ie(e,t,n);for(;i=c(t,i),t[i]===`|`&&t[i+1]!==`|`;){if(i++,_(t,i))return g(`|`,i);let{expr:n,pos:a}=ie(e,t,i);r={type:`ArithBinary`,operator:`|`,left:r,right:n},i=a}return{expr:r,pos:i}}function ie(e,t,n){let{expr:r,pos:i}=ae(e,t,n);for(;i=c(t,i),t[i]===`^`;){if(i++,_(t,i))return g(`^`,i);let{expr:n,pos:a}=ae(e,t,i);r={type:`ArithBinary`,operator:`^`,left:r,right:n},i=a}return{expr:r,pos:i}}function ae(e,t,n){let{expr:r,pos:i}=oe(e,t,n);for(;i=c(t,i),t[i]===`&`&&t[i+1]!==`&`;){if(i++,_(t,i))return g(`&`,i);let{expr:n,pos:a}=oe(e,t,i);r={type:`ArithBinary`,operator:`&`,left:r,right:n},i=a}return{expr:r,pos:i}}function oe(e,t,n){let{expr:r,pos:i}=se(e,t,n);for(;i=c(t,i),t.slice(i,i+2)===`==`||t.slice(i,i+2)===`!=`;){let n=t.slice(i,i+2);if(i+=2,_(t,i))return g(n,i);let{expr:a,pos:o}=se(e,t,i);r={type:`ArithBinary`,operator:n,left:r,right:a},i=o}return{expr:r,pos:i}}function se(e,t,n){let{expr:r,pos:i}=ce(e,t,n);for(;;)if(i=c(t,i),t.slice(i,i+2)===`<=`||t.slice(i,i+2)===`>=`){let n=t.slice(i,i+2);if(i+=2,_(t,i))return g(n,i);let{expr:a,pos:o}=ce(e,t,i);r={type:`ArithBinary`,operator:n,left:r,right:a},i=o}else if(t[i]===`<`||t[i]===`>`){let n=t[i];if(i++,_(t,i))return g(n,i);let{expr:a,pos:o}=ce(e,t,i);r={type:`ArithBinary`,operator:n,left:r,right:a},i=o}else break;return{expr:r,pos:i}}function ce(e,t,n){let{expr:r,pos:i}=le(e,t,n);for(;i=c(t,i),t.slice(i,i+2)===`<<`||t.slice(i,i+2)===`>>`;){let n=t.slice(i,i+2);if(i+=2,_(t,i))return g(n,i);let{expr:a,pos:o}=le(e,t,i);r={type:`ArithBinary`,operator:n,left:r,right:a},i=o}return{expr:r,pos:i}}function le(e,t,n){let{expr:r,pos:i}=ue(e,t,n);for(;i=c(t,i),(t[i]===`+`||t[i]===`-`)&&t[i+1]!==t[i];){let n=t[i];if(i++,_(t,i))return g(n,i);let{expr:a,pos:o}=ue(e,t,i);r={type:`ArithBinary`,operator:n,left:r,right:a},i=o}return{expr:r,pos:i}}function ue(e,t,n){let{expr:r,pos:i}=de(e,t,n);for(;;)if(i=c(t,i),t[i]===`*`&&t[i+1]!==`*`){if(i++,_(t,i))return g(`*`,i);let{expr:n,pos:a}=de(e,t,i);r={type:`ArithBinary`,operator:`*`,left:r,right:n},i=a}else if(t[i]===`/`||t[i]===`%`){let n=t[i];if(i++,_(t,i))return g(n,i);let{expr:a,pos:o}=de(e,t,i);r={type:`ArithBinary`,operator:n,left:r,right:a},i=o}else break;return{expr:r,pos:i}}function de(e,t,n){let{expr:r,pos:i}=fe(e,t,n),a=c(t,i);if(t.slice(a,a+2)===`**`){if(a+=2,_(t,a))return g(`**`,a);let{expr:n,pos:i}=de(e,t,a);return{expr:{type:`ArithBinary`,operator:`**`,left:r,right:n},pos:i}}return{expr:r,pos:i}}function fe(e,t,n){let r=c(t,n);if(t.slice(r,r+2)===`++`||t.slice(r,r+2)===`--`){let n=t.slice(r,r+2);r+=2;let{expr:i,pos:a}=fe(e,t,r);return{expr:{type:`ArithUnary`,operator:n,operand:i,prefix:!0},pos:a}}if(t[r]===`+`||t[r]===`-`||t[r]===`!`||t[r]===`~`){let n=t[r];r++;let{expr:i,pos:a}=fe(e,t,r);return{expr:{type:`ArithUnary`,operator:n,operand:i,prefix:!0},pos:a}}return me(e,t,r)}function pe(e,t){let n=e[t];return n===`$`||n==="`"}function me(e,t,n){let{expr:r,pos:i}=he(e,t,n,!1),a=[r];for(;pe(t,i);){let{expr:n,pos:r}=he(e,t,i,!0);a.push(n),i=r}a.length>1&&(r={type:`ArithConcat`,parts:a});let o;if(t[i]===`[`&&r.type===`ArithConcat`){i++;let{expr:n,pos:r}=v(e,t,i);o=n,i=r,t[i]===`]`&&i++}if(o&&r.type===`ArithConcat`&&(r={type:`ArithDynamicElement`,nameExpr:r,subscript:o},o=void 0),i=c(t,i),r.type===`ArithConcat`||r.type===`ArithVariable`||r.type===`ArithDynamicElement`){for(let n of l)if(t.slice(i,i+n.length)===n&&t.slice(i,i+n.length+1)!==`==`){i+=n.length;let{expr:a,pos:o}=y(e,t,i);return r.type===`ArithDynamicElement`?{expr:{type:`ArithDynamicAssignment`,operator:n,target:r.nameExpr,subscript:r.subscript,value:a},pos:o}:r.type===`ArithConcat`?{expr:{type:`ArithDynamicAssignment`,operator:n,target:r,value:a},pos:o}:{expr:{type:`ArithAssignment`,operator:n,variable:r.name,value:a},pos:o}}}if(t.slice(i,i+2)===`++`||t.slice(i,i+2)===`--`){let e=t.slice(i,i+2);return i+=2,{expr:{type:`ArithUnary`,operator:e,operand:r,prefix:!1},pos:i}}return{expr:r,pos:i}}function he(e,t,n,i=!1){let a=c(t,n),o=d(v,e,t,a);if(o)return o;let s=f(t,a);if(s)return s;let m=p(t,a);if(m)return m;if(t.slice(a,a+2)===`$(`&&t[a+2]!==`(`){a+=2;let e=1,n=a;for(;a<t.length&&e>0;)t[a]===`(`?e++:t[a]===`)`&&e--,e>0&&a++;let r=t.slice(n,a);return a++,{expr:{type:`ArithCommandSubst`,command:r},pos:a}}if(t[a]==="`"){a++;let e=a;for(;a<t.length&&t[a]!=="`";)a++;let n=t.slice(e,a);return t[a]==="`"&&a++,{expr:{type:`ArithCommandSubst`,command:n},pos:a}}if(t[a]===`(`){a++;let{expr:n,pos:r}=v(e,t,a);return a=c(t,r),t[a]===`)`&&a++,{expr:{type:`ArithGroup`,expression:n},pos:a}}if(t[a]===`'`){a++;let e=``;for(;a<t.length&&t[a]!==`'`;)e+=t[a],a++;t[a]===`'`&&a++;let n=Number.parseInt(e,10);return{expr:{type:`ArithSingleQuote`,content:e,value:Number.isNaN(n)?0:n},pos:a}}if(t[a]===`"`){a++;let n=``;for(;a<t.length&&t[a]!==`"`;)t[a]===`\\`&&a+1<t.length?(n+=t[a+1],a+=2):(n+=t[a],a++);t[a]===`"`&&a++;let r=n.trim();if(!r)return{expr:{type:`ArithNumber`,value:0},pos:a};let{expr:i}=v(e,r,0);return{expr:i,pos:a}}if(/[0-9]/.test(t[a])){let e=``,n=!1,i=!1;for(;a<t.length;){let r=t[a];if(n)if(/[0-9a-zA-Z@_]/.test(r))e+=r,a++;else break;else if(r===`#`)n=!0,e+=r,a++;else if(e===`0`&&(r===`x`||r===`X`)&&a+1<t.length&&/[0-9a-fA-F]/.test(t[a+1]))i=!0,e+=r,a++;else if(i&&/[0-9a-fA-F]/.test(r))e+=r,a++;else if(!i&&/[0-9]/.test(r))e+=r,a++;else break}if(a<t.length&&/[a-zA-Z_]/.test(t[a])){let n=e;for(;a<t.length&&/[a-zA-Z0-9_]/.test(t[a]);)n+=t[a],a++;return{expr:{type:`ArithSyntaxError`,errorToken:n,message:`${n}: value too great for base (error token is "${n}")`},pos:a}}if(t[a]===`.`&&/[0-9]/.test(t[a+1]))throw new r(`${e}.${t[a+1]}...: syntax error: invalid arithmetic operator`);if(t[a]===`[`){let n=t.slice(a).trim();return{expr:{type:`ArithNumberSubscript`,number:e,errorToken:n},pos:t.length}}return{expr:{type:`ArithNumber`,value:u(e)},pos:a}}if(t[a]===`$`&&t[a+1]===`{`){let e=a+2,n=1,r=e;for(;r<t.length&&n>0;)t[r]===`{`?n++:t[r]===`}`&&n--,n>0&&r++;let i=t.slice(e,r),o=r+1;if(t[o]===`#`){let e=o+1;for(;e<t.length&&/[0-9a-zA-Z@_]/.test(t[e]);)e++;return{expr:{type:`ArithDynamicBase`,baseExpr:i,value:t.slice(o+1,e)},pos:e}}if(/[0-9]/.test(t[o])||t[o]===`x`||t[o]===`X`){let e=o;if(t[o]===`x`||t[o]===`X`)for(e++;e<t.length&&/[0-9a-fA-F]/.test(t[e]);)e++;else for(;e<t.length&&/[0-9]/.test(t[e]);)e++;return{expr:{type:`ArithDynamicNumber`,prefix:i,suffix:t.slice(o,e)},pos:e}}return a=o,{expr:{type:`ArithBracedExpansion`,content:i},pos:a}}if(t[a]===`$`&&a+1<t.length&&/[0-9]/.test(t[a+1])){a++;let e=``;for(;a<t.length&&/[0-9]/.test(t[a]);)e+=t[a],a++;return{expr:{type:`ArithVariable`,name:e,hasDollarPrefix:!0},pos:a}}if(t[a]===`$`&&a+1<t.length&&/[*@#?\-!$]/.test(t[a+1])){let e=t[a+1];return a+=2,{expr:{type:`ArithSpecialVar`,name:e},pos:a}}let h=!1;if(t[a]===`$`&&a+1<t.length&&/[a-zA-Z_]/.test(t[a+1])&&(h=!0,a++),a<t.length&&/[a-zA-Z_]/.test(t[a])){let n=``;for(;a<t.length&&/[a-zA-Z0-9_]/.test(t[a]);)n+=t[a],a++;if(t[a]===`[`&&!i){a++;let r;if(t[a]===`'`||t[a]===`"`){let e=t[a];for(a++,r=``;a<t.length&&t[a]!==e;)r+=t[a],a++;t[a]===e&&a++,a=c(t,a),t[a]===`]`&&a++}let o;if(r===void 0){let{expr:n,pos:r}=v(e,t,a);o=n,a=r,t[a]===`]`&&a++}if(a=c(t,a),t[a]===`[`&&o)return{expr:{type:`ArithDoubleSubscript`,array:n,index:o},pos:a};if(!i){for(let i of l)if(t.slice(a,a+i.length)===i&&t.slice(a,a+i.length+1)!==`==`){a+=i.length;let{expr:s,pos:c}=y(e,t,a);return{expr:{type:`ArithAssignment`,operator:i,variable:n,subscript:o,stringKey:r,value:s},pos:c}}}return{expr:{type:`ArithArrayElement`,array:n,index:o,stringKey:r},pos:a}}if(a=c(t,a),!i){for(let r of l)if(t.slice(a,a+r.length)===r&&t.slice(a,a+r.length+1)!==`==`){a+=r.length;let{expr:i,pos:o}=y(e,t,a);return{expr:{type:`ArithAssignment`,operator:r,variable:n,value:i},pos:o}}}return{expr:{type:`ArithVariable`,name:n,hasDollarPrefix:h},pos:a}}if(t[a]===`#`){let e=a+1;for(;e<t.length&&t[e]!==`
4
4
  `;)e++;let n=t.slice(a,e).trim()||`#`;return{expr:{type:`ArithSyntaxError`,errorToken:n,message:`${n}: syntax error: invalid arithmetic operator (error token is "${n}")`},pos:t.length}}return{expr:{type:`ArithNumber`,value:0},pos:a}}var b={script(e){return{type:`Script`,statements:e}},statement(e,t=[],n=!1,r,i){let a={type:`Statement`,pipelines:e,operators:t,background:n};return r&&(a.deferredError=r),i!==void 0&&(a.sourceText=i),a},pipeline(e,t=!1,n=!1,r=!1,i){return{type:`Pipeline`,commands:e,negated:t,timed:n,timePosix:r,pipeStderr:i}},simpleCommand(e,t=[],n=[],r=[]){return{type:`SimpleCommand`,name:e,args:t,assignments:n,redirections:r}},word(e){return{type:`Word`,parts:e}},literal(e){return{type:`Literal`,value:e}},singleQuoted(e){return{type:`SingleQuoted`,value:e}},doubleQuoted(e){return{type:`DoubleQuoted`,parts:e}},escaped(e){return{type:`Escaped`,value:e}},parameterExpansion(e,t=null){return{type:`ParameterExpansion`,parameter:e,operation:t}},commandSubstitution(e,t=!1){return{type:`CommandSubstitution`,body:e,legacy:t}},arithmeticExpansion(e){return{type:`ArithmeticExpansion`,expression:e}},assignment(e,t,n=!1,r=null){return{type:`Assignment`,name:e,value:t,append:n,array:r}},redirection(e,t,n=null,r){let i={type:`Redirection`,fd:n,operator:e,target:t};return r&&(i.fdVariable=r),i},hereDoc(e,t,n=!1,r=!1){return{type:`HereDoc`,delimiter:e,content:t,stripTabs:n,quoted:r}},ifNode(e,t=null,n=[]){return{type:`If`,clauses:e,elseBody:t,redirections:n}},forNode(e,t,n,r=[]){return{type:`For`,variable:e,words:t,body:n,redirections:r}},whileNode(e,t,n=[]){return{type:`While`,condition:e,body:t,redirections:n}},untilNode(e,t,n=[]){return{type:`Until`,condition:e,body:t,redirections:n}},caseNode(e,t,n=[]){return{type:`Case`,word:e,items:t,redirections:n}},caseItem(e,t,n=`;;`){return{type:`CaseItem`,patterns:e,body:t,terminator:n}},subshell(e,t=[]){return{type:`Subshell`,body:e,redirections:t}},group(e,t=[]){return{type:`Group`,body:e,redirections:t}},functionDef(e,t,n=[],r){return{type:`FunctionDef`,name:e,body:t,redirections:n,sourceFile:r}},conditionalCommand(e,t=[],n){return{type:`ConditionalCommand`,expression:e,redirections:t,line:n}},arithmeticCommand(e,t=[],n){return{type:`ArithmeticCommand`,expression:e,redirections:t,line:n}}},x;(function(e){e.EOF=`EOF`,e.NEWLINE=`NEWLINE`,e.SEMICOLON=`SEMICOLON`,e.AMP=`AMP`,e.PIPE=`PIPE`,e.PIPE_AMP=`PIPE_AMP`,e.AND_AND=`AND_AND`,e.OR_OR=`OR_OR`,e.BANG=`BANG`,e.LESS=`LESS`,e.GREAT=`GREAT`,e.DLESS=`DLESS`,e.DGREAT=`DGREAT`,e.LESSAND=`LESSAND`,e.GREATAND=`GREATAND`,e.LESSGREAT=`LESSGREAT`,e.DLESSDASH=`DLESSDASH`,e.CLOBBER=`CLOBBER`,e.TLESS=`TLESS`,e.AND_GREAT=`AND_GREAT`,e.AND_DGREAT=`AND_DGREAT`,e.LPAREN=`LPAREN`,e.RPAREN=`RPAREN`,e.LBRACE=`LBRACE`,e.RBRACE=`RBRACE`,e.DSEMI=`DSEMI`,e.SEMI_AND=`SEMI_AND`,e.SEMI_SEMI_AND=`SEMI_SEMI_AND`,e.DBRACK_START=`DBRACK_START`,e.DBRACK_END=`DBRACK_END`,e.DPAREN_START=`DPAREN_START`,e.DPAREN_END=`DPAREN_END`,e.IF=`IF`,e.THEN=`THEN`,e.ELSE=`ELSE`,e.ELIF=`ELIF`,e.FI=`FI`,e.FOR=`FOR`,e.WHILE=`WHILE`,e.UNTIL=`UNTIL`,e.DO=`DO`,e.DONE=`DONE`,e.CASE=`CASE`,e.ESAC=`ESAC`,e.IN=`IN`,e.FUNCTION=`FUNCTION`,e.SELECT=`SELECT`,e.TIME=`TIME`,e.COPROC=`COPROC`,e.WORD=`WORD`,e.NAME=`NAME`,e.NUMBER=`NUMBER`,e.ASSIGNMENT_WORD=`ASSIGNMENT_WORD`,e.FD_VARIABLE=`FD_VARIABLE`,e.COMMENT=`COMMENT`,e.HEREDOC_CONTENT=`HEREDOC_CONTENT`})(x||={});var S=class extends Error{line;column;constructor(e,t,n){super(`line ${t}: ${e}`),this.line=t,this.column=n,this.name=`LexerError`}},ge=new Map([[`if`,x.IF],[`then`,x.THEN],[`else`,x.ELSE],[`elif`,x.ELIF],[`fi`,x.FI],[`for`,x.FOR],[`while`,x.WHILE],[`until`,x.UNTIL],[`do`,x.DO],[`done`,x.DONE],[`case`,x.CASE],[`esac`,x.ESAC],[`in`,x.IN],[`function`,x.FUNCTION],[`select`,x.SELECT],[`time`,x.TIME],[`coproc`,x.COPROC]]);function _e(e){let t=e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);if(!t)return!1;let n=e.slice(t[0].length);if(n===``||n===`+`)return!0;if(n[0]===`[`){let e=0,t=0;for(;t<n.length;t++)if(n[t]===`[`)e++;else if(n[t]===`]`&&(e--,e===0))break;if(e!==0||t>=n.length)return!1;let r=n.slice(t+1);return r===``||r===`+`}return!1}function ve(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r===`[`)t++;else if(r===`]`)t--;else{if(t===0&&r===`=`)return n;if(t===0&&r===`+`&&e[n+1]===`=`)return n+1}}return-1}var ye=[[`;`,`;`,`&`,x.SEMI_SEMI_AND],[`<`,`<`,`<`,x.TLESS],[`&`,`>`,`>`,x.AND_DGREAT]],be=[[`[`,`[`,x.DBRACK_START],[`]`,`]`,x.DBRACK_END],[`(`,`(`,x.DPAREN_START],[`)`,`)`,x.DPAREN_END],[`&`,`&`,x.AND_AND],[`|`,`|`,x.OR_OR],[`;`,`;`,x.DSEMI],[`;`,`&`,x.SEMI_AND],[`|`,`&`,x.PIPE_AMP],[`>`,`>`,x.DGREAT],[`<`,`&`,x.LESSAND],[`>`,`&`,x.GREATAND],[`<`,`>`,x.LESSGREAT],[`>`,`|`,x.CLOBBER],[`&`,`>`,x.AND_GREAT]],xe=new Map([[`|`,x.PIPE],[`&`,x.AMP],[`;`,x.SEMICOLON],[`(`,x.LPAREN],[`)`,x.RPAREN],[`<`,x.LESS],[`>`,x.GREAT]]);function Se(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)}function Ce(e){return e===` `||e===` `||e===`
@@ -72,4 +72,4 @@ Gid: ${i} ${i} ${i} ${i}
72
72
  `};if(r||e.state.options.noglob)return{target:i};let s=await pi(e,t);if(!H(s,e.state.shoptOptions.extglob))return{target:i};let c=new Pt(e.fs,e.state.cwd,e.state.env,{globstar:e.state.shoptOptions.globstar,nullglob:e.state.shoptOptions.nullglob,failglob:e.state.shoptOptions.failglob,dotglob:e.state.shoptOptions.dotglob,extglob:e.state.shoptOptions.extglob,globskipdots:e.state.shoptOptions.globskipdots,maxGlobOperations:e.limits.maxGlobOperations}),l=await c.expand(s);return l.length===0?c.hasFailglob()?{error:`bash: no match: ${i}
73
73
  `}:{target:i}:l.length===1?{target:l[0]}:{error:`bash: ${i}: ambiguous redirect
74
74
  `}}async function Ci(e,t){let n=t.parts,r=n.length;if(r===1){let t=await $(e,n[0]);return Z(t,e.limits.maxStringLength,`word expansion`),t}let i=[];for(let t=0;t<r;t++)i.push(await $(e,n[t]));let a=i.join(``);return Z(a,e.limits.maxStringLength,`word expansion`),a}async function $(e,t,n=!1){if(t.type===`ParameterExpansion`)return wi(e,t,n);let r=li(e,t,n);if(r!==null)return r;switch(t.type){case`DoubleQuoted`:{let n=[];for(let r of t.parts)n.push(await $(e,r,!0));return n.join(``)}case`CommandSubstitution`:{let n=En(t.body);if(n)try{let t=await ui(e,n.target),r=t.startsWith(`/`)?t:`${e.state.cwd}/${t}`,i=await e.fs.readFile(r);e.state.lastExitCode=0,e.state.env.set(`?`,`0`);let a=i.replace(/\n+$/,``);return Z(a,e.limits.maxStringLength,`command substitution`),a}catch(t){if(t instanceof a)throw t;return e.state.lastExitCode=1,e.state.env.set(`?`,`1`),``}let r=e.substitutionDepth??0,i=e.limits.maxSubstitutionDepth;if(r>=i)throw new a(`Command substitution nesting limit exceeded (${i})`,`substitution_depth`);let s=e.substitutionDepth;e.substitutionDepth=r+1;let c=e.state.bashPid;e.state.bashPid=e.state.nextVirtualPid++;let l=new Map(e.state.env),u=e.state.cwd,d=e.state.suppressVerbose;e.state.suppressVerbose=!0;try{let n=await e.executeScript(t.body),r=n.exitCode;e.state.env=l,e.state.cwd=u,e.state.suppressVerbose=d,e.state.lastExitCode=r,e.state.env.set(`?`,String(r)),n.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||``)+n.stderr),e.state.bashPid=c,e.substitutionDepth=s;let i=n.stdout.replace(/\n+$/,``);return Z(i,e.limits.maxStringLength,`command substitution`),i}catch(t){if(e.state.env=l,e.state.cwd=u,e.state.bashPid=c,e.substitutionDepth=s,e.state.suppressVerbose=d,t instanceof a)throw t;if(t instanceof o){e.state.lastExitCode=t.exitCode,e.state.env.set(`?`,String(t.exitCode)),t.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||``)+t.stderr);let n=t.stdout.replace(/\n+$/,``);return Z(n,e.limits.maxStringLength,`command substitution`),n}throw t}}case`ArithmeticExpansion`:{let n=t.expression.originalText;if(n&&/\$[a-zA-Z_][a-zA-Z0-9_]*(?![{[(])/.test(n)){let t=await xn(e,n),r=h(new D,t);return String(await O(e,r.expression,!0))}return String(await O(e,t.expression.expression,!0))}case`BraceExpansion`:{let n=[];for(let r of t.items)if(r.type===`Range`){let e=Tn(r.start,r.end,r.step,r.startStr,r.endStr);if(e.expanded)n.push(...e.expanded);else return e.literal}else n.push(await ui(e,r.word));return n.join(` `)}default:return``}}async function wi(e,t,n=!1){let{parameter:r}=t,{operation:i}=t,a=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(a){let[,t,n]=a;(e.state.associativeArrays?.has(t)||n.includes(`$(`)||n.includes("`")||n.includes("${"))&&(r=`${t}[${await Sn(e,n)}]`)}else if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)&&P(e,r)){let t=F(e,r);if(t&&t!==r){let n=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(n){let[,t,i]=n;(e.state.associativeArrays?.has(t)||i.includes(`$(`)||i.includes("`")||i.includes("${"))&&(r=`${t}[${await Sn(e,i)}]`)}}}let o=i&&(i.type===`DefaultValue`||i.type===`AssignDefault`||i.type===`UseAlternative`||i.type===`ErrorIfUnset`),c=await z(e,r,!o);if(!i)return c;let l=!await B(e,r),{isEmpty:u,effectiveValue:d}=nr(e,r,c,n),f={value:c,isUnset:l,isEmpty:u,effectiveValue:d,inDoubleQuotes:n};switch(i.type){case`DefaultValue`:return Un(e,i,f,Q);case`AssignDefault`:return Wn(e,r,i,f,Q);case`ErrorIfUnset`:return Gn(e,r,i,f,Q);case`UseAlternative`:return Kn(e,i,f,Q);case`PatternRemoval`:{let t=await qn(e,c,i,Q,$);return Z(t,e.limits.maxStringLength,`pattern removal`),t}case`PatternReplacement`:{let t=await Jn(e,c,i,Q,$);return Z(t,e.limits.maxStringLength,`pattern replacement`),t}case`Length`:return Yn(e,r,c);case`LengthSliceError`:throw new s(r);case`BadSubstitution`:throw new s(i.text);case`Substring`:return Xn(e,r,c,i);case`CaseModification`:{let t=await Zn(e,c,i,Q,wi);return Z(t,e.limits.maxStringLength,`case modification`),t}case`Transform`:return Qn(e,r,c,l,i);case`Indirection`:return $n(e,r,c,l,i,wi,n);case`ArrayKeys`:return er(e,i);case`VarNamePrefix`:return tr(e,i);default:return c}}export{Qt as A,zn as B,Yt as C,Bn as D,On as E,S as F,yn as H,mn as I,vn as L,Vn as M,Xt as N,Et as O,Rn as P,z as R,U as S,fi as T,Jt as V,fn as _,_n as a,P as b,h as c,L as d,ui as f,A as g,di as h,nn as i,F as j,Hn as k,Si as l,I as m,hn as n,xi as o,O as p,Zt as r,C as s,ci as t,en as u,D as v,R as w,ln as x,pn as y,yi as z};
75
- //# sourceMappingURL=chunk-FEIOJCZD-D6YUa1Xl.mjs.map
75
+ //# sourceMappingURL=chunk-BGSUD5R5-DQ0_iOyO.mjs.map
@@ -1,4 +1,4 @@
1
- import{a as e}from"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import{t}from"./chunk-SYMJJMQ4-DUF5hY-A.mjs";var n=e(t(),1);function r(){return Object.create(null)}function i(e,t,n){e[t]=n}function a(e){let t=r();for(let n of Object.keys(e)){let r=e[n];(typeof r==`string`||typeof r==`number`||typeof r==`boolean`||r===null)&&(t[n]=r)}return t}function o(e){let t=n.default.parse(e.trim(),{header:!0,dynamicTyping:!0,skipEmptyLines:!0}),r=t.data.map(e=>a(e));return{headers:t.meta.fields||[],data:r}}function s(e,t){return t.length===0?`${e.join(`,`)}
1
+ import{a as e}from"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import{t}from"./chunk-PXTK5WE2-B17f9YTq.mjs";var n=e(t(),1);function r(){return Object.create(null)}function i(e,t,n){e[t]=n}function a(e){let t=r();for(let n of Object.keys(e)){let r=e[n];(typeof r==`string`||typeof r==`number`||typeof r==`boolean`||r===null)&&(t[n]=r)}return t}function o(e){let t=n.default.parse(e.trim(),{header:!0,dynamicTyping:!0,skipEmptyLines:!0}),r=t.data.map(e=>a(e));return{headers:t.meta.fields||[],data:r}}function s(e,t){return t.length===0?`${e.join(`,`)}
2
2
  `:`${n.default.unparse(t,{columns:e}).replace(/\r\n/g,`
3
3
  `)}
4
4
  `}async function c(e,t){let n=e.find(e=>!e.startsWith(`-`)),r;if(!n||n===`-`)r=t.stdin;else try{let e=t.fs.resolvePath(t.cwd,n);r=await t.fs.readFile(e)}catch{return{headers:[],data:[],error:{stdout:``,stderr:`xan: ${n}: No such file or directory
@@ -7,4 +7,4 @@ import{a as e}from"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import{t}from"./chunk-SYMJJMQ4
7
7
  `,stderr:``,exitCode:0}}async function u(e,t){let n=0,r=[];for(let t=0;t<e.length;t++){let i=e[t];i===`-n`&&t+1<e.length?n=Number.parseInt(e[++t],10):i.startsWith(`-`)||r.push(i)}let{headers:i,data:a,error:o}=await c(r,t);if(o)return o;let s=n>0?a.slice(0,n):a,l=i.map(e=>e.length);for(let e of s)for(let t=0;t<i.length;t++){let n=String(e[i[t]]??``);l[t]=Math.max(l[t],n.length)}let u=[];u.push(`\u250C${l.map(e=>`─`.repeat(e+2)).join(`┬`)}\u2510`);let d=i.map((e,t)=>` ${e.padEnd(l[t])} `).join(`│`);u.push(`│${d}│`),u.push(`\u251C${l.map(e=>`─`.repeat(e+2)).join(`┼`)}\u2524`);for(let e of s){let t=i.map((t,n)=>` ${String(e[t]??``).padEnd(l[n])} `).join(`│`);u.push(`│${t}│`)}return u.push(`\u2514${l.map(e=>`─`.repeat(e+2)).join(`┴`)}\u2518`),{stdout:`${u.join(`
8
8
  `)}
9
9
  `,stderr:``,exitCode:0}}export{o as a,u as c,l as i,s as n,c as o,i as r,r as s,a as t};
10
- //# sourceMappingURL=chunk-F55TLFGB-AEzanSfe.mjs.map
10
+ //# sourceMappingURL=chunk-DBKNVD4L-BVx-WyDG.mjs.map
@@ -1,5 +1,5 @@
1
- import{s as e,t}from"./chunk-C94x7I9S.mjs";import{t as n}from"./chunk-YNYSPYQ5-DHter9G3.mjs";import{t as r}from"./chunk-5QMZ5MUS-_0tQyQsf.mjs";import{n as i,r as a,t as o}from"./chunk-74CEPOFO-V0JXh91S.mjs";import{t as s}from"./chunk-X2AJGDEF-ClcErtij.mjs";var c=t(((e,t)=>{var n=[0,1,3,7,15,31,63,127,255],r=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};r.prototype._ensureByte=function(){this.hasByte||=(this.curByte=this.stream.readByte(),!0)},r.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=n[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var i=r-e;t|=(this.curByte&n[e]<<i)>>i,this.bitOffset+=e,e=0}}return t},r.prototype.seek=function(e){var t=e%8,n=(e-t)/8;this.bitOffset=t,this.stream.seek(n),this.hasByte=!1},r.prototype.pi=function(){var e=new Buffer(6),t;for(t=0;t<e.length;t++)e[t]=this.read(8);return e.toString(`hex`)},t.exports=r})),l=t(((e,t)=>{var n=function(){};n.prototype.readByte=function(){throw Error(`abstract method readByte() not implemented`)},n.prototype.read=function(e,t,n){for(var r=0;r<n;){var i=this.readByte();if(i<0)return r===0?-1:r;e[t++]=i,r++}return r},n.prototype.seek=function(e){throw Error(`abstract method seek() not implemented`)},n.prototype.writeByte=function(e){throw Error(`abstract method readByte() not implemented`)},n.prototype.write=function(e,t,n){var r;for(r=0;r<n;r++)this.writeByte(e[t++]);return n},n.prototype.flush=function(){},t.exports=n})),u=t(((e,t)=>{t.exports=(function(){var e=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]);return function(){var t=4294967295;this.getCRC=function(){return~t>>>0},this.updateCRC=function(n){t=t<<8^e[(t>>>24^n)&255]},this.updateCRCRun=function(n,r){for(;r-- >0;)t=t<<8^e[(t>>>24^n)&255]}}})()})),d=t(((e,t)=>{t.exports={name:`seek-bzip`,version:`2.0.0`,contributors:[`C. Scott Ananian (http://cscott.net)`,`Eli Skeggs`,`Kevin Kwok`,`Rob Landley (http://landley.net)`],description:`a pure-JavaScript Node.JS module for random-access decoding bzip2 data`,main:`./lib/index.js`,repository:{type:`git`,url:`https://github.com/cscott/seek-bzip.git`},license:`MIT`,bin:{"seek-bunzip":`./bin/seek-bunzip`,"seek-table":`./bin/seek-bzip-table`},directories:{test:`test`},dependencies:{commander:`^6.0.0`},devDependencies:{fibers:`^5.0.0`,mocha:`^8.1.0`},scripts:{test:`mocha`}}})),f=e(t(((e,t)=>{var n=c(),r=l(),i=u(),a=d(),o=20,s=258,f=0,p=1,m=2,h=6,g=50,_=`314159265359`,v=`177245385090`,y=function(e,t){var n=e[t],r;for(r=t;r>0;r--)e[r]=e[r-1];return e[0]=n,n},b={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},x={};x[b.LAST_BLOCK]=`Bad file checksum`,x[b.NOT_BZIP_DATA]=`Not bzip data`,x[b.UNEXPECTED_INPUT_EOF]=`Unexpected input EOF`,x[b.UNEXPECTED_OUTPUT_EOF]=`Unexpected output EOF`,x[b.DATA_ERROR]=`Data error`,x[b.OUT_OF_MEMORY]=`Out of memory`,x[b.OBSOLETE_INPUT]=`Obsolete (pre 0.9.5) bzip format not supported.`;var S=function(e,t){var n=x[e]||`unknown error`;t&&(n+=`: `+t);var r=TypeError(n);throw r.errorCode=e,r},C=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};C.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new i,!0):(this.writeCount=-1,!1)},C.prototype._start_bunzip=function(e,t){var r=new Buffer(4);(e.read(r,0,4)!==4||String.fromCharCode(r[0],r[1],r[2])!==`BZh`)&&S(b.NOT_BZIP_DATA,`bad magic`);var i=r[3]-48;(i<1||i>9)&&S(b.NOT_BZIP_DATA,`level out of range`),this.reader=new n(e),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=t,this.streamCRC=0},C.prototype._get_next_block=function(){var e,t,n,r=this.reader,i=r.pi();if(i===v)return!1;i!==_&&S(b.NOT_BZIP_DATA),this.targetBlockCRC=r.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,r.read(1)&&S(b.OBSOLETE_INPUT);var a=r.read(24);a>this.dbufSize&&S(b.DATA_ERROR,`initial position out of bounds`);var c=r.read(16),l=new Buffer(256),u=0;for(e=0;e<16;e++)if(c&1<<15-e){var d=e*16;for(n=r.read(16),t=0;t<16;t++)n&1<<15-t&&(l[u++]=d+t)}var x=r.read(3);(x<m||x>h)&&S(b.DATA_ERROR);var C=r.read(15);C===0&&S(b.DATA_ERROR);var w=new Buffer(256);for(e=0;e<x;e++)w[e]=e;var T=new Buffer(C);for(e=0;e<C;e++){for(t=0;r.read(1);t++)t>=x&&S(b.DATA_ERROR);T[e]=y(w,t)}var E=u+2,D=[],O;for(t=0;t<x;t++){var k=new Buffer(E),A=new Uint16Array(o+1);for(c=r.read(5),e=0;e<E;e++){for(;(c<1||c>o)&&S(b.DATA_ERROR),r.read(1);)r.read(1)?c--:c++;k[e]=c}var j=M=k[0],M;for(e=1;e<E;e++)k[e]>M?M=k[e]:k[e]<j&&(j=k[e]);O={},D.push(O),O.permute=new Uint16Array(s),O.limit=new Uint32Array(o+2),O.base=new Uint32Array(o+1),O.minLen=j,O.maxLen=M;var N=0;for(e=j;e<=M;e++)for(A[e]=O.limit[e]=0,c=0;c<E;c++)k[c]===e&&(O.permute[N++]=c);for(e=0;e<E;e++)A[k[e]]++;for(N=c=0,e=j;e<M;e++)N+=A[e],O.limit[e]=N-1,N<<=1,c+=A[e],O.base[e+1]=N-c;O.limit[M+1]=Number.MAX_VALUE,O.limit[M]=N+A[M]-1,O.base[j]=0}var P=new Uint32Array(256);for(e=0;e<256;e++)w[e]=e;var F=0,I=0,L=0,R,z=this.dbuf=new Uint32Array(this.dbufSize);for(E=0;;){for(E--||(E=g-1,L>=C&&S(b.DATA_ERROR),O=D[T[L++]]),e=O.minLen,t=r.read(e);e>O.maxLen&&S(b.DATA_ERROR),!(t<=O.limit[e]);e++)t=t<<1|r.read(1);t-=O.base[e],(t<0||t>=s)&&S(b.DATA_ERROR);var B=O.permute[t];if(B===f||B===p){F||(F=1,c=0),B===f?c+=F:c+=2*F,F<<=1;continue}if(F)for(F=0,I+c>this.dbufSize&&S(b.DATA_ERROR),R=l[w[0]],P[R]+=c;c--;)z[I++]=R;if(B>u)break;I>=this.dbufSize&&S(b.DATA_ERROR),e=B-1,R=y(w,e),R=l[R],P[R]++,z[I++]=R}for((a<0||a>=I)&&S(b.DATA_ERROR),t=0,e=0;e<256;e++)n=t+P[e],P[e]=t,t=n;for(e=0;e<I;e++)R=z[e]&255,z[P[R]]|=e<<8,P[R]++;var V=0,ee=0,te=0;return I&&(V=z[a],ee=V&255,V>>=8,te=-1),this.writePos=V,this.writeCurrent=ee,this.writeCount=I,this.writeRun=te,!0},C.prototype._read_bunzip=function(e,t){var n,r,i;if(this.writeCount<0)return 0;var a=this.dbuf,o=this.writePos,s=this.writeCurrent,c=this.writeCount;this.outputsize;for(var l=this.writeRun;c;){for(c--,r=s,o=a[o],s=o&255,o>>=8,l++===3?(n=s,i=r,s=-1):(n=1,i=s),this.blockCRC.updateCRCRun(i,n);n--;)this.outputStream.writeByte(i),this.nextoutput++;s!=r&&(l=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&S(b.DATA_ERROR,`Bad block CRC (got `+this.blockCRC.getCRC().toString(16)+` expected `+this.targetBlockCRC.toString(16)+`)`),this.nextoutput};var w=function(e){if(`readByte`in e)return e;var t=new r;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(e){this.pos=e},t.eof=function(){return this.pos>=e.length},t},T=function(e){var t=new r,n=!0;if(e)if(typeof e==`number`)t.buffer=new Buffer(e),n=!1;else if(`writeByte`in e)return e;else t.buffer=e,n=!1;else t.buffer=new Buffer(16384);return t.pos=0,t.writeByte=function(e){if(n&&this.pos>=this.buffer.length){var t=new Buffer(this.buffer.length*2);this.buffer.copy(t),this.buffer=t}this.buffer[this.pos++]=e},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!n)throw TypeError(`outputsize does not match decoded input`);var e=new Buffer(this.pos);this.buffer.copy(e,0,0,this.pos),this.buffer=e}return this.buffer},t._coerced=!0,t};C.Err=b,C.decode=function(e,t,n){for(var r=w(e),i=T(t),a=new C(r,i);!(`eof`in r&&r.eof());)if(a._init_block())a._read_bunzip();else{var o=a.reader.read(32)>>>0;if(o!==a.streamCRC&&S(b.DATA_ERROR,`Bad stream CRC (got `+a.streamCRC.toString(16)+` expected `+o.toString(16)+`)`),n&&`eof`in r&&!r.eof())a._start_bunzip(r,i);else break}if(`getBuffer`in i)return i.getBuffer()},C.decodeBlock=function(e,t,n){var r=w(e),a=T(n),o=new C(r,a);if(o.reader.seek(t),o._get_next_block()&&(o.blockCRC=new i,o.writeCopies=0,o._read_bunzip()),`getBuffer`in a)return a.getBuffer()},C.table=function(e,t,n){var i=new r;i.delegate=w(e),i.pos=0,i.readByte=function(){return this.pos++,this.delegate.readByte()},i.delegate.eof&&(i.eof=i.delegate.eof.bind(i.delegate));var a=new r;a.pos=0,a.writeByte=function(){this.pos++};for(var o=new C(i,a),s=o.dbufSize;!(`eof`in i&&i.eof());){var c=i.pos*8+o.reader.bitOffset;if(o.reader.hasByte&&(c-=8),o._init_block()){var l=a.pos;o._read_bunzip(),t(c,a.pos-l)}else if(o.reader.read(32),n&&`eof`in i&&!i.eof())o._start_bunzip(i,a),console.assert(o.dbufSize===s,`shouldn't change block size within multistream file`);else break}},C.Stream=r,C.version=a.version,C.license=a.license,t.exports=C}))(),1),p=`file`,m=`link`,h=`symlink`,g=`directory`,_={file:`0`,link:`1`,symlink:`2`,"character-device":`3`,"block-device":`4`,directory:`5`,fifo:`6`,"pax-header":`x`,"pax-global-header":`g`,"gnu-long-name":`L`,"gnu-long-link-name":`K`},v={0:p,1:m,2:h,3:`character-device`,4:`block-device`,5:g,6:`fifo`,x:`pax-header`,g:`pax-global-header`,L:`gnu-long-name`,K:`gnu-long-link-name`},y=new Uint8Array(512),b=new Uint8Array,x=new TextEncoder,S=new TextDecoder;function C(e,t,n,r){r&&x.encodeInto(r,e.subarray(t,t+n))}function w(e,t,n,r){if(r===void 0)return;let i=r.toString(8).padStart(n-1,`0`);x.encodeInto(i,e.subarray(t,t+n-1))}function T(e,t,n){let r=e.indexOf(0,t),i=r===-1||r>t+n?t+n:r;return S.decode(e.subarray(t,i))}function E(e,t,n){let r=0,i=t+n;for(let n=t;n<i;n++){let t=e[n];if(t===0)break;t!==32&&(r=r*8+(t-48))}return r}function D(e,t,n){if(e[t]&128){let r=0;r=e[t]&127;for(let i=1;i<n;i++)r=r*256+e[t+i];if(!Number.isSafeInteger(r))throw Error(`TAR number too large`);return r}return E(e,t,n)}var O=e=>e.type===g||e.type===h||e.type===m;async function k(e){if(e==null)return b;if(e instanceof Uint8Array)return e;if(typeof e==`string`)return x.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw TypeError(`Unsupported content type for entry body.`)}function A(e,t){let{strip:n,filter:r,map:i}=t;if(!n&&!r&&!i)return e;let a={...e};if(n&&n>0){let e=a.name.split(`/`).filter(Boolean);if(n>=e.length)return null;let t=e.slice(n).join(`/`);if(a.name=a.type===g&&!t.endsWith(`/`)?`${t}/`:t,a.linkname?.startsWith(`/`)){let e=a.linkname.split(`/`).filter(Boolean);a.linkname=n>=e.length?`/`:`/${e.slice(n).join(`/`)}`}}if(r?.(a)===!1)return null;let o=i?i(a):a;return o&&(!o.name||!o.name.trim()||o.name===`.`||o.name===`/`)?null:o}var j=32,M=48;function N(e){let t=E(e,148,8),n=0;for(let t=0;t<e.length;t++)t>=148&&t<156?n+=j:n+=e[t];return t===n}function P(e){e.fill(j,148,156);let t=0;for(let n of e)t+=n;for(let n=153;n>=148;n--)e[n]=(t&7)+M,t>>=3;e[154]=0,e[155]=j}function F(e){let t={};e.name.length>100&&I(e.name)===null&&(t.path=e.name),e.linkname&&e.linkname.length>100&&(t.linkpath=e.linkname),e.uname&&e.uname.length>32&&(t.uname=e.uname),e.gname&&e.gname.length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let n=Object.entries(t);if(n.length===0)return null;let r=x.encode(n.map(([e,t])=>{let n=`${e}=${t}
2
- `,r=x.encode(n).length+1,i=r+String(r).length;return i=r+String(i).length,`${i} ${n}`}).join(``));return{paxHeader:L({name:S.decode(x.encode(`PaxHeader/${e.name}`).slice(0,100)),size:r.length,type:`pax-header`,mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:r}}function I(e){if(e.length<=100)return null;let t=e.length-100-1,n=e.lastIndexOf(`/`,155);return n>0&&n>=t?{prefix:e.slice(0,n),name:e.slice(n+1)}:null}function L(e){let t=new Uint8Array(512),n=O(e)?0:e.size??0,r=e.name,i=``;if(!e.pax?.path){let e=I(r);e&&(r=e.name,i=e.prefix)}return C(t,0,100,r),w(t,100,8,e.mode??(e.type===g?493:420)),w(t,108,8,e.uid??0),w(t,116,8,e.gid??0),w(t,124,12,n),w(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),C(t,156,1,_[e.type??p]),C(t,157,100,e.linkname),C(t,257,6,`ustar\0`),C(t,263,2,`00`),C(t,265,32,e.uname),C(t,297,32,e.gname),C(t,345,155,i),P(t),t}function R(e,t){if(t&&!N(e))throw Error(`Invalid tar header checksum.`);let n=T(e,156,1),r={name:T(e,0,100),mode:E(e,100,8),uid:D(e,108,8),gid:D(e,116,8),size:D(e,124,12),mtime:new Date(D(e,136,12)*1e3),type:v[n]||p,linkname:T(e,157,100)},i=T(e,257,6);return i.trim()===`ustar`&&(r.uname=T(e,265,32),r.gname=T(e,297,32)),i===`ustar`&&(r.prefix=T(e,345,155)),r}var z={path:[`name`,e=>e],linkpath:[`linkname`,e=>e],size:[`size`,e=>parseInt(e,10)],mtime:[`mtime`,parseFloat],uid:[`uid`,e=>parseInt(e,10)],gid:[`gid`,e=>parseInt(e,10)],uname:[`uname`,e=>e],gname:[`gname`,e=>e]};function B(e){let t=new TextDecoder(`utf-8`),n={},r={},i=0;for(;i<e.length;){let a=e.indexOf(32,i);if(a===-1)break;let o=parseInt(t.decode(e.subarray(i,a)),10);if(Number.isNaN(o)||o===0)break;let s=i+o,[c,l]=t.decode(e.subarray(a+1,s-1)).split(`=`,2);if(c&&l!==void 0){r[c]=l;let e=z[c];if(e){let[t,r]=e,i=r(l);(typeof i==`string`||!Number.isNaN(i))&&(n[t]=i)}}i=s}return Object.keys(r).length>0&&(n.pax=r),n}function V(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function ee(e){switch(e){case`pax-global-header`:case`pax-header`:return B;case`gnu-long-name`:return e=>({name:T(e,0,e.length)});case`gnu-long-link-name`:return e=>({linkname:T(e,0,e.length)});default:return}}function te(e){let t=L(e),n=F(e);if(!n)return[t];let r=-n.paxBody.length&511,i=r>0?[y.subarray(0,r)]:[];return[n.paxHeader,n.paxBody,...i,t]}var ne=new Uint8Array(512*2);function re(e,t,n){let r=null,i=0,a=!1;return{add(n){if(a){let e=Error(`No new tar entries after finalize.`);throw t(e),e}if(r!==null){let e=Error(`Previous entry must be completed before adding a new one`);throw t(e),e}try{let t=O(n)?0:n.size??0,a=te({...n,size:t});for(let t of a)e(t);r={...n,size:t},i=0}catch(e){t(e)}},write(n){if(!r){let e=Error(`No active tar entry.`);throw t(e),e}if(a){let e=Error(`Cannot write data after finalize.`);throw t(e),e}let o=i+n.length;if(o>r.size){let e=Error(`"${r.name}" exceeds given size of ${r.size} bytes.`);throw t(e),e}try{i=o,e(n)}catch(e){t(e)}},endEntry(){if(!r){let e=Error(`No active entry to end.`);throw t(e),e}if(a){let e=Error(`Cannot end entry after finalize.`);throw t(e),e}try{if(i!==r.size){let e=Error(`Size mismatch for "${r.name}".`);throw t(e),e}let n=-r.size&511;n>0&&e(new Uint8Array(n)),r=null,i=0}catch(e){throw t(e),e}},finalize(){if(a){let e=Error(`Archive has already been finalized`);throw t(e),e}if(r!==null){let e=Error(`Cannot finalize while an entry is still active`);throw t(e),e}try{e(ne),a=!0,n&&n()}catch(e){t(e)}}}}var H=256;function ie(){let e=Array(H),t=e.length-1,n=0,r=0,i=0,a=a=>{let o=e[n];a===o.length?(e[n]=b,n=n+1&t):e[n]=o.subarray(a),i-=a,i===0&&e.length>H&&(e=Array(H),t=H-1,n=0,r=0)};function o(t,r){if(r){let o=0,s=Math.min(t,i);for(;s>0;){let t=e[n],i=Math.min(s,t.length),c=i===t.length?t:t.subarray(0,i);if(a(i),s-=i,o+=i,!r(c))break}return o}if(i<t)return null;if(t===0)return b;let o=e[n];if(o.length>=t){let e=o.length===t?o:o.subarray(0,t);return a(t),e}let s=new Uint8Array(t),c=0,l=t;for(;l>0;){let t=e[n],r=Math.min(l,t.length);s.set(r===t.length?t:t.subarray(0,r),c),c+=r,l-=r,a(r)}return s}return{push:a=>{if(a.length===0)return;let o=r+1&t;if(o===n){let i=e.length,a=i*2,s=Array(a),c=r-n+i&i-1;if(n<r)for(let t=0;t<c;t++)s[t]=e[n+t];else if(c>0){let t=i-n;for(let r=0;r<t;r++)s[r]=e[n+r];for(let n=0;n<r;n++)s[t+n]=e[n]}e=s,t=a-1,n=0,r=c,o=r+1&t}e[r]=a,r=o,i+=a.length},available:()=>i,peek:r=>{if(i<r)return null;if(r===0)return b;let a=e[n];if(a.length>=r)return a.length===r?a:a.subarray(0,r);let o=new Uint8Array(r),s=0,c=n;for(;s<r;){let n=e[c],i=Math.min(r-s,n.length);i===n.length?o.set(n,s):o.set(n.subarray(0,i),s),s+=i,c=c+1&t}return o},discard:t=>{if(t>i)throw Error(`Too many bytes consumed`);if(t===0)return;let r=t;for(;r>0;){let t=e[n],i=Math.min(r,t.length);a(i),r-=i}},pull:o}}var ae=0,U=1,W=Error(`Tar archive is truncated.`);function oe(e={}){let t=e.strict??!1,{available:n,peek:r,push:i,discard:a,pull:o}=ie(),s=ae,c=!1,l=!1,u=!1,d=null,f={},p={},m={isEntryActive:()=>s===U,isBodyComplete:()=>!d||d.remaining===0,write(e){if(c)throw Error(`Archive already ended.`);i(e)},end(){c=!0},readHeader(){if(s!==ae)throw Error(`Cannot read header while an entry is active`);if(!l)for(;!l;){if(n()<512){if(c){if(n()>0&&t)throw W;l=!0;return}return null}let e=r(512);if(se(e)){if(n()<512*2){if(c){if(t)throw W;l=!0;return}return null}if(se(r(512*2).subarray(512))){a(512*2),l=!0,u=!0;return}if(t)throw Error(`Invalid tar header.`);a(512);continue}let i;try{i=R(e,t)}catch(e){if(t)throw e;a(512);continue}let m=ee(i.type);if(m){let e=i.size+511&-512;if(n()<512+e){if(c&&t)throw W;return null}a(512);let r=m(o(e).subarray(0,i.size)),s=i.type===`pax-global-header`?f:p;for(let e in r)s[e]=r[e];continue}a(512);let h=i;return i.prefix&&(h.name=`${i.prefix}/${h.name}`),V(h,f),V(h,p),p={},d={header:h,remaining:h.size,padding:-h.size&511},s=U,h}},streamBody(e){if(s!==U||!d||d.remaining===0)return 0;let t=Math.min(d.remaining,n());if(t===0)return 0;let r=o(t,e);return d.remaining-=r,r},skipPadding(){if(s!==U||!d)return!0;if(d.remaining>0)throw Error(`Body not fully consumed`);return n()<d.padding?!1:(a(d.padding),d=null,s=ae,!0)},skipEntry(){if(s!==U||!d)return!0;let e=Math.min(d.remaining,n());return e>0&&(a(e),d.remaining-=e),d.remaining>0?!1:m.skipPadding()},validateEOF(){if(t){if(!u)throw W;if(n()>0&&o(n()).some(e=>e!==0))throw Error(`Invalid EOF.`)}}};return m}function se(e){if(e.byteOffset%8==0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let e=0;e<t.length;e++)if(t[e]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function ce(){return new CompressionStream(`gzip`)}function le(){return new DecompressionStream(`gzip`)}function ue(){let e,t;return{readable:new ReadableStream({start(n){e=n,t=re(n.enqueue.bind(n),n.error.bind(n),n.close.bind(n))}}),controller:{add(n){let r=O(n),i={...n};return r&&(i.size=0),t.add(i),r&&t.endEntry(),new WritableStream({write(e){t.write(e)},close(){r||t.endEntry()},abort(t){e.error(t)}})},finalize(){t.finalize()},error(t){e.error(t)}}}}async function de(e){let t=[],n=e.getReader(),r=0;try{for(;;){let{done:e,value:i}=await n.read();if(e)break;t.push(i),r+=i.length}let e=new Uint8Array(r),i=0;for(let n of t)e.set(n,i),i+=n.length;return e}finally{n.releaseLock()}}var fe=e=>e.pipeTo(new WritableStream);function pe(e={}){let t=oe(e),n=null,r=!1,i=e=>{if(!r){r=!0;try{for(;;)if(t.isEntryActive()){if(n){if(t.streamBody(e=>(n.enqueue(e),!0))===0&&!t.isBodyComplete())break}else if(!t.skipEntry())break;if(t.isBodyComplete()){try{n?.close()}catch{}if(n=null,!t.skipPadding())break}}else{let r=t.readHeader();if(r==null)break;e.enqueue({header:r,body:new ReadableStream({start(e){r.size===0?e.close():n=e},pull:()=>i(e),cancel(){n=null,i(e)}})})}}catch(e){try{n?.error(e)}catch{}throw n=null,e}finally{r=!1}}};return new TransformStream({transform(e,r){try{t.write(e),i(r)}catch(e){try{n?.error(e)}catch{}throw e}},flush(e){try{if(t.end(),i(e),t.validateEOF(),t.isEntryActive()&&!t.isBodyComplete())try{n?.close()}catch{}}catch(e){try{n?.error(e)}catch{}throw e}}},void 0,{highWaterMark:1})}async function me(e){let{readable:t,controller:n}=ue();return await(async()=>{for(let t of e){let e=n.add(t.header),r=`body`in t?t.body:t.data;if(!r){await e.close();continue}if(r instanceof ReadableStream)await r.pipeTo(e);else if(r instanceof Blob)await r.stream().pipeTo(e);else try{let t=await k(r);if(t.length>0){let n=e.getWriter();await n.write(t),await n.close()}else await e.close()}catch{throw TypeError(`Unsupported content type for entry "${t.header.name}".`)}}})().then(()=>n.finalize()).catch(e=>n.error(e)),new Uint8Array(await de(t))}async function he(e,t={}){let n=e instanceof ReadableStream?e:new ReadableStream({start(t){t.enqueue(e instanceof Uint8Array?e:new Uint8Array(e)),t.close()}}),r=[],i=n.pipeThrough(pe(t));for await(let e of i){let n;try{n=A(e.header,t)}catch(t){throw await e.body.cancel(),t}if(n===null){await fe(e.body);continue}O(n)?(await fe(e.body),r.push({header:n})):r.push({header:n,data:await de(e.body)})}return r}var ge=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t<<24;for(let e=0;e<8;e++)n=n&2147483648?n<<1^79764919:n<<1;e[t]=n>>>0}return e})();function _e(e,t){return(e<<8^ge[(e>>>24^t)&255])>>>0}var ve=class{buffer=[];current=0;bitCount=0;writeBits(e,t){for(let n=e-1;n>=0;n--)this.current=this.current<<1|t>>>n&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}writeBit(e){this.current=this.current<<1|e&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.buffer.push(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function ye(e){let t=[],n=0;for(;n<e.length;){let r=e[n],i=1;for(;n+i<e.length&&e[n+i]===r&&i<255;)i++;i>=4?(t.push(r,r,r,r),t.push(i-4),n+=i):(t.push(r),n++)}return new Uint8Array(t)}function be(e){let t=e.length;if(t===0)return{transformed:new Uint8Array,pointer:0};let n=xe(e),r=new Uint8Array(t),i=0;for(let a=0;a<t;a++)n[a]===0?(i=a,r[a]=e[t-1]):r[a]=e[n[a]-1];return{transformed:r,pointer:i}}function xe(e){let t=e.length,n=new Int32Array(t),r=new Int32Array(t);for(let i=0;i<t;i++)n[i]=i,r[i]=e[i];for(let e=1;e<t;e*=2){let i=r.slice();n.sort((n,r)=>i[n]===i[r]?i[(n+e)%t]-i[(r+e)%t]:i[n]-i[r]),r[n[0]]=0;for(let a=1;a<t;a++)i[n[a]]===i[n[a-1]]&&i[(n[a]+e)%t]===i[(n[a-1]+e)%t]?r[n[a]]=r[n[a-1]]:r[n[a]]=r[n[a-1]]+1;if(r[n[t-1]]===t-1)break}return n}function Se(e,t){let n=[];for(let e=0;e<256;e++)t[e]&&n.push(e);let r=Array(256).fill(-1);for(let e=0;e<n.length;e++)r[n[e]]=e;let i=new Uint16Array(e.length),a=n.slice();for(let t=0;t<e.length;t++){let n=e[t],r=0;for(;a[r]!==n;)r++;if(i[t]=r,r>0){let e=a[r];for(let e=r;e>0;e--)a[e]=a[e-1];a[0]=e}}return{encoded:i,length:e.length}}function Ce(e,t,n){let r=n+1,i=[],a=0;for(;a<t;)if(e[a]===0){let n=0;for(;a<t&&e[a]===0;)n++,a++;let r=n;for(;r>0;)r--,r&1?i.push(1):i.push(0),r>>>=1}else i.push(e[a]+1),a++;i.push(r);let o=new Uint16Array(i.length);for(let e=0;e<i.length;e++)o[e]=i[e];return{symbols:o,length:i.length,eob:r}}function we(e,t,n){if(t<=1){let t=Array(e.length).fill(0);for(let n=0;n<e.length;n++)e[n]>0&&(t[n]=1);return{codeLengths:t,maxLen:1,minLen:1}}let r=[];for(let t=0;t<e.length;t++)e[t]>0&&r.push({freq:e[t],symbol:t,left:null,right:null});if(r.length===0)return{codeLengths:Array(e.length).fill(0),maxLen:0,minLen:0};if(r.length===1){let t=Array(e.length).fill(0);return t[r[0].symbol]=1,{codeLengths:t,maxLen:1,minLen:1}}for(;r.length>1;){r.sort((e,t)=>e.freq-t.freq);let e=r.shift(),t=r.shift();r.push({freq:e.freq+t.freq,symbol:-1,left:e,right:t})}let i=Array(e.length).fill(0);function a(e,t){if(!e.left&&!e.right){i[e.symbol]=t;return}e.left&&a(e.left,t+1),e.right&&a(e.right,t+1)}a(r[0],0);let o=!0;for(;o;){o=!1;for(let e=0;e<i.length;e++)i[e]>n&&(i[e]=n,o=!0);if(o){let e=0;for(let t=0;t<i.length;t++)i[t]>0&&(e+=1/(1<<i[t]));if(e>1)for(let t=1;t<n&&e>1;t++)for(let n=0;n<i.length&&e>1;n++)i[n]===t&&(i[n]++,e-=1/(1<<t)-1/(1<<t+1));o=!1;for(let e=0;e<i.length;e++)if(i[e]>n){o=!0;break}}}let s=n,c=0;for(let e=0;e<i.length;e++)i[e]>0&&(i[e]<s&&(s=i[e]),i[e]>c&&(c=i[e]));return{codeLengths:i,maxLen:c,minLen:s}}function Te(e,t){let n=Array(t).fill(0),r=e.slice(0,t),i=Math.max(...r,0),a=Array(i+1).fill(0);for(let e=0;e<t;e++)r[e]>0&&a[r[e]]++;let o=Array(i+1).fill(0),s=0;for(let e=1;e<=i;e++)s=s+a[e-1]<<1,o[e]=s;for(let e=0;e<t;e++)r[e]>0&&(n[e]=o[r[e]]++);return{codes:n,lengths:r}}function Ee(e,t,n){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,n),e.writeBit(0);let{transformed:r,pointer:i}=be(ye(t));e.writeBits(24,i);let a=Array(256).fill(!1);for(let e=0;e<r.length;e++)a[r[e]]=!0;let o=Array(16).fill(!1);for(let e=0;e<16;e++)for(let t=0;t<16;t++)if(a[e*16+t]){o[e]=!0;break}for(let t=0;t<16;t++)e.writeBit(o[t]?1:0);for(let t=0;t<16;t++)if(o[t])for(let n=0;n<16;n++)e.writeBit(a[t*16+n]?1:0);let s=0;for(let e=0;e<256;e++)a[e]&&s++;let{encoded:c,length:l}=Se(r,a),{symbols:u,length:d}=Ce(c,l,s),f=s+2,p=Math.ceil(d/50),m;m=d<200?2:d<600?3:d<1200?4:d<2400?5:6,m>p&&(m=Math.max(2,p));let h=[];for(let e=0;e<m;e++)h.push(Array(f).fill(0));let g=new Int32Array(p);for(let e=0;e<p;e++)g[e]=e%m;for(let e=0;e<p;e++){let t=e*50,n=Math.min(t+50,d),r=g[e];for(let e=t;e<n;e++)h[r][u[e]]++}function _(e){for(let t=0;t<f;t++)e[t]<1&&(e[t]=1)}let v=[];for(let e=0;e<m;e++)_(h[e]),v.push(we(h[e],f,20));for(let e=0;e<4;e++){for(let e=0;e<m;e++)h[e].fill(0);for(let e=0;e<p;e++){let t=e*50,n=Math.min(t+50,d),r=0,i=1/0;for(let e=0;e<m;e++){let a=0;for(let r=t;r<n;r++)a+=v[e].codeLengths[u[r]]||20;a<i&&(i=a,r=e)}g[e]=r;for(let e=t;e<n;e++)h[r][u[e]]++}for(let e=0;e<m;e++)_(h[e]),v[e]=we(h[e],f,20)}e.writeBits(3,m),e.writeBits(15,p);let y=[],b=[];for(let e=0;e<m;e++)b.push(e);for(let e=0;e<p;e++){let t=g[e],n=0;for(;b[n]!==t;)n++;if(y.push(n),n>0){let e=b[n];for(let e=n;e>0;e--)b[e]=b[e-1];b[0]=e}}for(let t=0;t<p;t++){for(let n=0;n<y[t];n++)e.writeBit(1);e.writeBit(0)}for(let t=0;t<m;t++){let n=v[t].codeLengths,r=n[0];e.writeBits(5,r);for(let t=0;t<f;t++){let i=n[t];for(;r<i;)e.writeBit(1),e.writeBit(0),r++;for(;r>i;)e.writeBit(1),e.writeBit(1),r--;e.writeBit(0)}}for(let e=0;e<m;e++){let{codes:t,lengths:n}=Te(v[e].codeLengths,f);v[e]=Object.assign(v[e],{_codes:t,_lengths:n})}let x=0,S=0;for(let t=0;t<d;t++){(S===0||S>=50)&&(t>0&&x++,S=0);let n=v[g[x]],r=u[t],i=n._lengths[r],a=n._codes[r];i>0&&e.writeBits(i,a),S++}}var De=10*1024*1024;function Oe(e,t=9,n=De){if(t<1||t>9)throw Error(`Block size level must be 1-9`);if(e.length>n)throw Error(`Input too large for bzip2 compression (${e.length} bytes, max ${n})`);let r=t*1e5,i=new ve;i.writeBits(8,66),i.writeBits(8,90),i.writeBits(8,104),i.writeBits(8,48+t);let a=0,o=0;for(;o<e.length;){let t=Math.min(o+r,e.length),n=e.subarray(o,t),s=4294967295;for(let e=0;e<n.length;e++)s=_e(s,n[e]);s=~s>>>0,a=(a<<1|a>>>31)>>>0,a=(a^s)>>>0,Ee(i,n,s),o=t}return i.writeBits(24,1536581),i.writeBits(24,3690640),i.writeBits(32,a),i.finish()}var G=null,K=null;async function ke(){if(G)return G;if(K)throw K;try{return G=await r.runTrustedAsync(()=>import(`./lzma-BSEvzrCT.mjs`)),G}catch{throw K=Error(`xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies.`),K}}var q=null,J=null;async function Ae(){if(q)return q;if(J)throw J;try{return q=await r.runTrustedAsync(()=>import(`./lib-BbNAtG4h.mjs`).then(t=>e(t.default,1))),q}catch{throw J=Error(`zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd`),J}}var Y=100*1024*1024,je=512,Me=1e4;function Ne(e){let t=`file`;e.isDirectory?t=`directory`:e.isSymlink&&(t=`symlink`);let n=e.name;e.isDirectory&&!n.endsWith(`/`)&&(n+=`/`);let r;e.content!==void 0&&(r=typeof e.content==`string`?new TextEncoder().encode(e.content):e.content);let i=e.isDirectory||e.isSymlink?0:r?.length??0;return{header:{name:n,mode:e.mode??(e.isDirectory?493:420),uid:e.uid??0,gid:e.gid??0,size:i,mtime:e.mtime??new Date,type:t,linkname:e.linkTarget??``,uname:`user`,gname:`user`},body:r}}async function X(e){return me(e.map(Ne))}async function Pe(e){let t=await X(e),n=new ReadableStream({start(e){e.enqueue(t),e.close()}}).pipeThrough(ce()).getReader(),r=[];for(;;){let{done:e,value:t}=await n.read();if(e)break;r.push(t)}let i=r.reduce((e,t)=>e+t.length,0),a=new Uint8Array(i),o=0;for(let e of r)a.set(e,o),o+=e.length;return a}async function Z(e){if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};if(e.length<je||e.length%je!==0)return{entries:[],error:`Invalid tar archive format`};try{let t=await he(e),n=[];for(let e of t){if(n.length>=Me)return{entries:n,error:`Too many entries (max ${Me})`};let t=`file`;switch(e.header.type){case`directory`:t=`directory`;break;case`symlink`:t=`symlink`;break;case`link`:t=`hardlink`;break;case`file`:t=`file`;break;default:t=`other`}n.push({name:e.header.name,mode:e.header.mode??420,uid:e.header.uid??0,gid:e.header.gid??0,size:e.header.size,mtime:e.header.mtime??new Date,type:t,linkTarget:e.header.linkname||void 0,content:e.data??new Uint8Array})}return{entries:n}}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}async function Fe(e){if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=new ReadableStream({start(t){t.enqueue(e),t.close()}}).pipeThrough(le()).getReader(),n=[],r=0;for(;;){let{done:e,value:i}=await t.read();if(e)break;if(r+=i.length,r>Y)return await t.cancel(),{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`};n.push(i)}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;return Z(i)}catch(e){return{entries:[],error:`Decompression failed: ${e instanceof Error?e.message:`Unknown error`}`}}}function Ie(e){return e.length>=2&&e[0]===31&&e[1]===139}function Le(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function Re(e){return e.length>=6&&e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0}async function ze(e){let t=f.default.decode(Buffer.from(e));return new Uint8Array(t)}async function Be(e){return Oe(e,9)}async function Ve(e){let t=(await ke()).unxzSync(Buffer.from(e));return new Uint8Array(t)}async function He(e){let t=(await ke()).xzSync(Buffer.from(e));return new Uint8Array(t)}async function Ue(e){return Be(await X(e))}async function We(e,t){if(!t?.allowNativeCodecs)throw Error(`xz compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.`);return He(await X(e))}async function Ge(e){if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=await ze(e);return t.length>Y?{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`}:Z(t)}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}async function Ke(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:`xz decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction.`};if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=await Ve(e);return t.length>Y?{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`}:Z(t)}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}function qe(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Je(e){let t=await(await Ae()).compress(Buffer.from(e),3);return new Uint8Array(t)}async function Ye(e){let t=await(await Ae()).decompress(Buffer.from(e));return new Uint8Array(t)}async function Xe(e,t){if(!t?.allowNativeCodecs)throw Error(`zstd compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.`);return Je(await X(e))}async function Ze(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:`zstd decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction.`};if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=await Ye(e);return t.length>Y?{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`}:Z(t)}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}function Qe(e){let t={create:!1,append:!1,update:!1,extract:!1,list:!1,file:``,autoCompress:!1,gzip:!1,bzip2:!1,xz:!1,zstd:!1,verbose:!1,toStdout:!1,keepOldFiles:!1,touch:!1,directory:``,preserve:!1,absoluteNames:!1,strip:0,exclude:[],filesFrom:``,excludeFrom:``,wildcards:!1},n=[],r=0;for(;r<e.length;){let a=e[r];if(a.startsWith(`-`)&&!a.startsWith(`--`)&&a.length>2){if(/^-\d+$/.test(a)){n.push(a),r++;continue}for(let n=1;n<a.length;n++){let o=a[n];switch(o){case`c`:t.create=!0;break;case`r`:t.append=!0;break;case`u`:t.update=!0;break;case`x`:t.extract=!0;break;case`t`:t.list=!0;break;case`a`:t.autoCompress=!0;break;case`z`:t.gzip=!0;break;case`j`:t.bzip2=!0;break;case`J`:t.xz=!0;break;case`v`:t.verbose=!0;break;case`O`:t.toStdout=!0;break;case`k`:t.keepOldFiles=!0;break;case`m`:t.touch=!0;break;case`p`:t.preserve=!0;break;case`P`:t.absoluteNames=!0;break;case`f`:if(n<a.length-1)t.file=a.substring(n+1),n=a.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'f'
1
+ import{s as e,t}from"./chunk-C94x7I9S.mjs";import{t as n}from"./chunk-B74TABJS-DlbqoTuk.mjs";import{t as r}from"./chunk-5QMZ5MUS-_0tQyQsf.mjs";import{n as i,r as a,t as o}from"./chunk-74CEPOFO-V0JXh91S.mjs";import{t as s}from"./chunk-X2AJGDEF-ClcErtij.mjs";var c=t(((e,t)=>{var n=[0,1,3,7,15,31,63,127,255],r=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};r.prototype._ensureByte=function(){this.hasByte||=(this.curByte=this.stream.readByte(),!0)},r.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=n[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var i=r-e;t|=(this.curByte&n[e]<<i)>>i,this.bitOffset+=e,e=0}}return t},r.prototype.seek=function(e){var t=e%8,n=(e-t)/8;this.bitOffset=t,this.stream.seek(n),this.hasByte=!1},r.prototype.pi=function(){var e=new Buffer(6),t;for(t=0;t<e.length;t++)e[t]=this.read(8);return e.toString(`hex`)},t.exports=r})),l=t(((e,t)=>{var n=function(){};n.prototype.readByte=function(){throw Error(`abstract method readByte() not implemented`)},n.prototype.read=function(e,t,n){for(var r=0;r<n;){var i=this.readByte();if(i<0)return r===0?-1:r;e[t++]=i,r++}return r},n.prototype.seek=function(e){throw Error(`abstract method seek() not implemented`)},n.prototype.writeByte=function(e){throw Error(`abstract method readByte() not implemented`)},n.prototype.write=function(e,t,n){var r;for(r=0;r<n;r++)this.writeByte(e[t++]);return n},n.prototype.flush=function(){},t.exports=n})),u=t(((e,t)=>{t.exports=(function(){var e=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]);return function(){var t=4294967295;this.getCRC=function(){return~t>>>0},this.updateCRC=function(n){t=t<<8^e[(t>>>24^n)&255]},this.updateCRCRun=function(n,r){for(;r-- >0;)t=t<<8^e[(t>>>24^n)&255]}}})()})),d=t(((e,t)=>{t.exports={name:`seek-bzip`,version:`2.0.0`,contributors:[`C. Scott Ananian (http://cscott.net)`,`Eli Skeggs`,`Kevin Kwok`,`Rob Landley (http://landley.net)`],description:`a pure-JavaScript Node.JS module for random-access decoding bzip2 data`,main:`./lib/index.js`,repository:{type:`git`,url:`https://github.com/cscott/seek-bzip.git`},license:`MIT`,bin:{"seek-bunzip":`./bin/seek-bunzip`,"seek-table":`./bin/seek-bzip-table`},directories:{test:`test`},dependencies:{commander:`^6.0.0`},devDependencies:{fibers:`^5.0.0`,mocha:`^8.1.0`},scripts:{test:`mocha`}}})),f=e(t(((e,t)=>{var n=c(),r=l(),i=u(),a=d(),o=20,s=258,f=0,p=1,m=2,h=6,g=50,_=`314159265359`,v=`177245385090`,y=function(e,t){var n=e[t],r;for(r=t;r>0;r--)e[r]=e[r-1];return e[0]=n,n},b={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},x={};x[b.LAST_BLOCK]=`Bad file checksum`,x[b.NOT_BZIP_DATA]=`Not bzip data`,x[b.UNEXPECTED_INPUT_EOF]=`Unexpected input EOF`,x[b.UNEXPECTED_OUTPUT_EOF]=`Unexpected output EOF`,x[b.DATA_ERROR]=`Data error`,x[b.OUT_OF_MEMORY]=`Out of memory`,x[b.OBSOLETE_INPUT]=`Obsolete (pre 0.9.5) bzip format not supported.`;var S=function(e,t){var n=x[e]||`unknown error`;t&&(n+=`: `+t);var r=TypeError(n);throw r.errorCode=e,r},C=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};C.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new i,!0):(this.writeCount=-1,!1)},C.prototype._start_bunzip=function(e,t){var r=new Buffer(4);(e.read(r,0,4)!==4||String.fromCharCode(r[0],r[1],r[2])!==`BZh`)&&S(b.NOT_BZIP_DATA,`bad magic`);var i=r[3]-48;(i<1||i>9)&&S(b.NOT_BZIP_DATA,`level out of range`),this.reader=new n(e),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=t,this.streamCRC=0},C.prototype._get_next_block=function(){var e,t,n,r=this.reader,i=r.pi();if(i===v)return!1;i!==_&&S(b.NOT_BZIP_DATA),this.targetBlockCRC=r.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,r.read(1)&&S(b.OBSOLETE_INPUT);var a=r.read(24);a>this.dbufSize&&S(b.DATA_ERROR,`initial position out of bounds`);var c=r.read(16),l=new Buffer(256),u=0;for(e=0;e<16;e++)if(c&1<<15-e){var d=e*16;for(n=r.read(16),t=0;t<16;t++)n&1<<15-t&&(l[u++]=d+t)}var x=r.read(3);(x<m||x>h)&&S(b.DATA_ERROR);var C=r.read(15);C===0&&S(b.DATA_ERROR);var w=new Buffer(256);for(e=0;e<x;e++)w[e]=e;var T=new Buffer(C);for(e=0;e<C;e++){for(t=0;r.read(1);t++)t>=x&&S(b.DATA_ERROR);T[e]=y(w,t)}var E=u+2,D=[],O;for(t=0;t<x;t++){var k=new Buffer(E),A=new Uint16Array(o+1);for(c=r.read(5),e=0;e<E;e++){for(;(c<1||c>o)&&S(b.DATA_ERROR),r.read(1);)r.read(1)?c--:c++;k[e]=c}var j=M=k[0],M;for(e=1;e<E;e++)k[e]>M?M=k[e]:k[e]<j&&(j=k[e]);O={},D.push(O),O.permute=new Uint16Array(s),O.limit=new Uint32Array(o+2),O.base=new Uint32Array(o+1),O.minLen=j,O.maxLen=M;var N=0;for(e=j;e<=M;e++)for(A[e]=O.limit[e]=0,c=0;c<E;c++)k[c]===e&&(O.permute[N++]=c);for(e=0;e<E;e++)A[k[e]]++;for(N=c=0,e=j;e<M;e++)N+=A[e],O.limit[e]=N-1,N<<=1,c+=A[e],O.base[e+1]=N-c;O.limit[M+1]=Number.MAX_VALUE,O.limit[M]=N+A[M]-1,O.base[j]=0}var P=new Uint32Array(256);for(e=0;e<256;e++)w[e]=e;var F=0,I=0,ee=0,L,R=this.dbuf=new Uint32Array(this.dbufSize);for(E=0;;){for(E--||(E=g-1,ee>=C&&S(b.DATA_ERROR),O=D[T[ee++]]),e=O.minLen,t=r.read(e);e>O.maxLen&&S(b.DATA_ERROR),!(t<=O.limit[e]);e++)t=t<<1|r.read(1);t-=O.base[e],(t<0||t>=s)&&S(b.DATA_ERROR);var z=O.permute[t];if(z===f||z===p){F||(F=1,c=0),z===f?c+=F:c+=2*F,F<<=1;continue}if(F)for(F=0,I+c>this.dbufSize&&S(b.DATA_ERROR),L=l[w[0]],P[L]+=c;c--;)R[I++]=L;if(z>u)break;I>=this.dbufSize&&S(b.DATA_ERROR),e=z-1,L=y(w,e),L=l[L],P[L]++,R[I++]=L}for((a<0||a>=I)&&S(b.DATA_ERROR),t=0,e=0;e<256;e++)n=t+P[e],P[e]=t,t=n;for(e=0;e<I;e++)L=R[e]&255,R[P[L]]|=e<<8,P[L]++;var B=0,te=0,V=0;return I&&(B=R[a],te=B&255,B>>=8,V=-1),this.writePos=B,this.writeCurrent=te,this.writeCount=I,this.writeRun=V,!0},C.prototype._read_bunzip=function(e,t){var n,r,i;if(this.writeCount<0)return 0;var a=this.dbuf,o=this.writePos,s=this.writeCurrent,c=this.writeCount;this.outputsize;for(var l=this.writeRun;c;){for(c--,r=s,o=a[o],s=o&255,o>>=8,l++===3?(n=s,i=r,s=-1):(n=1,i=s),this.blockCRC.updateCRCRun(i,n);n--;)this.outputStream.writeByte(i),this.nextoutput++;s!=r&&(l=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&S(b.DATA_ERROR,`Bad block CRC (got `+this.blockCRC.getCRC().toString(16)+` expected `+this.targetBlockCRC.toString(16)+`)`),this.nextoutput};var w=function(e){if(`readByte`in e)return e;var t=new r;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(e){this.pos=e},t.eof=function(){return this.pos>=e.length},t},T=function(e){var t=new r,n=!0;if(e)if(typeof e==`number`)t.buffer=new Buffer(e),n=!1;else if(`writeByte`in e)return e;else t.buffer=e,n=!1;else t.buffer=new Buffer(16384);return t.pos=0,t.writeByte=function(e){if(n&&this.pos>=this.buffer.length){var t=new Buffer(this.buffer.length*2);this.buffer.copy(t),this.buffer=t}this.buffer[this.pos++]=e},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!n)throw TypeError(`outputsize does not match decoded input`);var e=new Buffer(this.pos);this.buffer.copy(e,0,0,this.pos),this.buffer=e}return this.buffer},t._coerced=!0,t};C.Err=b,C.decode=function(e,t,n){for(var r=w(e),i=T(t),a=new C(r,i);!(`eof`in r&&r.eof());)if(a._init_block())a._read_bunzip();else{var o=a.reader.read(32)>>>0;if(o!==a.streamCRC&&S(b.DATA_ERROR,`Bad stream CRC (got `+a.streamCRC.toString(16)+` expected `+o.toString(16)+`)`),n&&`eof`in r&&!r.eof())a._start_bunzip(r,i);else break}if(`getBuffer`in i)return i.getBuffer()},C.decodeBlock=function(e,t,n){var r=w(e),a=T(n),o=new C(r,a);if(o.reader.seek(t),o._get_next_block()&&(o.blockCRC=new i,o.writeCopies=0,o._read_bunzip()),`getBuffer`in a)return a.getBuffer()},C.table=function(e,t,n){var i=new r;i.delegate=w(e),i.pos=0,i.readByte=function(){return this.pos++,this.delegate.readByte()},i.delegate.eof&&(i.eof=i.delegate.eof.bind(i.delegate));var a=new r;a.pos=0,a.writeByte=function(){this.pos++};for(var o=new C(i,a),s=o.dbufSize;!(`eof`in i&&i.eof());){var c=i.pos*8+o.reader.bitOffset;if(o.reader.hasByte&&(c-=8),o._init_block()){var l=a.pos;o._read_bunzip(),t(c,a.pos-l)}else if(o.reader.read(32),n&&`eof`in i&&!i.eof())o._start_bunzip(i,a),console.assert(o.dbufSize===s,`shouldn't change block size within multistream file`);else break}},C.Stream=r,C.version=a.version,C.license=a.license,t.exports=C}))(),1),p=`file`,m=`link`,h=`symlink`,g=`directory`,_={file:`0`,link:`1`,symlink:`2`,"character-device":`3`,"block-device":`4`,directory:`5`,fifo:`6`,"pax-header":`x`,"pax-global-header":`g`,"gnu-long-name":`L`,"gnu-long-link-name":`K`},v={0:p,1:m,2:h,3:`character-device`,4:`block-device`,5:g,6:`fifo`,x:`pax-header`,g:`pax-global-header`,L:`gnu-long-name`,K:`gnu-long-link-name`},y=new Uint8Array(512),b=new Uint8Array,x=new TextEncoder,S=new TextDecoder;function C(e,t,n,r){r&&x.encodeInto(r,e.subarray(t,t+n))}function w(e,t,n,r){if(r===void 0)return;let i=r.toString(8).padStart(n-1,`0`);x.encodeInto(i,e.subarray(t,t+n-1))}function T(e,t,n){let r=e.indexOf(0,t),i=r===-1||r>t+n?t+n:r;return S.decode(e.subarray(t,i))}function E(e,t,n){let r=0,i=t+n;for(let n=t;n<i;n++){let t=e[n];if(t===0)break;t!==32&&(r=r*8+(t-48))}return r}function D(e,t,n){if(e[t]&128){let r=0;r=e[t]&127;for(let i=1;i<n;i++)r=r*256+e[t+i];if(!Number.isSafeInteger(r))throw Error(`TAR number too large`);return r}return E(e,t,n)}var O=e=>e.type===`directory`||e.type===`symlink`||e.type===`link`||e.type===`character-device`||e.type===`block-device`||e.type===`fifo`;async function k(e){if(e==null)return b;if(e instanceof Uint8Array)return e;if(typeof e==`string`)return x.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw TypeError(`Unsupported content type for entry body.`)}var A=(e,t)=>{let n=e.split(`/`).filter(Boolean);return t>=n.length?``:n.slice(t).join(`/`)};function j(e,t){let{strip:n,filter:r,map:i}=t;if(!n&&!r&&!i)return e;let a={...e};if(n&&n>0){let e=A(a.name,n);if(!e)return null;if(a.name=a.type===`directory`&&!e.endsWith(`/`)?`${e}/`:e,a.linkname){let e=a.linkname.startsWith(`/`);if(e||a.type===`link`){let t=A(a.linkname,n);a.linkname=e?`/${t}`||`/`:t}}}if(r?.(a)===!1)return null;let o=i?i(a):a;return o&&(!o.name||!o.name.trim()||o.name===`.`||o.name===`/`)?null:o}var M=32,N=48;function P(e){let t=E(e,148,8),n=0;for(let t=0;t<e.length;t++)t>=148&&t<156?n+=M:n+=e[t];return t===n}function F(e){e.fill(M,148,156);let t=0;for(let n of e)t+=n;for(let n=153;n>=148;n--)e[n]=(t&7)+N,t>>=3;e[154]=0,e[155]=M}var I=256;function ee(e){let t={};x.encode(e.name).length>100&&L(e.name)===null&&(t.path=e.name),e.linkname&&x.encode(e.linkname).length>100&&(t.linkpath=e.linkname),e.uname&&x.encode(e.uname).length>32&&(t.uname=e.uname),e.gname&&x.encode(e.gname).length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let n=Object.entries(t);if(n.length===0)return null;let r=x.encode(n.map(([e,t])=>{let n=`${e}=${t}
2
+ `,r=x.encode(n).length+1,i=r+String(r).length;return i=r+String(i).length,`${i} ${n}`}).join(``));return{paxHeader:R({name:S.decode(x.encode(`PaxHeader/${e.name}`).slice(0,100)),size:r.length,type:`pax-header`,mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:r}}function L(e){let t=x.encode(e).length;if(t<=100||t>I)return null;for(let t=e.length-1;t>0;t--){if(e[t]!==`/`)continue;let n=e.slice(0,t),r=e.slice(t+1);if(x.encode(n).length<=155&&x.encode(r).length<=100)return{prefix:n,name:r}}return null}function R(e){let t=new Uint8Array(512),n=O(e)?0:e.size??0,r=e.name,i=``;if(!e.pax?.path){let e=L(r);e&&(r=e.name,i=e.prefix)}return C(t,0,100,r),w(t,100,8,e.mode??(e.type===`directory`?493:420)),w(t,108,8,e.uid??0),w(t,116,8,e.gid??0),w(t,124,12,n),w(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),C(t,156,1,_[e.type??`file`]),C(t,157,100,e.linkname),C(t,257,6,`ustar\0`),C(t,263,2,`00`),C(t,265,32,e.uname),C(t,297,32,e.gname),C(t,345,155,i),F(t),t}function z(e,t){if(t&&!P(e))throw Error(`Invalid tar header checksum.`);let n=T(e,156,1),r={name:T(e,0,100),mode:E(e,100,8),uid:D(e,108,8),gid:D(e,116,8),size:D(e,124,12),mtime:new Date(D(e,136,12)*1e3),type:v[n]||`file`,linkname:T(e,157,100)},i=T(e,257,6);return O(r)&&(r.size=0),i.trim()===`ustar`&&(r.uname=T(e,265,32),r.gname=T(e,297,32)),i===`ustar`&&(r.prefix=T(e,345,155)),r}var B={path:[`name`,e=>e],linkpath:[`linkname`,e=>e],size:[`size`,e=>parseInt(e,10)],mtime:[`mtime`,parseFloat],uid:[`uid`,e=>parseInt(e,10)],gid:[`gid`,e=>parseInt(e,10)],uname:[`uname`,e=>e],gname:[`gname`,e=>e]};function te(e){let t=new TextDecoder(`utf-8`),n=Object.create(null),r=Object.create(null),i=0;for(;i<e.length;){let a=e.indexOf(32,i);if(a===-1)break;let o=parseInt(t.decode(e.subarray(i,a)),10);if(Number.isNaN(o)||o===0)break;let s=i+o,[c,l]=t.decode(e.subarray(a+1,s-1)).split(`=`,2);if(c&&l!==void 0&&(r[c]=l,Object.hasOwn(B,c))){let[e,t]=B[c],r=t(l);(typeof r==`string`||!Number.isNaN(r))&&(n[e]=r)}i=s}return Object.keys(r).length>0&&(n.pax=r),n}function V(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function ne(e){switch(e){case`pax-global-header`:case`pax-header`:return te;case`gnu-long-name`:return e=>({name:T(e,0,e.length)});case`gnu-long-link-name`:return e=>({linkname:T(e,0,e.length)});default:return}}function re(e){let t=R(e),n=ee(e);if(!n)return[t];let r=-n.paxBody.length&511,i=r>0?[y.subarray(0,r)]:[];return[n.paxHeader,n.paxBody,...i,t]}var ie=new Uint8Array(512*2);function ae(e,t,n){let r=null,i=0,a=!1,o=e=>{let n=Error(e);throw t(n),n};return{add(n){a&&o(`No new tar entries after finalize.`),r!==null&&o(`Previous entry must be completed before adding a new one`);let s=O(n)?0:n.size;(!Number.isSafeInteger(s)||s<0)&&o(`Invalid tar entry size.`);try{let t=re({...n,size:s});for(let n of t)e(n);r={...n,size:s},i=0}catch(e){t(e)}},write(n){r||o(`No active tar entry.`),a&&o(`Cannot write data after finalize.`);let s=i+n.length;s>r.size&&o(`"${r.name}" exceeds given size of ${r.size} bytes.`);try{i=s,e(n)}catch(e){t(e)}},endEntry(){r||o(`No active entry to end.`),a&&o(`Cannot end entry after finalize.`);try{i!==r.size&&o(`Size mismatch for "${r.name}".`);let t=-r.size&511;t>0&&e(new Uint8Array(t)),r=null,i=0}catch(e){throw t(e),e}},finalize(){a&&o(`Archive has already been finalized`),r!==null&&o(`Cannot finalize while an entry is still active`);try{e(ie),a=!0,n&&n()}catch(e){t(e)}}}}var H=256;function oe(){let e=Array(H),t=e.length-1,n=0,r=0,i=0,a=a=>{let o=e[n];a===o.length?(e[n]=b,n=n+1&t):e[n]=o.subarray(a),i-=a,i===0&&e.length>H&&(e=Array(H),t=H-1,n=0,r=0)};function o(t,r){if(r){let o=0,s=Math.min(t,i);for(;s>0;){let t=e[n],i=Math.min(s,t.length),c=i===t.length?t:t.subarray(0,i);if(a(i),s-=i,o+=i,!r(c))break}return o}if(i<t)return null;if(t===0)return b;let o=e[n];if(o.length>=t){let e=o.length===t?o:o.subarray(0,t);return a(t),e}let s=new Uint8Array(t),c=0,l=t;for(;l>0;){let t=e[n],r=Math.min(l,t.length);s.set(r===t.length?t:t.subarray(0,r),c),c+=r,l-=r,a(r)}return s}return{push:a=>{if(a.length===0)return;let o=r+1&t;if(o===n){let i=e.length,a=i*2,s=Array(a),c=r-n+i&i-1;if(n<r)for(let t=0;t<c;t++)s[t]=e[n+t];else if(c>0){let t=i-n;for(let r=0;r<t;r++)s[r]=e[n+r];for(let n=0;n<r;n++)s[t+n]=e[n]}e=s,t=a-1,n=0,r=c,o=r+1&t}e[r]=a,r=o,i+=a.length},available:()=>i,peek:r=>{if(i<r)return null;if(r===0)return b;let a=e[n];if(a.length>=r)return a.length===r?a:a.subarray(0,r);let o=new Uint8Array(r),s=0,c=n;for(;s<r;){let n=e[c],i=Math.min(r-s,n.length);i===n.length?o.set(n,s):o.set(n.subarray(0,i),s),s+=i,c=c+1&t}return o},discard:t=>{if(t>i)throw Error(`Too many bytes consumed`);if(t===0)return;let r=t;for(;r>0;){let t=e[n],i=Math.min(r,t.length);a(i),r-=i}},pull:o}}var se=0,U=1,W=Error(`Tar archive is truncated.`);function ce(e={}){let t=e.strict??!1,{available:n,peek:r,push:i,discard:a,pull:o}=oe(),s=se,c=!1,l=!1,u=!1,d=null,f={},p={},m={isEntryActive:()=>s===U,isBodyComplete:()=>!d||d.remaining===0,canFinish:()=>!d||n()>=d.remaining+d.padding,write(e){if(c)throw Error(`Archive already ended.`);i(e)},end(){c=!0},readHeader(){if(s!==se)throw Error(`Cannot read header while an entry is active`);if(!l)for(;!l;){if(n()<512){if(c){if(n()>0&&t)throw W;l=!0;return}return null}let e=r(512);if(le(e)){if(n()<512*2){if(c){if(t)throw W;l=!0;return}return null}if(le(r(512*2).subarray(512))){a(512*2),l=!0,u=!0;return}if(t)throw Error(`Invalid tar header.`);a(512);continue}let i;try{i=z(e,t)}catch(e){if(t)throw e;a(512);continue}let m=ne(i.type);if(m){let e=i.size+(-i.size&511);if(n()<512+e){if(c&&t)throw W;return null}a(512);let r=m(o(e).subarray(0,i.size)),s=i.type===`pax-global-header`?f:p;for(let e in r)s[e]=r[e];continue}a(512);let h=i;return i.prefix&&(h.name=`${i.prefix}/${h.name}`),V(h,f),V(h,p),h.name.endsWith(`/`)&&h.type===`file`&&(h.type=g),p={},d={header:h,remaining:h.size,padding:-h.size&511},s=U,h}},streamBody(e){if(s!==U||!d||d.remaining===0)return 0;let t=Math.min(d.remaining,n());if(t===0)return 0;let r=o(t,e);return d.remaining-=r,r},skipPadding(){if(s!==U||!d)return!0;if(d.remaining>0)throw Error(`Body not fully consumed`);return n()<d.padding?!1:(a(d.padding),d=null,s=se,!0)},skipEntry(){if(s!==U||!d)return!0;let e=Math.min(d.remaining,n());return e>0&&(a(e),d.remaining-=e),d.remaining>0?!1:m.skipPadding()},validateEOF(){if(t){if(!u)throw W;if(n()>0&&o(n()).some(e=>e!==0))throw Error(`Invalid EOF.`)}}};return m}function le(e){if(e.byteOffset%8==0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let e=0;e<t.length;e++)if(t[e]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function ue(){return new CompressionStream(`gzip`)}function de(){return new DecompressionStream(`gzip`)}function fe(){let e,t;return{readable:new ReadableStream({start(n){e=n,t=ae(n.enqueue.bind(n),n.error.bind(n),n.close.bind(n))}}),controller:{add(n){let r=O(n);return t.add(n),r&&t.endEntry(),new WritableStream({write(e){t.write(e)},close(){r||t.endEntry()},abort(t){e.error(t)}})},finalize(){t.finalize()},error(t){e.error(t)}}}}async function pe(e){let t=[],n=e.getReader(),r=0;try{for(;;){let{done:e,value:i}=await n.read();if(e)break;t.push(i),r+=i.length}let e=new Uint8Array(r),i=0;for(let n of t)e.set(n,i),i+=n.length;return e}finally{n.releaseLock()}}var me=e=>e.pipeTo(new WritableStream);function he(e={}){let t=ce(e),n=e.strict??!1,r=null,i=null,a=!1,o=!1,s=!1,c=!1,l=()=>{try{i?.close()}catch{}i=null},u=e=>{if(!c){c=!0;try{i?.error(e)}catch{}i=null;try{r.error(e)}catch{}r=null}},d=()=>{if(!c){c=!0,l();try{r.close()}catch{}r=null}},f=()=>{if(n)throw Error(`Tar archive is truncated.`);d()},p=()=>{if(!(a||c||!r)){a=!0;try{for(;;){if(o){s&&(t.validateEOF(),d());break}if(t.isEntryActive()){if(s&&!t.canFinish()){f();break}if(i){if((i.desiredSize??1)<=0)break;if(t.streamBody(e=>(i.enqueue(e),(i.desiredSize??1)>0))===0&&!t.isBodyComplete()){s&&f();break}}else if(!t.skipEntry()){s&&f();break}if(t.isBodyComplete()&&(l(),!t.skipPadding())){s&&f();break}}else{if((r.desiredSize??0)<0)break;let e=t.readHeader();if(e===null){s&&d();break}if(e===void 0){if(s){t.validateEOF(),d();break}o=!0;break}r.enqueue({header:e,body:new ReadableStream({start(t){e.size===0?t.close():i=t},pull:p,cancel(){i=null,p()}})})}}}catch(e){throw u(e),e}finally{a=!1}}};return{readable:new ReadableStream({start(e){r=e},pull:p,cancel(e){e===void 0?d():u(e)}},{highWaterMark:2}),writable:new WritableStream({write(e){try{if(o&&n&&e.some(e=>e!==0))throw Error(`Invalid EOF.`);t.write(e),p()}catch(e){throw u(e),e}},close(){try{s=!0,t.end(),p()}catch(e){throw u(e),e}},abort(e){u(e)}})}}async function ge(e){let{readable:t,controller:n}=fe();return await(async()=>{for(let t of e){let e=n.add(t.header),r=`body`in t?t.body:t.data;if(!r){await e.close();continue}if(r instanceof ReadableStream)await r.pipeTo(e);else if(r instanceof Blob)await r.stream().pipeTo(e);else try{let t=await k(r);if(t.length>0){let n=e.getWriter();await n.write(t),await n.close()}else await e.close()}catch{throw TypeError(`Unsupported content type for entry "${t.header.name}".`)}}})().then(()=>n.finalize()).catch(e=>n.error(e)),new Uint8Array(await pe(t))}async function _e(e,t={}){let n=e instanceof ReadableStream?e:new ReadableStream({start(t){t.enqueue(e instanceof Uint8Array?e:new Uint8Array(e)),t.close()}}),r=[],i=n.pipeThrough(he(t));for await(let e of i){let n;try{n=j(e.header,t)}catch(t){throw await e.body.cancel(),t}if(n===null){await me(e.body);continue}O(n)?(await me(e.body),r.push({header:n})):r.push({header:n,data:await pe(e.body)})}return r}var ve=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t<<24;for(let e=0;e<8;e++)n=n&2147483648?n<<1^79764919:n<<1;e[t]=n>>>0}return e})();function ye(e,t){return(e<<8^ve[(e>>>24^t)&255])>>>0}var be=class{buffer=[];current=0;bitCount=0;writeBits(e,t){for(let n=e-1;n>=0;n--)this.current=this.current<<1|t>>>n&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}writeBit(e){this.current=this.current<<1|e&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.buffer.push(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function xe(e){let t=[],n=0;for(;n<e.length;){let r=e[n],i=1;for(;n+i<e.length&&e[n+i]===r&&i<255;)i++;i>=4?(t.push(r,r,r,r),t.push(i-4),n+=i):(t.push(r),n++)}return new Uint8Array(t)}function Se(e){let t=e.length;if(t===0)return{transformed:new Uint8Array,pointer:0};let n=Ce(e),r=new Uint8Array(t),i=0;for(let a=0;a<t;a++)n[a]===0?(i=a,r[a]=e[t-1]):r[a]=e[n[a]-1];return{transformed:r,pointer:i}}function Ce(e){let t=e.length,n=new Int32Array(t),r=new Int32Array(t);for(let i=0;i<t;i++)n[i]=i,r[i]=e[i];for(let e=1;e<t;e*=2){let i=r.slice();n.sort((n,r)=>i[n]===i[r]?i[(n+e)%t]-i[(r+e)%t]:i[n]-i[r]),r[n[0]]=0;for(let a=1;a<t;a++)i[n[a]]===i[n[a-1]]&&i[(n[a]+e)%t]===i[(n[a-1]+e)%t]?r[n[a]]=r[n[a-1]]:r[n[a]]=r[n[a-1]]+1;if(r[n[t-1]]===t-1)break}return n}function we(e,t){let n=[];for(let e=0;e<256;e++)t[e]&&n.push(e);let r=Array(256).fill(-1);for(let e=0;e<n.length;e++)r[n[e]]=e;let i=new Uint16Array(e.length),a=n.slice();for(let t=0;t<e.length;t++){let n=e[t],r=0;for(;a[r]!==n;)r++;if(i[t]=r,r>0){let e=a[r];for(let e=r;e>0;e--)a[e]=a[e-1];a[0]=e}}return{encoded:i,length:e.length}}function Te(e,t,n){let r=n+1,i=[],a=0;for(;a<t;)if(e[a]===0){let n=0;for(;a<t&&e[a]===0;)n++,a++;let r=n;for(;r>0;)r--,r&1?i.push(1):i.push(0),r>>>=1}else i.push(e[a]+1),a++;i.push(r);let o=new Uint16Array(i.length);for(let e=0;e<i.length;e++)o[e]=i[e];return{symbols:o,length:i.length,eob:r}}function Ee(e,t,n){if(t<=1){let t=Array(e.length).fill(0);for(let n=0;n<e.length;n++)e[n]>0&&(t[n]=1);return{codeLengths:t,maxLen:1,minLen:1}}let r=[];for(let t=0;t<e.length;t++)e[t]>0&&r.push({freq:e[t],symbol:t,left:null,right:null});if(r.length===0)return{codeLengths:Array(e.length).fill(0),maxLen:0,minLen:0};if(r.length===1){let t=Array(e.length).fill(0);return t[r[0].symbol]=1,{codeLengths:t,maxLen:1,minLen:1}}for(;r.length>1;){r.sort((e,t)=>e.freq-t.freq);let e=r.shift(),t=r.shift();r.push({freq:e.freq+t.freq,symbol:-1,left:e,right:t})}let i=Array(e.length).fill(0);function a(e,t){if(!e.left&&!e.right){i[e.symbol]=t;return}e.left&&a(e.left,t+1),e.right&&a(e.right,t+1)}a(r[0],0);let o=!0;for(;o;){o=!1;for(let e=0;e<i.length;e++)i[e]>n&&(i[e]=n,o=!0);if(o){let e=0;for(let t=0;t<i.length;t++)i[t]>0&&(e+=1/(1<<i[t]));if(e>1)for(let t=1;t<n&&e>1;t++)for(let n=0;n<i.length&&e>1;n++)i[n]===t&&(i[n]++,e-=1/(1<<t)-1/(1<<t+1));o=!1;for(let e=0;e<i.length;e++)if(i[e]>n){o=!0;break}}}let s=n,c=0;for(let e=0;e<i.length;e++)i[e]>0&&(i[e]<s&&(s=i[e]),i[e]>c&&(c=i[e]));return{codeLengths:i,maxLen:c,minLen:s}}function De(e,t){let n=Array(t).fill(0),r=e.slice(0,t),i=Math.max(...r,0),a=Array(i+1).fill(0);for(let e=0;e<t;e++)r[e]>0&&a[r[e]]++;let o=Array(i+1).fill(0),s=0;for(let e=1;e<=i;e++)s=s+a[e-1]<<1,o[e]=s;for(let e=0;e<t;e++)r[e]>0&&(n[e]=o[r[e]]++);return{codes:n,lengths:r}}function Oe(e,t,n){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,n),e.writeBit(0);let{transformed:r,pointer:i}=Se(xe(t));e.writeBits(24,i);let a=Array(256).fill(!1);for(let e=0;e<r.length;e++)a[r[e]]=!0;let o=Array(16).fill(!1);for(let e=0;e<16;e++)for(let t=0;t<16;t++)if(a[e*16+t]){o[e]=!0;break}for(let t=0;t<16;t++)e.writeBit(o[t]?1:0);for(let t=0;t<16;t++)if(o[t])for(let n=0;n<16;n++)e.writeBit(a[t*16+n]?1:0);let s=0;for(let e=0;e<256;e++)a[e]&&s++;let{encoded:c,length:l}=we(r,a),{symbols:u,length:d}=Te(c,l,s),f=s+2,p=Math.ceil(d/50),m;m=d<200?2:d<600?3:d<1200?4:d<2400?5:6,m>p&&(m=Math.max(2,p));let h=[];for(let e=0;e<m;e++)h.push(Array(f).fill(0));let g=new Int32Array(p);for(let e=0;e<p;e++)g[e]=e%m;for(let e=0;e<p;e++){let t=e*50,n=Math.min(t+50,d),r=g[e];for(let e=t;e<n;e++)h[r][u[e]]++}function _(e){for(let t=0;t<f;t++)e[t]<1&&(e[t]=1)}let v=[];for(let e=0;e<m;e++)_(h[e]),v.push(Ee(h[e],f,20));for(let e=0;e<4;e++){for(let e=0;e<m;e++)h[e].fill(0);for(let e=0;e<p;e++){let t=e*50,n=Math.min(t+50,d),r=0,i=1/0;for(let e=0;e<m;e++){let a=0;for(let r=t;r<n;r++)a+=v[e].codeLengths[u[r]]||20;a<i&&(i=a,r=e)}g[e]=r;for(let e=t;e<n;e++)h[r][u[e]]++}for(let e=0;e<m;e++)_(h[e]),v[e]=Ee(h[e],f,20)}e.writeBits(3,m),e.writeBits(15,p);let y=[],b=[];for(let e=0;e<m;e++)b.push(e);for(let e=0;e<p;e++){let t=g[e],n=0;for(;b[n]!==t;)n++;if(y.push(n),n>0){let e=b[n];for(let e=n;e>0;e--)b[e]=b[e-1];b[0]=e}}for(let t=0;t<p;t++){for(let n=0;n<y[t];n++)e.writeBit(1);e.writeBit(0)}for(let t=0;t<m;t++){let n=v[t].codeLengths,r=n[0];e.writeBits(5,r);for(let t=0;t<f;t++){let i=n[t];for(;r<i;)e.writeBit(1),e.writeBit(0),r++;for(;r>i;)e.writeBit(1),e.writeBit(1),r--;e.writeBit(0)}}for(let e=0;e<m;e++){let{codes:t,lengths:n}=De(v[e].codeLengths,f);v[e]=Object.assign(v[e],{_codes:t,_lengths:n})}let x=0,S=0;for(let t=0;t<d;t++){(S===0||S>=50)&&(t>0&&x++,S=0);let n=v[g[x]],r=u[t],i=n._lengths[r],a=n._codes[r];i>0&&e.writeBits(i,a),S++}}var ke=10*1024*1024;function Ae(e,t=9,n=ke){if(t<1||t>9)throw Error(`Block size level must be 1-9`);if(e.length>n)throw Error(`Input too large for bzip2 compression (${e.length} bytes, max ${n})`);let r=t*1e5,i=new be;i.writeBits(8,66),i.writeBits(8,90),i.writeBits(8,104),i.writeBits(8,48+t);let a=0,o=0;for(;o<e.length;){let t=Math.min(o+r,e.length),n=e.subarray(o,t),s=4294967295;for(let e=0;e<n.length;e++)s=ye(s,n[e]);s=~s>>>0,a=(a<<1|a>>>31)>>>0,a=(a^s)>>>0,Oe(i,n,s),o=t}return i.writeBits(24,1536581),i.writeBits(24,3690640),i.writeBits(32,a),i.finish()}var G=null,K=null;async function je(){if(G)return G;if(K)throw K;try{return G=await r.runTrustedAsync(()=>import(`./lzma-BSEvzrCT.mjs`)),G}catch{throw K=Error(`xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies.`),K}}var q=null,J=null;async function Me(){if(q)return q;if(J)throw J;try{return q=await r.runTrustedAsync(()=>import(`./lib-BbNAtG4h.mjs`).then(t=>e(t.default,1))),q}catch{throw J=Error(`zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd`),J}}var Y=100*1024*1024,Ne=512,Pe=1e4;function Fe(e){let t=`file`;e.isDirectory?t=`directory`:e.isSymlink&&(t=`symlink`);let n=e.name;e.isDirectory&&!n.endsWith(`/`)&&(n+=`/`);let r;e.content!==void 0&&(r=typeof e.content==`string`?new TextEncoder().encode(e.content):e.content);let i=e.isDirectory||e.isSymlink?0:r?.length??0;return{header:{name:n,mode:e.mode??(e.isDirectory?493:420),uid:e.uid??0,gid:e.gid??0,size:i,mtime:e.mtime??new Date,type:t,linkname:e.linkTarget??``,uname:`user`,gname:`user`},body:r}}async function X(e){return ge(e.map(Fe))}async function Ie(e){let t=await X(e),n=new ReadableStream({start(e){e.enqueue(t),e.close()}}).pipeThrough(ue()).getReader(),r=[];for(;;){let{done:e,value:t}=await n.read();if(e)break;r.push(t)}let i=r.reduce((e,t)=>e+t.length,0),a=new Uint8Array(i),o=0;for(let e of r)a.set(e,o),o+=e.length;return a}async function Z(e){if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};if(e.length<Ne||e.length%Ne!==0)return{entries:[],error:`Invalid tar archive format`};try{let t=await _e(e),n=[];for(let e of t){if(n.length>=Pe)return{entries:n,error:`Too many entries (max ${Pe})`};let t=`file`;switch(e.header.type){case`directory`:t=`directory`;break;case`symlink`:t=`symlink`;break;case`link`:t=`hardlink`;break;case`file`:t=`file`;break;default:t=`other`}n.push({name:e.header.name,mode:e.header.mode??420,uid:e.header.uid??0,gid:e.header.gid??0,size:e.header.size,mtime:e.header.mtime??new Date,type:t,linkTarget:e.header.linkname||void 0,content:e.data??new Uint8Array})}return{entries:n}}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}async function Le(e){if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=new ReadableStream({start(t){t.enqueue(e),t.close()}}).pipeThrough(de()).getReader(),n=[],r=0;for(;;){let{done:e,value:i}=await t.read();if(e)break;if(r+=i.length,r>Y)return await t.cancel(),{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`};n.push(i)}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;return Z(i)}catch(e){return{entries:[],error:`Decompression failed: ${e instanceof Error?e.message:`Unknown error`}`}}}function Re(e){return e.length>=2&&e[0]===31&&e[1]===139}function ze(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function Be(e){return e.length>=6&&e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0}async function Ve(e){let t=f.default.decode(Buffer.from(e));return new Uint8Array(t)}async function He(e){return Ae(e,9)}async function Ue(e){let t=(await je()).unxzSync(Buffer.from(e));return new Uint8Array(t)}async function We(e){let t=(await je()).xzSync(Buffer.from(e));return new Uint8Array(t)}async function Ge(e){return He(await X(e))}async function Ke(e,t){if(!t?.allowNativeCodecs)throw Error(`xz compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.`);return We(await X(e))}async function qe(e){if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=await Ve(e);return t.length>Y?{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`}:Z(t)}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}async function Je(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:`xz decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction.`};if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=await Ue(e);return t.length>Y?{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`}:Z(t)}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}function Ye(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Xe(e){let t=await(await Me()).compress(Buffer.from(e),3);return new Uint8Array(t)}async function Ze(e){let t=await(await Me()).decompress(Buffer.from(e));return new Uint8Array(t)}async function Qe(e,t){if(!t?.allowNativeCodecs)throw Error(`zstd compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.`);return Xe(await X(e))}async function $e(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:`zstd decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction.`};if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=await Ze(e);return t.length>Y?{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`}:Z(t)}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}function et(e){let t={create:!1,append:!1,update:!1,extract:!1,list:!1,file:``,autoCompress:!1,gzip:!1,bzip2:!1,xz:!1,zstd:!1,verbose:!1,toStdout:!1,keepOldFiles:!1,touch:!1,directory:``,preserve:!1,absoluteNames:!1,strip:0,exclude:[],filesFrom:``,excludeFrom:``,wildcards:!1},n=[],r=0;for(;r<e.length;){let a=e[r];if(a.startsWith(`-`)&&!a.startsWith(`--`)&&a.length>2){if(/^-\d+$/.test(a)){n.push(a),r++;continue}for(let n=1;n<a.length;n++){let o=a[n];switch(o){case`c`:t.create=!0;break;case`r`:t.append=!0;break;case`u`:t.update=!0;break;case`x`:t.extract=!0;break;case`t`:t.list=!0;break;case`a`:t.autoCompress=!0;break;case`z`:t.gzip=!0;break;case`j`:t.bzip2=!0;break;case`J`:t.xz=!0;break;case`v`:t.verbose=!0;break;case`O`:t.toStdout=!0;break;case`k`:t.keepOldFiles=!0;break;case`m`:t.touch=!0;break;case`p`:t.preserve=!0;break;case`P`:t.absoluteNames=!0;break;case`f`:if(n<a.length-1)t.file=a.substring(n+1),n=a.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'f'
3
3
  `,exitCode:2}};t.file=e[r]}break;case`C`:if(n<a.length-1)t.directory=a.substring(n+1),n=a.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'C'
4
4
  `,exitCode:2}};t.directory=e[r]}break;case`T`:if(n<a.length-1)t.filesFrom=a.substring(n+1),n=a.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'T'
5
5
  `,exitCode:2}};t.filesFrom=e[r]}break;case`X`:if(n<a.length-1)t.excludeFrom=a.substring(n+1),n=a.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'X'
@@ -9,15 +9,15 @@ import{s as e,t}from"./chunk-C94x7I9S.mjs";import{t as n}from"./chunk-YNYSPYQ5-D
9
9
  `,exitCode:2}};t.strip=n}else if(a.startsWith(`--exclude=`))t.exclude.push(a.substring(10));else if(a===`--exclude`){if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option '--exclude' requires an argument
10
10
  `,exitCode:2}};t.exclude.push(e[r])}else if(a===`-T`||a===`--files-from`){if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'T'
11
11
  `,exitCode:2}};t.filesFrom=e[r]}else if(a.startsWith(`--files-from=`))t.filesFrom=a.substring(13);else if(a===`-X`||a===`--exclude-from`){if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'X'
12
- `,exitCode:2}};t.excludeFrom=e[r]}else if(a.startsWith(`--exclude-from=`))t.excludeFrom=a.substring(15);else if(a===`--`){n.push(...e.slice(r+1));break}else{if(a.startsWith(`-`))return{ok:!1,error:i(`tar`,a)};n.push(a)}r++}return{ok:!0,options:t,files:n}}var $e=100,et={name:`tar`,summary:`manipulate tape archives`,usage:`tar [options] [file...]`,description:[`Create, extract, or list contents of tar archives.`,``,`One of -c, -r, -u, -x, or -t is required to specify the operation.`],options:[`-c, --create create a new archive`,`-r, --append append files to the end of an archive`,`-u, --update only append files newer than copy in archive`,`-x, --extract extract files from an archive`,`-t, --list list contents of an archive`,`-f, --file=ARCHIVE use archive file ARCHIVE`,`-a, --auto-compress use archive suffix to determine compression`,`-z, --gzip filter archive through gzip`,`-j, --bzip2 filter archive through bzip2`,`-J, --xz filter archive through xz`,`--zstd filter archive through zstd`,`-v, --verbose verbosely list files processed`,`-O, --to-stdout extract files to standard output`,`-k, --keep-old-files don't replace existing files when extracting`,`-m, --touch don't extract file modified time`,`-C, --directory=DIR change to directory DIR before performing operations`,`-p, --preserve preserve permissions`,`-P, --absolute-names do not strip leading '/' or block '..' paths`,`-T, --files-from=FILE read files to extract/create from FILE`,`-X, --exclude-from=FILE read exclude patterns from FILE`,`--strip=N strip N leading path components on extraction`,`--exclude=PATTERN exclude files matching PATTERN`,`--wildcards use wildcards for pattern matching`,` --help display this help and exit`],examples:[`tar -cvf archive.tar file1 file2 Create archive from files`,`tar -czvf archive.tar.gz dir/ Create gzip-compressed archive`,`tar -cjvf archive.tar.bz2 dir/ Create bzip2-compressed archive`,`tar -rf archive.tar newfile.txt Append file to archive`,`tar -uf archive.tar dir/ Update archive with newer files`,`tar -xvf archive.tar Extract archive`,`tar -xvf archive.tar -C /tmp Extract to /tmp`,`tar -tvf archive.tar List archive contents`,`tar -xzf archive.tar.gz Extract gzip archive`,`tar -xf archive.tar file1.txt Extract specific file`,`tar -xOf archive.tar file.txt Extract file to stdout`,`tar -xf archive.tar --wildcards '*.txt' Extract matching files`]};function tt(e,t){let r=e.includes(`/`)?e.substring(e.lastIndexOf(`/`)+1):e;for(let i of t){let t=i.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*\*/g,`<<<GLOBSTAR>>>`).replace(/\*/g,`[^/]*`).replace(/<<<GLOBSTAR>>>/g,`.*`).replace(/\?/g,`.`);if(n(`^${t}$`).test(e)||n(`^${t}/`).test(e)||!i.includes(`/`)&&n(`^${t}$`).test(r))return!0}return!1}function Q(e,t){let r=t.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*\*/g,`<<<GLOBSTAR>>>`).replace(/\*/g,`[^/]*`).replace(/<<<GLOBSTAR>>>/g,`.*`).replace(/\?/g,`.`),i=e.includes(`/`)?e.substring(e.lastIndexOf(`/`)+1):e;return n(`^${r}$`).test(e)||n(`^${r}$`).test(i)}function nt(e,t){if(t<=0)return e;let n=e.split(`/`).filter(e=>e!==``);return n.length<=t?``:n.slice(t).join(`/`)}function rt(e){return e.split(`/`).some(e=>e===`..`)}function it(e,t){if(t)return{safePath:e};let n=e.replace(/^\/+/,``);return n.length===0?{safePath:``}:rt(n)?{error:`Path contains '..'`}:{safePath:n}}function at(e){return`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][e.getMonth()]} ${e.getDate().toString().padStart(2,` `)} ${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}`}async function $(e,t,n,r){let i=[],a=[],o=e.fs.resolvePath(t,n);try{let s=await e.fs.stat(o);if(tt(n,r))return{entries:i,errors:a};if(s.isDirectory){i.push({name:n,isDirectory:!0,mode:s.mode,mtime:s.mtime});let c=await e.fs.readdir(o);for(let o=0;o<c.length;o+=$e){let s=c.slice(o,o+$e),l=await Promise.all(s.map(i=>$(e,t,n?`${n}/${i}`:i,r)));for(let e of l)i.push(...e.entries),a.push(...e.errors)}}else if(s.isFile){let t=await e.fs.readFileBuffer(o);i.push({name:n,content:t,mode:s.mode,mtime:s.mtime})}else if(s.isSymbolicLink){let t=await e.fs.readlink(o);i.push({name:n,isSymlink:!0,linkTarget:t,mode:s.mode,mtime:s.mtime})}}catch(e){let t=e instanceof Error?e.message:`unknown error`;a.push(`tar: ${n}: ${t}`)}return{entries:i,errors:a}}async function ot(e,t,n){if(n.length===0)return{stdout:``,stderr:`tar: Cowardly refusing to create an empty archive
12
+ `,exitCode:2}};t.excludeFrom=e[r]}else if(a.startsWith(`--exclude-from=`))t.excludeFrom=a.substring(15);else if(a===`--`){n.push(...e.slice(r+1));break}else{if(a.startsWith(`-`))return{ok:!1,error:i(`tar`,a)};n.push(a)}r++}return{ok:!0,options:t,files:n}}var tt=100,nt={name:`tar`,summary:`manipulate tape archives`,usage:`tar [options] [file...]`,description:[`Create, extract, or list contents of tar archives.`,``,`One of -c, -r, -u, -x, or -t is required to specify the operation.`],options:[`-c, --create create a new archive`,`-r, --append append files to the end of an archive`,`-u, --update only append files newer than copy in archive`,`-x, --extract extract files from an archive`,`-t, --list list contents of an archive`,`-f, --file=ARCHIVE use archive file ARCHIVE`,`-a, --auto-compress use archive suffix to determine compression`,`-z, --gzip filter archive through gzip`,`-j, --bzip2 filter archive through bzip2`,`-J, --xz filter archive through xz`,`--zstd filter archive through zstd`,`-v, --verbose verbosely list files processed`,`-O, --to-stdout extract files to standard output`,`-k, --keep-old-files don't replace existing files when extracting`,`-m, --touch don't extract file modified time`,`-C, --directory=DIR change to directory DIR before performing operations`,`-p, --preserve preserve permissions`,`-P, --absolute-names do not strip leading '/' or block '..' paths`,`-T, --files-from=FILE read files to extract/create from FILE`,`-X, --exclude-from=FILE read exclude patterns from FILE`,`--strip=N strip N leading path components on extraction`,`--exclude=PATTERN exclude files matching PATTERN`,`--wildcards use wildcards for pattern matching`,` --help display this help and exit`],examples:[`tar -cvf archive.tar file1 file2 Create archive from files`,`tar -czvf archive.tar.gz dir/ Create gzip-compressed archive`,`tar -cjvf archive.tar.bz2 dir/ Create bzip2-compressed archive`,`tar -rf archive.tar newfile.txt Append file to archive`,`tar -uf archive.tar dir/ Update archive with newer files`,`tar -xvf archive.tar Extract archive`,`tar -xvf archive.tar -C /tmp Extract to /tmp`,`tar -tvf archive.tar List archive contents`,`tar -xzf archive.tar.gz Extract gzip archive`,`tar -xf archive.tar file1.txt Extract specific file`,`tar -xOf archive.tar file.txt Extract file to stdout`,`tar -xf archive.tar --wildcards '*.txt' Extract matching files`]};function rt(e,t){let r=e.includes(`/`)?e.substring(e.lastIndexOf(`/`)+1):e;for(let i of t){let t=i.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*\*/g,`<<<GLOBSTAR>>>`).replace(/\*/g,`[^/]*`).replace(/<<<GLOBSTAR>>>/g,`.*`).replace(/\?/g,`.`);if(n(`^${t}$`).test(e)||n(`^${t}/`).test(e)||!i.includes(`/`)&&n(`^${t}$`).test(r))return!0}return!1}function Q(e,t){let r=t.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*\*/g,`<<<GLOBSTAR>>>`).replace(/\*/g,`[^/]*`).replace(/<<<GLOBSTAR>>>/g,`.*`).replace(/\?/g,`.`),i=e.includes(`/`)?e.substring(e.lastIndexOf(`/`)+1):e;return n(`^${r}$`).test(e)||n(`^${r}$`).test(i)}function it(e,t){if(t<=0)return e;let n=e.split(`/`).filter(e=>e!==``);return n.length<=t?``:n.slice(t).join(`/`)}function at(e){return e.split(`/`).some(e=>e===`..`)}function ot(e,t){if(t)return{safePath:e};let n=e.replace(/^\/+/,``);return n.length===0?{safePath:``}:at(n)?{error:`Path contains '..'`}:{safePath:n}}function st(e){return`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][e.getMonth()]} ${e.getDate().toString().padStart(2,` `)} ${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}`}async function $(e,t,n,r){let i=[],a=[],o=e.fs.resolvePath(t,n);try{let s=await e.fs.stat(o);if(rt(n,r))return{entries:i,errors:a};if(s.isDirectory){i.push({name:n,isDirectory:!0,mode:s.mode,mtime:s.mtime});let c=await e.fs.readdir(o);for(let o=0;o<c.length;o+=tt){let s=c.slice(o,o+tt),l=await Promise.all(s.map(i=>$(e,t,n?`${n}/${i}`:i,r)));for(let e of l)i.push(...e.entries),a.push(...e.errors)}}else if(s.isFile){let t=await e.fs.readFileBuffer(o);i.push({name:n,content:t,mode:s.mode,mtime:s.mtime})}else if(s.isSymbolicLink){let t=await e.fs.readlink(o);i.push({name:n,isSymlink:!0,linkTarget:t,mode:s.mode,mtime:s.mtime})}}catch(e){let t=e instanceof Error?e.message:`unknown error`;a.push(`tar: ${n}: ${t}`)}return{entries:i,errors:a}}async function ct(e,t,n){if(n.length===0)return{stdout:``,stderr:`tar: Cowardly refusing to create an empty archive
13
13
  `,exitCode:2};let r=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,i=[],a=[],o=``;for(let s of n){let{entries:n,errors:c}=await $(e,r,s,t.exclude);if(i.push(...n),a.push(...c),t.verbose)for(let e of n)o+=`${e.name}${e.isDirectory?`/`:``}
14
14
  `}if(i.length===0&&a.length>0)return{stdout:``,stderr:`${a.join(`
15
15
  `)}
16
- `,exitCode:2};let s;try{s=t.gzip?await Pe(i):t.bzip2?await Ue(i):t.xz?await We(i):t.zstd?await Xe(i):await X(i)}catch(e){return{stdout:``,stderr:`tar: error creating archive: ${e instanceof Error?e.message:`unknown error`}
16
+ `,exitCode:2};let s;try{s=t.gzip?await Ie(i):t.bzip2?await Ge(i):t.xz?await Ke(i):t.zstd?await Qe(i):await X(i)}catch(e){return{stdout:``,stderr:`tar: error creating archive: ${e instanceof Error?e.message:`unknown error`}
17
17
  `,exitCode:2}}let c=``;if(t.file&&t.file!==`-`){let n=e.fs.resolvePath(e.cwd,t.file);try{await e.fs.writeFile(n,s)}catch(e){let n=e instanceof Error?e.message:`unknown error`;return{stdout:``,stderr:`tar: ${t.file}: ${n}
18
18
  `,exitCode:2}}}else c=Buffer.from(s).toString(`latin1`);let l=o;return a.length>0&&(l+=`${a.join(`
19
19
  `)}
20
- `),{stdout:c,stderr:l,exitCode:a.length>0?2:0}}async function st(e,t,n){if(!t.file||t.file===`-`)return{stdout:``,stderr:`tar: Cannot append to stdin/stdout
20
+ `),{stdout:c,stderr:l,exitCode:a.length>0?2:0}}async function lt(e,t,n){if(!t.file||t.file===`-`)return{stdout:``,stderr:`tar: Cannot append to stdin/stdout
21
21
  `,exitCode:2};if(n.length===0)return{stdout:``,stderr:`tar: Cowardly refusing to append nothing to archive
22
22
  `,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),i;try{i=await e.fs.readFileBuffer(r)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
23
23
  `,exitCode:2}}let a=await Z(i);if(a.error)return{stdout:``,stderr:`tar: ${a.error}
@@ -26,7 +26,7 @@ import{s as e,t}from"./chunk-C94x7I9S.mjs";import{t as n}from"./chunk-YNYSPYQ5-D
26
26
  `,exitCode:2}}try{await e.fs.writeFile(r,f)}catch(e){let n=e instanceof Error?e.message:`unknown error`;return{stdout:``,stderr:`tar: ${t.file}: ${n}
27
27
  `,exitCode:2}}let p=u;return l.length>0&&(p+=`${l.join(`
28
28
  `)}
29
- `),{stdout:``,stderr:p,exitCode:l.length>0?2:0}}async function ct(e,t,n){if(!t.file||t.file===`-`)return{stdout:``,stderr:`tar: Cannot update stdin/stdout
29
+ `),{stdout:``,stderr:p,exitCode:l.length>0?2:0}}async function ut(e,t,n){if(!t.file||t.file===`-`)return{stdout:``,stderr:`tar: Cannot update stdin/stdout
30
30
  `,exitCode:2};if(n.length===0)return{stdout:``,stderr:`tar: Cowardly refusing to update with nothing
31
31
  `,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),i;try{i=await e.fs.readFileBuffer(r)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
32
32
  `,exitCode:2}}let a=await Z(i);if(a.error)return{stdout:``,stderr:`tar: ${a.error}
@@ -37,21 +37,21 @@ import{s as e,t}from"./chunk-C94x7I9S.mjs";import{t as n}from"./chunk-YNYSPYQ5-D
37
37
  `,exitCode:2}}try{await e.fs.writeFile(r,p)}catch(e){let n=e instanceof Error?e.message:`unknown error`;return{stdout:``,stderr:`tar: ${t.file}: ${n}
38
38
  `,exitCode:2}}let m=u;return l.length>0&&(m+=`${l.join(`
39
39
  `)}
40
- `),{stdout:``,stderr:m,exitCode:l.length>0?2:0}}async function lt(e,t,n){let r;if(t.file&&t.file!==`-`){let n=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(n)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
41
- `,exitCode:2}}}else r=Uint8Array.from(e.stdin,e=>e.charCodeAt(0));let i,a=t.gzip||Ie(r),o=t.bzip2||Le(r),s=t.xz||Re(r),c=t.zstd||qe(r);if(i=a?await Fe(r):o?await Ge(r):s?await Ke(r):c?await Ze(r):await Z(r),i.error)return{stdout:``,stderr:`tar: ${i.error}
42
- `,exitCode:2};let l=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,u=t.absoluteNames?n:n.map(e=>e.replace(/^\/+/,``)).filter(e=>e.length>0),d=``,f=``,p=[];if(t.directory&&!t.toStdout)try{await e.fs.mkdir(l,{recursive:!0})}catch{}for(let n of i.entries){let r=nt(n.name,t.strip);if(!r)continue;let i=it(r,t.absoluteNames);if(i.error){p.push(`tar: ${r}: ${i.error}`);continue}let a=i.safePath??``;if(!a)continue;let o=a.endsWith(`/`)?a.slice(0,-1):a;if(u.length>0){let e;if(e=t.wildcards?u.some(e=>Q(a,e)||Q(o,e)||a.startsWith(`${e}/`)):u.some(e=>a===e||a.startsWith(`${e}/`)||o===e),!e)continue}if(tt(a,t.exclude))continue;let s=e.fs.resolvePath(l,a);try{if(n.type===`directory`){if(t.toStdout)continue;await e.fs.mkdir(s,{recursive:!0}),t.verbose&&(d+=`${a}
40
+ `),{stdout:``,stderr:m,exitCode:l.length>0?2:0}}async function dt(e,t,n){let r;if(t.file&&t.file!==`-`){let n=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(n)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
41
+ `,exitCode:2}}}else r=Uint8Array.from(e.stdin,e=>e.charCodeAt(0));let i,a=t.gzip||Re(r),o=t.bzip2||ze(r),s=t.xz||Be(r),c=t.zstd||Ye(r);if(i=a?await Le(r):o?await qe(r):s?await Je(r):c?await $e(r):await Z(r),i.error)return{stdout:``,stderr:`tar: ${i.error}
42
+ `,exitCode:2};let l=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,u=t.absoluteNames?n:n.map(e=>e.replace(/^\/+/,``)).filter(e=>e.length>0),d=``,f=``,p=[];if(t.directory&&!t.toStdout)try{await e.fs.mkdir(l,{recursive:!0})}catch{}for(let n of i.entries){let r=it(n.name,t.strip);if(!r)continue;let i=ot(r,t.absoluteNames);if(i.error){p.push(`tar: ${r}: ${i.error}`);continue}let a=i.safePath??``;if(!a)continue;let o=a.endsWith(`/`)?a.slice(0,-1):a;if(u.length>0){let e;if(e=t.wildcards?u.some(e=>Q(a,e)||Q(o,e)||a.startsWith(`${e}/`)):u.some(e=>a===e||a.startsWith(`${e}/`)||o===e),!e)continue}if(rt(a,t.exclude))continue;let s=e.fs.resolvePath(l,a);try{if(n.type===`directory`){if(t.toStdout)continue;await e.fs.mkdir(s,{recursive:!0}),t.verbose&&(d+=`${a}
43
43
  `)}else if(n.type===`file`){if(t.toStdout){f+=new TextDecoder().decode(n.content),t.verbose&&(d+=`${a}
44
44
  `);continue}if(t.keepOldFiles)try{await e.fs.stat(s),t.verbose&&(d+=`${a}: not overwritten, file exists
45
45
  `);continue}catch{}let r=s.substring(0,s.lastIndexOf(`/`));if(r)try{await e.fs.mkdir(r,{recursive:!0})}catch{}if(await e.fs.writeFile(s,n.content),t.preserve&&n.mode)try{await e.fs.chmod(s,n.mode)}catch{}t.verbose&&(d+=`${a}
46
- `)}else if(n.type===`symlink`&&n.linkTarget){if(t.toStdout)continue;if(!t.absoluteNames&&(n.linkTarget.startsWith(`/`)||rt(n.linkTarget))){p.push(`tar: ${a}: unsafe symlink target`);continue}if(t.keepOldFiles)try{await e.fs.stat(s),t.verbose&&(d+=`${a}: not overwritten, file exists
46
+ `)}else if(n.type===`symlink`&&n.linkTarget){if(t.toStdout)continue;if(!t.absoluteNames&&(n.linkTarget.startsWith(`/`)||at(n.linkTarget))){p.push(`tar: ${a}: unsafe symlink target`);continue}if(t.keepOldFiles)try{await e.fs.stat(s),t.verbose&&(d+=`${a}: not overwritten, file exists
47
47
  `);continue}catch{}let r=s.substring(0,s.lastIndexOf(`/`));if(r)try{await e.fs.mkdir(r,{recursive:!0})}catch{}try{await e.fs.symlink(n.linkTarget,s)}catch{}t.verbose&&(d+=`${a}
48
48
  `)}}catch(e){let t=e instanceof Error?e.message:`unknown error`;p.push(`tar: ${a}: ${t}`)}}let m=d;return p.length>0&&(m+=`${p.join(`
49
49
  `)}
50
- `),{stdout:f,stderr:m,exitCode:p.length>0?2:0}}async function ut(e,t,n){let r;if(t.file&&t.file!==`-`){let n=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(n)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
51
- `,exitCode:2}}}else r=Uint8Array.from(e.stdin,e=>e.charCodeAt(0));let i,a=t.gzip||Ie(r),o=t.bzip2||Le(r),c=t.xz||Re(r),l=t.zstd||qe(r);if(i=a?await Fe(r):o?await Ge(r):c?await Ke(r):l?await Ze(r):await Z(r),i.error)return{stdout:``,stderr:`tar: ${i.error}
52
- `,exitCode:2};let u=``;for(let e of i.entries){let r=nt(e.name,t.strip);if(!r)continue;let i=r.endsWith(`/`)?r.slice(0,-1):r;if(n.length>0){let e;if(e=t.wildcards?n.some(e=>Q(r,e)||Q(i,e)||r.startsWith(`${e}/`)):n.some(e=>r===e||r.startsWith(`${e}/`)||i===e),!e)continue}if(!tt(r,t.exclude))if(t.verbose){let t=e.type===`directory`,n=s(e.mode,t),i=`${e.uid}/${e.gid}`,a=e.size.toString().padStart(8,` `),o=at(e.mtime),c=`${n} ${i.padEnd(10)} ${a} ${o} ${r}`;e.type===`symlink`&&e.linkTarget&&(c+=` -> ${e.linkTarget}`),u+=`${c}
50
+ `),{stdout:f,stderr:m,exitCode:p.length>0?2:0}}async function ft(e,t,n){let r;if(t.file&&t.file!==`-`){let n=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(n)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
51
+ `,exitCode:2}}}else r=Uint8Array.from(e.stdin,e=>e.charCodeAt(0));let i,a=t.gzip||Re(r),o=t.bzip2||ze(r),c=t.xz||Be(r),l=t.zstd||Ye(r);if(i=a?await Le(r):o?await qe(r):c?await Je(r):l?await $e(r):await Z(r),i.error)return{stdout:``,stderr:`tar: ${i.error}
52
+ `,exitCode:2};let u=``;for(let e of i.entries){let r=it(e.name,t.strip);if(!r)continue;let i=r.endsWith(`/`)?r.slice(0,-1):r;if(n.length>0){let e;if(e=t.wildcards?n.some(e=>Q(r,e)||Q(i,e)||r.startsWith(`${e}/`)):n.some(e=>r===e||r.startsWith(`${e}/`)||i===e),!e)continue}if(!rt(r,t.exclude))if(t.verbose){let t=e.type===`directory`,n=s(e.mode,t),i=`${e.uid}/${e.gid}`,a=e.size.toString().padStart(8,` `),o=st(e.mtime),c=`${n} ${i.padEnd(10)} ${a} ${o} ${r}`;e.type===`symlink`&&e.linkTarget&&(c+=` -> ${e.linkTarget}`),u+=`${c}
53
53
  `}else u+=`${r}
54
- `}return{stdout:u,stderr:``,exitCode:0}}var dt={name:`tar`,async execute(e,t){if(o(e))return a(et);let n=Qe(e);if(!n.ok)return n.error;let{options:r,files:i}=n,s=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(s===0)return{stdout:``,stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
54
+ `}return{stdout:u,stderr:``,exitCode:0}}var pt={name:`tar`,async execute(e,t){if(o(e))return a(nt);let n=et(e);if(!n.ok)return n.error;let{options:r,files:i}=n,s=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(s===0)return{stdout:``,stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
55
55
  `,exitCode:2};if(s>1)return{stdout:``,stderr:`tar: You may not specify more than one of -c, -r, -u, -x, or -t
56
56
  `,exitCode:2};if(r.autoCompress&&r.file&&r.create){let e=r.file.toLowerCase();e.endsWith(`.tar.gz`)||e.endsWith(`.tgz`)?r.gzip=!0:e.endsWith(`.tar.bz2`)||e.endsWith(`.tbz2`)?r.bzip2=!0:e.endsWith(`.tar.xz`)||e.endsWith(`.txz`)?r.xz=!0:(e.endsWith(`.tar.zst`)||e.endsWith(`.tzst`))&&(r.zstd=!0)}let c=[r.gzip,r.bzip2,r.xz,r.zstd].filter(Boolean).length;if(c>1)return{stdout:``,stderr:`tar: You may not specify more than one compression option
57
57
  `,exitCode:2};if((r.append||r.update)&&c>0)return{stdout:``,stderr:`tar: Cannot append/update compressed archives - decompress first
@@ -59,5 +59,5 @@ import{s as e,t}from"./chunk-C94x7I9S.mjs";import{t as n}from"./chunk-YNYSPYQ5-D
59
59
  `).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`));l=[...i,...n]}catch{return{stdout:``,stderr:`tar: ${r.filesFrom}: Cannot open: No such file or directory
60
60
  `,exitCode:2}}}if(r.excludeFrom){let e=t.fs.resolvePath(t.cwd,r.excludeFrom);try{let n=(await t.fs.readFile(e)).split(`
61
61
  `).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`));r.exclude.push(...n)}catch{return{stdout:``,stderr:`tar: ${r.excludeFrom}: Cannot open: No such file or directory
62
- `,exitCode:2}}}return r.create?ot(t,r,l):r.append?st(t,r,l):r.update?ct(t,r,l):r.extract?lt(t,r,l):ut(t,r,l)}},ft={name:`tar`,flags:[{flag:`-c`,type:`boolean`},{flag:`-x`,type:`boolean`},{flag:`-t`,type:`boolean`},{flag:`-f`,type:`value`,valueHint:`path`},{flag:`-z`,type:`boolean`},{flag:`-j`,type:`boolean`},{flag:`-v`,type:`boolean`},{flag:`-C`,type:`value`,valueHint:`path`},{flag:`--strip-components`,type:`value`,valueHint:`number`},{flag:`--exclude`,type:`value`,valueHint:`pattern`}],needsArgs:!0};export{dt as n,ft as t};
63
- //# sourceMappingURL=chunk-BRGMQKJV-DtyxDw61.mjs.map
62
+ `,exitCode:2}}}return r.create?ct(t,r,l):r.append?lt(t,r,l):r.update?ut(t,r,l):r.extract?dt(t,r,l):ft(t,r,l)}},mt={name:`tar`,flags:[{flag:`-c`,type:`boolean`},{flag:`-x`,type:`boolean`},{flag:`-t`,type:`boolean`},{flag:`-f`,type:`value`,valueHint:`path`},{flag:`-z`,type:`boolean`},{flag:`-j`,type:`boolean`},{flag:`-v`,type:`boolean`},{flag:`-C`,type:`value`,valueHint:`path`},{flag:`--strip-components`,type:`value`,valueHint:`number`},{flag:`--exclude`,type:`value`,valueHint:`pattern`}],needsArgs:!0};export{pt as n,mt as t};
63
+ //# sourceMappingURL=chunk-HKLCLINH-DwmCAW4U.mjs.map
@@ -0,0 +1,24 @@
1
+ import{a as e,r as t,t as n}from"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import{n as r,r as i,t as a}from"./chunk-74CEPOFO-V0JXh91S.mjs";import{open as o}from"node:fs/promises";var s=t(e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:(p?-1:1)*(1/0);o+=2**r,a-=l}return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}}),c=t((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}}),l=t((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=i,n.enabled=s,n.humanize=c(),n.destroy=u,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(typeof t>`u`?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function l(e){return e instanceof Error?e.stack||e.message:e}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n}),u=t((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=l()(e);var{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}}),d=t((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}}),f=t((e,t)=>{var r=n(`os`),i=n(`tty`),a=d(),{env:o}=process,s;a(`no-color`)||a(`no-colors`)||a(`color=false`)||a(`color=never`)?s=0:(a(`color`)||a(`colors`)||a(`color=true`)||a(`color=always`))&&(s=1),`FORCE_COLOR`in o&&(s=o.FORCE_COLOR===`true`?1:o.FORCE_COLOR===`false`?0:o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3));function c(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,t){if(s===0)return 0;if(a(`color=16m`)||a(`color=full`)||a(`color=truecolor`))return 3;if(a(`color=256`))return 2;if(e&&!t&&s===void 0)return 0;let n=s||0;if(o.TERM===`dumb`)return n;if(process.platform===`win32`){let e=r.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in o)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in o)||o.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if(o.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in o){let e=parseInt((o.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(o.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||`COLORTERM`in o?1:n}function u(e){return c(l(e,e&&e.isTTY))}t.exports={supportsColor:u,stdout:c(l(!0,i.isatty(1))),stderr:c(l(!0,i.isatty(2)))}}),p=t((e,t)=>{var r=n(`tty`),i=n(`util`);e.init=p,e.log=c,e.formatArgs=o,e.save=u,e.load=d,e.useColors=a,e.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=f();t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function a(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:r.isatty(process.stderr.fd)}function o(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \x1B[0m`;e[0]=a+e[0].split(`
2
+ `).join(`
3
+ `+a),e.push(i+`m+`+t.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=s()+n+` `+e[0]}function s(){return e.inspectOpts.hideDate?``:new Date().toISOString()+` `}function c(...t){return process.stderr.write(i.formatWithOptions(e.inspectOpts,...t)+`
4
+ `)}function u(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function d(){return process.env.DEBUG}function p(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}t.exports=l()(e);var{formatters:m}=t.exports;m.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split(`
5
+ `).map(e=>e.trim()).join(` `)},m.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}),m=t((e,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=u():t.exports=p()}),h=`End-Of-Stream`,g=class extends Error{constructor(){super(h),this.name=`EndOfStreamError`}},ee=class extends Error{constructor(e=`The operation was aborted`){super(e),this.name=`AbortError`}},te=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){let n=await this.read(e,t);return this.peekQueue.push(e.subarray(0,n)),n}async read(e,t=!1){if(e.length===0)return 0;let n=this.readFromPeekBuffer(e);if(this.endOfStream||(n+=await this.readRemainderFromStream(e.subarray(n),t)),n===0&&!t)throw new g;return n}readFromPeekBuffer(e){let t=e.length,n=0;for(;this.peekQueue.length>0&&t>0;){let r=this.peekQueue.pop();if(!r)throw Error(`peekData should be defined`);let i=Math.min(r.length,t);e.set(r.subarray(0,i),n),n+=i,t-=i,i<r.length&&this.peekQueue.push(r.subarray(i))}return n}async readRemainderFromStream(e,t){let n=0;for(;n<e.length&&!this.endOfStream;){if(this.interrupted)throw new ee;let r=await this.readFromStream(e.subarray(n),t);if(r===0)break;n+=r}if(!t&&n<e.length)throw new g;return n}},ne=class extends te{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}},re=class extends ne{async readFromStream(e,t){if(e.length===0)return 0;let n=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return n.done&&(this.endOfStream=n.done),n.value?(e.set(n.value),n.value.length):0}},ie=class extends te{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,t){let n=Math.min(t.length,e.length);return e.set(t.subarray(0,n)),n<t.length?this.buffer=t.subarray(n):this.buffer=null,n}async readFromStream(e,t){if(e.length===0)return 0;let n=0;for(this.buffer&&(n+=this.writeChunk(e,this.buffer));n<e.length&&!this.endOfStream;){let t=await this.reader.read();if(t.done){this.endOfStream=!0;break}t.value&&(n+=this.writeChunk(e.subarray(n),t.value))}if(!t&&n===0&&this.endOfStream)throw new g;return n}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}};function ae(e){try{let t=e.getReader({mode:`byob`});return t instanceof ReadableStreamDefaultReader?new ie(t):new re(t)}catch(t){if(t instanceof TypeError)return new ie(e.getReader());throw t}}var _=class{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener(`abort`,()=>{this.abort()})}async readToken(e,t=this.position){let n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new g;return e.get(n,0)}async peekToken(e,t=this.position){let n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new g;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new g;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new g;return e.get(this.numBuffer,0)}async ignore(e){if(e<0)throw RangeError(`ignore length must be ≥ 0 bytes`);if(this.fileInfo.size!==void 0){let t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&t.position!==void 0&&t.position<this.position)throw Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...t}}abort(){return Promise.resolve()}},oe=256e3,se=class extends _{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){let n=this.normalizeOptions(e,t),r=n.position-this.position;if(r>0)return await this.ignore(r),this.readBuffer(e,t);if(r<0)throw Error("`options.position` must be equal or greater than `tokenizer.position`");if(n.length===0)return 0;let i=await this.streamReader.read(e.subarray(0,n.length),n.mayBeLess);if(this.position+=i,(!t||!t.mayBeLess)&&i<n.length)throw new g;return i}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=0;if(n.position){let t=n.position-this.position;if(t>0){let i=new Uint8Array(n.length+t);return r=await this.peekBuffer(i,{mayBeLess:n.mayBeLess}),e.set(i.subarray(t)),r-t}if(t<0)throw Error(`Cannot peek from a negative offset in a stream`)}if(n.length>0){try{r=await this.streamReader.peek(e.subarray(0,n.length),n.mayBeLess)}catch(e){if(t?.mayBeLess&&e instanceof g)return 0;throw e}if(!n.mayBeLess&&r<n.length)throw new g}return r}async ignore(e){if(e<0)throw RangeError(`ignore length must be ≥ 0 bytes`);let t=Math.min(oe,e),n=new Uint8Array(t),r=0;for(;r<e;){let i=e-r,a=await this.readBuffer(n,{length:Math.min(t,i)});if(a<0)return a;r+=a}return r}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}},ce=class extends _{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){t?.position&&(this.position=t.position);let n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new g;return e.set(this.uint8Array.subarray(n.position,n.position+r)),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}},le=class extends _{constructor(e,t){super(t),this.blob=e,this.fileInfo={...t?.fileInfo??{},size:e.size,mimeType:e.type}}async readBuffer(e,t){t?.position&&(this.position=t.position);let n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=Math.min(this.blob.size-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new g;let i=await this.blob.slice(n.position,n.position+r).arrayBuffer();return e.set(new Uint8Array(i)),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}};function ue(e,t){let n=ae(e),r=t??{},i=r.onClose;return r.onClose=async()=>{if(await n.close(),i)return i()},new se(n,r)}function de(e,t){return new ce(e,t)}function fe(e,t){return new le(e,t)}(class e extends _{static async fromFile(t){let n=await o(t,`r`);return new e(n,{fileInfo:{path:t,size:(await n.stat()).size}})}constructor(e,t){super(t),this.fileHandle=e,this.fileInfo=t.fileInfo}async readBuffer(e,t){let n=this.normalizeOptions(e,t);if(this.position=n.position,n.length===0)return 0;let r=await this.fileHandle.read(e,0,n.length,n.position);if(this.position+=r.bytesRead,r.bytesRead<n.length&&(!t||!t.mayBeLess))throw new g;return r.bytesRead}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=await this.fileHandle.read(e,0,n.length,n.position);if(!n.mayBeLess&&r.bytesRead<n.length)throw new g;return r.bytesRead}async close(){return await this.fileHandle.close(),super.close()}setPosition(e){this.position=e}supportsRandomAccess(){return!0}}).fromFile,e(s(),1);var v={128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`},pe={};for(let[e,t]of Object.entries(v))pe[t]=Number.parseInt(e,10);var me;function he(){if(!(typeof globalThis.TextDecoder>`u`))return me??=new globalThis.TextDecoder(`utf-8`)}var y=32*1024,b=65533;function ge(e,t=`utf-8`){switch(t.toLowerCase()){case`utf-8`:case`utf8`:{let t=he();return t?t.decode(e):ve(e)}case`utf-16le`:return ye(e);case`us-ascii`:case`ascii`:return be(e);case`latin1`:case`iso-8859-1`:return xe(e);case`windows-1252`:return Se(e);default:throw RangeError(`Encoding '${t}' not supported`)}}function x(e,t){t.length!==0&&(e.push(String.fromCharCode.apply(null,t)),t.length=0)}function S(e,t,n){t.push(n),t.length>=y&&x(e,t)}function _e(e,t,n){if(n<=65535){S(e,t,n);return}n-=65536,S(e,t,55296+(n>>10)),S(e,t,56320+(n&1023))}function ve(e){let t=[],n=[],r=0;for(e.length>=3&&e[0]===239&&e[1]===187&&e[2]===191&&(r=3);r<e.length;){let i=e[r];if(i<=127){S(t,n,i),r++;continue}if(i<194||i>244){S(t,n,b),r++;continue}if(i<=223){if(r+1>=e.length){S(t,n,b),r++;continue}let a=e[r+1];if((a&192)!=128){S(t,n,b),r++;continue}S(t,n,(i&31)<<6|a&63),r+=2;continue}if(i<=239){if(r+2>=e.length){S(t,n,b),r++;continue}let a=e[r+1],o=e[r+2];if(!((a&192)==128&&(o&192)==128&&!(i===224&&a<160)&&!(i===237&&a>=160))){S(t,n,b),r++;continue}S(t,n,(i&15)<<12|(a&63)<<6|o&63),r+=3;continue}if(r+3>=e.length){S(t,n,b),r++;continue}let a=e[r+1],o=e[r+2],s=e[r+3];if(!((a&192)==128&&(o&192)==128&&(s&192)==128&&!(i===240&&a<144)&&!(i===244&&a>143))){S(t,n,b),r++;continue}_e(t,n,(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63),r+=4}return x(t,n),t.join(``)}function ye(e){let t=[],n=[],r=e.length,i=0;for(;i+1<r;){let a=e[i]|e[i+1]<<8;if(i+=2,a>=55296&&a<=56319){if(i+1<r){let r=e[i]|e[i+1]<<8;r>=56320&&r<=57343?(S(t,n,a),S(t,n,r),i+=2):S(t,n,b)}else S(t,n,b);continue}if(a>=56320&&a<=57343){S(t,n,b);continue}S(t,n,a)}return i<r&&S(t,n,b),x(t,n),t.join(``)}function be(e){let t=[];for(let n=0;n<e.length;n+=y){let r=Math.min(e.length,n+y),i=Array(r-n);for(let t=n,a=0;t<r;t++,a++)i[a]=e[t]&127;t.push(String.fromCharCode.apply(null,i))}return t.join(``)}function xe(e){let t=[];for(let n=0;n<e.length;n+=y){let r=Math.min(e.length,n+y),i=Array(r-n);for(let t=n,a=0;t<r;t++,a++)i[a]=e[t];t.push(String.fromCharCode.apply(null,i))}return t.join(``)}function Se(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r],a=i>=128&&i<=159?v[i]:void 0;n+=a??String.fromCharCode(i),n.length>=y&&(t.push(n),n=``)}return n&&t.push(n),t.join(``)}function C(e){return new DataView(e.buffer,e.byteOffset)}var Ce={len:1,get(e,t){return C(e).getUint8(t)},put(e,t,n){return C(e).setUint8(t,n),t+1}},w={len:2,get(e,t){return C(e).getUint16(t,!0)},put(e,t,n){return C(e).setUint16(t,n,!0),t+2}},T={len:2,get(e,t){return C(e).getUint16(t)},put(e,t,n){return C(e).setUint16(t,n),t+2}},E={len:4,get(e,t){return C(e).getUint32(t,!0)},put(e,t,n){return C(e).setUint32(t,n,!0),t+4}},we={len:4,get(e,t){return C(e).getUint32(t)},put(e,t,n){return C(e).setUint32(t,n),t+4}},Te={len:4,get(e,t){return C(e).getInt32(t)},put(e,t,n){return C(e).setInt32(t,n),t+4}},Ee={len:8,get(e,t){return C(e).getBigUint64(t,!0)},put(e,t,n){return C(e).setBigUint64(t,n,!0),t+8}},D=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){return ge(e.subarray(t,t+this.len),this.encoding)}},De=e(m(),1),O={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},k={get(e){return{signature:E.get(e,0),compressedSize:E.get(e,8),uncompressedSize:E.get(e,12)}},len:16},Oe={get(e){let t=w.get(e,6);return{signature:E.get(e,0),minVersion:w.get(e,4),dataDescriptor:!!(t&8),compressedMethod:w.get(e,8),compressedSize:E.get(e,18),uncompressedSize:E.get(e,22),filenameLength:w.get(e,26),extraFieldLength:w.get(e,28),filename:null}},len:30},ke={get(e){return{signature:E.get(e,0),nrOfThisDisk:w.get(e,4),nrOfThisDiskWithTheStart:w.get(e,6),nrOfEntriesOnThisDisk:w.get(e,8),nrOfEntriesOfSize:w.get(e,10),sizeOfCd:E.get(e,12),offsetOfStartOfCd:E.get(e,16),zipFileCommentLength:w.get(e,20)}},len:22},Ae={get(e){let t=w.get(e,8);return{signature:E.get(e,0),minVersion:w.get(e,6),dataDescriptor:!!(t&8),compressedMethod:w.get(e,10),compressedSize:E.get(e,20),uncompressedSize:E.get(e,24),filenameLength:w.get(e,28),extraFieldLength:w.get(e,30),fileCommentLength:w.get(e,32),relativeOffsetOfLocalHeader:E.get(e,42),filename:null}},len:46};function je(e){let t=new Uint8Array(E.len);return E.put(t,0,e),t}var A=(0,De.default)(`tokenizer:inflate`),j=256*1024,Me=je(O.DataDescriptor),M=je(O.EndOfCentralDirectory),N=class e{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(j)}async isZip(){return await this.peekSignature()===O.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(E)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),n=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(n,{position:e.fileInfo.size-t});for(let r=n.length-4;r>=0;r--)if(n[r]===M[0]&&n[r+1]===M[1]&&n[r+2]===M[2]&&n[r+3]===M[3])return e.fileInfo.size-t+r;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){A(`Cannot reading central-directory without random-read support`);return}A(`Reading central-directory...`);let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){A(`Central-directory 32-bit signature found`);let n=await this.tokenizer.readToken(ke,t),r=[];this.tokenizer.setPosition(n.offsetOfStartOfCd);for(let e=0;e<n.nrOfEntriesOfSize;++e){let t=await this.tokenizer.readToken(Ae);if(t.signature!==O.CentralFileHeader)throw Error(`Expected Central-File-Header signature`);t.filename=await this.tokenizer.readToken(new D(t.filenameLength,`utf-8`)),await this.tokenizer.ignore(t.extraFieldLength),await this.tokenizer.ignore(t.fileCommentLength),r.push(t),A(`Add central-directory file-entry: n=${e+1}/${r.length}: filename=${r[e].filename}`)}return this.tokenizer.setPosition(e),r}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let n=!1;do{let t=await this.readLocalFileHeader();if(!t)break;let r=e(t);n=!!r.stop;let i;if(await this.tokenizer.ignore(t.extraFieldLength),t.dataDescriptor&&t.compressedSize===0){let e=[],n=j;A(`Compressed-file-size unknown, scanning for next data-descriptor-signature....`);let i=-1;for(;i<0&&n===j;){n=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),i=Ne(this.syncBuffer.subarray(0,n),Me);let t=i>=0?i:n;if(r.handler){let n=new Uint8Array(t);await this.tokenizer.readBuffer(n),e.push(n)}else await this.tokenizer.ignore(t)}A(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),r.handler&&await this.inflate(t,Pe(e),r.handler)}else r.handler?(A(`Reading compressed-file-data: ${t.compressedSize} bytes`),i=new Uint8Array(t.compressedSize),await this.tokenizer.readBuffer(i),await this.inflate(t,i,r.handler)):(A(`Ignoring compressed-file-data: ${t.compressedSize} bytes`),await this.tokenizer.ignore(t.compressedSize));if(A(`Reading data-descriptor at pos=${this.tokenizer.position}`),t.dataDescriptor&&(await this.tokenizer.readToken(k)).signature!==134695760)throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-k.len}`)}while(!n)}async iterateOverCentralDirectory(e,t){for(let n of e){let e=t(n);if(e.handler){this.tokenizer.setPosition(n.relativeOffsetOfLocalHeader);let t=await this.readLocalFileHeader();if(t){await this.tokenizer.ignore(t.extraFieldLength);let r=new Uint8Array(n.compressedSize);await this.tokenizer.readBuffer(r),await this.inflate(t,r,e.handler)}}if(e.stop)break}}async inflate(t,n,r){if(t.compressedMethod===0)return r(n);if(t.compressedMethod!==8)throw Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);return A(`Decompress filename=${t.filename}, compressed-size=${n.length}`),r(await e.decompressDeflateRaw(n))}static async decompressDeflateRaw(e){let t=new ReadableStream({start(t){t.enqueue(e),t.close()}}),n=new DecompressionStream(`deflate-raw`),r=t.pipeThrough(n);try{let e=await new Response(r).arrayBuffer();return new Uint8Array(e)}catch(e){let t=e instanceof Error?`Failed to deflate ZIP entry: ${e.message}`:`Unknown decompression error in ZIP entry`;throw TypeError(t)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(E);if(e===O.LocalFileHeader){let e=await this.tokenizer.readToken(Oe);return e.filename=await this.tokenizer.readToken(new D(e.filenameLength,`utf-8`)),e}if(e===O.CentralFileHeader)return!1;throw Error(e===3759263696?`Encrypted ZIP`:`Unexpected signature`)}};function Ne(e,t){let n=e.length,r=t.length;if(r>n)return-1;for(let i=0;i<=n-r;i++){let n=!0;for(let a=0;a<r;a++)if(e[i+a]!==t[a]){n=!1;break}if(n)return i}return-1}function Pe(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}var Fe=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let n=new Uint8Array(1024),r=await e.readBuffer(n,{mayBeLess:!0});if(r===0){t.close();return}t.enqueue(n.subarray(0,r))}}).pipeThrough(new DecompressionStream(`gzip`))}};new globalThis.TextDecoder(`utf8`),new globalThis.TextEncoder,Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Ie(e){let{byteLength:t}=e;if(t===6)return e.getUint16(0)*2**32+e.getUint32(2);if(t===5)return e.getUint8(0)*2**32+e.getUint32(1);if(t===4)return e.getUint32(0);if(t===3)return e.getUint8(0)*2**16+e.getUint16(1);if(t===2)return e.getUint16(0);if(t===1)return e.getUint8(0)}function Le(e,t){if(t===`utf-16le`){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t.push(r&255,r>>8&255)}return t}if(t===`utf-16be`){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t.push(r>>8&255,r&255)}return t}return[...e].map(e=>e.charCodeAt(0))}function Re(e,t=0){let n=Number.parseInt(new D(6).get(e,148).replace(/\0.*$/,``).trim(),8);if(Number.isNaN(n))return!1;let r=256;for(let n=t;n<t+148;n++)r+=e[n];for(let n=t+156;n<t+512;n++)r+=e[n];return n===r}var ze={get:(e,t)=>e[t+3]&127|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},Be=`jpg,png,apng,gif,webp,flif,xcf,cr2,cr3,orf,arw,dng,nef,rw2,raf,tif,bmp,icns,jxr,psd,indd,zip,tar,rar,gz,bz2,7z,dmg,mp4,mid,mkv,webm,mov,avi,mpg,mp2,mp3,m4a,oga,ogg,ogv,opus,flac,wav,spx,amr,pdf,epub,elf,macho,exe,swf,rtf,wasm,woff,woff2,eot,ttf,otf,ttc,ico,flv,ps,xz,sqlite,nes,crx,xpi,cab,deb,ar,rpm,Z,lz,cfb,mxf,mts,blend,bpg,docx,pptx,xlsx,3gp,3g2,j2c,jp2,jpm,jpx,mj2,aif,qcp,odt,ods,odp,xml,mobi,heic,cur,ktx,ape,wv,dcm,ics,glb,pcap,dsf,lnk,alias,voc,ac3,m4v,m4p,m4b,f4v,f4p,f4b,f4a,mie,asf,ogm,ogx,mpc,arrow,shp,aac,mp1,it,s3m,xm,skp,avif,eps,lzh,pgp,asar,stl,chm,3mf,zst,jxl,vcf,jls,pst,dwg,parquet,class,arj,cpio,ace,avro,icc,fbx,vsdx,vtt,apk,drc,lz4,potx,xltx,dotx,xltm,ott,ots,otp,odg,otg,xlsm,docm,dotm,potm,pptm,jar,jmp,rm,sav,ppsm,ppsx,tar.gz,reg,dat`.split(`,`),Ve=`image/jpeg,image/png,image/gif,image/webp,image/flif,image/x-xcf,image/x-canon-cr2,image/x-canon-cr3,image/tiff,image/bmp,image/vnd.ms-photo,image/vnd.adobe.photoshop,application/x-indesign,application/epub+zip,application/x-xpinstall,application/vnd.ms-powerpoint.slideshow.macroenabled.12,application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.presentation,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.slideshow,application/zip,application/x-tar,application/x-rar-compressed,application/gzip,application/x-bzip2,application/x-7z-compressed,application/x-apple-diskimage,application/vnd.apache.arrow.file,video/mp4,audio/midi,video/matroska,video/webm,video/quicktime,video/vnd.avi,audio/wav,audio/qcelp,audio/x-ms-asf,video/x-ms-asf,application/vnd.ms-asf,video/mpeg,video/3gpp,audio/mpeg,audio/mp4,video/ogg,audio/ogg,audio/ogg; codecs=opus,application/ogg,audio/flac,audio/ape,audio/wavpack,audio/amr,application/pdf,application/x-elf,application/x-mach-binary,application/x-msdownload,application/x-shockwave-flash,application/rtf,application/wasm,font/woff,font/woff2,application/vnd.ms-fontobject,font/ttf,font/otf,font/collection,image/x-icon,video/x-flv,application/postscript,application/eps,application/x-xz,application/x-sqlite3,application/x-nintendo-nes-rom,application/x-google-chrome-extension,application/vnd.ms-cab-compressed,application/x-deb,application/x-unix-archive,application/x-rpm,application/x-compress,application/x-lzip,application/x-cfb,application/x-mie,application/mxf,video/mp2t,application/x-blender,image/bpg,image/j2c,image/jp2,image/jpx,image/jpm,image/mj2,audio/aiff,application/xml,application/x-mobipocket-ebook,image/heif,image/heif-sequence,image/heic,image/heic-sequence,image/icns,image/ktx,application/dicom,audio/x-musepack,text/calendar,text/vcard,text/vtt,model/gltf-binary,application/vnd.tcpdump.pcap,audio/x-dsf,application/x.ms.shortcut,application/x.apple.alias,audio/x-voc,audio/vnd.dolby.dd-raw,audio/x-m4a,image/apng,image/x-olympus-orf,image/x-sony-arw,image/x-adobe-dng,image/x-nikon-nef,image/x-panasonic-rw2,image/x-fujifilm-raf,video/x-m4v,video/3gpp2,application/x-esri-shape,audio/aac,audio/x-it,audio/x-s3m,audio/x-xm,video/MP1S,video/MP2P,application/vnd.sketchup.skp,image/avif,application/x-lzh-compressed,application/pgp-encrypted,application/x-asar,model/stl,application/vnd.ms-htmlhelp,model/3mf,image/jxl,application/zstd,image/jls,application/vnd.ms-outlook,image/vnd.dwg,application/vnd.apache.parquet,application/java-vm,application/x-arj,application/x-cpio,application/x-ace-compressed,application/avro,application/vnd.iccprofile,application/x.autodesk.fbx,application/vnd.visio,application/vnd.android.package-archive,application/vnd.google.draco,application/x-lz4,application/vnd.openxmlformats-officedocument.presentationml.template,application/vnd.openxmlformats-officedocument.spreadsheetml.template,application/vnd.openxmlformats-officedocument.wordprocessingml.template,application/vnd.ms-excel.template.macroenabled.12,application/vnd.oasis.opendocument.text-template,application/vnd.oasis.opendocument.spreadsheet-template,application/vnd.oasis.opendocument.presentation-template,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.graphics-template,application/vnd.ms-excel.sheet.macroenabled.12,application/vnd.ms-word.document.macroenabled.12,application/vnd.ms-word.template.macroenabled.12,application/vnd.ms-powerpoint.template.macroenabled.12,application/vnd.ms-powerpoint.presentation.macroenabled.12,application/java-archive,application/vnd.rn-realmedia,application/x-spss-sav,application/x-ms-regedit,application/x-ft-windows-registry-hive,application/x-jmp-data`.split(`,`),P=4100,He=P-2,F=1024*1024,I=1024,Ue=2**31-1,L=16*1024*1024,R=F,z=F,We=L,Ge=1,B=100,V=L,H=64,U=R,Ke=256,qe=512,Je=L,Ye=512,Xe=512,W=256,G=R,Ze=R,Qe=R,$e=L,et=new Set([`Unexpected signature`,`Encrypted ZIP`,`Expected Central-File-Header signature`]),tt=[`ZIP entry count exceeds `,`Unsupported ZIP compression method:`,`ZIP entry compressed data exceeds `,`ZIP entry decompressed data exceeds `,`Expected data-descriptor-signature at position `],nt=new Set([`Z_BUF_ERROR`,`Z_DATA_ERROR`,`ERR_INVALID_STATE`]),K=class extends Error{};function rt(e){let t=e?.streamReader;if(t?.constructor?.name!==`WebStreamByobReader`)return e;let{reader:n}=t,r=async()=>{await n.cancel(),n.releaseLock()};return t.close=r,t.abort=async()=>{t.interrupted=!0,await r()},e}function q(e,t,n){if(!Number.isFinite(e)||e<0||e>t)throw new K(`${n} has invalid size ${e} (maximum ${t} bytes)`);return e}async function J(e,t,{maximumLength:n=L,reason:r=`skip`}={}){let i=q(t,n,r);await e.ignore(i)}async function Y(e,t,n,{maximumLength:r=t.length,reason:i=`read`}={}){let a=q(n?.length??t.length,r,i);return e.readBuffer(t,{...n,length:a})}async function it(e,{maximumLength:t=F}={}){let n=new ReadableStream({start(t){t.enqueue(e),t.close()}}).pipeThrough(new DecompressionStream(`deflate-raw`)).getReader(),r=[],i=0;try{for(;;){let{done:e,value:a}=await n.read();if(e)break;if(i+=a.length,i>t)throw await n.cancel(),Error(`ZIP entry decompressed data exceeds ${t} bytes`);r.push(a)}}finally{n.releaseLock()}let a=new Uint8Array(i),o=0;for(let e of r)a.set(e,o),o+=e.length;return a}var at=134695760,X=16,ot=X-1;function st(e,t){if(e.length<X)return-1;let n=e.length-X;for(let r=0;r<=n;r++)if(E.get(e,r)===at&&E.get(e,r+8)===t+r)return r;return-1}function ct(e){return(e.codePointAt(0)&32)!=0}function lt(e,t){let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function ut(e,{shouldBuffer:t,maximumLength:n=F}={}){let{syncBuffer:r}=e,{length:i}=r,a=[],o=0;for(;;){let s=await e.tokenizer.peekBuffer(r,{mayBeLess:!0}),c=st(r.subarray(0,s),o),l=c>=0?0:s===i?Math.min(ot,s-1):0,u=c>=0?c:s-l;if(u===0)break;if(o+=u,o>n)throw Error(`ZIP entry compressed data exceeds ${n} bytes`);if(t){let t=new Uint8Array(u);await e.tokenizer.readBuffer(t),a.push(t)}else await e.tokenizer.ignore(u);if(c>=0)break}if(Q(e.tokenizer)||(e.knownSizeDescriptorScannedBytes+=o),t)return lt(a,o)}function dt(e,t){return Q(e.tokenizer)?Math.max(0,L-(e.tokenizer.position-t)):Math.max(0,F-e.knownSizeDescriptorScannedBytes)}async function ft(e,t,{shouldBuffer:n,maximumDescriptorLength:r=F}={}){if(t.dataDescriptor&&t.compressedSize===0)return ut(e,{shouldBuffer:n,maximumLength:r});if(!n){await J(e.tokenizer,t.compressedSize,{maximumLength:Q(e.tokenizer)?F:e.tokenizer.fileInfo.size,reason:`ZIP entry compressed data`});return}let i=bt(e.tokenizer);if(!Number.isFinite(t.compressedSize)||t.compressedSize<0||t.compressedSize>i)throw Error(`ZIP entry compressed data exceeds ${i} bytes`);let a=new Uint8Array(t.compressedSize);return await e.tokenizer.readBuffer(a),a}N.prototype.inflate=async function(e,t,n){if(e.compressedMethod===0)return n(t);if(e.compressedMethod!==8)throw Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);return n(await it(t,{maximumLength:F}))},N.prototype.unzip=async function(e){let t=!1,n=0,r=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if($(this.tokenizer,r,L))throw new K(`ZIP stream probing exceeds ${L} bytes`);let i=await this.readLocalFileHeader();if(!i)break;if(n++,n>I)throw Error(`ZIP entry count exceeds ${I}`);let a=e(i);t=!!a.stop,await this.tokenizer.ignore(i.extraFieldLength);let o=await ft(this,i,{shouldBuffer:!!a.handler,maximumDescriptorLength:Math.min(F,dt(this,r))});if(a.handler&&await this.inflate(i,o,a.handler),i.dataDescriptor){let e=new Uint8Array(X);if(await this.tokenizer.readBuffer(e),E.get(e,0)!==at)throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-e.length}`)}if($(this.tokenizer,r,L))throw new K(`ZIP stream probing exceeds ${L} bytes`)}while(!t)};function pt(e,t){let n=e.getReader(),r=0,i=!1,a=!1,o=async e=>{i||a||(a=!0,await n.cancel(e))};return new ReadableStream({async pull(e){if(r>=t){e.close(),await o();return}let{done:a,value:s}=await n.read();if(a||!s){i=!0,e.close();return}let c=t-r;if(s.length>c){e.enqueue(s.subarray(0,c)),r+=c,e.close(),await o();return}e.enqueue(s),r+=s.length},async cancel(e){await o(e)}})}async function mt(e,t){return new Dt(t).fromBuffer(e)}function ht(e){switch(e=e.toLowerCase(),e){case`application/epub+zip`:return{ext:`epub`,mime:e};case`application/vnd.oasis.opendocument.text`:return{ext:`odt`,mime:e};case`application/vnd.oasis.opendocument.text-template`:return{ext:`ott`,mime:e};case`application/vnd.oasis.opendocument.spreadsheet`:return{ext:`ods`,mime:e};case`application/vnd.oasis.opendocument.spreadsheet-template`:return{ext:`ots`,mime:e};case`application/vnd.oasis.opendocument.presentation`:return{ext:`odp`,mime:e};case`application/vnd.oasis.opendocument.presentation-template`:return{ext:`otp`,mime:e};case`application/vnd.oasis.opendocument.graphics`:return{ext:`odg`,mime:e};case`application/vnd.oasis.opendocument.graphics-template`:return{ext:`otg`,mime:e};case`application/vnd.openxmlformats-officedocument.presentationml.slideshow`:return{ext:`ppsx`,mime:e};case`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`:return{ext:`xlsx`,mime:e};case`application/vnd.ms-excel.sheet.macroenabled`:return{ext:`xlsm`,mime:`application/vnd.ms-excel.sheet.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.spreadsheetml.template`:return{ext:`xltx`,mime:e};case`application/vnd.ms-excel.template.macroenabled`:return{ext:`xltm`,mime:`application/vnd.ms-excel.template.macroenabled.12`};case`application/vnd.ms-powerpoint.slideshow.macroenabled`:return{ext:`ppsm`,mime:`application/vnd.ms-powerpoint.slideshow.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.wordprocessingml.document`:return{ext:`docx`,mime:e};case`application/vnd.ms-word.document.macroenabled`:return{ext:`docm`,mime:`application/vnd.ms-word.document.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.wordprocessingml.template`:return{ext:`dotx`,mime:e};case`application/vnd.ms-word.template.macroenabledtemplate`:return{ext:`dotm`,mime:`application/vnd.ms-word.template.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.presentationml.template`:return{ext:`potx`,mime:e};case`application/vnd.ms-powerpoint.template.macroenabled`:return{ext:`potm`,mime:`application/vnd.ms-powerpoint.template.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.presentationml.presentation`:return{ext:`pptx`,mime:e};case`application/vnd.ms-powerpoint.presentation.macroenabled`:return{ext:`pptm`,mime:`application/vnd.ms-powerpoint.presentation.macroenabled.12`};case`application/vnd.ms-visio.drawing`:return{ext:`vsdx`,mime:`application/vnd.visio`};case`application/vnd.ms-package.3dmanufacturing-3dmodel+xml`:return{ext:`3mf`,mime:`model/3mf`};default:}}function Z(e,t,n){n={offset:0,...n};for(let[r,i]of t.entries())if(n.mask){if(i!==(n.mask[r]&e[r+n.offset]))return!1}else if(i!==e[r+n.offset])return!1;return!0}function gt(e){return Number.isFinite(e)?Math.max(1,Math.trunc(e)):P}function _t(e,t,n){return n===void 0?e.read(t):(n.throwIfAborted(),new Promise((r,i)=>{let a=()=>{n.removeEventListener(`abort`,o)},o=()=>{let t=n.reason;a(),(async()=>{try{await e.cancel(t)}catch{}})(),i(t)};n.addEventListener(`abort`,o,{once:!0}),(async()=>{try{let n=await e.read(t);a(),r(n)}catch(e){a(),i(e)}})()}))}function vt(e){return Number.isFinite(e)?Math.max(0,Math.min(He,Math.trunc(e))):0}function yt(e){return Number.isFinite(e)?Math.max(0,e):2**53-1}function Q(e){let t=e.fileInfo.size;return!Number.isFinite(t)||t===2**53-1}function $(e,t,n){return Q(e)&&e.position-t>n}function bt(e){let t=e.fileInfo.size,n=Number.isFinite(t)?Math.max(0,t-e.position):2**53-1;return Math.min(n,Ue)}function xt(e){if(e instanceof g||e instanceof K)return!0;if(!(e instanceof Error))return!1;if(et.has(e.message)||nt.has(e.code))return!0;for(let t of tt)if(e.message.startsWith(t))return!0;return!1}function St(e,t=F){let n=[e.compressedSize,e.uncompressedSize];for(let e of n)if(!Number.isFinite(e)||e<0||e>t)return!1;return!0}function Ct(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function wt(e,t){t.startsWith(`word/`)&&(e.hasWordDirectory=!0),t.startsWith(`ppt/`)&&(e.hasPresentationDirectory=!0),t.startsWith(`xl/`)&&(e.hasSpreadsheetDirectory=!0),t.startsWith(`3D/`)&&t.endsWith(`.model`)&&(e.hasThreeDimensionalModelEntry=!0)}function Tt(e){if(!(!e.hasContentTypesEntry||e.hasUnparseableContentTypes||e.isParsingContentTypes||e.hasParsedContentTypesEntry)){if(e.hasWordDirectory)return{ext:`docx`,mime:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`};if(e.hasPresentationDirectory)return{ext:`pptx`,mime:`application/vnd.openxmlformats-officedocument.presentationml.presentation`};if(e.hasSpreadsheetDirectory)return{ext:`xlsx`,mime:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`};if(e.hasThreeDimensionalModelEntry)return{ext:`3mf`,mime:`model/3mf`}}}function Et(e){let t=e.indexOf(`.main+xml"`);if(t===-1){let t=`application/vnd.ms-package.3dmanufacturing-3dmodel+xml`;return e.includes(`ContentType="${t}"`)?t:void 0}let n=e.slice(0,t),r=n.lastIndexOf(`"`);return n.slice(r+1)}var Dt=class e{constructor(e){let t=vt(e?.mpegOffsetTolerance);this.options={...e,mpegOffsetTolerance:t},this.detectors=[...this.options.customDetectors??[],{id:`core`,detect:this.detectConfident},{id:`core.imprecise`,detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(e){return rt(ue(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let n=e.position;for(let t of this.detectors){let r;try{r=await t.detect(e)}catch(e){if(e instanceof g||e instanceof K)return;throw e}if(r)return r;if(n!==e.position)return}}async fromTokenizer(e){try{return await this.parseTokenizer(e)}finally{await e.close()}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(de(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=fe(e,this.getTokenizerOptions());return this.fromTokenizer(t)}async fromStream(e){this.options.signal?.throwIfAborted();let t=this.createTokenizerFromWebStream(e);return this.fromTokenizer(t)}async toDetectionStream(e,t){let n=gt(t?.sampleSize??P),r,i,a=e.getReader({mode:`byob`});try{let{value:e,done:t}=await _t(a,new Uint8Array(n),this.options.signal);if(i=e,!t&&e)try{r=await this.fromBuffer(e.subarray(0,n))}catch(e){if(!(e instanceof g))throw e;r=void 0}i=e}finally{a.releaseLock()}let o=new TransformStream({async start(e){e.enqueue(i)},transform(e,t){t.enqueue(e)}}),s=e.pipeThrough(o);return s.fileType=r,s}async detectGzip(t){if(this.gzipProbeDepth>=Ge)return{ext:`gz`,mime:`application/gzip`};let n=pt(new Fe(t).inflate(),We),r=Q(t),i,a,o,s;if(r){let t=new AbortController;i=setTimeout(()=>{t.abort(new DOMException(`Operation timed out after ${B} ms`,`TimeoutError`))},B),a=this.options.signal===void 0?t.signal:AbortSignal.any([this.options.signal,t.signal]),o=new e({...this.options,signal:a}),o.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{s=await(o??this).fromStream(n)}catch(e){if(e?.name===`AbortError`&&a?.reason?.name!==`TimeoutError`)throw e}finally{clearTimeout(i),r||this.gzipProbeDepth--}return s?.ext===`tar`?{ext:`tar.gz`,mime:`application/gzip`}:{ext:`gz`,mime:`application/gzip`}}check(e,t){return Z(this.buffer,e,t)}checkString(e,t){return this.check(Le(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(P),e.fileInfo.size===void 0&&(e.fileInfo.size=2**53-1),this.tokenizer=e,Q(e)&&(await e.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(e);if(await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:`bmp`,mime:`image/bmp`};if(this.check([11,119]))return{ext:`ac3`,mime:`audio/vnd.dolby.dd-raw`};if(this.check([120,1]))return{ext:`dmg`,mime:`application/x-apple-diskimage`};if(this.check([77,90]))return{ext:`exe`,mime:`application/x-msdownload`};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString(`PS-Adobe-`,{offset:2})&&this.checkString(` EPSF-`,{offset:14})?{ext:`eps`,mime:`application/eps`}:{ext:`ps`,mime:`application/postscript`};if(this.check([31,160])||this.check([31,157]))return{ext:`Z`,mime:`application/x-compress`};if(this.check([199,113]))return{ext:`cpio`,mime:`application/x-cpio`};if(this.check([96,234]))return{ext:`arj`,mime:`application/x-arj`};if(this.check([239,187,191]))return this.detectionReentryCount>=W?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(e));if(this.check([71,73,70]))return{ext:`gif`,mime:`image/gif`};if(this.check([73,73,188]))return{ext:`jxr`,mime:`image/vnd.ms-photo`};if(this.check([31,139,8]))return this.detectGzip(e);if(this.check([66,90,104]))return{ext:`bz2`,mime:`application/x-bzip2`};if(this.checkString(`ID3`)){await J(e,6,{maximumLength:6,reason:`ID3 header prefix`});let t=await e.readToken(ze),n=Q(e);if(!Number.isFinite(t)||t<0||n&&(t>V||e.position+t>V))return;if(e.position+t>e.fileInfo.size)return n?void 0:{ext:`mp3`,mime:`audio/mpeg`};try{await J(e,t,{maximumLength:n?V:e.fileInfo.size,reason:`ID3 payload`})}catch(e){if(e instanceof g)return;throw e}return this.detectionReentryCount>=W?void 0:(this.detectionReentryCount++,this.parseTokenizer(e,this.detectionReentryCount))}if(this.checkString(`MP+`))return{ext:`mpc`,mime:`audio/x-musepack`};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:`swf`,mime:`application/x-shockwave-flash`};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:`jls`,mime:`image/jls`}:{ext:`jpg`,mime:`image/jpeg`};if(this.check([79,98,106,1]))return{ext:`avro`,mime:`application/avro`};if(this.checkString(`FLIF`))return{ext:`flif`,mime:`image/flif`};if(this.checkString(`8BPS`))return{ext:`psd`,mime:`image/vnd.adobe.photoshop`};if(this.checkString(`MPCK`))return{ext:`mpc`,mime:`audio/x-musepack`};if(this.checkString(`FORM`))return{ext:`aif`,mime:`audio/aiff`};if(this.checkString(`icns`,{offset:0}))return{ext:`icns`,mime:`image/icns`};if(this.check([80,75,3,4])){let t,n=Ct();try{await new N(e).unzip(e=>{wt(n,e.filename);let r=e.filename===`[Content_Types].xml`,i=Tt(n);if(!r&&i)return t=i,{stop:!0};switch(e.filename){case`META-INF/mozilla.rsa`:return t={ext:`xpi`,mime:`application/x-xpinstall`},{stop:!0};case`META-INF/MANIFEST.MF`:return t={ext:`jar`,mime:`application/java-archive`},{stop:!0};case`mimetype`:return St(e,z)?{async handler(e){t=ht(new TextDecoder(`utf-8`).decode(e).trim())},stop:!0}:{};case`[Content_Types].xml`:return n.hasContentTypesEntry=!0,St(e,z)?(n.isParsingContentTypes=!0,{async handler(e){let r=Et(new TextDecoder(`utf-8`).decode(e));r&&(t=ht(r)),n.hasParsedContentTypesEntry=!0,n.isParsingContentTypes=!1},stop:!0}):(n.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(e.filename)?(t={ext:`apk`,mime:`application/vnd.android.package-archive`},{stop:!0}):{}}})}catch(e){if(!xt(e))throw e;n.isParsingContentTypes&&(n.isParsingContentTypes=!1,n.hasUnparseableContentTypes=!0)}return t??Tt(n)??{ext:`zip`,mime:`application/zip`}}if(this.checkString(`OggS`)){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),Z(t,[79,112,117,115,72,101,97,100])?{ext:`opus`,mime:`audio/ogg; codecs=opus`}:Z(t,[128,116,104,101,111,114,97])?{ext:`ogv`,mime:`video/ogg`}:Z(t,[1,118,105,100,101,111,0])?{ext:`ogm`,mime:`video/ogg`}:Z(t,[127,70,76,65,67])?{ext:`oga`,mime:`audio/ogg`}:Z(t,[83,112,101,101,120,32,32])?{ext:`spx`,mime:`audio/ogg`}:Z(t,[1,118,111,114,98,105,115])?{ext:`ogg`,mime:`audio/ogg`}:{ext:`ogx`,mime:`application/ogg`}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:`zip`,mime:`application/zip`};if(this.checkString(`MThd`))return{ext:`mid`,mime:`audio/midi`};if(this.checkString(`wOFF`)&&(this.check([0,1,0,0],{offset:4})||this.checkString(`OTTO`,{offset:4})))return{ext:`woff`,mime:`font/woff`};if(this.checkString(`wOF2`)&&(this.check([0,1,0,0],{offset:4})||this.checkString(`OTTO`,{offset:4})))return{ext:`woff2`,mime:`font/woff2`};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:`pcap`,mime:`application/vnd.tcpdump.pcap`};if(this.checkString(`DSD `))return{ext:`dsf`,mime:`audio/x-dsf`};if(this.checkString(`LZIP`))return{ext:`lz`,mime:`application/x-lzip`};if(this.checkString(`fLaC`))return{ext:`flac`,mime:`audio/flac`};if(this.check([66,80,71,251]))return{ext:`bpg`,mime:`image/bpg`};if(this.checkString(`wvpk`))return{ext:`wv`,mime:`audio/wavpack`};if(this.checkString(`%PDF`))return{ext:`pdf`,mime:`application/pdf`};if(this.check([0,97,115,109]))return{ext:`wasm`,mime:`application/wasm`};if(this.check([73,73])){let e=await this.readTiffHeader(!1);if(e)return e}if(this.check([77,77])){let e=await this.readTiffHeader(!0);if(e)return e}if(this.checkString(`MAC `))return{ext:`ape`,mime:`audio/ape`};if(this.check([26,69,223,163])){async function t(){let t=await e.peekNumber(Ce),n=128,r=0;for(;(t&n)===0&&n!==0;)++r,n>>=1;let i=new Uint8Array(r+1);return await Y(e,i,void 0,{maximumLength:i.length,reason:`EBML field`}),i}async function n(){let e=await t(),n=await t();n[0]^=128>>n.length-1;let r=Math.min(6,n.length),i=new DataView(e.buffer),a=new DataView(n.buffer,n.length-r,r);return{id:Ie(i),len:Ie(a)}}async function r(t){let r=0;for(;t>0;){if(r++,r>Ke||$(e,a,L))return;let i=e.position,o=await n();if(o.id===17026){if(o.len>H)return;let t=q(o.len,H,`EBML DocType`);return(await e.readToken(new D(t))).replaceAll(/\00.*$/g,``)}if(Q(e)&&(!Number.isFinite(o.len)||o.len<0||o.len>U)||(await J(e,o.len,{maximumLength:Q(e)?U:e.fileInfo.size,reason:`EBML payload`}),--t,e.position<=i))return}}let i=await n(),a=e.position;switch(await r(i.len)){case`webm`:return{ext:`webm`,mime:`video/webm`};case`matroska`:return{ext:`mkv`,mime:`video/matroska`};default:return}}if(this.checkString(`SQLi`))return{ext:`sqlite`,mime:`application/x-sqlite3`};if(this.check([78,69,83,26]))return{ext:`nes`,mime:`application/x-nintendo-nes-rom`};if(this.checkString(`Cr24`))return{ext:`crx`,mime:`application/x-google-chrome-extension`};if(this.checkString(`MSCF`)||this.checkString(`ISc(`))return{ext:`cab`,mime:`application/vnd.ms-cab-compressed`};if(this.check([237,171,238,219]))return{ext:`rpm`,mime:`application/x-rpm`};if(this.check([197,208,211,198]))return{ext:`eps`,mime:`application/eps`};if(this.check([40,181,47,253]))return{ext:`zst`,mime:`application/zstd`};if(this.check([127,69,76,70]))return{ext:`elf`,mime:`application/x-elf`};if(this.check([33,66,68,78]))return{ext:`pst`,mime:`application/vnd.ms-outlook`};if(this.checkString(`PAR1`)||this.checkString(`PARE`))return{ext:`parquet`,mime:`application/vnd.apache.parquet`};if(this.checkString(`ttcf`))return{ext:`ttc`,mime:`font/collection`};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:`macho`,mime:`application/x-mach-binary`};if(this.check([4,34,77,24]))return{ext:`lz4`,mime:`application/x-lz4`};if(this.checkString(`regf`))return{ext:`dat`,mime:`application/x-ft-windows-registry-hive`};if(this.checkString(`$FL2`)||this.checkString(`$FL3`))return{ext:`sav`,mime:`application/x-spss-sav`};if(this.check([79,84,84,79,0]))return{ext:`otf`,mime:`font/otf`};if(this.checkString(`#!AMR`))return{ext:`amr`,mime:`audio/amr`};if(this.checkString(`{\\rtf`))return{ext:`rtf`,mime:`application/rtf`};if(this.check([70,76,86,1]))return{ext:`flv`,mime:`video/x-flv`};if(this.checkString(`IMPM`))return{ext:`it`,mime:`audio/x-it`};if(this.checkString(`-lh0-`,{offset:2})||this.checkString(`-lh1-`,{offset:2})||this.checkString(`-lh2-`,{offset:2})||this.checkString(`-lh3-`,{offset:2})||this.checkString(`-lh4-`,{offset:2})||this.checkString(`-lh5-`,{offset:2})||this.checkString(`-lh6-`,{offset:2})||this.checkString(`-lh7-`,{offset:2})||this.checkString(`-lzs-`,{offset:2})||this.checkString(`-lz4-`,{offset:2})||this.checkString(`-lz5-`,{offset:2})||this.checkString(`-lhd-`,{offset:2}))return{ext:`lzh`,mime:`application/x-lzh-compressed`};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:`mpg`,mime:`video/MP1S`};if(this.check([68],{offset:4,mask:[196]}))return{ext:`mpg`,mime:`video/MP2P`}}if(this.checkString(`ITSF`))return{ext:`chm`,mime:`application/vnd.ms-htmlhelp`};if(this.check([202,254,186,190])){let e=we.get(this.buffer,4),t=T.get(this.buffer,6);if(e>0&&e<=30)return{ext:`macho`,mime:`application/x-mach-binary`};if(t>30)return{ext:`class`,mime:`application/java-vm`}}if(this.checkString(`.RMF`))return{ext:`rm`,mime:`application/vnd.rn-realmedia`};if(this.checkString(`DRACO`))return{ext:`drc`,mime:`application/vnd.google.draco`};if(this.check([253,55,122,88,90,0]))return{ext:`xz`,mime:`application/x-xz`};if(this.checkString(`<?xml `))return{ext:`xml`,mime:`application/xml`};if(this.check([55,122,188,175,39,28]))return{ext:`7z`,mime:`application/x-7z-compressed`};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:`rar`,mime:`application/x-rar-compressed`};if(this.checkString(`solid `))return{ext:`stl`,mime:`model/stl`};if(this.checkString(`AC`)){let e=new D(4,`latin1`).get(this.buffer,2);if(e.match(`^d*`)&&e>=1e3&&e<=1050)return{ext:`dwg`,mime:`image/vnd.dwg`}}if(this.checkString(`070707`))return{ext:`cpio`,mime:`application/x-cpio`};if(this.checkString(`BLENDER`))return{ext:`blend`,mime:`application/x-blender`};if(this.checkString(`!<arch>`))return await e.ignore(8),await e.readToken(new D(13,`ascii`))===`debian-binary`?{ext:`deb`,mime:`application/x-deb`}:{ext:`ar`,mime:`application/x-unix-archive`};if(this.checkString(`WEBVTT`)&&[`
6
+ `,`\r`,` `,` `,`\0`].some(e=>this.checkString(e,{offset:6})))return{ext:`vtt`,mime:`text/vtt`};if(this.check([137,80,78,71,13,10,26,10])){let t={ext:`png`,mime:`image/png`},n={ext:`apng`,mime:`image/apng`};await e.ignore(8);async function r(){return{length:await e.readToken(Te),type:await e.readToken(new D(4,`latin1`))}}let i=Q(e),a=e.position,o=0,s=!1;do{if(o++,o>qe||$(e,a,Je))break;let c=e.position,l=await r();if(l.length<0)return;if(l.type===`IHDR`){if(l.length!==13)return;s=!0}switch(l.type){case`IDAT`:return t;case`acTL`:return n;default:if(!s&&l.type!==`CgBI`)return;if(i&&l.length>G)return s&&ct(l.type)?t:void 0;try{await J(e,l.length+4,{maximumLength:i?G+4:e.fileInfo.size,reason:`PNG chunk payload`})}catch(e){if(!i&&(e instanceof K||e instanceof g))return t;throw e}}if(e.position<=c)break}while(e.position+8<e.fileInfo.size);return t}if(this.check([65,82,82,79,87,49,0,0]))return{ext:`arrow`,mime:`application/vnd.apache.arrow.file`};if(this.check([103,108,84,70,2,0,0,0]))return{ext:`glb`,mime:`model/gltf-binary`};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:`mov`,mime:`video/quicktime`};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:`orf`,mime:`image/x-olympus-orf`};if(this.checkString(`gimp xcf `))return{ext:`xcf`,mime:`image/x-xcf`};if(this.checkString(`ftyp`,{offset:4})&&this.buffer[8]&96){let e=new D(4,`latin1`).get(this.buffer,8).replace(`\0`,` `).trim();switch(e){case`avif`:case`avis`:return{ext:`avif`,mime:`image/avif`};case`mif1`:return{ext:`heic`,mime:`image/heif`};case`msf1`:return{ext:`heic`,mime:`image/heif-sequence`};case`heic`:case`heix`:return{ext:`heic`,mime:`image/heic`};case`hevc`:case`hevx`:return{ext:`heic`,mime:`image/heic-sequence`};case`qt`:return{ext:`mov`,mime:`video/quicktime`};case`M4V`:case`M4VH`:case`M4VP`:return{ext:`m4v`,mime:`video/x-m4v`};case`M4P`:return{ext:`m4p`,mime:`video/mp4`};case`M4B`:return{ext:`m4b`,mime:`audio/mp4`};case`M4A`:return{ext:`m4a`,mime:`audio/x-m4a`};case`F4V`:return{ext:`f4v`,mime:`video/mp4`};case`F4P`:return{ext:`f4p`,mime:`video/mp4`};case`F4A`:return{ext:`f4a`,mime:`audio/mp4`};case`F4B`:return{ext:`f4b`,mime:`audio/mp4`};case`crx`:return{ext:`cr3`,mime:`image/x-canon-cr3`};default:return e.startsWith(`3g`)?e.startsWith(`3g2`)?{ext:`3g2`,mime:`video/3gpp2`}:{ext:`3gp`,mime:`video/3gpp`}:{ext:`mp4`,mime:`video/mp4`}}}if(this.checkString(`REGEDIT4\r
7
+ `))return{ext:`reg`,mime:`application/x-ms-regedit`};if(this.check([82,73,70,70])){if(this.checkString(`WEBP`,{offset:8}))return{ext:`webp`,mime:`image/webp`};if(this.check([65,86,73],{offset:8}))return{ext:`avi`,mime:`video/vnd.avi`};if(this.check([87,65,86,69],{offset:8}))return{ext:`wav`,mime:`audio/wav`};if(this.check([81,76,67,77],{offset:8}))return{ext:`qcp`,mime:`audio/qcelp`}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:`rw2`,mime:`image/x-panasonic-rw2`};if(this.check([48,38,178,117,142,102,207,17,166,217])){let t=!1;try{async function n(){let t=new Uint8Array(16);return await Y(e,t,void 0,{maximumLength:t.length,reason:`ASF header GUID`}),{id:t,size:Number(await e.readToken(Ee))}}await J(e,30,{maximumLength:30,reason:`ASF header prelude`});let r=Q(e),i=e.position,a=0;for(;e.position+24<e.fileInfo.size&&(a++,!(a>Ye||$(e,i,L)));){let i=e.position,a=await n(),o=a.size-24;if(!Number.isFinite(o)||o<0){t=!0;break}if(Z(a.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let t=new Uint8Array(16);if(o-=await Y(e,t,void 0,{maximumLength:t.length,reason:`ASF stream type GUID`}),Z(t,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:`asf`,mime:`audio/x-ms-asf`};if(Z(t,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:`asf`,mime:`video/x-ms-asf`};break}if(r&&o>Ze){t=!0;break}if(await J(e,o,{maximumLength:r?Ze:e.fileInfo.size,reason:`ASF header payload`}),e.position<=i){t=!0;break}}}catch(n){if(n instanceof g||n instanceof K)Q(e)&&(t=!0);else throw n}return t?void 0:{ext:`asf`,mime:`application/vnd.ms-asf`}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:`ktx`,mime:`image/ktx`};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:`mie`,mime:`application/x-mie`};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:`shp`,mime:`application/x-esri-shape`};if(this.check([255,79,255,81]))return{ext:`j2c`,mime:`image/j2c`};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new D(4,`ascii`))){case`jp2 `:return{ext:`jp2`,mime:`image/jp2`};case`jpx `:return{ext:`jpx`,mime:`image/jpx`};case`jpm `:return{ext:`jpm`,mime:`image/jpm`};case`mjp2`:return{ext:`mj2`,mime:`image/mj2`};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:`jxl`,mime:`image/jxl`};if(this.check([254,255]))return this.checkString(`<?xml `,{offset:2,encoding:`utf-16be`})?{ext:`xml`,mime:`application/xml`}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:`cfb`,mime:`application/x-cfb`};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:`icc`,mime:`application/vnd.iccprofile`};if(this.checkString(`**ACE`,{offset:7})&&this.checkString(`**`,{offset:12}))return{ext:`ace`,mime:`application/x-ace-compressed`};if(this.checkString(`BEGIN:`)){if(this.checkString(`VCARD`,{offset:6}))return{ext:`vcf`,mime:`text/vcard`};if(this.checkString(`VCALENDAR`,{offset:6}))return{ext:`ics`,mime:`text/calendar`}}if(this.checkString(`FUJIFILMCCD-RAW`))return{ext:`raf`,mime:`image/x-fujifilm-raf`};if(this.checkString(`Extended Module:`))return{ext:`xm`,mime:`audio/x-xm`};if(this.checkString(`Creative Voice File`))return{ext:`voc`,mime:`audio/x-voc`};if(this.check([4,0,0,0])&&this.buffer.length>=16){let e=new DataView(this.buffer.buffer).getUint32(12,!0);if(e>12&&this.buffer.length>=e+16)try{let t=new TextDecoder().decode(this.buffer.subarray(16,e+16));if(JSON.parse(t).files)return{ext:`asar`,mime:`application/x-asar`}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:`mxf`,mime:`application/mxf`};if(this.checkString(`SCRM`,{offset:44}))return{ext:`s3m`,mime:`audio/x-s3m`};if(this.check([71])&&this.check([71],{offset:188})||this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:`mts`,mime:`video/mp2t`};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:`mobi`,mime:`application/x-mobipocket-ebook`};if(this.check([68,73,67,77],{offset:128}))return{ext:`dcm`,mime:`application/dicom`};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:`lnk`,mime:`application/x.ms.shortcut`};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:`alias`,mime:`application/x.apple.alias`};if(this.checkString(`Kaydara FBX Binary \0`))return{ext:`fbx`,mime:`application/x.autodesk.fbx`};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:`eot`,mime:`application/vnd.ms-fontobject`};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:`indd`,mime:`application/x-indesign`};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:`jmp`,mime:`application/x-jmp-data`};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString(`ustar`,{offset:257})&&(this.checkString(`\0`,{offset:262})||this.checkString(` `,{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&Re(this.buffer))return{ext:`tar`,mime:`application/x-tar`};if(this.check([255,254])){let e=`utf-16le`;return this.checkString(`<?xml `,{offset:2,encoding:e})?{ext:`xml`,mime:`application/xml`}:this.check([255,14],{offset:2})&&this.checkString(`SketchUp Model`,{offset:4,encoding:e})?{ext:`skp`,mime:`application/vnd.sketchup.skp`}:this.checkString(`Windows Registry Editor Version 5.00\r
8
+ `,{offset:2,encoding:e})?{ext:`reg`,mime:`application/x-ms-regedit`}:void 0}if(this.checkString(`-----BEGIN PGP MESSAGE-----`))return{ext:`pgp`,mime:`application/pgp-encrypted`}};detectImprecise=async e=>{this.buffer=new Uint8Array(P);let t=yt(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:`mpg`,mime:`video/mpeg`};if(this.check([0,1,0,0,0]))return{ext:`ttf`,mime:`font/ttf`};if(this.check([0,0,1,0]))return{ext:`ico`,mime:`image/x-icon`};if(this.check([0,0,2,0]))return{ext:`cur`,mime:`image/x-icon`};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let e=0;e<=this.options.mpegOffsetTolerance;++e){let t=this.scanMpeg(e);if(t)return t}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?T:w);switch(await this.tokenizer.ignore(10),t){case 50341:return{ext:`arw`,mime:`image/x-sony-arw`};case 50706:return{ext:`dng`,mime:`image/x-adobe-dng`};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?T:w);if(!(t>Xe)&&!(Q(this.tokenizer)&&2+t*12>$e))for(let n=0;n<t;++n){let t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){let t={ext:`tif`,mime:`image/tiff`},n=(e?T:w).get(this.buffer,2),r=(e?we:E).get(this.buffer,4);if(n===42){if(r>=6){if(this.checkString(`CR`,{offset:8}))return{ext:`cr2`,mime:`image/x-canon-cr2`};if(r>=8){let t=(e?T:w).get(this.buffer,8),n=(e?T:w).get(this.buffer,10);if(t===28&&n===254||t===31&&n===11)return{ext:`nef`,mime:`image/x-nikon-nef`}}}if(Q(this.tokenizer)&&r>Qe)return t;let n=Q(this.tokenizer)?$e:this.tokenizer.fileInfo.size;try{await J(this.tokenizer,r,{maximumLength:n,reason:`TIFF IFD offset`})}catch(e){if(e instanceof g)return;throw e}let i;try{i=await this.readTiffIFD(e)}catch(e){if(e instanceof g)return;throw e}return i??t}if(n===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]}),{ext:`aac`,mime:`audio/aac`};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:`mp3`,mime:`audio/mpeg`};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:`mp2`,mime:`audio/mpeg`};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:`mp1`,mime:`audio/mpeg`}}}};new Set(Be),new Set(Ve);var Ot={name:`file`,summary:`determine file type`,usage:`file [OPTION]... FILE...`,options:[`-b, --brief do not prepend filenames to output`,`-i, --mime output MIME type strings`,`-L, --dereference follow symlinks`,` --help display this help and exit`]},kt=new Map([[`.js`,{description:`JavaScript source`,mime:`text/javascript`}],[`.mjs`,{description:`JavaScript module`,mime:`text/javascript`}],[`.cjs`,{description:`CommonJS module`,mime:`text/javascript`}],[`.ts`,{description:`TypeScript source`,mime:`text/typescript`}],[`.tsx`,{description:`TypeScript JSX source`,mime:`text/typescript`}],[`.jsx`,{description:`JavaScript JSX source`,mime:`text/javascript`}],[`.py`,{description:`Python script`,mime:`text/x-python`}],[`.rb`,{description:`Ruby script`,mime:`text/x-ruby`}],[`.go`,{description:`Go source`,mime:`text/x-go`}],[`.rs`,{description:`Rust source`,mime:`text/x-rust`}],[`.c`,{description:`C source`,mime:`text/x-c`}],[`.h`,{description:`C header`,mime:`text/x-c`}],[`.cpp`,{description:`C++ source`,mime:`text/x-c++`}],[`.hpp`,{description:`C++ header`,mime:`text/x-c++`}],[`.java`,{description:`Java source`,mime:`text/x-java`}],[`.sh`,{description:`Bourne-Again shell script`,mime:`text/x-shellscript`}],[`.bash`,{description:`Bourne-Again shell script`,mime:`text/x-shellscript`}],[`.zsh`,{description:`Zsh shell script`,mime:`text/x-shellscript`}],[`.json`,{description:`JSON data`,mime:`application/json`}],[`.yaml`,{description:`YAML data`,mime:`text/yaml`}],[`.yml`,{description:`YAML data`,mime:`text/yaml`}],[`.xml`,{description:`XML document`,mime:`application/xml`}],[`.csv`,{description:`CSV text`,mime:`text/csv`}],[`.toml`,{description:`TOML data`,mime:`text/toml`}],[`.html`,{description:`HTML document`,mime:`text/html`}],[`.htm`,{description:`HTML document`,mime:`text/html`}],[`.css`,{description:`CSS stylesheet`,mime:`text/css`}],[`.svg`,{description:`SVG image`,mime:`image/svg+xml`}],[`.md`,{description:`Markdown document`,mime:`text/markdown`}],[`.markdown`,{description:`Markdown document`,mime:`text/markdown`}],[`.txt`,{description:`ASCII text`,mime:`text/plain`}],[`.rst`,{description:`reStructuredText`,mime:`text/x-rst`}],[`.env`,{description:`ASCII text`,mime:`text/plain`}],[`.gitignore`,{description:`ASCII text`,mime:`text/plain`}],[`.dockerignore`,{description:`ASCII text`,mime:`text/plain`}]]),At=new Map([[`jpg`,`JPEG image data`],[`jpeg`,`JPEG image data`],[`png`,`PNG image data`],[`gif`,`GIF image data`],[`webp`,`WebP image data`],[`bmp`,`PC bitmap`],[`ico`,`MS Windows icon resource`],[`tif`,`TIFF image data`],[`tiff`,`TIFF image data`],[`psd`,`Adobe Photoshop Document`],[`avif`,`AVIF image`],[`heic`,`HEIC image`],[`heif`,`HEIF image`],[`jxl`,`JPEG XL image`],[`icns`,`Mac OS X icon`],[`svg`,`SVG Scalable Vector Graphics image`],[`pdf`,`PDF document`],[`epub`,`EPUB document`],[`mobi`,`Mobipocket E-book`],[`djvu`,`DjVu document`],[`zip`,`Zip archive data`],[`gz`,`gzip compressed data`],[`gzip`,`gzip compressed data`],[`bz2`,`bzip2 compressed data`],[`xz`,`XZ compressed data`],[`tar`,`POSIX tar archive`],[`rar`,`RAR archive data`],[`7z`,`7-zip archive data`],[`lz`,`lzip compressed data`],[`lzma`,`LZMA compressed data`],[`zst`,`Zstandard compressed data`],[`cab`,`Microsoft Cabinet archive`],[`ar`,`Unix ar archive`],[`rpm`,`RPM package`],[`deb`,`Debian binary package`],[`apk`,`Android Package`],[`dmg`,`Apple disk image`],[`iso`,`ISO 9660 CD-ROM filesystem data`],[`vhd`,`Microsoft Virtual Hard Disk`],[`vhdx`,`Microsoft Virtual Hard Disk (new format)`],[`qcow2`,`QEMU QCOW Image`],[`mp3`,`Audio file with ID3`],[`m4a`,`MPEG-4 audio`],[`aac`,`AAC audio`],[`wav`,`RIFF (little-endian) data, WAVE audio`],[`flac`,`FLAC audio bitstream data`],[`ogg`,`Ogg data`],[`oga`,`Ogg audio`],[`opus`,`Ogg Opus audio`],[`aiff`,`AIFF audio`],[`wma`,`Windows Media Audio`],[`amr`,`AMR audio`],[`mid`,`MIDI audio`],[`midi`,`MIDI audio`],[`ape`,`Monkey's Audio`],[`mp4`,`ISO Media, MPEG-4`],[`m4v`,`MPEG-4 video`],[`webm`,`WebM`],[`avi`,`RIFF (little-endian) data, AVI`],[`mov`,`ISO Media, Apple QuickTime movie`],[`mkv`,`Matroska data`],[`wmv`,`Windows Media Video`],[`flv`,`Flash Video`],[`3gp`,`3GPP multimedia`],[`3g2`,`3GPP2 multimedia`],[`ogv`,`Ogg video`],[`mts`,`MPEG transport stream`],[`m2ts`,`MPEG transport stream`],[`ts`,`MPEG transport stream`],[`mpg`,`MPEG video`],[`mpeg`,`MPEG video`],[`exe`,`PE32 executable`],[`dll`,`PE32 DLL`],[`elf`,`ELF executable`],[`mach`,`Mach-O executable`],[`wasm`,`WebAssembly (wasm) binary module`],[`dex`,`Android Dalvik executable`],[`class`,`Java class file`],[`swf`,`Adobe Flash`],[`doc`,`Microsoft Word Document`],[`docx`,`Microsoft Word 2007+ Document`],[`xls`,`Microsoft Excel Spreadsheet`],[`xlsx`,`Microsoft Excel 2007+ Spreadsheet`],[`ppt`,`Microsoft PowerPoint Presentation`],[`pptx`,`Microsoft PowerPoint 2007+ Presentation`],[`odt`,`OpenDocument Text`],[`ods`,`OpenDocument Spreadsheet`],[`odp`,`OpenDocument Presentation`],[`ttf`,`TrueType Font`],[`otf`,`OpenType Font`],[`woff`,`Web Open Font Format`],[`woff2`,`Web Open Font Format 2`],[`eot`,`Embedded OpenType font`],[`stl`,`Stereolithography CAD`],[`obj`,`Wavefront 3D Object`],[`gltf`,`GL Transmission Format`],[`glb`,`GL Transmission Format (binary)`],[`sqlite`,`SQLite 3.x database`],[`mdb`,`Microsoft Access Database`],[`xml`,`XML document`],[`json`,`JSON data`],[`macho`,`Mach-O binary`],[`ics`,`iCalendar data`],[`vcf`,`vCard data`],[`msi`,`Microsoft Installer`],[`ps`,`PostScript`],[`ai`,`Adobe Illustrator`],[`indd`,`Adobe InDesign`],[`sketch`,`Sketch design file`],[`fig`,`Figma design file`],[`xd`,`Adobe XD`],[`blend`,`Blender`],[`fbx`,`Autodesk FBX`],[`lnk`,`MS Windows shortcut`],[`alias`,`Mac OS alias`],[`torrent`,`BitTorrent file`],[`pcap`,`pcap capture file`],[`arrow`,`Apache Arrow`],[`parquet`,`Apache Parquet`]]);function jt(e,t){let n=At.get(e);if(n)return n;let[r,i]=t.split(`/`),a=i?.split(`+`)[0]?.replace(/-/g,` `)||e;switch(r){case`image`:return`${a.toUpperCase()} image data`;case`audio`:return`${a.toUpperCase()} audio`;case`video`:return`${a.toUpperCase()} video`;case`font`:return`${a} font`;case`model`:return`${a} 3D model`;case`application`:return i?.includes(`zip`)||i?.includes(`compressed`)?`${a} archive data`:i?.includes(`executable`)?`${a} executable`:`${e.toUpperCase()} data`;default:return`${e.toUpperCase()} data`}}function Mt(e){let t=e.split(`/`).pop()||e;if(t.startsWith(`.`)&&!t.includes(`.`,1))return t;let n=t.lastIndexOf(`.`);return n===-1||n===0?``:t.slice(n).toLowerCase()}function Nt(e,t){if(e.startsWith(`#!`)){let t=e.split(`
9
+ `)[0];return t.includes(`python`)?{description:`Python script, ASCII text executable`,mime:`text/x-python`}:t.includes(`node`)||t.includes(`bun`)||t.includes(`deno`)?{description:`JavaScript script, ASCII text executable`,mime:`text/javascript`}:t.includes(`bash`)?{description:`Bourne-Again shell script, ASCII text executable`,mime:`text/x-shellscript`}:t.includes(`sh`)?{description:`POSIX shell script, ASCII text executable`,mime:`text/x-shellscript`}:t.includes(`ruby`)?{description:`Ruby script, ASCII text executable`,mime:`text/x-ruby`}:t.includes(`perl`)?{description:`Perl script, ASCII text executable`,mime:`text/x-perl`}:{description:`script, ASCII text executable`,mime:`text/plain`}}let n=e.trimStart();if(n.startsWith(`<?xml`))return{description:`XML document`,mime:`application/xml`};if(n.startsWith(`<!DOCTYPE html`)||n.toLowerCase().startsWith(`<html`))return{description:`HTML document`,mime:`text/html`};let r=e.includes(`\r
10
+ `),i=e.includes(`\r`)&&!r,a=``;r?a=`, with CRLF line terminators`:i&&(a=`, with CR line terminators`);let o=Mt(t),s=o?kt.get(o):void 0;if(s)return s.mime.startsWith(`text/`)&&a?{description:`${s.description}${a}`,mime:s.mime}:s;let c=!1;for(let t=0;t<Math.min(e.length,8192);t++)if(e.charCodeAt(t)>127){c=!0;break}return c?{description:`UTF-8 Unicode text${a}`,mime:`text/plain; charset=utf-8`}:{description:`ASCII text${a}`,mime:`text/plain`}}async function Pt(e,t){if(t.length===0)return{description:`empty`,mime:`inode/x-empty`};let n=await mt(t);return n?{description:jt(n.ext,n.mime),mime:n.mime}:Nt(new TextDecoder(`utf-8`,{fatal:!1}).decode(t),e)}var Ft={name:`file`,async execute(e,t){if(a(e))return i(Ot);let n=!1,o=!1,s=[];for(let t of e)if(t.startsWith(`--`)){if(t===`--brief`)n=!0;else if(t===`--mime`||t===`--mime-type`)o=!0;else if(t!==`--dereference`)return r(`file`,t)}else if(t.startsWith(`-`)&&t!==`-`){for(let e of t.slice(1))if(e===`b`)n=!0;else if(e===`i`)o=!0;else if(e!==`L`)return r(`file`,`-${e}`)}else s.push(t);if(s.length===0)return{stdout:``,stderr:`Usage: file [-bLi] FILE...
11
+ `,exitCode:1};let c=``,l=0;for(let e of s)try{let r=t.fs.resolvePath(t.cwd,e);if((await t.fs.stat(r)).isDirectory){let t=o?`inode/directory`:`directory`;c+=n?`${t}
12
+ `:`${e}: ${t}
13
+ `;continue}let i=await Pt(e,await t.fs.readFileBuffer(r)),a=o?i.mime:i.description;c+=n?`${a}
14
+ `:`${e}: ${a}
15
+ `}catch{c+=n?`cannot open
16
+ `:`${e}: cannot open (No such file or directory)
17
+ `,l=1}return{stdout:c,stderr:``,exitCode:l}}},It={name:`file`,flags:[{flag:`-b`,type:`boolean`},{flag:`-i`,type:`boolean`},{flag:`-L`,type:`boolean`}],needsArgs:!0};
18
+ /*! Bundled license information:
19
+
20
+ ieee754/index.js:
21
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
22
+ */
23
+ export{Ft as n,It as t};
24
+ //# sourceMappingURL=chunk-HL6NGDO2-978327U5.mjs.map