import"./rolldown-runtime-DIIn1E2Q.js";import"./vendor-primevue-CSt9JbQD.js";import"./vendor-firebase-D7u00oy9.js";import{q as e}from"./vendor-vue-core-DO0afONr.js";import"./vendor-other-Bo3xiN_p.js";import"./useFeatureFlags-Bq93lbLe.js";import"./api-Bzi--8-2.js";import"./vendor-markdown-Da9QPS2x.js";import"./colorUtil-Bc1n5Dsf.js";import"./i18n-xfNY32Ho.js";import"./vendor-reka-ui-D1HCh14_.js";import"./Button-DcKkUh7N.js";import{Qi as t,ea as n,ir as r}from"./dialogService-B4eN_yjE.js";import"./extensionStore-BKzl_b6L.js";import"./userStore-COx1oLYZ.js";import"./useErrorHandling-BvGYTWYe.js";import"./useExternalLink-Dz8tO2Wt.js";import"./vendor-tiptap-DU4sLNDM.js";import"./markdownRendererUtil-BmSNgBXi.js";import"./Popover-DBaEFrTX.js";import"./vendor-three-CbPgwNS4.js";import"./Load3DControls-BBny_bem.js";import"./constants-uQQG4CBf.js";import"./Load3dViewerContent-BOOIHTqR.js";import{t as i}from"./Load3D-CJyNivzd.js";import"./AnimationControls-D_YzMoTt.js";import{r as a,t as o}from"./load3dService-3Z51i0ou.js";import"./useLoad3dViewer-CwqiXnlv.js";import{n as s}from"./useLoad3d-C5LnKzTB.js";import{n as c,t as l}from"./Load3DConfiguration-DV1-pSX-.js";var u={name:`image`,type:`Preview3D`,isPreview:!0};r().registerExtension({name:`Comfy.SaveGLB`,async beforeRegisterNodeDef(e,t){t.name===`SaveGLB`&&(t.input.required.image=[`PREVIEW_3D`])},getCustomWidgets(){return{PREVIEW_3D(e){let r=new t({node:e,name:u.name,component:i,inputSpec:u,options:{}});return r.type=`load3D`,n(e,r),{widget:r}}}},getNodeMenuItems(e){if(e.constructor.comfyClass!==`SaveGLB`)return[];let t=o().getLoad3d(e);return!t||t.isSplatModel()?[]:c(t)},async nodeCreated(t){if(t.constructor.comfyClass!==`SaveGLB`)return;let[n,r]=t.size;t.setSize([Math.max(n,400),Math.max(r,550)]),await e();let i=t.onExecuted;t.onExecuted=function(e){i?.call(this,e);let n=e[`3d`]?.[0];n&&s(t).waitForLoad3d(e=>{let r=t.widgets?.find(e=>e.name===`image`);if(e&&r){let i=(n.subfolder??``)+`/`+(n.filename??``);r.value=i;let o=new l(e,t.properties),s=n.type,onModelLoaded=()=>{e.removeEventListener(`modelLoadingEnd`,onModelLoaded),a.generateThumbnailIfNeeded(e,i,s)};e.addEventListener(`modelLoadingEnd`,onModelLoaded),o.configureForSaveMesh(s,i)}})}}});
//# sourceMappingURL=saveMesh-CW6muKDE.js.map