PageSourceSearch

https://dashboard.imcwire.com/assets/report-web-C9SkrzSL.js

js imcwire.com collected 2026-10-02 17:56:07 UTC 3,711 bytes, 1 lines download raw bytes

1import{ab as H,an as U,r as a,j as e,h as s,T as I,x as k,I as C,i as D,f as R,B as $,X as A,H as F,w as O}from"./index-Cbg6X3T0.js";import{C as G}from"./config-global-DyVak7sw.js";import{C as z}from"./CircularProgress-BDRF1g_x.js";const E="https://files.imcwire.com",y=52;function v(t){if(!t||typeof t!="string")return!1;try{const r=new URL(t);return r.origin===E&&(r.protocol==="https:"||r.protocol==="http:")}catch{return!1}}function N(t){const r=t.startsWith("/")?t:`/${t}`;return`${E}${r}`}function l({title:t,children:r}){return e.jsxs(e.Fragment,{children:[e.jsx(F,{children:e.jsx("title",{children:`${t} - ${G.appName}`})}),e.jsxs(s,{sx:{position:"fixed",inset:0,width:"100vw",height:"100vh",display:"flex",flexDirection:"column",bgcolor:"#f5f7fa",overflow:"hidden",zIndex:1300},children:[e.jsxs(s,{sx:{height:y,minHeight:y,px:2,display:"flex",alignItems:"center",gap:1,bgcolor:"#482D70",color:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",flexShrink:0},children:[e.jsx(O,{onClick:()=>window.history.back(),sx:{color:"#fff"},"aria-label":"Go back",children:e.jsx(C,{icon:"eva:arrow-back-fill"})}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:700,flex:1},noWrap:!0,children:t}),e.jsx(k,{variant:"outlined",size:"small",onClick:()=>{window.location.href="/dashboard"},sx:{color:"#fff",borderColor:"rgba(255,255,255,0.6)","&:hover":{borderColor:"#fff",bgcolor:"rgba(255,255,255,0.08)"}},children:"Dashboard"})]}),e.jsx(s,{sx:{flex:1,width:"100%",minHeight:0,overflow:"hidden",position:"relative"},children:r})]})]})}function K(){const{id:t}=H(),[r]=U(),o=r.get("url"),[S,c]=a.useState(!o),[_,f]=a.useState(""),[p,i]=a.useState(null),[L,P]=a.useState("Distribution Report");return a.useEffect(()=>{if(o&&v(o))return;if(!t){c(!1),i(o?"Invalid or disallowed report URL":"Report ID or URL required");return}(async()=>{var x,u,g,m,b,w,j;try{const n=D.get("user");if(!n){i("Please log in to view this report"),c(!1);return}const T=JSON.parse(decodeURIComponent(n)),{token:W}=T,d=await R.get(`${$}/v1/reports/${t}`,{headers:{"x-api-key":A,Authorization:`Bearer ${W}`}});if((g=(u=(x=d.data)==null?void 0:x.data)==null?void 0:u.excelFile)!=null&&g.web_url){const B=N(d.data.data.excelFile.web_url);P(((b=(m=d.data)==null?void 0:m.data)==null?void 0:b.title)||"Distribution Report");try{const h=await R.get(B,{responseType:"text"});f(h.data)}catch(h){console.error("Error fetching HTML content:",h),f(""),i("Failed to load report content")}}else i("Web version not found for this report")}catch(n){console.error("Error fetching report:",n),i(((j=(w=n.response)==null?void 0:w.data)==null?void 0:j.message)||"Failed to load report")}finally{c(!1)}})()},[t,o]),o&&v(o)?e.jsx(l,{title:"Distribution Report",children:e.jsx("iframe",{title:"Report",src:o,style:{width:"100%",height:"100%",border:"none",display:"block",background:"#fff"},sandbox:"allow-same-origin allow-scripts allow-popups"})}):S?e.jsx(l,{title:"Loading Report...",children:e.jsx(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(z,{})})}):p?e.jsx(l,{title:"Report",children:e.jsxs(s,{sx:{py:6,px:3,textAlign:"center"},children:[e.jsx(I,{variant:"h6",color:"error",children:p}),e.jsx(k,{variant:"contained",onClick:()=>window.history.back(),sx:{mt:2},startIcon:e.jsx(C,{icon:"eva:arrow-back-fill"}),children:"Go Back"})]})}):e.jsx(l,{title:L,children:e.jsx(s,{sx:{width:"100%",height:"100%",overflow:"auto",bgcolor:"#f5f7fa"},children:e.jsx(s,{sx:{width:"100%",maxWidth:"100%","& .container":{maxWidth:"100% !important",borderRadius:"0 !important",boxShadow:"none !important"},"& body, & html":{padding:"0 !important"}},children:e.jsx("div",{dangerouslySetInnerHTML:{__html:_}})})})})}export{K 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.