const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./register_types.e1J8KIxr.js","./needle-engine-webxr.XIy9opUR.js","./materialx.CnHmG--Y.js","./rolldown-runtime.CYVBeYYp.js","./three@0.169.19.js","./needle-engine-ui.B3WhUziG.js","./gltf-progressive.U_EoiMHF.js","./three-examples@0.169.19.js","./three-mesh-ui.CgGzZ3ml.js","./three-examples.extras@0.169.19.js","./needle-engine@5.0.3.js","./needle-engine.extras.BMGdeUIm.js","./needle-engine-particles.W2HGH_-A.js","./three-quarks.DALdLWPD.js","./needle-engine.extras.BWlo-D5V.js","./postprocessing.Wy71DpiM.js","./three-mesh-bvh.B-oXEGo2.js","./needle-engine.NdjW02WD.js"])))=>i.map(i=>d[i]);
import{d as e}from"./materialx.CnHmG--Y.js";import{_t as t,fn as n,wi as r}from"./needle-engine-ui.B3WhUziG.js";import"./needle-engine@5.0.3.js";import{x as i}from"./needle-engine-webxr.XIy9opUR.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),globalThis[`needle:dependencies:ready`]=e(()=>import(`./register_types.e1J8KIxr.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);var a=[];globalThis[`needle:codegen_files`]=a,a.push(`./assets/SampleScene.glb`),document.addEventListener(`DOMContentLoaded`,()=>{let e=document.querySelector(`needle-engine`);e&&e.getAttribute(`src`)===null&&(e.setAttribute(`hash`,`1776607707382`),e.setAttribute(`src`,JSON.stringify(a)))}),console.log(`Made with ♥ by 🌵 Needle - https://needle.tools — Version 5.0.3`),r(e=>{let t=e.scene.getComponentInChildren(i);t||(t=e.scene.addComponent(i),t.createARButton=!0,t.createVRButton=!0),t.autoPlace=!0,t.autoCenter=!0,t.arScale=1});function o(e){document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>e(),{once:!0}):e()}function s(){let e=document.querySelector(`needle-engine`),r=document.querySelector(`#asset-picker-prev`),i=document.querySelector(`#asset-picker-next`),a=document.querySelector(`#asset-picker-ar`),s=document.querySelector(`#asset-picker-label`),c=document.querySelector(`#asset-picker-index`);if(!e||!r||!i||!a||!s||!c)return;let l=null,u=!1,d=!1,f=!1,p=()=>{l&&l.getDishSlotCount()>0?(s.textContent=l.getPickerLabel(),c.textContent=``):l?(s.textContent=`Menu (assign dishes in Unity)`,c.textContent=``):(s.textContent=`Sample scene`,c.textContent=`—`);let e=l!==null&&l.getDishSlotCount()>1;r.disabled=!e,i.disabled=!e,a.disabled=!d||f||u},m=async()=>{try{let n=await e.getContext();l=t(MenuController,n)}catch{l=null}p()};n.isARSupported().then(e=>{d=e,p()});let h=e=>{!l||l.getDishSlotCount()<=1||(e<0?l.selectPreviousDish():l.selectNextDish(),p())},g=async()=>{if(!(!d||f||u)){f=!0,p();try{let t=await e.getContext();await n.start(`immersive-ar`,void 0,t)}catch(e){console.warn(`[assetPicker] Failed to start AR session:`,e)}finally{f=!1,p()}}};r.addEventListener(`click`,()=>h(-1)),i.addEventListener(`click`,()=>h(1)),a.addEventListener(`click`,()=>void g()),e.addEventListener(`enter-ar`,()=>{u=!0,p()}),e.addEventListener(`exit-ar`,()=>{u=!1,p()}),e.addEventListener(`enter-vr`,()=>{u=!0,p()}),e.addEventListener(`exit-vr`,()=>{u=!1,p()}),e.addEventListener(`loadfinished`,()=>void m()),o(()=>{requestAnimationFrame(()=>void m())})}s(),e(()=>import(`./needle-engine.NdjW02WD.js`),__vite__mapDeps([17,11,2,3,4,1,5,6,7,8,9,12,13,14,15,10,16]),import.meta.url);