var y=(t,e,a)=>new Promise((o,s)=>{var l=n=>{try{r(a.next(n))}catch(i){s(i)}},f=n=>{try{r(a.throw(n))}catch(i){s(i)}},r=n=>n.done?o(n.value):Promise.resolve(n.value).then(l,f);r((a=a.apply(t,e)).next())});import{M as A}from"./index-00445133.js";import{u as K,i as E}from"./chartEditStore-87bc983c.js";import{u as B,a as T}from"./chartLayoutStore-d35ca544.js";import{b5 as $,cD as k,cE as M,b as N,d as G,O as I,r as b,cC as P,o as p,c as g,F as R,q as U,p as _,f as u,u as v,w as d,g as x,t as D,a3 as z,am as H,cF as V}from"./index-3da848c6.js";import{a as Y,b as q,l as J}from"./plugin-3ade9cd9.js";import{c as m}from"./index-e07d20ac.js";import{_ as Q,h as W,i as F,j as X,k as Z,f as O,a as S,c as j}from"./index-5ea60806.js";import{_ as ee}from"./_arrayMap-23a2d4b9.js";import"./icon-42e1d81a.js";import"./theme-color-0deb5eeb.js";import"./tables_list-7cb7cb60.js";import"./http-5398a097.js";import"./SettingItemBox-6900e67c.js";/* empty css                                                                   */import"./CollapseItem-95d54d26.js";function te(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var ae=te;function ne(t,e,a){var o=-1,s=t.length;e<0&&(e=-e>s?0:s+e),a=a>s?s:a,a<0&&(a+=s),s=e>a?0:a-e>>>0,e>>>=0;for(var l=Array(s);++o<s;)l[o]=t[o+e];return l}var se=ne,re=Q,oe=se;function le(t,e){return e.length<2?t:re(t,oe(e,0,-1))}var ie=le,ce=F,ue=ae,_e=ie,de=W;function me(t,e){return e=ce(e,t),t=_e(t,e),t==null||delete t[de(ue(e))]}var fe=me,pe=X;function ge(t){return pe(t)?void 0:t}var ve=ge,he=ee,Ce=M,ye=fe,Ee=F,be=$,xe=ve,De=Z,Oe=k,Se=1,Fe=2,Le=4,we=De(function(t,e){var a={};if(t==null)return a;var o=!1;e=he(e,function(l){return l=Ee(l,t),o||(o=l.length>1),l}),be(t,Oe(t),a),o&&(a=Ce(a,Se|Fe|Le,xe));for(var s=e.length;s--;)ye(a,e[s]);return a}),Ae=we;const Ke=["onDragstart","onDblclick"],Be={class:"list-header"},Te={class:"list-center go-flex-center"},$e={class:"list-img",alt:"\u56FE\u8868\u56FE\u7247"},ke={class:"list-bottom"},Me=G({__name:"index",props:{menuOptions:{type:Array,default:()=>[]}},setup(t){const e=K(),a=B(),o=I(()=>a.getChartType),s=(r,n)=>{m(n.chartKey,O(n)),m(n.conKey,S(n)),r.dataTransfer.setData(V.DRAG_KEY,JSON.stringify(Ae(n,["image"]))),e.setEditCanvas(E.IS_CREATE,!0)},l=()=>{e.setEditCanvas(E.IS_CREATE,!1)},f=r=>y(this,null,function*(){try{Y(),m(r.chartKey,O(r)),m(r.conKey,S(r));let n=yield j(r);e.addComponentList(n,!1,!0),e.setTargetSelectChart(n.id),q()}catch(n){J(),window.$message.warning("\u56FE\u8868\u6B63\u5728\u7814\u53D1\u4E2D, \u656C\u8BF7\u671F\u5F85...")}});return(r,n)=>{const i=b("n-ellipsis"),h=b("n-text"),L=P("lazy");return p(),g("div",{class:H(["go-content-charts-item-box",{double:v(o)===v(T).DOUBLE}])},[(p(!0),g(R,null,U(t.menuOptions,(c,w)=>(p(),g("div",{class:"item-box",key:w,draggable:"",onDragstart:C=>s(C,c),onDragend:l,onDblclick:C=>f(c)},[_("div",Be,[u(v(A),{class:"list-header-control-btn",mini:!0,disabled:!0}),u(h,{class:"list-header-text",depth:"3"},{default:d(()=>[u(i,null,{default:d(()=>[x(D(c.title),1)]),_:2},1024)]),_:2},1024)]),_("div",Te,[z(_("img",$e,null,512),[[L,c.image]])]),_("div",ke,[u(h,{class:"list-bottom-text",depth:"3"},{default:d(()=>[u(i,{style:{"max-width":"90%"}},{default:d(()=>[x(D(c.title),1)]),_:2},1024)]),_:2},1024)])],40,Ke))),128))],2)}}});var je=N(Me,[["__scopeId","data-v-2869e04e"]]);export{je as default};
