module.exports=[46058,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},14827,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={createLinkPrefetchPartialError:function(){return g},createUnrenderedSegmentError:function(){return f}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a,b){let c=`Route "${a}": Could not validate that a segment in your UI has instant navigation.`;if(b.length>0){let a=1===b.length?"Dropped segment":"Dropped segments";c+=`

This segment was dropped from rendering. Issues that would prevent instant navigation will go undetected.

${a}:
${b.map(a=>`  ${a}`).join("\n")}

Ways to fix this:
  - [render] Render the dropped segment
  - [ignore] Set \`export const instant = false\` to opt the dropped segment out of instant-navigation validation

Learn more: https://nextjs.org/docs/messages/instant-unrendered-segment`}return Object.defineProperty(Error(c),"__NEXT_ERROR_CODE",{value:"E1286",enumerable:!1,configurable:!0})}function g(a){return Object.defineProperty(Error(`Next.js encountered dynamic data during prefetching for "${a}".

This will lead to slower, more expensive prefetches.

Ways to fix this:
  - [upgrade] Opt into Partial Prefetching by exporting \`const prefetch = 'partial'\` from the page or layout, or by setting \`partialPrefetching: true\` in next.config to opt the whole app in
  - [disable] Remove \`prefetch={true}\` from the <Link> to use the default prefetch
  - [ignore] Set \`export const instant = false\` to opt the route out of instant-navigation validation

Learn more: https://nextjs.org/docs/messages/instant-link-prefetch-partial`),"__NEXT_ERROR_CODE",{value:"E1435",enumerable:!1,configurable:!0})}},88644,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"InvariantError",{enumerable:!0,get:function(){return d}});class d extends Error{constructor(a,b){super(`Invariant: ${a.endsWith(".")?a:a+"."} This is a bug in Next.js.`,b),Object.defineProperty(this,"__NEXT_ERROR_CODE",{value:"E1179",enumerable:!1,configurable:!0}),this.name="InvariantError"}}},54427,(a,b,c)=>{"use strict";function d(){let a,b,c=new Promise((c,d)=>{a=c,b=d});return{resolve:a,reject:b,promise:c}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createPromiseWithResolvers",{enumerable:!0,get:function(){return d}})},39118,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DEFAULT_SEGMENT_KEY:function(){return l},NOT_FOUND_SEGMENT_KEY:function(){return m},PAGE_SEGMENT_KEY:function(){return k},addSearchParamsIfPageSegment:function(){return i},computeSelectedLayoutSegment:function(){return j},getSegmentValue:function(){return f},getSelectedLayoutSegmentPath:function(){return function a(b,c,d=!0,e=[]){let g;if(d)g=b[1][c];else{let a=b[1];g=a.children??Object.values(a)[0]}if(!g)return e;let h=f(g[0]);return!h||h.startsWith(k)?e:(e.push(h),a(g,c,!1,e))}},isGroupSegment:function(){return g},isParallelRouteSegment:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Array.isArray(a)?a[1]:a}function g(a){return"("===a[0]&&a.endsWith(")")}function h(a){return a.startsWith("@")&&"@children"!==a}function i(a,b){if(a.includes(k)){let a=JSON.stringify(b);return"{}"!==a?k+"?"+a:k}return a}function j(a,b){if(!a||0===a.length)return null;let c="children"===b?a[0]:a[a.length-1];return c===l?null:c}let k="__PAGE__",l="__DEFAULT__",m="/_not-found"},2811,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246);function e({trahId:a,label:d,selected:f,onSelect:g,onClear:h}){let[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)(null);async function q(){let b=i.trim();if(0===b.length){p("Enter a name to search."),l(null);return}p(null),n(!0);try{let c=await fetch(`/api/trahs/${a}/search?q=${encodeURIComponent(b)}`);if(c.ok){let a=await c.json();l(a.results)}else p("Search failed. Please try again."),l(null)}catch{p("Something went wrong. Please try again."),l(null)}finally{n(!1)}}return(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:`picker-${d}`,children:d}),(0,b.jsx)("br",{}),f?(0,b.jsxs)("p",{style:{margin:"0.25rem 0"},children:["Selected: ",(0,b.jsx)("strong",{children:f.displayName})," ",(0,b.jsx)("button",{type:"button",onClick:h,children:"Change"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,b.jsx)("input",{id:`picker-${d}`,type:"text",value:i,onChange:a=>j(a.target.value),onKeyDown:function(a){"Enter"===a.key&&(a.preventDefault(),q())},placeholder:"Search by name…"}),(0,b.jsx)("button",{type:"button",disabled:m,onClick:()=>void q(),children:m?"Searching…":"Search"})]}),o&&(0,b.jsx)("p",{role:"alert",style:{color:"crimson"},children:o}),null!==k&&(0,b.jsx)("ul",{style:{listStyle:"none",margin:"0.5rem 0",padding:0},children:0===k.length?(0,b.jsx)("li",{style:{color:"#999"},children:"No matching persons found."}):k.map(a=>(0,b.jsx)("li",{children:(0,b.jsx)("button",{type:"button",onClick:()=>{g(a),l(null),j("")},children:a.displayName})},a.id))})]})]})}a.s(["default",0,function({trahId:a}){let[f,g]=(0,c.useState)(null),[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(!1);async function p(b){if(b.preventDefault(),m(null),k(null),!f||!h)return void m("Select both people first.");o(!0);try{let b=await fetch(`/api/trahs/${a}/relationship-finder?a=${encodeURIComponent(f.id)}&b=${encodeURIComponent(h.id)}`);if(b.ok){let a=await b.json();k(a.result);return}401===b.status?m("You need to be signed in to use the relationship finder."):403===b.status?m("You don't have permission to do this in this Trah."):m("Something went wrong. Please try again.")}catch{m("Something went wrong. Please try again.")}finally{o(!1)}}return(0,b.jsxs)("div",{children:[(0,b.jsxs)("form",{onSubmit:p,children:[(0,b.jsx)(e,{trahId:a,label:"Person A",selected:f,onSelect:g,onClear:()=>g(null)}),(0,b.jsx)(e,{trahId:a,label:"Person B",selected:h,onSelect:i,onClear:()=>i(null)}),(0,b.jsx)("button",{type:"submit",disabled:n,style:{marginTop:"1rem"},children:n?"Finding…":"Find relationship"})]}),l&&(0,b.jsx)("p",{role:"alert",style:{color:"crimson"},children:l}),j&&(0,b.jsx)("div",{style:{marginTop:"1rem"},children:"path"in j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{children:["Relationship: ",(0,b.jsx)("strong",{children:j.label})]}),(0,b.jsx)("p",{style:{fontSize:"0.85rem",color:"#666"},children:"Connecting path:"}),(0,b.jsx)("nav",{"aria-label":"Connecting path",children:(0,b.jsx)("ol",{style:{listStyle:"none",display:"flex",flexWrap:"wrap",gap:"0.35rem",padding:0,margin:0,alignItems:"center"},children:j.path.map((c,e)=>(0,b.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:"0.35rem"},children:[(0,b.jsx)(d.default,{href:`/trahs/${a}/persons/${c.id}/profile`,children:c.displayName}),e<j.path.length-1&&(0,b.jsx)("span",{"aria-hidden":"true",children:"→"})]},c.id))})})]}):(0,b.jsx)("p",{children:"These two people aren't related (no connecting path was found)."})})]})}])}];

//# sourceMappingURL=_095iq55._.js.map