"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),v=require("@aplus-frontend/antdv"),u=require("lodash-unified"),C=require("../utils/warning.js"),n=require("../utils/config-provider-preset.js"),m=require("./config-provider-props.js"),P=require("./constants.js"),c=require("./hooks/use-global-config.js");function h(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!r.isVNode(e)}const a=r.ref({}),b=r.defineComponent({name:"AplusConfigProvider",props:m.configProviderProps(),setup(e,{slots:d}){C.useDevWarning("ConfigProvider")(!e.uiMode,"breaking","uiMode has been remove, see migrate guide https://aplus.aplnk.com/aplus-ui/guide/migrate-7.2.html");function o(i,f){return e[i]??t.value?.[i]??f}const t=c.useGlobalConfig(),g=r.computed(()=>u.merge(u.cloneDeep(t.value?.aplusToken||{}),e.aplusToken)),s=r.computed(()=>({namespace:o("namespace",P.DEFAULT_NAMESPACE),apGrid:o("apGrid"),agGrid:o("agGrid"),apProCard:o("apProCard"),apImage:o("apImage"),apTitle:o("apTitle"),searchForm:o("searchForm"),apUpload:o("apUpload"),apDescriptions:o("apDescriptions"),apFilePreview:o("apFilePreview"),apExportGroup:o("apExportGroup"),apView:o("apView"),aplusLocale:e.aplusLocale,aplusToken:g.value,api:e.api,valueTypeMap:e.valueTypeMap,downloadCenterTriggerConfig:e.downloadCenterTriggerConfig,scrollYDomName:e.scrollYDomName,viewCacheOption:e.viewCacheOption})),p=c.provideGlobalConfig(s);let l=!0;return r.watch(()=>e,i=>{a.value=n.mergeAntdProviderConfigWithCache(n.mergeAntdProvideConfig(i),a.value)},{deep:!0,immediate:!0}),r.onActivated(()=>{if(l){l=!1;return}a.value=n.mergeAntdProviderConfigWithCache(n.mergeAntdProvideConfig(e),a.value)}),()=>{let i;return r.createVNode(v.ConfigProvider,a.value,h(i=r.renderSlot(d,"default",{config:p?.value}))?i:{default:()=>[i]})}}});exports.ConfigProvider=b;exports.globalConfigCached=a;
