import{w as _}from"./vendor-core-BKehvho7.js";import{o as p,m as a}from"./index-D88CvPWT.js";const P=(o="")=>{if(!o)throw new Error("createCompMetaStore scopeId is required");return _(`compMeta_${o}`,{state:()=>({detail:{},depEntryNameToFile:{},versionToFileAccessPath:{},localCompInfo:[],latestVersion:""}),getters:{isLocalExist:e=>e.localCompInfo.length!==0,latestVersionToFileAccessPath:e=>e.versionToFileAccessPath[e.latestVersion]??[]},actions:{setLatestVersion(e){this.$patch(t=>{t.latestVersion=e})},setLocalCompInfo(e){this.$patch(t=>{t.localCompInfo=e})},setDetail(e,t){this.$patch(r=>{r.detail[e]={...r.detail[e],...t}})},setDepEntryNameToFile(e,t){this.$patch(r=>{r.depEntryNameToFile[e]=t})},setVersionToFileAccessPath(e,t){this.$patch(r=>{r.versionToFileAccessPath[e]=t})}}})};function u(o,e){return o.filter(t=>{const r=e.find(l=>l.name===t.name||l.name===t.parent?.name);if(!r)return!1;const{match:m}=r,{major:s,minor:n,patch:h}=p.parseVersion(t.version),{major:i,minor:c,patch:T}=p.parseVersion(r.version);switch(m){case a.COMP_MATCH_TYPE_AUTO:return!0;case a.COMP_MATCH_TYPE_ONLY_INSTALL:return!0;case a.COMP_MATCH_TYPE_MAJOR_VERSION:return s===i;case a.COMP_MATCH_TYPE_MINOR_VERSION:return s===i&&n===c;case a.COMP_MATCH_TYPE_EXACT_VERSION:return s===i&&n===c&&h===T}})}export{P as c,u as p};
