import{I as X,k as u,X as J,o as i,A as f,a as e,w as o,e as E,t as C,ax as ge,ae as me,am as Ve,U as H,N as t,af as fe,V as oe,f as Q,b as l,s as U,$ as se,ak as le,bi as Se,F as B,B as Y,c as P,n as Be,d as K,ay as Ae,ag as pe,ah as he,z as Ee,a0 as Fe,K as $e,v as ue,a1 as De,x as Pe,G as O,bq as qe,b2 as je,Z as ke,aJ as Ye,bf as Me,bg as be,Y as We,aQ as Ge,M as Ie,ab as _e,aN as we,aO as Ce}from"./index-DZAIUlH9.js";import{_ as Je}from"./TitleBreadcrumb.vue_vue_type_style_index_0_lang-Dg3uU2Xc.js";import{f as ae,o as Ke,a as Te}from"./fileApi-DWjtv1_n.js";import{_ as ee}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{c as Ue}from"./close-BcCOVtMl.js";import{_ as He}from"./close-ju3PyIXP.js";import"./index.esm-CeDA535l.js";const ne=b=>(pe("data-v-4d7358fc"),b=b(),he(),b),Oe={class:"text-align position-relative text-center"},Qe={key:0,class:"pngbg"},Ze={class:"text-medium-emphasis mt-3 pl-4",style:{"font-size":"12px"}},Xe={class:"text-medium-emphasis mt-3 pl-4",style:{"font-size":"12px"}},et={class:"text-medium-emphasis mt-3 pl-4",style:{"font-size":"12px"}},tt={class:"text-medium-emphasis mt-3 pl-4",style:{"font-size":"12px"}},lt=ne(()=>l("h4",null,"Image Title",-1)),at=ne(()=>l("h4",{class:"mt-4"},"Tags",-1)),ot={class:"tag-con mt-4"},st=ne(()=>l("div",{class:"ml-5 text-medium-emphasis",style:{"font-size":"14px"}},"Add a Tag",-1)),nt={class:"d-flex flex-wrap"},it=ne(()=>l("div",{class:"ml-5",style:{"font-size":"14px",width:"92px","white-space":"nowrap"}},"History Tags:",-1)),ct={style:{flex:"1"},class:"d-flex flex-wrap"},dt=["onClick"],rt={class:"flex"},ut={class:"btns mt-3"},gt=ne(()=>l("div",{class:"ml-auto"},null,-1)),mt=X({__name:"EditImage",props:{},emits:["close"],setup(b,{expose:R,emit:I}){const h=I,k=u(!1),r=ae(),A=J({color:"",msg:"",isShow:!1}),g=u(!1);let a=J({}),m=J([]),n=u("");function p(){return new Promise((c,d)=>{const x={fileId:a.id,fileName:a.fileName,tags:a.tags,contentType:"application/json;charset=UTF-8"};r.fileUpdateFileInfo(x).then(j=>{c()})})}function _(c,d){a=c,m=d,g.value=!0}const y=()=>{g.value=!1,h("close")};function T(c){if(a.tags){for(const d of a.tags)if(d===c){A.color="warning",A.msg="This label already exists",A.isShow=!0;return}}else a.tags=[];a.tags.push(c),n.value=""}function V(c){a.tags.splice(c,1)}function v(){let c=a.smallImageUrl.split(".");return c[c.length-1]}function F(){k.value=!0,p().then(c=>{k.value=!1,y()})}function S(c){return c<1024?c+" Bytes":c<1048576?(c/1024).toFixed(2)+" KB":(c/1048576).toFixed(2)+" MB"}return R({openDialog:_,closeDialog:y}),(c,d)=>(i(),f(B,null,[e(ge,{modelValue:A.isShow,"onUpdate:modelValue":d[0]||(d[0]=x=>A.isShow=x),color:A.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:o(()=>[E(C(A.msg),1)]),_:1},8,["modelValue","color"]),e(Ae,{modelValue:g.value,"onUpdate:modelValue":d[5]||(d[5]=x=>g.value=x),width:"50%","min-width":"346px"},{default:o(()=>[e(me,null,{default:o(()=>[e(Ve,{class:"d-flex align-center pt-3 pb-3"},{default:o(()=>[E("Edit Image "),e(H,{src:t(Ue),width:32,height:32,class:"close",onClick:d[1]||(d[1]=x=>g.value=!1)},null,8,["src"])]),_:1}),e(fe,null,{default:o(()=>[e(oe,{style:{margin:"0"}},{default:o(()=>[e(Q,{lg:"6",cols:"12",style:{background:"#F7F7F7",padding:"0"}},{default:o(()=>[l("div",Oe,[v()=="png"?(i(),f("div",Qe)):U("",!0),e(H,{src:t(a).fileUrl,width:"427px",height:"427px",rounded:"md",inline:""},null,8,["src"])]),l("p",Ze,"Dimensions:"+C(t(a).imageWidth)+"*"+C(t(a).imageHeight),1),l("p",Xe,"Size:"+C(S(t(a).fileSize)),1),l("p",et,"Format:"+C(v()),1),l("p",tt,C(t(a).addDate),1)]),_:1}),e(Q,{lg:"6",cols:"12",style:{background:"#fff"}},{default:o(()=>[lt,e(se,{label:"Image Title",color:"primary",variant:"outlined","hide-details":"",modelValue:t(a).fileName,"onUpdate:modelValue":d[2]||(d[2]=x=>t(a).fileName=x),class:"mt-4",onBlur:p},null,8,["modelValue"]),at,l("div",ot,[e(se,{variant:"outlined",color:"primary",name:"input-7-4",rows:"2","base-color":"#fff",modelValue:t(n),"onUpdate:modelValue":d[3]||(d[3]=x=>le(n)?n.value=x:n=x),onKeyup:d[4]||(d[4]=Se(x=>T(t(n)),["enter"]))},{prepend:o(()=>[st]),_:1},8,["modelValue"]),l("div",nt,[it,l("div",ct,[(i(!0),f(B,null,Y(t(m),(x,j)=>(i(),f("span",{style:{color:"#435099",cursor:"pointer"},class:"ml-2 mb-2 cur",key:j,onClick:w=>T(x.tag)},C(x.tag),9,dt))),128))])])]),l("div",rt,[(i(!0),f(B,null,Y(t(a).tags,(x,j)=>(i(),P(Be,{label:"",closable:"",color:"primary",class:"mt-4 mr-4",key:j,"onClick:close":w=>V(j)},{default:o(()=>[E(C(x),1)]),_:2},1032,["onClick:close"]))),128))]),l("div",ut,[gt,e(K,{color:"primary",loading:k.value,onClick:F},{default:o(()=>[E("Confirm")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),ft=ee(mt,[["__scopeId","data-v-4d7358fc"]]),pt={key:0,class:"tag mt-4"},ht={class:"py-2 pl-3"},vt={class:"ml-2 pr-2"},_t=X({__name:"Tag",props:{item:Object},emits:["addTagBreadcrumb","getImgList","initPage"],setup(b,{emit:R}){const I=R,h=b;let k=u("");const r=ae();function A(n){I("addTagBreadcrumb",n)}function g(n){k.value=n.tag,n.unshow=!n.unshow}function a(n){const p={oldTag:k.value,newTag:n.tag};r.tagRename(p).then(_=>{_.code===200&&(n.unshow=!n.unshow,I("initPage"))})}function m(n){const p={tag:n.tag};r.tagRemove(p).then(_=>{_.code===200&&I("initPage")})}return(n,p)=>{const _=O("DotsVerticalIcon");return i(),f(B,null,[h.item.unshow?U("",!0):(i(),f("div",pt,[l("div",{style:{display:"inline-block"},onClick:p[0]||(p[0]=y=>A(h.item.tag))},[l("a",ht,C(h.item.tag),1),l("span",vt,C(h.item.num),1)]),e(De,{"close-on-content-click":!0,location:"bottom"},{activator:o(({props:y})=>[l("span",Ee({class:"tag-more d-flex align-center text-center ml-1"},y),[e(_,{size:"16"})],16)]),default:o(()=>[e(Fe,{rounded:"md",elevation:"12"},{default:o(()=>[e($e,null,{default:o(()=>[e(ue,{class:"text-medium-emphasis",link:"",onClick:p[1]||(p[1]=y=>g(h.item))},{default:o(()=>[E(" Rename Tags ")]),_:1}),e(ue,{class:"text-medium-emphasis",link:"",onClick:p[2]||(p[2]=y=>m(h.item))},{default:o(()=>[E(" Archive ")]),_:1})]),_:1})]),_:1})]),_:1})])),h.item.unshow?(i(),f("div",{key:1,style:Pe([{width:h.item.tag.length*10+"px"},{"min-width":"130px"}]),class:"tag-inp mt-4"},[e(se,{label:"Rename Tags",color:"primary",variant:"outlined","hide-details":"","max-width":98,height:"36px",required:"",modelValue:h.item.tag,"onUpdate:modelValue":p[3]||(p[3]=y=>h.item.tag=y),autofocus:!0,onBlur:p[4]||(p[4]=y=>a(h.item))},null,8,["modelValue"])],4)):U("",!0)],64)}}}),Le=ee(_t,[["__scopeId","data-v-518f10d6"]]),At=["id"],yt={style:{color:"#333"}},xt={class:"d-flex flex-wrap"},kt={class:"indexlist"},bt=["onClick"],It=X({__name:"AllTags",emits:["addTagBreadcrumb2"],setup(b,{expose:R,emit:I}){const h=I,k=qe();u(!1);const r=ae();u([]);let A=u([]),g=u([]);function a(){r.tagList().then(y=>{if(y.code===200&&y.data){A.value=y.data;const T=je(y.data);m(T)}})}function m(y){const T={},V=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","#"];V.forEach(v=>{T[v]=[]}),y.forEach(v=>{const F=v.tag.charAt(0).toUpperCase();console.log("firstLetter",F),console.log("firstLetteritem",v),V.includes(F)?T[F].push(v):T["#"].push(v)}),g.value=T,console.log("indexList.value...",g.value)}function n(y){console.log("tagList...",A),h("addTagBreadcrumb2",y)}function p(y){k("#"+y,{offset:-90})}function _(){a()}return R({initPage:_}),a(),(y,T)=>(i(),f(B,null,[(i(!0),f(B,null,Y(t(g),(V,v)=>(i(),f(B,{key:v},[V.length>0?(i(),f("div",{key:0,id:v,class:"mt-5 d-block",style:{"border-bottom":"1px solid #EEF2F6","padding-bottom":"16px"}},[l("h4",yt,C(v),1),l("div",xt,[(i(!0),f(B,null,Y(V,(F,S)=>(i(),f("div",{class:"mr-3",key:S},[e(Le,{item:F,onInitPage:_,onGetImgList:_,onAddTagBreadcrumb:n},null,8,["item"])]))),128))])],8,At)):U("",!0)],64))),128)),l("div",kt,[(i(!0),f(B,null,Y(t(g),(V,v)=>(i(),f(B,{key:v},[V.length>0?(i(),f("a",{key:0,class:"d-block text-h5",style:{color:"#333"},onClick:F=>p(v)},C(v),9,bt)):U("",!0)],64))),128))])],64))}}),wt=ee(It,[["__scopeId","data-v-9c870805"]]),Ct="/assets/none-PDTPEZFH.png",ie=b=>(pe("data-v-4b9bdb88"),b=b(),he(),b),Tt={class:"ml-2",style:{"font-size":"14px"}},Vt=ie(()=>l("h4",{class:"mt-4"},"Tags",-1)),St={class:"tag-con mt-4"},Bt=ie(()=>l("div",{class:"ml-5 text-medium-emphasis",style:{"font-size":"14px"}},"Add a Tag",-1)),Et={class:"d-flex flex-wrap"},Ft=ie(()=>l("div",{class:"ml-5",style:{"font-size":"14px",width:"92px","white-space":"nowrap"}},"History Tags:",-1)),$t={style:{flex:"1"},class:"d-flex flex-wrap"},Dt=["onClick"],Ut={class:"flex"},Lt=ie(()=>l("div",{class:"bt-con"},null,-1)),zt={class:"btns"},Nt=ie(()=>l("div",{class:"ml-auto"},null,-1)),Rt=X({__name:"BatchEditTag",emits:["close"],setup(b,{expose:R,emit:I}){const h=I,k=u(!1),r=ae(),A=J({color:"",msg:"",isShow:!1}),g=u(!1);let a=J({}),m=J([]),n=u(""),p=u([]);function _(){k.value=!0,a.forEach(async S=>{const c={fileId:S.id,fileName:S.fileName,tags:S.tags,contentType:"application/json;charset=UTF-8"};await r.fileUpdateFileInfo(c).then(d=>{k.value=!1})}),T()}function y(S,c){a=S,m=c,g.value=!0}const T=()=>{g.value=!1,h("close")};function V(S){for(const c of a)c.tags||(c.tags=[]),c.tags.push(S);p.value.push(S),n.value=""}function v(S){a.tags.splice(S,1)}function F(){_(),g.value=!1}return R({openDialog:y,closeDialog:T}),(S,c)=>(i(),f(B,null,[e(ge,{modelValue:A.isShow,"onUpdate:modelValue":c[0]||(c[0]=d=>A.isShow=d),color:A.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:o(()=>[E(C(A.msg),1)]),_:1},8,["modelValue","color"]),e(Ae,{modelValue:g.value,"onUpdate:modelValue":c[4]||(c[4]=d=>g.value=d),width:"50%"},{default:o(()=>[e(me,null,{default:o(()=>[e(Ve,{class:"d-flex align-center pt-3 pb-3"},{default:o(()=>[E("Edit Image "),e(H,{src:t(Ue),width:32,height:32,class:"close",onClick:c[1]||(c[1]=d=>g.value=!1)},null,8,["src"])]),_:1}),e(fe,null,{default:o(()=>[e(oe,null,{default:o(()=>[e(Q,{cols:"6",class:"pt-4",style:{background:"#F7F7F7"}},{default:o(()=>[(i(!0),f(B,null,Y(t(a),(d,x)=>(i(),f("div",{class:"d-flex align-center mb-3",key:x},[e(H,{src:d.smallImageUrl,width:60,height:60,rounded:"",inline:""},null,8,["src"]),l("p",Tt,C(d.fileName),1)]))),128))]),_:1}),e(Q,{cols:"6",style:{background:"#fff"}},{default:o(()=>[Vt,l("div",St,[e(se,{variant:"outlined",color:"primary",name:"input-7-4",rows:"2","base-color":"#fff",modelValue:t(n),"onUpdate:modelValue":c[2]||(c[2]=d=>le(n)?n.value=d:n=d),onKeyup:c[3]||(c[3]=Se(d=>V(t(n)),["enter"]))},{prepend:o(()=>[Bt]),_:1},8,["modelValue"]),l("div",Et,[Ft,l("div",$t,[(i(!0),f(B,null,Y(t(m),(d,x)=>(i(),f("span",{style:{color:"#435099",cursor:"pointer"},class:"ml-2 mb-2 cur",key:x,onClick:j=>V(d.tag)},C(d.tag),9,Dt))),128))])])]),l("div",Ut,[(i(!0),f(B,null,Y(t(p),(d,x)=>(i(),P(Be,{label:"",closable:"",color:"primary",class:"mt-4 mr-4",key:x,"onClick:close":j=>v(x)},{default:o(()=>[E(C(d),1)]),_:2},1032,["onClick:close"]))),128))]),Lt,l("div",zt,[Nt,e(K,{color:"primary",loading:k.value,onClick:F},{default:o(()=>[E("Confirm")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),Pt=ee(Rt,[["__scopeId","data-v-4b9bdb88"]]),qt={class:"d-flex align-center text-h3",style:{color:"#1F1F1F","font-weight":"500"}},jt={class:"btnleft"},Yt={class:"btnright"},Mt=X({__name:"ImageScaleDialog",setup(b,{expose:R}){let I=u(!1),h=u(0),k=u([]);function r(a,m){I.value=!0,h.value=a,k.value=m}const A=()=>{I.value=!1};function g(a){a=="left"?h.value>0&&h.value--:a=="right"&&h.value!=k.value.length-1&&h.value++}return R({openDialog:r,closeDialog:A}),(a,m)=>{const n=O("ChevronLeftIcon"),p=O("ChevronRightIcon");return i(),P(Ae,{modelValue:t(I),"onUpdate:modelValue":m[3]||(m[3]=_=>le(I)?I.value=_:I=_),"max-width":860},{default:o(()=>[e(me,null,{default:o(()=>[e(fe,null,{default:o(()=>[l("div",qt,[E("Image "),l("img",{src:He,width:32,height:32,class:"close",onClick:m[0]||(m[0]=_=>le(I)?I.value=!1:I=!1)})]),e(H,{alt:"product",src:t(k)[t(h)].fileUrl,"max-height":"625",class:"mt-5"},null,8,["src"]),l("div",jt,[e(K,{icon:"",variant:"text",onClick:m[1]||(m[1]=_=>g("left"))},{default:o(()=>[e(n,{size:"25","stroke-width":"1.5"})]),_:1})]),l("div",Yt,[e(K,{icon:"",variant:"text",onClick:m[2]||(m[2]=_=>g("right"))},{default:o(()=>[e(p,{size:"25","stroke-width":"1.5"})]),_:1})])]),_:1})]),_:1})]),_:1},8,["modelValue"])}}}),Wt=ee(Mt,[["__scopeId","data-v-e3b6b147"]]),Gt=b=>(pe("data-v-dde8126d"),b=b(),he(),b),Jt=Gt(()=>l("h3",{class:"mt-6"},"Images",-1)),Kt={class:"d-flex align-center mt-4"},Ht={class:"image-con"},Ot={class:"img-card"},Qt={class:"imgs d-flex align-center justify-center",style:{height:"187px"}},Zt={class:"img-card"},Xt={class:"itemcheck"},el={class:"imgs"},tl={key:0,class:"pngbg"},ll={class:"img-info d-flex"},al={class:"text-truncate",style:{width:"129px"}},ol={style:{"font-size":"12px"},class:"text-medium-emphasis mt-1"},sl={class:"ml-auto"},nl=X({__name:"ImageList",props:{searchValue:String,activeType:Number},emits:["addTagBreadcrumb","editImage"],setup(b,{expose:R,emit:I}){const h=b,k=I,r=J({color:"",msg:"",isShow:!1});let A=u(!1),g=u(!1),a=u(!1);const m=ae();let n=u([]),p=u([]),_=J({current:1,total:50,size:40,fileType:1,tagStatus:null,tag:null,fileName:""}),y=u(null),T=u(1),V=u(0);ke(()=>h.activeType,s=>{_.tagStatus=s,v()}),ke(T,s=>{console.log("分页....",s),_.current=s,v()});function v(){A.value=!0,m.filePage(_).then(s=>{A.value=!1,s.code===200&&s.data.records&&(n.value=s.data.records,_.total=s.data.total%s.data.size==0?s.data.total/s.data.size:Math.floor(s.data.total/s.data.size)+1)})}function F(){m.tagList({}).then(s=>{s.code===200&&s.data&&(A.value=!1,p.value=s.data)})}function S(s){y.value.openDialog(s,p.value)}function c(s){m.removeFile({fileId:s}).then(N=>{N.code===200&&(n.value=n.value.filter(ve=>ve.id!==s),r.isShow=!0,r.color="success",r.msg="Delete Success")})}let d=u(null);function x(){d.value.openDialog()}async function j(){for(let s=0;s<n.value.length;s++)n.value[s].checked&&await c(n.value[s].id);d.value.closeDialog(),a.value=!1,g.value=!1}function w(){let s=0;n.value.forEach(N=>{N.checked&&(s=s+1)}),s===n.value.length?g.value=!0:(s>0?a.value=!0:a.value=!1,g.value=!1)}function $(){!g.value&&a.value==!0||g.value==!1&&a.value==!1?(n.value.forEach(s=>{s.checked=!0}),g.value=!0,a.value=!1):(n.value.forEach(s=>{s.checked=!1}),g.value=!1,a.value=!1)}let z=u(null);function W(){let s=[];n.value.forEach(N=>{N.checked&&s.push(N)}),z.value.openDialog(s,p.value)}function M(s){_.tag=s,v()}function q(){F(),v(),k("editImage")}function L(){_.tag="",v(),k("addTagBreadcrumb","")}function G(s){_.fileName=s,v()}function Z(s){return console.log("getFileFormat...",s.split(".").pop().toLowerCase()),s.split(".").pop().toLowerCase()}function ce(s){V.value=s}function xe(s){return V.value}let de=u(null);function ze(s){de.value.openDialog(s,n.value)}function Ne(s){let N=s.split(".");return N[N.length-1]}function Re(){F(),v()}return F(),v(),R({getImageList:v,allImage:L,searchList:G,setLoading:ce,getLoading:xe,handleTag:M,initPage:Re}),(s,N)=>{const ve=O("DotsVerticalIcon");return i(),f(B,null,[e(Ye,{isShow:t(A)},null,8,["isShow"]),e(Me,{ref_key:"tipDialog",ref:d,title:"Archive",message:"Are you sure to archive the selected pictures?",onReflash:j},null,512),e(ge,{modelValue:r.isShow,"onUpdate:modelValue":N[0]||(N[0]=D=>r.isShow=D),color:r.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:o(()=>[E(C(r.msg),1)]),_:1},8,["modelValue","color"]),e(ft,{ref_key:"refEditImage",ref:y,onClose:q},null,512),e(Pt,{ref_key:"refBatchEditTag",ref:z,onClose:q},null,512),e(Wt,{ref_key:"refImageScaleDialog",ref:de},null,512),Jt,l("div",Kt,[e(be,{"model-value":t(g),indeterminate:t(a),color:"secondary",label:"Select All","hide-details":"",onClick:$},null,8,["model-value","indeterminate"]),t(a)||t(g)?(i(),P(K,{key:0,color:"secondary",class:"ml-4",onClick:W},{default:o(()=>[E("Add Tags")]),_:1})):U("",!0),t(a)||t(g)?(i(),P(K,{key:1,color:"secondary",class:"ml-4",onClick:x},{default:o(()=>[E("Archive")]),_:1})):U("",!0)]),l("div",Ht,[t(n).length!=0?(i(),P(oe,{key:0,class:"mt-2"},{default:o(()=>[(i(!0),f(B,null,Y(t(V),(D,re)=>(i(),P(Q,{cols:"12",md:"3",lg:"2",key:re},{default:o(()=>[l("div",Ot,[l("div",Qt,[e(We,{color:"secondary",size:"35",indeterminate:""})])])]),_:2},1024))),128)),(i(!0),f(B,null,Y(t(n),(D,re)=>(i(),P(Q,{cols:"12",md:"3",lg:"2",key:re},{default:o(()=>[l("div",Zt,[l("div",Xt,[e(be,{modelValue:D.checked,"onUpdate:modelValue":[te=>D.checked=te,w],color:"secondary","hide-details":""},null,8,["modelValue","onUpdate:modelValue"])]),l("div",el,[Ne(D.fileUrl)=="png"?(i(),f("div",tl)):U("",!0),e(H,{src:D.smallImageUrl,crossorigin:"anonymous",height:"187px",class:"w-100",onClick:te=>ze(re)},null,8,["src","onClick"])]),l("div",ll,[l("div",null,[l("h4",al,C(D.fileName)+"."+C(Z(D.smallImageUrl)),1),l("p",ol,C(D.imageWidth)+" * "+C(D.imageHeight),1)]),l("div",sl,[e(De,{"close-on-content-click":!0,location:"bottom"},{activator:o(({props:te})=>[e(K,Ee({icon:"",variant:"text",ref_for:!0},te),{default:o(()=>[e(ve,{size:"20","stroke-width":"1.5"})]),_:2},1040)]),default:o(()=>[e(Fe,{rounded:"md",elevation:"12"},{default:o(()=>[e($e,null,{default:o(()=>[e(ue,{class:"text-medium-emphasis",link:"",onClick:te=>S(D)},{default:o(()=>[E(" Edit ")]),_:2},1032,["onClick"]),e(ue,{class:"text-medium-emphasis",link:"",onClick:te=>c(D.id)},{default:o(()=>[E(" Archive ")]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)])])])]),_:2},1024))),128))]),_:1})):U("",!0),t(n).length==0&&!t(A)?(i(),P(oe,{key:1,class:"pb-15"},{default:o(()=>[e(H,{src:t(Ct),width:"195px",height:"174px"},null,8,["src"])]),_:1})):U("",!0),t(A)?U("",!0):(i(),P(Ge,{key:2,"active-color":"primary",modelValue:t(T),"onUpdate:modelValue":N[1]||(N[1]=D=>le(T)?T.value=D:T=D),length:t(_).total,"total-visible":7},null,8,["modelValue","length"]))])],64)}}}),il=ee(nl,[["__scopeId","data-v-dde8126d"]]),cl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAspJREFUWEftmF1y0zAQx7VJ/F5OgJhYnjzCDZoT0JwAcgK4QdMTtJyA9gSUE5AbwLM/JuYE+DEzsr2wHsmjCjuWSWtnmPopE9mrn/77Ia2AnfgDJ87H/m9AzjmfzWb8kBcAIIui6Me/eqq3govFgud5/gEA3jPGzhwnThljWynlVZqm9Nv56QUYBME7RLzpAWaDZGVZrpMkuXcldAacz+cXk8nkizaMiFsAuEPEg4oAAEfEtwBwob8l9cMwvHOBdAIktxZF8V0plyHiKo7jrcsE+h21wM/ahpTyjYu7nQCFEGSYYo6VZbnq4yJzEb7vnwPAN2XnU5IkH7sW6Qq4Y4xxAPgahmHtqi7jTeNCCAI8Z4xRdr/ostEJKIR4zRgj99KzjqLotsuoHuecV1mepmmm/xNCkCfIIyzPc77b7X4eLFNdk5luQcSlGXtqMtYErRZGamUq3irIQ/aaWDoVbDNI6nie94uMAsAmDMMrQyVSneBIwXQUQIIRQpDrCaaGNJQjOFJtae4kgylIUEpFUqqC/KMYFXG9w/wFN6iLzUTwPM+EpKFGuFEA7UkV+G0UReumoB/UxSoOzYSomezE0QODAtoJQVsgAFzbiWMqORigShDKYjoP1jFnJ46t5BiAVE4elBIb0twxBgPUZcbeyqzsvkHEl3EcL0eJwa5t8iSyuC/koC7uCzdaoe4D+qxgWy+iijYV6TMp5aqt3xhFwSAILhFxY7r6lLY6Or7r45YdjnRYXZpqDqZgg2p0vbGeTqdZURR0/KqvREw1nxyQ7lpU01OrhohXcRw/cLHv+xsAuDQkrdSkuxzdeto9TlM16NWTAMA9IpptZ6Va2+WQavhtNWsbjw5orrBJtbZ62KBm9epTAR5UrQ2ySc1HATTbyz6quagppXzVdT/TGYM0Ea1+v99n5g1Bn+3NfrePPSfAY2CO/fYZ8FgFfwOMibRHR8CMbAAAAABJRU5ErkJggg==",dl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAuRJREFUWEftmE9SGkEUxr8eUq6xBFJZBW+gN2hOEDlB9ATJUiYLYSFSlUXICdAThFwg9A3wBjGrVBTLKa1YBoru5DEMNM3I9BAYqESWdM/rX3/fe/2PYc1/bM358G8DfueH+WdAfpYLCn0vJ96fz+tUbAV9KPbGgbOvoNI2AzPgQgGiB1l5IWoXNt8EfWIBdvi71wyo24KFgHiAOsiIk6YtpDXgD17aS4F9GgdmAuifKWCmIgrIO3BeAdgbf6v2M+LkzAbSCpBs3UCqTcoxwJOQxayoCZsBgj4dXtoDnAb8tPB6kLs2dlsBdrjbALBPg/Whis9jWKRP4oofcgan5f8nP2ZE7W3UJK0Ar7n7laxSkJ+zoqZZFRV+ur3DSy2AcVIxI6qbUREiAS+5u+MA7cGcIQ9yonYaFXRWe4e75AQ5gpTD8ptfjr/N6h8JqNuiIAt67l36gyEnqqHQYe2z4oWBzg14w8vpPro3FPRPkPKWqFb0Aa65e6SAsqlUYoA08DV32wrYMSF1OAacb4nqbgCfKCCpKNFt6ZAEEihHcLe4L2yLurcSQBrUhAxAwuCoLVEFA5ghJNkdHBy8O9xv68qtTMFhLo4KQlNwqnBWoqBZEMMcnCqclShowlFBpJGGWTj6EpRYDhrr4ES1moWj7xiJAZJll7x06sB5eYefRbMgCLKHX3Vqz4jjwkosnmdPTlTBJ0B/n5/9i2vJouP9P4D+wZZ9YFDpLmTxsftGXEcWoqC+YK/VVkeqpYBGcNwy848u7F3Igq5mYgqaqtHxqg8c9CG9DbCWAhs9iegn7qUDKjieqZoCKllRHRzvxzuGW2bAkWb5QE16ywmunuYdJ2wFiJWDgGoCbHTtDFTLiWro45B/4Z9U0wGacvjKsATA8RzDVHtsDbzik2oG/ZYCGKXaY5Bhai4EUD9WxVHNRs0e5HbU+0xkDtJANPsHPHhhd4yorS2sPU48K8B5IBb1zRPg3yr5GwmqfkcOOeDIAAAAAElFTkSuQmCC",ye=b=>(pe("data-v-c76a092e"),b=b(),he(),b),rl={class:"flex-column pa-4 libray-left"},ul=ye(()=>l("span",{class:"ml-3"},"All Files",-1)),gl=ye(()=>l("span",{class:"ml-3"},"All Tags",-1)),ml=["color"],fl={key:0,class:"d-flex align-center mt-6",style:{cursor:"pointer"}},pl={key:0,class:"d-flex align-center"},hl={key:1,class:"d-flex align-center mt-6",style:{cursor:"pointer"}},vl={key:2},_l=ye(()=>l("h3",null,"History Tags",-1)),Al={class:"tag-con d-flex flex-wrap"},yl=X({__name:"Index",setup(b){const R=u([{title:"Design Library",disabled:!0}]),I=ae(),h=J({color:"",msg:"",isShow:!1});let k=u(""),r=u(4);u(null),u(!1);const A=u(null);let g=u(!1);const a=u(null);let m=u(null),n=u([]);function p(){I.tagList({}).then(w=>{w.code===200&&w.data&&(n.value=w.data)})}function _(){A.value.click()}async function y(w){a.value.setLoading(w.target.files.length),g.value=!0,console.log("events...",w.target.files.length),console.log("event...",typeof w.target.files),Object.keys(w.target.files).forEach(async $=>{let z=w.target.files[$];console.log("file...",z);const W=await T(z),{width:M,height:q}=W;console.log("file...",z);const L=Ke();var G=await Te.oss(L.fileSts),Z=Te.getRandomObjectName(G.ossObjectNamePrefix,G.domain,z.name);try{console.log("ossObject...",Z),console.log("oss...",G),await G.client.multipartUpload(Z.objectName,z,{headers:{"Cache-Control":"max-age=360000"}});const ce={fileSize:z.size,fileName:Z.fileName,fileType:1,width:M,height:q,fileUrl:Z.objectUrl,bucketName:G.bucket,objectName:Z.objectName,tags:null};I.submitOssFile2(ce).then(xe=>{g.value=!1,a.value.getImageList();let de=a.value.getLoading();a.value.setLoading(de-1)})}catch{}})}function T(w){return new Promise(($,z)=>{const W=new FileReader;W.onload=function(M){const q=new Image;q.onload=function(){$({width:q.width,height:q.height,imageUrl:M.target.result})},q.onerror=function(L){z(L)},q.src=M.target.result},W.onerror=function(M){z(M)},W.readAsDataURL(w)})}function V(w){a.value.handleTag(""),m.value=null,r.value=w}function v(){m.value=null,a.value.allImage()}function F(w){m.value=w,a.value.handleTag(w)}function S(w){m.value=w,setTimeout(()=>{a.value.handleTag(w)},200)}function c(){a.value.searchList(k.value)}let d=u(null);function x(){p(),r.value==3&&d.value.initPage(),r.value==4&&a.value.initPage()}function j(){p()}return p(),(w,$)=>{const z=O("PhotoIcon"),W=O("BookmarksIcon"),M=O("XIcon"),q=O("ChevronRightIcon");return i(),f(B,null,[l("input",{type:"file",multiple:"",ref_key:"fileInput",ref:A,style:{display:"none"},onChange:y},null,544),e(ge,{modelValue:h.isShow,"onUpdate:modelValue":$[0]||($[0]=L=>h.isShow=L),color:h.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:o(()=>[E(C(h.msg),1)]),_:1},8,["modelValue","color"]),e(Je,{title:"Design Library",breadcrumbs:R.value},null,8,["breadcrumbs"]),e(me,{variant:"outlined"},{default:o(()=>[e(fe,{style:{"background-color":"white","border-radius":"12px"}},{default:o(()=>[e(oe,null,{default:o(()=>[e(Q,{cols:"12",lg:"2"},{default:o(()=>[l("div",rl,[e(K,{"prepend-icon":"mdi-cloud-upload-outline",block:"",size:"large",color:"primary",onClick:_},{default:o(()=>[E("Upload Image")]),_:1}),e(Ie,{class:"my-6"}),l("div",{style:{height:"44px",cursor:"pointer"},class:_e(["d-flex align-center mb-2",t(r)==4?"activeType":""]),onClick:$[1]||($[1]=L=>V(4))},[e(z,{"stroke-width":"1.5",color:t(r)==4?"#EC407A":""},null,8,["color"]),ul],2),l("div",{style:{height:"44px",cursor:"pointer"},class:_e(["d-flex align-center mb-2",t(r)==3?"activeType":""]),onClick:$[2]||($[2]=L=>V(3))},[e(W,{"stroke-width":"1.5",color:t(r)==3?"#EC407A":""},null,8,["color"]),gl],2),l("div",{style:{height:"44px",cursor:"pointer"},class:_e(["d-flex align-center mb-2",t(r)==1?"activeType":""]),onClick:$[3]||($[3]=L=>V(1))},[t(r)==1?(i(),P(H,{key:0,src:t(dl),width:25,height:25,inline:""},null,8,["src"])):(i(),P(H,{key:1,src:t(cl),width:25,height:25,inline:""},null,8,["src"])),l("span",{class:"ml-3",color:t(r)==1?"#EC407A":""},"No Tags",8,ml)],2)])]),_:1}),e(Q,{cols:"12",lg:"10"},{default:o(()=>[e(se,{modelValue:t(k),"onUpdate:modelValue":$[4]||($[4]=L=>le(k)?k.value=L:k=L),"persistent-placeholder":"",placeholder:"Search by Name",color:"primary",variant:"outlined","hide-details":"","prepend-inner-icon":"mdi-magnify",onBlur:c},{"append-inner":o(()=>[e(K,{color:"lighterror",icon:"",rounded:"sm",variant:"flat",size:"small",class:"text-error SearchSetting ml-3 d-block d-lg-none"},{default:o(()=>[e(M,{"stroke-width":"1.5",size:"20"})]),_:1})]),_:1},8,["modelValue"]),t(r)==4||t(r)==3?(i(),f("h3",fl,[l("div",{class:"d-flex align-center",onClick:v},[E(C(t(r)==3?"All Tags":"All Files"),1),t(m)?(i(),P(q,{key:0,"stroke-width":"1.5"})):U("",!0)]),t(m)?(i(),f("div",pl,C(t(m)),1)):U("",!0)])):U("",!0),t(r)==1?(i(),f("h3",hl," No Tags ")):U("",!0),e(Ie,{class:"my-6"}),(t(r)==4||t(r)==3)&&!t(m)?(i(),f("div",vl,[_l,l("div",Al,[(i(!0),f(B,null,Y(t(n),(L,G)=>(i(),f("div",{class:"mr-3",key:G},[e(Le,{item:L,onAddTagBreadcrumb:F,onInitPage:x},null,8,["item"])]))),128))])])):U("",!0),we(l("div",null,[e(il,{ref_key:"refImageList",ref:a,activeType:t(r),onAddTagBreadcrumb:F,onEditImage:j},null,8,["activeType"])],512),[[Ce,t(r)==4||t(r)==1||t(r)==3&&t(m)]]),we(l("div",null,[e(wt,{ref_key:"refAlltags",ref:d,onAddTagBreadcrumb2:S},null,512)],512),[[Ce,t(r)==3&&!t(m)]])]),_:1})]),_:1})]),_:1})]),_:1})],64)}}}),Vl=ee(yl,[["__scopeId","data-v-c76a092e"]]);export{Vl as default};