System.register(["./index-legacy.js?v=1723125373998","./vue-legacy.js?v=1723125373998"],(function(e,i){"use strict";var t,l,n,r,s,o,a,c,p,u,d,g,v,f,m;return{setters:[e=>{t=e.bz,l=e.aK,n=e.cp,r=e.aE,s=e.aW,o=e.aG,a=e.bM,c=e.aN,p=e.bt},e=>{u=e.l,d=e.r,g=e.k,v=e.G,f=e.p,m=e.L}],execute:function(){e({b:w,c:h});const i=e("e",t({name:"Ellipsis",common:l,peers:{Tooltip:n}})),b=e("s",r("ellipsis",{overflow:"hidden"},[s("line-clamp","\n white-space: nowrap;\n display: inline-block;\n vertical-align: bottom;\n max-width: 100%;\n "),o("line-clamp","\n display: -webkit-inline-box;\n -webkit-box-orient: vertical;\n "),o("cursor-pointer","\n cursor: pointer;\n ")]));function h(e){return`${e}-ellipsis--line-clamp`}function w(e,i){return`${e}-ellipsis--cursor-${i}`}const T=e("a",Object.assign(Object.assign({},c.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}));e("_",u({name:"Ellipsis",inheritAttrs:!1,props:T,setup(e,{slots:t,attrs:l}){const n=a(),r=c("Ellipsis","-ellipsis",b,i,e,n),s=d(null),o=d(null),p=d(null),u=d(!1),T=g((()=>{const{lineClamp:i}=e,{value:t}=u;return void 0!==i?{textOverflow:"","-webkit-line-clamp":t?"":i}:{textOverflow:t?"":"ellipsis","-webkit-line-clamp":""}}));function k(){let i=!1;const{value:t}=u;if(t)return!0;const{value:l}=s;if(l){const{lineClamp:t}=e;if(function(i){if(!i)return;const t=T.value,l=h(n.value);void 0!==e.lineClamp?C(i,l,"add"):C(i,l,"remove");for(const e in t)i.style[e]!==t[e]&&(i.style[e]=t[e])}(l),void 0!==t)i=l.scrollHeight<=l.offsetHeight;else{const{value:e}=o;e&&(i=e.getBoundingClientRect().width<=l.getBoundingClientRect().width)}!function(i,t){const l=w(n.value,"pointer");"click"!==e.expandTrigger||t?C(i,l,"remove"):C(i,l,"add")}(l,i)}return i}const x=g((()=>"click"===e.expandTrigger?()=>{var e;const{value:i}=u;i&&(null===(e=p.value)||void 0===e||e.setShow(!1)),u.value=!i}:void 0));function C(e,i,t){"add"===t?e.classList.contains(i)||e.classList.add(i):e.classList.contains(i)&&e.classList.remove(i)}return v((()=>{var i;e.tooltip&&(null===(i=p.value)||void 0===i||i.setShow(!1))})),{mergedTheme:r,triggerRef:s,triggerInnerRef:o,tooltipRef:p,handleClick:x,renderTrigger:()=>f("span",Object.assign({},m(l,{class:[`${n.value}-ellipsis`,void 0!==e.lineClamp?h(n.value):void 0,"click"===e.expandTrigger?w(n.value,"pointer"):void 0],style:T.value}),{ref:"triggerRef",onClick:x.value,onMouseenter:"click"===e.expandTrigger?k:void 0}),e.lineClamp?t:f("span",{ref:"triggerInnerRef"},t)),getTooltipDisabled:k}},render(){var e;const{tooltip:i,renderTrigger:t,$slots:l}=this;if(i){const{mergedTheme:n}=this;return f(p,Object.assign({ref:"tooltipRef",placement:"top"},i,{getDisabled:this.getTooltipDisabled,theme:n.peers.Tooltip,themeOverrides:n.peerOverrides.Tooltip}),{trigger:t,default:null!==(e=l.tooltip)&&void 0!==e?e:l.default})}return t()}}))}}}));
