var __spreadArray=this&&this.__spreadArray||function(e,l,i){if(i||arguments.length===2)for(var t=0,n=l.length,s;t<n;t++){if(s||!(t in l)){if(!s)s=Array.prototype.slice.call(l,0,t);s[t]=l[t]}}return e.concat(s||Array.prototype.slice.call(l))};import{r as registerInstance,h,H as Host}from"./index-b7735e0d.js";var dvnFieldDisplayMultipleChoiceCss=".sc-dvn-field-display-multiple-choice-h{display:block}.sc-dvn-field-display-multiple-choice-h ul.sc-dvn-field-display-multiple-choice{margin:0;padding-left:0}.sc-dvn-field-display-multiple-choice-h ul.sc-dvn-field-display-multiple-choice li.sc-dvn-field-display-multiple-choice{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sc-dvn-field-display-multiple-choice-h dvn-button.sc-dvn-field-display-multiple-choice{margin-right:4px}";var DvnFieldDisplayMultipleChoice=function(){function e(e){registerInstance(this,e);this.value=[]}e.prototype.render=function(){var e=this;var l=this,i=l.meta,t=l.value;var n=((i===null||i===void 0?void 0:i.lines)||0)-this.value.length;if(this.field.inputType==="tag-cloud"){var s=__spreadArray([],t,true);if(i.maxItems&&t.length-i.maxItems>=1){s=s.slice(0,i.maxItems-1)}return h(Host,{style:{height:this.fixHeight?"".concat((this.field.options||[]).length*20,"px"):undefined}},s.map((function(l){return h("dvn-button",{leaned:true,scale:"small",shape:"rounded",view:"outline",tagMode:true},e.field.getOptionOfValue(l).label)})),t.length>s.length&&h("dvn-button",{leaned:true,scale:"small",shape:"rounded",view:"outline",tagMode:true},"+",t.length-s.length),this.value.length===0&&"-")}return h(Host,{style:{height:this.fixHeight?"".concat((this.field.options||[]).length*20,"px"):undefined}},h("ul",null,this.value.map((function(l){return h("li",null,e.field.getOptionOfValue(l).label)})),this.value.length===0&&"-",n>0&&new Array(n).fill(0).map((function(){return h("li",null)}))))};return e}();DvnFieldDisplayMultipleChoice.style=dvnFieldDisplayMultipleChoiceCss;export{DvnFieldDisplayMultipleChoice as dvn_field_display_multiple_choice};