drill.define(async e=>{let t=await e("common/data");const l=()=>{t.splits.forEach(e=>{e.isHandle=!1})};return()=>new Promise(e=>{t.splits.forEach(e=>{e.isHandle=!0});let c,a=$("#sourcePannel .source_con"),n=a.que(".cancelbtn"),o=a.que(".okbtn"),s=$("o-frame").$title.html;$("o-frame").$title.html="请选择资源",$("o-frame").$btns.que("#sourceBtn").ele.click(),$("o-frame").$btns.class.add("unuse"),a.class.add("selected_img_mode");let i,r,m,u,d=()=>{$("o-frame").$title.html=s,setTimeout(()=>{a.class.remove("selected_img_mode"),e(""),l()},300),$("o-frame").$btns.class.remove("unuse"),n.off("click",m),o.off("click",u),a.que(".pic_con").off("click",i).off("dblclick",r)};a.que(".pic_con").on("click",i=(e=>{let{target:t}=e;if(t.is("source-block")||(t=t.parents("source-block")[0]),!t)return c=null,o.attr("disable",""),void(a.que(".selectedTargetName").text="无");c={url:t.path,name:t.name},o.removeAttr("disable"),a.que(".selectedTargetName").text=t.name})),a.que(".pic_con").on("dblclick","source-block",r=(t=>{let{delegateTarget:a}=t;c={url:a.path,name:a.name},d(),$("o-frame").$btns.que("#designBtn").ele.click(),e(c),l()})),n.on("click",m=(e=>{d(),$("o-frame").$btns.que("#designBtn").ele.click()})),o.on("click",u=(t=>{""!=o.attr("disable")&&(d(),$("o-frame").$btns.que("#designBtn").ele.click(),e(c),l())}))})});