1import{T as w}from"./tabulator.min-NWc-ChHA.js";import{A as y}from"./AssessorsLayout-D-b3xaLV.js";import{i as b,Z as x,r as d,f as c,a as u,w as h,b as r,l as k,o as p,F as f,j as _,t as m,p as F,T as C}from"./app-B9KORyBa.js";import{_ as M}from"./Modal-Bzvoe6wK.js";import{_ as S,a as D,b as O,c as j}from"./EyeOutline-BJItCWaF.js";import{_ as N}from"./CheckmarkCircleOutline-D-9-1wJh.js";import{P as L}from"./PrimaryButton-vaEit9c1.js";import"./moment-BLMuvzoS.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ApplicationLogo-DrAX-EpC.js";import"./NavLink-BiVKPBr8.js";import"./TextOutline-CGLkonHp.js";import"./DocumentTextOutline-B7A647Cs.js";import"./InformationCircleOutline-DCl6slX2.js";const I={name:"TabulatorView",components:{AssessorsLayout:y,Head:x,Link:b,Modal:M,EyeOutline:j,TrashOutline:O,CheckmarkCircleOutline:N,EditOutline:D,CloseCircleOutline:S,PrimaryButton:L},props:{regforms:{type:Array,default:()=>[]},user:{type:Array,default:()=>[]},userId:{type:Number},scholarships:{type:Number,default:()=>[]},filters:{type:Object,default:()=>({scholarship_name:"",average_grade:"",rating:""})}},data(){return{table:null,localFilters:{...this.filters},filters:{scholarship_name:"",average_grade:"",rating:""}}},mounted(){const t=sessionStorage.getItem("filters");t&&(this.localFilters=JSON.parse(t)),this.initializeTable(),this.applyFilters()},methods:{initializeTable(){this.table=new w(this.$refs.tabulator,{data:this.regforms,layout:"fitColumns",responsiveLayout:"hide",pagination:"local",paginationSizeSelector:[30,50,100,500,1e3],paginationSize:30,columns:[{title:"ID",field:"id",width:100},{title:"Stipendija",field:"scholarship_name",headerFilter:"input"},{title:"VÄrds",field:"form_data",headerFilter:"input",headerFilterFunc:function(t,e,s,a){if(!e)return!1;try{const i=JSON.parse(e),l=Object.entries(i||{}),n=l.length?l[0][1]:"";return String(n).toLowerCase().includes(String(t).toLowerCase())}catch{return!1}},formatter:function(t){try{const e=JSON.parse(t.getValue()),s=Object.entries(e||{});return s.length?s[0][1]:""}catch{return""}}},{title:"UzvÄrds",field:"form_data",headerFilter:"input",headerFilterFunc:function(t,e,s,a){if(!e)return!1;try{const i=JSON.parse(e),l=Object.entries(i||{}),n=l.length?l[1][1]:"";return String(n).toLowerCase().includes(String(t).toLowerCase())}catch{return!1}},formatter:function(t){try{const e=JSON.parse(t.getValue()),s=Object.entries(e||{});return s.length?s[1][1]:""}catch{return""}}},{title:"VidÄjÄ atzÄ«me",field:"form_data",headerFilter:"input",formatter:t=>{try{return JSON.parse(t.getValue()).school_rating||"N/A"}catch{return"Invalid Data"}}},{title:"KomentÄrs",field:"comment",headerFilter:"input",formatter:t=>{try{const e=t.getValue();if(!e)return"";const s=JSON.parse(e);return(s==null?void 0:s[this.userId])||""}catch(e){return console.error("Invalid JSON data:",e),""}}},{title:"VÄrtÄjums",field:"rating",headerFilter:"input",formatter:t=>{try{const e=t.getValue();if(!e)return"";const s=JSON.parse(e);return(s==null?void 0:s[this.userId])||""}catch(e){return console.error("Invalid JSON data:",e),""}}},{title:"NoraidÄ«ts sÄkotnÄji",field:"declined_other",headerFilter:"input",hozAlign:"center",formatter:t=>{let e=t.getValue(),s=t.getRow().getData(),a="";return s.declined_other_mail==1&&(a='<svg data-v-69f7d44a="" xmlns="http://www.w3.org/2000/svg" class="inline-block w-6 m-l-3 fill-green-600 text-green-600" viewBox="0 0 512 512"><rect x="48" y="96" width="416" height="320" rx="40" ry="40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M112 160l144 112 144-112"></svg>'),e==1?'<svg xmlns="http://www.w3.org/2000/svg" class="inline-block ionicon w-6 text-red-600" viewBox="0 0 512 512"><path d="M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 320L192 192M192 320l128-128"></path></svg>'+a:""+a}},{width:150,title:"DarbÄ«bas",field:"actions",formatter:()=>` 2 <div class="flex space-x-2"> 3 <button class="view-btn text-blue-500"><svg class="view-btn" style="height:20px" xmlns="http://www.w3.org/2000/svg" :class="styleClasses" viewBox="0 0 512 512"><path d="M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 00-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 000-17.47C428.89 172.28 347.8 112 255.66 112z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32"/></svg></button> 4 <button class="edit-btn text-green-500"><svg class="edit-btn" style="height:20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M384 224v184a40 40 0 01-40 40H104a40 40 0 01-40-40V168a40 40 0 0140-40h167.48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path d="M459.94 53.25a16.06 16.06 0 00-23.22-.56L424.35 65a8 8 0 000 11.31l11.34 11.32a8 8 0 0011.34 0l12.06-12c6.1-6.09 6.67-16.01.85-22.38zM399.34 90L218.82 270.2a9 9 0 00-2.31 3.93L208.16 299a3.91 3.91 0 004.86 4.86l24.85-8.35a9 9 0 003.93-2.31L422 112.66a9 9 0 000-12.66l-9.95-10a9 9 0 00-12.71 0z"/></svg></button> 5<!-- <button class="delete-btn text-red-500"><svg class="delete-btn" style="height:20px" xmlns="http://www.w3.org/2000/svg" :class="styleClasses" viewBox="0 0 512 512"><path d="M112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M80 112h352"/><path d="M192 112V72h0a23.93 23.93 0 0124-24h80a23.93 23.93 0 0124 24h0v40M256 176v224M184 176l8 224M328 176l-8 224" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg></button>--> 6 </div> 7 `,cellClick:(t,e)=>{const s=e.getRow().getData().id,a=t.target;a.classList.contains("view-btn")?window.location.href=route("assessor.evaluation.show",{evaluation:s}):a.classList.contains("edit-btn")?window.location.href=route("assessor.evaluation.edit",{evaluation:s}):a.classList.contains("delete-btn")&&window.openDeleteModal(s)}}]})},openDeleteModal(t){this.evaluationIdToDelete=t,this.showDeleteModal=!0},closeDeleteModal(){this.showDeleteModal=!1,this.evaluationIdToDelete=null},deleteAssessor(t){C({}).delete(route("admin.evaluation.destroy",{evaluation:t}),{onSuccess:()=>{this.closeDeleteModal()},preserveState:!1})},applyFilters(){const t=[];this.localFilters.scholarship_name&&t.push({field:"scholarship_name",type:"like",value:this.localFilters.scholarship_name}),this.localFilters.average_grade&&t.push({field:"form_data",type:"function",value:e=>{try{return JSON.parse(e)["VidÄjÄ atzÄ«me"]>=this.localFilters.average_grade}catch{return!1}}}),this.table.setFilter(t),sessionStorage.setItem("filters",JSON.stringify(this.localFilters))},resetFilters(){this.localFilters={scholarship_name:"",average_grade:""},this.table.clearFilter(),sessionStorage.removeItem("filters")}}},z={class:"flex"},A={class:"font-semibold text-xl text-gray-800 leading-tight"},J={class:"py-12 space-y-5"},T={class:"flex space-x-4 mb-4"},B=["value"],P={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg p-4 space-y-4"},H={ref:"tabulator",class:"tabulator-table"},E={class:"space-y-5"},R={class:"p-4 space-y-5"},U={class:"flex space-x-4"};function K(t,e,s,a,i,l){const n=d("Head"),g=d("Modal"),v=d("AssessorsLayout");return p(),c(f,null,[u(n,{title:"Assessors"}),u(v,null,{header:h(()=>[e[6]||(e[6]=r("div",{class:"flex"},[r("h2",{class:"font-semibold text-xl text-gray-800 leading-tight"},"Pieteikumu izvÄrtÄÅ¡ana"),r("div",{class:"flex-grow"}
7)],-1)),r("div",z,[r("h2",A,"VÄrtÄtÄjs: "+m(s.user.name),1),e[5]||(e[5]=r("div",{class:"flex-grow"},null,-1))])]),default:h(()=>[r("div",null,[r("div",J,[r("div",T,[k(r("select",{"onUpdate:modelValue":e[0]||(e[0]=o=>i.localFilters.scholarship_name=o),class:"border rounded px-2 py-1",onChange:e[1]||(e[1]=(...o)=>l.applyFilters&&l.applyFilters(...o)),style:{width:"300px","width-max":"300px"}},[e[7]||(e[7]=r("option",{value:""},"Visas",-1)),(p(!0),c(f,null,_(s.scholarships,o=>(p(),c("option",{key:o.name,value:o.name},m(o.name),9,B))),128))],544),[[F,i.localFilters.scholarship_name]]),r("button",{onClick:e[2]||(e[2]=(...o)=>l.resetFilters&&l.resetFilters(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"NotÄ«rÄ«t filtrus")]),r("div",P,[r("div",H,null,512)])])]),u(g,{show:t.showDeleteModal,onClose:l.closeDeleteModal},{default:h(()=>[r("div",E,[e[10]||(e[10]=r("div",{class:"w-full bg-gray-200 py-2 px-4"},[r("p",{class:"text-gray-700 font-bold"},"Delete confirmation")],-1)),r("div",R,[e[9]||(e[9]=r("h1",{class:"text-gray-700"},"Are you sure you want to delete this regform?",-1)),r("div",U,[e[8]||(e[8]=r("div",{class:"flex-grow"},null,-1)),r("div",{class:"border border-gray-900 font-semibold text-white bg-gray-900 rounded-lg py-1 px-3 cursor-pointer",onClick:e[3]||(e[3]=(...o)=>l.closeDeleteModal&&l.closeDeleteModal(...o))},"Cancel"),r("div",{class:"border border-red-600 font-semibold text-white bg-red-600 rounded-lg py-1 px-3 cursor-pointer",onClick:e[4]||(e[4]=o=>l.deleteAssessor(t.evaluationIdToDelete))}," Delete ")])])])]),_:1},8,["show","onClose"])]),_:1})],64)}const ae=V(I,[["render",K],["__scopeId","data-v-d5c1d182"]]);export{ae 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.