/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./ImageUploadButton.css');const e=require("vue"),t=require("./basic/MediaUploadModal.vue.js");;/* empty css                        */const a=require("../../../_virtual/_plugin-vue_export-helper.js"),l=["disabled"],i={__name:"ImageUploadButton",props:{editor:{type:Object,required:!0},disabled:{type:Boolean,default:!1}},setup(a){const i=a,d=e.ref(!1),o=()=>{d.value=!0},s=()=>{d.value=!1},r=()=>{d.value=!1},n=e=>{const[t]=e.target.files||[];t&&((e,t)=>{const a=new FileReader;a.onload=e=>{t(e.target?.result||"")},a.readAsDataURL(e)})(t,e=>{(e=>{e&&i.editor?.chain().focus().setImage({src:e}).run()})(e)}),e.target.value=""};return(u,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("button",{title:"Image",class:e.normalizeClass([a.disabled?"is-disabled":""]),disabled:a.disabled,onClick:o},[e.createElementVNode("span",{class:e.normalizeClass(["icon","i-ant-design:picture-outlined"]),style:{width:"18px",height:"18px"}})],10,l),e.createElementVNode("input",{type:"file",accept:"image/*",class:"hidden",onChange:n},null,32),e.createVNode(t.default,{visible:d.value,"onUpdate:visible":c[0]||(c[0]=e=>d.value=e),title:"Add Image","media-type":"image",editor:i.editor,onCancel:s,onOk:r},null,8,["visible","editor"])],64))}},d=a.default(i,[["__scopeId","data-v-e1bc87c3"]]);exports.default=d;