PageSourceSearch

https://ark.art/static/js/add-brand-BH-3v3W8.js

js ark.art collected 2026-10-09 22:54:47 UTC 24,796 bytes, 1 lines download raw bytes

1var e=Object.defineProperty,a=Object.defineProperties,l=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,r=(a,l,o)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[l]=o,u=(e,a)=>{for(var l in a||(a={}))t.call(a,l)&&r(e,l,a[l]);if(o)for(var l of o(a))n.call(a,l)&&r(e,l,a[l]);return e},i=(e,a)=>{var l={};for(var r in e)t.call(e,r)&&a.indexOf(r)<0&&(l[r]=e[r]);if(null!=e&&o)for(var r of o(e))a.indexOf(r)<0&&n.call(e,r)&&(l[r]=e[r]);return l},s=(e,a,l)=>new Promise((o,t)=>{var n=e=>{try{u(l.next(e))}catch(a){t(a)}},r=e=>{try{u(l.throw(e))}catch(a){t(a)}},u=e=>e.done?o(e.value):Promise.resolve(e.value).then(n,r);u((l=l.apply(e,a)).next())});import{w as d,$ as c,b4 as g,ac as v,aM as p,e8 as h,C as m,gQ as f,er as b,c as y,et as M,es as w,eu as L,iQ as k,m as x,ev as _,iR as C,iS as U,q as R}from"./index-BHKElW5-.js";import{B as q}from"./back-ChF-7oLU.js";import{w as O}from"./runtime-dom.esm-bundler-DyrtEVhK.js";import{R as P,q as j,v as I,x as z,I as S,k as F,c as D,b as B,e as E,n as A,p as H,A as T,B as W,C as Y,u as N,D as X,F as $,E as V,z as Q,G,N as J}from"./runtime-core.esm-bundler-CSn0hs_e.js";import{_ as K}from"./_plugin-vue_export-helper-BCo6x5W8.js";import{as as Z,p as ee,aO as ae,b0 as le,b1 as oe,I as te,r as ne,b2 as re}from"./video-editor-DTVSiof6.js";import{A as ue}from"./app-JYTLOjb3.js";import"./vueuse-CCQysXvv.js";import"./_commonjsHelpers-HLVOKCDG.js";import"./export-tools-BFBXm_DW.js";import"./floating-ui.dom-B-67nXkj.js";import"./konva-BpeUsT-l.js";import"./add-to-unscopables-BZIYrn41.js";const ie={key:0,class:"brand-logo-badge"},se=["src","alt"],de=K(P({__name:"index",props:{src:{default:""},alt:{default:""}},setup(e){const a=e,l=F(()=>/^(data:|blob:)/i.test(a.src)?a.src:d(a.src,500));return(a,o)=>e.src?(j(),I("div",ie,[z("img",{src:l.value,alt:e.alt},null,8,se)])):S("",!0)}}),[["__scopeId","data-v-71b0af67"]]);var ce=Object.defineProperty,ge=(e,a,l)=>((e,a,l)=>a in e?ce(e,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[a]=l)(e,a+"",l);const ve={class:"crop-dialog-content"},pe={class:"crop-workspace"},he={class:"crop-editor"},me={class:"section-heading"},fe=["src","alt"],be={key:2,class:"crop-guides","aria-hidden":"true"},ye={class:"editor-toolbar"},Me={class:"crop-preview-panel"},we={class:"section-heading compact"},Le={key:0,class:"brand-intro-preview"},ke={class:"brand-intro-logo"},xe=["src","alt"],_e={class:"cover-preview-list"},Ce={class:"product-cover-option"},Ue={class:"product-cover product-cover--light"},Re={class:"product-cover-option"},qe={class:"product-cover product-cover--dark"},Oe={class:"crop-note"},Pe={class:"dialog-footer"},je=["accept"],Ie=2097152,ze=4096,Se=K(P({__name:"index",props:{mode:{default:"square"},sourceUrl:{default:""},sourceName:{default:""},initialState:{default:null}},emits:["confirm","cancel"],setup(e,{emit:o}){class t extends Error{constructor(e,a={}){super(e),ge(this,"params"),this.params=a}}const n=e,r=o,i={square:{width:1e3,height:1e3,displayWidth:80,displayHeight:80,safeAreaWidth:840,safeAreaHeight:840},cover:{width:500,height:200,displayWidth:94,displayHeight:38,safeAreaWidth:440,safeAreaHeight:140}},d=D(null),b=D(null),y=D(null),M=D(null),w=D(null),L=D(n.sourceUrl),k=D(""),x=D(""),_=D(0),C=D(0),U=D({left:0,top:0,right:0,bottom:0}),R=D(0),q=D(0),P=D(100),J=D(0),K=D(0),ue=D(!1),ie=D(!1),se=D(!1),ce=D(!1),Se=D(!0),Fe=D({clientX:0,clientY:0,offsetX:0,offsetY:0});let De=null;const Be=F(()=>n.mode),Ee=F(()=>(Be.value,220)),Ae=F(()=>i[Be.value]),He=F(()=>"square"===Be.value?c("ecologyManage.uploadBrandIntroLogo"):c("ecologyManage.uploadBrandCoverLogo")),Te=F(()=>c("ecologyManage.logoOutputDescription",{width:Ae.value.width,height:Ae.value.height,ratio:"square"===Be.value?"1:1":"5:2"})),We=F(()=>c("ecologyManage.logoDisplayDescription",{width:Ae.value.displayWidth,height:Ae.value.displayHeight})),Ye=F(()=>"cover"===Be.value?".png,image/png":".png,.jpg,.jpeg,image/png,image/jpeg"),Ne=F(()=>c("cover"===Be.value?"ecologyManage.brandCoverLogoDialogHelperMain":"ecologyManage.brandLogoDialogHelperMain")),Xe=F(()=>
1{if(!R.value||!q.value)return{left:0,top:0,width:0,height:0,centerX:0,centerY:0};const e=R.value*(Ae.value.safeAreaWidth/Ae.value.width),a=q.value*(Ae.value.safeAreaHeight/Ae.value.height),l=(R.value-e)/2,o=(q.value-a)/2;return{left:l,top:o,width:e,height:a,centerX:l+e/2,centerY:o+a/2}}),$e=F(()=>({left:`${Xe.value.left}px`,top:`${Xe.value.top}px`,width:`${Xe.value.width}px`,height:`${Xe.value.height}px`})),Ve=F(()=>_.value&&C.value&&Xe.value.width&&Xe.value.height?Math.min(Xe.value.width/_.value,Xe.value.height/C.value):1),Qe=F(()=>{const e=Ve.value*(P.value/100);return{width:_.value*e,height:C.value*e,scale:e}}),Ge=F(()=>({left:Xe.value.centerX-Qe.value.width/2+J.value,top:Xe.value.centerY-Qe.value.height/2+K.value,width:Qe.value.width,height:Qe.value.height})),Je=F(()=>({left:`${Ge.value.left}px`,top:`${Ge.value.top}px`,width:`${Ge.value.width}px`,height:`${Ge.value.height}px`})),Ke=F(()=>{const e=Qe.value.scale,a=Xe.value.centerX-Qe.value.width/2,l=Xe.value.centerY-Qe.value.height/2;return{left:a+U.value.left*e,top:l+U.value.top*e,right:a+U.value.right*e,bottom:l+U.value.bottom*e}}),Ze=F(()=>"cover"===Be.value&&se.value&&!Se.value?c("ecologyManage.brandLogoCropTransparentRequired"):""),ea=F(()=>se.value&&!Ze.value&&!ie.value),aa=F(()=>({sourceUrl:L.value,zoom:P.value,offsetX:J.value,offsetY:K.value})),la=()=>{k.value&&(URL.revokeObjectURL(k.value),k.value="")},oa=()=>{y.value&&(R.value=y.value.clientWidth,q.value=y.value.clientHeight)},ta=()=>{const e=Xe.value.left+Xe.value.width,a=Xe.value.top+Xe.value.height,l=e-Ke.value.right,o=Xe.value.left-Ke.value.left,t=a-Ke.value.bottom,n=Xe.value.top-Ke.value.top;J.value=Math.max(Math.min(l,o),Math.min(Math.max(l,o),J.value)),K.value=Math.max(Math.min(t,n),Math.min(Math.max(t,n),K.value))},na=(e,a)=>{const l=M.value;if(!l||!Xe.value.width||!Xe.value.height)return null;const o=document.createElement("canvas");o.width=e,o.height=a;const t=o.getContext("2d");if(!t)return null;const n=Ge.value.width/Math.max(_.value,1);if(!n)return null;const r=(Xe.value.left-Ge.value.left)/n,u=(Xe.value.top-Ge.value.top)/n,i=Xe.value.width/n,s=Xe.value.height/n,d=Math.min(e/i,a/s),c=i*d,g=s*d,v=(e-c)/2,p=(a-g)/2;return t.clearRect(0,0,e,a),t.imageSmoothingEnabled=!0,t.imageSmoothingQuality="high",t.drawImage(l,r,u,i,s,v,p,c,g),o},ra=e=>{const a=e.getContext("2d",{willReadFrequently:!0});if(!a)return!1;const l=a.getImageData(0,0,e.width,e.height).data,o=l.length/4;let t=0;for(let n=3;n<l.length;n+=4)l[n]<250&&(t+=1);return t/o>=.01},ua=()=>{if(!se.value)return x.value="",void(Se.value=!0);try{const e=na(Ae.value.width,Ae.value.height);x.value=(null==e?void 0:e.toDataURL("image/png"))||"",Se.value="cover"!==Be.value||Boolean(e&&ra(e))}catch(e){x.value=L.value,Se.value="cover"!==Be.value}},ia=()=>{P.value=100,J.value=0,K.value=0,A(ua)},sa=e=>{var a,l;se.value&&(ue.value=!0,Fe.value={clientX:e.clientX,clientY:e.clientY,offsetX:J.value,offsetY:K.value},null==(l=null==(a=y.value)?void 0:a.setPointerCapture)||l.call(a,e.pointerId))},da=e=>{ue.value&&(J.value=Fe.value.offsetX+e.clientX-Fe.value.clientX,K.value=Fe.value.offsetY+e.clientY-Fe.value.clientY,ta(),ua())},ca=e=>{var a,l;ue.value&&(ue.value=!1,null==(l=null==(a=y.value)?void 0:a.releasePointerCapture)||l.call(a,e.pointerId),ua())},ga=e=>{se.value&&(P.value=Math.max(40,Math.min(Ee.value,P.value+(e.deltaY>0?-5:5))))},va=e=>s(this,null,function*(){const a="image/png"===e.type||/\.png$/i.test(e.name),l=["image/png","image/jpeg"].includes(e.type),o=/\.(png|jpe?g)$/i.test(e.name);if("cover"===Be.value&&!a)throw new t("ecologyManage.brandCoverLogoPngRequired");if(!l&&!o)throw new t("ecologyManage.brandLogoImageFormatRequired");if(e.size>Ie)throw new t("ecologyManage.brandLogoMaxSizeError");const n=yield(r=e,new Promise((e,a)=>{const l="string"==typeof r?r:URL.createObjectURL(r),o=new Image;o.crossOrigin="anonymous",o.onload=()=>{"string"!=typeof r&&URL.revokeObjectURL(l),e(o)},o.onerror=()=>{"string"!=typeof r&&URL.revokeObjectURL(l),a(new Error("load failed"))},o.src=l}));var r;if(n.width>ze||n.height>ze)throw new t("ecologyManage.brandLogoMaxResolutionError",{max:ze});if("cover"===Be.value&&!(e=>
1{const a=Math.min(1,512/Math.max(e.naturalWidth,e.naturalHeight)),l=document.createElement("canvas");l.width=Math.max(1,Math.round(e.naturalWidth*a)),l.height=Math.max(1,Math.round(e.naturalHeight*a));const o=l.getContext("2d",{willReadFrequently:!0});return!!o&&(o.clearRect(0,0,l.width,l.height),o.drawImage(e,0,0,l.width,l.height),ra(l))})(n))throw new t("ecologyManage.brandCoverLogoTransparentRequired")}),pa=()=>{var e;return null==(e=b.value)?void 0:e.click()},ha=e=>s(this,null,function*(){var a;const l=e.target,o=null==(a=l.files)?void 0:a[0];if(l.value="",o)try{yield va(o),la(),w.value=o,k.value=URL.createObjectURL(o),L.value=k.value,se.value=!1,x.value=""}catch(n){(e=>{e instanceof t?h(e.message,e.params):h("ecologyManage.brandLogoLoadFailed")})(n)}}),ma=e=>s(this,null,function*(){const a=e.currentTarget;_.value=a.naturalWidth,C.value=a.naturalHeight,U.value=(e=>{const a=Math.min(1,1024/Math.max(e.naturalWidth,e.naturalHeight)),l=document.createElement("canvas");l.width=Math.max(1,Math.round(e.naturalWidth*a)),l.height=Math.max(1,Math.round(e.naturalHeight*a));const o=l.getContext("2d",{willReadFrequently:!0});if(!o)return{left:0,top:0,right:e.naturalWidth,bottom:e.naturalHeight};o.clearRect(0,0,l.width,l.height),o.drawImage(e,0,0,l.width,l.height);const t=o.getImageData(0,0,l.width,l.height).data;let n=l.width,r=l.height,u=-1,i=-1;for(let d=0;d<l.height;d+=1)for(let e=0;e<l.width;e+=1)t[4*(d*l.width+e)+3]<10||(e<n&&(n=e),d<r&&(r=d),e>u&&(u=e),d>i&&(i=d));if(u<0||i<0)return{left:0,top:0,right:e.naturalWidth,bottom:e.naturalHeight};const s=1/a;return{left:n*s,top:r*s,right:(u+1)*s,bottom:(i+1)*s}})(a),se.value=Boolean(a.naturalWidth&&a.naturalHeight),yield A(),oa(),(()=>{const e=n.initialState;e&&L.value&&e.sourceUrl===L.value?(P.value=Math.max(40,Math.min(Ee.value,e.zoom||100)),J.value=Number(e.offsetX||0),K.value=Number(e.offsetY||0),A(()=>{ta(),ua()})):ia()})()}),fa=()=>{se.value=!1,x.value="",h("ecologyManage.brandLogoLoadFailed")},ba=e=>s(this,null,function*(){var a;const l=new FormData;l.append("file",e);const o=yield m(l,f),n=String((null==(a=null==o?void 0:o.data)?void 0:a.temporaryUrl)||"").trim();if(200===(null==o?void 0:o.code)&&n)return n;if(null==o?void 0:o.msg)throw new Error(o.msg);throw new t("ecologyManage.brandLogoCropUploadFailed")}),ya=()=>s(this,null,function*(){var e,o;if(ea.value){ie.value=!0;try{const c=yield new Promise((e,a)=>{try{const l=na(Ae.value.width,Ae.value.height);if(!l)return void a(new t("ecologyManage.brandLogoCropUploadFailed"));if("cover"===Be.value&&!ra(l))return void a(new t("ecologyManage.brandLogoCropTransparentRequired"));l.toBlob(l=>{if(!l)return void a(new t("ecologyManage.brandLogoCropUploadFailed"));const o="square"===Be.value?"brand-logo-square":"brand-logo-cover";e(new File([l],`${o}-${Date.now()}.png`,{type:"image/png"}))},"image/png")}catch(l){a(new t("ecologyManage.brandLogoCropUploadFailed"))}});if(c.size>Ie)throw new t("ecologyManage.brandLogoMaxSizeError");const g=w.value?ba(w.value):Promise.resolve(n.sourceUrl||L.value),[v,p]=yield Promise.all([ba(c),g]);ce.value=!0,r("confirm",{logoUrl:v,originalUrl:p,cropState:(i=u({},aa.value),s={sourceUrl:p||aa.value.sourceUrl},a(i,l(s)))}),null==(o=null==(e=d.value)?void 0:e.close)||o.call(e)}catch(c){c instanceof t?h(c.message,c.params):h(c instanceof Error?c.message:"ecologyManage.brandLogoCropUploadFailed")}finally{ie.value=!1}var i,s}}),Ma=()=>{var e,a;return null==(a=null==(e=d.value)?void 0:e.close)?void 0:a.call(e)},wa=()=>{ce.value||r("cancel")};return B(P,()=>{A(()=>{ta(),ua()})}),E(()=>s(this,null,function*(){var e,a;null==(a=null==(e=d.value)?void 0:e.show)||a.call(e),yield A(),oa(),y.value&&"undefined"!=typeof ResizeObserver&&(De=new ResizeObserver(()=>{oa(),ta(),ua()}),De.observe(y.value))})),H(()=>{null==De||De.disconnect(),la()}),(a,l)=>(j(),T(p,{ref_key:"dialogRef",ref:d,size:"big",title:He.value,class:"brand-logo-crop-dialog","show-close":!ie.value,"close-on-click-modal":!1,"close-on-press-escape":!ie.value,onClose:wa},{default:W(()=>[z("div",ve,[z("div",pe,[z("section",he,[z("div",me,[z("div",null,[z("strong",null,Y(N(c)("ecologyManage.adjustCropArea")),1),z("span",null,Y(Te.value),1)]),L.value?(j(),T(N(g),{key:0,t
1ype:"info",onClick:ia},{default:W(()=>[X(N(Z),{size:14}),$(Y(N(c)("ecologyManage.resetCrop")),1)]),_:1})):S("",!0)]),z("div",{ref_key:"cropStageRef",ref:y,class:V(["crop-stage checkerboard",[`crop-stage--${Be.value}`,{"crop-stage--empty":!L.value}]]),onPointerdown:sa,onPointermove:da,onPointerup:ca,onPointercancel:ca,onWheel:O(ga,["prevent"])},[L.value?(j(),I("img",{key:0,ref_key:"sourceImageRef",ref:M,src:L.value,alt:e.sourceName||He.value,crossorigin:"anonymous",draggable:"false",style:Q(Je.value),onLoad:ma,onError:fa},null,44,fe)):(j(),I("button",{key:1,type:"button",class:"empty-upload",onClick:O(pa,["stop"])},[z("span",null,[X(N(ee),{size:22})]),z("strong",null,Y(N(c)("ecologyManage.addBrandLogo")),1),z("small",null,Y(Ne.value),1)])),L.value?(j(),I("div",be,[...l[1]||(l[1]=[z("i",null,null,-1),z("i",null,null,-1),z("i",null,null,-1),z("i",null,null,-1)])])):S("",!0),L.value?(j(),I("div",{key:3,class:"safe-area",style:Q($e.value),"aria-hidden":"true"},[z("span",null,Y(N(c)("ecologyManage.logoSafeArea")),1)],4)):S("",!0)],34),z("p",{class:V(["resolution-error",{"is-hidden":!Ze.value}]),role:"alert","aria-live":"polite"},Y(Ze.value||" "),3),z("div",ye,[X(N(g),{type:"info",disabled:ie.value,onClick:pa},{default:W(()=>[X(N(ae),{size:14}),$(Y(N(c)("ecologyManage.reuploadBrandLogo")),1)]),_:1},8,["disabled"]),L.value?(j(),I("div",{key:0,class:"zoom-control",onWheel:O(ga,["prevent"])},[X(N(le),{size:16}),X(N(v),{modelValue:P.value,"onUpdate:modelValue":l[0]||(l[0]=e=>P.value=e),min:40,max:Ee.value,step:1},null,8,["modelValue","max"]),X(N(oe),{size:16}),z("span",null,Y(P.value)+"%",1)],32)):S("",!0)])]),z("aside",Me,[z("div",we,[z("div",null,[z("strong",null,Y(N(c)("ecologyManage.finishedPreview")),1),z("span",null,Y(We.value),1)])]),"square"===Be.value?(j(),I("div",Le,[z("div",ke,[x.value?(j(),I("img",{key:0,src:x.value,alt:He.value},null,8,xe)):(j(),T(N(te),{key:1,size:26}))]),z("div",null,[z("strong",null,Y(N(c)("ecology.brandIntroduction")),1),z("span",null,Y(N(c)("ecologyManage.brandIntroLogoUsage")),1)])])):(j(),I(G,{key:1},[z("div",_e,[z("div",Ce,[z("span",null,Y(N(c)("ecologyManage.lightCover"))+" · 1:1",1),z("div",Ue,[l[2]||(l[2]=z("div",{class:"product-shape"},null,-1)),X(de,{src:x.value},null,8,["src"])])]),z("div",Re,[z("span",null,Y(N(c)("ecologyManage.darkCover"))+" · 1:1",1),z("div",qe,[l[3]||(l[3]=z("div",{class:"product-shape"},null,-1)),X(de,{src:x.value},null,8,["src"])])])]),z("div",Oe,[X(N(ne),{size:16}),z("span",null,Y(N(c)("ecologyManage.coverLogoTransparentTip")),1)])],64))])]),z("footer",Pe,[X(N(g),{type:"info",disabled:ie.value,onClick:Ma},{default:W(()=>[$(Y(N(c)("ecologyManage.cropDialogCancel")),1)]),_:1},8,["disabled"]),X(N(g),{type:"primary",loading:ie.value,disabled:!ea.value,onClick:ya},{default:W(()=>[X(N(re),{size:15}),$(Y(N(c)("ecologyManage.confirmCropAndUpload")),1)]),_:1},8,["loading","disabled"])])]),z("input",{ref_key:"fileInputRef",ref:b,class:"hidden-input",type:"file",accept:Ye.value,onChange:ha},null,40,je)]),_:1},8,["title","show-close","close-on-press-escape"]))}}),[["__scopeId","data-v-a7c7050e"]]);const Fe={class:"add-brand"},De={key:0,class:"refuse-reason"},Be={class:"content"},Ee={class:"header"},Ae={class:"text"},He={class:"logo-upload-layout"},Te={class:"logo-upload-shell logo-upload-shell--square"},We=["src","alt"],Ye={key:1,class:"logo-upload__empty"},Ne={key:2,class:"logo-upload__edit"},Xe=["aria-label"],$e={class:"logo-guidance"},Ve={class:"logo-upload-layout"},Qe={class:"logo-upload-shell logo-upload-shell--cover"},Ge=["src","alt"],Je={key:1,class:"logo-upload__empty"},Ke={key:2,class:"logo-upload__edit"},Ze=["aria-label"],ea={class:"logo-guidance"},aa={class:"not-upload"},la={class:"text"},oa=["src"],ta={class:"el-upload-list__item-actions"},na=["onClick"],ra={class:"tips"},ua={class:"button-box"},ia=K({__name:"add-brand",setup(e){const a=y(),l=D(),o=D(null),t=D(null),n=D(""),r=D(""),g=D(null),v=D(null),p=D({brandName:"",brandLogo:"",brandLogoOriginal:"",brandDesc:"",authType:"1",authProof:"",authProofFiles:[]}),m=D([]),f=D({brandName:[{required:!0,message:c("ecologyManage.pleaseEnterBrandNameRequired"),trigger:"blur"}],brandDesc:[{required:!0,message:c("ecologyManage.pleaseEnterBrandDescriptionRequired"),trigger:"blur"}],brandLogoOriginal:[{required:!0,message:c("ecologyManage.pleaseUploadBrandLogoRequired"),trigger:"change"}],brandLogo:[{required:!0,message:c("ecologyManage.pleaseUploadBrandCoverLogoRequired"),trigger:"change"}],authType:[{required:!0,message:c("ecologyManage.pleaseSelectAuthorizationTypeRequired"),trigger:"change"}],authProofFiles:[{required:!0,message:c("ecologyManage.pleaseUploadAuthorizationProofRequired"),trigger:"change"}]}),O=[{label:c("ecologyManage.brandAgent"),value:"1"},{label:c("ecologyManage.ownBrand"),value:"2"}],P=e=>{const a="cover"===e;var l;l={mode:e,sourceUrl:a?r.value||p.value.brandLogo:n.value||p.value.brandLogoOriginal,initialState:a?v.value:g.value,onConfirm:({logoUrl:e,originalUrl:l,cropState:t})=>{var u,i,s,d;if(a)return r.value=l||e,v.value=t||null,p.value.brandLogo=e,void(null==(i=null==(u=o.value)?void 0:u.validateField)||i.call(u,"brandLogo").cat
1ch(()=>{}));n.value=l||e,g.value=t||null,p.value.brandLogoOriginal=e,null==(d=null==(s=o.value)?void 0:s.validateField)||d.call(s,"brandLogoOriginal").catch(()=>{})}},b(Se,l,!1)},F=(e,a)=>{var l,o,n,r;if(200==e.code&&(null==(l=null==e?void 0:e.data)?void 0:l.temporaryUrl))return p.value.authProof=null==(o=null==e?void 0:e.data)?void 0:o.temporaryUrl,void p.value.authProofFiles.push(null==(n=null==e?void 0:e.data)?void 0:n.temporaryUrl);h(e.msg),null==(r=t.value)||r.handleAuthRemove(a)},A=e=>{var a,l,t,u;if("cover"===e)return r.value="",v.value=null,p.value.brandLogo="",void(null==(l=null==(a=o.value)?void 0:a.validateField)||l.call(a,"brandLogo").catch(()=>{}));n.value="",g.value=null,p.value.brandLogoOriginal="",null==(u=null==(t=o.value)?void 0:t.validateField)||u.call(t,"brandLogoOriginal").catch(()=>{})},H=()=>{o.value.validate(e=>s(this,null,function*(){var a,o;if(e){const e=p.value,{brandLogoSmall:t}=e,n=i(e,["brandLogoSmall"]),{code:r,msg:u}=yield U(n);200==r?(R(u),null==(o=null==(a=l.value)?void 0:a.back)||o.call(a)):h(u)}}))},T=e=>s(this,null,function*(){const{code:a,data:l,msg:o}=yield k(e);if(200==a){const e=l||{},{brandLogoSmall:a}=e,o=i(e,["brandLogoSmall"]);p.value=u(u({},{brandName:"",brandLogo:"",brandLogoOriginal:"",brandDesc:"",authType:"1",authProof:"",authProofFiles:[]}),o),n.value=String(p.value.brandLogoOriginal||""),r.value=String(p.value.brandLogo||""),g.value=null,v.value=null,m.value=((null==l?void 0:l.authProofFiles)||[]).map((e,a)=>({id:++a,url:e}))}else h(o)}),V=()=>{x("msgImagesList.max_upload_image",{max:5})},Q=e=>s(this,null,function*(){return _.includes(e.type)?e:(x("msgUploadList.format"),!1)}),G=()=>{const e=document.createElement("a");e.href=C,e.download=c("ecologyManage.authorizationProofTemplate"),document.body.appendChild(e),e.click(),document.body.removeChild(e)};return B(()=>m.value.length,e=>{const a=document.querySelector(".product-uploader div.el-upload--picture-card");a&&(a.style.display=e<5?"flex":"none")},{deep:!0}),E(()=>{a.params.id&&T(a.params.id)}),(e,a)=>{const n=J("ark-input"),r=J("el-form-item"),u=J("el-upload"),i=J("el-button"),s=J("el-form"),g=J("ark-button");return j(),I("div",Fe,[X(q,{class:"back",ref_key:"backBtnRef",ref:l},null,512),p.value.rejectReason?(j(),I("div",De,[a[8]||(a[8]=z("i",{class:"icon-gantanhao"},null,-1)),$(Y(N(c)("ecologyManage.auditFailedStatus"))+Y(p.value.rejectReason),1)])):S("",!0),z("div",Be,[X(s,{model:p.value,"label-width":"auto","label-position":"left",inline:!1,rules:f.value,ref_key:"formRef",ref:o},{default:W(()=>[z("div",Ee,[a[9]||(a[9]=z("div",{class:"line"},null,-1)),z("div",Ae,Y(N(c)("ecologyManage.addBrand")),1)]),X(r,{label:N(c)("ecologyManage.brandName"),prop:"brandName"},{default:W(()=>[X(n,{modelValue:p.value.brandName,"onUpdate:modelValue":a[0]||(a[0]=e=>p.value.brandName=e),placeholder:N(c)("ecologyManage.pleaseEnterBrandName"),maxlength:20},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),X(r,{label:N(c)("ecologyManage.brandIntroLogo"),class:"files logo-form-item",prop:"brandLogoOriginal"},{default:W(()=>[z("div",He,[z("div",Te,[z("button",{type:"button",class:"logo-upload logo-upload--square",onClick:a[1]||(a[1]=e=>P("square"))},[p.value.brandLogoOriginal?(j(),I("img",{key:0,src:N(d)(p.value.brandLogoOriginal,500),alt:N(c)("ecologyManage.brandIntroLogo")},null,8,We)):(j(),I("span",Ye,[a[10]||(a[10]=z("i",{class:"icon-upload-02"},null,-1)),$(" "+Y(N(c)("ecologyManage.uploadImage")),1)])),p.value.brandLogoOriginal?(j(),I("span",Ne,Y(N(c)("ecologyManage.recrop")),1)):S("",!0)]),p.value.brandLogoOriginal?(j(),I("button",{key:0,type:"button",class:"logo-remove","aria-label":N(c)("ecologyManage.removeBrandIntroLogo"),onClick:a[2]||(a[2]=e=>A("square"))},[...a[11]||(a[11]=[z("i",{class:"icon-shanchu1"},null,-1)])],8,Xe)):S("",!0)]),z("div",$e,[z("strong",null,Y(N(c)("ecologyManage.brandIntroLogoUsage")),1),z("span",null,Y(N(c)("ecologyManage.brandIntroLogoSpec")),1),z("small",null,Y(N(c)("ecologyManage.brandIntroLogoSafeArea")),1)])])]),_:1},8,["label"]),X(r,{label:N(c)("ecologyManage.brandCoverLogo"),class:"files logo-form-item",prop:"brandLogo"},{default:W(()=>[z("div",Ve,[z("div",Qe,[z("button",{type:"button",class:"logo-upload logo-upload--cover",onClick:a[3]||(a[3]=e=>P("cover"))},[p.value.brandLogo?(j(),I("img",{key:0,src:N(d)(p.value.brandLogo,500),alt:N(c)("ecologyManage.brandCoverLogo")},null,8,Ge)):(j(),I("span",Je,[a[12]||(a[12]=z("i",{class:"icon-upload-02"},null,-1)),$(" "+Y(N(c)("ecologyManage.uploadImage")),1)])),p.value.brandLogo?(j(),I("span",Ke,Y(N(c)("ecologyManage.recrop")),1)):S("",!0)]),p.value.brandLogo?(j(),I("button",{key:0,t
1ype:"button",class:"logo-remove","aria-label":N(c)("ecologyManage.removeBrandCoverLogo"),onClick:a[4]||(a[4]=e=>A("cover"))},[...a[13]||(a[13]=[z("i",{class:"icon-shanchu1"},null,-1)])],8,Ze)):S("",!0)]),z("div",ea,[z("strong",null,Y(N(c)("ecologyManage.brandCoverLogoUsage")),1),z("span",null,Y(N(c)("ecologyManage.brandCoverLogoSpec")),1),z("small",null,Y(N(c)("ecologyManage.brandCoverLogoSafeArea")),1)])])]),_:1},8,["label"]),X(r,{label:N(c)("ecologyManage.brandDescription"),prop:"brandDesc"},{default:W(()=>[X(n,{type:"textarea",modelValue:p.value.brandDesc,"onUpdate:modelValue":a[5]||(a[5]=e=>p.value.brandDesc=e),placeholder:N(c)("ecologyManage.pleaseEnterBrandDescription"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),X(r,{label:N(c)("ecologyManage.authorizationType"),prop:"authType"},{default:W(()=>[X(N(ue),{modelValue:p.value.authType,"onUpdate:modelValue":a[6]||(a[6]=e=>p.value.authType=e),options:O},null,8,["modelValue"])]),_:1},8,["label"]),X(r,{label:N(c)("ecologyManage.authorizationProof"),class:"files",prop:"authProofFiles"},{default:W(()=>[X(u,{class:"product-uploader",ref_key:"proofUploadRef",ref:t,action:"","http-request":N(L),accept:N(w),headers:{Authorization2:N(M)},"on-success":F,"before-upload":Q,multiple:"","file-list":m.value,"onUpdate:fileList":a[7]||(a[7]=e=>m.value=e),"on-exceed":V,"list-type":"picture-card",limit:5},{file:W(({file:e})=>[z("div",null,[z("img",{class:"el-upload-list__item-thumbnail",src:e.url,alt:""},null,8,oa),z("span",ta,[z("span",{class:"el-upload-list__item-delete",onClick:a=>(e=>{p.value.authProof="";const a=m.value.findIndex(a=>a.url===e.url);a>-1&&(m.value.splice(a,1),p.value.authProofFiles.splice(a,1))})(e)},[...a[15]||(a[15]=[z("i",{class:"icon-shanchu1 icon-size-mini icon-color-white delIcon"},null,-1)])],8,na)])])]),default:W(()=>[z("div",aa,[a[14]||(a[14]=z("div",{class:"icon"},[z("i",{class:"icon-download icon-color-violet icon-size-medium"})],-1)),z("div",la,Y(N(c)("button.upload")),1)])]),_:1},8,["http-request","accept","headers","file-list"]),z("div",null,[z("p",ra,Y(N(c)("ecologyManage.uploadProofTips")),1),X(i,{link:"",type:"primary",class:"download-btn",onClick:G},{default:W(()=>[$(Y(N(c)("ecologyManage.downloadTemplate")),1)]),_:1})])]),_:1},8,["label"])]),_:1},8,["model","rules"]),z("div",ua,[X(g,{class:"ark-button",type:"success",onClick:H},{default:W(()=>[$(Y(N(c)("saveButton")),1)]),_:1})])])])}}},[["__scopeId","data-v-ebb36528"]]);export{ia as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.