var c=(a,s,i)=>new Promise((t,n)=>{var o=r=>{try{u(i.next(r))}catch(x){n(x)}},e=r=>{try{u(i.throw(r))}catch(x){n(x)}},u=r=>r.done?t(r.value):Promise.resolve(r.value).then(o,e);u((i=i.apply(a,s)).next())});import{u as d,cj as f,a4 as w,cR as T,cz as C,cQ as l,an as p,al as g,cS as y,cT as A,cP as D}from"./index.6c36cb53.js";const{isShow:B,showDialog:M,confirm:S,onReveal:h}=d(),E=()=>c(void 0,null,function*(){const a=new w;a.setMessage("\u6307\u5B9A\u6587\u5B57\u8D77\u70B9:"),a.setCursorType(T.kCross);const s=yield a.go();if(!s)return;let i=new C;i.setMessage("\u6307\u5B9A\u6587\u5B57\u9AD8\u5EA6:");let t=yield i.go();if(t===null)return;const n=yield M(!0,{text:"\u6D4B\u8BD5"});if(!n||!n.data)return;const{data:o}=n;let e=new l;e.textString=o.text,e.position=new p(s),e.alignmentPoint=e.position,e.height=t,e.rotation=Number(o.angle)*3.14159265/180,g.getCurrentMxCAD().drawEntity(e),g.getCurrentMxCAD().updateDisplay()}),m=()=>c(void 0,null,function*(){let a=new y;a.AddMcDbEntityTypes("TEXT,MTEXT");let s=new A;s.setFilter(a),s.setMessage("\u9009\u62E9\u8981\u7F16\u8F91\u7684\u6587\u5B57");let i=yield s.go();if(!i.isValid())return;let t=i.getMcDbEntity();if(!t)return;let n;if(t instanceof l?n=t.textString:t instanceof D&&(n=t.contents),!n)return;const o=yield M(!0,{text:n});if(!o||!o.data)return;const{data:e}=o;t instanceof l?(t.textString=e.text,t.rotation=Number(e.angle)*3.14159265/180):t instanceof D&&(t.contents=e.text,t.rotation=Number(e.angle)*3.14159265/180),g.getCurrentMxCAD().updateDisplay()});f("Mx_EditText",m);f("_DrawText",()=>{E()});export{S as c,B as i,h as o,M as s};