@ifc-lite/viewer 1.17.2 → 1.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/.turbo/turbo-build.log +30 -29
  2. package/.turbo/turbo-typecheck.log +1 -42
  3. package/CHANGELOG.md +9 -0
  4. package/dist/assets/arrow-DJf2ErbF.js +20 -0
  5. package/dist/assets/basketViewActivator-aojwdomq.js +1 -0
  6. package/dist/assets/bcf-D5-QWGO9.js +281 -0
  7. package/dist/assets/{browser-BDShTXzi.js → browser-CKs-FY1P.js} +1 -1
  8. package/dist/assets/drawing-2d-gWfpdfYe.js +257 -0
  9. package/dist/assets/epsg-index.generated-BjJrt_0S.js +1 -0
  10. package/dist/assets/exporters-C_6J153K.js +79896 -0
  11. package/dist/assets/geometry.worker-Nz9_YIqh.js +1 -0
  12. package/dist/assets/ids-B4jTqB1O.js +1 -0
  13. package/dist/assets/{ifc-lite_bg-FNRmpSvM.wasm → ifc-lite_bg-eSkBTizQ.wasm} +0 -0
  14. package/dist/assets/index-jhBr1wbn.js +101666 -0
  15. package/dist/assets/index-pbE7itQS.css +1 -0
  16. package/dist/assets/lens-CSASnhAL.js +1 -0
  17. package/dist/assets/maplibre-gl-BpvwNKKy.js +811 -0
  18. package/dist/assets/{native-bridge-Crsb7TKz.js → native-bridge-DSIyEYXG.js} +6 -4
  19. package/dist/assets/{arrow2-bb-jcVEo.js → parquet-CEXmQNRO.js} +2 -2
  20. package/dist/assets/sandbox-B79eavQ3.js +5933 -0
  21. package/dist/assets/server-client-D3bUPJJc.js +626 -0
  22. package/dist/assets/wasm-bridge-B0J07fZZ.js +1 -0
  23. package/dist/assets/zip-B-jFFAGa.js +12 -0
  24. package/dist/index.html +11 -2
  25. package/package.json +24 -19
  26. package/src/components/viewer/ExportChangesButton.tsx +18 -3
  27. package/src/components/viewer/ExportDialog.tsx +16 -3
  28. package/src/components/viewer/HierarchyPanel.tsx +6 -6
  29. package/src/components/viewer/PropertiesPanel.tsx +96 -60
  30. package/src/components/viewer/Section2DPanel.tsx +3 -2
  31. package/src/components/viewer/ViewportContainer.tsx +5 -4
  32. package/src/components/viewer/hierarchy/treeDataBuilder.ts +2 -1
  33. package/src/components/viewer/properties/EpsgLookupDialog.tsx +418 -0
  34. package/src/components/viewer/properties/GeoreferencingPanel.tsx +591 -0
  35. package/src/components/viewer/properties/LocationMap.tsx +289 -0
  36. package/src/components/viewer/properties/ModelMetadataPanel.tsx +3 -70
  37. package/src/hooks/bcfIdLookup.ts +13 -11
  38. package/src/hooks/ids/idsColorSystem.ts +3 -8
  39. package/src/hooks/useIDS.ts +31 -16
  40. package/src/hooks/useIfcFederation.ts +2 -2
  41. package/src/lib/geo/kmz-exporter.ts +112 -0
  42. package/src/lib/geo/reproject.ts +244 -0
  43. package/src/lib/lens/adapter.ts +3 -1
  44. package/src/main.tsx +1 -0
  45. package/src/sdk/adapters/export-adapter.ts +14 -1
  46. package/src/sdk/adapters/viewer-adapter.ts +5 -9
  47. package/src/sdk/adapters/visibility-adapter.ts +6 -9
  48. package/src/store/basketVisibleSet.ts +3 -4
  49. package/src/store/globalId.ts +79 -0
  50. package/src/store/index.ts +1 -0
  51. package/src/store/slices/mutationSlice.ts +178 -0
  52. package/src/store/slices/pinboardSlice.ts +4 -8
  53. package/vite.config.ts +17 -0
  54. package/dist/assets/Arrow.dom-BhOg9lpn.js +0 -20
  55. package/dist/assets/arrow2_bg-BlXl-cSQ.js +0 -1
  56. package/dist/assets/basketViewActivator-BRG5DBmM.js +0 -1
  57. package/dist/assets/geometry.worker-kgiT_Qhh.js +0 -1
  58. package/dist/assets/index-B1Ecw4AU.js +0 -189756
  59. package/dist/assets/index-Ba4eoTe7.css +0 -1
  60. package/dist/assets/index-CrgYBjTn.js +0 -229
  61. package/dist/assets/module-6F3E5H7Y-tx0BadV3.js +0 -6
  62. package/dist/assets/wasm-bridge-mJUhb7uk.js +0 -1
