PageSourceSearch

https://anime-planet.vercel.app/_next/static/chunks/pages/collection-d26de8a36251d14d.js

js anime-planet.vercel.app collected 2026-10-03 06:06:12 UTC 5,284 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[186],{1039:function(e,t,n){!function(e,t,n){"use strict";var r=n&&"object"==typeof n&&"default"in n?n:{default:n};function o(e,t,n){"function"==typeof e?(o=t||[],i=n):(o=[],i=t);var o,i,u=r.default.useRef({hasResult:!1,result:i,error:null}),s=r.default.useReducer(function(e){return e+1},0);s[0];var l=s[1],a=r.default.useMemo(function(){var t="function"==typeof e?e():e;if(!t||"function"!=typeof t.subscribe){if(e===t)throw TypeError("Given argument to useObservable() was neither a valid observable nor a function.");throw TypeError("Observable factory given to useObservable() did not return a valid observable.")}if(!u.current.hasResult&&"undefined"!=typeof window&&("function"!=typeof t.hasValue||t.hasValue())){if("function"==typeof t.getValue)u.current.result=t.getValue(),u.current.hasResult=!0;else{var n=t.subscribe(function(e){u.current.result=e,u.current.hasResult=!0});"function"==typeof n?n():n.unsubscribe()}}return t},o);if(r.default.useDebugValue(u.current.result),r.default.useEffect(function(){var e=a.subscribe(function(e){var t=u.current;(null!==t.error||t.result!==e)&&(t.error=null,t.result=e,t.hasResult=!0,l())},function(e){var t=u.current;t.error!==e&&(t.error=e,l())});return"function"==typeof e?e:e.unsubscribe.bind(e)},o),u.current.error)throw u.current.error;return u.current.result}e.useLiveQuery=function(e,n,r){return o(function(){return t.liveQuery(e)},n||[],r)},e.useObservable=o,e.usePermissions=function(e,n,r){var i;if(!e)throw TypeError("Invalid arguments to usePermissions(): undefined or null");if(arguments.length>=3){if(!("transaction"in e))throw TypeError("Invalid arguments to usePermission(db, table, obj): 1st arg must be a Dexie instance");if("string"!=typeof n)throw TypeError("Invalid arguments to usePermission(db, table, obj): 2nd arg must be string");if(!r||"object"!=typeof r)throw TypeError("Invalid arguments to usePermission(db, table, obj): 3rd arg must be an object");i=e}else{if(e instanceof t.Dexie)throw TypeError("Invalid arguments to usePermission(db, table, obj): Missing table and obj arguments.");if("function"==typeof e.table&&"object"==typeof e.db)i=e.db,r=e,n=e.table();else throw TypeError("Invalid arguments to usePermissions(). Expected usePermissions(entity: DexieCloudEntity) or usePermissions(db: Dexie, table: string, obj: DexieCloudObject)")}if(!("cloud"in i))throw Error("usePermissions() is only for Dexie Cloud but there's no dexie-cloud-addon active in given db.");if(!("permissions"in i.cloud))throw Error("usePermissions() requires a newer version of dexie-cloud-addon. Please upgrade it.");return o(function(){return i.cloud.permissions(r,n)},[r.realmId,r.owner,n])},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(9520),n(7294))},9178:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/collection",function(){return n(2091)}])},2091:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}});var r=n(5893),o=n(7294),i=n(1163),u=n(8229),s=n(9140),l=n(1039),a=n(2517),c=n(6481),d=n(59);function f(){let e=(0,i.useRouter)(),{isMobile:t}=(0,s.Z)(),{setToast:n}=(0,a.useGlobalContext)(),f=(0,l.useLiveQuery)(d.bG,[]),b=(null==f?void 0:f.length)||0,[v,m]=(0,o.useState)(null),[p,h]=(0,o.useState)({create:!1,edit:!1,delete:!1,addAnime:!1}),y=async()=>{if(!v)return h(e=>({...e,delete:!1}));try{await (0,d.Vg)(null==v?void 0:v.id),h(e=>({...e,delete:!1})),n({isOpen:!0,message:"Collection has been deleted",type:"success"})}catch(e){n({isOpen:!0,message:"Failed to delete collection",type:"error"})}},g={isOpen:p.create||p.edit,selectedCollection:v,onClose:()=>{m(null),h(e=>({...e,create:!1,edit:!1}))}};return(0,r.jsxs)(c.W2,{children:[(0,r.jsx)(c.pQ,{title:"My Collection"}),(0,r.jsxs)(c.xu,{pt:32,pb:64,children:[(0,r.jsx)(c.di,{when:0===b,children:(0,r.jsx)(c.HY,{text:"You don’t have any collection yet.",button:(0,r.jsx)(c.zx,{mt:16,"data-cy":"create-collection-button",onClick:()=>{m(null),h(e=>({...e,create:!0}))},children:"Create new collection"})})}),(0,r.jsxs)(c.di,{when:b>0,children:[(0,r.jsxs)(c.kC,{alignItems:"center",gap:14,children:[(0,r.jsx)(c.zx,{"data-cy":"create-collection-button",onClick:()=>{m(null),h(e=>({...e,create:!0}))},children:t?"Create":"Create new collection"}),(0,r.jsxs)(c.xv,{color:"gray.500",fontSize:[12,14,16],children:[b," Collection"]})]}),(0,r.jsx)(c.rj,{gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gridGap:4,py:32,children:null==f?void 0:f.map((n,o)=>{var i,s,l,a,d;return(0,r.jsx)(c.zt,{title:n.name,totalItems:n.items.length,image:t?null===(i=n.items)||void 0===i?void 0:null===(s=i[0])||void 0===s?void 0:s.coverImage.medium:null===(l=n.items)||void 0===l?void 0:null===(a=l[0])||void 0===a?void 0:null===(d=a.coverImage)||void 0===d?void 0:d.large,onClick:()=>e.push(u.Z.COLLECTION_DETAIL(n.id)),onDelete:()=>{m(n),h(e=>({...e,delete:!0}))},onEdit:()=>{m(n),h(e=>({...e,edit:!0}))}},o)})})]}),(0,r.jsx)(c.BN,{...g}),(0,r.jsx)(c.cV,{title:"Delete ".concat(null==v?void 0:v.name),description:"Are you sure you’d like to delete ".concat(null==v?void 0:v.name," collection? It can’t be undone."),isOpen:p.delete,onClose:()=>h(e=>({...e,delete:!1})),onDone:y})]})]})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=9178)}),_N_E=e.O()}]);

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.