import"./rolldown-runtime-DIIn1E2Q.js";function getStringProperty(e,t){let n=e.user_metadata?.[t];if(typeof n==`string`)return n;let r=e.metadata?.[t];if(typeof r==`string`)return r}function getAssetDescription(e){return getStringProperty(e,`description`)??null}function getAssetBaseModels(e){let t=e.user_metadata?.base_model??e.metadata?.base_model;return Array.isArray(t)?t.filter(e=>typeof e==`string`):typeof t==`string`&&t?[t]:[]}function getAssetDisplayName(e){return getStringProperty(e,`name`)||e.display_name||e.name}function getAssetSourceUrl(e){if(typeof e.metadata?.repo_url==`string`)return e.metadata.repo_url;let t=e.metadata?.source_arn??e.user_metadata?.source_arn;if(typeof t!=`string`)return null;let n=t.match(/^civitai:model:(\d+):version:(\d+)(?::file:\d+)?$/);if(n){let[,e,t]=n;return`https://civitai.com/models/${e}?modelVersionId=${t}`}return null}function getAssetTriggerPhrases(e){let t=e.user_metadata?.trained_words??e.metadata?.trained_words;return Array.isArray(t)?t.filter(e=>typeof e==`string`):typeof t==`string`?[t]:[]}function getAssetAdditionalTags(e){let t=e.user_metadata?.additional_tags;return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}function getSourceName(e){return e.includes(`civitai.com`)?`Civitai`:e.includes(`huggingface.co`)?`Hugging Face`:`Source`}function getAssetModelType(e){return e.tags?.find(e=>e&&e!==`models`)??null}function getAssetUserDescription(e){return typeof e.user_metadata?.user_description==`string`?e.user_metadata.user_description:``}function getAssetFilename(e){return getStringProperty(e,`filename`)??e.name}export{getAssetFilename as a,getAssetTriggerPhrases as c,getAssetDisplayName as i,getAssetUserDescription as l,getAssetBaseModels as n,getAssetModelType as o,getAssetDescription as r,getAssetSourceUrl as s,getAssetAdditionalTags as t,getSourceName as u};
//# sourceMappingURL=assetMetadataUtils-xfixkyW2.js.map