const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Dtj0WP_z.js","./index-Dw8Uzof1.js","./index-qRhMeKhs.css"])))=>i.map(i=>d[i]);
import{_ as V}from"./index-Dw8Uzof1.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import{onMount as z}from"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";var A=e.from_html("<canvas></canvas>");function G(C,r){e.push(r,!1);const p=e.mutable_source();let h,s=e.prop(r,"value",12),n=e.prop(r,"display_mode",12),u=e.prop(r,"clear_color",12),m=e.prop(r,"camera_position",12),d=e.prop(r,"zoom_speed",12),_=e.prop(r,"pan_speed",12),c=e.mutable_source(),i,l,f=e.mutable_source(!1);z(()=>((async()=>{h=await V(()=>import("./index-Dtj0WP_z.js").then(a=>a.cq),__vite__mapDeps([0,1,2]),import.meta.url),h.CreateViewerForCanvas(e.get(c),{clearColor:u(),useRightHandedSystem:!0,animationAutoPlay:!0,cameraAutoOrbit:{enabled:!1},onInitialized:a=>{l=a}}).then(a=>{i=a,e.set(f,!0)})})(),()=>{i?.dispose()}));function v(t,a){l.scene.forcePointsCloud=t,l.scene.forceWireframe=a}function P(t){i&&(t?i.loadModel(t,{pluginOptions:{obj:{importVertexColors:!0}}}).then(()=>{n()==="point_cloud"?v(!0,!1):n()==="wireframe"?v(!1,!0):g(m(),d(),_())}):i.resetModel())}function g(t,a,M){const o=l.camera;t[0]!==null&&(o.alpha=t[0]*Math.PI/180),t[1]!==null&&(o.beta=t[1]*Math.PI/180),t[2]!==null&&(o.radius=t[2]),o.lowerRadiusLimit=.1;const w=()=>{o.wheelPrecision=250/(o.radius*a),o.panningSensibility=1e4*M/o.radius};w(),o.onAfterCheckInputsObservable.add(w)}function b(){l&&i.resetCamera()}e.legacy_pre_effect(()=>e.deep_read_state(s()),()=>{e.set(p,s().url)}),e.legacy_pre_effect(()=>(e.get(f),e.get(p)),()=>{e.get(f)&&P(e.get(p))}),e.legacy_pre_effect_reset();var I={update_camera:g,reset_camera_position:b,get value(){return s()},set value(t){s(t),e.flush()},get display_mode(){return n()},set display_mode(t){n(t),e.flush()},get clear_color(){return u()},set clear_color(t){u(t),e.flush()},get camera_position(){return m()},set camera_position(t){m(t),e.flush()},get zoom_speed(){return d()},set zoom_speed(t){d(t),e.flush()},get pan_speed(){return _()},set pan_speed(t){_(t),e.flush()}};e.init();var y=A();return e.bind_this(y,t=>e.set(c,t),()=>e.get(c)),e.append(C,y),e.bind_prop(r,"update_camera",g),e.bind_prop(r,"reset_camera_position",b),e.pop(I)}export{G as default};
