import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import"./vendor-primevue-DxVRNMbC.js";import"./vendor-firebase-CdLSXhbt.js";import{q as t}from"./vendor-vue-core-X6q-rGJs.js";import"./vendor-other-CyG3qq8S.js";import"./useFeatureFlags-CxRWjdi1.js";import"./api-DQLKc1Xa.js";import"./vendor-markdown-Cola12Wc.js";import"./colorUtil-Cth7eqhK.js";import"./i18n-DjV_9lZM.js";import"./vendor-reka-ui-CHPbCe4i.js";import"./Button-C7dWyQyS.js";import{Or as n,kr as r,qt as i}from"./dialogService-Cqui0UMO.js";import"./systemStatsStore-D9aNY5gT.js";import"./useErrorHandling-BFB8eSj5.js";import"./dialogStore-CXD5Bcfy.js";import"./useCopyToClipboard-C74olorb.js";import"./vendor-tiptap-BXSIIPYY.js";import"./markdownRendererUtil-Bm7Umh6C.js";import"./useExternalLink-Cc30SNi3.js";import"./vendor-three-CHi1XwmR.js";import"./Load3DControls-C7Lxgjdd.js";import"./constants-BMSdGzcT.js";import"./Load3dViewerContent-DOlYENFn.js";import{t as a}from"./Load3D-c_H5Y86b.js";import"./AnimationControls-C9rBFNWa.js";import{r as o,t as s}from"./load3dService-Ctk3mPz3.js";import"./useLoad3dViewer-B76fxHL5.js";import{n as c}from"./useLoad3d-C2idHlw3.js";import{n as l,t as u}from"./Load3DConfiguration-CgUfeZCc.js";var d={name:`image`,type:`Preview3D`,isPreview:!0};i().registerExtension({name:`Comfy.SaveGLB`,async beforeRegisterNodeDef(e,t){t.name===`SaveGLB`&&(t.input.required.image=[`PREVIEW_3D`])},getCustomWidgets(){return{PREVIEW_3D(e){let t=new n({node:e,name:d.name,component:a,inputSpec:d,options:{}});return t.type=`load3D`,r(e,t),{widget:t}}}},getNodeMenuItems(e){if(e.constructor.comfyClass!==`SaveGLB`)return[];let t=s().getLoad3d(e);return!t||t.isSplatModel()?[]:l(t)},async nodeCreated(e){if(e.constructor.comfyClass!==`SaveGLB`)return;let[n,r]=e.size;e.setSize([Math.max(n,400),Math.max(r,550)]),await t();let i=e.onExecuted;e.onExecuted=function(t){i?.call(this,t);let n=t[`3d`]?.[0];n&&c(e).waitForLoad3d(t=>{let r=e.widgets?.find(e=>e.name===`image`);if(t&&r){let i=(n.subfolder??``)+`/`+(n.filename??``);r.value=i;let a=new u(t,e.properties),s=n.type,onModelLoaded=()=>{t.removeEventListener(`modelLoadingEnd`,onModelLoaded),o.generateThumbnailIfNeeded(t,i,s)};t.addEventListener(`modelLoadingEnd`,onModelLoaded),a.configureForSaveMesh(s,i)}})}}});
//# sourceMappingURL=saveMesh-BrGfmBc7.js.map