PageSourceSearch

https://localpdf.online/app/assets/index-BoeGrVpG.js

js localpdf.online collected 2026-09-24 14:26:43 UTC 4,050 bytes, 1 lines download raw bytes

1import{j as s}from"./jsx-runtime-0DLF9kdB.js";import{r as p}from"./index-DH-tsESH.js";import{u as E}from"./platform-context-BRxCm7Dr.js";import{L as u}from"./linear-icon-C4MoDyVR.js";const v=[{id:"low",label:"Low",hint:"Quality",description:"Keep documentation sharp.",icon:"image",ratio:.65},{id:"medium",label:"Median",hint:"Balanced",description:"Optimal for daily use.",icon:"compress",ratio:.45},{id:"high",label:"Extreme",hint:"Min Size",description:"Shared via web or email.",icon:"zap",ratio:.28}];function x(n){if(n<=0)return"0 B";const r=["B","KB","MB","GB"];let o=n,c=0;for(;o>=1024&&c<r.length-1;)o/=1024,c+=1;return`${o.toFixed(o>=10||c===0?0:1)} ${r[c]}`}function P({inputFiles:n,onStart:r,onBack:o}){const{runtime:c}=E(),[t,b]=p.useState("medium"),[e,h]=p.useState(null),[l,f]=p.useState(!0);p.useEffect(()=>{if(n.length===0){h(null),f(!1);return}const a=n[0];let i=!1;return(async()=>{var d;try{const g=await c.vfs.read(a);if(i)return;const w=g.getName(),C=await g.getSize();if(i)return;let y=1;try{const L={id:crypto.randomUUID(),type:"COMMAND",payload:{type:"GET_PDF_PAGE_COUNT",payload:{fileId:a}}},m=await c.workerOrchestrator.dispatch(L,void 0);!i&&((d=m==null?void 0:m.payload)==null?void 0:d.type)==="PAGE_COUNT_RESULT"&&(y=m.payload.payload.pageCount)}catch{}i||h({name:w,size:C,pageCount:y})}catch{i||h(null)}finally{i||f(!1)}})(),()=>{i=!0}},[n,c.vfs,c.workerOrchestrator]);const N=v.find(a=>a.id===t),j=e&&N?Math.round(e.size*N.ratio):null;return s.jsxs("div",{className:"tool-config-root compress-config-root",children:[s.jsxs("div",{className:"compress-file-box",children:[s.jsx("div",{className:"compress-file-icon",children:s.jsx(u,{name:"file-input",className:"linear-icon"})}),s.jsxs("div",{className:"compress-file-details",children:[s.jsx("p",{className:"compress-file-name",title:(e==null?void 0:e.name)??"",children:(e==null?void 0:e.name)??(l?"Loading…":"")}),s.jsx("p",{className:"compress-file-meta",children:e&&!l?`${e.pageCount} page${e.pageCount!==1?"s":""} · ${x(e.size)}`:l?"Loading file info…":""})]})]}),s.jsxs("div",{className:"compress-config-header",children:[s.jsx("h3",{className:"compress-config-main-title",children:"Compression level"}),s.jsx("p",{className:"tool-config-copy",children:"Our local engine will re-encode your PDF to save space without cloud dependency."})]}),s.jsx("div",{className:"compress-quality-grid",children:v.map(a=>{const i=e?Math.round(e.size*a.ratio):null,d=e?Math.round((1-a.ratio)*100):null;return s.jsxs("div",{className:`compress-quality-card ${t===a.id?"active":""}`,onClick:()=>b(a.id),children:[s.jsx("div",{className:"compress-card-selection",children:s.jsx("div",{className:"compress-radio-outer",children:s.jsx("div",{className:"compress-radio-inner"})})}),s.jsxs("div",{className:"compress-card-content",children:[s.jsx("div",{className:"compress-card-icon-box",children:s.jsx(u,{name:a.icon,className:"linear-icon icon-md"})}),s.jsxs("div",{className:"compress-card-text",children:[s.jsxs("div",{className:"compress-card-title-row",children:[s.jsx("span",{className:"compress-card-label",children:a.label}),s.jsx("span",{className:"compress-card-hint",children:a.hint})]}),s.jsx("p",{className:"compress-card-desc",children:a.description}),i!==null&&s.jsxs("p",{className:"compress-estimate-row",children:[s.jsx("span",{className:"compress-estimate-size",children:x(i)}),s.jsxs("span",{className:"compress-estimate-savings",children:["−",d,"%"]})]})]})]}),t===a.id&&s.jsx("div",{className:"compress-card-glow"})]},a.id)})}),s.jsxs("div",{className:"tool-config-actions premium-actions",children:[s.jsx("button",{className:"btn-ghost",onClick:o,children:s.jsxs("span",{className:"btn-inline",children:[s.jsx(u,{name:"x",className:"linear-icon"}),"Back to Studio"]})}),s.jsx("button",{className:"btn-primary btn-premium-glow",onClick:()=>r({quality:t}),disabled:!e&&!l,children:s.jsxs("span",{className:"btn-inline",children:[s.jsx(u,{name:"play",className:"linear-icon"}),j!==null?`Compress to ${x(j)}`:"Compress PDF"]})})]})]})}export{P as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.