import{j as e}from"./ui-vendor-CJlQk0Tq.js";import{S as t}from"./SEOHead-DvKCumc3.js";import{C as r}from"./index-CUIxi1yy.js";import{C as s}from"./CTAButton-BVEzDYQl.js";import{e as o,r as n}from"./react-vendor-f6QdChhz.js";import{s as i}from"./stockStructures-DrcVCf6W.js";import{s as u,a}from"./slug-parser-8h41spFl.js";const c=()=>{const n=o().pathname.includes("/past-inventory");return e.jsxs(e.Fragment,{children:[e.jsx(t,{title:"Structure Not Found | White Pine Structures",description:"The structure you're looking for doesn't exist or has been removed.",canonical:"https://whitepinestructures.com/stock-structures",noindex:!0,structuredData:{"@context":"https://schema.org","@type":"WebPage",name:"Structure Not Found",description:"The structure you're looking for doesn't exist or has been removed",url:"https://whitepinestructures.com",mainEntity:{"@type":"WebSite","@id":"https://whitepinestructures.com"}}}),e.jsx("main",{className:"min-h-screen py-16",children:e.jsx("div",{className:"container mx-auto px-4 text-center",children:e.jsxs(r,{className:"max-w-2xl mx-auto p-8 shadow-wood",children:[e.jsx("h1",{className:"text-3xl font-bold mb-6",children:"Structure Not Found"}),e.jsx("p",{className:"mb-8",children:"The structure you're looking for doesn't exist or has been removed."}),e.jsx(s,{to:n?"/past-inventory":"/stock-structures",variant:"primary",children:n?"Back to Customer Builds":"Back to Stock Structures"})]})})})]})},d=(e,t,r)=>{const[s,o]=n.useState(null),[c,d]=n.useState(!0),[l,m]=n.useState([]),[f,p]=n.useState(0),[h,x]=n.useState([]),[w,C]=n.useState(0);return n.useEffect(()=>{const t=(()=>{if(!e)return null;let t=null;if(t=i.find(t=>t.id.toLowerCase()===e.toLowerCase()),t)return t;if(e.includes("-")){const r=u(e);if(r!==e&&(t=i.find(e=>e.id.toLowerCase()===r.toLowerCase()),t))return t;const{itemNumber:s}=a(r);if(s){const e=s.toLowerCase();if(t=i.find(t=>{var r;return(null==(r=t.itemNumber)?void 0:r.toLowerCase())===e}),t)return t}const o=r.split("-");for(let e=o.length-1;e>=0;e--){const r=o[e];if(r&&/^[A-Za-z0-9.\-xX]+$/.test(r)&&r.length>=3){const e=r.toLowerCase();if(t=i.find(t=>{var r;return(null==(r=t.itemNumber)?void 0:r.toLowerCase())===e}),t)return t}}}if(!t&&r){const e=r.toLowerCase();if(t=i.find(t=>{var r;return(null==(r=t.itemNumber)?void 0:r.toLowerCase())===e}),t)return t}if(!t){const r=e.toLowerCase().replace(/(\d+)x(\d+)/g,"$1X$2");if(t=i.find(e=>{const t=e.id.toLowerCase().replace(/(\d+)x(\d+)/gi,"$1X$2");return t.includes(r)||r.includes(t)}),t)return t}return!t&&(t=i.find(t=>t.id.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.id.toLowerCase())),t)?t:null})();if(t){o(t);const e=i.filter(e=>e.type===t.type&&e.soldOut===t.soldOut);x(e),C(e.length);const r=e.findIndex(e=>e.id===t.id);p(Math.max(0,r));const s=e.filter(e=>e.id!==t.id).slice(0,3);m(s)}else o(null);d(!1)},[e,t,r]),{structure:s,loading:c,similarStructures:l,currentIndex:f,structuresOfSameType:h,typeStructureCount:w}};export{c as S,d as u};