1import{_ as w,v as L,c as p,a as l,b as r,e as d,t as f,n as A,F as u,r as m,H as v,o as n,y as _,D as C}from"./index-Cthg2AOb.js";import{S as $}from"./SelectedAffiliateProduct-B9z4z5r0.js";import{S as M,A as I}from"./SelectAffiliateCollectionLinks-CkFssIdC.js";import{C as b}from"./CreateAffiliateCollection-BYreiknW.js";import{_ as P}from"./ListingStyleComponent-CLDYMis4.js";import{S as j}from"./StoreAnalyticsComponent-D8WNoqJm.js";import"./DeleteIcon-sm9vDr3M.js";import"./CheckedBoxIcon-Nwr4jS4a.js";import"./AnalyticsIcon-CILjCi7O.js";import"./OrdersIcon-BVn1dtRz.js";import"./LinkIcon-iTD3fCO_.js";import"./index-uzVG0GMg.js";const O={components:{ListingStyleComponent:P,StoreAnalyticsComponent:j,ImageView:L,SelectedAffiliateProduct:$,AffiliateCollectionMenu:I,CreateAffiliateCollection:b,SelectAffiliateCollectionLinks:M},data(){return{listingMode:"grid",collection:[],isCopied:!1}},async created(){var e,i,o;this.$route.query.mode&&(this.listingMode=this.$route.query.mode),this.$route.params.collection?(this.collection=JSON.parse((e=this.$route.params)==null?void 0:e.collection),this.$store.dispatch("creatorStore/setAffiliateCollection",this.collection),((o=(i=this.collection)==null?void 0:i.influencer_link_ids)==null?void 0:o.length)>0&&await this.fetchInfluencerCollectionLinks()):await this.fetchCollectionDataById()},methods:{switchMode(e){this.listingMode!==e&&(this.listingMode=e)},openCollectionMenu(){this.$router.push({name:"AffiliateCollectionMenu",params:{id:this.$route.params.id}})},selectProducts(){this.$router.push({name:"SelectAffiliateCollectionProducts",params:{id:this.$route.params.id}})},copyLink(){var o,s;this.$emit("trackCollectionShareClick");let e=v(this.$base+"/"+this.$store.state.user.userObject.influencer_info.username+"/affiliate-collection/"+((o=this.collection)==null?void 0:o.id)+"?title="+((s=this.collection)==null?void 0:s.name)),i=encodeURI(e);navigator.clipboard.writeText(i),this.isCopied=!0,setTimeout(()=>{this.isCopied&&(this.isCopied=!1)},1e3)},addLinks(){this.$store.dispatch("creatorStore/setAffiliateCollectionLinks",this.linksObject),this.$router.push({name:"EditAffiliateCollectionProducts"})},async fetchCollectionDataById(){var i,o;let e=new URLSearchParams;e.append("id",this.$route.params.id);try{let s=await this.axios({method:"GET",url:this.$catalogURL+"/api/app/influencer/collection",params:e,withCredentials:!0,headers:{"Content-Type":"application/json"}});this.collection={...s.data.payload},this.$store.dispatch("creatorStore/setAffiliateCollection",this.collection),((o=(i=this.collection)==null?void 0:i.influencer_link_ids)==null?void 0:o.length)>0&&await this.fetchInfluencerCollectionLinks()}catch(s){console.log(s),this.$router.replace({name:"Collections"})}},async fetchInfluencerCollectionLinks(){var s;try{var e={ids:[...(s=this.collection)==null?void 0:s.influencer_link_ids],influencer_id:this.$store.state.user.userObject.influencer_info._id},i=await this.axios({method:"POST",url:this.$catalogURL+"/api/app/influencer/collection/deeplinks/ids",data:e,withCredentials:!0,headers:{"Content-Type":"application/json"}});if(i.data.payload){var o=i.data.payload.reduce((t,a)=>Object.assign(t,{[a.id]:a}),{});this.$store.dispatch("creatorStore/setAffiliateCollectionLinks",o)}}catch(t){console.log(t)}}}},B={class:"affiliate-collection-wrapper"},D={class:"affiliate-collection-container"},T={class:"collection-header"},R={class:"collection-info-wrapper"},U={class:"collection-info"},V={class:"collection-name"},x={class:"collection-links"},E={class:"collection-btns"},q={class:"collection-links-wrapper"};function F(e,i,o,s,t,a){var h;const g=d("ImageView"),k=d("ListingStyleComponent"),y=d("SelectedAffiliateProduct"),S=d("StoreAnalyticsComponent");return n(),p("div",B,[l("div",D,[l("div",T,[l("div",R,[(n(),r(g,{key:t.collection.image,class:"collection-thumbnail",src:t.collection.image&&t.collection.image.src},null,8,["src"])),l("div",U,[l("div",V,f((h=t.collection)==null?void 0:h.name),1),l("div",x,f(Object.keys(e.$store.state.creatorStore.collectionLinks).length)+" Links ",1)])]),l("div",E,[(n(),r(k,{onChangeMode:a.switchMode,mode:t.listingMode,ke
1y:t.listingMode},null,8,["onChangeMode","mode"]))])]),l("div",q,[l("div",{class:A({"product-listing-wrapper-analytics":t.listingMode==="list","links-listing-wrapper":t.listingMode==="grid"})},[(n(!0),p(u,null,m(e.$store.state.creatorStore.collectionLinks,c=>_((n(),r(y,{class:"collection-link",source:"collection-analytics",collectionProduct:!0,key:c.id,productInfo:c,isDeletable:!1,showCopy:!1,showAnalytics:!0},null,8,["productInfo"])),[[C,t.listingMode==="grid"]])),128)),(n(!0),p(u,null,m(e.$store.state.creatorStore.collectionLinks,c=>_((n(),r(S,{key:c.id,source:"collection-products",type:"afflink",product:c},null,8,["product"])),[[C,t.listingMode==="list"]])),128))],2)])])])}const te=w(O,[["render",F],["__scopeId","data-v-4d5197cc"]]);export{te 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.