PageSourceSearch

https://shelfy.so/_next/static/chunks/59185-651ffccdeae5d22c.js

js shelfy.so collected 2026-10-09 22:42:27 UTC 29,232 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[59185],{20470:(e,t,r)=>{r.d(t,{x:()=>n});var a=r(95155);r(12115);let s=/^(the|a|an)\s+/i;function n(e){let{title:t,source:r,size:n,fill:i=!1,letterSize:l,tldSize:o,className:d=""}=e,c=(e=>{let t=(null!=e?e:"").trim();return t?((t.replace(s,"").trim()||t).charAt(0)||"?").toUpperCase():"?"})(t),x=(e=>{if(!e)return"";let t=e.trim();try{t=new URL(t.includes("://")?t:"https://".concat(t)).hostname}catch(e){t=t.replace(/^[a-z]+:\/\//i,"").replace(/\/.*$/,"")}let r=t.split(".").filter(Boolean);return r.length<2?"":".".concat(r[r.length-1].toUpperCase())})(r),m=null!=n?n:80,u=null!=o?o:Math.max(7,.16*m);return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-lg bg-[#F3F4F6] overflow-hidden ".concat(i?"w-full h-full":""," ").concat(d),style:i?{}:{width:null!=n?n:m,height:null!=n?n:m},"aria-hidden":"true",children:[(0,a.jsx)("span",{className:"font-sans font-semibold select-none text-gray-700",style:{fontSize:null!=l?l:.38*m,letterSpacing:"-0.02em",lineHeight:1},children:c}),m>24&&!!x&&(0,a.jsx)("span",{className:"font-sans font-bold select-none",style:{color:"#6B7280",fontSize:u,letterSpacing:"0.6px",marginTop:1,lineHeight:1},children:x})]})}},28807:(e,t,r)=>{r.d(t,{N:()=>i});var a=r(12115),s=r(42138),n=r(79933);function i(e){var t;let{resource:r,collectionId:i}=e,{toast:l}=(0,n.dj)(),[o,d]=(0,a.useState)(!1),[c]=(0,s.useUpdateResourceStatesMutation)(),[x]=(0,s.useArchiveResourceMutation)(),[m]=(0,s.useRestoreResourceMutation)(),[u]=(0,s.usePinResourceMutation)(),[g]=(0,s.useUnpinResourceMutation)(),[p]=(0,s.useDeleteResourceMutation)(),h=(null==r?void 0:r.title)||(null==r?void 0:r.file_name)||"Untitled",y=null==r||null==(t=r.id)?void 0:t.toString(),v=i||(null==r?void 0:r.collection_id),b=(0,a.useCallback)(async()=>{try{await c({resourceId:y,states:{is_favorite:!0}}).unwrap(),l({title:"Added to favorites",description:'"'.concat(h,'" has been added to your favorites')})}catch(e){console.error("❌ Failed to add to favorites:",e),l({variant:"destructive",title:"Error",description:"Failed to add to favorites."})}},[y,h,c,l]),f=(0,a.useCallback)(async()=>{try{await c({resourceId:y,states:{is_favorite:!1}}).unwrap(),l({title:"Removed from favorites",description:'"'.concat(h,'" has been removed from your favorites')})}catch(e){console.error("❌ Failed to remove from favorites:",e),l({variant:"destructive",title:"Error",description:"Failed to remove from favorites."})}},[y,h,c,l]),j=(0,a.useCallback)(async()=>{try{await c({resourceId:y,states:{in_reading_list:!0}}).unwrap(),l({title:"Added to reading list",description:'"'.concat(h,'" has been added to your reading list')})}catch(e){console.error("❌ Failed to add to reading list:",e),l({variant:"destructive",title:"Error",description:"Failed to add to reading list."})}},[y,h,c,l]),k=(0,a.useCallback)(async()=>{try{await c({resourceId:y,states:{in_reading_list:!1}}).unwrap(),l({title:"Removed from reading list",description:'"'.concat(h,'" has been removed from your reading list')})}catch(e){console.error("❌ Failed to remove from reading list:",e),l({variant:"destructive",title:"Error",description:"Failed to remove from reading list."})}},[y,h,c,l]),w=(0,a.useCallback)(async()=>{try{await c({resourceId:y,states:{is_read:!0}}).unwrap(),l({title:"Marked as read",description:'"'.concat(h,'" has been marked as read')})}catch(e){console.error("❌ Failed to mark as read:",e),l({variant:"destructive",title:"Error",description:"Failed to mark as read."})}},[y,h,c,l]),N=(0,a.useCallback)(async()=>{try{await c({resourceId:y,states:{is_read:!1}}).unwrap(),l({title:"Unmarked as read",description:'"'.concat(h,'" has been unmarked as read')})}catch(e){console.error("❌ Failed to unmark as read:",e),l({variant:"destructive",title:"Error",description:"Failed to unmark as read."})}},[y,h,c,l]),C=(0,a.useCallback)(async()=>{try{await x({resourceId:y,collectionId:null==v?void 0:v.toString()}).unwrap(),l({title:"Resource archived",description:'"'.concat(h,'" has been archived')})}catch(e){console.error("❌ Failed to archive resource:",e),l({variant:"destructive",title:"Error",description:"Failed to archive resource."})}},[y,h,v,x,l]),_=(0,a.useCallback)(async()=>{try{await m({resourceId:y,collectionId:null==v?void 0:v.toString()}).unwrap(),l({title:"Resource restored",description:'"'.concat(h,'" has been restored from archive')})}catch(t){var e;console.error("❌ Failed to restore resource:",t),l({variant:"destructive",title:"Error",description:(null==t||null==(e=t.data)?void 0:e.message)||"Failed to restore resource."})}},[y,h,v,m,l]),F=(0,a.useCallback)(async()=>{try{await p({id:null==r?void 0:r.id,collectionId:null==r?void 0:r.collection_id}).unwrap(),d(!1),l({title:"Resource deleted",description:"The resource has been deleted permanently"})}catch(e){console.error("Failed to delete resource:",e),l({variant:"destructive",title:"Error",description:"Failed to delete resource."})}},[null==r?void 0:r.id,null==r?void 0:r.collection_id,p,l]),D=(0,a.useCallback)(async()=>{try{await u({resourceId:y,context:"home"}).unwrap(),l({title:"Pinned to Dashboard",description:'"'.concat(h,'" has been pinned to your dashboard')})}catch(e){l({variant:"destructive",title:"Error",description:"Failed to pin to dashboard."})}},[y,h,u,l]);return{isAlertOpen:o,setIsAlertOpen:d,handleFavorite:b,handleUnfavorite:f,handleReadLater:j,handleUnreadLater:k,handleMarkRead:w,handleUnmarkRead:N,handleArchive:C,handleRestore:_,handleDelete:F,handlePinToHome:D,handlePinToCollection:(0,a.useCallback)(async()=>{try{await u({resourceId:y,context:"collection",context_id:null==v?void 0:v.toString()}).unwrap(),l({title:"Pinned to Collection",description:'"'.concat(h,'" has been pinned to this collection')})}catch(e){l({variant:"destructive",title:"Error",description:"Failed to pin to collection."})}},[y,h,v,u,l]),handleUnpin:(0,a.useCallback)(async e=>{try{let t=e||(null==r?void 0:r.pinned_context)||"home",a=(null==r?void 0:r.pinned_context_id)||(null==v?void 0:v.toString());await g({resourceId:y,context:t,context_id:"collection"===t?a:void 0}).unwrap(),l({title:"Unpinned",description:'"'.concat(h,'" has been unpinned')})}catch(e){l({variant:"destructive",title:"Error",description:"Failed to unpin."})}},[y,h,null==r?void 0:r.pinned_context,null==r?void 0:r.pinned_context_id,v,g,l])}}},59185:(e,t,r)=>{r.r(t),r.d(t,{Home:()=>$});var a=r(95155),s=r(12115),n=r(2644),i=r(93499),l=r(45532),o=r(16105),d=r(77317),c=r(23083),x=r(47089),m=r(94161),u=r(63892),g=r(20781),p=r(97756),h=r(28649),y=r(27056),v=r(21350),b=r(18186),f=r(20063),j=r(65848),k=r(80345),w=r(28807),N=r(69542),C=r(20470),_=r(18130);let F=(0,s.memo)(function(e){let{resource:t,collection:r,collectionId:n}
1=e,[i,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),c=(0,f.useRouter)(),{isSelectionMode:x,isSelected:g,toggleSelection:p}=(0,N.K)(),{buildResourceUrl:h}=(0,m.j)(),y=n||t.collection_id||(null==r?void 0:r.id)||null,{isAlertOpen:v,setIsAlertOpen:F,handleFavorite:D,handleUnfavorite:S,handleReadLater:A,handleUnreadLater:R,handleMarkRead:E,handleUnmarkRead:M,handleArchive:L,handleRestore:U,handleDelete:T,handlePinToHome:I,handlePinToCollection:O,handleUnpin:P}=(0,w.N)({resource:t,collectionId:y}),z="in_progress"===t.fetching_status,G=h(t.id.toString()),B=x&&g(t.id.toString()),$=(0,s.useCallback)(e=>{var t,r;(null==(t=(r=window).matchMedia)?void 0:t.call(r,"(hover: hover)").matches)?window.open(e,"_blank","noopener,noreferrer"):window.location.assign(e)},[]),H=(0,s.useCallback)(()=>{if(x)return void p(t.id.toString());c.push(G,{scroll:!1})},[x,t.id,p,c,G]),V=(()=>{var e,r;switch(t.kind){case b.v.URL:return(0,_.S)(t.url)||t.url||"";case b.v.IMAGE:case b.v.FILE:return(e=t.file_size)?"".concat((e/1048576).toFixed(1)," MB"):"";case b.v.NOTE:case b.v.VOICE_NOTE:return(r=t.created_at)?new Date(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"";default:return""}})(),Q=t.url;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{role:"link",tabIndex:0,onClick:H,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),H())},className:"group relative flex items-center gap-3 p-2 bg-white dark:bg-gray-600 border border-gray-100 dark:border-gray-600 rounded-md transition-all duration-200 cursor-pointer shadow-xs ".concat(B?"ring-2 ring-blue-500 bg-blue-50 dark:bg-blue-500/10":"lg:hover:ring-3 lg:hover:ring-[#0D99FF]"),children:[(0,a.jsx)("div",{className:"w-[43px] h-[43px] flex-shrink-0 rounded-md overflow-hidden bg-gray-50 dark:bg-gray-700 relative",children:t.thumbnail_url&&!o?(0,a.jsx)("img",{src:t.thumbnail_url,alt:"",className:"w-full h-full object-cover",loading:"lazy",onError:()=>d(!0)}):(0,a.jsx)(C.x,{fill:!0,title:t.title,source:t.url,letterSize:20,tldSize:9,className:"!rounded-none !border-0"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"font-medium text-sm text-gray-900 dark:text-gray-100 truncate",title:t.title||"No Title",children:t.title||"No Title"}),V&&(0,a.jsx)("p",{className:"font-regular text-xs text-gray-500 dark:text-gray-400 truncate mt-0.5",title:V,children:V})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[Q&&(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),$(Q)},className:"bg-white dark:bg-gray-600 rounded-sm p-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer",title:"Open link in new tab",children:(0,a.jsx)("span",{className:"text-[#5D5D5D] dark:text-gray-400",children:(0,a.jsx)(u.A,{name:"Arrowuprightfilled",width:18,height:18})})}),(0,a.jsx)(j.A,{link:t,collection:r||{id:y||62,permission:"admin"},isMenuOpen:i,setIsMenuOpen:l,setIsAlertOpen:F,onFavorite:D,onUnfavorite:S,onReadLater:A,onUnreadLater:R,onMarkRead:E,onUnmarkRead:M,onMove:()=>{},onArchive:L,onRestore:U,onPinToHome:I,onPinToCollection:O,onUnpin:P,customTrigger:(0,a.jsx)("button",{type:"button",className:"bg-white dark:bg-gray-600 rounded-sm p-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer",onClick:e=>{e.stopPropagation()},children:(0,a.jsx)("span",{className:"text-[#5D5D5D] dark:text-gray-400",children:(0,a.jsx)(u.A,{name:"Moremenu",width:18,height:18})})})})]}),z&&(0,a.jsx)("div",{className:"absolute inset-0 bg-black/10 flex items-center justify-center rounded-md z-10",children:(0,a.jsx)("div",{className:"w-6 h-6 border-3 border-white border-t-transparent rounded-full animate-spin"})})]}),(0,a.jsx)(k.A,{isOpen:v,onOpenChange:F,onDelete:T})]})});var D=r(97328),S=r(97545),A=r(51834),R=r(69560);function E(e){let{isOpen:t,onClose:r,stats:s,isLoading:n}=e;return(0,a.jsx)(A.lG,{open:t,onOpenChange:e=>!e&&r(),children:(0,a.jsxs)(A.Cf,{className:"sm:max-w-[780px] p-8 rounded-2xl",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,a.jsxs)(A.c7,{className:"relative",children:[(0,a.jsx)("button",{type:"button",onClick:r,className:"absolute right-0 top-0 w-8 h-8 flex items-center justify-center rounded-md hover:bg-gray-100 dark:hover:bg-gray-600 transition-colors cursor-pointer","aria-label":"Close",children:(0,a.jsx)(u.A,{name:"Close",width:16,height:16,color:"#5d5d5d"})}),(0,a.jsx)(A.L3,{className:"text-gray-900 dark:text-gray-100",children:"Usage Statistics"}),(0,a.jsx)(A.rr,{className:"text-gray-600 dark:text-gray-400",children:"Your account usage and limits"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-5 py-6",children:[(0,a.jsx)("div",{className:"bg-white dark:bg-gray-600 p-4 sm:p-5 rounded-[10px] border border-gray-100 dark:border-gray-600 flex justify-between items-center",style:{boxShadow:"0 1px 3px rgba(0, 0, 0, 0.05)"},children:(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[11px] sm:text-xs font-medium text-gray-500 dark:text-gray-400",children:"Total Saves"}),(0,a.jsx)("div",{className:"text-[22px] sm:text-[28px] font-semibold leading-none pb-1 pt-2 sm:pb-2 sm:pt-3 text-gray-900 dark:text-gray-100",children:n?(0,a.jsx)("div",{className:"w-8 h-8 border-2 border-gray-300 dark:border-gray-600 border-t-blue-500 rounded-full animate-spin"}):s.totalSaves}),(0,a.jsx)("div",{className:"text-[11px] sm:text-sm font-medium text-gray-500 dark:text-gray-400",children:"Resources"})]})}),(0,a.jsxs)("div",{style:{boxShadow:"0 1px 3px rgba(0, 0, 0, 0.05)"},className:"bg-white dark:bg-gray-600 p-4 sm:p-5 rounded-[10px] border border-gray-100 dark:border-gray-600 flex justify-between items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[11px] sm:text-xs font-medium text-gray-500 dark:text-gray-400",children:"Reminders"}),(0,a.jsx)("div",{className:"text-[22px] sm:text-[28px] font-semibold leading-none pb-1 pt-2 sm:pb-2 sm:pt-3 text-gray-900 dark:text-gray-100",children:s.reminders}),(0,a.jsx)("div",{className:"text-[11px] sm:text-sm font-medium text-gray-500 dark:text-gray-400",children:"Resources"})]}),(0,a.jsx)("div",{className:"text-[#D0D5DD] dark:text-gray-400 flex-shrink-0",children:(0,a.jsx)(u.A,{name:"Calendar",width:40,height:40})})]}),(0,a.jsxs)("div",{style:{boxShadow:"0 1px 3px rgba(0, 0, 0, 0.05)"},className:"bg-white dark:bg-gray-600 p-4 sm:p-5 rounded-[10px] border border-gray-100 dark:border-gray-600 flex justify-between items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[11px] sm:text-xs font-medium text-gray-500 dark:text-gray-400",children:"Reading List"}),(0,a.jsx)("div",{className:"text-[22px] sm:text-[28px] font-semibold leading-none pb-1 pt-2 sm:pb-2 sm:pt-3 text-gray-900 dark:text-gray-100",children:s.reading}),(0,a.jsx)("div",{className:"text-[11px] sm:text-sm font-medium text-gray-500 dark:text-gray-400",children:"Resources"})]}),(0,a.jsx)("div",{className:"text-[#D0D5DD] dark:text-gray-400 flex-shrink-0",children:(0,a.jsx)(u.A,{name:"Reading",width:40,height:40})})]}),(0,a.jsxs)("div",{style:{boxShadow:"0 1px 3px rgba(0, 0, 0, 0.05)"},className:"bg-white dark:bg-gray-600 p-4 sm:p-5 rounded-[10px] border border-gray-100 dark:border-gray-600 flex justify-between items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[11px] sm:text-xs font-medium text-gray-500 dark:text-gray-400",children:"AI Credits Used"}),(0,a.jsx)("div",{className:"text-[22px] sm:text-[28px] font-semibold leading-none pb-1 pt-2 sm:pb-2 sm:pt-3 text-gray-900 dark:text-gray-100",children:s.aiCreditsUsed}),(0,a.jsxs)("div",{className:"text-[11px] sm:text-sm font-medium text-gray-500 dark:text-gray-400",children:[s.aiCreditsTotal-s.aiCreditsUsed," / ",s.aiCreditsTotal," Credits Left"]})]}),(0,a.jsx)("div",{className:"text-[#D0D5DD] dark:text-gray-400 flex-shrink-0",children:(0,a.jsx)(u.A,{name:"Flame",width:40,height:40})})]}),(0,a.jsxs)("div",{style:{boxShadow:"0 1px 3px rgba(0, 0, 0, 0.05)"},className:"bg-white dark:bg-gray-600 p-4 sm:p-5 rounded-[10px] border border-gray-100 dark:border-gray-600 flex justify-between items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[11px] sm:text-xs font-medium text-gray-500 dark:text-gray-400",children:"Storage Used"}),(0,a.jsxs)("div",{className:"text-[22px] sm:text-[28px] font-semibold leading-none pb-1 pt-2 sm:pb-2 sm:pt-3 text-gray-900 dark:text-gray-100",children:[s.storage,"mb"]}),(0,a.jsxs)("div",{className:"text-[11px] sm:text-sm font-medium text-gray-500 dark:text-gray-400",children:[s.storageTotal-s.storage," / ",s.storageTotal,"mb Left"]})]}),(0,a.jsx)("div",{className:"text-gray-300 dark:text-gray-400 flex-shrink-0",children:(0,a.jsx)(R.A,{used:s.storage,total:s.storageTotal,size:40})})]})]})]})})}var M=r(52619),L=r.n(M),U=r(22629),T=r(28437),I=r(61143),O=r(71227),P=r(32107);let z=[{key:"addResource",label:"Adding Resources",emoji:"\uD83D\uDCCE"},{key:"collection",label:"Using Collections",emoji:"\uD83D\uDCC1"},{key:"shuffles",label:"What are Shuffles?",emoji:"✨"},{key:"reminders",label:"Reminders",emoji:"\uD83D\uDD14"},{key:"readingList",label:"Reading List",emoji:"\uD83D\uDCD6"},{key:"duplicates",label:"Duplicates Finder",emoji:"\uD83E\uDDF9"},{key:"pinned",label:"Pinned Resources",emoji:"\uD83D\uDCCC"}];function G(){let{isDismissed:e,dismiss:t}
1=(0,P.n)(),[r,n]=(0,s.useState)(null);return e?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mb-10",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Getting Started"}),(0,a.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors cursor-pointer p-1 rounded","aria-label":"Dismiss getting started",children:(0,a.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 14 14",fill:"none",children:(0,a.jsx)("path",{d:"M1 1l12 12M13 1L1 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:z.map(e=>(0,a.jsxs)("button",{onClick:()=>n(e.key),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-gray-100 dark:bg-gray-600/70 hover:bg-gray-200 dark:hover:bg-gray-500 transition-colors cursor-pointer text-sm text-gray-700 dark:text-gray-200",children:[(0,a.jsx)("span",{"aria-hidden":"true",children:e.emoji}),e.label]},e.key))})]}),(0,a.jsx)(S.A,{isOpen:!!r,onClose:()=>n(null),videoUrl:r?S.m[r]:void 0})]})}function B(e){let{item:t}=e;return t.kind===b.v.URL?(0,a.jsx)(p.A,{resource:t}):t.kind===b.v.IMAGE||t.kind===b.v.FILE&&"image"===t.sub_kind?(0,a.jsx)(h.A,{resource:t}):t.kind===b.v.FILE?(0,a.jsx)(v.A,{resource:t}):t.kind===b.v.NOTE||t.kind===b.v.VOICE_NOTE?(0,a.jsx)(y.A,{resource:t}):null}let $=(0,s.memo)(function(){var e,t,r,p,h,y,v,b,j,k,w,N,C,_;let A=(0,f.usePathname)(),R=(0,f.useRouter)(),{buildResourceUrl:M}=(0,m.j)(),[P,z]=(0,s.useState)(null),[$,H]=(0,s.useState)(!1),V=(0,n.tg)(A)&&"/"!==A,Q=(0,d.d4)(c.mB),{data:W}=(0,x.useGetMeQuery)(void 0,{skip:V}),{data:Y,isLoading:K}=(0,l.useGetStatsQuery)(void 0,{skip:V,refetchOnMountOrArgChange:30}),{data:Z,isLoading:q}=(0,o.useGetRecentlyAddedQuery)(void 0,{skip:V}),{isSidebarOpen:J,toggleSidebar:X}=(0,D.cL)(),ee=(null==Q?void 0:Q.first_name)?"".concat(Q.first_name," ").concat(Q.last_name||"").trim():(null==Q?void 0:Q.email)||"User",et=(null==W||null==(t=W.current_account)||null==(e=t.feature_flags)?void 0:e.ai_credits)||0,er=(null==W||null==(p=W.current_account)||null==(r=p.feature_flags)?void 0:r.storage_mb)||0,ea=(null==Q?void 0:Q.used_ai_credits)||0,es=(null==Q?void 0:Q.used_megabytes)||0,en={totalSaves:(null==Y||null==(y=Y.data)||null==(h=y.resources)?void 0:h.total_saved)||0,reminders:(null==Y||null==(b=Y.data)||null==(v=b.reminders)?void 0:v.count)||0,reading:(null==Y||null==(k=Y.data)||null==(j=k.reading_list)?void 0:j.count)||0,aiCreditsUsed:ea,aiCreditsTotal:et,storage:es,storageTotal:er},ei=s.useMemo(()=>{var e;return((null==Y||null==(e=Y.data)?void 0:e.pinned_items)||[]).map(e=>{let t=e.pinnable;return t?{...t,is_pinned:!0,has_home_pin:!0,pinned_context:"home"}:null}).filter(Boolean)},[Y]),el=s.useMemo(()=>{var e;return((null==Y||null==(e=Y.data)?void 0:e.recently_visited)||[]).filter(Boolean).slice(0,5)},[Y]),eo=s.useMemo(()=>{var e;return(null==Z?void 0:Z.data)?Array.isArray(Z.data)?Z.data:(null==(e=Z.data)?void 0:e.resources)||[]:[]},[Z]);return s.useEffect(()=>{eo.length>0&&R.prefetch(M(eo[0].id.toString()))},[eo,R,M]),(0,a.jsxs)("div",{className:"relative flex flex-col w-full px-5 py-8 bg-white dark:bg-gray-700 overflow-x-hidden",children:[!J&&(0,a.jsx)("button",{type:"button",className:"fixed top-5 left-5 z-50 hidden lg:flex items-center justify-center cursor-pointer p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-600 transition-colors bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-700 shadow-sm",onClick:X,"aria-label":"Show sidebar",children:(0,a.jsx)("span",{className:"text-[#5D5D5D] dark:text-gray-400",children:(0,a.jsx)(u.A,{name:"SidebarToggle",width:20,height:20})})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4 mb-8 max-w-full",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:["Good afternoon, ",(0,a.jsxs)("span",{className:"text-orange-500",children:[ee,"!"]})]}),(0,a.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:["You are currently on a"," ",(0,a.jsx)("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:(null==W||null==(w=W.current_account)?void 0:w.plan)==="pro_agent"?"Pro Agent":(null==W||null==(N=W.current_account)?void 0:N.plan)==="pro"?"Pro":"Free"})," ","Plan"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2.5 sm:gap-3 sm:flex-shrink-0",children:[(0,a.jsx)(g.$,{variant:"dark",className:"px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium whitespace-nowrap",onClick:()=>H(!0),children:"Usage Stats"}),(0,a.jsx)(g.$,{variant:"dark",className:"px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium whitespace-nowrap",onClick:()=>R.push("/pricing-plans"),children:(null==W||null==(C=W.current_account)?void 0:C.plan)&&"free"!==W.current_account.plan?"Manage Subscription":"Upgrade Plan"}),(0,a.jsxs)(g.$,{variant:"dark",className:"px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium flex items-center gap-1 sm:gap-1.5 whitespace-nowrap",onClick:()=>window.open("https://www.youtube.com/@shelfyapp","_blank"),children:["Tutorials",(0,a.jsx)(i.A,{size:13,className:"sm:w-3.5 sm:h-3.5"})]})]})]}),(0,a.jsx)(G,{}),(0,a.jsxs)("div",{className:"mb-10",children:[(0,a.jsx)("h2",{className:"text-sm font-medium mb-2 text-gray-900 dark:text-gray-100",children:"Pinned Items"}),K?(0,a.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3 py-2",children:Array.from({length:6}).map((e,t)=>(0,a.jsx)("div",{className:"h-[63px] bg-gray-100 dark:bg-gray-600 rounded-md animate-pulse"},t))}):ei.length>0?(0,a.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3 py-2",children:ei.map(e=>(0,a.jsx)(F,{resource:e},e.id))}):(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-700 mt-[10px]",children:[(0,a.jsx)("p",{className:"text-[#5D5D5D] dark:text-gray-400 font-regular text-sm mb-1",children:"No pinned items yet."}),(0,a.jsx)("button",{type:"button",onClick:()=>z("pinned"),className:"text-[#0D99FF] font-regular text-sm hover:underline cursor-pointer",children:"Learn more about pinned items"})]})]}),(0,a.jsxs)("div",{className:"mb-10",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Recently Visited"}),K?(0,a.jsx)("div",{className:"flex gap-4 sm:gap-8 overflow-x-auto py-2 -mx-5 px-5",children:Array.from({length:5}).map((e,t)=>(0,a.jsx)("div",{className:"flex-shrink-0 w-[180px] sm:w-[220px] h-[150px] sm:h-[196px] bg-gray-100 dark:bg-gray-600 rounded-[10px] animate-pulse"},t))}):el.length>0?(0,a.jsx)("div",{className:"flex gap-4 sm:gap-8 overflow-x-auto py-2 -mx-5 px-5",children:el.map(e=>(0,a.jsx)("div",{className:"flex-shrink-0 w-[180px] sm:w-[220px] h-[150px] sm:h-[196px] relative z-10",children:(0,a.jsx)(B,{item:e})},e.id))}):(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-700 py-2",children:[(0,a.jsx)("p",{className:"text-[#5D5D5D] dark:text-gray-400 font-regular text-sm",children:"No items added yet."}),(0,a.jsx)("button",{type:"button",onClick:()=>z("addResource"),className:"text-[#0D99FF] font-regular text-sm hover:underline cursor-pointer",children:"Learn more about adding resources"})]})]}),(0,a.jsxs)("div",{className:"mb-10",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Recently Added"}),q?(0,a.jsx)("div",{className:"flex gap-4 sm:gap-8 overflow-x-auto py-2 -mx-5 px-5",children:Array.from({length:5}).map((e,t)=>(0,a.jsx)("div",{className:"flex-shrink-0 w-[180px] sm:w-[220px] h-[150px] sm:h-[196px] bg-gray-100 dark:bg-gray-600 rounded-[10px] animate-pulse"},t))}):eo.length>0?(0,a.jsx)("div",{className:"flex gap-4 sm:gap-8 overflow-x-auto py-2 -mx-5 px-5",children:eo.map(e=>(0,a.jsx)("div",{className:"flex-shrink-0 w-[180px] sm:w-[220px] h-[150px] sm:h-[196px] relative z-10",children:(0,a.jsx)(B,{item:e})},e.id))}):(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-700 py-2",children:[(0,a.jsx)("p",{className:"text-[#5D5D5D] dark:text-gray-400 font-regular text-sm",children:"No items added yet."}),(0,a.jsx)("button",{type:"button",onClick:()=>z("addResource"),className:"text-[#0D99FF] font-regular text-sm hover:underline cursor-pointer",children:"Learn more about adding resources"})]})]}),(0,a.jsxs)("div",{className:"mb-10",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Reminders"}),(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-700 py-2",children:[(0,a.jsx)("p",{className:"text-[#5D5D5D] dark:text-gray-400 font-regular text-sm mb-1",children:"No upcoming reminders."}),(0,a.jsx)("button",{type:"button",onClick:()=>z("reminders"),className:"text-[#0D99FF] font-regular text-sm hover:underline cursor-pointer",children:"Learn more about Reminders"})]})]}),(0,a.jsxs)("div",{className:"mb-10",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsx)("h2",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Shelfy Apps"})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,a.jsx)(U.A,{name:"Shelfy Browser Extension",description:"Save anything from the web with one click",logoImage:"/images/integrations/chrome.png",actionLabel:"Get Extension",onAction:()=>window.open("https://chromewebstore.google.com/detail/shelfyso-smart-web-resour/fldjjikpamfnfleoleonpjglapbmemam?utm_source=item-share-cb","_blank")}),(0,a.jsx)(U.A,{name:"Shelfy Mobile App",description:"Access your shelves on the go, anywhere",logoElement:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("img",{src:"/images/integrations/apple.png",alt:"Apple",className:"h-9 w-9 rounded-lg"}),(0,a.jsx)("img",{src:"/images/integrations/android.png",alt:"Android",className:"h-9 w-9 rounded-lg"})]}),actionLabel:"Coming Very Soon"})]})]}),(0,a.jsxs)("div",{className:"mb-10",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Import"}),(0,a.jsx)(L(),{href:"/import-integrations",className:"text-[#0D99FF] font-regular text-sm hover:underline",children:"Show more"})]}),W&&(!(null==(_=W.current_account)?void 0:_.plan)||"free"===W.current_account.plan)&&(0,a.jsxs)("p",{className:"mt-1 mb-3 text-xs text-gray-500 dark:text-gray-400",children:["Your free plan covers bulk imports of up to 1,000 resources."," ",(0,a.jsx)("button",{type:"button",onClick:()=>R.push("/pricing-plans"),className:"text-[#0D99FF] hover:underline cursor-pointer",children:"Upgrade to import larger bulk imports."})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-4",children:I.q.slice(0,2).map(e=>(0,a.jsx)(T.A,{provider:e},e.id))})]}),(0,a.jsxs)("div",{className:"mb-10",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Integrations"}),(0,a.jsx)(L(),{href:"/import-integrations",className:"text-[#0D99FF] font-regular text-sm hover:underline",children:"Show more"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-4",children:O.T.slice(0,2).map(e=>(0,a.jsx)(U.A,{name:e.name,description:e.description,logoText:e.logoText,logoClassName:e.logoClassName,logoImage:e.logoImage,actionLabel:"Coming Soon"},e.id))})]}),(0,a.jsx)(E,{isOpen:$,onClose:()=>H(!1),stats:en,isLoading:K}),(0,a.jsx)(S.A,{isOpen:!!P,onClose:()=>z(null),videoUrl:P?S.m[P]:void 0})]})})},69560:(e,t,r)=>{r.d(t,{A:()=>s});var a=r(95155);r(12115);let s=e=>{let{used:t,total:r,size:s=40}=e,n=r>0?t/r*100:0,i=s/2,l=s/2,o=s/2-1,d=n/100*2*Math.PI-Math.PI/2,c=i+o*Math.cos(d),x=l+o*Math.sin(d),m=n>0?"M ".concat(i," ").concat(l," L ").concat(i," ").concat(l-o," A ").concat(o," ").concat(o," 0 ").concat(+(n>50)," 1 ").concat(c," ").concat(x," Z"):"";return(0,a.jsx)("div",{className:"relative",style:{width:s,height:s},children:(0,a.jsxs)("svg",{width:s,height:s,children:[(0,a.jsx)("circle",{cx:i,cy:l,r:
1o-2,fill:"none",stroke:"#F2F4F7",strokeWidth:4}),n>0&&(0,a.jsx)("path",{d:m,fill:"#0D99FF",style:{transition:"d 0.5s ease-in-out"}})]})})}},80345:(e,t,r)=>{r.d(t,{A:()=>n});var a=r(95155),s=r(98053);let n=e=>{let{isOpen:t,onOpenChange:r,onDelete:n,isLoading:i=!1}=e;return(0,a.jsx)(s.Lt,{open:t,onOpenChange:r,children:(0,a.jsxs)(s.EO,{children:[(0,a.jsxs)(s.wd,{children:[(0,a.jsx)(s.r7,{children:"Are you absolutely sure?"}),(0,a.jsx)(s.$v,{children:"This action cannot be undone. This will permanently delete your resource"})]}),(0,a.jsxs)(s.ck,{className:"flex flex-row justify-end space-x-2",children:[(0,a.jsx)(s.Zr,{disabled:i,children:"Cancel"}),(0,a.jsx)(s.Rx,{onClick:n,disabled:i,className:"bg-red-600 hover:bg-red-700 text-white border-0 disabled:opacity-50",style:{backgroundColor:"#dc2626",color:"white",border:"none"},children:i?"Deleting...":"Delete"})]})]})})}}}]);

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.