(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,48425,e=>{"use strict";var t=e.i(71645),r=e.i(74080),i=e.i(91918),s=e.i(43476),o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,r)=>{let o=t.forwardRef((e,t)=>{let{asChild:o,...l}=e,a=o?i.Slot:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(a,{...l,ref:t})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function l(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}e.s(["Primitive",()=>o,"dispatchDiscreteCustomEvent",()=>l])},23750,e=>{"use strict";var t=e.i(43476),r=e.i(47163);function i({className:e,type:i,...s}){return(0,t.jsx)("input",{type:i,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...s})}e.s(["Input",()=>i])},51737,e=>{"use strict";let t=(0,e.i(75254).default)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",()=>t],51737)},84614,e=>{"use strict";let t=(0,e.i(75254).default)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>t],84614)},18566,(e,t,r)=>{t.exports=e.r(76562)},94433,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(18566);let s=(0,r.createContext)(void 0),o=["/profile","/forum/ask","/insights/create","/orchard-v3-panel"];function l({children:e}){let[l,a]=(0,r.useState)(null),[u,n]=(0,r.useState)(!0),d=(0,i.useRouter)(),c=(0,i.usePathname)();return(0,r.useEffect)(()=>{let e=localStorage.getItem("user");e&&a(JSON.parse(e)),n(!1)},[]),(0,r.useEffect)(()=>{if(!u){if(o.some(e=>c.startsWith(e))&&!l)return void d.push("/login");c.startsWith("/orchard-v3-panel")&&l&&"admin"!==l.role&&"moderator"!==l.role&&d.push("/")}},[l,u,c,d]),(0,t.jsx)(s.Provider,{value:{user:l,loading:u,login:(e,t)=>{localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("token",t),a(e),d.push("/")},logout:()=>{localStorage.removeItem("user"),localStorage.removeItem("token"),a(null),d.push("/")}},children:e})}function a(){let e=(0,r.useContext)(s);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}e.s(["AuthProvider",()=>l,"useAuth",()=>a])},31171,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["default",()=>t])},64659,e=>{"use strict";var t=e.i(31171);e.s(["ChevronDown",()=>t.default])},55436,e=>{"use strict";let t=(0,e.i(75254).default)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);e.s(["Search",()=>t],55436)},35804,e=>{"use strict";var t=e.i(71645),r=e.i(34620);function i(e){let[i,s]=t.useState(void 0);return(0,r.useLayoutEffect)(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;s({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}s(void 0)},[e]),i}e.s(["useSize",()=>i])},61574,e=>{"use strict";let t=(0,e.i(75254).default)("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);e.s(["HeartPulse",()=>t],61574)},33498,e=>{"use strict";let t=(0,e.i(75254).default)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["CircleIcon",()=>t],33498)}]);