import{_ as V,d as f,o as t,f as n,g as u,t as c,h as e,aq as y,e as m,i as v,w as a,F as b,p as g,R as U,N as d,W as L,V as w}from"./index.cf09daef.js";const C={props:{modelValue:Array,view:Boolean},emits:["update:model-value"],data(){return{lists:this.modelValue||[]}},methods:{onRemove(l){console.func("components/UrlList:methods.onRemove()",arguments),this.lists.splice(l,1),this.$emit("update:model-value",this.lists)},onAdd(l){console.func("components/UrlList:methods.onAdd()",arguments),this.lists.push({}),this.$emit("update:model-value",this.lists)}},computed:{noLinks(){return!this.lists||this.lists&&this.lists.length<1}}},A={class:"url-list"},B={class:"q-mb-md flex items-center"},N={class:"text-bold"},Q={key:0,class:"text-grey"},$=["href"];function q(l,R,r,x,k,i){const h=f("base-btn"),p=f("base-input");return t(),n("div",A,[u("div",B,[u("div",N,c(l.$t("urls")),1),e(y),r.view?v("",!0):(t(),m(h,{key:0,color:"primary",icon:"fad fa-circle-plus",label:l.$t("addNew"),flat:"",onClick:i.onAdd},null,8,["label","onClick"]))]),i.noLinks?(t(),n("div",Q,c(l.$t("noUrlsAdded")),1)):v("",!0),e(w,{dense:r.view,class:"q-gutter-y-sm"},{default:a(()=>[(t(!0),n(b,null,g(k.lists,(s,_)=>(t(),m(U,{class:"q-pa-none",key:_},{default:a(()=>[r.view?(t(),m(d,{key:0},{default:a(()=>[e(L,null,{default:a(()=>[u("a",{href:s.url},c(s.label||s.url),9,$)]),_:2},1024)]),_:2},1024)):(t(),n(b,{key:1},[e(d,null,{default:a(()=>[e(p,{modelValue:s.url,"onUpdate:modelValue":o=>s.url=o,placeholder:l.$t("placeholder.url")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1024),e(d,null,{default:a(()=>[e(p,{modelValue:s.label,"onUpdate:modelValue":o=>s.label=o,placeholder:l.$t("placeholder.label")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1024),e(d,{side:""},{default:a(()=>[e(h,{color:"grey",size:"md",flat:"",padding:"14px",icon:"fas fa-trash-can",onClick:o=>i.onRemove(_)},null,8,["onClick"])]),_:2},1024)],64))]),_:2},1024))),128))]),_:1},8,["dense"])])}var S=V(C,[["render",q]]);export{S as U};
