PageSourceSearch

https://connect.mediatrack.org/hub/js/GBrdskr3.js

js mediatrack.org collected 2026-10-09 18:18:46 UTC 74,031 bytes, 72 lines download raw bytes

1import{U as A,k as q,m as P,g as G,c as o,a as L,w as U,T as Y,r as I,F as w,p as z,o as n,b as c,h as $,d as s,t as u,n as k,e as y,Y as x,j as T,$ as R,f as S,s as F,a2 as O,a6 as j,q as D}from"./CoClc6X9.js";import{s as J}from"./-HWb_k8e.js";import{A as B,_ as N}from"./BsDiHVxw.js";import{A as E}from"./BdZOqgPP.js";import{A as H}from"./gJ8puzJY.js";import{A as W}from"./DDDxpOQ9.js";import{L as g}from"./i3x8mUgz.js";const K={name:"BulkUpload",emits:["hide"],directives:{tippy:q},components:{AppLoader:B,AppNoRecord:E},mixins:[A],props:{show:{type:Boolean,required:!0}},data(){return{global:G,file:null,isDragging:!1,isLoading:!1,records:!1,total:0,frecords:[],ftotal:0,suppliers:!1,totalSuppliers:0,activeSource:{},isModalAddToVisible:!1,errorMessage:!1,filterType:"ready",sortBy:"source_name",orderBy:"asc",viewType:1,isCollapsed:!0,selectedGroups:[],topLevelRecords:[],topLevelRecordsCount:0,checkedGroups:[],selectedGroupName:null,selectedTopLevelRecord:null,inputSelectedTopLevelGlobalId:null,inputSelectedTopLevelSourceName:null,finalFormat:[],selectedTopSourceNames:{},selectedTopGlobalIds:{},isChecked:!0,countryPrices:{},countryPricesF:{}}},async created(){await this.getUserInfo()},watch:{sortBy:"sortRecords",orderBy:"sortRecords",filteredFrecords:{handler(e){this.checkedGroups.length!==e.length&&(this.checkedGroups=e.map(t=>t.source_name))},immediate:!0}},computed:{selectedCount(){return this.records?this.records.filter(e=>e.selected&&!e.missingCountry&&!this.isMissingMeta(e)).length:0},selectedRecords(){var e;return((e=this.records)==null?void 0:e.filter(t=>t.selected))||[]},filteredRecords(){const e=t=>({...t,source_name:t.source_name,country:t.country,language:t.language,type:t.type,distribution:t.distribution,frequency:t.frequency,price:t.price});if(this.filterType==="ready")return this.records.filter(t=>!t.invalidFields.includes("Missing Country")&&!t.invalidFields.includes("Invalid Country")&&!t.invalidFields.includes("Missing Source Name")&&!t.invalidFields.includes("Invalid Source Name")).map(e);if(this.filterType==="flagged"){const t=this.records.filter(r=>r.invalidFields.includes("Missing Country")||r.invalidFields.includes("Invalid Country")||r.invalidFields.includes("Missing Source Name")||r.invalidFields.includes("Invalid Source Name")).map(e),a=this.frecords.filter(r=>r.invalidFields.includes("Missing Country")||r.invalidFields.includes("Invalid Country")||r.invalidFields.includes("Missing Source Name")||r.invalidFields.includes("Invalid Source Name"));return[...t,...a]}return this.records.map(e)},filteredFrecords(){return(this.frecords||[]).filter(e=>!e.invalidFields.includes("Missing Country")&&!e.invalidFields.includes("Invalid Country")&&!e.invalidFields.includes("Missing Source Name")&&!e.invalidFields.includes("Invalid Source Name"))},readyCount(){return this.records.filter(e=>!e.invalidFields.includes("Missing Country")&&!e.invalidFields.includes("Invalid Country")&&!e.invalidFields.includes("Missing Source Name")&&!e.invalidFields.includes("Invalid Source Name")).length},flaggedCount(){return this.records.filter(e=>
1e.invalidFields.includes("Missing Country")||e.invalidFields.includes("Invalid Country")||e.invalidFields.includes("Missing Source Name")||e.invalidFields.includes("Invalid Source Name")).length},topLevelCount(){return this.frecords.filter(e=>!e.invalidFields.includes("Missing Country")&&!e.invalidFields.includes("Invalid Country")&&!e.invalidFields.includes("Missing Source Name")&&!e.invalidFields.includes("Invalid Source Name")).length},isAllSelected(){return this.checkedGroups.length===this.filteredFrecords.length&&this.filteredFrecords.length>0}},methods:{handleHeaderClick(e){this.filterType=e,this.isCollapsed=!0},handleTopLevelHeaderClick(){if(this.filterType==="toplevel"?this.isCollapsed=!this.isCollapsed:(this.filterType="toplevel",this.isCollapsed=!1),this.filteredFrecords.length===0)return;const e=this.filteredFrecords[0],t=sessionStorage.getItem("custom_frecords_session");let a=[];try{a=JSON.parse(t)}catch(d){console.error("Invalid session format in handleTopLevelHeaderClick:",d);return}const r=a.find(d=>d.source_name===e.source_name);if(r){let d=r.top_source??[],m=null;d.length===1?(d[0].selected_record=!0,m=d[0]):d.length>1&&(d=d.map((f,v)=>({...f,selected_record:v===0})),m=d[0]),a=a.map(f=>f.source_name===r.source_name?{...r,top_source:d}:f),sessionStorage.setItem("custom_frecords_session",JSON.stringify(a)),this.selectedGroupName=e.source_name,this.topLevelRecords=this.cleanFRecord(e,m)}},toggleAllGroups(){if(this.isAllSelected)this.checkedGroups=[],this.clearSelectedGroups(),this.topLevelRecords=[];else{this.checkedGroups=this.filteredFrecords.map(a=>a.source_name),this.selectedGroups=this.filteredFrecords.map(a=>({...a}));const e=sessionStorage.getItem("custom_frecords_session");let t=[];try{t=JSON.parse(e)}catch(a){console.error("Invalid session format in toggleAllGroups:",a);return}if(this.filteredFrecords.length>0){const a=this.filteredFrecords[0],r=t.find(d=>d.source_name===a.source_name);if(r){let d=r.top_source??[],m=null;d.length===1?(d[0].selected_record=!0,m=d[0]):d.length>1&&(d=d.map((f,v)=>({...f,selected_record:v===0})),m=d[0]),t=t.map(f=>f.source_name===r.source_name?{...r,top_source:d}:f),sessionStorage.setItem("custom_frecords_session",JSON.stringify(t)),this.selectedGroupName=a.source_name,this.topLevelRecords=this.cleanFRecord(a,m)}}}},clearSelectedGroups(){this.selectedGroups=[]},isSelected(e){return this.checkedGroups.includes(e)},toggleCheckbox(e){const t=this.checkedGroups.indexOf(e);t===-1?this.checkedGroups.push(e):this.checkedGroups.splice(t,1)},isGroupSelected(e){return this.selectedGroupName===e},cleanFRecord(e,t=null){return(e.top_source||[]).map(a=>{const r=(t==null?void 0:t.global_source_id)===a.global_source_id;return{main_source_name:e.source_name,source_name:a.source_name,country:a.country,language:a.language,type:a.type,distribution:a.distribution,frequency:a.frequency,price:a.price,_id:a._id,global_source_id:a.global_source_id,supplier_id:a.supplier_id,create_date:a.create_date,selected_record:r}})},toggleSelectedGroup(e){this.selectedGroupName=e,this.filterType="toplevel";const t=sessionStorage.getItem("custom_frecords_session");if(!t)return;let a=[];try{a=JSON.parse(t)}catch(h){console.error("Invalid session format:",h);return}const r=this.isSelected(e);this.isChecked=r;const d=a.find(h=>h.source_name===e);if(!d)return;const m=d.top_source??[],f=m.length===1;let v=null;f?(m[0].selected_record=!0,v=m[0]):v=m.find(b=>b.selected_record===!0)||null,a=a.map(h=>h.source_name===e?d:h),sessionStorage.setItem("custom_frecords_session",JSON.stringify(a));const i=this.frecords.find(h=>h.source_name===e);i&&(this.selectedGroups.push(i),this.topLevelRecords=this.cleanFRecord(i,v),this.topLevelRecordsCount=this.topLevelRecords.length,this.toggleSelectTopLevel(v))},toggleSelectTopLevel(e){var m;if(!e||((m=this.selectedTopLevelRecord)==null?void 0:m.global_source_id)===e.global_source_id)return;this.selectedTopLevelRecord=e;const t=sessionStorage.getItem("custom_frecords_session");if(!t)return;let a=[];try{a=JSON.parse(t)}catch(f){console.error("Invalid session data:",f);return}const r=e.main_source_name;a=a.map(f=>(f.source_name===r&&Array.isArray(f.top_source)&&(f.top_source=f.top_source.map(v=>({...v,selected_record:v.global_source_id===e.global_source_id}))),f)),sessionStorage.setItem("custom_frecords_session",JSON.stringify(a));const d=this.selectedGroups.find(f=>f.source_name===r);d&&(this.topLevelRecords=this.cleanFRecord(d,e)),this.selectedTopSourceNames[r]=e.source_name,this.selectedTopGlobalIds[r]=e.global_source_id},checkData(){const e=sessionStorage.getItem("custom_frecords_session");console.log("session data:",e)},getCurrentSelected(){const e=[],t=sessionStorage.getItem("custom_frecords_session");if(!t)return console.warn("No session data found"),e;let a=[];try{a=JSON.parse(t)}catch(m){return console.error("Failed to parse session data:",m),e}const r=[],d=[];return this.checkedGroups.forEach(m=>{const f=a.find(i=>i.source_name===m);if(!f||!Array.isArray(f.top_source))return;const v=f.top_source.find(i=>i.selected_record===!0);v&&r.push({global_source_id:v.global_source_id,source_name:f.source_name,country:v.country,language:v.language,type:v.type,distribution:v.distribution,frequency:v.frequency,price:f.price||v.price})}),a.forEach(m=>{this.checkedGroups.includes(m.source_name)||d.push({source_name:m.source_name,country:m.country,language:m.language,type:m.type,distribution:m.distribution,frequency:m.frequency,price:m.price})}),e.push(...r,...d),e},getInvalidSourceNameCountry(e){var h,b,l,p,C,M;const t=[],a=this.countries.map(_=>_.name),r=this.languages.map(_=>_.name),d=this.global.source_type.map(_=>_.name),m=this.global.distribution_type,f=this.global.frequency_type,v=((h=e.country)==null?void 0:h.trim())||"";return(((b=e.source_name)==null?void 0:b.trim())||"").length===0&&t.push("Missing Source Name"),v.length===0?t.push("Missing Country"):a.includes(v)||t.push("Invalid Country"),(l=e.language)!=null&&l.trim()&&(r.includes(e.language.trim())?e.language=e.language.trim():e.language=""),(p=e.type)!=null&&p.trim()&&(d.includes(e.type.trim())?e.type=e.type.trim():e.type=""),(C=e.distribution)!=null&&C.trim()&&(m.includes(e.distribution.trim())?e.distribution=e.distribution.trim():e.distribution=""),(M=e.frequency)!=null&&M.trim()&&(f.includes(e.frequency.trim())?e.frequency=e.frequency.trim():e.frequency=""),t},isMissingMeta(e){return["language","type","distribution"].some(t=>!e[t]||e[t].toString().trim()==="")},getInvalidMetaFields(e){const t=[],a=this.languages.map(f=>f.name),r=this.global.source_type.map(f=>f.name),d=this.global.distribution_type,m=this.global.frequency_type;return a.includes(e.language)||t.push("Language"),r.includes(e.type)||t.push("Type"),d.includes(e.distribution)||t.push("Distribution"),m.includes(e.frequency)||t.push("Frequency"),t},sortRecords(){if(!this.records||!Array.isArray(this.records))return;const e=this.sortBy,t=this.orderBy;this.records.sort((a,r)=>{const d=a[e]?a[e].toString().toLowerCase():"",m=r[e]?r[e].toString().toLowerCase():"";return d<m?t==="asc"?-1:1:d>m?t==="asc"?1:-1:0})},changeView(e){const t=Number(e);
1this.viewType=t},clear(){this.sortBy="source_name",this.orderBy="asc"},triggerFileInput(){this.$refs.fileInput.click()},handleFileDrop(e){this.isDragging=!1;let t=e.dataTransfer.files;t.length>0&&this.uploadFile(t[0])},handleFileChange(e){let t=e.target.files;t.length>0&&this.uploadFile(t[0])},async getSuppliers(e){this.activeSource=e,this.suppliers=e.suppliers,this.totalSuppliers=Object.keys(e.suppliers).length},clearFileInput(){this.file=null,this.$refs.fileInput&&(this.$refs.fileInput.value=null)},async uploadFile(e){if(e.type!=="text/csv")return this.showToast(`${this.toastIconInfo} Invalid file type. Only CSV is accepted.`,1e3),this.clearFileInput(),{status:!1,message:"Invalid file type"};this.isLoading=!0,this.file=e;try{await this.getUserInfo(),g.file=e,g.type=5,g.clientID=this.activeClient;const t=await g.bulkUpload();return t&&t.status&&t.data&&Array.isArray(t.data.not_found)?(this.records=t.data.not_found.map(r=>{const d=this.getInvalidSourceNameCountry(r);return{...r,selected:d.length===0,invalidFields:d}}),this.total=this.records.length,this.frecords=t.data.found.filter(r=>Array.isArray(r.top_source)&&r.top_source.length>0).map(r=>{const d=this.getInvalidSourceNameCountry(r);return{...r,selected:d.length===0,invalidFields:d}}),this.ftotal=this.frecords.length,this.customFRecords=this.frecords.map(r=>{const d=r.top_source.map((m,f)=>({...m,selected_record:r.top_source.length===1?!0:f===0}));return{...r,top_source:d}}),sessionStorage.setItem("custom_frecords_session",JSON.stringify(this.customFRecords)),this.sortRecords(),this.filterType="ready",this.records.some(r=>r.invalidFields.length>0)?(this.showToast("Some records have missing or invalid fields. Please fix and reupload CSV.",2e3),{status:!1,message:"Invalid fields found in some records"}):{status:!0,data:{records:this.records,frecords:this.frecords},total:this.total,message:t.message||"Upload successful"}):(this.errorMessage=t.message||"Upload failed",this.records=[],this.total=0,{status:!1,message:this.errorMessage})}catch(t){return console.error("Upload Error: ",t),{status:!1,message:"An unexpected error occurred during upload"}}finally{this.clearFileInput(),this.isLoading=!1}},toggleSelect(e){var r;let t;if(typeof e=="number"?t=this.records[e]:t=e,!t||((r=t.invalidFields)==null?void 0:r.length)>0)return;const a=this.records.find(d=>d.source_name===t.source_name);a&&(a.selected=!a.selected)},selectAllRecords(){this.records.forEach(e=>{(!e.invalidFields||e.invalidFields.length===0)&&(e.selected=!0)})},clearSelectedRecords(){this.records.forEach(e=>{e.selected=!1})},hideModal(){this.records=!1,this.total=0,this.file=null,this.isDragging=!1,this.activeSource={},this.$emit("hide"),this.filterType="ready",this.isCollapsed=!0,sessionStorage.removeItem("custom_frecords_session")},async fetchAllCountryPrices(){var t;if(!Array.isArray(this.records)||this.records.length===0)return;this.isLoading=!0;const e=[...new Set(this.records.map(a=>a.country).filter(Boolean))];for(const a of e){const r={supplier_id:this.activeClient,country:a};g.data=r;try{const d=await g.getSupplierSourceMarket(),m=Array.isArray(d==null?void 0:d.data)?d.data:[];if(m.length>0){const f=m[0];this.countryPrices[a]={country:f.country,price:((t=f.price)==null?void 0:t.toString())??"",market_price_id:f.market_price_id}}else this.countryPrices[a]=null}catch(d){console.error(`Failed to fetch for ${a}`,d),this.countryPrices[a]=null}}this.isLoading=!1},async confirmSelection(){await this.fetchAllCountryPrices();const e=this.records.filter(r=>r.selected),t=`<p class="mb-2">You have selected <strong>${e.length+this.topLevelCount}</strong> listing(s). Proceed with saving?</p>`;if((await P.fire({title:"Save Your Selection(s)",html:t,showCancelButton:!0,confirmButtonText:"YES",cancelButtonText:"NO",reverseButtons:!0,confirmButtonColor:this.confirmButtonColor||"#3085d6",cancelButtonColor:this.cancelButtonColor||"#d33",customClass:{confirmButton:"font-vvsmall",cancelButton:"font-vvsmall",popup:"text-left"}})).isConfirmed){this.isLoading=!0;const d=this.getCurrentSelected().map(({source_name:i,global_source_id:h,c
1ountry:b,language:l,type:p,distribution:C,frequency:M,price:_,client_source_id:V})=>({source_name:i??"",global_source_id:h??"",country:b??"",language:l??"",type:p??"",distribution:C??"",frequency:M??"",price:_??0,status:!1,client_source_id:V??!1})),m=e.map(i=>{var C;const h=(C=this.countryPrices)==null?void 0:C[i.country],b=!!h,p=Number(i.price)>0?i.price:b?h.price:0;return{source_name:i.source_name??"",country:i.country??"",language:i.language??"",type:i.type??"",distribution:i.distribution??"",frequency:i.frequency??"",price:p,client_source_id:i.client_source_id??!1,status:!1}}),f=[...d,...m],v={data:{client_id:this.activeClient,bulk:!0,sources:f}};g.data=v,g.action=3;try{const i=await g.save();if(i&&i.data){const h=i.data.saved?i.data.saved.length:0,b=i.data.failed_sources?i.data.failed_sources.length:0;let l="";h>0&&b===0?l="Your listings have been successfully uploaded. Redirecting you to the Inactive tab to review them before activation.":h>0&&b>0?l=`Your ${h} listings have been successfully uploaded. ${b} Listing can’t be saved. Ensure all mandatory fields are completed, or verify if the Listing Name already exists.`:h===0&&b>0&&(l="Listing can’t be saved. Ensure all mandatory fields are completed, or verify if the Listing Name already exists."),h>0?(this.isLoading=!1,this.hideModal(),this.$router.push({name:"Listing",params:{tab:"inactive"}}).then(()=>{this.showToast(l,5e3)})):this.showToast(l,5e3)}else this.isLoading=!1,this.showToast("Listing can’t be saved. Ensure all mandatory fields are completed, or verify if the Listing Name already exists.",5e3)}catch(i){this.isLoading=!1,console.error("Error during save:",i),this.showToast("Error saving listing.",5e3)}}}}},Q={class:"modal-content p-3"},X={key:0,class:"row p-0 m-0 mt-4"},Z={class:"col-4 text-center"},ee={key:0,class:"font-vsmall text-gray mt-4 d-block text-red"},te={key:0,class:"font-vsmall text-gray"},se={key:1,class:"font-vsmall text-gray"},ie={key:1,class:"row p-0 m-0 h-100 align-items-stretch"},le={class:"col-3 border-end border-1 pt-4"},oe={class:"d-block font-vvsmall text-black mb-2"},ne={class:"d-flex justify-content-between align-items-center",style:{"padding-left":"7px","padding-right":"7px"}},ae={class:"d-flex justify-content-between align-items-center",style:{"padding-left":"7px","padding-right":"7px"}},re={class:"h-100 d-flex flex-column"},de={class:"font-vvsmall text-black",style:{"background-color":"#ebedf0",padding:"3px 7px","border-radius":"6px"}},ue={class:"mt-2 mb-2 ps-3 pe-3 d-flex justify-content-between align-items-center"},ce={class:"font-vvsmall text-gray d-flex align-items-center"},pe={class:"bi bi-info-circle-fill text-gray ms-2"},me={class:"flex-grow-1 overflow-auto px-3 pb-3"},fe={class:"list-unstyled mb-0"},ge=["onClick"],he=["onClick"],ve={class:"font-small"},ye={class:"sub-label"},be=["value"],ke=["value"],we={class:"col p-4 d-flex justify-content-center"},Ce={style:{"max-width":"960px",width:"100%"}},Se={key:0,class:"text-uppercase",style:{"font-size":".85rem","margin-top":"1rem"}},Te={key:1,class:"text-uppercase",style:{"font-size":".85rem","margin-top":"1rem"}},$e={key:2,class:"text-uppercase",style:{"font-size":".85rem","margin-top":"1rem"}},xe={key:3,class:"text-left font-vvsmall mb-3 mt-2 text-muted"},_e={key:4,class:"text-left font-vvsmall mt-3 text-muted"},Le={key:5,class:"text-left font-vvsmall mt-3 text-muted"},Ie={class:"row p-0 pt-2 m-0 pb-2 align-items-center"},Me={class:"col d-flex justify-content-between align-items-center px-0"},Fe={class:"d-flex align-items-center"},De={key:0,class:"font-vvsmall font-vsmall text-gray me-2"},Re={key:1,class:"font-vvsmall font-vsmall text-gray me-2"},Ae={key:2,class:"font-vvsmall font-vsmall text-gray me-2"},Ge={class:"d-flex align-items-center"},Be={class:"dropdown ms-2"},Ne={class:"dropdown-menu dropdown-menu-end mt-1"},Ee={class:"dropdown-item mb-2"},Ve={class:"dropdown-item"},qe=["value"],Pe={key:6},Ue={key:0},Ye={style:{"font-size":".75rem !important","max-height":"400px","overflow-y":"auto"}},ze=["onClick"],Oe={class:"record-card rounded p-3 border mb-2"},je={key:0,class:"fa-solid fa-circle-check text-success font-vvsmall me-1"},Je={key:1,class:"fa-solid fa-triangle-exclamation text-danger me-1"},He={class:"row mt-2"},We={class:"col"},Ke={class:"col"},Qe={class:"col"},Xe={class:"col"},Ze={class:"col"},et={class:"col"},tt={class:"col"},st={key:1},it={key:0,style:{"font-size":".75rem !important","max-height":"400px","overflow-y":"auto"}},lt=["onClick"],ot={class:"record-card rounded p-3 border mb-2"},nt={key:0,class:"fa-solid fa-circle-check text-success font-vvsmall me-1"},at={class:"row mt-2"},rt={class:"col"},dt={class:"col"},ut={class:"col"},ct={class:"col"},pt={class:"col"},mt={class:"col"},ft={class:"col"},gt={key:1,style:{"font-size":".75rem !important","max-height":"400px","overflow-y":"auto","background-color":"#ebedf0"}},ht={class:"record-card rounded p-3 border"},vt={style:{"font-weight":"bold"}},yt={key:7},bt={key:0},kt={class:"table table-hover font-vsmall"},wt={style:{"max-height":"300px","overflow-y":"auto"},class:"custom-scroll"},Ct=["onClick"],St={class:"text-center",nowrap:""},Tt={key:0,class:"fa-solid fa-circle-check text-success font-vvsmall me-1"},$t={key:1,class:"fa-solid fa-triangle-exclamation text-danger me-1"},xt={key:1},_t={key:0,style:{"font-size":".75rem !important","max-height":"400px","overflow-y":"auto"}},Lt={class:"table table-hover font-vsmall"},It={style:{"max-height":"300px","overflow-y":"auto"},class:"custom-scroll"},Mt=["onClick"],Ft={class:"text-center",nowrap:""},Dt={key:0,class:"fa-solid fa-circle-check text-success font-vvsmall me-1"},Rt={key:1,style:{"font-size":".75rem !important","max-height":"400px","overflow-y":"auto","background-color":"#ebedf0"}},At={class:"record-card rounded p-3 border"},Gt={style:{"font-weight":"bold"}},Bt={key:0,class:"position-fixed bottom-0 start-0 p-3 d-flex bg-white border-top border-1 justify-content-center gap-4",style:{bottom:"0",position:"sticky","z-index":"10"}};function Nt(e,t,a,r,d,m){const f=I("AppLoader"),v=z("tippy");return n(),o(w,null,[L(Y,{name:"slide-top"},{default:U(()=>[e.show?(n(),o("div",{key:0,class:"modal-overlay",onClick:t[20]||(t[20]=$((...i)=>e.hideModal&&e.hideModal(...i),["self"]))},[s("i",{class:"fa-solid fa-xmark position-absolute top-0 end-0 m-3 text-black pointer fs-4",onClick:t[0]||(t[0]=(...i)=>e.hideModal&&e.hideModal(...i))}),s("div",Q,[t[74]||(t[74]=s("div",{class:"border-bottom border-1 pb-3 text-center"},[s("span",{class:"font-small text-green text-uppercase fw-medium"},"BULK UPLOAD LISTINGS")],-1)),e.records?c("",!0):(n(),o("div",X,[t[25]||(t[25]=s("div",{class:"col-4"}," ",-1)),s("div",Z,[t[23]||(t[23]=s("p",{class:"font-vsmall text-gray mb
1-4 d-block"}," Upload your content listings along with their relevant metadata in one go. For best results and accurate matching with our global listings, we recommend using the CSV template below. ",-1)),t[24]||(t[24]=s("a",{href:"../sample.csv",class:"text-uppercase font-vsmall p-2 pe-3 ps-3 btn btn-primary btn-mt-custom"}," Download CSV Sample ",-1)),e.errorMessage?(n(),o("span",ee,u(e.errorMessage),1)):c("",!0),s("div",{class:k(["drop-zone mt-2",{"drop-zone-active":e.isDragging}]),onDragover:t[2]||(t[2]=$(()=>{},["prevent"])),onDragenter:t[3]||(t[3]=$(i=>e.isDragging=!0,["prevent"])),onDragleave:t[4]||(t[4]=$(i=>e.isDragging=!1,["prevent"])),onDrop:t[5]||(t[5]=$((...i)=>e.handleFileDrop&&e.handleFileDrop(...i),["prevent"])),onClick:t[6]||(t[6]=(...i)=>e.triggerFileInput&&e.triggerFileInput(...i))},[t[22]||(t[22]=s("i",{class:"bi bi-upload font-vvbig text-gray d-block mb-2"},null,-1)),e.file?(n(),o("p",se,[t[21]||(t[21]=y("Uploaded file : ",-1)),s("strong",null,u(e.file.name),1)])):(n(),o("p",te,"Drag or click to upload your file.")),s("input",{type:"file",ref:"fileInput",onChange:t[1]||(t[1]=(...i)=>e.handleFileChange&&e.handleFileChange(...i)),accept:".csv",hidden:""},null,544)],34)]),t[26]||(t[26]=s("div",{class:"col-4"}," ",-1))])),e.records?(n(),o("div",ie,[s("div",le,[t[30]||(t[30]=s("span",{class:"d-block text-uppercase font-vsmall text-black mb-2"},"Upload Summary",-1)),s("span",oe," Total of "+u(e.total+e.topLevelCount)+" listings to upload ",1),e.readyCount>0?(n(),o("div",{key:0,class:"rounded p-2 border mb-2 pointer",style:x({backgroundColor:e.filterType==="ready"?"#ebedf0":""}),onClick:t[7]||(t[7]=i=>e.handleHeaderClick("ready"))},[s("div",ne,[t[27]||(t[27]=s("span",{class:"font-vsmall text-gray"},"READY FOR UPLOAD",-1)),s("span",{class:"font-vvsmall text-black",style:x(e.filterType!=="flagged"?"background-color: #ebedf0; padding: 3px 7px; border-radius: 6px;":"padding: 3px 7px;")},u(e.selectedRecords.length),5)])],4)):c("",!0),e.flaggedCount>0?(n(),o("div",{key:1,class:"rounded p-2 border mb-2 pointer",style:x({backgroundColor:e.filterType==="flagged"?"#ebedf0":""}),onClick:t[8]||(t[8]=i=>e.handleHeaderClick("flagged"))},[s("div",ae,[t[28]||(t[28]=s("span",{class:"font-vsmall text-gray"},[y(" FLAGGED "),s("i",{class:"fa-solid fa-triangle-exclamation text-danger ms-1"})],-1)),s("span",{class:"font-vvsmall text-black",style:x(e.filterType!=="flagged"?"background-color: #ebedf0; padding: 3px 7px; border-radius: 6px;":"padding: 3px 7px;")},u(e.flaggedCount),5)])],4)):c("",!0),e.topLevelCount>0?(n(),o("div",{key:2,class:"rounded border mb-2",style:x({height:e.isCollapsed?"42px":"400px"})},[s("div",re,[s("div",{class:"d-flex justify-content-between align-items-center border-bottom ps-3 pe-3 pt-2 pb-2 pointer",style:x({backgroundColor:e.filterType==="toplevel"?"#ebedf0":""}),onClick:t[9]||(t[9]=(...i)=>e.handleTopLevelHeaderClick&&e.handleTopLevelHeaderClick(...i))},[t[29]||(t[29]=s("span",{class:"font-vsmall text-gray"},"SUGGESTED TOP-LEVEL LISTINGS",-1)),s("span",de,u(e.topLevelCount),1),s("span",null,[s("i",{class:k(["fa",e.isCollapsed?"fa-chevron-down":"fa-chevron-up"]),style:{cursor:"pointer"}},null,2)])],4),T(s("div",null,[s("div",ue,[s("span",ce,[s("i",{class:k(["bi font-vvsmall pointer me-1",e.isAllSelected?"bi-check-square-fill text-green":"bi-square text-gray"]),onClick:t[10]||(t[10]=(...i)=>e.toggleAllGroups&&e.toggleAllGroups(...i))},null,2),y(" "+u(e.checkedGroups.length)+" listings matched ",1),T(s("i",pe,null,512),[[v,{content:"Top-level listing automated matching uses your listing’s name and country to find close matches. Deselect any matches if you prefer to assign your own top-level listing.."}]])])])],512),[[R,!e.isCollapsed]]),T(s("div",me,[s("ul",fe,[(n(!0),o(w,null,S(e.filteredFrecords,(i,h)=>{var b;return n(),o("li",{key:i.source_name,class:k(["d-flex align-items-start mb-2 hover-list-item",{"bg-selected":e.isGroupSelected(i.source_name)}])},[s("i",{class:k(["bi font-vvsmall me-2 mt-1",e.isSelected(i.source_name)?"bi-check-square-fill text-green":"bi-square text-gray"]),onClick:$(l=>e.toggleCheckbox(i.source_name),["stop"]),style:{cursor:"pointer"}},null,10,ge),s("div",{onClick:l=>e.toggleSelectedGroup(i.source_name),style:{cursor:"pointer"}},[s("div",ve,u(i.source_name),1),s("div",ye,u(e.selectedTopSourceNames[i.source_name]||((b=i.top_source[0])==null?void 0:b.source_name)),1),s("input",{type:"hidden",value:e.selectedTopSourceNames[i.source_name]||""},null,8,be),s("input",{type:"hidden",value:e.selectedTopGlobalIds[i.source_name]||""},null,8,ke)],8,he)],2)}),128))])],512),[[R,!e.isCollapsed]])])],4)):c("",!0)]),s("div",we,[s("div",Ce,[e.filterType==="ready"?(n(),o("span",Se," Summary of Your Uploaded Listing ")):c("",!0),e.filterType==="flagged"?(n(),o("span",Te," Listings with Issues ")):c("",!0),e.filterType==="toplevel"?(n(),o("span",$e,[...t[31]||(t[31]=[y(" Suggested Top-Level Listings ",-1),s("i",{class:"bi bi-exclamation-circle-fill",style:{"font-size":"1.2em",color:"red","margin-right":"6px","vertical-align":"middle"}},null,-1)])])):c("",!0),e.filterType==="ready"?(n(),o("p",xe," Please review and confirm. These listings will be saved as inactive upon confirmation. ")):c("",!0),e.filterType==="flagged"?(n(),o("p",_e,[...t[32]||(t[32]=[s("span",null," We’ve found your uploaded listings with the following issues: ",-1),s("br",null,null,-1),s("span",{class:"mt-2"},[s("i",{class:"fa-solid fa-triangle-exclamation text-danger me-1",style:{"font-size":"1rem"}}),y(" Missing listing name/country ")],-1)])])):c("",!0),e.filterType==="toplevel"?(n(),o("p",Le,[...t[33]||(t[33]=[s("span",null," We’ve found close matches for your uploaded listings. You can select a top-level listing to group them for better search visibility, or proceed with the upload as is. ",-1)])])):c("",!0),s("div",Ie,[s("div",Me,[s("div",Fe,[e.filterType==="ready"?(n(),o("span",De,u(e.selectedRecords.length)+" listings uploaded — all currently selected ",1)):c("",!0),e.filterType==="flagged"?(n(),o("span",Re,u(e.flaggedCount)+" listings found ",1)):c("",!0),e.filterType==="toplevel"?(n(),o("span",Ae,u(e.topLevelRecordsCount)+" similar top level listings ",1)):c("",!0),e.filterType==="ready"&&e.records.some(i=>(!i.invalidFields||i.invalidFields.length===0)&&!i.selected)?(n(),o("span",{key:3,class:"font-vvsmall text-green pointer hover-underline ms-2",onClick:t[11]||(t[11]=(...i)=>e.selectAllRecords&&e.selectAllRecords(...i))}," Select All ")):c("",!0),e.filterType==="ready"&&e.records.some(i=>i.selected)?(n(),o("span",{key:4,class:"font-vvsmall text-green pointer hover-underline ms-2",onClick:t[12]||(t[12]=(...i)=>e.clearSelectedRecords&&e.clearSelectedRecords(...i))}," Clear Selection ")):c("",!0)]),s("div",Ge,[s("div",Be,[t[37]||(t[37]=s("span",{"data-bs-auto-close":"outside","data-bs-toggle":"dropdown",class:"text-uppercase font-vsmall bt
1n btn-primary btn-mt-custom-2"},[y(" Sort By "),s("i",{class:"fa-solid fa-chevron-down text-gray"})],-1)),s("ul",Ne,[s("li",Ee,[t[35]||(t[35]=s("span",{class:"text-uppercase font-vvsmall text-gray d-block mb-1 text-center"}," Sort Field ",-1)),T(s("select",{class:"form-select font-vvsmall text-gray ps-2 pe-2 p-1","onUpdate:modelValue":t[13]||(t[13]=i=>e.sortBy=i)},[...t[34]||(t[34]=[s("option",{value:"source_name"},"Listing Name",-1),s("option",{value:"country"},"Country",-1),s("option",{value:"language"},"Language",-1),s("option",{value:"type"},"Type",-1),s("option",{value:"distribution"},"Coverage",-1),s("option",{value:"frequency"},"Frequency",-1)])],512),[[F,e.sortBy]])]),s("li",Ve,[t[36]||(t[36]=s("span",{class:"text-uppercase font-vvsmall text-gray d-block mb-1 text-center"},"Order",-1)),T(s("select",{class:"form-select font-vvsmall text-gray ps-2 pe-2 p-1","onUpdate:modelValue":t[14]||(t[14]=i=>e.orderBy=i)},[(n(!0),o(w,null,S(e.global.order_type,(i,h)=>(n(),o("option",{value:h},u(i),9,qe))),256))],512),[[F,e.orderBy]])])])]),s("button",{class:"border-0 bg-white ms-2",onClick:t[15]||(t[15]=(...i)=>e.clear&&e.clear(...i))},[...t[38]||(t[38]=[s("i",{class:"text-black bi bi-arrow-clockwise"},null,-1)])]),e.viewType=="2"?(n(),o("button",{key:0,onClick:t[16]||(t[16]=i=>e.changeView("1")),class:"border-0 bg-white ms-2"},[...t[39]||(t[39]=[s("i",{class:"text-black bi bi-grid"},null,-1)])])):c("",!0),e.viewType=="1"?(n(),o("button",{key:1,onClick:t[17]||(t[17]=i=>e.changeView("2")),class:"border-0 bg-white ms-2"},[...t[40]||(t[40]=[s("i",{class:"text-black bi bi-table"},null,-1)])])):c("",!0)])])]),e.viewType==1?(n(),o("div",Pe,[e.filterType==="ready"||e.filterType==="flagged"?(n(),o("div",Ue,[s("div",Ye,[(n(!0),o(w,null,S(e.filteredRecords,(i,h)=>{var b,l,p;return n(),o("div",{class:"pointer",key:h,onClick:C=>e.toggleSelect(i)},[s("div",Oe,[s("div",null,[i.selected&&((b=i.invalidFields)==null?void 0:b.length)===0?(n(),o("i",je)):c("",!0),((l=i.invalidFields)==null?void 0:l.length)>0?T((n(),o("i",Je,null,512)),[[v,{content:(p=i.invalidFields)==null?void 0:p.join(", ")}]]):c("",!0),s("span",null,u(i.source_name),1)]),s("div",He,[s("div",We,[t[41]||(t[41]=s("small",{class:"text-muted"},"COUNTRY",-1)),t[42]||(t[42]=s("br",null,null,-1)),y(u(i.country),1)]),s("div",Ke,[t[43]||(t[43]=s("small",{class:"text-muted"},"LANGUAGE",-1)),t[44]||(t[44]=s("br",null,null,-1)),y(u(i.language),1)]),s("div",Qe,[t[45]||(t[45]=s("small",{class:"text-muted"},"TYPE",-1)),t[46]||(t[46]=s("br",null,null,-1)),y(u(i.type),1)]),s("div",Xe,[t[47]||(t[47]=s("small",{class:"text-muted"},"DISTRIBUTION",-1)),t[48]||(t[48]=s("br",null,null,-1)),y(u(i.distribution),1)]),s("div",Ze,[t[49]||(t[49]=s("small",{class:"text-muted"},"FREQUENCY",-1)),t[50]||(t[50]=s("br",null,null,-1)),y(u(i.frequency),1)]),s("div",et,[t[51]||(t[51]=s("small",{class:"text-muted"},"PRICE",-1)),t[52]||(t[52]=s("br",null,null,-1)),y(u(i.price||"-"),1)]),s("div",tt,[t[53]||(t[53]=s("small",{class:"text-muted"},"Publication ID",-1)),t[54]||(t[54]=s("br",null,null,-1)),y(u(i.client_source_id||"-"),1)])])])],8,ze)}),128))])])):c("",!0),e.filterType==="toplevel"?(n(),o("div",st,[e.isChecked?(n(),o("div",it,[(n(!0),o(w,null,S(e.topLevelRecords,(i,h)=>(n(),o("div",{class:"pointer",key:h,onClick:b=>e.toggleSelectTopLevel(i)},[s("div",ot,[s("div",null,[i.selected_record===!0?(n(),o("i",nt)):c("",!0),s("span",null,u(i.source_name),1)]),s("div",at,[s("div",rt,[t[55]||(t[55]=s("small",{class:"text-muted"},"COUNTRY",-1)),t[56]||(t[56]=s("br",null,null,-1)),y(u(i.country),1)]),s("div",dt,[t[57]||(t[57]=s("small",{class:"text-muted"},"LANGUAGE",-1)),t[58]||(t[58]=s("br",null,null,-1)),y(u(i.language),1)]),s("div",ut,[t[59]||(t[59]=s("small",{class:"text-muted"},"TYPE",-1)),t[60]||(t[60]=s("br",null,null,-1)),y(u(i.type),1)]),s("div",ct,[t[61]||(t[61]=s("small",{class:"text-muted"},"DISTRIBUTION",-1)),t[62]||(t[62]=s("br",null,null,-1)),y(u(i.distribution),1)]),s("div",pt,[t[63]||(t[63]=s("small",{class:"text-muted"},"FREQUENCY",-1)),t[64]||(t[64]=s("br",null,null,-1)),y(u(i.frequency),1)]),s("div",mt,[t[65]||(t[65]=s("small",{class:"text-muted"},"PRICE",-1)),t[66]||(t[66]=s("br",null,null,-1)),y(u(i.price||"-"),1)]),s("div",ft,[t[67]||(t[67]=s("small",{class:"text-muted"},"Publication ID",-1)),t[68]||(t[68]=s("br",null,null,-1)),y(u(i.client_source_id||"-"),1)])])])],8,lt))),128))])):(n(),o("div",gt,[(n(!0),o(w,null,S(e.topLevelRecords.slice(0,1),(i,h)=>(n(),o("div",{class:"pointer",key:h},[s("div",ht,[s("div",null,[s("span",vt,u(i.main_source_name),1)]),t[69]||(t[69]=s("div",{class:"row mt-2"},[s("div",{class:"col"}," This listing will remain unassigned and will become its own top-level listing. Check the box to assign it to one of the suggested listings. ")],-1))])]))),128))]))])):c("",!0)])):c("",!0),e.viewType==2?(n(),o("div",yt,[e.filterType==="ready"||e.filterType==="flagged"?(n(),o("div",bt,[s("table",kt,[t[70]||(t[70]=s("thead",{class:"table-light text-uppercase text-muted"},[s("tr",null,[s("th",{scope:"col",class:"text-center",style:{width:"5%"}}),s("th",{scope:"col",style:{width:"20%"},class:"text-gray fw-medium"}," Listing Name "),s("th",{scope:"col",style:{width:"10%"},class:"text-gray fw-medium"}," Country "),s("th",{scope:"col",style:{width:"10%"},class:"text-gray fw-medium"}," Language "),s("th",{scope:"col",style:{width:"15%"},class:"text-gray fw-medium"}," Type "),s("th",{scope:"col",style:{width:"10%"},class:"text-gray fw-medium"}," Distribution "),s("th",{scope:"col",style:{width:"10%"},class:"text-gray fw-medium"}," Frequency "),s("th",{scope:"col",class:"text-gray fw-medium",style:{width:"10%"}}," Price "),s("th",{scope:"col",class:"text-gray fw-medium",style:{width:"10%"}}," Publication ID ")])],-1)),s("tbody",wt,[(n(!0),o(w,null,S(e.filteredRecords,(i,h)=>(n(),o("tr",{key:h,class:k({"bg-missing-country cursor-not-allowed":i.invalidFields.includes("Country"),"cursor-not-allowed":i.invalidFields.length>0,"bg-selected pointer":i.selected&&i.invalidFields.length===0}),onClick:b=>e.toggleSelect(i)},[s("td",St,[i.selected&&i.invalidFields.length===0?(n(),o("i",Tt)):c("",!0),i.invalidFields.length>0?T((n(),o("i",$t,null,512)),[[v,{content:i.invalidFields.join(", ")}]]):c("",!0)]),s("td",null,u(i.source_name),1),s("td",null,u(i.country),1),s("td",null,u(i.language),
11),s("td",null,u(i.type),1),s("td",null,u(i.distribution),1),s("td",null,u(i.frequency),1),s("td",null,u(i.price),1),s("td",null,u(i.client_source_id),1)],10,Ct))),128))])])])):c("",!0),e.filterType==="toplevel"?(n(),o("div",xt,[e.isChecked?(n(),o("div",_t,[s("table",Lt,[t[71]||(t[71]=s("thead",{class:"table-light text-uppercase text-muted"},[s("tr",null,[s("th",{scope:"col",class:"text-center",style:{width:"5%"}}),s("th",{scope:"col",style:{width:"20%"},class:"text-gray fw-medium"}," Listing Name"),s("th",{scope:"col",style:{width:"12.5%"},class:"text-gray fw-medium"}," Country "),s("th",{scope:"col",style:{width:"12.5%"},class:"text-gray fw-medium"}," Language"),s("th",{scope:"col",style:{width:"15%"},class:"text-gray fw-medium"},"Type "),s("th",{scope:"col",style:{width:"12.5%"},class:"text-gray fw-medium"}," Distribution"),s("th",{scope:"col",style:{width:"12.5%"},class:"text-gray fw-medium"}," Frequency"),s("th",{scope:"col",class:"text-gray fw-medium",style:{width:"10%"}},"Price ")])],-1)),s("tbody",It,[(n(!0),o(w,null,S(e.topLevelRecords,(i,h)=>(n(),o("tr",{key:h,onClick:b=>e.toggleSelectTopLevel(i),class:k({"bg-selected pointer":i.selected_record===!0})},[s("td",Ft,[i.selected_record===!0?(n(),o("i",Dt)):c("",!0)]),s("td",null,u(i.source_name),1),s("td",null,u(i.country),1),s("td",null,u(i.language),1),s("td",null,u(i.type),1),s("td",null,u(i.distribution),1),s("td",null,u(i.frequency),1),s("td",null,u(i.price),1)],10,Mt))),128))])])])):(n(),o("div",Rt,[(n(!0),o(w,null,S(e.topLevelRecords.slice(0,1),(i,h)=>(n(),o("div",{class:"pointer",key:h},[s("div",At,[s("div",null,[s("span",Gt,u(i.main_source_name),1)]),t[72]||(t[72]=s("div",{class:"row mt-2"},[s("div",{class:"col"}," This listing will remain unassigned and will become its own top-level listing. Check the box to assign it to one of the suggested listings. ")],-1))])]))),128))]))])):c("",!0)])):c("",!0),t[73]||(t[73]=s("div",{class:"m-5 pb-3"},null,-1))])]),e.records?(n(),o("div",Bt,[s("button",{class:"btn btn-mt-custom text-gray font-vvsmall bg-white",onClick:t[18]||(t[18]=(...i)=>e.hideModal&&e.hideModal(...i))},"CANCEL"),s("button",{class:"btn btn-mt-custom text-gray font-vvsmall",onClick:t[19]||(t[19]=(...i)=>e.confirmSelection&&e.confirmSelection(...i))}," COMPLETE UPLOAD ")])):c("",!0)])):c("",!0)])])):c("",!0)]),_:1}),L(f,{isLoading:e.isLoading},null,8,["isLoading"])],64)}const Et=N(K,[["render",Nt],["__scopeId","data-v-7bd3f621"]]),Vt={name:"Listing",props:{tab:{type:String,default:""}},components:{Multiselect:J,AppLoadMore:H,AppLoader:B,AppNoRecord:E,BulkUpload:Et,AppSearchBar:W},mixins:[A],data(){return{activeSource:{},isLoading:!1,viewType:2,global:G,activeStatus:"",deactivatedStatus:"",sortBy:"create_timestamp",orderBy:"desc",keyword:"",keywordType:"source_name",records:!1,total:0,currentCount:0,isModalBulkUploadVisible:!1,isModalSupplierVisible:!1,checkStatus:[],checkType:[],checkDistribution:[],checkFrequency:[],size:20,summary:{active_source_count:0,inactive_source_count:0,confirmed_request_count:0,deactivation_count:0},dropdownVisible:null,hoveredMenu:null,activeTab:"all",checkStatus:[],selectedGroups:[],countryPrices:{},sourceIdTerms:{}}}
1,async created(){await this.getUserInfo(),await this.getSources()},computed:{sourceSorts(){return{sortBy:this.sortBy,orderBy:this.orderBy}},sourceFilters(){return{status:this.checkStatus,type:this.checkType,distribution:this.checkDistribution,supplierOnly:this.checkSupplierOnly}}},watch:{tab:{immediate:!0,handler(e){const a=["all","active","expiring","inactive"].includes(e),r=a?e:"all";if(!a){this.$router.replace({name:"Listing",params:{tab:"all"}});return}this.setTab(r)}},sourceFilters:{handler:"refresh",deep:!0},sourceSorts:{handler:"refresh",deep:!0}},methods:{isValidRecord(e){return[e.country,e.language,e.type,e.distribution,e.global_source_id].every(t=>t==null?void 0:t.toString().trim())},singleEntryNew(){this.$router.push({name:"SingleEntry",params:{id:"new"}})},async clear(){this.keyword="",this.keywordType="source_name",this.sortBy="create_timestamp",this.orderBy="desc",this.checkStatus=[],this.checkType=[],this.checkDistribution=[],this.checkFrequency=[]},changeView(e){const t=Number(e);this.viewType=t,t===1?this.size=21:this.size=20,this.refresh()},handleRowClick(e,t){const a=e.target.closest(".handleRowClick");let r="SingleEntry";this.activeLevelClient=="1"&&(r="InternalListingDetail"),a&&this.$router.push({name:r,params:{id:t.source_id}})},getDisableIconMeta(e){var r;let t={class:"",title:"",chkbx:!1};return e.price!==null&&e.price!==void 0&&e.price!==""&&e.price!==0||(r=this.countryPrices)!=null&&r[e.country]||(t.class="bi bi-exclamation-triangle-fill text-red ms-2",t.title="Price Missing/No Global Price",t.chkbx=!0,this.needsCountryPriceFetch=!0),t},getWarningIconMeta(e){let t={class:"",title:""};return!!e.terms||(t.class="bi bi-exclamation-triangle-fill text-red ms-2",t.title="Missing Terms",t.chkbx=!0),t},async selectAllGroups(){this.selectedGroups=this.records.filter(e=>!this.getDisableIconMeta(e).chkbx).map(e=>({source_id:e.source_id,source_name:e.source_name}))},clearSelectedGroups(){this.selectedGroups=[]},toggleSelectedGroup(e,t){const a=this.records.find(d=>d.source_id===e);if(!a||!a.global_source_id||[a.country,a.language,a.type,a.distribution].some(d=>!(d!=null&&d.toString().trim())))return;const r=this.selectedGroups.findIndex(d=>d.source_id===e);r===-1?this.selectedGroups.push({source_id:e,source_name:t}):this.selectedGroups.splice(r,1)},activateGroup(){if(this.selectedGroups.length===1){const e=this.selectedGroups[0];this.activateRecord(e);return}if(this.selectedGroups.length>1){this.activateRecordMultiple(this.selectedGroups);return}},setModalBulkUploadVisibility(e){this.isModalBulkUploadVisible=e,this.$router.push({name:"Listing",params:{tab:"all"}})},setModalSupplierVisibility(e,t={}){this.activeSource=t,this.isModalSupplierVisible=e},setTab(e){this.activeTab!==e&&(this.activeTab=e,this.checkStatus=[],this.getSources(),this.$route.params.tab!==e&&this.$router.push({name:"Listing",params:{tab:e}}))},onStatusCheckChanged(){this.activeTab="all",this.getSources()}
1,async refresh(){this.clearSelectedGroups(),await this.getSources(1)},async getSources(e=!1){this.isLoading=!0,g.reset(),g.status="",g.deactivateStatus="",g.supplierID=this.activeClient,this.checkStatus.includes("active")&&this.checkStatus.includes("inactive")?g.status="all":this.checkStatus.includes("active")?g.status=!0:this.checkStatus.includes("inactive")&&(g.status=!1),this.checkStatus.includes("flagged")&&(g.deactivateStatus=!0),this.keyword&&(g.keyword=this.keyword),this.keywordType&&(g.keywordType=this.keywordType),this.activeTab&&(g.activeTab=this.activeTab),this.checkType.length>0&&(g.type=this.checkType.join(",")),this.checkDistribution.length>0&&(g.distribution=this.checkDistribution.join(",")),this.sortBy&&(g.sortBy=this.sortBy),this.orderBy&&(g.orderBy=this.orderBy),e&&(g.start=e),g.size=this.size;let t=await g.getSupplierSources();t?(t.summary&&(this.summary=t.summary),!e||e==1?(this.records=t.data,this.currentCount=t.result):(this.records=this.records.concat(t.data),this.currentCount+=t.result),this.total=t.total):(this.records=!1,this.total=0,this.currentCount=0),this.isLoading=!1,this.$nextTick(()=>{this.needsCountryPriceFetch&&(this.fetchAllCountryPrices(),this.needsCountryPriceFetch=!1)})},toggleDropdown(e){this.dropdownVisible===e?this.dropdownVisible=null:(this.dropdownVisible=e,this.$nextTick(()=>{setTimeout(()=>{document.addEventListener("click",this.handleClickOutside)},0)}))},handleClickOutside(e){const t="dropdown_"+this.dropdownVisible;let a=this.$refs[t];Array.isArray(a)&&(a=a[0]),(!a||!a.contains(e.target))&&(this.dropdownVisible=null,document.removeEventListener("click",this.handleClickOutside))},async fetchAllCountryPrices(){var t;if(!Array.isArray(this.records)||this.records.length===0)return;const e=[...new Set(this.records.map(a=>a.country).filter(a=>!!a))];for(const a of e)try{g.data={supplier_id:this.activeClient,country:a};const r=await g.getSupplierSourceMarket(),d=Array.isArray(r==null?void 0:r.data)?r.data:[];this.countryPrices[a]=d.length>0?{country:d[0].country,price:((t=d[0].price)==null?void 0:t.toString())??"",market_price_id:d[0].market_price_id}:null}catch(r){console.error(`Failed to fetch market prices for ${a}`,r),this.countryPrices[a]=null}},async activateRecord(e){var r;this.dropdownVisible=null;const t=this.$router.resolve({name:"SupplierTerms"}).href;if((await this.confirmDialog().fire({title:"ACTIVATE LISTING",html:`
2                <div style="display: flex;flex-direction: column;gap: 8px;margin-top: 1rem;text-align: center;">
3                    <span style="text-align: center">You are about to activate the inactive listing:</span>
4                    <h5 style="text-align: center; margin: 5px; padding: 5px; background-color: #ebedf0; color: green">
5                        ${e.source_name}
6                    </h5>
7                    <span >Please ensure all information is accurate before proceeding.</span>
8                    <div style="display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 1rem;">
9                        <input type="checkbox" id="confirm-rights-checkbox" checked />
10                        <label for="confirm-rights-checkbox" style="margin: 0;">
11                            I confirm that we have the 
12                            <a href="${t}" target="_blank" rel="noopener noreferrer" style="color: green;">
13                                rights to sell this listing
14                            </a><span style="color: red">*</span>.
15                        </label>
16                    </div>
17                    <span style="font-size: 0.75rem; margin-top: 1rem;">
18                        <i class="bi bi-exclamation-circle-fill"
19                        style="font-size: 1.5em; color: red; margin-right: 6px; vertical-align: middle;"></i>
20                        Note: Listing information cannot be edited after activation unless the listing is deactivated.
21                    </span>
22                    <span style="font-size: 0.75rem; margin-top: 1.1rem;">
23                        Pricing and terms can still be updated at any time.
24                    </span>
25                </div>
26                `,icon:this.confirmIcon,showCancelButton:!0,reverseButtons:!0,confirmButtonText:"ACTIVATE",customClass:{confirmButton:"font-vvsmall bt
26n btn-outline-secondary btn-sm w-10 w-md-auto me-2",cancelButton:"font-vvsmall btn btn-outline-secondary btn-sm w-10 w-md-auto me-2",popup:(r=this.swalCustomClass)==null?void 0:r.popup},buttonsStyling:!1,preConfirm:()=>document.getElementById("confirm-rights-checkbox").checked?!0:(this.confirmDialog().showValidationMessage("You must confirm that you have the rights to sell this listing."),!1)})).isConfirmed){if(this.isLoading=!0,!(e!=null&&e.source_id)||!this.activeClient){console.error("Missing required IDs"),this.isLoading=!1;return}const d={status:1,filter:{supplier_id:this.activeClient,source_id:e.source_id}};g.data=d,g.action=1;try{await g.save()?(e.status=!0,await this.refresh(),this.alert("Listing activated successfully!")):this.showToast("Activation failed. Try again later.",500)}catch(m){console.error("Error during save:",m)}this.isLoading=!1}},async activateRecordMultiple(e){var r;this.dropdownVisible=null;const t=e.length;if((await this.confirmDialog().fire({title:"ACTIVATE LISTING(S)",html:`
27                <div style="display: flex;flex-direction: column;gap: 8px;margin-top: 1rem;text-align: center;">
28                    <span style="text-align: center">
29                        You are about to activate the selected 
30                        <span style="font-size: 1rem; color: green">${t}</span> listings.
31                    </span>
32                    <span>Please ensure all information is accurate before proceeding.</span>
33
34                    <span style="font-size: 0.75rem; margin-top: 1rem;">
35                        <i class="bi bi-exclamation-circle-fill"
36                        style="font-size: 1.5em; color: red; margin-right: 6px; vertical-align: middle;"></i>
37                        Note: Listing information cannot be edited after activation unless the listing is deactivated.
38                    </span>
39                    <span style="font-size: 0.75rem; margin-top: 1.1rem;">
40                        Pricing and terms can still be updated at any time.
41                    </span>
42                </div>
43                `,icon:this.confirmIcon,showCancelButton:!0,reverseButtons:!0,confirmButtonText:"ACTIVATE",customClass:{confirmButton:"font-vvsmall btn btn-outline-secondary btn-sm w-10 w-md-auto me-2",cancelButton:"font-vvsmall btn btn-outline-secondary btn-sm w-10 w-md-auto me-2",popup:(r=this.swalCustomClass)==null?void 0:r.popup},buttonsStyling:!1})).isConfirmed){if(this.isLoading=!0,!this.activeClient){console.error("Missing required IDs"),this.isLoading=!1;return}const d=e.map(f=>f.source_id),m={data:{supplier_id:this.activeClient,source_id:d}};g.data=m,g.action=10;try{await g.save()?(this.alert("Listing activated successfully!"),this.$router.push({name:"Listing",params:{tab:"active"}})):this.showToast("Activation failed. Try again later.",500)}catch(f){console.error("Error during save:",f)}this.isLoading=!1}},async deactivateRecord(e){var m;this.dropdownVisible=null;const a=O().clone().add(this.activeSourceDeactivationPeriod,"months"),r=this.formatDate(a,"MMMM DD YYYY");if((await this.confirmDialog().fire({title:"DEACTIVATE LISTING",html:`
44                <div style="display: flex;flex-direction: column;gap: 8px;text-align: left;"  class="m-0">
45                    <span style="text-align: center">You are about to deactivate this listing</span>
46                    <span style="text-align: center">This will be scheduled for deactivation on:</span>
47                    <h5 class="font-small fw-medium text-green text-center bg-light p-2 mw-50 w-100 rounded-1 mx-auto">
48                    ${r}
49                    </h5>
50                    <span class="text-center mx-auto">Note: Until the deactivation date, you are still required to
51                    deliver content to all buyers with active profiles that
52                    include this listing.</span>
53                </div>`,icon:this.confirmIcon,showCancelButton:!0,confirmButtonText:"CONFIRM",cancelButtonText:"CANCEL",reverseButtons:!0,customClass:{confirmButton:"text-uppercase font-vsmall p-2 pe-3 ps-3 btn btn-mt-custom ms-2",cancelButton:"text-uppercase font-vsmall p-2 pe-3 ps-3 btn btn-outline-secondary",popup:(m=this.swalCustomClass)==null?void 0:m.popup},buttonsStyling:!1,preConfirm:()=>!0})).isConfirmed){if(this.isLoading=!0,!(e!=null&&e.source_id)||!this.activeClient){console.error("Missing required IDs"),this.isLoading=!1;return}const f={status:0,filter:{supplier_id:this.activeClient,source_id:e.source_id}};g.data=f,g.action=1;try{await g.save()?(e.status=!0,this.alert("Listing deactivated successfully!"),await this.refresh()):this.showToast("Deactivation failed. Try again later.",500)}catch(v){console.error("Error during save:",v)}this.isLoading=!1}},async deleteRecord(e){var m;this.dropdownVisible=null;const t=new Date,a=new Date(t);a.setDate(t.getDate()+30);const r=a.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});if((await this.confirmDialog().fire({title:"DELETE LISTING",html:`
54                <div style="display: flex;flex-direction: column;gap: 8px;text-align: left;" class="m-0">
55                
56                    <span style="text-align: center">You are about to delete this listing</span>
57                    <span style="text-align: center">This will be scheduled for delete on.</span>
58                    <h5 style="text-align: center; margin: 5px; padding: 5px; background-color: #ebedf0; color: green">
59                    ${r}
60                    </h5>
61
62                    <div style="display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 1rem; text-align: left;">
63                        <input type="checkbox" id="confirm-rights-checkbox" />
64                        <label for="confirm-rights-checkbox" style="margin: 0;">
65                        I confirm to delete this listing*
66                        </label>
67                    </div>
68                    <span>Note: Until the deletion date, you are still required to
69                    deliver content to all buyers with active profiles that
70                    include this listing.</span>
71
72                </div>`,icon:this.confirmIcon,showCancelButton:!0,confirmButtonText:"DELETE",customClass:{confirmButton:"font-vvsmall btn btn-outline-secondary btn-sm w-10 w-md-auto me-2",cancelButton:"font-vvsmall btn btn-outline-secondary btn-sm w-10 w-md-auto",popup:(m=this.swalCustomClass)==null?void 0:m.popup},buttonsStyling:!1,preConfirm:()=>document.getElementById("confirm-rights-checkbox").checked?!0:(this.confirmDialog().showValidationMessage("You must confirm to delete this listing."),!1)})).isConfirmed){if(this.isLoading=!0,!(e!=null&&e.source_id)||!this.activeClient){console.error("Missing required IDs"),this.isLoading=!1;return}const f={filter:{supplier_id:this.activeClient,source_id:e.source_id}};g.data=f,g.action=4;try{await g.save()?(e.status=!0,this.alert("Listing deleted successfully!"),await this.refresh()):this.showToast("Delete failed. Try again later.",500)}catch(v){console.error("Error during save:",v)}this.isLoading=!1}}}},qt={class:"container"},Pt={class:"row px-3 pt-4 pb-4 border-bottom"},Ut={class:"col-12 col-md-6 text-center"},Yt={class:"d-flex justify-content-center flex-wrap gap-2"},zt={class:"col-12 mt-4"},Ot={class:"row m-0 p-0 align-items-center"},jt={class:"col-12 col-md-6"},Jt={key:0,class:"col-md-3 mt-3 mt-md-0 text-md-end text-center"},Ht={class:"dropdown"},Wt={class:"dropdown-menu","aria-labelledby":"dropdownMenu2"},Kt={class:"row pt-3 pb-3 m-0"},Qt={class:"col ps-2 pe-2 pt-3 pb-3 m-0 text-center border-1 border rounded ms-1 me-1"},Xt={class:"d-block text-black fw-semibold"},Zt={class:"col ps-2 pe-2 pt-3 pb-3 m-0 text-center border-1 border rounded ms-1 me-1"},es={class:"d-block text-black fw-semibold"},ts={class:"col ps-2 pe-2 pt-3 pb-3 m-0 text-center border-1 border rounded ms-1 me-1"},ss={class:"d-block text-black fw-semibold"},is={class:"bg-lgreen col ps-2 pe-2 pt-3 pb-3 m-0 text-center border-1 border rounded ms-1 me-1"},ls={class:"d-block text-black fw-semibold"},os={class:"bg-lred col ps-2 pe-2 pt-3 pb-3 m-0 text-center border-1 border rounded ms-1 me-1"},ns={class:"d-block text-black fw-semibold"},as={class:"row p-0 pt-2 pb-4 m-0"},rs={class:"mb-2"},ds={class:"clearfix float-start"},us={class:"clearfix float-start"},cs={class:"float-start p-1 ps-0 font-vsmall text-gray me-2"},ps={class:"ms-1 me-1"},ms={class:"ms-1 me-1"},fs={key:2,class:"font-vsmall text-gray ms-2"},gs={class:"clearfix float-end"},hs={class:"dropdown float-end ms-2"},vs={class:"dropdown-menu dropdown-menu-end mt-1"},ys={class:"dropdown-item no-hover"},bs=["value","id"],ks=["for"],ws={class:"dropdown-item no-hover"},Cs=["value","id"],Ss=["for"],Ts={class:"dropdown-item no-hover"},$s=["value","id"],xs=["for"],_s={class:"dropdown float-end"},Ls={class:"dropdown-menu dropdown-menu-end mt-1"},Is={class:"dropdown-item mb-2"},Ms={class:"dropdown-item"},Fs=["value"],Ds={key:0,class:"row p-0 m-0 mb-3"},Rs={class:"col-4 mb-4 pointer"},As=["onClick"],Gs={class:"card-body"},Bs={class:"clearfix mb-2"},Ns={class:"card-title text-black d-block float-start"},Es={key:0},Vs={key:0,class:"bi me-2 bi-square text-gray",title:"Disabled"},qs=["onClick"],Ps={class:"d-flex align-items-center gap-2 float-end"},Us={key:0,class:"bi bi-exclamation-triangle-fill text-gray","data-bs-toggle":"tooltip","data-bs-placement":"top",title:"Used as top level listing"},Ys={key:1},zs=["title"],Os=["title"],js={key:2,class:"bi bi-exclamation-triangle-fill text-orange","data-bs-placement":"top",title:"Missing meta data"},Js=["title"],Hs={class:"position-relative"},Ws={class:"d-flex font-vsmall"},Ks=["onClick"],Qs=["onClick"],Xs=["onClick"],Zs=["onClick"],ei={class:"row p-0 m-0"},ti={class:"col-4 p-0 m-0"},si={class:"d-block font-vsmall"},ii={class:"col-4 mb-3 p-0 m-0"},li={class:"d-block font-vsmall"},oi={class:"col-4 p-0 m-0"},ni={class:"d-block font-vsmall"},ai={class:"row p-0 m-0"},ri={class:"col-4 p-0 m-0"},di={class:"d-block font-vsmall"},ui={class:"col-4 mb-3 p-0 m-0"},ci={class:"d-block font-vsmall"},pi={class:"col-4 p-0 m-0"},mi={class:"d-block font-vsmall"},fi={key:1},gi={key:0,class:"table table-hover"},hi={key:0,width:"5%",class:"bg-light pt-2 pb-2 font-small"},vi=["onClick"],yi={key:0,class:"bi font-vvsmall pointer bi-square text-gray",title:"Disabled"},bi=["onClick"],ki={style:{"line-height":"1em"}},wi={class:"font-vsmall"},Ci={nowrap:""},Si={key:0,class:"bi bi-arrow-up-circle-fill text-gray ms-2","data-bs-toggle":"tooltip","data-bs-placement":"top",title:"Used as top level listing"},Ti={key:1},$i=["title"],xi=["title"],_i={key:2,class:"bi bi-exclamation-triangle-fill text-orange ms-2","data-bs-placement":"top",title:"Missing meta data"}
72,Li=["title"],Ii={nowrap:"nowrap"},Mi={class:"font-vsmall"},Fi={class:"d-flex font-vsmall"},Di={class:"d-flex font-vsmall"},Ri={class:"d-flex font-vsmall"},Ai={class:"d-flex font-vsmall"},Gi={class:"d-flex font-vsmall"},Bi={class:"d-flex font-vsmall"},Ni=["onClick"],Ei=["onClick"],Vi=["onClick"],qi=["onClick"],Pi={class:"row p-0 m-0"};function Ui(e,t,a,r,d,m){const f=I("AppSearchBar"),v=I("AppNoRecord"),i=I("AppLoader"),h=I("AppLoadMore"),b=I("BulkUpload");return n(),o("div",qt,[s("div",Pt,[t[43]||(t[43]=s("div",{class:"col-md-3 d-none d-md-block"}," ",-1)),s("div",Ut,[t[38]||(t[38]=s("span",{class:"text-center d-block text-uppercase font-small text-green fw-semibold mb-3"},"LISTINGS",-1)),t[39]||(t[39]=s("h6",{class:"d-block text-center mb-4",style:{"font-weight":"bolder"}},"Manage your content listings.",-1)),t[40]||(t[40]=s("p",{class:"d-block text-center font-vsmall mb-4"},"Add or upload content listings available for resale. ",-1)),s("div",Yt,[s("div",{onClick:t[0]||(t[0]=l=>e.setTab("all")),class:k([{active:e.activeTab==="all"},"tabs me-3 rounded-pill bg-light p-2 ps-4 pe-4"])},[...t[34]||(t[34]=[s("span",{class:"font-vsmall user-select-none text-uppercase"},"All",-1)])],2),s("div",{onClick:t[1]||(t[1]=l=>e.setTab("active")),class:k([{active:e.activeTab==="active"},"tabs me-3 rounded-pill bg-light p-2 ps-4 pe-4"])},[...t[35]||(t[35]=[s("span",{class:"font-vsmall user-select-none text-uppercase"},"Active",-1)])],2),s("div",{onClick:t[2]||(t[2]=l=>e.setTab("expiring")),class:k([{active:e.activeTab==="expiring"},"tabs rounded-pill bg-light p-2 ps-3 pe-3"])},[...t[36]||(t[36]=[s("span",{class:"font-vsmall user-select-none text-uppercase"},"Expiring",-1)])],2),s("div",{onClick:t[3]||(t[3]=l=>e.setTab("inactive")),class:k([{active:e.activeTab==="inactive"},"tabs rounded-pill bg-light p-2 ps-4 pe-4"])},[...t[37]||(t[37]=[s("span",{class:"font-vsmall user-select-none text-uppercase"},"Inactive",-1)])],2)])]),t[44]||(t[44]=s("div",{class:"col-md-3 d-flex justify-content-md-end justify-content-center mt-3 mt-md-0"},[s("a",{class:"font-vsmall text-gray align-self-start text-decoration-none",href:"https://connecthelp.mediatrack.org/",target:"_blank"},[s("i",{class:"bi bi-info-circle"}),y(" How it works ")])],-1)),s("div",zt,[s("div",Ot,[t[42]||(t[42]=s("div",{class:"col-md-3 d-none d-md-block"}," ",-1)),s("div",jt,[L(f,{keyword:e.keyword,type:e.keywordType,filter:e.global.sort_source_type,refresh:!0,onSet:e.setKeyword,onClear:e.clearKeyword},null,8,["keyword","type","filter","onSet","onClear"])]),e.activeLevelClient=="2"?(n(),o("div",Jt,[s("div",Ht,[t[41]||(t[41]=s("button",{class:"btn btn-secondary dropdown-toggle text-uppercase font-vsmall fw-semibold p-2 ps-3 pe-3 btn-mt-custom",type:"button",id:"dropdownMenu2","data-bs-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}," ADD LISTING ",-1)),s("div",Wt,[s("button",{class:"dropdown-item font-vsmall fw-medium",type:"button",onClick:t[4]||(t[4]=l=>e.singleEntryNew())},"SINGLE ENTRY"),s("button",{class:"dropdown-item font-vsmall fw-medium",type:"button",onClick:t[5]||(t[5]=l=>e.setModalBulkUploadVisibility(!0))},"BULK UPLOAD")])])])):c("",!0)])])]),t[83]||(t[83]=s("div",{class:"row p-0 pt-4 m-0"},[s("div",{class:"col-12"},[s("span",{class:"font-small text-uppercase fw-semibold pb-2 d-inline-block w-100"}," LISTING SUMMARY ")])],-1)),s("div",Kt,[s("div",Qt,[t[45]||(t[45]=s("span",{class:"mb-2 d-block text-uppercase font-vsmall"},"LISTINGS",-1)),s("h3",Xt,u(e.summary.active_source_count+e.summary.inactive_source_count),1)]),s("div",Zt,[t[46]||(t[46]=s("span",{class:"mb-2 d-block text-uppercase font-vsmall"},"Active",-1)),s("h3",es,u(e.summary.active_source_count),1)]),s("div",ts,[t[47]||(t[47]=s("span",{class:"mb-2 d-block text-uppercase font-vsmall"},"Inactive",-1)),s("h3",ss,u(e.summary.inactive_source_count),1)]),s("div",is,[t[48]||(t[48]=s("span",{class:"mb-2 d-block text-uppercase font-vsmall"},"Profile Request",-1)),s("h3",ls,u(e.summary.profile_count),1)]),s("div",os,[t[49]||(t[49]=s("span",{class:"mb-2 d-block text-uppercase font-vsmall"},"EXPIRING",-1)),s("h3",ns,u(e.summary.expiring_source_count),1)])]),s("div",as,[s("div",rs,[t[67]||(t[67]=s("p",{class:"font-vsmall mb-0 text-uppercase fw-medium pb-0 d-inline-block w-100"}
72,"LISTINGS",-1)),s("div",ds,[s("div",us,[s("span",cs,[t[50]||(t[50]=y(" Displaying ",-1)),s("strong",ps,u(e.currentCount),1),t[51]||(t[51]=y(" out of ",-1)),s("strong",ms,u(e.total),1),t[52]||(t[52]=y(" Sources. ",-1))]),e.activeTab==="inactive"?(n(),o(w,{key:0},[e.selectedGroups.length!=Object.keys(e.records).length?(n(),o("span",{key:0,onClick:t[6]||(t[6]=(...l)=>e.selectAllGroups&&e.selectAllGroups(...l)),class:"font-vsmall text-green pointer hover-underline"},[...t[53]||(t[53]=[s("i",{class:"bi bi-check2"},null,-1),y(" Select All ",-1)])])):c("",!0),e.selectedGroups.length>0?(n(),o("button",{key:1,onClick:t[7]||(t[7]=l=>e.activateGroup()),class:"text-uppercase font-vsmall btn btn-primary btn-mt-custom ms-2"}," ACTIVATE ")):c("",!0),e.selectedGroups.length>0?(n(),o("span",fs,u(e.selectedGroups.length)+" listings selected ",1)):c("",!0),e.selectedGroups.length>0?(n(),o("span",{key:3,onClick:t[8]||(t[8]=(...l)=>e.clearSelectedGroups&&e.clearSelectedGroups(...l)),class:"font-vsmall text-green pointer hover-underline ms-2"}," Clear Selection ")):c("",!0)],64)):c("",!0)])]),s("div",gs,[e.viewType=="2"?(n(),o("button",{key:0,onClick:t[9]||(t[9]=l=>e.changeView("1")),class:"border-0 bg-white float-end mt ms-2"},[...t[54]||(t[54]=[s("i",{class:"text-black bi bi-grid"},null,-1)])])):c("",!0),e.viewType=="1"?(n(),o("button",{key:1,onClick:t[10]||(t[10]=l=>e.changeView("2")),class:"border-0 bg-white float-end mt ms-2"},[...t[55]||(t[55]=[s("i",{class:"text-black bi bi-table"},null,-1)])])):c("",!0),s("button",{class:"border-0 bg-white float-end mt ms-2",onClick:t[11]||(t[11]=(...l)=>e.clear&&e.clear(...l))},[...t[56]||(t[56]=[s("i",{class:"text-black bi bi-arrow-clockwise"},null,-1)])]),s("div",hs,[t[62]||(t[62]=s("span",{"data-bs-auto-close":"outside","data-bs-toggle":"dropdown",class:"text-uppercase font-vsmall btn btn-primary btn-mt-custom-2"},[y("Filters "),s("i",{class:"fa-solid fa-sliders text-gray"})],-1)),s("ul",vs,[s("li",ys,[t[57]||(t[57]=s("span",{class:"text-uppercase font-vsmall text-black d-block mb-1 fw-semibold"},"STATUS",-1)),(n(!0),o(w,null,S(e.global.status_type,(l,p)=>(n(),o("div",{class:"form-check",key:p},[T(s("input",{class:"form-check-input",type:"checkbox",value:l.code,id:`chk-status-${p}`,"onUpdate:modelValue":t[12]||(t[12]=C=>e.checkStatus=C),onChange:t[13]||(t[13]=(...C)=>e.onStatusCheckChanged&&e.onStatusCheckChanged(...C))},null,40,bs),[[D,e.checkStatus]]),s("label",{class:"form-check-label text-gray font-vsmall",for:`chk-status-${p}`},u(l.name),9,ks)]))),128))]),t[60]||(t[60]=s("li",null,[s("hr",{class:"dropdown-divider"})],-1)),s("li",ws,[t[58]||(t[58]=s("span",{class:"text-uppercase font-vsmall text-black d-block mb-1 fw-semibold"},"Type",-1)),(n(!0),o(w,null,S(e.global.source_type,(l,p)=>(n(),o("div",{class:"form-check",key:p},[T(s("input",{class:"form-check-input",type:"checkbox",value:l.name,id:`chk-type-${p}`,"onUpdate:modelValue":t[14]||(t[14]=C=>e.checkType=C)},null,8,Cs),[[D,e.checkType]]),s("label",{class:"form-check-label text-gray font-vsmall",for:`chk-type-${p}`},u(l.name),9,Ss)]))),128))]),t[61]||(t[61]=s("li",null,[s("hr",{class:"dropdown-divider"})],-1)),s("li",Ts,[t[59]||(t[59]=s("span",{class:"text-uppercase font-vsmall text-black d-block mb-1 fw-semibold"},"Coverage",-1)),(n(!0),o(w,null,S(e.global.distribution_type,(l,p)=>(n(),o("div",{class:"form-check",key:p},[T(s("input",{class:"form-check-input",type:"checkbox",value:l,id:`chk-distribution-${p}`,"onUpdate:modelValue":t[15]||(t[15]=C=>e.checkDistribution=C)},null,8,$s),[[D,e.checkDistribution]]),s("label",{class:"form-check-label text-gray font-vsmall",for:`chk-distribution-${p}`},u(l),9,xs)]))),128))])])]),s("div",_s,[t[66]||(t[66]=s("span",{"data-bs-auto-close":"outside","data-bs-toggle":"dropdown",class:"float-end text-uppercase font-vsmall btn btn-primary btn-mt-custom-2"},[y("Sort By "),s("i",{class:"fa-solid fa-chevron-down text-gray"})],-1)),s("ul",Ls,[s("li",Is,[t[64]||(t[64]=s("span",{class:"text-uppercase font-vsmall text-gray d-block mb-1 text-center"},"Sort Field",-1)),T(s("select",{class:"form-select font-vsmall text-gray ps-2 pe-2 p-1","onUpdate:modelValue":t[16]||(t[16]=l=>e.sortBy=l)},[...t[63]||(t[63]=[j('<option value="source_name" data-v-700eee34>Source Name</option><option value="status" data-v-700eee34>Status</option><option value="create_timestamp" data-v-700eee34>Created Date</option><option value="country" data-v-700eee34>Country</option><option value="language" data-v-700eee34>Language</option><option value="type" data-v-700eee34>Type</option><option value="distribution" data-v-700eee34>Distribution</option>',7)])],512),[[F,e.sortBy]])]),s("li",Ms,[t[65]||(t[65]=s("span",{class:"text-uppercase font-vsmall text-gray d-block mb-1 text-center"},"Order",-1)),T(s("select",{class:"form-select font-vsmall text-gray ps-2 pe-2 p-1","onUpdate:modelValue":t[17]||(t[17]=l=>e.orderBy=l)},[(n(!0),o(w,null,S(e.global.order_type,(l,p)=>(n(),o("option",{value:p},u(l),9,Fs))),256))],512),[[F,e.orderBy]])])])])])])]),e.total>0?(n(),o("div",Ds,[e.viewType==1?(n(!0),o(w,{key:0},S(e.records,l=>(n(),o("div",Rs,[s("div",{class:"handleRowClick card shadow-sm",onClick:p=>e.handleRowClick(p,l)},[s("div",Gs,[s("div",Bs,[s("span",Ns,[e.activeTab==="inactive"?(n(),o("span",Es,[e.getDisableIconMeta(l).chkbx?(n(),o("i",Vs)):(n(),o("i",{key:1,class:k(["bi me-2 text-green",e.selectedGroups.some(p=>p.source_id===l.source_id)?"text-green bi-check-square-fill":"bi-square"]),onClick:$(p=>e.toggleSelectedGroup(l.source_id,l.source_name),["stop"])},null,10,qs))])):c("",!0),y(" "+u(l.source_name),1)]),s("div",Ps,[l.top_list_owner===!0?(n(),o("i",Us)):c("",!0),e.activeTab==="inactive"||e.activeTab==="all"?(n(),o("span",Ys,[e.getDisableIconMeta(l).class?(n(),o("i",{key:0,class:k(e.getDisableIconMeta(l).class),title:e.getDisableIconMeta(l).title,"data-bs-placement":"top"},null,10,zs)):c("",!0),e.getWarningIconMeta(l).class?(n(),o("i",{key:1,class:k(e.getWarningIconMeta(l).class),title:e.getWarningIconMeta(l).title,"data-bs-placement":"top"},null,10,Os)):c("",!0)])):c("",!0),[l.country,l.language,l.type,l.distribution,l.frequency].some(p=>!(p!=null&&p.toString().trim()))?(n(),o("i",js)):c("",!0),l.deactivation_date!==null&&l.deactivation_date!==""?(n(),o("i",{key:3,class:"bi bi-hourglass-split text-orange","data-bs-placement":"top",title:"This is scheduled for deactivation on: "+e.formatDate(l.deactivation_effective_date,"DD-MMMM YYYY")},null,8,Js)):c("",!0),s("i",{class:k([l.deactivated===!1&&l.draft===!1?"bi bi-toggle-on text-green":"bi bi-toggle-off text-gray","small","text-muted","align-middle"])},null,2),s("div",Hs,[s("span",Ws,[s("i",{class:"bi bi-three-dots-vertical cursor-pointer",onClick:$(p=>e.toggleDropdown(l.source_id),["stop"])},null,8,Ks)]),e.dropdownVisible===l.source_id?(n(),o("div",{key:0,ref_for:!0,ref:"dropdown_"+l.source_id,class:"position-absolute border rounded shadow p-2",onClick:t[24]||(t[24]=$(()=>{}
72,["stop"])),style:{top:"0",left:"0",transform:"translateY(-100%)","z-index":"1050","min-width":"160px","background-color":"#fff"}},[l.status===!0?(n(),o("div",{key:0,class:"dropdown-item small py-2 px-3 fw-normal text-dark",onClick:p=>e.deactivateRecord(l),onMouseover:t[18]||(t[18]=p=>e.hoveredMenu="deactivate"),onMouseleave:t[19]||(t[19]=p=>e.hoveredMenu=null),style:x([{backgroundColor:e.hoveredMenu==="deactivate"?"#f8f9fa":""},{cursor:"pointer"}])}," DEACTIVATE ",44,Qs)):l.status===!1?(n(),o(w,{key:1},[e.isValidRecord(l)?(n(),o("div",{key:0,class:"dropdown-item small py-2 px-3 fw-normal text-dark",onClick:p=>e.activateRecord(l),onMouseover:t[20]||(t[20]=p=>e.hoveredMenu="activate"),onMouseleave:t[21]||(t[21]=p=>e.hoveredMenu=null),style:x([{backgroundColor:e.hoveredMenu==="activate"?"#f8f9fa":""},{cursor:"pointer"}])}," ACTIVATE ",44,Xs)):c("",!0),!l.status&&l.draft?(n(),o("div",{key:1,class:"dropdown-item small py-2 px-3 fw-normal text-danger",onClick:p=>e.deleteRecord(l),onMouseover:t[22]||(t[22]=p=>e.hoveredMenu="delete"),onMouseleave:t[23]||(t[23]=p=>e.hoveredMenu=null),style:x([{backgroundColor:e.hoveredMenu==="delete"?"#f8f9fa":""},{cursor:"pointer"}])}," DELETE ",44,Zs)):c("",!0)],64)):c("",!0)],512)):c("",!0)])])]),s("div",null,[s("div",ei,[s("div",ti,[t[68]||(t[68]=s("span",{class:"mb-1 d-block text-gray font-vsmall text-uppercase"},"Country",-1)),s("span",si,u(l.country),1)]),s("div",ii,[t[69]||(t[69]=s("span",{class:"mb-1 d-block text-gray font-vsmall text-uppercase"},"Language",-1)),s("span",li,u(l.language),1)]),s("div",oi,[t[70]||(t[70]=s("span",{class:"mb-1 d-block text-gray font-vsmall text-uppercase"},"Type",-1)),s("span",ni,u(l.type),1)])]),s("div",ai,[s("div",ri,[t[71]||(t[71]=s("span",{class:"mb-1 d-block text-gray font-vsmall text-uppercase"},"Coverage",-1)),s("span",di,u(l.distribution),1)]),s("div",ui,[t[72]||(t[72]=s("span",{class:"mb-1 d-block text-gray font-vsmall text-uppercase"},"Frequency",-1)),s("span",ci,u(l.frequency),1)]),s("div",pi,[t[73]||(t[73]=s("span",{class:"mb-1 d-block text-gray font-vsmall text-uppercase"},"Profile Request",-1)),s("span",mi,u(l.profile_count),1)])])])])],8,As)]))),256)):c("",!0),e.viewType==2?(n(),o("div",fi,[e.total?(n(),o("table",gi,[s("thead",null,[s("tr",null,[e.activeTab==="inactive"?(n(),o("th",hi)):c("",!0),t[74]||(t[74]=s("th",{width:"20%",class:"bg-light pt-2 pb-2 text-uppercase text-gray fw-medium font-vsmall"}," Source Name",-1)),t[75]||(t[75]=s("th",{width:"10%",class:"bg-light pt-2 pb-2 text-uppercase text-gray fw-medium font-vsmall"}," Status",-1)),t[76]||(t[76]=s("th",{width:"10%",class:"bg-light pt-2 pb-2 text-uppercase text-gray fw-medium font-vsmall"}," Date Created",-1)),t[77]||(t[77]=s("th",{width:"15%",class:"bg-light pt-2 pb-2 text-uppercase text-gray fw-medium font-vsmall"}," Country",-1)),t[78]||(t[78]=s("th",{width:"10%",class:"bg-light pt-2 pb-2 text-uppercase text-gray fw-medium font-vsmall"}," Language",-1)),t[79]||(t[79]=s("th",{width:"10%",class:"bg-light pt-2 pb-2 text-uppercase text-gray fw-medium font-vsmall"}," Type",-1)),t[80]||(t[80]=s("th",{width:"10%",class:"bg-light pt-2 pb-2 text-uppercase text-gray fw-medium font-vsmall"}," Coverage",-1)),t[81]||(t[81]=s("th",{width:"10%",style:{"white-space":"nowrap"},class:"bg-light pt-2 pb-2 text-uppercase text-gray fw-medium font-vsmall"}," Search Profile",-1)),t[82]||(t[82]=s("th",{width:"5%",style:{"white-space":"nowrap"},class:"bg-light pt-2 pb-2 text-uppercase text-gray fw-medium font-vsmall"},null,-1))])]),s("tbody",null,[(n(!0),o(w,null,S(e.records,l=>(n(),o("tr",{class:"handleRowClick pointer",onClick:p=>e.handleRowClick(p,l)},[e.activeTab==="inactive"?(n(),o("td",{key:0,onClick:t[25]||(t[25]=$(()=>{},["stop"]))},[e.getDisableIconMeta(l).chkbx?(n(),o("i",yi)):(n(),o("i",{key:1,class:k(["bi text-green font-vvsmall pointer",e.selectedGroups.some(p=>p.source_id===l.source_id)?"text-green bi-check-square-fill":"bi-square"]),onClick:$(p=>e.toggleSelectedGroup(l.source_id,l.source_name),["stop"])},null,10,bi))])):c("",!0),s("td",ki,[s("span",wi,u(l.source_name),1)]),s("td",Ci,[s("i",{class:k([l.deactivated===!1&&l.draft===!1?"bi bi-toggle-on text-green":"bi bi-toggle-off text-gray","small","text-muted","align-middle"])},null,2),l.top_list_owner===!0?(n(),o("i",Si)):c("",!0),e.activeTab==="inactive"||e.activeTab==="all"?(n(),o("span",Ti,[e.getDisableIconMeta(l).class?(n(),o("i",{key:0,class:k(e.getDisableIconMeta(l).class),title:e.getDisableIconMeta(l).title,"data-bs-placement":"top"},null,10,$i)):c("",!0),e.getWarningIconMeta(l).class?(n(),o("i",{key:1,class:k(e.getWarningIconMeta(l).class),title:e.getWarningIconMeta(l).title,"data-bs-placement":"top"},null,10,xi)):c("",!0)])):c("",!0),[l.country,l.language,l.type,l.distribution,l.frequency].some(p=>!(p!=null&&p.toString().trim()))?(n(),o("i",_i)):c("",!0),l.deactivation_date!==null&&l.deactivation_date!==""?(n(),o("i",{key:3,class:"bi bi-hourglass-split text-orange ms-2","data-bs-placement":"top",title:"This is scheduled for deactivation on: "+e.formatDate(l.deactivation_effective_date,"DD-MMMM YYYY")},null,8,Li)):c("",!0)]),s("td",Ii,[s("span",Mi,u(e.formatDate(l.create_date,"DD-MMMM YYYY")),1)]),s("td",null,[s("span",Fi,u(l.country),1)]),s("td",null,[s("span",Di,u(l.language),
721)]),s("td",null,[s("span",Ri,u(l.type),1)]),s("td",null,[s("span",Ai,u(l.distribution),1)]),s("td",null,[s("span",Gi,u(l.profile_count),1)]),s("td",{class:"position-relative",onClick:t[32]||(t[32]=$(()=>{},["stop"]))},[s("span",Bi,[s("i",{class:"bi bi-three-dots-vertical cursor-pointer",onClick:p=>e.toggleDropdown(l.source_id)},null,8,Ni)]),e.dropdownVisible===l.source_id?(n(),o("div",{key:0,ref_for:!0,ref:"dropdown_"+l.source_id,class:"position-absolute border rounded shadow p-2",style:{top:"100%",right:"0","z-index":"1050","min-width":"160px","background-color":"#fff"}},[l.status===!0?(n(),o("div",{key:0,class:"dropdown-item font-vsmall py-2 px-3 fw-normal text-dark",onClick:p=>e.deactivateRecord(l),onMouseover:t[26]||(t[26]=p=>e.hoveredMenu="deactivate"),onMouseleave:t[27]||(t[27]=p=>e.hoveredMenu=null),style:x({backgroundColor:e.hoveredMenu==="deactivate"?"#f8f9fa":""})}," DEACTIVATE ",44,Ei)):l.status===!1?(n(),o(w,{key:1},[e.isValidRecord(l)?(n(),o("div",{key:0,class:"dropdown-item font-vsmall py-2 px-3 fw-normal text-dark",onClick:p=>e.activateRecord(l),onMouseover:t[28]||(t[28]=p=>e.hoveredMenu="activate"),onMouseleave:t[29]||(t[29]=p=>e.hoveredMenu=null),style:x({backgroundColor:e.hoveredMenu==="activate"?"#f8f9fa":""})}," ACTIVATE ",44,Vi)):c("",!0),!l.status&&l.draft?(n(),o("div",{key:1,class:"dropdown-item font-vsmall py-2 px-3 fw-normal text-danger",onClick:p=>e.deleteRecord(l),onMouseover:t[30]||(t[30]=p=>e.hoveredMenu="delete"),onMouseleave:t[31]||(t[31]=p=>e.hoveredMenu=null),style:x({backgroundColor:e.hoveredMenu==="delete"?"#f8f9fa":""})}," DELETE ",44,qi)):c("",!0)],64)):c("",!0)],512)):c("",!0)])],8,vi))),256))])])):c("",!0)])):c("",!0)])):c("",!0),s("div",Pi,[L(v,{type:"Sources",isLoading:e.isLoading,total:e.total},null,8,["isLoading","total"])]),L(i,{isLoading:e.isLoading},null,8,["isLoading"]),L(h,{size:e.size,total:e.total,current:e.currentCount,onLoadMore:e.getSources},null,8,["size","total","current","onLoadMore"]),L(b,{show:e.isModalBulkUploadVisible,onHide:t[33]||(t[33]=l=>e.setModalBulkUploadVisibility(!1))},null,8,["show"])])}const Ki=N(Vt,[["render",Ui],["__scopeId","data-v-700eee34"]]);export{Ki 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.