PageSourceSearch

https://indexer.so/assets/InputMedia-DrUK2NK3.js

js indexer.so collected 2026-10-07 17:55:24 UTC 6,309 bytes, 1 lines download raw bytes

1import{j as e,r as v}from"./chunk-XJI4KG32-DlXDHkdZ.js";import{c as N}from"./clsx-B-dksMZM.js";import{P as Y}from"./PdfViewer-mneP3OVF.js";import{B as F}from"./ButtonSecondary-BTizLjFF.js";import{X as $}from"./XIcon-DYfS92Dl.js";import{O as z}from"./OpenModal-D5UA82m4.js";import{D as P}from"./DownloadIcon-5DUYrgEX.js";import{Y as A}from"./dialog-DgqLC0ft.js";import{H as J}from"./HintTooltip-D3UUlM3j.js";import{B as y}from"./ButtonTertiary-BBOSEmZ5.js";import{E as O}from"./EyeIcon-CZJA5GC1.js";import{P as R}from"./PaperClipIcon-BnDZOwZk.js";import{T as V}from"./TrashIcon-DYE94-BZ.js";import{C as _}from"./CheckIcon-BjiYXG13.js";import{U as q}from"./UploadDocument-BnWTfUbB.js";import{u as G}from"./ObjectUtils-tv52OPXG.js";import{u as K}from"./useTranslation-QMW_9Idl.js";function Q({item:t,onClose:d,onDownload:c}){function m(){return t.type.endsWith("pdf")}function a(){return t.type.includes("image")}return e.jsx(z,{onClose:d,children:e.jsx("div",{children:t?e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[e.jsx(A,{as:"h3",className:"text-foreground truncate text-lg leading-6 font-medium",children:t.title}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(F,{type:"button",onClick:c,children:e.jsx(P,{className:"h-4 w-4"})}),e.jsx(F,{type:"button",onClick:d,children:e.jsx($,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"mt-4 space-y-3",children:m()?e.jsx("div",{children:e.jsx(Y,{file:t.publicUrl??t.file,canDownload:!1})}):a()?e.jsx("div",{children:e.jsx("img",{alt:t.title,className:"mx-auto h-96 object-contain",src:t.publicUrl??t.file})}):e.jsx("div",{children:"Not PDF or Image"})})]}):e.jsx("div",{children:"Undefined"})})})}function Z({item:t,onChangeTitle:d,onDelete:c,onDownload:m,onPreview:a,readOnly:o}){return e.jsx("div",{className:N("border-border w-full rounded-md border border-dashed px-2 text-xs",""),children:o?e.jsxs("div",{className:"flex items-center justify-between py-2 pr-4 text-sm",children:[e.jsxs("div",{className:"flex w-0 flex-1 items-center",children:[e.jsx(R,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"ml-2 w-0 flex-1 truncate",children:t.name})]}),e.jsx("div",{className:"ml-4 shrink-0 space-x-2",children:e.jsxs("div",{className:"flex items-center space-x-3",children:[a&&e.jsx(y,{type:"button",onClick:a,className:" text-muted-foreground hover:text-muted-foreground border-0 font-medium shadow-none",children:e.jsx(O,{className:"text-muted-foreground h-4 w-4"})}),e.jsx(y,{type:"button",onClick:m,className:" text-muted-foreground hover:text-muted-foreground border-0 font-medium shadow-none",children:e.jsx(P,{className:"text-muted-foreground h-4 w-4"})})]})})]}):e.jsxs("div",{className:"flex select-none items-center justify-between space-x-2 py-1",children:[e.jsxs("div",{className:"flex grow items-center space-x-2 truncate py-1",children:[e.jsx(_,{className:N("h-6 w-6 shrink-0 text-teal-600")}),e.jsx("div",{className:"truncate text-sm font-medium",children:t.title})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(y,{disabled:o,onClick:()=>c(),className:"group p-2",children:e.jsx(V,{className:N("h-4 w-4",o?"opacity-80":"group-hover:text-foreground")})})})]})})}function Ne({name:t,title:d,initialMedia:c,disabled:m,onSelected:a,className:o,readOnly:T,required:U,min:ee,max:x,accept:h,hint:B,help:I,icon:se,maxSize:g,uploadText:L,autoFocus:S}){const{t:k}=K(),[C,p]=v.useState(void 0),[n,b]=v.useState(c??[]),[w,E]=v.useState();v.useEffect(()=>{a&&a(n)},[n]);function H(s){b(n.filter((r,i)=>i!==s))}function W(s){if(p(void 0),x&&s.length+n.length>x){p("Maximun number of files exceeded: "+x);return}if(g){const i=l=>l/1048576,f=s.find(l=>i(l.file.size)>g);if(f){p(`Max size is ${g} MB, found ${i(f.file.size).toFixed(2)}`);return}}if(h?.includes(".")){const i=h.split(",");if(s.map(l=>{let M="";return i.filter(j=>j).forEach(j=>{l.file.name.toLowerCase().endsWith(j.toLowerCase())&&(M=j)}),M?null:l}).find(l=>l!==null)){p("Invalid file type: "+h);return}}const r=[...n];s.forEach(({file:i,base64:f})=>{r.push({title:i.name.split(".").slice(0,-1).join("."),file:f,name:i.name,type:i.type})}),b(r)}function X(s){E(s)}function D(s){const r=document.createElement("a");r.href=s.publicUrl??s.file,r.download=s.name,r.click()}function u(){return m||T}return e.jsxs("div",{className:N(o,""),children:[e.jsxs("label",{htmlFor:t,className:"flex justify-between space-x-2 text-xs font-medium",children:[e.jsxs("div",{className:" flex items-center space-x-1",children:[e.jsx("div",{className:"truncate",children:d&&e.jsxs(e.Fragment,{children:[k(d),U&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),e.jsx("div",{className:"",children:I&&e.jsx(J,{text:I})})]}),e.jsx("div",{children:C&&e.jsx("span",{className:"text-red-500",children:C})}),B]}),e.jsxs("div",{className:"mt-1",children:[!u()&&n.length===0&&e.jsx(q,{name:t,disabled:u()||x!==void 0&&x<=n.length,multiple:!0,onDroppedFiles:W,accept:h,uploadText:L,autoFocus:S}),u()&&n.length===0&&e.jsx("div",{children:e.jsx("div",{className:"border-border flex h-12 w-full cursor-not-allowed items-center justify-center rounded-md border border-dashed",children:e.jsx("div",{className:"text-foreground text-xs",children:e.jsx("p",{children:k("shared.files.noFilesUploaded")})})})}),n.map((s,r)=>e.jsx("input",{type:"hidden",name:t+"[]",value:JSON.stringify(s)},r)),n.length>0?e.jsxs("div",{className:"space-y-2",children:[n.map((s,r)=>e.jsx(Z,{item:s,onChangeTitle:i=>G(n,b,r,{title:i,name:i+"."+s.name.split(".").slice(-1)[0]}),onDelete:()=>H(r),readOnly:u(),onDownload:()=>D(s),onPreview:s.type.includes("pdf")||s.type.includes("image")?()=>X(s):void 0},r)),e.jsx("div",{})]}):e.jsx("div",{}),u()&&n.filter(s=>s.type.includes("image")).length>0&&e.jsx("div",{className:"mt-2",children:e.jsx("div",{className:"grid gap-1  overflow-auto",children:n.filter(s=>s.type.includes("image")).map(s=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-muted-foreground text-xs",children:s.title}),e.jsx("img",{className:"border-border h-12 w-full rounded-md border border-dashed object-contain p-1 shadow-2xs",src:s.publicUrl??s.file,alt:s.title})]},s.name))})})]}),w&&e.jsx(Q,{item:w,onClose:()=>E(void 0),onDownload:()=>D(w)})]})}export{Ne as I,Q as P};

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.