import{d as k,b as f,s as B,x as L,c as K,a as i,h as y,C as p,u as x,t as g,m as d,o as M,_ as Z,a3 as q,a4 as z}from"./_plugin-vue_export-helper-0830d71a.js";import I from"./drag-arrow-9d4f3f57.js";import N from"./active-drag-arrow-20a39f55.js";const T={tuoZhuai:"拖拽到此保存",songKai:"松开完成保存",baoCun:"保存文字、链接、图片至 Boardmix 素材库"},j={tuoZhuai:"Drag and drop here to save",songKai:"Release to save",baoCun:"Save text, URLs, and images to Boardmix resource library."},H={tuoZhuai:"ここにドラッグして保存します",songKai:"放して保存を完了します",baoCun:"Boardmix素材中継所への文字、リンク、画像の保存"},P={tuoZhuai:"드래그하여 저장하기",songKai:"풀어서 저장하기",baoCun:"텍스트, 링크, 이미지를 Boardmix 소재 라이브러리에 저장하기"},R=["onDragenter","onDragover","onDragleave","onDrop"],U={class:"bm-plugin-drag-top-content"},V={class:"bm-plugin-drag-bottom"},J={style:{opacity:"0.33",color:"white","font-size":"12px","max-width":"288px"}},O=k({__name:"DragArea",setup(G){const u=f(void 0),D={zh:T,en:j,ja:H,ko:P};function m(l){u.value=D[l.detail]}B(()=>{window.addEventListener("bmp-plugin-lang-update",m)}),L(()=>{window.removeEventListener("bmp-plugin-lang-update",m)});const n=f(!1),A=()=>{n.value=!0},C=()=>{},v=()=>{n.value=!1},E=l=>new Promise((c,s)=>{l.getAsString(e=>{c(e)})}),S=async l=>{var b,_;v();const c=l.dataTransfer.items;let s;for(let r=0;r<c.length;r++){const t=c[r];t.kind==="string"&&t.type.match("^text/html")&&(s=t)}let e,o,h;if(s){const r=await E(s),t=document.createElement("div");if(t.innerHTML=r,t.querySelectorAll(":scope > a").length>0){const a=t.querySelectorAll(":scope > a");a.length>0&&((b=a[0].href)==null?void 0:b.length)>0&&(e="link",o=a[0].href,h=t.textContent)}else if(t.querySelectorAll(":scope > img").length>0){const a=t.querySelectorAll(":scope > img");a.length>0&&((_=a[0].src)==null?void 0:_.length)>0&&(e="image",o=a[0].src)}else{const a=document.createElement("div");a.innerHTML=r,e="text",o=a.textContent}}e&&o&&window.dispatchEvent(new CustomEvent("bm-plugin-drag-finish",{detail:{type:e,content:o,file_name:h}}))};return(l,c)=>{var s,e,o;return M(),K("div",{class:"bm-plugin-drag-container",onDragenter:d(A,["prevent"]),onDragover:d(C,["prevent"]),onDragleave:d(v,["prevent"]),onDrop:d(S,["prevent"])},[i("div",{class:"bm-plugin-drag-top",style:p({backgroundColor:n.value?"rgba(129, 153, 255, 0.2)":"rgba(255, 255, 255, 0.19)",borderColor:n.value?"rgba(109, 126, 255)":"rgba(255, 255, 255, 0.19)"})},[i("div",U,[y(x(I),{class:"bm-plugin-drag-top-arrow",style:p({display:n.value?"none":"block"})},null,8,["style"]),i("span",{class:"bm-plugin-drag-top-tips",style:p({display:n.value?"none":"block"})},g((s=u.value)==null?void 0:s.tuoZhuai),5),y(x(N),{class:"bm-plugin-drag-top-hover-arrow",style:p({display:n.value?"block":"none"})},null,8,["style"]),i("span",{class:"bm-plugin-drag-top-hover-tips",style:p({display:n.value?"block":"none"})},g((e=u.value)==null?void 0:e.songKai),5)])],4),i("div",V,[i("span",J,g((o=u.value)==null?void 0:o.baoCun),1)])],40,R)}}});const F=Z(O,[["__scopeId","data-v-091b8785"]]),w=q(F);w.use(z());w.mount("#bm-plugin-drag-app");
