import*as c from"path";import{DEFAULT_THEME_NAME as i,USER_THEME_ALIAS as k}from"../../constants/common.js";import{logger as y}from"../../server/tools/notifiers/logger.js";import{reporter as T}from"../../server/tools/notifiers/reporter.js";import{resolveTheme as F}from"./resolveTheme.js";import{EntitlementsProvider as A}from"../../server/entitlements/entitlements-provider.js";const L=["markdoc/attributes/code-walkthrough-filesets.ts","markdoc/attributes/code-walkthrough-filters.ts","markdoc/components/CodeWalkthrough/**","markdoc/tags/code-step.ts","markdoc/tags/code-toggle.ts","markdoc/tags/code-walkthrough.ts"],m=["./core/**","./markdoc/**/default.*","**/__mocks__/**","**/index.*","**/utils/**/*","**/__tests__/**/*","**/__snapshots__/**/*","**/*.stories.*","**/variables.*",...L],v=["./components/CatalogClassic/CatalogClassicCard.*","./components/ColorModeSwitcher/**","./components/Feedback/**","./components/Filter/**","./components/Footer/**","./components/LanguagePicker/**","./components/Menu/**","./components/Navbar/**","./components/PageNavigation/**","./components/Product/**","./components/Search/**","./components/UserMenu/**","./layouts/RootLayout.*","./layouts/NotFound.*","./layouts/Forbidden.*","./layouts/DocumentationLayoutTop.*","./layouts/DocumentationLayoutBottom.*","./icons/**","./markdoc/**","./ext/**"];async function C(t){const[p,n]=t._,{theme:l,force:d,onSuccess:u,onError:g,onOverride:h,config:E}=t,_=A.instance(),s=c.resolve(t["project-dir"]);let o=l;o||(o=i);const r=await F(s,E.plugins||[],o,n);r||await T.panicOnContentError(`Theme ${o} not found. Skipping eject.`);const e=r?.config.ejectIgnore;e&&!Array.isArray(e)&&y.warn("'ejectIgnore' must be of type Array. Skipping.");const a=await _.getPackageEjectIgnore(),f={force:d,onSuccess:u,onError:g,onOverride:h,onlyFiles:o===i?v:void 0,ignoreFiles:Array.isArray(e)?[...e,...a,...m]:[...a,...m]};return{objectType:p,pathToThemeFolder:r?.pluginDirAbsolutePath,pathToPortalCustomThemeFolder:c.resolve(s,k),componentToEject:n,theme:o,options:f}}export{m as DEFAULT_IGNORED_FILES,v as EJECTABLE_FILES,C as default};
