import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import"./vendor-primevue-Cxtp5b7G.js";import"./vendor-firebase-yTFzdAQf.js";import{q as t}from"./vendor-vue-core-CvBSzfTV.js";import"./vendor-other-D5NZnOmc.js";import"./useFeatureFlags-DVZ3jgA6.js";import"./api-DSiNdNpa.js";import"./vendor-markdown-U30xfsVK.js";import"./colorUtil-DSsa6gcB.js";import"./i18n-DCFpta2c.js";import"./vendor-reka-ui-CTPZ4sYp.js";import"./Button-DVVwvjf6.js";import{Gt as n,Mr as r,jr as i}from"./dialogService-Rf2pSjHq.js";import"./systemStatsStore-CurmsieD.js";import"./useErrorHandling-t6du6c8l.js";import"./dialogStore-IEowu711.js";import"./userStore-B0bZXNfw.js";import"./useCopyToClipboard-DvrVgs_8.js";import"./vendor-tiptap-DAH79rhp.js";import"./markdownRendererUtil-D9EL2S0X.js";import"./useExternalLink-QBp7P3GY.js";import"./vendor-three-DTAwrV_W.js";import"./Load3DControls-Bgpa2tOl.js";import"./constants-D-rYTqCC.js";import"./Load3dViewerContent-D0hYNbvC.js";import{t as a}from"./Load3D-DMk0tE91.js";import"./AnimationControls-C4lHceM5.js";import{r as o,t as s}from"./load3dService-DhvYbq1k.js";import"./useLoad3dViewer-CeBjg4i6.js";import{n as c}from"./useLoad3d-BPKWi2z3.js";import{n as l,t as u}from"./Load3DConfiguration-BG-Gciwk.js";var d={name:`image`,type:`Preview3D`,isPreview:!0};n().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 i({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-BQDWJMBt.js.map