PageSourceSearch

https://www.paperclip.fyi/assets/ErrorContext-BeBfchZe.js

js paperclip.fyi collected 2026-09-24 15:01:10 UTC 4,206 bytes, 7 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GoogleAnalytics-fvyrpq7T.js","assets/react-vendor-q1XEArln.js","assets/router-D0jjFGd1.js","assets/AuthProvider-vDMTCKEq.js","assets/supabase-D48Cuo4e.js","assets/sentry-client-BsPf0hor.js","assets/session-manager-B0_T4B2G.js","assets/supabase-ouukccQe.js","assets/utm-CQjlBfjO.js"])))=>i.map(i=>d[i]);
2import{_ as E}from"./supabase-D48Cuo4e.js";import{j as r,r as a}from"./react-vendor-q1XEArln.js";import{X as j,I as v,u as C,b as N,c as T}from"./icons-Cj0dM6Gf.js";import{p as _}from"./portal-api-C3iyuvRk.js";import{c as z}from"./sentry-client-BsPf0hor.js";function I({toast:e,onDismiss:o}){const[i,c]=a.useState(!1);a.useEffect(()=>{c(!0);const x=e.duration||(e.type==="error"?6e3:4e3),m=setTimeout(()=>{c(!1),setTimeout(()=>o(e.id),300)},x);return()=>clearTimeout(m)},[e.id,e.duration,e.type,o]);const u=()=>{switch(e.type){case"success":return r.jsx(T,{size:20,className:"text-green-600 dark:text-green-400"});case"error":return r.jsx(N,{size:20,className:"text-red-600 dark:text-red-400"});case"warning":return r.jsx(C,{size:20,className:"text-yellow-600 dark:text-yellow-400"});case"info":return r.jsx(v,{size:20,className:"text-blue-600 dark:text-blue-400"})}},l=()=>{switch(e.type){case"success":return"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800 text-green-900 dark:text-green-200";case"error":return"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800 text-red-900 dark:text-red-200";case"warning":return"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800 text-yellow-900 dark:text-yellow-200";case"info":return"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800 text-blue-900 dark:text-blue-200"}};return r.jsx("div",{className:`
3        ${l()}
4        border rounded-lg p-4 shadow-lg min-w-[300px] max-w-md
5        transform transition-all duration-300 ease-in-out
6        ${i?"translate-x-0 opacity-100":"translate-x-full opacity-0"}
7      `,children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"flex-shrink-0 mt-0.5",children:u()}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium",children:e.message}),e.action&&r.jsx("button",{onClick:()=>{e.action.onClick(),o(e.id)},className:"mt-2 text-sm font-semibold underline hover:no-underline",children:e.action.label})]}),r.jsx("button",{onClick:()=>{c(!1),setTimeout(()=>o(e.id),300)},className:"flex-shrink-0 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors","aria-label":"Dismiss",children:r.jsx(j,{size:18})})]})})}function P({toasts:e,onDismiss:o}){return e.length===0?null:r.jsx("div",{className:"fixed top-4 right-4 z-[100] flex flex-col gap-2 pointer-events-none",children:e.map(i=>r.jsx("div",{className:"pointer-events-auto",children:r.jsx(I,{toast:i,onDismiss:o})},i.id))})}let b=null;function S(e,o){b||(b=E(()=>import("./GoogleAnalytics-fvyrpq7T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),b.then(({trackError:i})=>{i(e,o)}).catch(()=>{})}const f=a.createContext(void 0);function G({children:e}){const[o,i]=a.useState([]),[c,u]=a.useState(null),l=a.useCallback((n,t,s)=>{const d=`toast-${Date.now()}-${Math.random()}`,y={id:d,type:n,message:t,duration:s?.duration,action:s?.action};return i(w=>[...w,y]),d},[]),x=a.useCallback(n=>{i(t=>t.filter(s=>s.id!==n))},[]),m=a.useCallback((n,t)=>{const s=_(n);u(s),t?.logToSentry!==!1&&z(s,{userFacing:!0,...t}),t?.trackGA!==!1&&S(s,{error_code:s.code,error_message:s.message,retryable:s.retryable,error_location:window.location.pathname});const d={};t?.retry&&s.retryable&&(d.action={label:"Retry",onClick:t.retry}),l("error",s.message,{duration:6e3,...d})},[l]),g=a.useCallback((n,t)=>{l("success",n,t)},[l]),k=a.useCallback((n,t)=>{l("warning",n,t)},[l]),h=a.useCallback((n,t)=>{l("info",n,t)},[l]),p=a.useCallback(()=>{u(null)},[]);return r.jsxs(f.Provider,{value:{showError:m,showSuccess:g,showWarning:k,showInfo:h,clearError:p,currentError:c},children:[e,r.jsx(P,{toasts:o,onDismiss:x})]})}function M(){const e=a.useContext(f);if(!e)throw new Error("useError must be used within ErrorProvider");return e}export{G as E,M as u};

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.