@vunk/plus 1.16.0 → 1.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("@vunk/plus/components/bubble-templates"),$=require("element-plus"),k=require("@vunk/plus/vue-virtual-scroller"),x=require("@element-plus/icons-vue"),R=require("@vueuse/core"),w=require("@vunk/plus/components/scrollbar"),B=require("@vunk/plus/element/bubble"),V=require("../_plugin-vue_export-helper-BHFhmbuH.js"),z=require("@vunk/shared/function"),P=require("@vunk/plus/components/agent-chat-provider"),N={},q={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"704",height:"704",viewBox:"0 0 704 704"};function A(r,i){return e.openBlock(),e.createElementBlock("svg",q,[...i[0]||(i[0]=[e.createStaticVNode('<defs><filter id="master_svg0_62_10054" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.030120481927710843" y="-0.030120481927710843" width="1.0602409638554218" height="1.0602409638554218"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="5" result="effect1_foregroundBlur"></feGaussianBlur></filter><linearGradient id="master_svg1_62_10082" x1="0.5" y1="-0.13192443549633026" x2="0.42319029569625854" y2="1.368432641029358"><stop offset="9.145302325487137%" stop-color="currentColor" stop-opacity="1"></stop><stop offset="13.636428117752075%" stop-color="currentColor" stop-opacity="0.07539999485015869"></stop><stop offset="16.968481242656708%" stop-color="currentColor" stop-opacity="0"></stop></linearGradient></defs><g transform="matrix(0,1,-1,0,704,-664)" filter="url(#master_svg0_62_10054)"><path d="M1016,684C1199.359,684,1348,535.359,1348,352C1348,168.641,1199.359,20,1016,20C832.641,20,684,168.641,684,352C684,535.359,832.641,684,1016,684ZM1016,32C1192.731,32,1336,175.269,1336,352C1336,528.731,1192.731,672,1016,672C839.269,672,696,528.731,696,352C696,175.269,839.269,32,1016,32Z" fill-rule="evenodd" fill="url(#master_svg1_62_10082)" fill-opacity="1"></path></g>',2)])])}const F=V._export_sfc(N,[["render",A]]),E={class:"vk-bubble-list-wrapper"},L=e.defineComponent({__name:"index",props:{list:{type:Array,default:()=>[]},autoScroll:{type:Boolean,default:!0},autoScrollThreshold:{type:Number,default:200},maxHeight:{type:String,default:""},alwaysShowScrollbar:{type:Boolean,default:!1},backButtonThreshold:{type:Number,default:80},showBackButton:{type:Boolean,default:!0},backButtonPosition:{type:Object,default:()=>({bottom:"20px",left:"calc(50% - 19px)"})},btnLoading:{type:Boolean,default:!0},btnColor:{type:String,default:"#409EFF"},btnIconSize:{type:Number,default:24},scrollbarAppendTo:{type:null,default:void 0},virtual:{type:Boolean,default:!1}},emits:{complete:null},setup(r,{expose:i}){const l=r,n=e.ref(),a=e.ref(),v=e.ref();function u(){document.documentElement.style.setProperty("--el-bubble-list-max-height",l.maxHeight||"100%"),document.documentElement.style.setProperty("--el-bubble-list-btn-size",`${l.btnIconSize}px`)}e.onMounted(()=>{u(),l.virtual&&e.nextTick(()=>{const o=n.value?.wrapRef;o&&(v.value=o)}),setTimeout(p)}),e.watch(()=>[l.maxHeight,l.btnIconSize],()=>u());const s=e.ref(),S=e.computed(()=>l.showBackButton&&s.value!==void 0&&s.value>l.backButtonThreshold);function p(){const o=n.value?.wrapRef;if(o)return s.value=o.scrollHeight-o.scrollTop-o.clientHeight,s.value}function h(){if(l.virtual){a.value?.scrollToBottom();return}n.value?.scrollToBottom()}function C(){if(l.virtual){a.value?.scrollToItem(0);return}n.value?.scrollToTop()}function T(o){if(l.virtual){a.value?.scrollToItem(o);return}const c=n.value?.wrapRef;if(!c)return;const b=c.querySelectorAll(".el-bubble");if(o>=b.length)return;const t=b[o],d=c.getBoundingClientRect(),y=t.getBoundingClientRect();c.scrollTo({top:y.top-d.top+c.scrollTop,behavior:"smooth"})}const g=e.ref();return e.onMounted(()=>{e.nextTick(()=>{g.value=n.value?.wrapRef?.firstElementChild})}),l.autoScroll&&R.useResizeObserver(g,()=>{const o=p();o!==void 0&&o>l.autoScrollThreshold||h()}),i({scrollToTop:C,scrollToBottom:h,scrollToBubble:T}),(o,c)=>{const b=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",E,[r.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vk-bubble-list-virtual-host",style:e.normalizeStyle({height:r.maxHeight||"100%"})},[e.createVNode(e.unref(w.VkScrollbar),{ref_key:"scrollbarRef",ref:n,class:"vk-bubble-list-virtual-scrollbar",always:r.alwaysShowScrollbar,"hide-after":800,onScroll:p},{default:e.withCtx(()=>[v.value?(e.openBlock(),e.createBlock(e.unref(k.DynamicScroller),{key:0,ref_key:"scrollerRef",ref:a,items:r.list,"min-item-size":54,"key-field":"key","page-mode":!0,"scroll-parent":v.value,class:"vk-bubble-list-dynamic-scroller"},{default:e.withCtx(({item:t,index:d,active:y})=>[e.createVNode(e.unref(k.DynamicScrollerItem),{item:t,active:y,"data-index":d,class:"vk-bubble-list-virtual-item"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.Bubble),{content:t.content,placement:t.placement,loading:t.loading,shape:t.shape,variant:t.variant,"is-markdown":t.isMarkdown,"is-fog":t.isFog,typing:t.typing,"max-width":t.maxWidth,avatar:t.avatar,"avatar-size":t.avatarSize,"avatar-gap":t.avatarGap,"avatar-shape":t.avatarShape,"avatar-src-set":t.avatarSrcSet,"avatar-alt":t.avatarAlt,"avatar-fit":t.avatarFit,"no-style":t.noStyle,class:e.normalizeClass({[`is-${t.role}`]:!0})},e.createSlots({_:2},[o.$slots.avatar?{name:"avatar",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"avatar",{item:t})]),key:"0"}:void 0,o.$slots.header?{name:"header",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"header",{item:t})]),key:"1"}:void 0,o.$slots.content?{name:"content",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"content",{item:t})]),key:"2"}:void 0,o.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"footer",{item:t})]),key:"3"}:void 0,o.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"loading",{item:t})]),key:"4"}:void 0]),1032,["content","placement","loading","shape","variant","is-markdown","is-fog","typing","max-width","avatar","avatar-size","avatar-gap","avatar-shape","avatar-src-set","avatar-alt","avatar-fit","no-style","class"])]),_:2},1032,["item","active","data-index"])]),_:3},8,["items","scroll-parent"])):e.createCommentVNode("",!0)]),_:3},8,["always"])],4)):(e.openBlock(),e.createBlock(e.unref(w.VkScrollbar),{key:1,ref_key:"scrollbarRef",ref:n,class:"vk-bubble-list","append-to":r.scrollbarAppendTo,always:r.alwaysShowScrollbar,"hide-after":800,onScroll:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.list,(t,d)=>(e.openBlock(),e.createBlock(e.unref(B.Bubble),{key:t.key||d,content:t.content,placement:t.placement,loading:t.loading,shape:t.shape,variant:t.variant,"is-markdown":t.isMarkdown,"is-fog":t.isFog,typing:t.typing,"max-width":t.maxWidth,avatar:t.avatar,"avatar-size":t.avatarSize,"avatar-gap":t.avatarGap,"avatar-shape":t.avatarShape,"avatar-src-set":t.avatarSrcSet,"avatar-alt":t.avatarAlt,"avatar-fit":t.avatarFit,"no-style":t.noStyle,class:e.normalizeClass({[`is-${t.role}`]:!0})},e.createSlots({_:2},[o.$slots.avatar?{name:"avatar",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"avatar",{item:t})]),key:"0"}:void 0,o.$slots.header?{name:"header",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"header",{item:t})]),key:"1"}:void 0,o.$slots.content?{name:"content",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"content",{item:t})]),key:"2"}:void 0,o.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"footer",{item:t})]),key:"3"}:void 0,o.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"loading",{item:t})]),key:"4"}:void 0]),1032,["content","placement","loading","shape","variant","is-markdown","is-fog","typing","max-width","avatar","avatar-size","avatar-gap","avatar-shape","avatar-src-set","avatar-alt","avatar-fit","no-style","class"]))),128))]),_:3},8,["append-to","always"])),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["vk-bubble-list-default-back-button",{"vk-bubble-list-back-to-bottom-solt":o.$slots.backToBottom}]),style:e.normalizeStyle({bottom:r.backButtonPosition.bottom,left:r.backButtonPosition.left}),onClick:h},[e.renderSlot(o.$slots,"backToBottom",{},()=>[e.createVNode(b,{class:"vk-bubble-list-back-to-bottom-icon",style:e.normalizeStyle({color:l.btnColor})},{default:e.withCtx(()=>[e.createVNode(e.unref(x.ArrowDownBold)),l.btnLoading?(e.openBlock(),e.createBlock(F,{key:0,class:"back-to-bottom-loading-svg-bg"})):e.createCommentVNode("",!0)]),_:1},8,["style"])])],6),[[e.vShow,S.value]])])}}}),M={items:{type:Array,default:()=>[]},elRef:{type:Function,default:z.noop},scrollbarAppendTo:null,virtual:{type:Boolean,default:!1},autoScrollThreshold:{type:Number,default:200}},f=e.defineComponent({name:"VkBubbleList",inheritAttrs:!1,__name:"index",props:M,setup(r,{expose:i}){const l=r,n=e.ref();return e.watch(()=>l.elRef,a=>{a&&a(n.value)},{immediate:!0}),i({scrollToTop:()=>n.value?.scrollToTop(),scrollToBottom:()=>n.value?.scrollToBottom(),scrollToBubble:a=>n.value?.scrollToBubble(a)}),(a,v)=>(e.openBlock(),e.createBlock(e.unref(m.VkBubbleRenderTemplates),null,{placeholder:e.withCtx(()=>[e.createVNode(e.unref(m.VkBubbleTemplates))]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"renderer"),e.createVNode(e.unref($.ElAutoResizer),null,{default:e.withCtx(({height:u})=>[e.createVNode(L,e.mergeProps({ref_key:"bubbleListRef",ref:n,"btn-icon-size":18,"max-height":`${u}px`,"scrollbar-append-to":a.scrollbarAppendTo,virtual:a.virtual,"auto-scroll-threshold":a.autoScrollThreshold,style:{"--el-bubble-list-max-height":`${u}px`},list:a.items},a.$attrs),e.createSlots({content:e.withCtx(({item:s})=>[e.createVNode(e.unref(m.VkBubbleRenderer),{source:[s]},null,8,["source"])]),_:2},[a.$slots.avatar?{name:"avatar",fn:e.withCtx(s=>[e.renderSlot(a.$slots,"avatar",e.normalizeProps(e.guardReactiveProps(s)))]),key:"0"}:void 0,a.$slots.header?{name:"header",fn:e.withCtx(s=>[e.renderSlot(a.$slots,"header",e.normalizeProps(e.guardReactiveProps(s)))]),key:"1"}:void 0,a.$slots.loading?{name:"loading",fn:e.withCtx(s=>[e.renderSlot(a.$slots,"loading",e.normalizeProps(e.guardReactiveProps(s)))]),key:"2"}:void 0,a.$slots.footer?{name:"footer",fn:e.withCtx(s=>[e.renderSlot(a.$slots,"footer",e.normalizeProps(e.guardReactiveProps(s)))]),key:"3"}:void 0]),1040,["max-height","scrollbar-append-to","virtual","auto-scroll-threshold","style","list"])]),_:3})]),_:3}))}}),_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));f.install=r=>{r.component(f.name||"VkBubbleList",f)};Object.defineProperty(exports,"Role",{enumerable:!0,get:()=>P.Role});exports.VkBubbleList=f;exports.__VkBubbleList=_;exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("@vunk/plus/components/bubble-templates"),P=require("element-plus"),B=require("@vunk/plus/vue-virtual-scroller"),F=require("@element-plus/icons-vue"),q=require("@vueuse/core"),S=require("@vunk/plus/components/scrollbar"),C=require("@vunk/plus/element/bubble"),I=require("../_plugin-vue_export-helper-BHFhmbuH.js"),N=require("@vunk/shared/function"),A=require("@vunk/plus/components/agent-chat-provider"),E={},O={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"704",height:"704",viewBox:"0 0 704 704"};function M(n,f){return e.openBlock(),e.createElementBlock("svg",O,[...f[0]||(f[0]=[e.createStaticVNode('<defs><filter id="master_svg0_62_10054" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.030120481927710843" y="-0.030120481927710843" width="1.0602409638554218" height="1.0602409638554218"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="5" result="effect1_foregroundBlur"></feGaussianBlur></filter><linearGradient id="master_svg1_62_10082" x1="0.5" y1="-0.13192443549633026" x2="0.42319029569625854" y2="1.368432641029358"><stop offset="9.145302325487137%" stop-color="currentColor" stop-opacity="1"></stop><stop offset="13.636428117752075%" stop-color="currentColor" stop-opacity="0.07539999485015869"></stop><stop offset="16.968481242656708%" stop-color="currentColor" stop-opacity="0"></stop></linearGradient></defs><g transform="matrix(0,1,-1,0,704,-664)" filter="url(#master_svg0_62_10054)"><path d="M1016,684C1199.359,684,1348,535.359,1348,352C1348,168.641,1199.359,20,1016,20C832.641,20,684,168.641,684,352C684,535.359,832.641,684,1016,684ZM1016,32C1192.731,32,1336,175.269,1336,352C1336,528.731,1192.731,672,1016,672C839.269,672,696,528.731,696,352C696,175.269,839.269,32,1016,32Z" fill-rule="evenodd" fill="url(#master_svg1_62_10082)" fill-opacity="1"></path></g>',2)])])}const H=I._export_sfc(E,[["render",M]]),L={class:"vk-bubble-list-wrapper"},G=e.defineComponent({__name:"index",props:{list:{type:Array,default:()=>[]},autoScroll:{type:Boolean,default:!0},autoScrollThreshold:{type:Number,default:200},maxHeight:{type:String,default:""},alwaysShowScrollbar:{type:Boolean,default:!1},backButtonThreshold:{type:Number,default:80},showBackButton:{type:Boolean,default:!0},backButtonPosition:{type:Object,default:()=>({bottom:"20px",left:"calc(50% - 19px)"})},btnLoading:{type:Boolean,default:!0},btnColor:{type:String,default:"#409EFF"},btnIconSize:{type:Number,default:24},scrollbarAppendTo:{type:null,default:void 0},virtual:{type:Boolean,default:!1},keyField:{type:String,default:"key"}},emits:{complete:null},setup(n,{expose:f}){const s=n,r=e.ref(),a=e.ref(),h=e.ref();function b(){document.documentElement.style.setProperty("--el-bubble-list-max-height",s.maxHeight||"100%"),document.documentElement.style.setProperty("--el-bubble-list-btn-size",`${s.btnIconSize}px`)}e.onMounted(()=>{b(),s.virtual&&e.nextTick(()=>{const o=r.value?.wrapRef;o&&(h.value=o)}),setTimeout(g)}),e.watch(()=>[s.maxHeight,s.btnIconSize],()=>b());const i=e.ref(),T=e.computed(()=>s.showBackButton&&i.value!==void 0&&i.value>s.backButtonThreshold);let p=!1;function g(){const o=r.value?.wrapRef;if(o)return i.value=o.scrollHeight-o.scrollTop-o.clientHeight,i.value}function y(){if(s.virtual){a.value?.scrollToBottom();return}r.value?.scrollToBottom()}function $(){if(s.virtual){a.value?.scrollToItem(0);return}r.value?.scrollToTop()}async function R(o){if(s.virtual){const l=r.value?.wrapRef;if(!l)return;p=!0;try{const d=l.querySelector(`[data-index="${o}"][data-visible="true"] .el-bubble`);if(d){const u=l.getBoundingClientRect(),c=d.getBoundingClientRect();l.scrollTo({top:c.top-u.top+l.scrollTop-24,behavior:"auto"});return}let t=0;for(;t<o;){const u=a.value?.getItemOffset(t+1)??0;l.scrollTo({top:u,behavior:"auto"}),await new Promise(c=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>c())})}),t=Math.min(t+20,o)}for(const u of[1,2]){a.value?.scrollToItem(o),await new Promise(m=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>m())})});const c=l.querySelector(`[data-index="${o}"][data-visible="true"] .el-bubble`);if(c){const m=l.getBoundingClientRect(),z=c.getBoundingClientRect();l.scrollTo({top:z.top-m.top+l.scrollTop-24,behavior:"auto"})}}}finally{p=!1}return}p=!0;try{const l=r.value?.wrapRef;if(!l)return;const d=l.querySelectorAll(".el-bubble");if(o>=d.length)return;const t=d[o],u=l.getBoundingClientRect(),c=t.getBoundingClientRect();l.scrollTo({top:c.top-u.top+l.scrollTop,behavior:"smooth"})}finally{p=!1}}function V(o){return a.value?.getItemOffset(o)}function x(){const o=a.value,l=r.value?.wrapRef;if(!o||!l)return;const d=l.scrollTop,t=l.clientHeight,u=o.findItemIndex(d),c=o.findItemIndex(d+t);return{start:u,end:c}}const w=e.ref();return e.onMounted(()=>{e.nextTick(()=>{w.value=r.value?.wrapRef?.firstElementChild})}),s.autoScroll&&q.useResizeObserver(w,()=>{if(p)return;const o=g();o!==void 0&&o>s.autoScrollThreshold||y()}),f({scrollToTop:$,scrollToBottom:y,scrollToBubble:R,getItemOffset:V,getVisibleRange:x}),(o,l)=>{const d=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",L,[n.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vk-bubble-list-virtual-host",style:e.normalizeStyle({height:n.maxHeight||"100%"})},[e.createVNode(e.unref(S.VkScrollbar),{ref_key:"scrollbarRef",ref:r,class:"vk-bubble-list-virtual-scrollbar",always:n.alwaysShowScrollbar,"hide-after":800,onScroll:g},{default:e.withCtx(()=>[h.value?(e.openBlock(),e.createBlock(e.unref(B.DynamicScroller),{key:0,ref_key:"scrollerRef",ref:a,items:n.list,"min-item-size":54,"key-field":n.keyField,"page-mode":!0,"scroll-parent":h.value,class:"vk-bubble-list-dynamic-scroller"},{default:e.withCtx(({item:t,index:u,active:c})=>[e.createVNode(e.unref(B.DynamicScrollerItem),{item:t,active:c,"data-index":u,"data-visible":c,class:"vk-bubble-list-virtual-item"},{default:e.withCtx(()=>[e.createVNode(e.unref(C.Bubble),{content:t.content,placement:t.placement,loading:t.loading,shape:t.shape,variant:t.variant,"is-markdown":t.isMarkdown,"is-fog":t.isFog,typing:t.typing,"max-width":t.maxWidth,avatar:t.avatar,"avatar-size":t.avatarSize,"avatar-gap":t.avatarGap,"avatar-shape":t.avatarShape,"avatar-src-set":t.avatarSrcSet,"avatar-alt":t.avatarAlt,"avatar-fit":t.avatarFit,"no-style":t.noStyle,class:e.normalizeClass({[`is-${t.role}`]:!0})},e.createSlots({_:2},[o.$slots.avatar?{name:"avatar",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"avatar",{item:t})]),key:"0"}:void 0,o.$slots.header?{name:"header",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"header",{item:t})]),key:"1"}:void 0,o.$slots.content?{name:"content",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"content",{item:t})]),key:"2"}:void 0,o.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"footer",{item:t})]),key:"3"}:void 0,o.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"loading",{item:t})]),key:"4"}:void 0]),1032,["content","placement","loading","shape","variant","is-markdown","is-fog","typing","max-width","avatar","avatar-size","avatar-gap","avatar-shape","avatar-src-set","avatar-alt","avatar-fit","no-style","class"])]),_:2},1032,["item","active","data-index","data-visible"])]),_:3},8,["items","key-field","scroll-parent"])):e.createCommentVNode("",!0)]),_:3},8,["always"])],4)):(e.openBlock(),e.createBlock(e.unref(S.VkScrollbar),{key:1,ref_key:"scrollbarRef",ref:r,class:"vk-bubble-list","append-to":n.scrollbarAppendTo,always:n.alwaysShowScrollbar,"hide-after":800,onScroll:g},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(t,u)=>(e.openBlock(),e.createBlock(e.unref(C.Bubble),{key:t.key||u,content:t.content,placement:t.placement,loading:t.loading,shape:t.shape,variant:t.variant,"is-markdown":t.isMarkdown,"is-fog":t.isFog,typing:t.typing,"max-width":t.maxWidth,avatar:t.avatar,"avatar-size":t.avatarSize,"avatar-gap":t.avatarGap,"avatar-shape":t.avatarShape,"avatar-src-set":t.avatarSrcSet,"avatar-alt":t.avatarAlt,"avatar-fit":t.avatarFit,"no-style":t.noStyle,class:e.normalizeClass({[`is-${t.role}`]:!0})},e.createSlots({_:2},[o.$slots.avatar?{name:"avatar",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"avatar",{item:t})]),key:"0"}:void 0,o.$slots.header?{name:"header",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"header",{item:t})]),key:"1"}:void 0,o.$slots.content?{name:"content",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"content",{item:t})]),key:"2"}:void 0,o.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"footer",{item:t})]),key:"3"}:void 0,o.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"loading",{item:t})]),key:"4"}:void 0]),1032,["content","placement","loading","shape","variant","is-markdown","is-fog","typing","max-width","avatar","avatar-size","avatar-gap","avatar-shape","avatar-src-set","avatar-alt","avatar-fit","no-style","class"]))),128))]),_:3},8,["append-to","always"])),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["vk-bubble-list-default-back-button",{"vk-bubble-list-back-to-bottom-solt":o.$slots.backToBottom}]),style:e.normalizeStyle({bottom:n.backButtonPosition.bottom,left:n.backButtonPosition.left}),onClick:y},[e.renderSlot(o.$slots,"backToBottom",{},()=>[e.createVNode(d,{class:"vk-bubble-list-back-to-bottom-icon",style:e.normalizeStyle({color:s.btnColor})},{default:e.withCtx(()=>[e.createVNode(e.unref(F.ArrowDownBold)),s.btnLoading?(e.openBlock(),e.createBlock(H,{key:0,class:"back-to-bottom-loading-svg-bg"})):e.createCommentVNode("",!0)]),_:1},8,["style"])])],6),[[e.vShow,T.value]])])}}}),_={items:{type:Array,default:()=>[]},elRef:{type:Function,default:N.noop},scrollbarAppendTo:null,virtual:{type:Boolean,default:!1},keyField:{type:String,default:"key"},autoScrollThreshold:{type:Number,default:200}},v=e.defineComponent({name:"VkBubbleList",inheritAttrs:!1,__name:"index",props:_,setup(n,{expose:f}){const s=n,r=e.ref();return e.watch(()=>s.elRef,a=>{a&&a(r.value)},{immediate:!0}),f({scrollToTop:()=>r.value?.scrollToTop(),scrollToBottom:()=>r.value?.scrollToBottom(),scrollToBubble:a=>r.value?.scrollToBubble(a),getItemOffset:a=>r.value?.getItemOffset(a),getVisibleRange:()=>r.value?.getVisibleRange()}),(a,h)=>(e.openBlock(),e.createBlock(e.unref(k.VkBubbleRenderTemplates),null,{placeholder:e.withCtx(()=>[e.createVNode(e.unref(k.VkBubbleTemplates))]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"renderer"),e.createVNode(e.unref(P.ElAutoResizer),null,{default:e.withCtx(({height:b})=>[e.createVNode(G,e.mergeProps({ref_key:"bubbleListRef",ref:r,"btn-icon-size":18,"max-height":`${b}px`,"scrollbar-append-to":a.scrollbarAppendTo,virtual:a.virtual,"key-field":a.keyField,"auto-scroll-threshold":a.autoScrollThreshold,style:{"--el-bubble-list-max-height":`${b}px`},list:a.items},a.$attrs),e.createSlots({content:e.withCtx(({item:i})=>[e.createVNode(e.unref(k.VkBubbleRenderer),{source:[i]},null,8,["source"])]),_:2},[a.$slots.avatar?{name:"avatar",fn:e.withCtx(i=>[e.renderSlot(a.$slots,"avatar",e.normalizeProps(e.guardReactiveProps(i)))]),key:"0"}:void 0,a.$slots.header?{name:"header",fn:e.withCtx(i=>[e.renderSlot(a.$slots,"header",e.normalizeProps(e.guardReactiveProps(i)))]),key:"1"}:void 0,a.$slots.loading?{name:"loading",fn:e.withCtx(i=>[e.renderSlot(a.$slots,"loading",e.normalizeProps(e.guardReactiveProps(i)))]),key:"2"}:void 0,a.$slots.footer?{name:"footer",fn:e.withCtx(i=>[e.renderSlot(a.$slots,"footer",e.normalizeProps(e.guardReactiveProps(i)))]),key:"3"}:void 0]),1040,["max-height","scrollbar-append-to","virtual","key-field","auto-scroll-threshold","style","list"])]),_:3})]),_:3}))}}),j=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));v.install=n=>{n.component(v.name||"VkBubbleList",v)};Object.defineProperty(exports,"Role",{enumerable:!0,get:()=>A.Role});exports.VkBubbleList=v;exports.__VkBubbleList=j;exports.default=v;