1import{h as b,r as m,j as e,G as z,L as oe,k as l,A as J,S as c,D as V,a9 as ie,a8 as S,a0 as B,a1 as Q,i as Z,T as ae}from"./vendor-ui-CS0mnPFt.js";import{aH as le,cg as de,B as ee,bm as ce,a3 as me,ck as fe,I as $,ay as ue,j as pe,bg as he}from"./index-C_aFVV9u.js";import{c as ge}from"./createToolFlow-C4zWLjrN.js";import{u as xe}from"./useBaseTool-BSBw1Chw.js";/* empty css */import"./vendor-i18n-Duaa3CPZ.js";import"./vendor-embedpdf-DPr2xF0N.js";import"./vendor-zip-MQ9XS9sB.js";import"./vendor-pdfjs-qeL0KTy0.js";import"./vendor-posthog-BTegTnBq.js";import"./vendor-supabase-BDX6J8AV.js";import"./PrivateContent-5HmopU0L.js";import"./DocumentThumbnail-T25PCzpJ.js";import"./useViewScopedFiles-BhlXdGH7.js";const te={},je=()=>le({defaultParameters:te,endpointName:"get-info-on-pdf"}),ye=(s,n)=>s.find(t=>t.name.toLowerCase().endsWith(n)),Pe=({operation:s,isLoading:n,errorMessage:t})=>{const{t:r}=b(),o=m.useMemo(()=>ye(s.files,".json"),[s.files]),a=m.useMemo(()=>o??null,[o]),i=m.useMemo(()=>r("getPdfInfo.downloadJson","Download JSON"),[r]),d=m.useCallback(u=>{de({data:u,filename:u.name})},[]);return n&&s.results.length===0?e.jsxs(z,{justify:"center",gap:"sm",py:"md",children:[e.jsx(oe,{size:"sm"}),e.jsx(l,{children:r("getPdfInfo.processing","Extracting information...")})]}):!n&&s.results.length===0?e.jsx(J,{color:"gray",variant:"light",title:r("getPdfInfo.results","Results"),children:e.jsx(l,{size:"sm",children:r("getPdfInfo.noResults","Run the tool to generate a report.")})}):e.jsxs(c,{gap:"md",children:[t&&e.jsx(J,{color:"yellow",variant:"light",children:e.jsx(l,{size:"sm",children:t})}),e.jsxs(c,{gap:"xs",children:[e.jsx(l,{size:"sm",fw:600,children:r("getPdfInfo.downloads","Downloads")}),e.jsx(ee,{onClick:()=>a&&d(a),disabled:!a,fullWidth:!0,children:i})]})]})},Ie="response.json",se=()=>{const{t:s}=b(),{selectors:n}=ce(),[t,r]=m.useState(!1),[o,a]=m.useState(""),[i,d]=m.useState(null),[u,f]=m.useState([]),[P,p]=m.useState(null),[y,k]=m.useState(""),[F,x]=m.useState([]),w=m.useRef(!1),g=m.useRef(null),C=m.useCallback(()=>{g.current&&(URL.revokeObjectURL(g.current),g.current=null)},[]),T=m.useCallback(()=>{w.current=!1,x([]),f([]),C(),p(null),k(""),a(""),d(null)},[C]),M=m.useCallback(()=>{d(null)},[]),_=m.useCallback(async(K,R)=>{if(R.length===0){d(s("noFileSelected","No file loaded"));return}w.current=!1,r(!0),a(s("getPdfInfo.processing","Extracting information...")),d(null),x([]),f([]),C(),p(null),k("");try{const I=[],U=Date.now();for(const j of R){if(w.current)break;const h=new FormData;h.append("fileInput",j);try{const v=await me.post("/api/v1/security/get-info-on-pdf",h),A=n.getStirlingFileStub(j.fileId),W={fileId:j.fileId,fileName:j.name,fileSize:j.size??null,lastModified:j.lastModified??null,thumbnailUrl:A?.thumbnailUrl??null,data:v.data??{},error:null,summaryGeneratedAt:U};I.push(W)}catch(v){const A=n.getStirlingFileStub(j.fileId);I.push({fileId:j.fileId,fileName:j.name,fileSize:j.size??null,lastModified:j.lastModified??null,thumbnailUrl:A?.thumbnailUrl??null,data:{},error:fe(v),summaryGeneratedAt:U})}}if(!w.current){if(x(I),I.length>0){const h=I.filter(G=>!G.error).map(G=>G.data),v=h.length===1?h[0]:h,A=JSON.stringify(v,null,2),W=new File([A],Ie,{type:"application/json"});f([W])}I.some(h=>h.error)&&d(s("getPdfInfo.error.partial","Some files could not be processed.")),a(s("getPdfInfo.status.complete","Extraction complete"))}}catch(I){console.error("[getPdfInfo] unexpected failure",I),d(s("getPdfInfo.error.unexpected","Unexpected error during extraction."))}finally{r(!1)}},[C,n,s]),L=m.useCallback(()=>{t&&(w.current=!0,r(!1),a(s("operationCancelled","Operation cancelled")))},[t,s]),N=m.useCallback(async()=>{T()},[T]);return m.useEffect(()=>()=>{C()},[C]),m.useMemo(()=>({files:u,thumbnails:[],isGeneratingThumbnails:!1,downloadUrl:P,downloadFilename:y,isLoading:t,status:o,errorMessage:i,progress:null,executeOperation:_,resetResults:T,clearError:M,cancelOperation:L,undoOperation:N,results:F}),[L,M,y,P,i,_,u,t,T,F,o])},E=({title:s,anchorId:n,children:t})=>e.jsxs(c,{gap:"sm",id:n,children:[e.jsx(l,{fw:700,size:"lg",children:s}),e.jsx(V,{}),t]}),D=({obj:s,emptyLabel:n})=>!s||Object.keys(s).length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n??"None detected"}):e.jsx(c,{gap:6,children:Object.entries(s).map(([t,r])=>e.jsxs(z,{wrap:"nowrap",align:"flex-start",style:{width:"100%"},children:[e.jsx(l,{size:"sm",style:{minWidth:180,maxWidth:180,flexShrink:0},children:t}),e.jsx(l,{size:"sm",c:"dimmed",style:{wordBreak:"break-word",overflowWrap:"break-word",flex:1},children:r==null?"":String(r)})]},t))}),be=s=>{if(!s||s.length===0)return{hasCompliance:!1,passedStandards:[],failedCount:0};const n=s.filter(o=>o.Standard.toLowerCase()!=="not-pdfa");if(n.length===0)return{hasCompliance:!1,passedStandards:[],failedCount:0};const t=n.filter(o=>o.Compliant).map(o=>{const a=o.Standard.toLowerCase(),i=a.match(/^pdf[_-]?a[_-]?(\d+)([abuf])?$/i);if(i)return`PDF/A-${i[1]}${i[2]?.toUpperCase()||""}`;const d=a.match(/^pdf[_-]?ua[_-]?(\d+)?$/i);return d?`PDF/UA-${d[1]||"1"}`:o.Standard.toUpperCase()}),r=n.filter(o=>!o.Compliant).length;return{hasCompliance:!0,passedStandards:t,failedCount:r}},we=({sections:s,hideSectionTitle:n=!1})=>{const{t}=b(),r=m.useMemo(()=>{const a=s.basicInfo??{},i=s.documentInfo??{},d=s.metadata??{},u=s.encryption??{},f=s.permissions??{},P=s.summaryData??{},p=s.other??{},y=s.perPage??{},k=a["Number of pages"],F=a.FileSizeInBytes,x=i["PDF version"],w=a.Language,g={[t("getPdfInfo.summary.pages","Pages")]:k,[t("getPdfInfo.summary.fileSize","File Size")]:typeof F=="number"?`${(F/1024).toFixed(2)} KB`:F,[t("getPdfInfo.summary.pdfVersion","PDF Version")]:x,[t("getPdfInfo.summary.language","Language")]:w},C={[t("getPdfInfo.summary.title","Title")]:d.Title,[t("getPdfInfo.summary.author","Author")]:d.Author,[t("getPdfInfo.summary.created","Created")]:d.CreationDate,[t("getPdfInfo.summary.modified","Modified")]:d.ModificationDate},T=u.IsEncrypted?t("getPdfInfo.summary.security.encrypted","Encrypted PDF - Password protection present"):t("getPdfInfo.summary.security.unencrypted","Unencrypted PDF - No password protection"),M=P.restrictedPermissionsCount??0,L=Object.values(f).every(h=>h==="Allowed")?t("getPdfInfo.summary.permsAll","All Permissions Allowed"):M>0?t("getPdfInfo.summary.permsRestricted","{{count}} restrictions",{count:M}):t("getPdfInfo.summary.permsMixed","Some permissions restricted"),N=be(P.Compliance),K=N.hasCompliance?N.passedStandards.length>0?t("getPdfInfo.summary.compliancePassed","{{standards}} compliant",{standards:N.passedStandards.join(", ")}):t("getPdfInfo.summary.complianceChecked","Standards verified ({{failed}} failed)",{failed:N.failedCount}):t("getPdfInfo.summary.noCompliance","No Compliance Standards"),R=y["Page 1"],I=R?.Fonts??[],U={[t("getPdfInfo.summary.tech.images","Images")]:(()=>{const h=a.TotalImages;
1return typeof h=="number"?h===0?"None":`${h}`:"None"})(),[t("getPdfInfo.summary.tech.fonts","Fonts")]:(()=>{if(I.length===0)return"None";const h=I.filter(v=>v.IsEmbedded).length;return`${I.length} (${h} embedded)`})(),[t("getPdfInfo.summary.tech.formFields","Form Fields")]:s.formFields&&Object.keys(s.formFields).length>0?Object.keys(s.formFields).length:"None",[t("getPdfInfo.summary.tech.embeddedFiles","Embedded Files")]:p.EmbeddedFiles?.length??"None",[t("getPdfInfo.summary.tech.javaScript","JavaScript")]:p.JavaScript?.length??"None",[t("getPdfInfo.summary.tech.layers","Layers")]:p.Layers?.length??"None",[t("getPdfInfo.summary.tech.bookmarks","Bookmarks")]:s.toc?.length??"None",[t("getPdfInfo.summary.tech.multimedia","Multimedia")]:R?.Multimedia?.length??"None"},j=(()=>{const h=d.Title?`"${d.Title}"`:t("getPdfInfo.summary.overview.untitled","an untitled document"),v=d.Author||t("getPdfInfo.summary.overview.unknown","Unknown Author");return t("getPdfInfo.summary.overview.text","This is a {{pages}}-page PDF titled {{title}} created by {{author}} (PDF version {{version}}).",{pages:typeof k=="number"?k:"?",title:h,author:v,version:x??"?"})})();return{basicInformation:g,documentInformation:C,securityStatusText:T,permSummary:L,complianceText:K,technical:U,overview:j}},[s,t]),o=e.jsxs(c,{gap:"md",children:[e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.basic","Basic Information")}),e.jsx(D,{obj:r.basicInformation})]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.documentInfo","Document Information")}),e.jsx(D,{obj:r.documentInformation})]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.securityTitle","Security Status")}),e.jsx(l,{size:"sm",c:"dimmed",children:r.securityStatusText}),e.jsx(l,{size:"sm",c:"dimmed",children:r.permSummary}),e.jsx(l,{size:"sm",c:"dimmed",children:r.complianceText})]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.technical","Technical")}),e.jsx(D,{obj:r.technical})]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.overviewTitle","PDF Overview")}),e.jsx(l,{size:"sm",c:"dimmed",children:r.overview})]})]});return n?e.jsx("div",{id:"summary",children:o}):e.jsx(E,{title:t("getPdfInfo.summary.title","PDF Summary"),anchorId:"summary",children:o})},O=({title:s,anchorId:n,obj:t,emptyLabel:r})=>e.jsx(E,{title:s,anchorId:n,children:e.jsx(D,{obj:t,emptyLabel:r})}),Ce=({anchorId:s,tocArray:n})=>{const{t}=b(),r=t("getPdfInfo.noneDetected","None detected");return e.jsx(E,{title:t("getPdfInfo.sections.tableOfContents","Table of Contents"),anchorId:s,children:!n||n.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:r}):e.jsx(c,{gap:4,children:n.map((o,a)=>e.jsx(l,{size:"sm",c:"dimmed",children:typeof o=="string"?o:JSON.stringify(o)},a))})})},H=({content:s,maxHeight:n="400px",emptyMessage:t})=>{const{t:r}=b();return s?e.jsx(ie,{block:!0,style:{whiteSpace:"pre-wrap",backgroundColor:"var(--c-surface-raised)",color:"var(--c-text)",maxHeight:n,overflowY:"auto"},children:s}):e.jsx(l,{size:"sm",c:"dimmed",children:t??r("getPdfInfo.noneDetected","None detected")})},ne={item:{backgroundColor:"var(--c-surface-raised)"},control:{backgroundColor:"transparent"}},Se=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,r)=>e.jsx("div",{style:{wordBreak:"break-word",overflowWrap:"break-word"},children:e.jsxs(l,{size:"sm",c:"dimmed",children:[e.jsx("strong",{children:t.Name||"Unnamed attachment"}),t.Description&&` - ${t.Description}`,t.FileSize!=null&&` (${t.FileSize} bytes)`]})},r))}),ke=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,r)=>e.jsx("div",{style:{wordBreak:"break-word",overflowWrap:"break-word"},children:e.jsxs(l,{size:"sm",c:"dimmed",children:[e.jsx("strong",{children:t.Name||"Unnamed file"}),t.FileSize!=null&&` (${t.FileSize} bytes)`,t.MimeType&&` - ${t.MimeType}`,t.CreationDate&&` - Created: ${t.CreationDate}`,t.ModificationDate&&` - Modified: ${t.ModificationDate}`]})},r))}),X=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,r)=>e.jsx(l,{size:"sm",c:"dimmed",style:{wordBreak:"break-word",overflowWrap:"break-word"},children:typeof t=="string"?t:JSON.stringify(t)},r))}),ve=({anchorId:s,other:n})=>{const{t}=b(),r=t("getPdfInfo.noneDetected","None detected"),o=Array.isArray(n?.StructureTree)&&n.StructureTree.length>0?JSON.stringify(n.StructureTree,null,2):null;return e.jsx(E,{title:t("getPdfInfo.sections.other","Other"),anch
1orId:s,children:e.jsxs(c,{gap:"sm",children:[e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.attachments","Attachments")}),Se(n?.Attachments,r)]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.embeddedFiles","Embedded Files")}),ke(n?.EmbeddedFiles,r)]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.javaScript","JavaScript")}),X(n?.JavaScript,r)]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.layers","Layers")}),X(n?.Layers,r)]}),e.jsxs(S,{variant:"separated",radius:"md",defaultValue:"",styles:ne,children:[e.jsxs(S.Item,{value:"structureTree",children:[e.jsx(S.Control,{children:e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.structureTree","StructureTree")})}),e.jsx(S.Panel,{children:e.jsx(H,{content:o,maxHeight:"20rem"})})]}),e.jsxs(S.Item,{value:"xmp",children:[e.jsx(S.Control,{children:e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.xmp","XMPMetadata")})}),e.jsx(S.Panel,{children:e.jsx(H,{content:n?.XMPMetadata,maxHeight:"400px"})})]})]})]})})},Fe=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,r)=>e.jsx("div",{style:{wordBreak:"break-word",overflowWrap:"break-word"},children:e.jsxs(l,{size:"sm",c:"dimmed",children:[t.Name?`${t.Name} `:"Image ","(",t.Width,"Ã",t.Height,"px",t.ColorSpace?`, ${t.ColorSpace}`:"",")"]})},r))}),q=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,r)=>e.jsx(l,{size:"sm",c:"dimmed",style:{wordBreak:"break-word",overflowWrap:"break-word"},children:typeof t=="string"?t:JSON.stringify(t)},r))}),De=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,r)=>e.jsx(l,{size:"sm",c:"dimmed",style:{wordBreak:"break-word",overflowWrap:"break-word"},children:`${t.Name??"Unknown"}${t.IsEmbedded?" (embedded)":""}`},r))}),ze=({anchorId:s,perPage:n})=>{const{t}=b(),r=t("getPdfInfo.noneDetected","None detected"),o=n&&Object.keys(n).length>0;return e.jsx(E,{title:t("getPdfInfo.sections.perPageInfo","Per Page Info"),anchorId:s,children:o?e.jsx(S,{variant:"separated",radius:"md",defaultValue:"",styles:ne,children:Object.entries(n).map(([a,i])=>e.jsxs(S.Item,{value:a,children:[e.jsx(S.Control,{children:e.jsx(l,{fw:600,size:"sm",children:a})}),e.jsx(S.Panel,{children:e.jsx("div",{style:{backgroundColor:"var(--c-surface-raised)",color:"var(--c-text)",borderRadius:8,padding:12},children:e.jsxs(c,{gap:"sm",children:[i?.Size&&e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.size","Size")}),e.jsx(D,{obj:i.Size})]}),e.jsx(D,{obj:{Rotation:i?.Rotation,"Page Orientation":i?.["Page Orientation"],MediaBox:i?.MediaBox,CropBox:i?.CropBox,BleedBox:i?.BleedBox,TrimBox:i?.TrimBox,ArtBox:i?.ArtBox,"Text Characters Count":i?.["Text Characters Count"]}}),i?.Annotations&&e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.annotations","Annotations")}),e.jsx(D,{obj:i.Annotations})]}),e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.images","Images")}),Fe(i?.Images,r)]}),e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.links","Links")}),q(i?.Links,r)]}),e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.fonts","Fonts")}),De(i?.Fonts,r)]}),i?.XObjectCounts&&e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.xobjects","XObject Counts")}),e.jsx(D,{obj:i.XObjectCounts})]}),e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.multimedia","Multimedia")}),q(i?.Multimedia,r)]})]})})})]},a))}):e.jsx(l,{size:"sm",c:"dimmed",children:r})})},Te=s=>{const n=s.toLowerCase().trim(),t=n.match(/^pdf[_-]?a[_-]?(\d+)([abuf])?$/i);if(t){const i=t[1],d=t[2]?.toUpperCase()||"";return{displayName:`PDF/A-${i}${d}`,category:"PDF/A",sortOrder:10+parseInt(i)*10+(d==="A"?1:d==="B"?2:d==="U"?3:0)}}const r=n.match(/^pdf[_-]?ua[_-]?(\d+)?$/i);if(r){const i=r[1]||"1";return{displayName:`PDF/UA-${i}`,category:"PDF/UA",sortOrder:200+parseInt(i)}}const o=n.match(/^pdf[_-]?x[_-]?(.+)?$/i);if(o){const i=o[1]?.toUpperCase()||"";return{displayName:`PDF/X${i?`-${i}`:""}`,category:"PDF/X",sortOrder:300}}const a=n.match(/^pdf[_-]?e[_-]?(.+)?$/i);if(a){const i=a[1]?.toUpperCase()||"";return{displayName:`PDF/E${i?`-${i}`:""}`,category:"PDF/E",sortOrder:400}}return n.includes("pdfvt")||n.includes("pdf-vt")||n.includes("pdf_vt")?{displayName:"PDF/VT",category:"PDF/VT",sortOrder:500}:n.includes("sec")||n.includes("edgar")?{displayName:"SEC (EDGAR)",category:"SEC",sortOrder:600}:n==="not-pdfa"||n==="not_pdfa"?{displayName:"PDF/A Detection",category:"Detection",sortOrder:1}
1:{displayName:s.toUpperCase().replace(/[-_]/g,"/"),category:"Other",sortOrder:999}},Ne=(s,n)=>{const t=[],r=new Set;if(s&&s.length>0)for(const o of s){if(o.Standard.toLowerCase()==="not-pdfa")continue;const{displayName:a,category:i,sortOrder:d}=Te(o.Standard);r.add(i),t.push({displayName:a,category:i,isCompliant:o.Compliant,summary:o.Summary,standardId:o.Standard,sortOrder:d})}if(n&&"IsPDF/SECCompliant"in n&&!r.has("SEC")){const o=n["IsPDF/SECCompliant"];t.push({displayName:"SEC (EDGAR)",category:"SEC",isCompliant:o,summary:o?"Document meets SEC EDGAR filing requirements":"Document does not meet SEC EDGAR filing requirements",standardId:"sec-edgar",sortOrder:600})}return t.sort((o,a)=>o.sortOrder-a.sortOrder),t},Ae=s=>{const n=s.filter(t=>t.category==="PDF/A"&&t.isCompliant).sort((t,r)=>r.sortOrder-t.sortOrder);return n.length>0?n[0].displayName:null},Oe=({result:s})=>{const{t:n}=b(),t=s.isCompliant?"teal":"red",r=s.isCompliant?n("getPdfInfo.compliance.passed","Passed"):n("getPdfInfo.compliance.failed","Failed");
1return e.jsx(Q,{p:"sm",radius:"sm",withBorder:!0,style:{borderColor:`var(--mantine-color-${t}-6)`},children:e.jsxs(z,{justify:"space-between",wrap:"nowrap",children:[e.jsxs(z,{gap:"sm",wrap:"nowrap",style:{minWidth:0},children:[e.jsx(Z,{color:t,variant:"light",size:"lg",radius:"xl",children:e.jsx($,{name:s.isCompliant?"check":"x",size:"1.2rem"})}),e.jsxs(c,{gap:2,style:{minWidth:0},children:[e.jsx(l,{size:"sm",fw:600,truncate:!0,children:s.displayName}),e.jsx(ae,{label:s.summary,multiline:!0,maw:400,withArrow:!0,children:e.jsx(l,{size:"xs",c:"dimmed",lineClamp:1,style:{cursor:"help"},children:s.summary})})]})]}),e.jsx(B,{color:t,variant:"light",size:"md",leftSection:e.jsx($,{name:s.isCompliant?"check":"x",size:12}),children:r})]})})},Ee=()=>{const{t:s}=b();return e.jsx(Q,{p:"md",radius:"sm",withBorder:!0,children:e.jsxs(z,{gap:"sm",children:[e.jsx(Z,{color:"gray",variant:"light",size:"lg",radius:"xl",children:e.jsx($,{name:"info",size:"1.2rem"})}),e.jsxs(c,{gap:2,children:[e.jsx(l,{size:"sm",fw:500,children:s("getPdfInfo.compliance.noVerification","No Verification Performed")}),e.jsx(l,{size:"xs",c:"dimmed",children:s("getPdfInfo.compliance.noVerificationDesc","PDF standards compliance was not verified for this document.")})]})]})})},Me=({anchorId:s,complianceSummary:n,legacyCompliance:t})=>{const{t:r}=b(),o=m.useMemo(()=>Ne(n,t),[n,t]),a=m.useMemo(()=>Ae(o),[o]),i=o.filter(f=>f.isCompliant).length,d=o.filter(f=>
1!f.isCompliant).length,u=o.length>0;return e.jsx(E,{title:r("getPdfInfo.sections.compliance","Compliance"),anchorId:s,children:e.jsxs(c,{gap:"md",children:[u&&e.jsxs(e.Fragment,{children:[e.jsx(z,{justify:"space-between",wrap:"wrap",gap:"xs",children:e.jsxs(z,{gap:"xs",children:[a&&e.jsx(B,{color:"cyan",variant:"light",size:"lg",children:a}),i>0&&e.jsxs(B,{color:"teal",variant:"outline",size:"sm",children:[i," ",r("getPdfInfo.compliance.passedCount","passed")]}),d>0&&e.jsxs(B,{color:"red",variant:"outline",size:"sm",children:[d," ",r("getPdfInfo.compliance.failedCount","failed")]})]})}),e.jsx(V,{})]}),u?e.jsx(c,{gap:"xs",children:o.map((f,P)=>e.jsx(Oe,{result:f},`${f.standardId}-${P}`))}):e.jsx(Ee,{})]})})},Re=new Set(["summary","metadata","formFields","basicInfo","documentInfo","compliance","encryption","permissions","toc","other","perPage"]),Be=({data:s})=>{const{t:n}=b(),t=m.useRef(null),r=s.entries[0]??null;m.useEffect(()=>{if(!s.scrollTo||!Re.has(s.scrollTo))return;const a=s.scrollTo,i=t.current,d=i?.querySelector(`#${a}`);if(d&&i){const u=parseFloat(getComputedStyle(document.documentElement).fontSize)*4,f=d.getBoundingClientRect().top,P=i.getBoundingClientRect().top,y=i.scrollTop+(f-P)-u;i.scrollTo({top:Math.max(0,y),behavior:"smooth"}),d.classList.remove("section-flash-highlight"),d.offsetWidth,d.classList.add("section-flash-highlight"),setTimeout(()=>d.classList.remove("section-flash-highlight"),1500)}},[s.scrollTo]);const o=m.useMemo(()=>{const a=r?.data??{};return{metadata:a.Metadata??null,formFields:a.FormFields??a["Form Fields"]??null,basicInfo:a.BasicInfo??a["Basic Info"]??null,documentInfo:a.DocumentInfo??a["Document Info"]??null,compliance:a.Compliancy??a.Compliance??null,encryption:a.Encryption??null,permissions:a.Permissions??null,toc:a["Bookmarks/Outline/TOC"]??a["Table of Contents"]??null,other:a.Other??null,perPage:a.PerPageInfo??a["Per Page Info"]??null,summaryData:a.SummaryData??null}},[r]);return r?e.jsx("div",{className:"report-container",ref:t,children:e.jsx(c,{gap:"xl",align:"center",children:e.jsx("div",{className:"simulated-page",children:e.jsxs(c,{gap:"lg",children:[e.jsxs(c,{gap:"xs",children:[e.jsxs(l,{fw:700,size:"xl",style:{lineHeight:1.3,wordBreak:"break-word"},children:[r.fileName,e.jsxs(l,{component:"span",fw:700,children:[" ","- ",n("getPdfInfo.summary.title","PDF Summary")]})]}),e.jsx(V,{})]}),e.jsx(we,{sections:o,hideSectionTitle:!0}),e.jsx(O,{title:n("getPdfInfo.sections.metadata","Metadata"),anchorId:"metadata",obj:o.metadata}),e.jsx(O,{title:n("getPdfInfo.sections.formFields","Form Fields"),anchorId:"formFields",obj:o.formFields}),e.jsx(O,{title:n("getPdfInfo.sections.basicInfo","Basic Info"),anchorId:"basicInfo",obj:o.basicInfo}),e.jsx(O,{title:n("getPdfInfo.sections.documentInfo","Document Info"),anchorId:"documentInfo",obj:o.documentInfo}),e.jsx(Me,{anchorId:"compliance",complianceSummary:o.summaryData?.Compliance,legacyCompliance:o.compliance}),e.jsx(O,{title:n("getPdfInfo.sections.encryption","Encryption"),anchorId:"encryption",obj:o.encryption}),e.jsx(O,{title:n("getPdfInfo.sections.permissions","Permissions"),anchorId:"permissions",obj:o.permissions}),e.jsx(Ce,{anchorId:"toc",tocArray:o.toc??[]}),e.jsx(ve,{anchorId:"other",other:o.other}),e.jsx(ze,{anchorId:"perPage",perPage:o.perPage})]})})})}):e.jsx("div",{className:"report-container",children:e.jsxs(c,{gap:"md",align:"center",children:[e.jsx(B,{color:"gray",variant:"light",children:"No Data"}),e.jsx(l,{size:"sm",c:"dimmed",children:"Run the tool to generate the report."})]})})},Y=[{id:"summary",labelKey:"getPdfInfo.summary.title",fallback:"PDF Summary"},{id:"metadata",labelKey:"getPdfInfo.sections.metadata",fallback:"Metadata"},{id:"formFields",labelKey:"getPdfInfo.sections.formFields",fallback:"Form Fields"},{id:"basicInfo",labelKey:"getPdfInfo.sections.basicInfo",fallback:"Basic Info"},{id:"documentInfo",labelKey:"getPdfInfo.sections.documentInfo",fallback:"Document Info"},{id:"compliance",labelKey:"getPdfInfo.sections.compliance",fallback:"Compliance"},{id:"encryption",labelKey:"getPdfInfo.sections.encryption",fallback:"Encryption"},{id:"permissions",labelKey:"getPdfInfo.sections.permissions",fallback:"Permissions"},{id:"toc",labelKey:"getPdfInfo.sections.tableOfContents",fallback:"Table of Contents"},{id:"other",labelKey:"getPdfInfo.sections.other",fallback:"Other"},{id:"perPage",labelKey:"getPdfInfo.sections.perPageInfo",fallback:"Per Page Info"}],$e=s=>{const{t:n}=b(),{actions:t}=ue(),r=pe(),{registerCustomWorkbenchView:o,unregisterCustomWorkbenchView:a,setCustomWorkbenchViewData:i,clearCustomWorkbenchViewData:d}=he(),u="getPdfInfoReport",f="custom:getPdfInfoReport",P=m.useMemo(()=>e.jsx($,{name:"file-pdf",size:20}),[]),p=xe("getPdfInfo",je,se,s),y=p.operation,k=y.results.length>0,F=k||p.operation.isLoading||!!p.operation.errorMessage;m.useEffect(()=>(o({id:u,workbenchId:f,label:n("getPdfInfo.report.shortTitle","PDF Information"),icon:P,component:Be}),()=>{d(u),a(u)}),[d,o,P,n,a]);const x=m.useMemo(()=>y.results.length===0?null:{generatedAt:y.results[0].summaryGeneratedAt??Date.now(),entr
1ies:y.results},[y.results]),w=m.useRef(null);return m.useEffect(()=>{if(x){i(u,x);const g=x.generatedAt??null;g&&g!==w.current&&(w.current=g,r.selectedTool==="getPdfInfo"&&r.workbench!==f&&t.setWorkbench(f))}else d(u),w.current=null},[d,t,r.selectedTool,r.workbench,x,i]),ge({files:{selectedFiles:p.selectedFiles,isCollapsed:k},steps:[{title:n("getPdfInfo.indexTitle","Index"),isVisible:!!x,isCollapsed:!1,content:e.jsx(c,{gap:0,children:Y.map((g,C)=>e.jsxs(c,{gap:0,children:[e.jsx(ee,{variant:"tertiary",fullWidth:!0,justify:"start",onClick:()=>{x&&(i(u,{...x,scrollTo:g.id}),r.workbench!==f&&t.setWorkbench(f))},style:{padding:"8px 4px"},leftSection:e.jsx($,{name:"link",size:20,style:{opacity:.7}}),children:e.jsx(l,{size:"md",c:"dimmed",children:n(g.labelKey,g.fallback)})}),C<Y.length-1&&e.jsx(V,{my:6})]},g.id))})},{title:n("getPdfInfo.results","Results"),isVisible:F,isCollapsed:!1,content:e.jsx(Pe,{operation:y,isLoading:p.operation.isLoading,errorMessage:p.operation.errorMessage})}],executeButton:{text:n("getPdfInfo.submit","Generate"),loadingText:n("loading","Loading..."),onClick:p.handleExecute,endpointEnabled:p.endpointEnabled,paramsValid:p.params.validateParameters(),isVisible:!0},review:{isVisible:!1,operation:p.operation,title:n("getPdfInfo.results","Results"),onUndo:p.handleUndo}})},re=$e;re.tool=()=>se;re.getDefaultParameters=()=>({...te});export{re 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.