PageSourceSearch

https://search.capemaynjdaily.com/_next/static/chunks/app/page-69aa119d8a0f89ff.js

js capemaynjdaily.com collected 2026-10-04 23:11:40 UTC 11,606 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{3294:(e,a,s)=>{Promise.resolve().then(s.bind(s,8848))},8848:(e,a,s)=>{"use strict";s.d(a,{default:()=>c});var t=s(5155),n=s(2115);function r(){return(0,t.jsxs)("svg",{className:"navicon",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,t.jsx)("circle",{cx:"7",cy:"7",r:"5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),(0,t.jsx)("line",{x1:"10.8",y1:"10.8",x2:"15",y2:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function l(e){let{items:a,buttonLabel:s}=e,[l,c]=(0,n.useState)(null);return a&&0!==a.length?(0,t.jsx)("nav",{className:"sitenav","aria-label":"Site",children:(0,t.jsx)("div",{className:"sitenav-in",children:a.map(e=>{var a;let n=!!(null==(a=e.children)?void 0:a.length),i=(()=>{try{return new URL(e.url,"https://x.invalid").pathname.toLowerCase()}catch(e){return""}})(),o=!!e.search||"search"===e.label.trim().toLowerCase()||/(^|\/)search\/?$/.test(i),u=!!s&&e.label.trim().toLowerCase()===s.trim().toLowerCase();return(0,t.jsxs)("div",{className:"navitem".concat(o?" on":"").concat(u?" btn":""),onMouseEnter:()=>n&&c(e.label),onMouseLeave:()=>n&&c(null),children:[(0,t.jsxs)("a",{href:o?"/":e.url,"aria-current":o?"page":void 0,target:!o&&e.new_tab?"_blank":void 0,rel:!o&&e.new_tab?"n
1oopener noreferrer":void 0,children:[o&&(0,t.jsx)(r,{}),e.label,n&&(0,t.jsx)("span",{className:"caret","aria-hidden":"true",children:"▾"})]}),n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{className:"navtoggle","aria-expanded":l===e.label,"aria-label":"".concat(e.label," submenu"),onClick:a=>{a.preventDefault(),c(l===e.label?null:e.label)},children:"▾"}),(0,t.jsx)("div",{className:"submenu".concat(l===e.label?" show":""),children:e.children.map(e=>(0,t.jsx)("a",{href:e.url,target:e.new_tab?"_blank":void 0,rel:e.new_tab?"noopener noreferrer":void 0,children:e.label},e.label))})]})]},e.label)})})}):null}function c(e){let{siteName:a,logoTop:s,logoMain:r,submark:c,mark:i,lead:o,popular:u,today:d,subscribeUrl:h,nav:m,navButton:x,logo:p}=e,[j,g]=(0,n.useState)(""),[N,b]=(0,n.useState)(""),[f,v]=(0,n.useState)(1),[w,y]=(0,n.useState)(null),[S,k]=(0,n.useState)(null),[C,L]=(0,n.useState)(null),[E,_]=(0,n.useState)(!1),[R,F]=(0,n.useState)(null),[T,D]=(0,n.useState)([]),[P,q]=(0,n.useState)(!1),[I,U]=(0,n.useState)(!1),A=(0,n.useRef)(null),M=(0,n.useRef)(null),O=(0,n.useRef)(null),W=(0,n.useRef)(null),Y=!N&&!E,z=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(z.current)return;z.current=!0;let e=new URLSearchParams(window.location.search),a=(e.get("q")||"").trim();if(!a)return;let s=parseInt(e.get("year")||"",10),t=(e.get("category")||"").trim(),n=parseInt(e.get("page")||"1",10);g(a),b(a),isNaN(s)||y(s),t&&k(t),!isNaN(n)&&n>1&&v(n)},[]),(0,n.useEffect)(()=>{if(!z.current)return;let e=new URLSearchParams;N&&e.set("q",N),w&&e.set("year",String(w)),S&&e.set("category",S),f>1&&e.set("page",String(f));let a=e.toString(),s=a?"".concat(window.location.pathname,"?").concat(a):window.location.pathname;window.history.replaceState(null,"",s)},[N,w,S,f]),(0,n.useEffect)(()=>{function e(){let e=new URLSearchParams(window.location.search),a=(e.get("q")||"").trim(),s=parseInt(e.get("year")||"",10),t=(e.get("category")||"").trim(),n=parseInt(e.get("page")||"1",10);g(a),b(a),y(isNaN(s)?null:s),k(t||null),v(isNaN(n)?1:n)}return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]);let B=(0,n.useCallback)(async(e,a,s,t)=>{var n;if(!e.trim()){L(null),F(null);return}null==(n=O.current)||n.abort();let r=new AbortController;O.current=r,_(!0),F(null);try{let n=new URLSearchParams({q:e,page:String(a)});s&&n.set("year",String(s)),t&&n.set("category",t);let l=await fetch("/api/search?".concat(n.toString()),{signal:r.signal}),c=await l.json();l.ok?L(c):(F(c.error||"Search failed."),L(null))}catch(e){(null==e?void 0:e.name)!=="AbortError"&&F("Could not reach search.")}finally{_(!1)}},[]);function $(e){U(!1),v(1),y(null),k(null),g(e),b(e);let a=new URLSearchParams({q:e});window.history.pushState(null,"","".concat(window.location.pathname,"?").concat(a.toString()))}function G(){U(!1),g(""),b(""),L(null),F(null),v(1),y(null),k(null),window.history.pushState(null,"",window.location.pathname)}function H(e){e.preventDefault();let a=j.trim();a&&$(a)}function J(e){v(e),window.scrollTo({top:0,behavior:"smooth"})}(0,n.useEffect)(()=>{N&&B(N,f,w,S)},[N,f,w,S,B]),(0,n.useEffect)(()=>{M.current&&clearTimeout(M.current);let e=j.trim();if(e.length<2||e===N){D([]),U(!1),q(!1);return}return q(!0),U(!0),M.current=setTimeout(async()=>{var a;null==(a=A.current)||a.abort();let s=new AbortController;A.current=s;try{let a=await fetch("/api/suggest?q=".concat(encodeURIComponent(e)),{signal:s.signal}),t=await a.json();D(t.suggestions||[])}catch(e){(null==e?void 0:e.name)!=="AbortError"&&D([])}finally{q(!1)}},400),()=>{M.current&&clearTimeout(M.current)}},[j]),(0,n.useEffect)(()=>{function e(e){W.current&&!W.current.contains(e.target)&&U(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let K=e=>{let{variant:s}=e;return(0,t.jsxs)("div",{className:"searchwrap ".concat(s),ref:W,children:[(0,t.jsxs)("form",{className:"floatbar",onSubmit:H,role:"search",autoComplete:"off",children:[(0,t.jsx)("input",{type:"text",value:j,onChange:e=>g(e.target.value),onFocus:()=>{j.trim().length>=2&&j.trim()!==N&&U(!0)},placeholder:"Search ".concat(a,"…"),"aria-label":"Search ".concat(a),autoFocus:!0}),j&&(0,t.jsx)("button",{type:"button",className:"clearx",onClick:G,"aria-label":"Clear search",children:"✕"}),(0,t.jsx)("button",{type:"submit",className:"gobtn",disabled:!j.trim(),children:"Search"})]}),I&&(0,t.jsxs)("div",{className:"dropdown",role:"listbox",children:[P&&0===T.length&&(0,t.jsx)("div",{className:"dd-state",children:"Searching…"}),!P&&0===T.length&&j.trim().length>=2&&(0,t.jsxs)("div",{className:"dd-state",children:["No matches for “",j.trim(),"”"]}
1),T.map(e=>(0,t.jsxs)("button",{type:"button",className:"dd-item",onClick:()=>window.open(e.url,"_blank","noopener"),children:[(0,t.jsx)("p",{className:"t",children:e.title}),(0,t.jsxs)("p",{className:"s",children:[(0,t.jsx)("span",{className:"k",children:e.kicker})," \xb7 ",function(e){if(!e)return"";let a=new Date(e);return isNaN(a.getTime())?"":a.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}(e.date)]})]},e.id)),j.trim().length>=2&&(0,t.jsxs)("button",{type:"button",className:"dd-foot",onClick:()=>$(j.trim()),children:["Search all for “",j.trim(),"” →"]})]})]})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("header",{className:"topstrip",children:(0,t.jsxs)("div",{className:"topstrip-in",children:[(0,t.jsxs)("div",{className:"dateblk",children:[d,(0,t.jsx)("span",{children:"TODAY’S EDITION"})]}),(0,t.jsx)("button",{className:"logobtn",onClick:G,"aria-label":"".concat(a," search home"),children:(null==p?void 0:p.url)?(0,t.jsx)("img",{className:"sitelogo",src:p.url,alt:a,width:p.width||void 0,height:p.height||void 0}):(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)("span",{className:"l1",children:s}),(0,t.jsx)("span",{className:"l2",children:r}),(0,t.jsx)("span",{className:"l3",children:c})]})}),(0,t.jsx)("a",{className:"subbtn",href:h,target:"_blank",rel:"noopener noreferrer",children:"✉ Subscribe"})]})}),(0,t.jsx)(l,{items:m,buttonLabel:x}),(0,t.jsx)("div",{className:"shell",children:Y?(0,t.jsxs)("div",{className:"panel",children:[(0,t.jsxs)("p",{className:"t serif",children:["Search ",a]}),(0,t.jsx)("p",{className:"s",children:o}),(0,t.jsx)(K,{variant:"landing"}),(null==u?void 0:u.length)>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"pop",children:"Popular"}),(0,t.jsx)("div",{className:"popcats",children:u.map(e=>(0,t.jsx)("button",{onClick:()=>$(e),children:e},e))})]})]}):(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"layout",children:[(0,t.jsxs)("div",{className:"main",children:[(0,t.jsx)(K,{variant:"results"}),R&&(0,t.jsx)("p",{className:"err",children:R}),(0,t.jsxs)("div",{className:"active",children:[(0,t.jsxs)("span",{className:"fchip",children:["“",N,"”",(0,t.jsx)("button",{onClick:G,"aria-label":"Clear search",children:"✕"})]}),S&&(0,t.jsxs)("span",{className:"fchip",children:[S,(0,t.jsx)("button",{onClick:()=>k(null),"aria-label":"Clear category",children:"✕"})]}),w&&(0,t.jsxs)("span",{className:"fchip",children:[w,(0,t.jsx)("button",{onClick:()=>y(null),"aria-label":"Clear year",children:"✕"})]})]}),E&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"skel"}),(0,t.jsx)("div",{className:"skel"}),(0,t.jsx)("div",{className:"skel"})]}),!E&&C&&0===C.results.length&&(0,t.jsxs)("p",{className:"empty",children:["No stories match ",(0,t.jsxs)("b",{children:["“",C.query,"”"]}),w?" in ".concat(w):"",S?" under ".concat(S):"",". Try a different term."]}),!E&&C&&C.results.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"sech",children:(0,t.jsxs)("h3",{children:[C.total.toLocaleString(),C.capped?"+":""," result",1===C.total?"":"s"," for “",C.query,"”"]})}),C.results.map(e=>(0,t.jsxs)("article",{className:"rescard",children:[e.image?(0,t.jsx)("img",{className:"thumb",src:e.image,alt:"",loading:"lazy"}):(0,t.jsx)("div",{className:"thumb mark",children:i}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"kicker",children:e.categories[0]||"News"}),(0,t.jsx)("h2",{children:(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.title})}),(0,t.jsxs)("p",{className:"m",children:[e.author&&(0,t.jsx)("b",{children:e.author}),e.author&&e.date?" \xb7 ":"",function(e){if(!e)return"";let a=new Date(e);return isNaN(a.getTime())?"":a.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})}(e.date)]}),e.excerpt&&(0,t.jsx)("p",{className:"ex",children:e.excerpt})]})]},e.id)),C.pages>1&&(0,t.jsxs)("nav",{className:"pager","aria-label":"Search results pages",children:[(0,t.jsx)("button",{className:"pnav",onClick:()=>J(f-1),disabled:f<=1,children:"← Prev"}),(0,t.jsx)("div",{className:"pnums",children:(function(e,a){if(a<=7)return Array.from({length:a},(e,a)=>a+1);let s=[],t=e=>s.push(e);t(1);let n=Math.max(2,e-1),r=Math.min(a-1,e+1);n>2&&s.push("…");for(let e=n;e<=r;e++)t(e);return r<a-1&&s.push("…"),t(a),s})(f,C.pages).map((e,a)=>"…"===e?(0,t.jsx)("span",{className:"pdots",children:"…"},"d".concat(a)):(0,t.jsx)("button",{className:"pnum".concat(e===f?" on":""),onClick:()=>J(e),"aria-current":e===f?"page":void 0,children:e},e))}),(0,t.jsx)("button",{className:"pnav",onClick:()=>J(f+1),disabled:f>=C.pages,children:"Next →"})]})]})]}),!E&&C&&(C.facets.years.length>0||C.facets.categories.length>0)&&(0,t.jsxs)("aside",{className:"side",children:[C.facets.years.length>0&&(0,t.jsxs)("div",{className:"box",children:[(0,t.jsx)("h4",{children:"Years"}),(0,t.jsx)("div",{className:"years",children:C.facets.years.slice(0,18).map(e=>(0,t.jsx)("button",{className:w===e.year?"on":"",onClick:()=>{var a;return a=e.year,void(v(1),y(w===a?null:a))},title:"".concat(e.count," results"),children:e.year},e.year))})]}),C.facets.categories.length>0&&(0,t.jsxs)("div",{className:"box",children:[(0,t.jsx)("h4",{children:"Categories"}),(0,t.jsx)("div",{className:"cats",children:C.facets.categories.map(e=>(0,t.jsxs)("button",{className:S===e.name?"on":"",onClick:()=>{var a;return a=e.name,void(v(1),k(S===a?null:a))},children:[(0,t.jsx)("span",{children:e.name}),(0,t.jsx)("span",{className:"c",children:e.count})]},e.name))})]})]})]})})})]})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=3294)),_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.