PageSourceSearch

https://mojotv.cn/_next/static/chunks/5248-edf0f2542407f889.js

js mojotv.cn collected 2026-10-04 15:11:42 UTC 13,713 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5248],{15248:function(e,t,r){r.d(t,{ArticlesFooter:function(){return y},ArticlesHeader:function(){return k},ArticlesNavigation:function(){return b},ChildCard:function(){return w}});var a=r(57437),l=r(62869),s=r(17692),n=r(94508),o=r(40875),i=r(10407),c=r(15868),d=r(32489),u=r(27648),h=r(99376),f=r(2265);let g=(e,t)=>e.some(e=>e.urlPath===t||g(e.children,t)),x=e=>{let{text:t,theme:r="default"}=e;return(0,a.jsx)("span",{className:"inline-block whitespace-nowrap rounded px-1.5 align-middle font-medium leading-4 tracking-wide [font-size:10px] ".concat("default"===r?"border border-slate-400/70 text-slate-500 dark:border-slate-600 dark:text-slate-400":"border border-purple-300 text-purple-400 dark:border-purple-800 dark:text-purple-600"),children:t})},m=e=>{let{title:t,label:r,url:l,level:s,activePath:i,collapsible:c,collapsed:d,toggleCollapsed:h,activeRef:f}=e,g=l===i;return(0,a.jsxs)("div",{ref:g?f:null,className:(0,n.cn)("group flex h-8 items-center justify-between space-x-2 whitespace-nowrap rounded-md px-3 text-sm leading-none",g?"".concat(0==s?"font-medium":"font-normal"," bg-violet-50 text-violet-900 dark:bg-violet-500/20 dark:text-violet-50"):"hover:bg-gray-50 dark:hover:bg-gray-900 ".concat(0==s?"font-medium text-slate-600 hover:text-slate-700 dark:text-slate-300 dark:hover:text-slate-200":"font-normal hover:text-slate-600 dark:hover:text-slate-300")),children:[(0,a.jsxs)(u.default,{href:l,prefetch:!0,className:"flex h-full grow items-center space-x-2 overflow-hidden",children:[(0,a.jsx)("span",{className:"truncate",children:t}),r&&(0,a.jsx)(x,{text:r})]}),c&&(0,a.jsx)("button",{"aria-label":"Toggle children",onClick:h,className:"mr-2 shrink-0 px-2 py-1",children:(0,a.jsx)(o.Z,{size:14,className:"block w-2.5 ".concat(d?"-rotate-90 transform":"")})})]})},p=e=>{var t,r;let{node:l,level:s,activePath:n,activeRef:o}=e,[i,c]=(0,f.useState)(null===(t=l.collapsed)||void 0===t||t);return(0,f.useEffect)(()=>{(n==l.urlPath||g(l.children,n))&&c(!1)},[n,l.children,l.urlPath]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m,{title:l.nav_title||l.title,label:l.label||void 0,url:l.urlPath,level:s,activePath:n,collapsible:null!==(r=l.collapsible)&&void 0!==r&&r,collapsed:i,toggleCollapsed:()=>c(!i),activeRef:o}),l.children.length>0&&!i&&(0,a.jsx)(v,{tree:l.children,level:s+1,activePath:n,activeRef:o})]})},b=e=>{let{tree:t}=e,r=(0,h.usePathname)(),[l,s]=(0,f.useState)(null),n=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(l&&n.current){let e=n.current.parentElement;for(;e;){let t=window.getComputedStyle(e).overflowY;if("auto"===t||"scroll"===t)break;e=e.parentElement}if(!e){l.scrollIntoView({behavior:"smooth",block:"center"});return}let t=e.getBoundingClientRect(),r=l.getBoundingClientRect(),a=r.top<t.top,s=r.bottom>t.bottom;if(a||s){let t=l.offsetTop-e.offsetTop,r=e.clientHeight,a=l.clientHeight;e.scrollTo({top:Math.max(0,t-r/2+a/2),behavior:"smooth"})}}},[r,l]),(0,a.jsx)("aside",{className:"-ml-6 w-80",ref:n,children:(0,a.jsx)("div",{children:(0,a.jsx)(v,{tree:t,level:0,activePath:r,activeRef:s})})})},v=e=>{let{tree:t,level:r,activePath:l,activeRef:s}=e;return(0,a.jsx)("div",{className:(0,n.cn)("ml-3 space-y-2 pl-3",r>0?"border-l border-gray-200 dark:border-gray-800":""),children:t.map((e,t)=>(0,a.jsx)(p,{node:e,level:r,activePath:l,activeRef:s},t))})},y=e=>{let{article:t}=e;return(0,a.jsxs)("footer",{className:"space-y-4 text-xs italic text-gray-400 sm:flex sm:justify-between sm:space-y-0","aria-hidden":"true",children:[(0,a.jsxs)("p",{className:"m-0",children:["Created on"," ",(0,a.jsx)("time",{dateTime:new Date(t.created_at).toISOString(),children:new Date(t.created_at).toLocaleDateString()}),"."]}),(0,a.jsxs)("p",{className:"m-0 text-right",children:["Last edited on"," ",(0,a.jsx)("time",{dateTime:new Date(t.updated_at).toISOString(),children:new Date(t.updated_at).toLocaleDateString()}),"."]})]})};function w(e){let{children:t,url:r,className:l,shadow:s=!1,dark:o=!1}=e,i=(0,h.useRouter)();return(0,a.jsx)("div",{onClick:()=>i.push(r),className:(0,n.cn)("cursor-pointer overflow-hidden rounded-2xl border",o?"border-gray-800 bg-gray-900":"border-gray-100 bg-gray-50 dark:border-gray-800 dark:bg-gray-900",s&&"shadow-lg ".concat(o?"shadow-gray-900":"shadow-gray-100 dark:shadow-gray-900"),l),
1children:t})}let k=e=>{let{tree:t,breadcrumbs:r,title:n,articleId:g}=e,x=(0,h.usePathname)(),{isAdmin:m}=(0,s.s)(),[p,v]=(0,f.useState)(!1),[y,w]=(0,f.useState)(!0);return(0,f.useEffect)(()=>{let e=()=>w(window.scrollY<=30);return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),(0,f.useEffect)(()=>{v(!1)},[x]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("header",{className:"relative w-full ",children:(0,a.jsxs)("div",{className:"mx-auto w-full max-w-3xl select-text space-y-2 px-4 py-8 md:px-8 lg:max-w-full lg:px-16",children:[(0,a.jsx)("ul",{className:"mb-4 flex flex-wrap items-center text-sm",children:r.map((e,t)=>{let{path:l,title:s}=e;return(0,a.jsx)(f.Fragment,{children:t<r.length-1&&(0,a.jsxs)("li",{className:"mx-1 flex items-center space-x-2",children:[(0,a.jsx)(u.default,{href:l,className:"inline whitespace-nowrap hover:text-slate-600",children:s}),(0,a.jsx)(i.Z,{className:"inline-block text-slate-400",size:14})]})},t)})}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsx)("h1",{className:"sr-only  lg:not-sr-only lg:text-4xl",children:n}),m&&g&&(0,a.jsx)(l.z,{variant:"outline",size:"sm",onClick:()=>window.open("/admin/articles/".concat(g),"_blank"),className:"hidden lg:flex items-center gap-2",children:(0,a.jsx)(c.Z,{className:"h-4 w-4 text-red-800"})})]}),(0,a.jsx)("div",{className:"lg:hidden",children:(0,a.jsxs)("button",{"aria-label":"Show articles navigation",onClick:()=>v(!0),className:"flex space-x-2 text-left text-2xl font-semibold text-slate-800 dark:text-slate-200 md:space-x-3 md:text-3xl lg:text-4xl",children:[(0,a.jsx)(o.Z,{className:"mt-1.5 inline-block w-4 flex-shrink-0 md:w-5",size:14}),(0,a.jsx)("span",{className:"inline-block flex-shrink",children:n})]})})]})}),p&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 h-screen bg-gray-950/20 backdrop-blur-sm animate-in fade-in duration-200 dark:bg-gray-950/60",children:(0,a.jsxs)("div",{className:"absolute left-0 h-full w-80 max-w-[85vw] overflow-y-auto border-r border-gray-200 bg-white shadow-2xl animate-in slide-in-from-left duration-300 dark:border-gray-800 dark:bg-gray-950",children:[(0,a.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-gray-200 bg-white/95 px-6 py-4 backdrop-blur-sm dark:border-gray-800 dark:bg-gray-950/95",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-slate-800 dark:text-slate-200",children:"Articles"}),(0,a.jsx)("button",{type:"button","aria-label":"Close articles navigation",onClick:()=>v(!p),className:"flex h-9 w-9 items-center justify-center rounded-lg text-slate-600 transition-colors hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:(0,a.jsx)(d.Z,{className:"inline-block w-5",size:20})})]}),(0,a.jsx)("div",{className:"p-6",children:(0,a.jsx)(b,{tree:t})})]})}),(0,a.jsx)("div",{className:"fixed top-14 z-10 hidden h-16 w-full border-b border-gray-200 bg-white bg-opacity-90 backdrop-blur backdrop-filter transition-opacity duration-200 dark:border-gray-800 dark:bg-gray-950 lg:block ".concat(y?"opacity-0":"opacity-100"),children:(0,a.jsxs)("ul",{className:"flex h-full items-center space-x-2 px-16 text-sm","aria-hidden":"true",children:[r.map((e,t)=>{let{path:l,title:s}=e;return(0,a.jsx)(f.Fragment,{children:t<r.length-1&&(0,a.jsxs)("li",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.default,{href:l,className:"inline whitespace-nowrap hover:text-slate-600 dark:hover:text-slate-300",children:s}),(0,a.jsx)(i.Z,{className:"inline-block w-1.5 text-slate-400 dark:text-slate-500",size:14})]})},t)}),(0,a.jsx)("li",{className:"hidden text-slate-800 dark:text-slate-200 xl:block",children:n})]})})]})}},62869:function(e,t,r){r.d(t,{d:function(){return i},z:function(){return c}});var a=r(57437),l=r(16600),s=r(69804),n=r(2265),o=r(94508);let i=(0,s.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 transition-shadow duration-200",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"bg-blue-600 text-white hover:bg-blue-700",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-600 text-white hover:bg-yellow-700",info:"bg-cyan-600 text-white hover:bg-cyan-700",danger:"bg-red-600 text-white hover:bg-red-700",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),c=n.forwardRef((e,t)=>
1{let{className:r,variant:s,size:n,asChild:c=!1,...d}=e,u=c?l.g7:"button";return(0,a.jsx)(u,{className:(0,o.cn)(i({variant:s,size:n,className:r})),ref:t,...d})});c.displayName="Button"},17692:function(e,t,r){r.d(t,{s:function(){return n}});var a=r(2265),l=r(88219),s=r(2314);function n(){let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)(!0),{user:o,isAuthed:i,checkSessionExpiry:c}=(0,l.L)();return(0,a.useEffect)(()=>{(()=>{try{if(n(!0),c(),!i||!o.id){t(!1),n(!1);return}let r="admin"===o.role;if(!r){var e;let t=s.P.getAllUserData();(null==t?void 0:null===(e=t.user)||void 0===e?void 0:e.role)==="admin"&&(r=!0)}t(r),n(!1)}catch(e){console.error("Admin check failed:",e),t(!1),n(!1)}})()},[o,i,c]),{isAdmin:e,isLoading:r,isAuthenticated:i&&!!o.id}}},2314:function(e,t,r){r.d(t,{P:function(){return a}});class a{static saveUser(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(t)localStorage.removeItem(this.SESSION_EXPIRY_KEY);else{let e=new Date().getTime()+864e5;localStorage.setItem(this.SESSION_EXPIRY_KEY,e.toString())}}catch(e){console.error("Failed to save user data to localStorage:",e)}}static saveUserInfo(e){try{localStorage.setItem(this.USER_INFO_KEY,JSON.stringify(e))}catch(e){console.error("Failed to save user info to localStorage:",e)}}static getUser(){try{let e=localStorage.getItem(this.USER_KEY);if(e)return JSON.parse(e)}catch(e){console.error("Failed to get user data from localStorage:",e)}return null}static getUserInfo(){try{let e=localStorage.getItem(this.USER_INFO_KEY);if(e)return JSON.parse(e)}catch(e){console.error("Failed to get user info from localStorage:",e)}return null}static isSessionExpired(){try{let e=localStorage.getItem(this.SESSION_EXPIRY_KEY);if(e&&new Date().getTime()>parseInt(e))return!0}catch(e){console.error("Failed to check session expiry:",e)}return!1}static clearUserData(){try{localStorage.removeItem(this.USER_KEY),localStorage.removeItem(this.USER_INFO_KEY),localStorage.removeItem(this.SESSION_EXPIRY_KEY)}catch(e){console.error("Failed to clear user data from localStorage:",e)}}static getAllUserData(){try{let e=this.getUser(),t=this.getUserInfo(),r=localStorage.getItem(this.SESSION_EXPIRY_KEY);if(e)return{user:e,userInfo:t||void 0,sessionExpiry:r||void 0,rememberMe:!r}}catch(e){console.error("Failed to get all user data:",e)}return null}}a.USER_KEY="user",a.USER_INFO_KEY="userInfo",a.SESSION_EXPIRY_KEY="userSessionExpiry"},94508:function(e,t,r){r.d(t,{cn:function(){return s},hD:function(){return n},qg:function(){return o}});var a=r(40334);r(2265);var l=r(25610);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.m)((0,a.W)(t))}let n=e=>e.trim().toLowerCase().replace(/[^\w\s]/g,"").replace(/\s+/g,"-"),o=e=>{var t;return"string"==typeof e?e:"number"==typeof e?e.toString():e instanceof Array?e.map(o).join(""):"object"==typeof e&&(null==e?void 0:null===(t=e.props)||void 0===t?void 0:t.children)?o(e.props.children):""}},40875:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(79205).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},15868:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(79205).Z)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])},32489:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},88219:function(e,t,r){r.d(t,{L:function(){return o}});var a=r(87208),l=r(1206),s=r(2314);let n={id:0,username:"",email:"",role:"user",token:void 0},o=(0,a.Ue)()((0,l.tJ)((e,t)=>({fetchUserInfo:()=>{fetch("/api/users/info").then(e=>e.json()).then(t=>{200===t.code&&(e({userInfo:t.data}),s.P.saveUserInfo(t.data))}).catch(console.error)},patchUserInfo:async e=>await fetch("/api/users/info",{method:"PATCH",body:JSON.stringify(e)}).then(e=>e.json()),setUserInfo:t=>e({userInfo:t}),reset:()=>{s.P.clearUserData(),e({user:n,isAuthed:!1,userInfo:void 0})},user:n,isAuthed:!1,setUser:t=>{e({user:t,isAuthed:!0})},checkSessionExpiry:()=>{s.P.isSessionExpired()&&t().reset()},initializeFromStorage:()=>{t().checkSessionExpiry();let r=s.P.getUserInfo();r&&e({userInfo:r})}}),{name:"user"}))}}]);

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.