"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("./BaseIcon-C2QCjRyr.cjs"),g=require("./useNestedProp-DO3dp1MP.cjs"),u=require("./index-BCDlAguz.cjs"),f=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),m=["id"],h={key:0,class:"vue-ui-accordion-arrow"},k={__name:"vue-ui-accordion",props:{config:{type:Object,default(){return{}}},hideDetails:{type:Boolean,default:!1}},setup(l){const c=l;e.useCssVars(r=>({"95f7c2e4":v.value}));const{vue_ui_accordion:d}=u.useConfig(),o=e.computed(()=>g.useNestedProp({userConfig:c.config,defaultConfig:d})),a=e.ref(o.value.open),i=e.ref(u.createUid()),t=e.ref(null),n=e.ref(0);e.onMounted(()=>{t.value.open=o.value.open}),e.watch(()=>o.value.open,r=>{t.value.open=r});function s(){(n.value>0||!o.value.open)&&(a.value=!a.value),n.value+=1}const v=e.computed(()=>`${o.value.maxHeight}px`);return(r,C)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("details",{id:`details_${i.value}`,ref_key:"details",ref:t,onToggle:s},[e.createElementVNode("summary",{class:e.normalizeClass({"vue-ui-accordion-headless":l.hideDetails})},[e.createElementVNode("div",{class:"vue-ui-accordion-head",style:e.normalizeStyle(`background:${o.value.head.backgroundColor};padding:${o.value.head.padding}; ${l.hideDetails?"height: 0px !important; padding: 0 !important;":""}`)},[l.hideDetails?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",h,[o.value.head.useArrowSlot?e.renderSlot(r.$slots,"arrow",e.normalizeProps(e.mergeProps({key:0},{backgroundColor:o.value.head.backgroundColor,color:o.value.head.color,iconColor:o.value.head.iconColor,isOpen:a.value})),void 0,!0):(e.openBlock(),e.createBlock(p.default,{key:1,name:"arrowRight",stroke:o.value.head.iconColor},null,8,["stroke"]))])),e.renderSlot(r.$slots,"title",e.normalizeProps(e.guardReactiveProps({color:o.value.head.color,isOpen:a.value})),void 0,!0)],4)],2)],40,m),e.createElementVNode("div",{class:"vue-ui-accordion-content",style:e.normalizeStyle(`background:${o.value.body.backgroundColor};color:${o.value.body.color}`)},[e.renderSlot(r.$slots,"content",e.normalizeProps(e.guardReactiveProps({backgroundColor:o.value.body.backgroundColor,color:o.value.body.color,isOpen:a.value})),void 0,!0)],4)]))}},y=f._export_sfc(k,[["__scopeId","data-v-28fc829c"]]);exports.default=y;
