PageSourceSearch

https://portals.noloco.io/assets/FilePreviewModal-CDWutLQL.js

js noloco.io collected 2026-10-03 21:23:27 UTC 3,646 bytes, 1 lines download raw bytes

1import{j as t}from"./jsx-runtime-esm-DkAt4wbo.js";import{F as j}from"./FilePreviewElement-DXfHiH4w.js";import{I as w,N as k}from"./tabs-BBTGYUlo.js";import{f,E,g as N,h as _,i as I,C as M,I as F,j as P}from"./app-x6fDPxye.js";import{a}from"./index-ByLmqo6e.js";import{R as C}from"./index-BXXzNVct.js";import{F as R}from"./user-avatar-DDG4jDfk.js";import"./index-ByInV43t.js";import"./Icon-oGravVff.js";import"./_commonjsHelpers-yjRi3dfI.js";import"./index-Cbqy7Iw-.js";import"./project-DLQ_xSEO.js";import"./with-selector-CogykupQ.js";import"./react-redux-YN15yk5j.js";import"./isEqual-DlV9wj1O.js";import"./useAuthWrapper-BfiReOjv.js";import"./normalizeDates-zLvF6tl8.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"5ee2174"},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=(function(d){for(var i=1;i<arguments.length;i++){var r=arguments[i];if(r!=null)for(var l in r)r.hasOwnProperty(l)&&(d[l]=r[l])}return d})({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:noloco-ui":!0});var o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="73eac404-b7b9-4060-b8a6-f5287e898970",e._sentryDebugIdIdentifier="sentry-dbid-73eac404-b7b9-4060-b8a6-f5287e898970")}catch{}})();const D=e=>e.stopPropagation(),Z=a.memo(({files:e,id:o,initialIndex:d,onClose:i,onRemove:r,queryFileId:l})=>{f(E,i,{preventDefault:!0});const{replaceQueryParams:x}=N(),[p,b]=a.useState(d||0),s=a.useMemo(()=>!o||!l?p:e.findIndex(u=>u.id===l),[e,o,p,l]),c=a.useMemo(()=>!!(s>0&&e[s-1]),[s,e]),m=a.useMemo(()=>s<e.length-1,[s,e]),h=a.useCallback(()=>{if(c)if(!o)b(s-1);else{const u=e[s-1];x({_fileId:String(u.id)})}},[s,e,c,o,x]),g=a.useCallback(()=>{if(m)if(!o)b(s+1);else{const u=e[s+1];x({_fileId:String(u.id)})}},[s,e,m,o,x]);f(_,h,{enabled:c}),f(I,g,{enabled:m});const n=a.useMemo(()=>e[s],[s,e]),v=a.useCallback(()=>{r&&n&&n.id&&r(n.id)},[n,r]);if(!n)return null;const y=t.jsx("div",{"aria-labelledby":"modal-title","aria-modal":"true",className:"pointer-events-auto fixed inset-0 z-9999 flex h-screen w-screen items-center justify-center bg-white dark:bg-stone-900",role:"dialog",children:t.jsxs("div",{className:"flex h-screen w-full flex-col overflow-hidden bg-white p-4 dark:bg-stone-900",onClick:D,children:[t.jsxs("div",{className:"mb-2 flex w-full items-center bg-white py-4 dark:bg-stone-900",children:[t.jsx("button",{"aria-label":"Close modal",className:"mr-4 p-1 text-stone-500 hover:text-stone-700 dark:text-stone-400 dark:hover:text-stone-200",onClick:i,children:t.jsx(w,{size:14})}),t.jsx("div",{className:"truncate pr-4 text-lg font-medium text-stone-900 dark:text-stone-100",id:"modal-title",children:n.name||""}),t.jsxs("div",{className:"ml-auto flex shrink-0",children:[r&&t.jsx(M,{className:"mr-2",onDelete:v}),t.jsx(R,{className:"mr-4 p-1",file:n}),(c||m)&&t.jsxs(t.Fragment,{children:[t.jsx("button",{"aria-label":"Previous file",className:"p-1 text-stone-500 hover:text-stone-700 disabled:opacity-50 dark:text-stone-400 dark:hover:text-stone-200",disabled:!c,onClick:h,children:t.jsx(F,{size:20})}),t.jsx("button",{"aria-label":"Next file",className:"ml-2 p-1 text-stone-500 hover:text-stone-700 disabled:opacity-50 dark:text-stone-400 dark:hover:text-stone-200",disabled:!m,onClick:g,children:t.jsx(P,{size:20})})]})]})]}),t.jsx("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden",children:t.jsx(j,{file:n})})]})});return C.createPortal(t.jsx(k,{children:y}),document.body)});
1export{Z 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.