PageSourceSearch

https://haloomi.ai/_next/static/chunks/pages/admin/editions/new-e93f0f9e9d387e1a.js

js haloomi.ai collected 2026-10-05 12:16:46 UTC 10,922 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dd28b678-faac-40c8-ab35-613f7560a80a",e._sentryDebugIdIdentifier="sentry-dbid-dd28b678-faac-40c8-ab35-613f7560a80a")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5710],{79369:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var i=n(58168),r=n(98587),o=n(68584),a=n(11317),s=n(51264),l=n(33571);let d=["ownerState"],c=["variants"],u=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function p(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}let f=(0,s.A)(),h=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function m({defaultTheme:e,theme:t,themeId:n}){return 0===Object.keys(t).length?e:t[n]||t}function x(e,t){let{ownerState:n}=t,o=(0,r.A)(t,d),a="function"==typeof e?e((0,i.A)({ownerState:n},o)):e;if(Array.isArray(a))return a.flatMap(e=>x(e,(0,i.A)({ownerState:n},o)));if(a&&"object"==typeof a&&Array.isArray(a.variants)){let{variants:e=[]}=a,t=(0,r.A)(a,c);return e.forEach(e=>{let r=!0;"function"==typeof e.props?r=e.props((0,i.A)({ownerState:n},o,n)):Object.keys(e.props).forEach(t=>{(null==n?void 0:n[t])!==e.props[t]&&o[t]!==e.props[t]&&(r=!1)}),r&&(Array.isArray(t)||(t=[t]),t.push("function"==typeof e.style?e.style((0,i.A)({ownerState:n},o,n)):e.style))}),t}return a}let g=function(e={}){let{themeId:t,defaultTheme:n=f,rootShouldForwardProp:s=p,slotShouldForwardProp:d=p}=e,c=e=>(0,l.A)((0,i.A)({},e,{theme:m((0,i.A)({},e,{defaultTheme:n,themeId:t}))}));return c.__mui_systemSx=!0,(e,l={})=>{var f;let g;(0,o.internal_processStyles)(e,e=>e.filter(e=>!(null!=e&&e.__mui_systemSx)));let{name:A,slot:b,skipVariantsResolver:y,skipSx:v,overridesResolver:w=(f=h(b))?(e,t)=>t[f]:null}=l,j=(0,r.A)(l,u),k=void 0!==y?y:b&&"Root"!==b&&"root"!==b||!1,C=v||!1,S=p;"Root"===b||"root"===b?S=s:b?S=d:"string"==typeof e&&e.charCodeAt(0)>96&&(S=void 0);let _=(0,o.default)(e,(0,i.A)({shouldForwardProp:S,label:g},j)),E=e=>"function"==typeof e&&e.__emotion_real!==e||(0,a.Q)(e)?r=>x(e,(0,i.A)({},r,{theme:m({theme:r.theme,defaultTheme:n,themeId:t})})):e,W=(r,...o)=>{let a=E(r),s=o?o.map(E):[];A&&w&&s.push(e=>{let r=m((0,i.A)({},e,{defaultTheme:n,themeId:t}));if(!r.components||!r.components[A]||!r.components[A].styleOverrides)return null;let o=r.components[A].styleOverrides,a={};return Object.entries(o).forEach(([t,n])=>{a[t]=x(n,(0,i.A)({},e,{theme:r}))}),w(e,a)}),A&&!k&&s.push(e=>{var r;let o=m((0,i.A)({},e,{defaultTheme:n,themeId:t}));return x({variants:null==o||null==(r=o.components)||null==(r=r[A])?void 0:r.variants},(0,i.A)({},e,{theme:o}))}),C||s.push(c);let l=s.length-o.length;if(Array.isArray(r)&&l>0){let e=Array(l).fill("");(a=[...r,...e]).raw=[...r.raw,...e]}let d=_(a,...s);return e.muiName&&(d.muiName=e.muiName),d};return _.withConfig&&(W.withConfig=_.withConfig),W}}()},28610:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(47379),r=n(43049);function o({props:e,name:t,defaultTheme:n,themeId:o}){let a=(0,r.A)(n);return o&&(a=a[o]||a),function(e){let{theme:t,name:n,props:r}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,i.A)(t.components[n].defaultProps,r):r}({theme:a,name:t,props:e})}},88826:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/editions/new",function(){return n(26321)}])},55759:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var i=n(98587),r=n(58168),o=n(96540),a=n(34164),s=n(31609),l=n(75659),d=n(13967),c=n(28610),u=n(79369),p=n(51264),f=n(74848);let h=["className","component","disableGutters","fixed","maxWidth","classes"],m=(0,p.A)(),x=(0,u.A)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`maxWidth${(0,d.A)(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),g=e=>(0,c.A)({props:e,name:"MuiContainer",defaultTheme:m}),A=(e,t)=>{let{classes:n,fixed:i,disableGutters:r,maxWidth:o}=e,a={root:["root",o&&`maxWidth${(0,d.A)(String(o))}`,i&&"fixed",r&&"disableGutters"]};return(0,l.A)(a,e=>(0,s.Ay)(t,e),n)};var b=n(97306),y=n(3552),v=n(26322);let w=function(e={}){let{createStyledComponent:t=x,useThemeProps:n=g,componentName:s="MuiContainer"}=e,l=t(({theme:e,ownerState:t})=>(0,r.A)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,n)=>{let i=e.breakpoints.values[n];return 0!==i&&(t[e.breakpoints.up(n)]={maxWidth:`${i}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,r.A)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}}));return o.forwardRef(function(e,t){let o=n(e),{className:d,component:c="div",disableGutters:u=!1,fixed:p=!1,maxWidth:m="lg"}=o,x=(0,i.A)(o,h),g=(0,r.A)({},o,{component:c,disableGutters:u,fixed:p,maxWidth:m}),b=A(g,s);return(0,f.jsx)(l,(0,r.A)({as:c,ownerState:g,className:(0,a.A)(b.root,d),ref:t},x))})}({createStyledComponent:(0,y.Ay)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`maxWidth${(0,b.A)(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,v.b)({props:e,name:"MuiContainer"})})},15021:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var i=n(74848),r=n(34544),o=n(42413),a=n(21532);let s=(0,a.Ay)(r.A).withConfig({componentId:"sc-e3885fee-0"})(["padding:1rem;margin-bottom:1rem;cursor:pointer;transition:all 0.2s ease-in-out;display:flex;align-items:center;gap:1rem;&:hover{transform:translateY(-2px);box-shadow:0 4px 8px rgba(0,0,0,0.1);}"]),l=a.Ay.div.withConfig({componentId:"sc-e3885fee-1"})(["width:80px;height:80px;flex-shrink:0;border-radius:4px;overflow:hidden;background-color:#f5f5f5;"]),d=a.Ay.img.withConfig({componentId:"sc-e3885fee-2"})(["width:100%;height:100%;object-fit:cover;"]),c=a.Ay.div.withConfig({componentId:"sc-e3885fee-3"})(["flex:1;min-width:0;"]);function u(e){let{edition:t,onClick:n}=e;return console.log(t),(0,i.jsxs)(s,{onClick:()=>n(t),elevation:1,children:[(0,i.jsx)(l,{children:t.headerImage?(0,i.jsx)(d,{src:t.headerImage.imageURL,alt:t.topic}):(0,i.jsx)("div",{style:{width:"100%",height:"100%",backgroundColor:"#f5f5f5"}})}),(0,i.jsxs)(c,{children:[(0,i.jsx)(o.A,{variant:"h6",gutterBottom:!0,children:t.topic}),(0,i.jsx)(o.A,{variant:"body2",color:"textSecondary",children:new Date(t.createdAt.toMillis()).toLocaleDateString()})]})]})}},26321:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>A});var i=n(74848),r=n(96540),o=n(86715),a=n(448),s=n(41917),l=n(55759),d=n(3058),c=n(42413),u=n(51059),p=n(47373),f=n(83327),h=n(71884),m=n(70841),x=n(15021);let g=(0,n(21532).Ay)(s.A).withConfig({componentId:"sc-215765d7-0"})(["border-radius:16px;text-transform:uppercase;padding:4px 10px;font-size:0.8125rem;min-height:24px;background-color:#f0f0f0 !important;color:#333 !important;font-weight:500;letter-spacing:0.02857em;line-height:1.75;box-shadow:none;&:hover{background-color:#e0e0e0 !important;box-shadow:none;}&.MuiButton-contained{box-shadow:none;&:hover{box-shadow:none;}}"]);function A(){let{user:e}=(0,a.A)(),t=(0,o.useRouter)(),[n,A]=(0,r.useState)(""),[b,y]=(0,r.useState)([]),[v,w]=(0,r.useState)(""),[j,k]=(0,r.useState)(null),[C,S]=(0,r.useState)(!1),[_,E]=(0,r.useState)(null),[W,I]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&!e.isAdmin&&t.push("/")},[e,t]),(0,r.useEffect)(()=>{A(new Date().toISOString().split("T")[0])},[]),(0,r.useEffect)(()=>{(async()=>
1{if(n)try{let e=(0,h.P)((0,h.rJ)(f.db,"editions"),(0,h._M)("editionDate","==",new Date(n))),t=await (0,h.GG)(e);if(t.empty)E(null);else{let e=t.docs[0];E({id:e.id,...e.data()})}}catch(e){console.error("Error loading existing edition:",e),k("Failed to load existing edition")}})()},[n]),(0,r.useEffect)(()=>{let e=async()=>{if(n)try{let e=(0,h.P)((0,h.rJ)(f.db,"suggestedTopics"),(0,h._M)("date","==",n)),t=await (0,h.GG)(e);if(t.empty)y([]);else{let e=t.docs[0].data().topics.map(e=>"string"==typeof e?{name:e,context:"",relevance:5,funFactor:3}:e);y(e)}}catch(e){console.error("Error fetching suggestions:",e),k("Failed to fetch topic suggestions")}};_||e()},[n,_]);let R=e=>{w(e.name)},D=async()=>{if(!n||!v){k("Please select a date and topic");return}S(!0),k(null);try{let e={createdAt:h.Dc.now(),editionDate:new Date(n),topic:v,status:"draft"},i=await (0,h.gS)((0,h.rJ)(f.db,"editions"),e);t.push(`/admin/edition/${i.id}`)}catch(e){console.error("Error creating edition:",e),k("Failed to create edition"),S(!1)}};return e?.isAdmin?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.A,{user:e}),(0,i.jsxs)(l.A,{maxWidth:"md",sx:{mt:4,mb:4},children:[(0,i.jsx)(d.A,{sx:{mb:4},children:(0,i.jsx)(s.A,{variant:"text",onClick:()=>t.push("/admin/editions"),startIcon:(0,i.jsx)("span",{children:"←"}),children:"Back to Editions"})}),(0,i.jsx)(c.A,{variant:"h4",gutterBottom:!0,children:"Create New Edition"}),(0,i.jsx)(u.A,{type:"date",label:"Select Date",value:n,onChange:e=>{A(e.target.value),k(null),w("")},InputLabelProps:{shrink:!0},fullWidth:!0,sx:{mb:4}}),_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.A,{variant:"h6",gutterBottom:!0,children:"An edition already exists for this date:"}),(0,i.jsx)(x.A,{edition:_,onClick:e=>{t.push(`/admin/edition/${e.id}`)}})]}):n&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(d.A,{children:[(0,i.jsx)(c.A,{variant:"body1",sx:{mb:1},children:"Tap on a trending topic..."}),b&&b.length>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.A,{sx:{display:"flex",gap:1,flexWrap:"wrap",mb:2},children:b.filter(e=>W?e.funFactor>=3:e.funFactor>=4).map((e,t)=>(0,i.jsx)(g,{onClick:()=>R(e),disableElevation:!0,variant:"contained",title:e.context,children:e.name},t))}),b.some(e=>3===e.funFactor)&&(0,i.jsx)(s.A,{onClick:()=>I(!W),variant:"text",size:"small",sx:{textTransform:"none",color:"text.secondary",alignSelf:"flex-start",mb:1},children:W?"See fewer topics":"See more topics"})]}):(0,i.jsx)(c.A,{variant:"body2",color:"text.secondary",children:"No suggested topics available for this date"}),(0,i.jsx)(c.A,{variant:"body1",sx:{mt:2,mb:1},children:"Or enter your own topic..."}),(0,i.jsx)(u.A,{type:"text",label:"Topic",variant:"outlined",value:v,onChange:e=>w(e.target.value),fullWidth:!0,size:"small",name:"topic",autoComplete:"off"}),(0,i.jsx)(s.A,{variant:"contained",color:"primary",onClick:D,fullWidth:!0,sx:{mt:2},disabled:!v||C,children:C?"Creating...":"Create Edition"})]})}),j&&(0,i.jsx)(p.A,{severity:"error",sx:{mt:2},children:j})]})]}):null}}},e=>{var t=t=>e(e.s=t);e.O(0,[5850,3498,9965,4250,841,636,6593,8792],()=>t(88826)),_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.