async function e(e,t){let n=`octal`,r=[],i=[];for(let t=0;t<e.length;t++){let a=e[t];if(a===`-c`)r.push(`char`);else if(a===`-An`||a===`-A`&&e[t+1]===`n`)n=`none`,a===`-A`&&t++;else if(a===`-t`&&e[t+1]){let n=e[++t];n===`x1`?r.push(`hex`):n===`c`?r.push(`char`):n.startsWith(`o`)&&r.push(`octal`)}else (!a.startsWith(`-`)||a===`-`)&&i.push(a)}r.length===0&&r.push(`octal`);let a=t.stdin;if(i.length>0&&i[0]!==`-`){let e=i[0].startsWith(`/`)?i[0]:`${t.cwd}/${i[0]}`;try{a=await t.fs.readFile(e)}catch{return{stdout:``,stderr:`od: ${i[0]}: No such file or directory
`,exitCode:1}}}let o=r.includes(`char`);function s(e){return e===0?`  \\0`:e===7?`  \\a`:e===8?`  \\b`:e===9?`  \\t`:e===10?`  \\n`:e===11?`  \\v`:e===12?`  \\f`:e===13?`  \\r`:e>=32&&e<127?`   ${String.fromCharCode(e)}`:` ${e.toString(8).padStart(3,`0`)}`}function c(e){return o?`  ${e.toString(16).padStart(2,`0`)}`:` ${e.toString(16).padStart(2,`0`)}`}function l(e){return` ${e.toString(8).padStart(3,`0`)}`}let u=[];for(let e of a)u.push(e.charCodeAt(0));let d=[];for(let e=0;e<u.length;e+=16){let t=u.slice(e,e+16);for(let i=0;i<r.length;i++){let a=r[i],o;o=a===`char`?t.map(s):a===`hex`?t.map(c):t.map(l);let u=``;i===0&&n!==`none`?u=`${e.toString(8).padStart(7,`0`)} `:(i>0||n===`none`)&&(u=n===`none`?``:`        `),d.push(u+o.join(``))}}return n!==`none`&&u.length>0&&d.push(u.length.toString(8).padStart(7,`0`)),{stdout:d.length>0?`${d.join(`
`)}
`:``,stderr:``,exitCode:0}}var t={name:`od`,execute:e},n={name:`od`,flags:[{flag:`-c`,type:`boolean`},{flag:`-A`,type:`value`,valueHint:`string`},{flag:`-t`,type:`value`,valueHint:`string`},{flag:`-N`,type:`value`,valueHint:`number`}],stdinType:`text`,needsFiles:!0};export{n,t};
//# sourceMappingURL=chunk-PP6PSHAB-DQ3LPONR.mjs.map