PageSourceSearch

https://indiancaucus.org/_next/static/chunks/pages/app/guide-7b9822ae12c308d2.js

js indiancaucus.org collected 2026-09-24 14:27:47 UTC 8,718 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[196],{20028:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/guide",function(){return a(38304)}])},31710:(e,t,a)=>{"use strict";a.d(t,{s:()=>n});var s=a(14232),r=a(79004);function n(e,t,a){let n=(0,s.useRef)(t),l=(0,s.useRef)(a);n.current=t,l.current=a;let[o,i]=(0,s.useState)(()=>e?(0,r.tv)(e):void 0),[d,c]=(0,s.useState)(()=>!e||void 0===(0,r.tv)(e)),[x,h]=(0,s.useState)(!1),[u,m]=(0,s.useState)(e);if(e!==u){m(e);let t=e?(0,r.tv)(e):void 0;i(t),c(void 0===t),h(!1)}let p=(0,s.useCallback)(async()=>{let t=e?(0,r.tv)(e):void 0;void 0!==t?(i(t),c(!1)):c(!0),h(!1);try{let t="function"==typeof n.current?n.current():n.current,a=await fetch(t);if(!a.ok)throw Error("load");let s=await a.json(),o=l.current?l.current(s):s;return i(o),(0,r.lx)(e,o),c(!1),o}catch{void 0===t&&h(!0),c(!1);return}},[e]);return(0,s.useEffect)(()=>{p()},[p]),{data:o,loading:d,error:x,reload:p,setData:(0,s.useCallback)(t=>{i(a=>{let s="function"==typeof t?t(a):t;return(0,r.lx)(e,s),s})},[e])}}},38304:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>c});var s=a(37876),r=a(14232),n=a(62422),l=a(62406),o=a(31710);let i=[{title:"Health & Wellness",desc:"South Asians face higher heart-disease & diabetes risk — learn the signs and get screened.",url:"https://www.heart.org/en/health-topics/consumer-healthcare/south-asian-health"}],d=["Groceries","Restaurants","Worship","Doctors","Legal / Immigration","Accounting / Tax","Realtors","Tutoring / Classes","Other"];function c(){let{member:e}=(0,l.IG)(),[t,a]=(0,r.useState)(!1),{data:c=[],loading:h,error:u,reload:m}=(0,o.s)("directory","/api/directory",e=>e.listings||[]),p=c.reduce((e,t)=>((e[t.category]||=[]).push(t),e),{});return(0,s.jsxs)(n.Ay,{title:"Newcomer Guide",children:[(0,s.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,s.jsx)("h1",{className:"app-fade-up text-xl font-extrabold text-brand-navy",children:"Newcomer Guide"})}),(0,s.jsx)("p",{className:"app-fade-up text-gray-500 text-sm mb-4",children:"Settling into Secaucus — the essentials."}),(0,s.jsx)("div",{className:"space-y-2.5 app-stagger mb-6",children:i.map(e=>(0,s.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 bg-white border border-orange-100 rounded-2xl p-4 shadow-xs active:scale-[.99] transition-transform",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"font-bold text-brand-navy",children:e.title}),(0,s.jsx)("p",{className:"text-gray-500 text-sm mt-0.5",children:e.desc})]}),(0,s.jsx)("svg",{width:"16",height:"16",className:"text-brand-orange shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M5 12h14M13 6l6 6-6 6"})})]},e.title))}),(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("h2",{className:"text-lg font-extrabold text-brand-navy",children:"Local Directory"}),e&&(0,s.jsx)("button",{onClick:()=>a(!0),className:"text-xs font-bold text-brand-orange",children:"+ Suggest"})]}),h?(0,s.jsx)("div",{className:"space-y-2",children:[0,1,2].map(e=>(0,s.jsx)("div",{className:"h-20 rounded-2xl bg-white border border-orange-100 app-shine"},e))}):u?(0,s.jsxs)("div",{className:"text-center py-10 bg-white border border-orange-100 rounded-2xl",children:[(0,s.jsx)("p",{className:"font-bold text-brand-navy",children:"Couldn’t load the directory"}),(0,s.jsx)("button",{onClick:m,className:"mt-3 bg-brand-navy text-white font-bold text-sm rounded-2xl px-5 py-2.5 active:scale-95 transition-transform",children:"Try again"})]}):0===c.length?(0,s.jsxs)("div",{className:"text-center py-10 bg-white border border-orange-100 rounded-2xl",children:[(0,s.jsx)("p",{className:"text-gray-500 text-sm",children:"No listings yet."}),e&&(0,s.jsx)("button",{onClick:()=>a(!0),className:"mt-3 text-brand-orange font-bold text-sm",children:"Suggest the first one"})]}):(0,s.jsx)("div",{className:"space-y-5",children:[...d.filter(e=>p[e]),...Object.keys(p).filter(e=>!d.includes(e)).sort()].map(e=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider mb-2",children:e}),(0,s.jsx)("div",{className:"space-y-2",children:p[e].map(e=>(0,s.jsxs)("div",{className:"bg-white border border-orange-100 rounded-2xl p-4 shadow-xs",children:[(0,s.jsx)("p",{className:"font-bold text-brand-navy",children:e.name}),e.blurb&&(0,s.jsx)("p",{className:"text-gray-500 text-sm mt-0.5",children:e.blurb}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 mt-2 text-sm",children:[e.phone&&(0,s.jsx)("a",{href:`tel:${e.phone}`,className:"text-brand-orange font-semibold",children:"Call"}),e.url&&(0,s.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-brand-orange font-semibold",children:"Website"}),e.address&&(0,s.jsx)("span",{className:"text-gray-400",children:e.address})]})]},e.id))})]},e))}),c.length>0&&(0,s.jsxs)("p",{className:"text-gray-300 text-[10px] text-center mt-6",children:["Some business listings from"," ",(0,s.jsx)("a",{href:"https://www.openstreetmap.org/copyright",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"\xa9 OpenStreetMap"})," contributors"]}),t&&(0,s.jsx)(x,{categories:d,onClose:()=>a(!1)})]})}function x({categories:e,onClose:t}
1){let[a,n]=(0,r.useState)({category:e[0],name:"",blurb:"",phone:"",url:"",address:""}),[l,o]=(0,r.useState)(!1),[i,d]=(0,r.useState)(!1),[c,x]=(0,r.useState)(!1),[h,u]=(0,r.useState)(""),[m,p]=(0,r.useState)(""),b=e=>t=>n(a=>({...a,[e]:t.target.value})),g="w-full border border-gray-200 rounded-xl px-4 py-3 text-base text-brand-navy mb-2 focus:outline-hidden focus:ring-2 focus:ring-brand-orange/40";async function f(){if(a.name.trim()){o(!0),u("");try{let e=await fetch("/api/member/suggest-listing",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Could not submit");x("approved"===t.status),p(t.message||""),d(!0)}catch(e){u(e.message)}finally{o(!1)}}}return(0,s.jsx)("div",{className:"app-backdrop fixed inset-0 z-50 bg-black/50 flex items-end sm:items-center justify-center",onClick:t,children:(0,s.jsx)("div",{className:"app-pop bg-white w-full sm:max-w-md rounded-t-3xl sm:rounded-3xl p-5 max-h-[85dvh] overflow-y-auto",onClick:e=>e.stopPropagation(),style:{paddingBottom:"calc(84px + env(safe-area-inset-bottom))"},children:i?(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("p",{className:"font-extrabold text-brand-navy text-lg",children:c?"Added — thank you!":"Thanks!"}),(0,s.jsx)("p",{className:"text-gray-500 text-sm mt-1",children:m||(c?"Your place is now in the directory.":"Your suggestion was sent for review.")}),(0,s.jsx)("button",{onClick:t,className:"mt-4 bg-brand-orange text-white font-bold rounded-2xl px-6 py-3 text-sm",children:"Done"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"font-extrabold text-brand-navy text-lg mb-1",children:"Suggest a listing"}),(0,s.jsx)("p",{className:"text-gray-500 text-xs mb-3",children:"Add an address and we’ll verify it on Google Maps. Real places within 10 miles of Secaucus get added right away — others go to our team for review."}),(0,s.jsx)("select",{value:a.category,onChange:b("category"),className:"w-full border border-gray-200 rounded-xl px-3 py-2.5 text-sm text-brand-navy mb-2 bg-white",children:e.map(e=>(0,s.jsx)("option",{value:e,children:e},e))}),(0,s.jsx)("input",{className:g,placeholder:"Business / service name",value:a.name,onChange:b("name")}),(0,s.jsx)("input",{className:g,placeholder:"Short description (optional)",value:a.blurb,onChange:b("blurb")}),(0,s.jsx)("input",{className:g,type:"tel",placeholder:"Phone (optional)",value:a.phone,onChange:b("phone")}),(0,s.jsx)("input",{className:g,inputMode:"url",autoCapitalize:"none",autoCorrect:"off",placeholder:"Website (optional)",value:a.url,onChange:b("url")}),(0,s.jsx)("input",{className:g,placeholder:"Address (helps us verify & add it faster)",value:a.address,onChange:b("address")}),h&&(0,s.jsx)("p",{className:"text-red-600 text-xs mb-2",children:h}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:t,className:"flex-1 py-3 rounded-2xl border border-gray-200 text-gray-600 font-bold text-sm",children:"Cancel"}),(0,s.jsx)("button",{onClick:f,disabled:!a.name.trim()||l,className:"flex-1 py-3 rounded-2xl bg-linear-to-r from-brand-orange to-brand-saffron text-white font-bold text-sm shadow-lg shadow-orange-500/20 disabled:opacity-50",children:l?"Sending…":"Submit"})]})]})})})}}},e=>{e.O(0,[8230,900,6475,2422,636,6593,8792],()=>e(e.s=20028)),_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.