1var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>(__defNormalProp(obj,typeof key!="symbol"?key+"":key,value),value);import{O as OpenAI}from"./client-6a90d2cf.js";import{T as Tool}from"./Tool.mixin-a1f5bff3.js";import{C as CameraControls,T as THREE,S as Scene,a as Color,P as PerspectiveCamera,W as WebGLRenderer,A as ACESFilmicToneMapping,b as Clock,D as DirectionalLight,H as HemisphereLight,c as AmbientLight,m as mergeGeometries,M as Mesh,e as MeshLambertMaterial,f as DoubleSide,B as BufferGeometry,h as BufferAttribute,i as Matrix4,j as Box3,k as Vector3,l as MathUtils}from"./BufferGeometryUtils-0d4497c1.js";import{I as IfcAPI2,j as IFCSPACE}from"./web-ifc-api-b335217d.js";import{d as defineComponent,c as createElementBlock,b as createBaseVNode,o as openBlock,T as TrashBinOutline,q as markRaw,a as createVNode,t as toDisplayString,w as withCtx,h as createCommentVNode,g as withDirectives,D as vShow,v as normalizeStyle,e as resolveComponent,j as createTextVNode,_ as _export_sfc}from"./index-091a344c.js";import{D as DownloadOutline}from"./DownloadOutline-531f2238.js";import{R as RefreshOutline}from"./RefreshOutline-80541e49.js";import{A as ArrowBackOutline}from"./ArrowBackOutline-711ce353.js";const _hoisted_1$1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},_hoisted_2$1=createBaseVNode("path",{d:"M350.54 148.68l-26.62-42.06C318.31 100.08 310.62 96 302 96h-92c-8.62 0-16.31 4.08-21.92 10.62l-26.62 42.06C155.85 155.23 148.62 160 140 160H80a32 32 0 0 0-32 32v192a32 32 0 0 0 32 32h352a32 32 0 0 0 32-32V192a32 32 0 0 0-32-32h-59c-8.65 0-16.85-4.77-22.46-11.32z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),_hoisted_3$1=createBaseVNode("circle",{cx:"256",cy:"272",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),_hoisted_4$1=createBaseVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M124 158v-22h-24v22"},null,-1),_hoisted_5$1=[_hoisted_2$1,_hoisted_3$1,_hoisted_4$1],CameraOutline=defineComponent({name:"CameraOutline",render:__name(function(_ctx,_cache){return openBlock(),createElementBlock("svg",_hoisted_1$1,_hoisted_5$1)},"render")});CameraControls.install({THREE});const _RendererViewerManager=class _RendererViewerManager{constructor(){__publicField(this,"container");__publicField(this,"scene");__publicField(this,"camera");__publicField(this,"renderer");__publicField(this,"controls");__publicField(this,"clock");__publicField(this,"animationId",null);__publicField(this,"resizeObserver",null);__publicField(this,"geometriesByMaterial",{})}init(container){this.container=container,this.scene=new Scene,this.scene.background=new Color(2368548);const w=container.clientWidth,h=container.clientHeight;this.camera=new PerspectiveCamera(45,w/h,.1,1e3),this.camera.position.set(35,20,45),this.renderer=new WebGLRenderer({antialias:!0,preserveDrawingBuffer:!0}),this.renderer.setClearColor(1710638,1),this.renderer.setSize(w,h),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.toneMapping=ACESFilmicToneMapping,this.renderer.toneMappingExposure=1.2,this.renderer.domElement.style.width="100%",this.renderer.domElement.style.height="100%",this.renderer.domElement.style.display="block",container.appendChild(this.renderer.domElement),this.controls=new CameraControls(this.camera,this.renderer.domElement),this.controls.dollyToCursor=!0,this.clock=new Clock;const dir=new DirectionalLight(16777215,1.8);dir.position.set(12,18,8),this.scene.add(dir);const fill=new DirectionalLight(16777215,.7);fill.position.set(-10,10,-10),this.scene.add(fill);const hemi=new HemisphereLight(11657727,12155424,.6);this.scene.add(hemi),this.scene.add(new AmbientLight(16777215,.5)),this.resizeObserver=new ResizeObserver(()=>this.handleResize()),this.resizeObserver.observe(container),this.animate=this.animate.bind(this),this.animate()}async loadModel(ifcData){this.clearModelMeshes(),this.geometriesByMaterial={};const ifcApi=new IfcAPI2;ifcApi.SetWasmPath("https://unpkg.com/[email protected]/",!0),await ifcApi.Init();const modelID=ifcApi.OpenModel(ifcData);ifcApi.StreamAllMeshes(modelID,mesh=>{const placed=mesh.geometries;for(let i=0;i<placed.size();i++){const pg=placed.get(i),geom=this.extractGeometry(ifcApi,modelID,pg);this.storeByMaterial(pg.color,geom)}}),ifcApi.StreamAllMeshesWithTypes(modelID,[IFCSPACE],mesh=>{const placed=mesh.geometries;for(let i=0;i<placed.size();i++){const pg=placed.get(i),geom=this.extractGeometry(ifcApi,modelID,pg);this.storeByMaterial(pg.color,geom)}});for(const key of Object.keys(this.geometriesByMaterial)){const group=this.geometriesByMaterial[key];if(group.geometries.length===0)continue;const merged=mergeGeometries(group.geometries),mesh=new Mesh(merged,group.material);this.scene.add(mesh)}this.fitToView(),ifcApi.CloseModel(modelID),ifcApi.Dispose()}storeByMaterial(color,geometry){const colID=`${color.x}${color.y}${color.z}${color.w}`;if(this.geometriesByMaterial[colID]){this.geometriesByMaterial[colID].geometries.push(geometry);return}const col=new Color(color.x,color.y,color.z),mat=new MeshLambertMaterial({color:col,side:DoubleSide,transparent:color.w!==1,opacity:color.w,depthWrite:color.w===1});this.geometriesByMaterial[colID]={material:mat,geometries:[geometry]}}extractGeometry(ifcApi,modelID,pg){const raw=ifcApi.GetGeometry(modelID,pg.geometryExpressID),verts=ifcApi.GetVertexArray(raw.GetVertexData(),raw.GetVertexDataSize()),indices=ifcApi.GetIndexArray(raw.GetIndexData(),raw.GetIndexDataSize());raw.delete();const vertCount=verts.length/6,positions=new Float32Array(vertCount*3),normals=new Float32Array(vertCount*3);for(let i=0;i<verts.length;i+=6){const vi=i/6;positions[vi*3]=verts[i],positions[vi*3+1]=verts[i+1],positions[vi*3+2]=verts[i+2],normals[vi*3]=verts[i+3],normals[vi*3+1]=verts[i+4],normals[vi*3+2]=verts[i+5]}const geom=new BufferGeometry;return geom.setAttribute("position",new BufferAttribute(positions,3)),geom.setAttribute("normal",new BufferAttribute(normals,3)),geom.setIndex(new BufferAttribute(indices,1)),geom.applyM
1atrix4(new Matrix4().fromArray(pg.flatTransformation)),geom}captureScreenshot(){return this.renderer.render(this.scene,this.camera),this.renderer.domElement.toDataURL("image/png")}animate(){const delta=this.clock.getDelta();this.controls.update(delta),this.renderer.render(this.scene,this.camera),this.animationId=requestAnimationFrame(this.animate)}fitToView(padding=1.2){const box=new Box3().setFromObject(this.scene);if(box.isEmpty())return;const size=new Vector3,center=new Vector3;box.getSize(size),box.getCenter(center);const maxDim=Math.max(size.x,size.y,size.z),fov=MathUtils.degToRad(this.camera.fov),dist=maxDim/2/Math.tan(fov/2),dir=new Vector3(.5,.35,1).normalize(),pos=center.clone().add(dir.multiplyScalar(dist*padding));this.controls.setLookAt(pos.x,pos.y,pos.z,center.x,center.y,center.z,!0),this.camera.near=dist/100,this.camera.far=dist*10,this.camera.updateProjectionMatrix()}handleResize(){const w=this.container.clientWidth,h=this.container.clientHeight;w===0||h===0||(this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(w,h,!1),this.renderer.domElement.style.width="100%",this.renderer.domElement.style.height="100%",this.camera.aspect=w/h,this.camera.updateProjectionMatrix())}clearModelMeshes(){const toRemove=[];this.scene.traverse(obj=>{obj instanceof Mesh&&toRemove.push(obj)}),toRemove.forEach(obj=>{var _a,_b;const mesh=obj;(_a=mesh.geometry)==null||_a.dispose();const mat=mesh.material;Array.isArray(mat)?mat.forEach(m=>m.dispose()):mat==null||mat.dispose(),(_b=mesh.parent)==null||_b.remove(mesh)})}dispose(){var _a;this.animationId!==null&&cancelAnimationFrame(this.animationId),this.animationId=null,(_a=this.resizeObserver)==null||_a.disconnect(),this.scene.traverse(obj=>{var _a2;if(obj instanceof Mesh){(_a2=obj.geometry)==null||_a2.dispose();const mat=obj.material;Array.isArray(mat)?mat.forEach(m=>m.dispose()):mat==null||mat.dispose()}}),this.controls.dispose(),this.renderer.dispose(),this.container.innerHTML=""}};__name(_RendererViewerManager,"RendererViewerManager");let RendererViewerManager=_RendererViewerManager;const API_KEY_STORAGE_KEY="ifc-renderer-openai-api-key",MODEL_STORAGE_KEY="ifc-renderer-openai-model",MODEL_OPTIONS=[{label:"GPT Image 1",value:"gpt-image-1"},{label:"DALL·E 3",value:"dall-e-3"}],TIME_OF_DAY_OPTIONS=[{label:"Morning",value:"morning"},{label:"Noon",value:"noon"},{label:"Golden hour",value:"golden hour"},{label:"Sunset",value:"sunset"},{label:"Night",value:"night"}],WEATHER_OPTIONS=[{label:"Clear sky",value:"clear sky"},{label:"Partly cloudy",value:"partly cloudy"},{label:"Overcast",value:"overcast"},{label:"Rainy",value:"rainy"},{label:"Snowy",value:"snowy"},{label:"Foggy",value:"foggy"}],SEASON_OPTIONS=[{label:"Spring",value:"spring"},{label:"Summer",value:"summer"},{label:"Autumn",value:"autumn"},{label:"Winter",value:"winter"}],ENVIRONMENT_OPTIONS=[{label:"Urban",value:"urban"},{label:"Suburban",value:"suburban residential"},{label:"Rural",value:"rural countryside"},{label:"Waterfront",value:"waterfront"},{label:"Mountain",value:"mountain landscape"},{label:"Park / Garden",value:"park and garden"}],STYLE_OPTIONS=[{label:"Photorealistic",value:"photorealistic"},{label:"Architectural visualization",value:"architectural visualization"},{label:"Sketch / Line art",value:"architectural sketch line art"},{label:"Watercolor",value:"watercolor painting"},{label:"Cinematic",value:"cinematic film still"}],_sfc_main=defineComponent({components:{TrashBinOutline,CameraOutline,DownloadOutline,RefreshOutline,ArrowBackOutline},mixins:[Tool],data(){return{viewer:null,ifcName:"",ifcSizeMb:"0.00",ifcBytes:null,modelLoaded:!1,isLoading:!1,screenshotUrl:"",generatedImageUrl:"",showResult:!1,apiKey:(typeof localStorage<"u"?localStorage.getItem(API_KEY_STORAGE_KEY):null)||"",selectedModel:(typeof localStorage<"u"?localStorage.getItem(MODEL_STORAGE_KEY):null)||"gpt-image-1",modelOptions:MODEL_OPTIONS,settings:{timeOfDay:"golden hour",weather:"clear sky",season:"summer",environment:"urban",style:"photorealistic",customPrompt:""},timeOfDayOptions:TIME_OF_DAY_OPTIONS,weatherOptions:WEATHER_OPTIONS,seasonOptions:SEASON_OPTIONS,environmentOptions:ENVIRONMENT_OPTIONS,styleOptions:STYLE_OPTIONS,isGenerating:!1,progressPercent:0,progressMessage:"",errorMessage:""}},computed:{canGenerate(){var _a;return!!this.screenshotUrl&&!!((_a=this.apiKey)!=null&&_a.trim())}},watch:{apiKey(val){typeof localStorage<"u"&&localStorage.setItem(API_KEY_STORAGE_KEY,val||"")},selectedModel(val){typeof localStorage<"u"&&localStorage.setItem(MODEL_STORAGE_KEY,val)}},mounted(){this.initViewer()},beforeUnmount(){var _a;(_a=this.viewer)==null||_a.dispose()},methods:{initViewer(){this.$nextTick(()=>{const el=document.getElementById("renderer-viewer");!el||this.viewer||(this.viewer=markRaw(new RendererViewerManager),this.viewer.init(el))})},async onDropIfc(files){var _a;if(!(files!=null&&files[0]))return;const file=files[0],ext=file.name.split(".").pop();if(["ifc","Ifc","IFC"].includes(ext||"")){this.isLoading=!0,this.errorMessage="",this.screenshotUrl="",this.generatedImageUrl="",this.showResult=!1;try{const url=URL.createObjectURL(file);this.ifcBytes=await this.getIfcFile(url),this.ifcName=file.name,this.ifcSizeMb=(file.size/1024/1024).toFixed(2),URL.revokeObjectURL(url),await this.viewer.loadModel(this.ifcBytes),this.modelLoaded=!0,(_a=window.$message)==null||_a.success("Model loaded. Orbit to your desired angle, then capture a screenshot.",{showIcon:!1})}catch(err){this.errorMessage=(err==null?void 0:err.message)||"Failed to load IFC file."}finally{this.isLoading=!1}}},captureScreenshot(){var _a;this.viewer&&(this.screenshotUrl=this.viewer.captureScreenshot(),(_a=window.$message)==null||_a.success("Screenshot captured.",{showIcon:!1}))},retakeScreenshot(){this.screenshotUrl="",this.generatedImageUrl="",this.showResult=!1},buildPrompt(){var _a;const s=this.settings;let prompt=`Create a ${s.style} architectural render of this building. The scene should depict ${s.timeOfDay} lighting with ${s.weather} weather during ${s.season}. The environment is ${s.environment}. Maintain the exact building geometry, angles, proportions, and composition from the reference image. Add realistic materials, textures, landscaping, and atmospheric effects. The result should look like a professional architectural visualization render.`;return(_a=s.customPrompt)!=null&&_a.trim()&&(prompt+=` Additional instructions: ${s.customPrompt.trim()}`),prompt},async generateRender(){var _a,_b,_c,_d,_e;if(this.canGenerate){this.isGenerating=!0,this.progressPercent=10,this.progressMessage="Preparing request...",this.errorMessage="",this.generatedImageUrl="",this.showResult=!1;try{const client=new OpenAI({apiKey:this.apiKey.trim(),dangerouslyAllowBrowser:!0}),prompt=this.buildPrompt();if(this.progressPercent=30,this.progressMessage="Sending to AI...",this.selectedModel==="gpt-image-1"){const base64Data=this.screenshotUrl.replace(/^data:image\/png;base64,/,""),binaryStr=atob(base64Data),bytes=new Uint8Array(binaryStr.length);for(let i=0;i<binaryStr.length;i++)bytes[i]=binaryStr.charCodeAt(i);const imageFile=new File([bytes],"screenshot.png",{type:"image/png"});this.progressPercent=50,this.progressMessage="Generating render (this may take a minute)...";const response=await client.images.edit({model:"gpt-image-1",image:imageFile,prompt,size:"1536x1024"});this.progressPercent=90,this.progressMessage="Processing result...";
1const b64=(_b=(_a=response.data)==null?void 0:_a[0])==null?void 0:_b.b64_json;if(b64)this.generatedImageUrl=`data:image/png;base64,${b64}`;else throw new Error("No image returned from API.")}else{this.progressPercent=50,this.progressMessage="Generating render (this may take a minute)...";const response=await client.images.generate({model:"dall-e-3",prompt:prompt+" Reference image description: a 3D model screenshot of a building viewed from an angle, showing the structure with colored materials.",size:"1792x1024",quality:"hd",n:1});this.progressPercent=90,this.progressMessage="Processing result...";const url=(_d=(_c=response.data)==null?void 0:_c[0])==null?void 0:_d.url;if(url)this.generatedImageUrl=url;else throw new Error("No image returned from API.")}this.progressPercent=100,this.progressMessage="Done!",this.showResult=!0,(_e=window.$message)==null||_e.success("Render generated!",{showIcon:!1})}catch(err){const msg=(err==null?void 0:err.message)||"Render generation failed.";this.errorMessage=msg.includes("api_key")||(err==null?void 0:err.status)===401?"Invalid or missing API key. Please check your OpenAI API key.":msg}finally{this.isGenerating=!1}}},backToViewer(){this.showResult=!1},downloadRender(){if(!this.generatedImageUrl)return;const a=document.createElement("a");a.href=this.generatedImageUrl,a.download=`${this.ifcName.replace(/\.ifc$/i,"")}_render.png`,a.click()},resetAll(){var _a;this.ifcBytes=null,this.ifcName="",this.ifcSizeMb="0.00",this.modelLoaded=!1,this.isLoading=!1,this.screenshotUrl="",this.generatedImageUrl="",this.showResult=!1,this.errorMessage="",this.progressPercent=0,this.progressMessage="",this.settings={timeOfDay:"golden hour",weather:"clear sky",season:"summer",environment:"urban",style:"photorealistic",customPrompt:""},(_a=this.viewer)==null||_a.dispose(),this.viewer=null,this.$nextTick(()=>this.initViewer())}}}),_hoisted_1={class:"renderer-page flex flex-col h-screen overflow-hidden"},_hoisted_2={class:"flex flex-col flex-1 min-h-0 overflow-hidden p-4 box-border"},_hoisted_3={class:"renderer-layout flex-1 min-h-0 pb-4"},_hoisted_4={class:"flex flex-col gap-4"},_hoisted_5={class:"panel p-4 viewer-panel flex flex-col"},_hoisted_6={class:"flex items-center justify-between mb-2 shrink-0"},_hoisted_7={class:"panel-title m-0"},_hoisted_8={key:0,class:"flex gap-2"},_hoisted_9={class:"w-full flex-1 min-h-0 rounded-lg overflow-hidden bg-zinc-900",id:"renderer-viewer"},_hoisted_10={key:0,class:"capture-overlay"},_hoisted_11={key:1,class:"result-container w-full flex-1 min-h-0 rounded-lg overflow-hidden bg-zinc-900 flex items-center justify-center"},_hoisted_12=["src"],_hoisted_13={class:"panel p-4 side-panel flex flex-col min-h-0"},_hoisted_14={key:0,class:"upload-stack mt-20"},_hoisted_15={key:1,class:"upload-meta"},_hoisted_16={class:"flex items-center justify-between"},_hoisted_17={key:2,class:"flex items-center gap-2 mt-4 text-zinc-300"},_hoisted_18={key:3,class:"mt-4"},_hoisted_19={class:"screenshot-preview-wrap"},_hoisted_20=["src"],_hoisted_21={key:4,class:"settings-section mt-4 flex flex-col gap-3"},_hoisted_22={class:"setting-row"},_hoisted_23={class:"setting-row"},_hoisted_24={class:"setting-row"},_hoisted_25={class:"setting-row"},_hoisted_26={class:"setting-row"},_hoisted_27={class:"setting-row"},_hoisted_28={key:5,class:"api-key-section mt-4 flex flex-col gap-2"},_hoisted_29={class:"setting-row"},_hoisted_30={key:6,class:"flex gap-2 mt-4"},_hoisted_31={key:7,class:"panel-sub mt-3"},_hoisted_32={class:"bar-wrap mt-2"},_hoisted_33={class:"text-xs text-zinc-400 mt-1"},_hoisted_34={key:8,class:"text-red-400 text-sm mt-2"};function render2(_ctx,_cache,$props,$setup,$data,$options){const _component_bbx_header=resolveComponent("bbx-header"),_component_ArrowBackOutline=resolveComponent("ArrowBackOutline"),_component_n_icon=resolveComponent("n-icon"),_component_n_button=resolveComponent("n-button"),_component_DownloadOutline=resolveComponent("DownloadOutline"),_component_CameraOutline=resolveComponent("CameraOutline"),_component_bbx_dropZone=resolveComponent("bbx-dropZone"),_component_TrashBinOutline=resolveComponent("TrashBinOutline"),_component_n_spin=resolveComponent("n-spin"),_component_RefreshOutline=resolveComponent("RefreshOutline"),_component_n_select=resolveComponent("n-select"),_component_n_input
1=resolveComponent("n-input");return openBlock(),createElementBlock("div",_hoisted_1,[createVNode(_component_bbx_header),createBaseVNode("div",_hoisted_2,[createBaseVNode("div",_hoisted_3,[createBaseVNode("div",_hoisted_4,[_cache[10]||(_cache[10]=createBaseVNode("div",{class:"demo-context-notice rounded-lg p-3 bg-amber-500 bg-opacity-15 border border-amber-500 border-opacity-30"},[createBaseVNode("span",{class:"text-amber-200 text-xs font-medium"},"You're using a limited demo version. Full custom versions are available on request.")],-1)),createBaseVNode("div",_hoisted_5,[createBaseVNode("div",_hoisted_6,[createBaseVNode("h3",_hoisted_7,toDisplayString(_ctx.showResult?"AI Render":"3D Viewer"),1),_ctx.showResult?(openBlock(),createElementBlock("div",_hoisted_8,[createVNode(_component_n_button,{class:"button-neon-secondary",size:"small",quaternary:"",onClick:_ctx.backToViewer},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_ArrowBackOutline)]),_:1})]),default:withCtx(()=>[_cache[8]||(_cache[8]=createTextVNode("Back to viewer",-1))]),_:1},8,["onClick"]),createVNode(_component_n_button,{class:"button-neon",size:"small",onClick:_ctx.downloadRender},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_DownloadOutline)]),_:1})]),default:withCtx(()=>[_cache[9]||(_cache[9]=createTextVNode("Download",-1))]),_:1},8,["onClick"])])):createCommentVNode("",!0)]),withDirectives(createBaseVNode("div",_hoisted_9,null,512),[[vShow,!_ctx.showResult]]),_ctx.modelLoaded&&!_ctx.showResult?(openBlock(),createElementBlock("div",_hoisted_10,[createVNode(_component_n_button,{class:"button-neon",size:"small",onClick:_ctx.captureScreenshot,disabled:!!_ctx.screenshotUrl},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_CameraOutline)]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.screenshotUrl?"Captured":"Capture screenshot"),1)]),_:1},8,["onClick","disabled"])])):createCommentVNode("",!0),_ctx.showResult?(openBlock(),createElementBlock("div",_hoisted_11,[createBaseVNode("img",{class:"result-image",src:_ctx.generatedImageUrl,alt:"AI Render"},null,8,_hoisted_12)])):createCommentVNode("",!0)])]),createBaseVNode("div",_hoisted_13,[_cache[27]||(_cache[27]=createBaseVNode("div",{class:"side-panel-header flex items-baseline gap-4 pt-4 pb-2 justify-center"},[createBaseVNode("h1",{class:"drop-shadow-xl text-white shrink-0 my-1"},"IFC SnapRender")],-1)),_ctx.ifcBytes?(openBlock(),createElementBlock("div",_hoisted_15,[createBaseVNode("div",_hoisted_16,[createBaseVNode("span",null,"IFC loaded: "+toDisplayString(_ctx.ifcName)+" ("+toDisplayString(_ctx.ifcSizeMb)+" MB)",1),createVNode(_component_n_button,{size:"tiny",quaternary:"",onClick:_ctx.resetAll},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_TrashBinOutline)]),_:1})]),_:1},8,["onClick"])])])):(openBlock(),createElementBlock("div",_hoisted_14,[createVNode(_component_bbx_dropZone,{isIdle:!_ctx.isLoading,content:"Upload IFC file",onOnChange:_ctx.onDropIfc,format:".ifc, .Ifc, .IFC"},null,8,["isIdle","onOnChange"])])),_ctx.isLoading?(openBlock(),createElementBlock("div",_hoisted_17,[createVNode(_component_n_spin,{size:"small"}),_cache[11]||(_cache[11]=createBaseVNode("span",{class:"text-sm"},"Loading model...",-1))])):createCommentVNode("",!0),_ctx.screenshotUrl?(openBlock(),createElementBlock("div",_hoisted_18,[_cache[13]||(_cache[13]=createBaseVNode("span",{class:"text-zinc-400 text-xs block mb-1"},"Captured view",-1)),createBaseVNode("div",_hoisted_19,[createBaseVNode("img",{class:"screenshot-preview",src:_ctx.screenshotUrl},null,8,_hoisted_20),createVNode(_component_n_button,{class:"retake-btn",size:"tiny",quaternary:"",onClick:_ctx.retakeScreenshot},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_RefreshOutline)]),_:1})]),default:withCtx(()=>
1[_cache[12]||(_cache[12]=createTextVNode("Retake",-1))]),_:1},8,["onClick"])])])):createCommentVNode("",!0),_ctx.modelLoaded?(openBlock(),createElementBlock("div",_hoisted_21,[_cache[20]||(_cache[20]=createBaseVNode("h3",{class:"panel-title m-0"},"Render settings",-1)),createBaseVNode("div",_hoisted_22,[_cache[14]||(_cache[14]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"Time of day",-1)),createVNode(_component_n_select,{value:_ctx.settings.timeOfDay,"onUpdate:value":_cache[0]||(_cache[0]=$event=>_ctx.settings.timeOfDay=$event),options:_ctx.timeOfDayOptions,size:"small"},null,8,["value","options"])]),createBaseVNode("div",_hoisted_23,[_cache[15]||(_cache[15]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"Weather",-1)),createVNode(_component_n_select,{value:_ctx.settings.weather,"onUpdate:value":_cache[1]||(_cache[1]=$event=>_ctx.settings.weather=$event),options:_ctx.weatherOptions,size:"small"},null,8,["value","options"])]),createBaseVNode("div",_hoisted_24,[_cache[16]||(_cache[16]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"Season",-1)),createVNode(_component_n_select,{value:_ctx.settings.season,"onUpdate:value":_cache[2]||(_cache[2]=$event=>_ctx.settings.season=$event),options:_ctx.seasonOptions,size:"small"},null,8,["value","options"])]),createBaseVNode("div",_hoisted_25,[_cache[17]||(_cache[17]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"Environment",-1)),createVNode(_component_n_select,{value:_ctx.settings.environment,"onUpdate:value":_cache[3]||(_cache[3]=$event=>_ctx.settings.environment=$event),options:_ctx.environmentOptions,size:"small"},null,8,["value","options"])]),createBaseVNode("div",_hoisted_26,[_cache[18]||(_cache[18]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"Render style",-1)),createVNode(_component_n_select,{value:_ctx.settings.style,"onUpdate:value":_cache[4]||(_cache[4]=$event=>_ctx.settings.style=$event),options:_ctx.styleOptions,size:"small"},null,8,["value","options"])]),createBaseVNode("div",_hoisted_27,[_cache[19]||(_cache[19]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"Custom instructions (optional)",-1)),createVNode(_component_n_input,{value:_ctx.settings.customPrompt,"onUpdate:value":_cache[5]||(_cache[5]=$event=>_ctx.settings.customPrompt=$event),type:"textarea",placeholder:"e.g. Add trees and people walking...",autosize:{minRows:2,maxRows:4},size:"small"},null,8,["value"])])])):createCommentVNode("",!0),_ctx.modelLoaded?(openBlock(),createElementBlock("div",_hoisted_28,[_cache[22]||(_cache[22]=createBaseVNode("h3",{class:"panel-title m-0"}
1,"OpenAI API key",-1)),_cache[23]||(_cache[23]=createBaseVNode("p",{class:"text-zinc-500 text-xs m-0"},"Stored only in your browser.",-1)),createVNode(_component_n_input,{value:_ctx.apiKey,"onUpdate:value":_cache[6]||(_cache[6]=$event=>_ctx.apiKey=$event),type:"password",placeholder:"sk-...","show-password-on":"click",clearable:"",size:"small"},null,8,["value"]),createBaseVNode("div",_hoisted_29,[_cache[21]||(_cache[21]=createBaseVNode("span",{class:"text-zinc-400 text-xs"},"AI model",-1)),createVNode(_component_n_select,{value:_ctx.selectedModel,"onUpdate:value":_cache[7]||(_cache[7]=$event=>_ctx.selectedModel=$event),options:_ctx.modelOptions,size:"small"},null,8,["value","options"])])])):createCommentVNode("",!0),_ctx.modelLoaded?(openBlock(),createElementBlock("div",_hoisted_30,[createVNode(_component_n_button,{class:"button-neon flex-1",type:"primary",disabled:!_ctx.canGenerate||_ctx.isGenerating,loading:_ctx.isGenerating,onClick:_ctx.generateRender},{default:withCtx(()=>[..._cache[24]||(_cache[24]=[createTextVNode("Generate render",-1)])]),_:1},8,["disabled","loading","onClick"]),createVNode(_component_n_button,{class:"button-neon-secondary",quaternary:"",onClick:_ctx.resetAll},{icon:withCtx(()=>[createVNode(_component_n_icon,null,{default:withCtx(()=>[createVNode(_component_TrashBinOutline)]),_:1})]),default:withCtx(()=>[_cache[25]||(_cache[25]=createTextVNode("Reset",-1))]),_:1},8,["onClick"])])):createCommentVNode("",!0),_ctx.isGenerating?(openBlock(),createElementBlock("div",_hoisted_31,[_cache[26]||(_cache[26]=createBaseVNode("div",{class:"flex items-center justify-between"},[createBaseVNode("span",{class:"text-xs text-zinc-300"},"Generating render...")],-1)),createBaseVNode("div",_hoisted_32,[createBaseVNode("div",{class:"bar-fill",style:normalizeStyle({width:`${_ctx.progressPercent}%`})},null,4)]),createBaseVNode("div",_hoisted_33,toDisplayString(_ctx.progressMessage),1)])):createCommentVNode("",!0),_ctx.errorMessage?(openBlock(),createElementBlock("div",_hoisted_34,toDisplayString(_ctx.errorMessage),1)):createCommentVNode("",!0)])])])])}__name(render2,"render");const IFCRenderer=_export_sfc(_sfc_main,[["render",render2],["__scopeId","data-v-2226cf74"]]);export{IFCRenderer as default};
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.