@@ -0,0 +1,281 @@
1
+ import{J as Y}from"./zip-B-jFFAGa.js";function j(t){if(!t||typeof t!="string")return t;let e="",i=0;for(;i<t.length;){if(t[i]!=="\\"){e+=t[i],i+=1;continue}if(t[i+1]==="P"&&t[i+3]==="\\"){i+=4;continue}if(t[i+1]==="S"&&t[i+2]==="\\"&&i+3<t.length){e+=String.fromCharCode(t.charCodeAt(i+3)+128),i+=4;continue}if(t[i+1]==="X"&&t[i+2]==="\\"&&i+5<=t.length){const n=t.slice(i+3,i+5);if(/^[0-9A-Fa-f]{2}$/.test(n)){e+=String.fromCharCode(parseInt(n,16)),i+=5;continue}}if(t.startsWith("\\X2\\",i)){const n=t.indexOf("\\X0\\",i+4);if(n!==-1){const o=t.slice(i+4,n);if(o.length%4===0&&/^[0-9A-Fa-f]+$/.test(o)){for(let s=0;s<o.length;s+=4)e+=String.fromCharCode(parseInt(o.slice(s,s+4),16));i=n+4;continue}}}if(t.startsWith("\\X4\\",i)){const n=t.indexOf("\\X0\\",i+4);if(n!==-1){const o=t.slice(i+4,n);if(o.length%8===0&&/^[0-9A-Fa-f]+$/.test(o)){for(let s=0;s<o.length;s+=8)e+=String.fromCodePoint(parseInt(o.slice(s,s+8),16));i=n+4;continue}}}e+=t[i],i+=1}return e}const M="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$";function nt(t){const e=t.replace(/-/g,"").toUpperCase();if(e.length!==32)throw new Error(`Invalid UUID: expected 32 hex characters, got ${e.length}`);const i=new Uint8Array(16);for(let o=0;o<16;o++)i[o]=parseInt(e.substring(o*2,o*2+2),16);let n="";n+=M[i[0]>>6&3],n+=M[i[0]&63];for(let o=1;o<16;o+=3){const s=i[o]||0,c=i[o+1]||0,r=i[o+2]||0;n+=M[s>>2&63],n+=M[(s&3)<<4|c>>4&15],n+=M[(c&15)<<2|r>>6&3],n+=M[r&63]}return n}function se(){return nt(C())}function C(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let i=0;i<16;i++)t[i]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(const i of t)e+=i.toString(16).padStart(2,"0");return`${e.substring(0,8)}-${e.substring(8,12)}-${e.substring(12,16)}-${e.substring(16,20)}-${e.substring(20,32)}`}const A={".T.":"True",".F.":"False",".U.":"Unknown"},X={IFCBOOLEAN:"Boolean",IFCLOGICAL:"Logical",IFCIDENTIFIER:"Identifier",IFCLABEL:"Label",IFCTEXT:"Text",IFCREAL:"Real",IFCINTEGER:"Integer",IFCPOSITIVELENGTHMEASURE:"Length",IFCLENGTHMEASURE:"Length",IFCAREAMEASURE:"Area",IFCVOLUMEMEASURE:"Volume",IFCMASSMEASURE:"Mass",IFCTHERMALTRANSMITTANCEMEASURE:"Thermal Transmittance",IFCPRESSUREMEASURE:"Pressure",IFCFORCEMEASURE:"Force",IFCPLANEANGLEMEASURE:"Angle",IFCTIMEMEASURE:"Time",IFCNORMALISEDRATIOMEASURE:"Ratio",IFCRATIOMEASURE:"Ratio",IFCPOSITIVERATIOMEASURE:"Ratio",IFCCOUNTMEASURE:"Count",IFCMONETARYMEASURE:"Currency"};function ot(t){if(t==null)return{displayValue:"—"};if(Array.isArray(t)&&t.length===2&&typeof t[0]=="string"){const[e,i]=t,n=e.toUpperCase(),o=X[n]||n.replace(/^IFC/,"");return{displayValue:ot(i).displayValue,ifcType:o}}if(typeof t=="string"){const e=t.toUpperCase();if(A[e])return{displayValue:A[e],ifcType:"Boolean"};const i=t.match(/^(IFC[A-Z0-9_]+),(.*)$/i);if(i){const[,n,o]=i,s=n.toUpperCase(),c=X[s]||s.replace(/^IFC/,"");if(!o||o.trim()==="")return{displayValue:"—",ifcType:c};const r=o.toUpperCase().trim();return A[r]?{displayValue:A[r],ifcType:c}:{displayValue:j(o),ifcType:c}}return{displayValue:j(t)}}return typeof t=="boolean"?{displayValue:t?"True":"False",ifcType:"Boolean"}:typeof t=="number"?{displayValue:Number.isInteger(t)?t.toLocaleString():t.toLocaleString(void 0,{maximumFractionDigits:6})}:{displayValue:String(t)}}async function ce(t){const e=await Y.loadAsync(t),i=await st(e),{projectId:n,name:o,extensions:s}=await ct(e),c=await at(e);return{version:i.versionId,projectId:n,name:o,topics:c,extensions:s}}async function st(t){const e=t.file("bcf.version");if(!e)throw new Error("Invalid BCF file: missing bcf.version");const n=(await e.async("string")).match(/VersionId="([^"]+)"/);if(!n)throw new Error("Invalid BCF version file: could not parse VersionId");const o=n[1];return o!=="2.1"&&o!=="3.0"&&console.warn(`Unsupported BCF version: ${o}, treating as 2.1`),{versionId:o==="3.0"?"3.0":"2.1",detailedVersion:n[1]}}async function ct(t){const e=t.file("project.bcfp");if(!e)return{};const i=await e.async("string"),n=i.match(/ProjectId="([^"]+)"/),o=i.match(/<Name>([^<]+)<\/Name>/);return{projectId:n?.[1],name:o?.[1]}}async function at(t){const e=new Map,i=new Set;t.forEach(n=>{const o=n.match(/^([^/]+)\/markup\.bcf$/i);o&&i.add(o[1])});for(const n of i)try{const o=await rt(t,n);o&&e.set(o.guid,o)}catch(o){console.warn(`Failed to parse topic ${n}:`,o)}return e}async function rt(t,e){const i=t.file(`${e}/markup.bcf`);if(!i)return null;const n=await i.async("string"),o=n.match(/<Topic\s+Guid="([^"]+)"[^>]*>([\s\S]*?)<\/Topic>/);if(!o)return console.warn(`Invalid markup.bcf in ${e}: missing Topic element`),null;const s=o[1],c=o[2],r=n.match(/<Topic[^>]*TopicType="([^"]+)"/),a=n.match(/<Topic[^>]*TopicStatus="([^"]+)"/),l=h(c,"Title")||"Untitled",p=h(c,"Description"),f=h(c,"Priority"),m=h(c,"Index"),u=h(c,"CreationDate")||new Date().toISOString(),g=h(c,"CreationAuthor")||"Unknown",d=h(c,"ModifiedDate"),x=h(c,"ModifiedAuthor"),w=h(c,"DueDate"),T=h(c,"AssignedTo"),S=h(c,"Stage"),v=[],K=c.matchAll(/<Labels>([^<]+)<\/Labels>/g);for(const z of K)v.push(z[1]);const Q=lt(c),O=pt(c),F=[],tt=c.matchAll(/<RelatedTopic\s+Guid="([^"]+)"/g);for(const z of tt)F.push(z[1]);const et=ft(n),it=await ut(t,e,n);return{guid:s,title:l,description:p,topicType:r?.[1],topicStatus:a?.[1],priority:f,index:m?parseInt(m,10):void 0,creationDate:u,creationAuthor:g,modifiedDate:d,modifiedAuthor:x,dueDate:w,assignedTo:T,stage:S,labels:v.length>0?v:void 0,bimSnippet:Q,documentReferences:O.length>0?O:void 0,relatedTopics:F.length>0?F:void 0,comments:et,viewpoints:it}}function h(t,e){return t.match(new RegExp(`<${e}>([^<]*)<\\/${e}>`))?.[1]}function lt(t){const e=t.match(/<BimSnippet\s+SnippetType="([^"]+)"[^>]*>([\s\S]*?)<\/BimSnippet>/);if(!e)return;const i=e[0].match(/isExternal="([^"]+)"/),n=h(e[2],"Reference"),o=h(e[2],"ReferenceSchema");return{snippetType:e[1],isExternal:i?.[1]==="true",reference:n||"",referenceSchema:o}}function pt(t){const e=[],i=t.matchAll(/<DocumentReference[^>]*>([\s\S]*?)<\/DocumentReference>/g);for(const n of i){const o=n[0].match(/Guid="([^"]+)"/),s=n[0].match(/isExternal="([^"]+)"/),c=h(n[1],"ReferencedDocument"),r=h(n[1],"Description");c&&e.push({guid:o?.[1],isExternal:s?.[1]==="true",referencedDocument:c,description:r})}return e}function ft(t){const e=[],i=t.matchAll(/<Comment\s+Guid="([^"]+)"[^>]*>([\s\S]*?)<\/Comment>/g);for(const n of i){const o=n[1],s=n[2],c=h(s,"Date")||new Date().toISOString(),r=h(s,"Author")||"Unknown",a=h(s,"Comment")||"",l=h(s,"ModifiedDate"),p=h(s,"ModifiedAuthor"),f=s.match(/<Viewpoint\s+Guid="([^"]+)"/);e.push({guid:o,date:c,author:r,comment:a,viewpointGuid:f?.[1],modifiedDate:l,modifiedAuthor:p})}return e}async function ut(t,e,i){const n=[],o=new Map,s=/<Viewpoint\s+Guid="([^"]+)"[^>]*>([\s\S]*?)<\/Viewpoint>/g;for(const a of i.matchAll(s)){const l=a[1],p=a[2],f=p.match(/<Viewpoint>([^<]+)<\/Viewpoint>/),m=p.match(/<Snapshot>([^<]+)<\/Snapshot>/);o.set(l,{viewpointFile:f?.[1],snapshotFile:m?.[1]})}const c=i.matchAll(/<Viewpoint\s+Guid="([^"]+)"[^>]*\/>/g);for(const a of c)o.has(a[1])||o.set(a[1],{});const r=[];t.forEach(a=>{a.startsWith(`${e}/`)&&a.endsWith(".bcfv")&&r.push(a)});for(const a of r)try{const l=t.file(a);if(!l)continue;const p=await l.async("string"),f=mt(p);if(f){const m=o.get(f.guid);let u=null,g="png";if(m?.snapshotFile){const d=`${e}/${m.snapshotFile}`;u=t.file(d),(m.snapshotFile.toLowerCase().endsWith(".jpg")||m.snapshotFile.toLowerCase().endsWith(".jpeg"))&&(g="jpeg")}if(!u){const d=a.replace(".bcfv",""),x=d.replace(/Viewpoint_/i,"Snapshot_"),w=d.replace(/_viewpoint$/i,"_snapshot"),T=[`${x}.png`,`${w}.png`,`${d}.png`,`${e}/snapshot.png`,`${x}.jpg`,`${w}.jpg`,`${d}.jpg`,`${e}/snapshot.jpg`];for(const S of T)if(u=t.file(S),u){(S.toLowerCase().endsWith(".jpg")||S.toLowerCase().endsWith(".jpeg"))&&(g="jpeg");break}}if(u){const d=await u.async("uint8array");f.snapshotData=d,f.snapshot=`data:image/${g};base64,${B(d)}`}n.push(f)}}catch(l){console.warn(`Failed to parse viewpoint ${a}:`,l)}if(n.length===0){const a=t.file(`${e}/snapshot.png`)||t.file(`${e}/snapshot.jpg`);if(a){const l=a.name.toLowerCase().endsWith(".jpg"),p=await a.async("uint8array");n.push({guid:e,snapshot:`data:image/${l?"jpeg":"png"};base64,${B(p)}`,snapshotData:p})}}return n}function mt(t){const i=t.match(/<VisualizationInfo[^>]+Guid="([^"]+)"/)?.[1]||crypto.randomUUID?.()||`vp-${Date.now()}`,n=dt(t),o=ht(t),s=gt(t),c=Ct(t),r=wt(t),a=St(t);return{guid:i,perspectiveCamera:n,orthogonalCamera:o,components:s,lines:c.length>0?c:void 0,clippingPlanes:r.length>0?r:void 0,bitmaps:a.length>0?a:void 0}}function dt(t){const e=t.match(/<PerspectiveCamera>([\s\S]*?)<\/PerspectiveCamera>/);if(!e)return;const i=e[1],n=V(i,"CameraViewPoint"),o=I(i,"CameraDirection"),s=I(i,"CameraUpVector"),c=h(i,"FieldOfView");if(!(!n||!o||!s||!c))return{cameraViewPoint:n,cameraDirection:o,cameraUpVector:s,fieldOfView:parseFloat(c)}}function ht(t){const e=t.match(/<OrthogonalCamera>([\s\S]*?)<\/OrthogonalCamera>/);if(!e)return;const i=e[1],n=V(i,"CameraViewPoint"),o=I(i,"CameraDirection"),s=I(i,"CameraUpVector"),c=h(i,"ViewToWorldScale");if(!(!n||!o||!s||!c))return{cameraViewPoint:n,cameraDirection:o,cameraUpVector:s,viewToWorldScale:parseFloat(c)}}function V(t,e){const i=t.match(new RegExp(`<${e}>([\\s\\S]*?)<\\/${e}>`));if(!i)return;const n=h(i[1],"X"),o=h(i[1],"Y"),s=h(i[1],"Z");if(!(n===void 0||o===void 0||s===void 0))return{x:parseFloat(n),y:parseFloat(o),z:parseFloat(s)}}function I(t,e){return V(t,e)}function gt(t){const e=t.match(/<Components>([\s\S]*?)<\/Components>/);if(!e)return;const i=e[1],n=Z(i,"Selection"),o=yt(i),s=xt(i);if(!(!n&&!o&&!s))return{selection:n?.length?n:void 0,visibility:o,coloring:s?.length?s:void 0}}function Z(t,e){const i=t.match(new RegExp(`<${e}>([\\s\\S]*?)<\\/${e}>`));if(!i)return;const n=[],o=i[1].matchAll(/<Component[^>]*(?:\/>|>[\s\S]*?<\/Component>)/g);for(const s of o){const c=H(s[0]);c&&n.push(c)}return n.length>0?n:void 0}function H(t){const e=t.match(/IfcGuid="([^"]+)"/),i=t.match(/AuthoringToolId="([^"]+)"/),n=t.match(/OriginatingSystem="([^"]+)"/);if(!(!e&&!i))return{ifcGuid:e?.[1],authoringToolId:i?.[1],originatingSystem:n?.[1]}}function yt(t){const e=t.match(/<Visibility[^>]*>([\s\S]*?)<\/Visibility>/);if(!e)return;const n=t.match(/DefaultVisibility="([^"]+)"/)?.[1]!=="false",o=Z(e[1],"Exceptions");return{defaultVisibility:n,exceptions:o}}function xt(t){const e=t.match(/<Coloring>([\s\S]*?)<\/Coloring>/);if(!e)return;const i=[],n=e[1].matchAll(/<Color\s+Color="([^"]+)"[^>]*>([\s\S]*?)<\/Color>/g);for(const o of n){const s=o[1],c=[],r=o[2].matchAll(/<Component[^>]*(?:\/>|>[\s\S]*?<\/Component>)/g);for(const a of r){const l=H(a[0]);l&&c.push(l)}c.length>0&&i.push({color:s,components:c})}return i.length>0?i:void 0}function Ct(t){const e=[],i=t.match(/<Lines>([\s\S]*?)<\/Lines>/);if(!i)return e;const n=i[1].matchAll(/<Line>([\s\S]*?)<\/Line>/g);for(const o of n){const s=V(o[1],"StartPoint"),c=V(o[1],"EndPoint");s&&c&&e.push({startPoint:s,endPoint:c})}return e}function wt(t){const e=[],i=t.match(/<ClippingPlanes>([\s\S]*?)<\/ClippingPlanes>/);if(!i)return e;const n=i[1].matchAll(/<ClippingPlane>([\s\S]*?)<\/ClippingPlane>/g);for(const o of n){const s=V(o[1],"Location"),c=I(o[1],"Direction");s&&c&&e.push({location:s,direction:c})}return e}function St(t){const e=[],i=t.match(/<Bitmaps>([\s\S]*?)<\/Bitmaps>/);if(!i)return e;const n=i[1].matchAll(/<Bitmap>([\s\S]*?)<\/Bitmap>/g);for(const o of n){const s=h(o[1],"Format")||h(o[1],"Bitmap"),c=h(o[1],"Reference"),r=V(o[1],"Location"),a=I(o[1],"Normal"),l=I(o[1],"Up"),p=h(o[1],"Height");s&&c&&r&&a&&l&&p&&e.push({format:s.toUpperCase()==="JPG"?"JPG":"PNG",reference:c,location:r,normal:a,up:l,height:parseFloat(p)})}return e}function B(t){let e="";for(let i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return btoa(e)}async function ae(t){const e=new Y;$t(e,t.version),(t.projectId||t.name)&&bt(e,t);for(const[i,n]of t.topics)await Tt(e,n);return e.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}})}function $t(t,e){const i=`<?xml version="1.0" encoding="UTF-8"?>
2
+ <Version xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" VersionId="${e}">
3
+ <DetailedVersion>${e}</DetailedVersion>
4
+ </Version>`;t.file("bcf.version",i)}function bt(t,e){const i=e.projectId||C(),n=e.name?`
5
+ <Name>${y(e.name)}</Name>`:"",o=`<?xml version="1.0" encoding="UTF-8"?>
6
+ <ProjectExtension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
7
+ <Project ProjectId="${i}">${n}
8
+ </Project>
9
+ </ProjectExtension>`;t.file("project.bcfp",o)}async function Tt(t,e){const i=t.folder(e.guid);if(i){vt(i,e);for(let n=0;n<e.viewpoints.length;n++){const o=e.viewpoints[n];await Vt(i,o)}}}function vt(t,e){let i=`<?xml version="1.0" encoding="UTF-8"?>
10
+ <Markup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
11
+ <Topic Guid="${e.guid}"${e.topicType?` TopicType="${y(e.topicType)}"`:""}${e.topicStatus?` TopicStatus="${y(e.topicStatus)}"`:""}>
12
+ <Title>${y(e.title)}</Title>`;if(e.description&&(i+=`
13
+ <Description>${y(e.description)}</Description>`),e.priority&&(i+=`
14
+ <Priority>${y(e.priority)}</Priority>`),e.index!==void 0&&(i+=`
15
+ <Index>${e.index}</Index>`),i+=`
16
+ <CreationDate>${e.creationDate}</CreationDate>`,i+=`
17
+ <CreationAuthor>${y(e.creationAuthor)}</CreationAuthor>`,e.modifiedDate){i+=`
18
+ <ModifiedDate>${e.modifiedDate}</ModifiedDate>`;const n=e.modifiedAuthor||e.creationAuthor;i+=`
19
+ <ModifiedAuthor>${y(n)}</ModifiedAuthor>`}if(e.dueDate&&(i+=`
20
+ <DueDate>${e.dueDate}</DueDate>`),e.assignedTo&&(i+=`
21
+ <AssignedTo>${y(e.assignedTo)}</AssignedTo>`),e.stage&&(i+=`
22
+ <Stage>${y(e.stage)}</Stage>`),e.labels&&e.labels.length>0)for(const n of e.labels)i+=`
23
+ <Labels>${y(n)}</Labels>`;if(e.relatedTopics&&e.relatedTopics.length>0)for(const n of e.relatedTopics)i+=`
24
+ <RelatedTopic Guid="${n}"/>`;i+=`
25
+ </Topic>`;for(let n=0;n<e.viewpoints.length;n++){const o=e.viewpoints[n],s=`Viewpoint_${o.guid}.bcfv`,c=`Snapshot_${o.guid}.png`;i+=`
26
+ <Viewpoints Guid="${o.guid}">`,i+=`
27
+ <Viewpoint>${s}</Viewpoint>`,(o.snapshot||o.snapshotData)&&(i+=`
28
+ <Snapshot>${c}</Snapshot>`),i+=`
29
+ </Viewpoints>`}for(const n of e.comments)i+=`
30
+ <Comment Guid="${n.guid}">`,i+=`
31
+ <Date>${n.date}</Date>`,i+=`
32
+ <Author>${y(n.author)}</Author>`,i+=`
33
+ <Comment>${y(n.comment)}</Comment>`,n.viewpointGuid&&(i+=`
34
+ <Viewpoint Guid="${n.viewpointGuid}"/>`),n.modifiedDate&&(i+=`
35
+ <ModifiedDate>${n.modifiedDate}</ModifiedDate>`),n.modifiedAuthor&&(i+=`
36
+ <ModifiedAuthor>${y(n.modifiedAuthor)}</ModifiedAuthor>`),i+=`
37
+ </Comment>`;i+=`
38
+ </Markup>`,t.file("markup.bcf",i)}async function Vt(t,e,i){const n=`Viewpoint_${e.guid}.bcfv`,o=`Snapshot_${e.guid}.png`;let s=`<?xml version="1.0" encoding="UTF-8"?>
39
+ <VisualizationInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="${e.guid}">`;if(e.components&&(s+=It(e.components)),e.perspectiveCamera&&(s+=Pt(e.perspectiveCamera)),e.orthogonalCamera&&(s+=At(e.orthogonalCamera)),e.lines&&e.lines.length>0){s+=`
40
+ <Lines>`;for(const c of e.lines)s+=Dt(c);s+=`
41
+ </Lines>`}if(e.clippingPlanes&&e.clippingPlanes.length>0){s+=`
42
+ <ClippingPlanes>`;for(const c of e.clippingPlanes)s+=Ft(c);s+=`
43
+ </ClippingPlanes>`}if(e.bitmaps&&e.bitmaps.length>0){s+=`
44
+ <Bitmaps>`;for(const c of e.bitmaps)s+=zt(c);s+=`
45
+ </Bitmaps>`}if(s+=`
46
+ </VisualizationInfo>`,t.file(n,s),e.snapshotData)t.file(o,e.snapshotData);else if(e.snapshot&&e.snapshot.startsWith("data:")){const c=e.snapshot.split(",")[1],r=atob(c),a=new Uint8Array(r.length);for(let l=0;l<r.length;l++)a[l]=r.charCodeAt(l);t.file(o,a)}}function It(t){let e=`
47
+ <Components>`;if(t.visibility?.viewSetupHints){const i=t.visibility.viewSetupHints;e+=`
48
+ <ViewSetupHints`,i.spacesVisible!==void 0&&(e+=` SpacesVisible="${i.spacesVisible}"`),i.spaceBoundariesVisible!==void 0&&(e+=` SpaceBoundariesVisible="${i.spaceBoundariesVisible}"`),i.openingsVisible!==void 0&&(e+=` OpeningsVisible="${i.openingsVisible}"`),e+="/>"}if(t.selection&&t.selection.length>0){e+=`
49
+ <Selection>`;for(const i of t.selection)e+=k(i);e+=`
50
+ </Selection>`}if(e+=Mt(t.visibility),t.coloring&&t.coloring.length>0){e+=`
51
+ <Coloring>`;for(const i of t.coloring)e+=Et(i);e+=`
52
+ </Coloring>`}return e+=`
53
+ </Components>`,e}function Mt(t){let i=`
54
+ <Visibility DefaultVisibility="${t?.defaultVisibility??!0}">`;if(t?.exceptions&&t.exceptions.length>0){i+=`
55
+ <Exceptions>`;for(const n of t.exceptions)i+=k(n," ");i+=`
56
+ </Exceptions>`}return i+=`
57
+ </Visibility>`,i}function k(t,e=" "){const i=t.originatingSystem||t.authoringToolId;let n=`
58
+ ${e}<Component`;return t.ifcGuid&&(n+=` IfcGuid="${t.ifcGuid}"`),i?(n+=">",t.originatingSystem&&(n+=`
59
+ ${e} <OriginatingSystem>${y(t.originatingSystem)}</OriginatingSystem>`),t.authoringToolId&&(n+=`
60
+ ${e} <AuthoringToolId>${y(t.authoringToolId)}</AuthoringToolId>`),n+=`
61
+ ${e}</Component>`):n+="/>",n}function Et(t){let e=`
62
+ <Color Color="${t.color}">`;for(const i of t.components)e+=k(i," ");return e+=`
63
+ </Color>`,e}function Pt(t){return`
64
+ <PerspectiveCamera>
65
+ <CameraViewPoint>
66
+ <X>${t.cameraViewPoint.x}</X>
67
+ <Y>${t.cameraViewPoint.y}</Y>
68
+ <Z>${t.cameraViewPoint.z}</Z>
69
+ </CameraViewPoint>
70
+ <CameraDirection>
71
+ <X>${t.cameraDirection.x}</X>
72
+ <Y>${t.cameraDirection.y}</Y>
73
+ <Z>${t.cameraDirection.z}</Z>
74
+ </CameraDirection>
75
+ <CameraUpVector>
76
+ <X>${t.cameraUpVector.x}</X>
77
+ <Y>${t.cameraUpVector.y}</Y>
78
+ <Z>${t.cameraUpVector.z}</Z>
79
+ </CameraUpVector>
80
+ <FieldOfView>${t.fieldOfView}</FieldOfView>
81
+ </PerspectiveCamera>`}function At(t){return`
82
+ <OrthogonalCamera>
83
+ <CameraViewPoint>
84
+ <X>${t.cameraViewPoint.x}</X>
85
+ <Y>${t.cameraViewPoint.y}</Y>
86
+ <Z>${t.cameraViewPoint.z}</Z>
87
+ </CameraViewPoint>
88
+ <CameraDirection>
89
+ <X>${t.cameraDirection.x}</X>
90
+ <Y>${t.cameraDirection.y}</Y>
91
+ <Z>${t.cameraDirection.z}</Z>
92
+ </CameraDirection>
93
+ <CameraUpVector>
94
+ <X>${t.cameraUpVector.x}</X>
95
+ <Y>${t.cameraUpVector.y}</Y>
96
+ <Z>${t.cameraUpVector.z}</Z>
97
+ </CameraUpVector>
98
+ <ViewToWorldScale>${t.viewToWorldScale}</ViewToWorldScale>
99
+ </OrthogonalCamera>`}function Dt(t){return`
100
+ <Line>
101
+ <StartPoint>
102
+ <X>${t.startPoint.x}</X>
103
+ <Y>${t.startPoint.y}</Y>
104
+ <Z>${t.startPoint.z}</Z>
105
+ </StartPoint>
106
+ <EndPoint>
107
+ <X>${t.endPoint.x}</X>
108
+ <Y>${t.endPoint.y}</Y>
109
+ <Z>${t.endPoint.z}</Z>
110
+ </EndPoint>
111
+ </Line>`}function Ft(t){return`
112
+ <ClippingPlane>
113
+ <Location>
114
+ <X>${t.location.x}</X>
115
+ <Y>${t.location.y}</Y>
116
+ <Z>${t.location.z}</Z>
117
+ </Location>
118
+ <Direction>
119
+ <X>${t.direction.x}</X>
120
+ <Y>${t.direction.y}</Y>
121
+ <Z>${t.direction.z}</Z>
122
+ </Direction>
123
+ </ClippingPlane>`}function zt(t){return`
124
+ <Bitmap>
125
+ <Format>${t.format}</Format>
126
+ <Reference>${y(t.reference)}</Reference>
127
+ <Location>
128
+ <X>${t.location.x}</X>
129
+ <Y>${t.location.y}</Y>
130
+ <Z>${t.location.z}</Z>
131
+ </Location>
132
+ <Normal>
133
+ <X>${t.normal.x}</X>
134
+ <Y>${t.normal.y}</Y>
135
+ <Z>${t.normal.z}</Z>
136
+ </Normal>
137
+ <Up>
138
+ <X>${t.up.x}</X>
139
+ <Y>${t.up.y}</Y>
140
+ <Z>${t.up.z}</Z>
141
+ </Up>
142
+ <Height>${t.height}</Height>
143
+ </Bitmap>`}function y(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function $(t){return{x:t.x,y:-t.z,z:t.y}}function b(t){return{x:t.x,y:t.z,z:-t.y}}function Lt(t){const e=$(t.position),i=$(t.target),n=$(t.up),o=i.x-e.x,s=i.y-e.y,c=i.z-e.z,r=Math.sqrt(o*o+s*s+c*c),a=r>1e-4?{x:o/r,y:s/r,z:c/r}:{x:0,y:1,z:0},l=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z),p=l>1e-4?{x:n.x/l,y:n.y/l,z:n.z/l}:{x:0,y:0,z:1},f=t.fov*180/Math.PI;return{cameraViewPoint:e,cameraDirection:a,cameraUpVector:p,fieldOfView:Math.max(1,Math.min(179,f))}}function Gt(t,e){const i=$(t.position),n=$(t.target),o=$(t.up),s=n.x-i.x,c=n.y-i.y,r=n.z-i.z,a=Math.sqrt(s*s+c*c+r*r),l=a>1e-4?{x:s/a,y:c/a,z:r/a}:{x:0,y:1,z:0},p=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z),f=p>1e-4?{x:o.x/p,y:o.y/p,z:o.z/p}:{x:0,y:0,z:1};return{cameraViewPoint:i,cameraDirection:l,cameraUpVector:f,viewToWorldScale:e}}function Ut(t,e=10){const i={x:t.cameraViewPoint.x+t.cameraDirection.x*e,y:t.cameraViewPoint.y+t.cameraDirection.y*e,z:t.cameraViewPoint.z+t.cameraDirection.z*e},n=b(t.cameraViewPoint),o=b(i),s=b(t.cameraUpVector),c=t.fieldOfView*Math.PI/180;return{position:n,target:o,up:s,fov:c,isOrthographic:!1}}function kt(t,e=10){const i={x:t.cameraViewPoint.x+t.cameraDirection.x*e,y:t.cameraViewPoint.y+t.cameraDirection.y*e,z:t.cameraViewPoint.z+t.cameraDirection.z*e},n=b(t.cameraViewPoint),o=b(i),s=b(t.cameraUpVector);return{position:n,target:o,up:s,fov:Math.PI/4,isOrthographic:!0,orthoScale:t.viewToWorldScale}}function Rt(t,e){if(!t.enabled)return null;const i=t.position/100;let n,o;switch(t.axis){case"down":n={x:(e.min.x+e.max.x)/2,y:e.min.y+i*(e.max.y-e.min.y),z:(e.min.z+e.max.z)/2},o=t.flipped?{x:0,y:1,z:0}:{x:0,y:-1,z:0};break;case"front":n={x:(e.min.x+e.max.x)/2,y:(e.min.y+e.max.y)/2,z:e.min.z+i*(e.max.z-e.min.z)},o=t.flipped?{x:0,y:0,z:1}:{x:0,y:0,z:-1};break;case"side":n={x:e.min.x+i*(e.max.x-e.min.x),y:(e.min.y+e.max.y)/2,z:(e.min.z+e.max.z)/2},o=t.flipped?{x:1,y:0,z:0}:{x:-1,y:0,z:0};break}return{location:$(n),direction:$(o)}}function Ot(t,e){const i=b(t.location),n=b(t.direction),o=Math.abs(n.x),s=Math.abs(n.y),c=Math.abs(n.z);let r,a,l;if(s>=o&&s>=c){r="down";const p=e.max.y-e.min.y;a=p>0?(i.y-e.min.y)/p*100:50,l=n.y>0}else if(c>=o){r="front";const p=e.max.z-e.min.z;a=p>0?(i.z-e.min.z)/p*100:50,l=n.z>0}else{r="side";const p=e.max.x-e.min.x;a=p>0?(i.x-e.min.x)/p*100:50,l=n.x>0}return a=Math.max(0,Math.min(100,a)),{axis:r,position:a,enabled:!0,flipped:l}}function re(t){const{camera:e,sectionPlane:i,bounds:n,snapshot:o,snapshotData:s,selectedGuids:c,hiddenGuids:r,visibleGuids:a,coloredGuids:l}=t,p={guid:C()};if(e.isOrthographic&&e.orthoScale!==void 0?p.orthogonalCamera=Gt(e,e.orthoScale):p.perspectiveCamera=Lt(e),i?.enabled&&n){const d=Rt(i,n);d&&(p.clippingPlanes=[d])}o&&(p.snapshot=o),s&&(p.snapshotData=s);const f=c&&c.length>0,m=r&&r.length>0,u=a&&a.length>0,g=l&&l.length>0;return(f||m||u||g)&&(p.components={},f&&(p.components.selection=c.map(d=>({ifcGuid:d}))),u?p.components.visibility={defaultVisibility:!1,exceptions:a.map(d=>({ifcGuid:d}))}:m&&(p.components.visibility={defaultVisibility:!0,exceptions:r.map(d=>({ifcGuid:d}))}),g&&(p.components.coloring=l.map(({color:d,guids:x})=>({color:d,components:x.map(w=>({ifcGuid:w}))})))),p}function le(t,e,i=10){let n,o;t.perspectiveCamera?n=Ut(t.perspectiveCamera,i):t.orthogonalCamera&&(n=kt(t.orthogonalCamera,i)),t.clippingPlanes&&t.clippingPlanes.length>0&&e&&(o=Ot(t.clippingPlanes[0],e));const s=[];if(t.components?.selection)for(const l of t.components.selection)l.ifcGuid&&s.push(l.ifcGuid);const c=[],r=[];if(t.components?.visibility){const{defaultVisibility:l,exceptions:p}=t.components.visibility;if(p)for(const f of p)f.ifcGuid&&(l===!1?r.push(f.ifcGuid):c.push(f.ifcGuid))}const a=[];if(t.components?.coloring)for(const l of t.components.coloring){const p=[];for(const f of l.components)f.ifcGuid&&p.push(f.ifcGuid);p.length>0&&a.push({color:l.color,guids:p})}return{camera:n,sectionPlane:o,selectedGuids:s,hiddenGuids:c,visibleGuids:r,coloredGuids:a}}function G(t){return{x:t.x,y:t.z,z:-t.y}}function jt(t,e){const i=t.perspectiveCamera??t.orthogonalCamera;if(!i)return null;const n=G(i.cameraViewPoint),o=G(i.cameraDirection),s=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z);if(s<1e-6)return null;const c=o.x/s,r=o.y/s,a=o.z/s;return{x:n.x+c*e,y:n.y+r*e,z:n.z+a*e}}function N(t){const e=(t.min.x+t.max.x)/2,i=(t.min.z+t.max.z)/2,n=t.max.y,o=t.max.y-t.min.y,s=Math.max(o*.3,.5);return{position:{x:e,y:n+s,z:i},connectorAnchor:{x:e,y:n,z:i}}}function Xt(t,e,i){const n=t.components?.selection;if(n&&n.length>0)for(const r of n){if(!r.ifcGuid)continue;const a=e(r.ifcGuid);if(a)return{...N(a),source:"component"}}const o=t.components?.visibility;if(o&&!o.defaultVisibility&&o.exceptions&&o.exceptions.length>0)for(const r of o.exceptions){if(!r.ifcGuid)continue;const a=e(r.ifcGuid);if(a)return{...N(a),source:"component"}}const s=jt(t,i);if(s)return{position:s,source:"camera-target"};const c=t.perspectiveCamera??t.orthogonalCamera;return c?{position:G(c.cameraViewPoint),source:"camera-position"}:null}function pe(t,e,i){const{targetDistance:n=50,statusFilter:o}=i??{},s=[];for(let c=0;c<t.length;c++){const r=t[c];if(o&&o.length>0){const p=(r.topicStatus??"").toLowerCase();if(!o.some(f=>f.toLowerCase()===p))continue}let a=null;for(const p of r.viewpoints)if(a=Xt(p,e,n),a)break;if(!a)continue;const l=r.viewpoints[0];s.push({topicGuid:r.guid,position:a.position,connectorAnchor:a.connectorAnchor,title:r.title,status:r.topicStatus??"Open",priority:r.priority??"Normal",topicType:r.topicType??"Issue",commentCount:r.comments.length,hasViewpoint:r.viewpoints.length>0,snapshot:l?.snapshot,positionSource:a.source,index:r.index??c+1})}return s}const L="bcf-overlay-marker",_="bcf-overlay-connector",E="bcf-overlay-active",P="bcf-overlay-tooltip",Bt={high:"#f7768e",critical:"#f7768e",medium:"#ff9e64",normal:"#ff9e64",low:"#9ece6a"},Nt={open:"●","in progress":"◐",resolved:"✓",closed:"○"};class U{container;svgLayer;markerElements=new Map;connectorElements=new Map;markers=[];activeMarkerId=null;projection;unsubCamera=null;clickCallbacks=[];hoverCallbacks=[];opts;_visible=!0;_disposed=!1;constructor(e,i,n){this.projection=i,this.opts={showConnectors:n?.showConnectors??!0,showTooltips:n?.showTooltips??!0,minScale:n?.minScale??.65,maxScale:n?.maxScale??1,verticalOffset:n?.verticalOffset??36},this.container=document.createElement("div"),this.container.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:20;",e.appendChild(this.container),this.svgLayer=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svgLayer.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;",this.container.appendChild(this.svgLayer),this.injectStyles(),this.unsubCamera=i.onCameraChange(()=>this.updatePositions())}setMarkers(e){this.markers=e;const i=new Set(e.map(n=>n.topicGuid));for(const[n,o]of this.markerElements)i.has(n)||(o.remove(),this.markerElements.delete(n));for(const[n,o]of this.connectorElements)i.has(n)||(o.remove(),this.connectorElements.delete(n));for(const n of e)this.markerElements.has(n.topicGuid)?this.updateMarkerContent(n):this.createMarkerElement(n);this.updatePositions()}setActiveMarker(e){if(this.activeMarkerId){const i=this.markerElements.get(this.activeMarkerId);i&&i.classList.remove(E)}if(this.activeMarkerId=e,e){const i=this.markerElements.get(e);i&&i.classList.add(E)}}setVisible(e){this._visible=e,this.container.style.display=e?"":"none"}onMarkerClick(e){return this.clickCallbacks.push(e),()=>{this.clickCallbacks=this.clickCallbacks.filter(i=>i!==e)}}onMarkerHover(e){return this.hoverCallbacks.push(e),()=>{this.hoverCallbacks=this.hoverCallbacks.filter(i=>i!==e)}}updatePositions(){if(this._disposed||!this._visible)return;const{width:e,height:i}=this.projection.getCanvasSize();if(e===0||i===0)return;const n=this.projection.getCameraPosition?.();for(const o of this.markers){const s=this.markerElements.get(o.topicGuid);if(!s)continue;const c=this.projection.projectToScreen(o.position);if(!c||c.x<-80||c.y<-80||c.x>e+80||c.y>i+80){s.style.display="none";const f=this.connectorElements.get(o.topicGuid);f&&(f.style.display="none");continue}s.style.display="";let r=1;if(n){const f=o.position.x-n.x,m=o.position.y-n.y,u=o.position.z-n.z,g=Math.sqrt(f*f+m*m+u*u),d=Math.max(0,Math.min(1,(g-20)/180));r=this.opts.maxScale+d*(this.opts.minScale-this.opts.maxScale)}const a=c.x,l=c.y;s.style.transform=`translate(${a}px, ${l}px) translate(-50%, -100%) scale(${r.toFixed(3)})`;const p=n?.6+(1-Math.max(0,Math.min(1,(Math.sqrt((o.position.x-n.x)**2+(o.position.y-n.y)**2+(o.position.z-n.z)**2)-20)/250)))*.4:1;if(s.style.opacity=p.toFixed(2),this.opts.showConnectors){const f=o.connectorAnchor??o.position,m=this.projection.projectToScreen(f);let u=this.connectorElements.get(o.topicGuid);if(u||(u=document.createElementNS("http://www.w3.org/2000/svg","line"),u.classList.add(_),this.svgLayer.appendChild(u),this.connectorElements.set(o.topicGuid,u)),!m){u.style.display="none";continue}u.style.display="";const g=this.getPriorityColor(o.priority);u.setAttribute("x1",String(a)),u.setAttribute("y1",String(l)),u.setAttribute("x2",String(m.x)),u.setAttribute("y2",String(m.y)),u.setAttribute("stroke",g),u.setAttribute("stroke-width","1.5"),u.setAttribute("stroke-dasharray","3 2"),u.setAttribute("stroke-opacity",String((p*.5).toFixed(2)))}}}dispose(){this._disposed=!0,this.unsubCamera&&this.unsubCamera(),this.container.remove(),this.markerElements.clear(),this.connectorElements.clear(),this.clickCallbacks=[],this.hoverCallbacks=[]}createMarkerElement(e){const i=document.createElement("div");i.className=L,i.dataset.topicGuid=e.topicGuid,this.updateMarkerInnerHTML(i,e),i.addEventListener("click",n=>{n.stopPropagation();for(const o of this.clickCallbacks)o(e.topicGuid)}),i.addEventListener("mouseenter",()=>{for(const o of this.hoverCallbacks)o(e.topicGuid);const n=i.querySelector(`.${P}`);n&&(n.style.display="")}),i.addEventListener("mouseleave",()=>{for(const o of this.hoverCallbacks)o(null);const n=i.querySelector(`.${P}`);n&&(n.style.display="none")}),e.topicGuid===this.activeMarkerId&&i.classList.add(E),this.container.appendChild(i),this.markerElements.set(e.topicGuid,i)}updateMarkerContent(e){const i=this.markerElements.get(e.topicGuid);i&&(this.updateMarkerInnerHTML(i,e),e.topicGuid===this.activeMarkerId?i.classList.add(E):i.classList.remove(E))}updateMarkerInnerHTML(e,i){const n=this.getPriorityColor(i.priority),o=Nt[i.status.toLowerCase()]??"●";e.innerHTML=`
144
+ <div class="bcf-marker-pin" style="--marker-color:${n};">
145
+ <span class="bcf-marker-index">${i.index}</span>
146
+ </div>
147
+ <div class="${P}" style="display:none;">
148
+ <div class="bcf-tooltip-header">
149
+ <span class="bcf-tooltip-status" style="color:${n}">${o}</span>
150
+ <span class="bcf-tooltip-title">${this.escapeHtml(i.title)}</span>
151
+ </div>
152
+ <div class="bcf-tooltip-meta">
153
+ ${this.escapeHtml(i.status)}${i.commentCount>0?` · ${i.commentCount} comment${i.commentCount!==1?"s":""}`:""}
154
+ </div>
155
+ </div>
156
+ `}getPriorityColor(e){return Bt[e.toLowerCase()]??"#7aa2f7"}escapeHtml(e){const i=document.createElement("div");return i.textContent=e,i.innerHTML}static stylesInjected=!1;injectStyles(){if(U.stylesInjected)return;U.stylesInjected=!0;const e=document.createElement("style");e.textContent=`
157
+ /* BCF 3D Overlay Markers */
158
+
159
+ .${L} {
160
+ position: absolute;
161
+ left: 0;
162
+ top: 0;
163
+ pointer-events: auto;
164
+ cursor: pointer;
165
+ will-change: transform, opacity;
166
+ z-index: 21;
167
+ filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
168
+ transform-origin: center bottom;
169
+ }
170
+
171
+ .bcf-marker-pin {
172
+ width: 28px;
173
+ height: 28px;
174
+ border-radius: 50% 50% 50% 0;
175
+ background: var(--marker-color, #7aa2f7);
176
+ transform: rotate(-45deg);
177
+ display: flex;
178
+ align-items: center;
179
+ justify-content: center;
180
+ border: 2px solid rgba(255,255,255,0.9);
181
+ box-shadow: 0 2px 8px rgba(0,0,0,0.25);
182
+ transition: transform 0.15s ease, box-shadow 0.15s ease;
183
+ }
184
+
185
+ .${L}:hover .bcf-marker-pin {
186
+ transform: rotate(-45deg) scale(1.2);
187
+ box-shadow: 0 4px 16px rgba(0,0,0,0.4);
188
+ }
189
+
190
+ .${E} .bcf-marker-pin {
191
+ transform: rotate(-45deg) scale(1.25);
192
+ box-shadow: 0 0 0 4px rgba(122,162,247,0.35), 0 4px 16px rgba(0,0,0,0.4);
193
+ animation: bcf-pulse 1.8s ease-in-out infinite;
194
+ }
195
+
196
+ .bcf-marker-index {
197
+ transform: rotate(45deg);
198
+ font-size: 11px;
199
+ font-weight: 700;
200
+ color: white;
201
+ font-family: ui-monospace, monospace;
202
+ line-height: 1;
203
+ user-select: none;
204
+ }
205
+
206
+ /* Tooltip */
207
+ .${P} {
208
+ position: absolute;
209
+ bottom: calc(100% + 6px);
210
+ left: 50%;
211
+ transform: translateX(-50%);
212
+ background: #1a1b26;
213
+ color: #a9b1d6;
214
+ border: 1px solid #3b4261;
215
+ padding: 8px 12px;
216
+ min-width: 160px;
217
+ max-width: 260px;
218
+ font-family: ui-monospace, monospace;
219
+ font-size: 11px;
220
+ line-height: 1.4;
221
+ white-space: nowrap;
222
+ z-index: 100;
223
+ pointer-events: none;
224
+ box-shadow: 0 4px 16px rgba(0,0,0,0.5);
225
+ }
226
+
227
+ .${P}::after {
228
+ content: '';
229
+ position: absolute;
230
+ top: 100%;
231
+ left: 50%;
232
+ transform: translateX(-50%);
233
+ border: 5px solid transparent;
234
+ border-top-color: #3b4261;
235
+ }
236
+
237
+ .bcf-tooltip-header {
238
+ display: flex;
239
+ align-items: center;
240
+ gap: 6px;
241
+ }
242
+
243
+ .bcf-tooltip-status {
244
+ font-size: 10px;
245
+ flex-shrink: 0;
246
+ }
247
+
248
+ .bcf-tooltip-title {
249
+ font-weight: 600;
250
+ color: #c0caf5;
251
+ overflow: hidden;
252
+ text-overflow: ellipsis;
253
+ }
254
+
255
+ .bcf-tooltip-meta {
256
+ margin-top: 3px;
257
+ font-size: 10px;
258
+ color: #565f89;
259
+ text-transform: uppercase;
260
+ letter-spacing: 0.05em;
261
+ }
262
+
263
+ /* Connector lines */
264
+ .${_} {
265
+ pointer-events: none;
266
+ }
267
+
268
+ /* Pulse animation for active marker */
269
+ @keyframes bcf-pulse {
270
+ 0%, 100% { box-shadow: 0 0 0 4px rgba(122,162,247,0.35), 0 4px 16px rgba(0,0,0,0.4); }
271
+ 50% { box-shadow: 0 0 0 8px rgba(122,162,247,0.1), 0 4px 16px rgba(0,0,0,0.4); }
272
+ }
273
+ `,document.head.appendChild(e)}}function _t(t,e){return{version:e,projectId:C(),name:t,topics:new Map}}function R(t){return{guid:C(),title:t.title,description:t.description,topicType:t.topicType??"Issue",topicStatus:t.topicStatus??"Open",priority:t.priority,creationDate:new Date().toISOString(),creationAuthor:t.author,labels:t.labels,comments:[],viewpoints:[]}}function D(t){return{guid:C(),date:new Date().toISOString(),author:t.author,comment:t.comment,viewpointGuid:t.viewpointGuid}}const Yt="ids-validator@ifc-lite",Zt=1e3,Ht="FFFF3333",qt="Error",q="Info",Wt=50;function fe(t,e={}){const{author:i=Yt,projectName:n,version:o="2.1",topicGrouping:s="per-entity",includePassingEntities:c=!1,failureTopicType:r=qt,passTopicType:a=q,maxTopics:l=Zt,failureColor:p=Ht,entityBounds:f,entitySnapshots:m}=e,u=_t(n??t.title,o);switch(s){case"per-entity":Jt(u,t,{author:i,includePassingEntities:c,failureTopicType:r,passTopicType:a,maxTopics:l,failureColor:p,entityBounds:f,entitySnapshots:m});break;case"per-specification":Kt(u,t,{author:i,failureTopicType:r,maxTopics:l,failureColor:p});break;case"per-requirement":Qt(u,t,{author:i,failureTopicType:r,maxTopics:l,failureColor:p,entityBounds:f,entitySnapshots:m});break}return u}function Jt(t,e,i){let n=0;for(const o of e.specificationResults)if(o.status!=="not_applicable")for(const s of o.entityResults){if(n>=i.maxTopics)return;if(s.passed&&!i.includePassingEntities)continue;const c=s.requirementResults.filter(m=>m.status==="fail"),r=s.requirementResults.filter(m=>m.status!=="not_applicable").length,a=s.entityName||`#${s.expressId}`,l=!s.passed,p=R({title:`${s.entityType}: ${a}`,description:te(o,s,c.length,r),author:i.author,topicType:l?i.failureTopicType:i.passTopicType??q,topicStatus:l?"Open":"Closed",priority:l?c.length===r?"High":"Medium":void 0,labels:["IDS",o.specification.name]});let f;if(s.globalId){const m=`${s.modelId}:${s.expressId}`,u=i.entityBounds?.get(m),g=i.entitySnapshots?.get(m),d=J(s.globalId,l?i.failureColor:void 0,u,g);p.viewpoints.push(d),f=d.guid}for(const m of c){const u=D({author:i.author,comment:W(m),viewpointGuid:f});p.comments.push(u)}t.topics.set(p.guid,p),n++}}function Kt(t,e,i){let n=0;for(const o of e.specificationResults){if(o.status!=="fail")continue;if(n>=i.maxTopics)return;const s=o.entityResults.filter(f=>!f.passed),c=R({title:`[FAIL] ${o.specification.name}`,description:ee(o),author:i.author,topicType:i.failureTopicType,topicStatus:"Open",priority:o.failedCount>o.passedCount?"High":"Medium",labels:["IDS",o.specification.name]}),r=s.map(f=>f.globalId).filter(f=>f!==void 0);let a;if(r.length>0){const f=ne(r,i.failureColor);c.viewpoints.push(f),a=f.guid}const l=Wt,p=s.slice(0,l);for(const f of p){const m=f.entityName||`#${f.expressId}`,g=f.requirementResults.filter(x=>x.status==="fail").map(x=>x.failureReason??x.checkedDescription).join("; "),d=D({author:i.author,comment:`${f.entityType}: ${m}${f.globalId?` (${f.globalId})`:""}
274
+ ${g}`,viewpointGuid:a});c.comments.push(d)}if(s.length>l){const f=D({author:i.author,comment:`... and ${s.length-l} more failing entities`});c.comments.push(f)}t.topics.set(c.guid,c),n++}}function Qt(t,e,i){let n=0;for(const o of e.specificationResults)if(o.status==="fail"){for(const s of o.entityResults)if(!s.passed)for(const c of s.requirementResults){if(c.status!=="fail")continue;if(n>=i.maxTopics)return;const r=s.entityName||`#${s.expressId}`,a=R({title:`${s.entityType}: ${r} - ${c.failureReason??c.checkedDescription}`,description:`Specification: ${o.specification.name}
275
+ ${o.specification.description??""}
276
+
277
+ Requirement: ${c.checkedDescription}${s.globalId?`
278
+ GlobalId: ${s.globalId}`:""}`,author:i.author,topicType:i.failureTopicType,topicStatus:"Open",labels:["IDS",o.specification.name]});let l;if(s.globalId){const f=`${s.modelId}:${s.expressId}`,m=i.entityBounds?.get(f),u=i.entitySnapshots?.get(f),g=J(s.globalId,i.failureColor,m,u);a.viewpoints.push(g),l=g.guid}const p=D({author:i.author,comment:W(c),viewpointGuid:l});a.comments.push(p),t.topics.set(a.guid,a),n++}}}function te(t,e,i,n){const o=[];return e.passed?o.push("IDS Validation Passed — all requirements satisfied"):o.push(`IDS Validation Failure — ${i} of ${n} requirements failed`),o.push(""),o.push(`Specification: ${t.specification.name}`),t.specification.description&&o.push(`Description: ${t.specification.description}`),o.push(`Entity Type: ${e.entityType}`),e.globalId&&o.push(`GlobalId: ${e.globalId}`),e.entityName&&o.push(`Name: ${e.entityName}`),o.join(`
279
+ `)}function ee(t){const e=[];return e.push(`IDS Specification Failure — ${t.failedCount} of ${t.applicableCount} entities failed`),t.specification.description&&(e.push(""),e.push(t.specification.description)),e.push(""),e.push(`Applicable: ${t.applicableCount}`),e.push(`Passed: ${t.passedCount}`),e.push(`Failed: ${t.failedCount}`),e.join(`
280
+ `)}function W(t){const e=[];return e.push(`[${t.facetType}] ${t.checkedDescription}`),t.failureReason&&e.push(`Failure: ${t.failureReason}`),t.expectedValue&&e.push(`Expected: ${t.expectedValue}`),t.actualValue&&e.push(`Actual: ${t.actualValue}`),e.join(`
281
+ `)}function ie(t){const e=(t.min.x+t.max.x)/2,i=(t.min.y+t.max.y)/2,n=(t.min.z+t.max.z)/2,o=t.max.x-t.min.x,s=t.max.y-t.min.y,c=t.max.z-t.min.z,r=Math.max(o,s,c,.1),a=60*Math.PI/180,l=r/2/Math.tan(a/2)*1.5,p=Math.sqrt(.6*.6+.5*.5+.6*.6),f=.6/p*l,m=.5/p*l,u=.6/p*l,g=e+f,d=i+m,x=n+u,w=e-g,T=i-d,S=n-x,v=Math.sqrt(w*w+T*T+S*S);return{cameraViewPoint:{x:g,y:-x,z:d},cameraDirection:{x:w/v,y:-S/v,z:T/v},cameraUpVector:{x:0,y:0,z:1},fieldOfView:60}}function J(t,e,i,n){const o={guid:C(),components:{selection:[{ifcGuid:t}],visibility:{defaultVisibility:!1,exceptions:[{ifcGuid:t}]}}};return e&&(o.components.coloring=[{color:e,components:[{ifcGuid:t}]}]),i&&(o.perspectiveCamera=ie(i)),n&&(o.snapshot=n),o}function ne(t,e){const i={guid:C(),components:{selection:t.map(n=>({ifcGuid:n})),visibility:{defaultVisibility:!1,exceptions:t.map(n=>({ifcGuid:n}))}}};return e&&(i.components.coloring=[{color:e,components:t.map(n=>({ifcGuid:n}))}]),i}function ue(t){return{version:t?.version??"2.1",projectId:C(),name:t?.name,topics:new Map}}function me(t){return{guid:C(),title:t.title,description:t.description,topicType:t.topicType??"Issue",topicStatus:t.topicStatus??"Open",priority:t.priority,creationDate:new Date().toISOString(),creationAuthor:t.author,assignedTo:t.assignedTo,dueDate:t.dueDate,labels:t.labels,comments:[],viewpoints:[]}}function de(t){return{guid:C(),date:new Date().toISOString(),author:t.author,comment:t.comment,viewpointGuid:t.viewpointGuid}}export{U as B,pe as a,ue as b,re as c,j as d,le as e,me as f,se as g,de as h,fe as i,ot as p,ce as r,ae as w};
@@ -1,4 +1,4 @@
1
- import{j as Ot}from"./index-B1Ecw4AU.js";function Ct(ye,_e){for(var oe=0;oe<_e.length;oe++){const ae=_e[oe];if(typeof ae!="string"&&!Array.isArray(ae)){for(const ce in ae)if(ce!=="default"&&!(ce in ye)){const we=Object.getOwnPropertyDescriptor(ae,ce);we&&Object.defineProperty(ye,ce,we.get?we:{enumerable:!0,get:()=>ae[ce]})}}}return Object.freeze(Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"}))}var He={exports:{}};(function(ye){(_e=>{var oe=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,ce=Object.getOwnPropertyNames,we=Object.prototype.hasOwnProperty,Xe=(e,t)=>{for(var r in t)oe(e,r,{get:t[r],enumerable:!0})},Ke=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let g of ce(t))!we.call(e,g)&&g!==r&&oe(e,g,{get:()=>t[g],enumerable:!(a=ae(t,g))||a.enumerable});return e},Ze=e=>Ke(oe({},"__esModule",{value:!0}),e),le=(e,t,r)=>new Promise((a,g)=>{var y=f=>{try{k(r.next(f))}catch(D){g(D)}},h=f=>{try{k(r.throw(f))}catch(D){g(D)}},k=f=>f.done?a(f.value):Promise.resolve(f.value).then(y,h);k((r=r.apply(e,t)).next())}),Ee={};Xe(Ee,{analyzeMetafile:()=>bt,analyzeMetafileSync:()=>Et,build:()=>gt,buildSync:()=>vt,context:()=>pt,default:()=>$t,formatMessages:()=>wt,formatMessagesSync:()=>_t,initialize:()=>St,stop:()=>kt,transform:()=>yt,transformSync:()=>xt,version:()=>mt}),_e.exports=Ze(Ee);function Re(e){let t=a=>{if(a===null)r.write8(0);else if(typeof a=="boolean")r.write8(1),r.write8(+a);else if(typeof a=="number")r.write8(2),r.write32(a|0);else if(typeof a=="string")r.write8(3),r.write(Z(a));else if(a instanceof Uint8Array)r.write8(4),r.write(a);else if(a instanceof Array){r.write8(5),r.write32(a.length);for(let g of a)t(g)}else{let g=Object.keys(a);r.write8(6),r.write32(g.length);for(let y of g)r.write(Z(y)),t(a[y])}},r=new Ue;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),De(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function et(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return he(r.read());case 4:return r.read();case 5:{let h=r.read32(),k=[];for(let f=0;f<h;f++)k.push(t());return k}case 6:{let h=r.read32(),k={};for(let f=0;f<h;f++)k[he(r.read())]=t();return k}default:throw new Error("Invalid packet")}},r=new Ue(e),a=r.read32(),g=(a&1)===0;a>>>=1;let y=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:a,isRequest:g,value:y}}var Ue=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);De(this.buf,e,t)}write(e){let t=this._write(4+e.length);De(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return Ie(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},Z,he,Ae;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;Z=r=>e.encode(r),he=r=>t.decode(r),Ae='new TextEncoder().encode("")'}else if(typeof Buffer<"u")Z=e=>Buffer.from(e),he=e=>{let{buffer:t,byteOffset:r,byteLength:a}=e;return Buffer.from(t,r,a).toString()},Ae='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Ae} instanceof Uint8Array" is incorrectly false
1
+ import{g as Ot}from"./zip-B-jFFAGa.js";function Ct(ye,_e){for(var oe=0;oe<_e.length;oe++){const ae=_e[oe];if(typeof ae!="string"&&!Array.isArray(ae)){for(const ce in ae)if(ce!=="default"&&!(ce in ye)){const we=Object.getOwnPropertyDescriptor(ae,ce);we&&Object.defineProperty(ye,ce,we.get?we:{enumerable:!0,get:()=>ae[ce]})}}}return Object.freeze(Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"}))}var He={exports:{}};(function(ye){(_e=>{var oe=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,ce=Object.getOwnPropertyNames,we=Object.prototype.hasOwnProperty,Xe=(e,t)=>{for(var r in t)oe(e,r,{get:t[r],enumerable:!0})},Ke=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let g of ce(t))!we.call(e,g)&&g!==r&&oe(e,g,{get:()=>t[g],enumerable:!(a=ae(t,g))||a.enumerable});return e},Ze=e=>Ke(oe({},"__esModule",{value:!0}),e),le=(e,t,r)=>new Promise((a,g)=>{var y=f=>{try{k(r.next(f))}catch(D){g(D)}},h=f=>{try{k(r.throw(f))}catch(D){g(D)}},k=f=>f.done?a(f.value):Promise.resolve(f.value).then(y,h);k((r=r.apply(e,t)).next())}),Ee={};Xe(Ee,{analyzeMetafile:()=>bt,analyzeMetafileSync:()=>Et,build:()=>gt,buildSync:()=>vt,context:()=>pt,default:()=>$t,formatMessages:()=>wt,formatMessagesSync:()=>_t,initialize:()=>St,stop:()=>kt,transform:()=>yt,transformSync:()=>xt,version:()=>mt}),_e.exports=Ze(Ee);function Re(e){let t=a=>{if(a===null)r.write8(0);else if(typeof a=="boolean")r.write8(1),r.write8(+a);else if(typeof a=="number")r.write8(2),r.write32(a|0);else if(typeof a=="string")r.write8(3),r.write(Z(a));else if(a instanceof Uint8Array)r.write8(4),r.write(a);else if(a instanceof Array){r.write8(5),r.write32(a.length);for(let g of a)t(g)}else{let g=Object.keys(a);r.write8(6),r.write32(g.length);for(let y of g)r.write(Z(y)),t(a[y])}},r=new Ue;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),De(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function et(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return he(r.read());case 4:return r.read();case 5:{let h=r.read32(),k=[];for(let f=0;f<h;f++)k.push(t());return k}case 6:{let h=r.read32(),k={};for(let f=0;f<h;f++)k[he(r.read())]=t();return k}default:throw new Error("Invalid packet")}},r=new Ue(e),a=r.read32(),g=(a&1)===0;a>>>=1;let y=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:a,isRequest:g,value:y}}var Ue=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);De(this.buf,e,t)}write(e){let t=this._write(4+e.length);De(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return Ie(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},Z,he,Ae;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;Z=r=>e.encode(r),he=r=>t.decode(r),Ae='new TextEncoder().encode("")'}else if(typeof Buffer<"u")Z=e=>Buffer.from(e),he=e=>{let{buffer:t,byteOffset:r,byteLength:a}=e;return Buffer.from(t,r,a).toString()},Ae='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Ae} instanceof Uint8Array" is incorrectly false
2
2
 
3
3
  This indicates that your JavaScript environment is broken. You cannot use
4
4
  esbuild in this environment because esbuild relies on this invariant. This