import{b as s}from"./qrcode.9a9f3873.js";import{d,r as c,w as m,h as l}from"./@vue.96c135a1.js";const p=["low","medium","quartile","high","L","M","Q","H"],g=[0,1,2,3,4,5,6,7],b=["alphanumeric","numeric","kanji","byte"],y=["image/png","image/jpeg","image/webp"],S=40,N=d({props:{version:{type:Number,validator:e=>e===Number.parseInt(String(e),10)&&e>=1&&e<=S},errorCorrectionLevel:{type:String,validator:e=>p.includes(e)},maskPattern:{type:Number,validator:e=>g.includes(e)},toSJISFunc:Function,margin:Number,scale:Number,width:Number,color:{type:Object,validator:e=>["dark","light"].every(r=>["string","undefined"].includes(typeof e[r])),required:!0},type:{type:String,validator:e=>y.includes(e),required:!0},quality:{type:Number,validator:e=>e===Number.parseFloat(String(e))&&e>=0&&e<=1,required:!1},value:{type:[String,Array],required:!0,validator(e){return typeof e=="string"?!0:e.every(r=>typeof r.data=="string"&&"mode"in r&&r.mode&&b.includes(r.mode))}}},setup(e,{attrs:r,emit:a}){const n=c();return m(e,()=>{const{quality:o,value:i,...u}=e;s.toDataURL(i,Object.assign(u,o==null||{renderOptions:{quality:o}})).then(t=>{n.value=t,a("change",t)}).catch(t=>a("error",t))},{immediate:!0}),()=>l("img",{...r,src:n.value})}});export{N as t};
