PageSourceSearch

https://archispace.com/_next/static/chunks/3xupyo7m479vv.js

js archispace.com collected 2026-10-09 23:08:15 UTC 31,279 bytes, 320 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="881bdb64-fc4b-1a14-13bb-5dad494d816c")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,779529,e=>{"use strict";var t=e.i(271645);let n=t.forwardRef(function({title:e,titleId:n,...o},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":n},o),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))});e.s(["ArrowPathIcon",0,n],779529)},734872,e=>{"use strict";let t={pl:"pl-pl",en:"en",de:"de-de",fr:"fr-fr",es:"es-es",hu:"hu-hu",cz:"cs-cz",sk:"sk-sk",lt:"lt-lt",lv:"lv-lv",ee:"et-ee",ru:"ru-ru",ua:"uk-ua",ro:"ro-ro",nl:"nl-nl",it:"it-it"};var n=e.i(581949),o=e.i(873158),a=e.i(599241);let i=`
3query ($language: String!, $path: String!) {
4  catalogue(language: $language, path: $path) {
5    ...Item
6    ...Product
7  }
8}
9
10fragment Item on Item {
11  id
12  type
13  language
14  path
15  name
16  components {
17    ...Component
18  }
19  topics {
20    path
21    name
22  }
23}
24
25fragment Product on Product {
26  variants {
27    id
28    name
29    sku
30    components {
31      ...Component
32    }
33    images {
34      url
35      altText
36      key
37    }
38  }
39}
40
41fragment Component on Component {
42  ...BaseComponentDefinition
43  content {
44    ...BaseComponentContent
45
46    ... on ComponentChoiceContent {
47      selectedComponent {
48        ...BaseComponentDefinition
49        content {
50          ...BaseComponentContent
51          ...LevelThreePieceContent
52        }
53      }
54    }
55
56    ... on ContentChunkContent {
57      chunks {
58        ...BaseComponentDefinition
59        content {
60          ...BaseComponentContent
61          ...LevelThreePieceContent
62        }
63      }
64    }
65
66    ... on ComponentMultipleChoiceContent {
67      selectedComponents {
68        ...BaseComponentDefinition
69        content {
70          ...BaseComponentContent
71          ...LevelThreePieceContent
72        }
73      }
74    }
75
76    ... on PieceContent {
77      components {
78        ...BaseComponentDefinition
79        content {
80          ...BaseComponentContent
81          ...LevelThreePieceContent
82
83          ... on ComponentChoiceContent {
84            selectedComponent {
85              ...BaseComponentDefinition
86              content {
87                ...BaseComponentContent
88                ...LevelTwoPieceContent
89              }
90            }
91          }
92
93          ... on ContentChunkContent {
94            chunks {
95              ...BaseComponentDefinition
96              content {
97                ...BaseComponentContent
98                ...LevelTwoPieceContent
99              }
100            }
101          }
102
103          ... on ComponentMultipleChoiceContent {
104            selectedComponents {
105              ...BaseComponentDefinition
106              content {
107                ...BaseComponentContent
108                ...LevelTwoPieceContent
109              }
110            }
111          }
112        }
113      }
114    }
115  }
116}
117
118fragment BaseComponentDefinition on Component {
119  id
120  name
121  type
122}
123
124fragment BaseComponentContent on ComponentContent {
125  ...SingleLine
126  ...RichText
127  ...ImageContent
128  ...ParagraphCollection
129  ...ItemRelations
130  ...PropertiesTable
131  ...VideoContent
132  ...Selection
133  ...File
134}
135
136fragment Image on Image {
137  url
138  altText
139  key
140  variants {
141    url
142    width
143    key
144  }
145}
146
147fragment ImageContent on ImageContent {
148  images {
149    ...Image
150  }
151}
152
153fragment SingleLine on SingleLineContent {
154  text
155}
156
157fragment RichText on RichTextContent {
158  json
159  html
160  plainText
161}
162
163fragment ParagraphCollection on ParagraphCollectionContent {
164  paragraphs {
165    title {
166      ...SingleLine
167    }
168    body {
169      ...RichText
170    }
171    images {
172      ...Image
173    }
174  }
175}
176
177fragment PropertiesTable on PropertiesTableContent {
178  sections {
179    ... on PropertiesTableSection {
180      title
181      properties {
182        key
183        value
184      }
185    }
186  }
187}
188
189fragment ItemRelations on ItemRelationsContent {
190  items {
191    id
192    name
193    path
194  }
195  productVariants {
196    sku
197    name
198  }
199}
200
201fragment Video on Video {
202  id
203  playlists
204  title
205  thumbnails {
206    ...Image
207  }
208}
209
210fragment VideoContent on VideoContent {
211  videos {
212    ...Video
213  }
214}
215
216fragment Selection on SelectionContent {
217  options {
218    key
219    value
220  }
221}
222
223fragment File on FileContent {
224  files {
225    url
226    key
227    title
228    size
229  }
230}
231
232fragment LevelOnePieceContent on PieceContent {
233  components {
234    ...BaseComponentDefinition
235    content {
236      ...BaseComponentContent
237    }
238  }
239}
240
241fragment LevelTwoPieceContent on PieceContent {
242  components {
243    ...BaseComponentDefinition
244    content {
245      ...BaseComponentContent
246      ...LevelOnePieceContent
247
248      ... on ComponentChoiceContent {
249        selectedComponent {
250          ...BaseComponentDefinition
251          content {
252            ...BaseComponentContent
253          }
254        }
255      }
256
257      ... on ContentChunkContent {
258        chunks {
259          ...BaseComponentDefinition
260          content {
261            ...BaseComponentContent
262          }
263        }
264      }
265
266      ... on ComponentMultipleChoiceContent {
267        selectedComponents {
268          ...BaseComponentDefinition
269          content {
270            ...BaseComponentContent
271          }
272        }
273      }
274    }
275  }
276}
277
278fragment LevelThreePieceContent on PieceContent {
279  components {
280    ...BaseComponentDefinition
281    content {
282      ...BaseComponentContent
283      ...LevelTwoPieceContent
284
285      ... on ComponentChoiceContent {
286        selectedComponent {
287          ...BaseComponentDefinition
288          content {
289            ...BaseComponentContent
290            ...LevelOnePieceContent
291          }
292        }
293      }
294
295      ... on ContentChunkContent {
296        chunks {
297          ...BaseComponentDefinition
298          content {
299            ...BaseComponentContent
300            ...LevelOnePieceContent
301          }
302        }
303      }
304
305      ... on ComponentMultipleChoiceContent {
306        selectedComponents {
307          ...BaseComponentDefinition
308          content {
309            ...BaseComponentContent
310            ...LevelOnePieceContent
311          }
312        }
313      }
314    }
315  }
316}
317`,r=async(e,t,n)=>{let i=await fetch((0,a.getApiUrl)()+`/search?${e}&lang=${t}&page=${n}`,{next:{revalidate:(0,o.evaluateNextCache)(3600),tags:["catalogue_index_all"]}});if(!i.ok)throw Error(`Failed to fetch catalogue index: ${i.status} ${i.statusText}`);return await i.json()},l=async(e,t)=>{let n=await fetch((0,a.getApiUrl)()+`/search/parent?${e}&lang=${t}`,{next:{revalidate:(0,o.evaluateNextCache)(3600),tags:["catalogue_index_all"]}});if(!n.ok)throw Error(`Failed to fetch catalogue index: ${n.status} ${n.statusText}`);return await n.json()},s=async(e,t)=>{let n=await fetch((0,a.getApiUrl)()+`/search/hierarchyCount?${e}&lang=${t}`,{next:{revalidate:(0,o.evaluateNextCache)(3600),tags:["hierarchy_count"]}});if(!n.ok)throw Error(`Failed to fetch hierarchy count: ${n.status} ${n.statusText}`);return await n.json()},c=async e=>{if("number"!=typeof e||!Number.isFinite(e))return null;try{let t=await fetch((0,a.getApiUrl)()+`/search/index/${e}/files`);return t.ok?await t.json():null}catch{return null}},d=async(e,n)=>{let o=await fetch("https://api.crystallize.com/sagiton-archispace/catalogue",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:i,variables:{language:t[e],path:n}})});return o.ok?(await o.json()).data.catalogue:null},u=async e=>await n.default.get(`https://api.archispace.com/api/search/homepage/featured?lang=${e}`)??[],m=async e=>await n.default.get(`https://api.archispace.com/api/search/homepage/most-popular?lang=${e}`)??[],p=async e=>await n.default.get(`https://api.archispace.com/api/search/homepage/user-downloaded?lang=${e}`)??[],h=async e=>await n.default.post("https://api.archispace.com/api/search/homepage/user-last-seen",{ids:e})??null;e.s(["fetchHomepageFeaturedItems",0,u,"fetchHomepageMostPopularItems",0,m,"fetchHomepageUserDownloads",0,p,"fetchHomepageUserLastSeen",0,h,"getCatalogueIndexFiles",0,c,"getCrystallizeItem",0,d,"getSearchByParent",0,l,"getSearchHierarchyCount",0,s,"searchCatalogueIndex",0,r],734872)},88116,e=>{"use strict";var t=e.i(843476),n=e.i(329110),o=e.i(271645),a=e.i(225526);e.s(["default",0,({children:e,className:i="",strokeDasharray:r="6 4",borderColor:l="text-gray-300"})=>{let{ref:s,dimensions:c}=((e=100)=>{let t=(0,o.useRef)(null),[n,i]=(0,o.useState)({width:0,height:0}),r=(0,a.useDebounce)(n,e);return(0,o.useEffect)(()=>{let e=()=>{if(t.current){let{width:e,height:n}=t.current.getBoundingClientRect();i({width:e,height:n})}};e();let n=new ResizeObserver(e);return t.current&&n.observe(t.current),window.addEventListener("resize",e),()=>{n.disconnect(),window.removeEventListener("resize",e)}},[]),{ref:t,dimensions:r}})(50);return(0,t.jsxs)("div",{ref:s,className:(0,n.default)("relative rounded-xl",i),children:[(0,t.jsx)("svg",{className:(0,n.default)("pointer-events-none absolute inset-0 z-20 rounded-xl",l),fill:"none",xmlns:"http://www.w3.org/2000/svg",width:c.width,height:c.height,children:(0,t.jsx)("rect",{x:"1",y:"1",width:Math.max(0,c.width-2),height:Math.max(0,c.height-2),rx:"12",ry:"12",stroke:"currentColor",strokeWidth:"1",strokeDasharray:r})}),(0,t.jsx)("div",{className:"relative z-10 h-full",children:e})]})}],88116)},769767,e=>{"use strict";var t=e.i(843476),n=e.i(329110),o=e.i(522016),a=e.i(520133),i=e.i(861745),r=e.i(618566),l=e.i(271645),s=e.i(902639),c=e.i(949097),d=e.i(295192),u=e.i(351957),m=e.i(349407),p=e.i(638427),h=e.i(536042),g=e.i(532079),f=e.i(867056),w=e.i(779529),x=e.i(521292),C=e.i(626830),v=e.i(88116);e.s(["ProductBox",0,({index:e,variantName:y="",productId:k,materials:b,photos:_})=>{let{loggedIn:D}=(0,c.useUser)(),{saveUrlToLocalStorage:N}=(0,d.useSaveUrlToLocalStorage)(),j=(0,g.useDownloadToastMessages)(),L=(0,u.useDownloadLocked)(),[P,S]=(0,l.useState)(!1),I=(0,r.useRouter)(),T=(0,i.useLocale)(),E="file"===e.type,z=e.producer_slug??e.path?.split("/")?.[2],$=e.id??("item_id"in e?e.item_id:void 0),F=async()=>
317{if(!D())return O();if((0,u.startDownloadLock)()){S(!0);try{let t=e.id,n=B(y,e.system??"",String(e.file_url));t&&(0,m.trackCadDownload)(t,(0,p.getDownloadFileExtension)(n)),await (0,p.downloadFile)(String(e.file_url),n,j,{skipLock:!0})}catch{(0,h.sendToast)({type:"error",headerText:"Error",caption:"Error downloading files"})}finally{window.setTimeout(()=>S(!1),u.DOWNLOAD_LOCK_MS)}}},B=(e,t,n)=>e+" - "+t+"."+n.split("/").pop().split(".").pop(),O=()=>{N(),I.push(`/${T}/login`)};return E?(0,t.jsx)(v.default,{className:"group relative h-full w-full max-w-[488px] transition-all",children:(0,t.jsxs)("button",{onClick:()=>void F(),disabled:L&&!P,className:"flex aspect-square h-full w-full flex-col overflow-hidden rounded-xl",children:[(0,t.jsxs)("div",{className:(0,n.default)("relative block flex-1 overflow-hidden rounded-t-lg bg-white p-4 sm:max-w-none",!e.image_url&&"mx-0 w-full bg-gray-300 p-0"),children:[e.image_url&&(0,t.jsx)(C.ImageWithSkeleton,{src:e.image_url,alt:e.name,className:"absolute w-full object-contain",sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 220px, 280px"}),(0,t.jsx)("div",{className:"flex justify-between",children:(0,t.jsx)("div",{className:"flex space-x-2 text-sm text-gray-700"})}),(0,t.jsx)("div",{className:"btn btn btn-tertiary btn-md group absolute bottom-3 right-3 z-10 block rounded-lg border-[1px] !border-primary-600 bg-white p-3 text-primary-600 transition duration-200 hover:bg-primary-600 hover:text-white xl:opacity-0 xl:group-hover:opacity-100",children:P?(0,t.jsx)(w.ArrowPathIcon,{height:25,width:25,className:"animate-spin"}):(0,t.jsx)(f.ArrowDownTrayIcon,{height:25,width:25})})]}),(0,t.jsxs)("div",{className:"flex items-start space-x-2 rounded-b-lg bg-white px-4 py-3",children:[(0,t.jsxs)("div",{className:"mr-auto max-w-[calc(100%-50px)] lg:mx-auto",children:[(0,t.jsx)("p",{className:"line-clamp-3 break-words text-lg font-medium text-gray-600 xl:text-h1",children:e.producer_name}),(0,t.jsx)("p",{className:"line-clamp-3 break-words text-lg font-semibold text-primary-600 transition duration-200 xl:text-h2 xl:text-gray-700 xl:group-hover:text-primary-600",children:e.name}),e.drawing_type&&(0,t.jsx)("p",{className:"line-clamp-3 break-words text-h3 text-gray-700",children:"."+e.drawing_type})]}),(0,t.jsx)("div",{className:"self-center xl:hidden",children:(0,t.jsx)(x.ArrowRightIcon,{height:25,width:25,className:"text-primary-600"})})]})]})}):(0,t.jsx)(v.default,{className:"group relative h-full w-full max-w-[488px] transition-all",children:(0,t.jsxs)("div",{className:"flex aspect-square flex-col overflow-hidden rounded-xl",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsxs)(o.default,{href:`/${T}/search/${e.type}/${e.external_id}`,className:(0,n.default)("relative block h-full overflow-hidden rounded-t-lg bg-white p-4 sm:max-w-none",!e.image_url&&"mx-0 w-full bg-gray-300 p-0"),children:[e.image_url&&(0,t.jsx)(C.ImageWithSkeleton,{src:e.image_url,alt:e.name,className:"absolute w-full object-contain",sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 220px, 280px"}),(0,t.jsx)("div",{className:"flex justify-between",children:(0,t.jsx)("div",{className:"flex space-x-2 text-sm text-gray-700"})})]}),"catalogue"!==y&&"folder"!==e.type&&null!=$&&(0,t.jsx)(s.default,{className:"absolute bottom-3 right-3 z-10 xl:opacity-0 xl:group-hover:opacity-100",id:$,productId:k,producerId:e.producer_id,materials:b,photos:_,path:e.path,isSmall:!0,color:"primary",system:e.system??void 0,hasCadItems:!0,variantExternalId:"variant"===e.type?e.external_id:void 0})]}),(0,t.jsxs)("div",{className:"flex items-start space-x-2 rounded-b-lg bg-white px-4 py-3",children:[(0,t.jsxs)("div",{className:"mr-auto max-w-[calc(100%-50px)]",children:["catalogue"!==y&&(0,t.jsx)(a.Link,{href:{pathname:"/producers/[slug]",params:{slug:z}},className:"hover:underline",children:(0,t.jsx)("p",{className:"line-clamp-3 break-words text-lg font-medium text-gray-600 xl:text-h1",children:e.producer_name})}),(0,t.jsx)(o.default,{href:`/${T}/search/${e.type}/${e.external_id}`,children:(0,t.jsx)("p",{className:"line-clamp-3 break-words text-lg font-semibold text-primary-600 transition duration-200 xl:text-h2 xl:text-gray-700 xl:group-hover:text-primary-600",children:e.name})})]}),(0,t.jsx)("div",{className:"self-center xl:hidden",children:(0,t.jsx)(x.ArrowRightIcon,{height:25,width:25,className:"text-primary-600"})})]})]})})}])},902639,521292,626830,e=>{"use strict";var t=e.i(843476),n=e.i(271645),o=e.i(618566),a=e.i(329110),i=e.i(867056),r=e.i(949097),l=e.i(685149);let s=e=>!!e?.some(e=>e.images.some(e=>e.url)),c=e=>(e?.flatMap(e=>e.files.map(e=>({title:e.title,key:e.key,size:e.size,sizeMiB:"number"==typeof e.size?e.size/1024/1024:null,hasUrl:!!e.url,eligible:!!e.url&&"number"==typeof e.size&&Number.isFinite(e.size)&&e.size<=l.MAX_CRYSTALLIZE_DOWNLOAD_FILE_SIZE})))??[]).some(e=>e.hasUrl&&(e.eligible||null===e.size||void 0===e.size));var d=e.i(351957),u=e.i(734872),m=e.i(638427),p=e.i(546737),h=e.i(536042),g=e.i(365233),f=e.i(532079),w=e.i(349407);let x=async e=>e?.length?Promise.all(e.map(async e=>({...e,files:(await Promise.all(e.files.map(async e=>{let t=e.size;if("number"!=typeof t||!Number.isFinite(t))try{let n=(await fetch((0,p.buildProxyDownloadUrl)(e.url,e.title),{method:"HEAD",cache:"no-store"})).headers.get("content-length");t=n?Number(n):void 0}catch{t=void 0}return"number"==typeof t&&Number.isFinite(t)&&t<=l.MAX_CRYSTALLIZE_DOWNLOAD_FILE_SIZE?{...e,size:t}:null}))).filter(e=>null!==e)}))):e,C=async(e,t,n,o,a,i)=>{let r,l,s=!e?.length,c=!t?.length,d=!n?.length;
317if(!s&&!c&&!d||!o||!a)return{materials:e,photos:t,files:n};let m=await (0,u.getCrystallizeItem)(a,o);if(!m)return{materials:e,photos:t,files:n};let p=s?(0,g.findProductMaterials)(m):void 0,h=c?(0,g.findProductImages)(m):void 0,f=d?i?(l=(r=(0,g.findVariant)(m,i))?(0,g.findFiles)(r):[]).some(e=>e.files.some(e=>e.url))?l:(0,g.findFiles)(m):(0,g.findProductFiles)(m):void 0;return{materials:p?.length?p:e,photos:h?.length?h:t,files:f?.length?f:n}};var v=e.i(1162),y=e.i(295192),k=e.i(861745);e.s(["default",0,({id:e,productId:l,producerId:p,isSmall:g,label:b,className:_,system:D,color:N,materials:j,photos:L,files:P,path:S,hasCadItems:I=!1,variantExternalId:T})=>{let E=(0,k.useLocale)(),z=P?.some(e=>e.files.some(e=>"number"!=typeof e.size||!Number.isFinite(e.size))),[$,F]=(0,n.useState)(z?void 0:P),[B,O]=(0,n.useState)(j),[A,M]=(0,n.useState)(L),[R,U]=(0,n.useState)(!!(P?.length&&z||S&&E&&(!j?.length||!L?.length||!P?.length)));(0,n.useEffect)(()=>{let e=!1;return!P?.length&&(!S||!E)||!z&&j?.length&&L?.length&&P?.length?(O(j),M(L),F(P),U(!1),()=>{e=!0}):(O(j),M(L),F(void 0),U(!0),C(j,L,P,S,E,T).then(async t=>{let n=await x(t.files);e||(O(t.materials),M(t.photos),F(n))}).finally(()=>{e||U(!1)}),()=>{e=!0})},[P,z,E,j,S,L,T]);let{loggedIn:W}=(0,r.useUser)(),Z=(0,o.useRouter)(),{isDownloading:V,fetchProductFiles:H}=function({id:e,productId:t,producerId:o,system:a,materials:i,photos:r,files:l,path:p,locale:g,variantExternalId:v}){let[y,k]=(0,n.useState)(!1),b=(0,n.useRef)(!1),_=(0,f.useDownloadToastMessages)();return{isDownloading:y,fetchProductFiles:(0,n.useCallback)(async()=>{if(b.current||!(0,d.startDownloadLock)())return!1;b.current=!0,k(!0);try{let[n,d]=await Promise.all([(0,u.getCatalogueIndexFiles)(t??e),C(i,r,l,p,g,v)]),f=n?((e,t)=>{if(t){let n=e.variants.filter(e=>Number(e.id)===Number(t));return Number(e.product.id)===Number(t)&&e.product.urls.length&&n.push(e.product),n}return[...e.variants,{id:e.product.id,folder_name:e.product.folder_name,urls:e.product.urls}]})(n,t?e:void 0):[],y=f.some(e=>e.urls.length>0),k=d.materials,b=d.photos,D=await x(d.files);if(!y&&!s(k)&&!s(b)&&!c(D))return(0,h.sendToast)({type:"error",headerText:"Error",caption:"No files available for bulk download"}),!1;let N=(a?a.split(" "):[]).map(e=>`${encodeURIComponent(e)}`).join("-"),j=n?.product.folder_name??"materials",L=`files-${j}${String(N).trim()?"-"+N:""}.zip`,P=(({hasCad:e,hasDocumentation:t,hasMaterials:n,hasPhotos:o})=>{let a=[e?"cad":void 0,t?"documentation":void 0,n?"materials":void 0,o?"photos":void 0].filter(e=>void 0!==e);if(!(a.length<1))return a.length>1?"mixed":a[0]})({hasCad:y,hasDocumentation:c(D),hasMaterials:s(k),hasPhotos:s(b)}),S=(0,m.getDownloadPackageContentCounts)(f,k,b,D),I=(0,m.getDownloadPackageFileExtensionCounts)(f,k,b,D);if(P)if("number"==typeof o&&Number.isFinite(o)){let t=f.filter(e=>e.urls.length>0).map(e=>e.id),n=t.length?Array.from(new Set([e,...t].filter(e=>t.includes(e)))):[e];(0,w.trackPackageDownload)({producerId:o,itemName:L,catalogueIndexIds:n,section:P,packageContentCounts:S,packageFileExtensionCounts:I})}else console.error("Download event tracking skipped: producer context unavailable");else console.error("Download event tracking skipped: package section unavailable");return await (0,m.downloadFilesAsZip)(f,L,k,b,D,_,{skipLock:!0}),!0}catch(e){return(0,h.sendToast)({type:"error",headerText:"Error",caption:"Error downloading files"}),console.error(e),!1}finally{setTimeout(()=>{b.current=!1,k(!1)},d.DOWNLOAD_LOCK_MS)}},[_,l,e,g,i,p,r,t,o,a,v])}}({id:e,productId:l,producerId:p,system:D,materials:B,photos:A,files:$,path:S,locale:E,variantExternalId:T}),{saveUrlToLocalStorage:q}=(0,y.useSaveUrlToLocalStorage)(),K=(0,d.useDownloadLocked)(),X=(({materials:e,photos:t,files:n,hasCadItems:o=!1})=>o||s(e)||s(t)||c(n))({materials:R?void 0:B,photos:R?void 0:A,files:R?void 0:$,hasCadItems:I}),Y=(0,n.useCallback)(async()=>{if(!W()){q(),Z.push(`/${E}/login`);return}e&&await H()},[W,H,e,Z,E,q]);return X?(0,t.jsx)(v.default,{onClick:e=>{e.stopPropagation(),Y()},icon:i.ArrowDownTrayIcon,iconPosition:"right",color:N??"gray",iconSize:g?25:20,className:(0,a.default)("btn btn-tertiary btn-md",g&&"block rounded-lg border-[1px] bg-white p-3","gray"===N&&"border-gray-300",_),isLoading:V,disabled:K&&!V||R,children:!g&&b}):null}],902639);let b=n.forwardRef(function({title:e,titleId:t,...o},a){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},o),e?n.createElement("title",{id:t},e):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))});e.s(["ArrowRightIcon",0,b],521292);var _=e.i(657688);e.s(["ImageWithSkeleton",0,({src:e,alt:o,className:a,sizes:i})=>
317{let[r,l]=(0,n.useState)(!0);return(0,t.jsxs)(t.Fragment,{children:[r&&(0,t.jsx)("div",{className:"absolute inset-0 animate-pulse bg-gray-300"}),(0,t.jsx)(_.default,{src:e,alt:o,fill:!0,className:a,sizes:i,onLoad:()=>l(!1)})]})}],626830)},349407,e=>{"use strict";var t=e.i(581949);function n(e){return t.default.post(`https://api.archispace.com/api/search/downloads/${e.index_id}`,{event_id:e.event_id},{skipAuthRefresh:!0}).then(()=>void 0)}function o(e){return t.default.post("https://api.archispace.com/api/search/downloads",e,{skipAuthRefresh:!0}).then(()=>void 0)}var a=e.i(638427);let i=(e,t)=>{e(t).catch(e=>{console.error("Download event tracking failed",e)})},r=(e=e=>"index_id"in e?n(e):o(e))=>{let t=({producerId:t,itemName:n,catalogueIndexId:o,catalogueIndexIds:r,fileExtension:l,packageContentCounts:s,packageFileExtensionCounts:c,section:d,action:u})=>{try{let m,p,h,g="number"==typeof o&&Number.isFinite(o)&&o>0?o:void 0,f=r?Array.from(new Set(r)).filter(e=>Number.isFinite(e)&&e>0):[],w={event_id:crypto.randomUUID(),producer_id:t,section:d,action:u,...f.length>0?{catalogue_index_ids:f}:void 0!==g?{catalogue_index_ids:[g]}:{},...n?{item_name:n}:{},..."single"===u&&void 0!==l&&(m=(0,a.normalizeDownloadFileExtension)(l))?{file_extension:m}:{},..."package"===u?(p=(e=>{if(!e||"object"!=typeof e)return;let t=Object.fromEntries(["cad","documentation","materials","photos","homepage"].flatMap(t=>{let n=e[t];return"number"==typeof n&&Number.isInteger(n)&&n>0?[[t,n]]:[]}));return Object.keys(t).length>0?t:void 0})(s),h=(e=>{if(!e||"object"!=typeof e||Array.isArray(e))return;let t=Object.fromEntries(["cad","documentation","materials","photos","homepage"].flatMap(t=>{let n=e[t];if(!n||"object"!=typeof n||Array.isArray(n))return[];let o=Object.entries(n).reduce((e,[t,n])=>{if("number"==typeof n&&Number.isInteger(n)&&n>0){let o=(0,a.normalizeDownloadFileExtension)(t);o&&(e[o]=(e[o]??0)+n)}return e},{});return Object.keys(o).length>0?[[t,o]]:[]}));return Object.keys(t).length>0?t:void 0})(c),{...p?{package_content_counts:p}:{},...h?{package_file_extension_counts:h}:{}}):{}};i(e,w)}catch(e){console.error("Download event tracking failed",e)}};return{trackCad:(t,n)=>{try{let o,r={event_id:crypto.randomUUID(),index_id:t,...void 0!==n&&(o=(0,a.normalizeDownloadFileExtension)(n))?{file_extension:o}:{}};i(e,r)}catch{console.error("Download event tracking failed")}},trackDocumentation:e=>{t({...e,section:"documentation",action:"single"})},trackHomepage:e=>{t({producerId:e.producerId,itemName:e.itemName,fileExtension:e.fileExtension,section:"homepage",action:"single"})},trackPatterns:e=>{t({producerId:e.producerId,itemName:e.itemName,fileExtension:e.fileExtension,section:"patterns",action:"single"})},trackMaterials:e=>{t({...e,section:"materials"})},trackPhotos:e=>{t({...e,section:"photos"})},trackPackage:({producerId:e,itemName:n,catalogueIndexIds:o,packageContentCounts:a,packageFileExtensionCounts:i,section:r})=>{t({producerId:e,itemName:n,section:r,action:"package",catalogueIndexIds:o,packageContentCounts:a,packageFileExtensionCounts:i})}}};e.s(["trackCadDownload",0,(e,t)=>{r().trackCad(e,t)},"trackDocumentationDownload",0,e=>{r().trackDocumentation(e)},"trackHomepageDownload",0,e=>{r().trackHomepage(e)},"trackMaterialsDownload",0,e=>{r().trackMaterials(e)},"trackPackageDownload",0,e=>{r().trackPackage(e)},"trackPatternsDownload",0,e=>{r().trackPatterns(e)},"trackPhotosDownload",0,e=>{r().trackPhotos(e)}],349407)},638427,e=>{"use strict";var t=e.i(546737),n=e.i(29555),o=e.i(685149);let a=e=>{let t=e.trim().toLowerCase().replace(/^\.+/,"");return/^[a-z0-9][a-z0-9_-]{0,31}$/.test(t)?t:void 0},i=e=>{let t=e.split(/[?#]/,1)[0].split("/").pop()??"",n=t.lastIndexOf(".");return n>0&&n<t.length-1?a(t.slice(n+1)):void 0},r=e=>i(e)??"png",l=(e,t)=>{if(!e)return t?l(t):"unknown";let n=e.split(/[?#]/,1)[0].split("/").pop()??"",o=n.lastIndexOf(".");return o<=0||o===n.length-1?t?l(t):"unknown":a(n.slice(o+1))??"unknown"},s=(e,t)=>e.toLowerCase().endsWith(`.${t.toLowerCase()}`)?e:`${e}.${t}`,c=(...e)=>e.map(e=>e.trim()).filter(Boolean).join("/"),d=(e,t)=>e.trim().toLowerCase()===t.trim().toLowerCase()?"":e,u=(e,t)=>
317{if(!e?.length)return[];let o=[],a=(0,n.sanitizeWindowsFolderName)(t);for(let i of e){if(!i.images.length)continue;let e=d(i.group,t),l=e?(0,n.sanitizeWindowsFolderName)(e):"";for(let e of i.images){if(!e.url)continue;let t=r(e.url),n=e.altText??"file";o.push({url:e.url,fileName:c(a,l,s(n,t))})}}return o},m=e=>{if(!e?.length)return[];let t=[];for(let a of e){let e=d(a.group,"Pliki"),i=e?(0,n.sanitizeWindowsFolderName)(e):"";for(let e of a.files){if(!e.url||"number"!=typeof e.size||!Number.isFinite(e.size)||e.size>o.MAX_CRYSTALLIZE_DOWNLOAD_FILE_SIZE)continue;let n=r(e.url);t.push({url:e.url,fileName:c("Pliki",i,s(e.title||"file",n)),size:e.size})}}return t},p=e=>{let t=[];for(let o of e){if(0===o.urls.length)continue;let e=(0,n.sanitizeWindowsFolderName)(o.folder_name||"defaultFolder");for(let n of o.urls){if(!n.file_url)continue;let a=r(n.file_url),i=s(`${o.folder_name} - ${n.drawing_subtype}-${Math.floor(10001*Math.random())+1}`,a);t.push({url:n.file_url,fileName:c(e,i)})}}return t},h=(e,t)=>({...(e?{toastMessages:e}:{notify:!1})??{},skipLock:t?.skipLock}),g=async(e,n,o,a,i,r,l)=>{let s=[...p(e),...u(o,"Materiały"),...u(a,"Zdjęcia"),...m(i)];0!==s.length&&await (0,t.downloadRemoteZip)(s,n,h(r,l))},f=async(e,n,o,a)=>{if(0===e.length)return;let i=e.map(e=>({url:e.url,fileName:s(e.fileName,r(e.url))}));await (0,t.downloadRemoteZip)(i,n,h(o,a))},w=async(e,n,o,a)=>{let i=e.split(".").pop(),r=i&&!n.toLowerCase().endsWith(`.${i.toLowerCase()}`)?`${n}.${i}`:n;await (0,t.downloadRemoteFile)(e,r,h(o,a))};e.s(["downloadFile",0,w,"downloadFilesAsZip",0,g,"downloadImagesAsZip",0,f,"getDownloadFileExtension",0,l,"getDownloadPackageContentCounts",0,(e,t,n,o)=>{let a=e.reduce((e,t)=>e+t.urls.filter(e=>!!e.file_url).length,0),i=m(o).length,r=u(t,"Materiały").length,l=u(n,"Zdjęcia").length,s={...a>0?{cad:a}:{},...i>0?{documentation:i}:{},...r>0?{materials:r}:{},...l>0?{photos:l}:{}};return Object.keys(s).length>0?s:void 0},"getDownloadPackageFileExtensionCounts",0,(e,t,n,o)=>{let a=(e,t)=>0===t.length?{}:{[e]:t.reduce((e,t)=>{let n=i(t.url)??"unknown";return e[n]=(e[n]??0)+1,e},{})},r=p(e),l=u(t,"Materiały"),s=u(n,"Zdjęcia"),c=m(o),d={...a("cad",r),...a("materials",l),...a("photos",s),...a("documentation",c)};return Object.values(d).some(e=>Object.keys(e??{}).length>0)?d:void 0},"normalizeDownloadFileExtension",0,a])},546737,351957,29555,e=>{"use strict";let t;var n=e.i(271645);let o=0,a=new Set,i=()=>{a.forEach(e=>e())},r=()=>{let e;return!(Date.now()<o)&&(o=Date.now()+2e3,void 0!==t&&window.clearTimeout(t),e=Math.max(0,o-Date.now()),t=window.setTimeout(()=>{Date.now()<o||(o=0,t=void 0,i())},e),i(),!0)},l=()=>Date.now()<o;e.s(["DOWNLOAD_LOCK_MS",0,2e3,"startDownloadLock",0,r,"useDownloadLocked",0,()=>(0,n.useSyncExternalStore)(e=>(a.add(e),()=>{a.delete(e)}),l,()=>!1)],351957);var s=e.i(843476),c=e.i(170319);let d=({messages:e})=>(0,s.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,s.jsx)("div",{className:"text-h2",children:e.startingTitle}),(0,s.jsx)("div",{className:"text-md text-gray-600",children:e.startingCaption})]}),u=e=>{let t=`download-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,n=!1;return{showStarting:()=>{let o=(0,s.jsx)(d,{messages:e});if(!n){(0,c.toast)(o,{toastId:t,type:"info",icon:!1,autoClose:2e3,closeOnClick:!0}),n=!0;return}c.toast.update(t,{render:o,type:"info",icon:!1,autoClose:2e3,closeOnClick:!0})},dismiss:()=>{c.toast.dismiss(t),n=!1}}},m=(e,t)=>`/api/download?url=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,p=e=>e?.toastMessages??e?.notifyMessages,h=async(e,t,n)=>{let o=n?.notify===!1?void 0:p(n),a=o?u(o):null;if(n?.skipLock||r())try{var i;let n;a?.showStarting(),i=m(e,t),(n=document.createElement("iframe")).setAttribute("aria-hidden","true"),n.style.display="none",n.src=i,document.body.appendChild(n),window.setTimeout(()=>{n.remove()},6e4)}catch(e){throw a?.dismiss(),e}},g=async(e,t,n)=>{if(0===e.length)return;let o=n?.notify===!1?void 0:p(n),a=o?u(o):null;if(n?.skipLock||r())try{let n,o,i,r;a?.showStarting(),n=`zip-download-${Date.now()}`,(o=document.createElement("iframe")).name=n,o.setAttribute("aria-hidden","true"),o.style.display="none",document.body.appendChild(o),(i=document.createElement("form")).method="POST",i.action="/api/download-zip",i.target=n,i.style.display="none",(r=document.createElement("input")).type="hidden",r.name="payload",r.value=JSON.stringify({files:e,zipFilename:t}),i.appendChild(r),document.body.appendChild(i),i.submit(),i.remove(),window.setTimeout(()=>{o.remove()},6e4)}catch(e){throw a?.dismiss(),e}};e.s(["buildProxyDownloadUrl",0,m,"downloadRemoteFile",0,h,"downloadRemoteZip",0,g],546737);let f=/[<>:"/\\|?*\u0000-\u001f]/g;e.s(["sanitizeWindowsFolderName",0,e=>e.replace(f,"_").replace(/[. ]+$/g,"").trim()||"_"],29555)},536042,532079,e=>{"use strict";var t=e.i(843476),n=e.i(170319),o=e.i(329110);e.s(["sendToast",0,({type:e="info",headerText:a,caption:i,hideIcon:r=!1,autoClose:l=3e3})=>{(0,n.toast)((0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:(0,o.default)(i&&"text-h2"),children:a}),i&&(0,t.jsx)("div",{className:"text-md text-gray-600",children:i})]}),{type:e,icon:!r&&void 0,autoClose:l})}],536042);var a=e.i(948148);let i="__PROGRESS__";e.s(["useDownloadToastMessages",0,()=>{let e=(0,a.useTranslations)("search_page");return{startingTitle:e("download_starting_title"),startingCaption:e("download_starting_caption"),progressTitle:e("download_progress_t
317itle"),progressCaption:e("download_progress_caption",{progress:i}),completedTitle:e("download_completed_title"),completedCaption:e("download_completed_caption"),queuedTitle:e("download_queued_title"),queuedCaption:e("download_queued_caption"),backgroundTitle:e("download_background_title"),backgroundCaption:e("download_background_caption",{progress:i})}}],532079)},295192,e=>{"use strict";e.s(["useSaveUrlToLocalStorage",0,()=>({saveUrlToLocalStorage:()=>{localStorage.getItem("lastVisitedPage")&&localStorage.removeItem("lastVisitedPage"),localStorage.setItem("lastVisitedPage",window.location.pathname)}})])},685149,e=>{"use strict";e.s(["MAX_CRYSTALLIZE_DOWNLOAD_FILE_SIZE",0,0x1400000])}]);
318
319//# debugId=881bdb64-fc4b-1a14-13bb-5dad494d816c
320//# sourceMappingURL=026kqr49n0wa9.js.map

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.