PageSourceSearch

https://app.planitprima.com/dist/myTrainingSession.a5a29fa5bb7c8d9b.bundle.js

js planitprima.com collected 2026-10-07 00:57:19 UTC 24,209 bytes, 1 lines download raw bytes

1"use strict";(globalThis["webpackChunkfrontend"]=globalThis["webpackChunkfrontend"]||[]).push([[1317],{25242:(e,t,i)=>{i.r(t),i.d(t,{default:()=>O});var s=i(20641),a=i(90033),l=i(89170),o=i(28378),n=i(76601),r=i(58969),c=i(40139),d=i(75503);const m={class:"px-4"},u={class:"pt-6 px-6"},h={class:"d-flex align-center justify-space-between mb-6"},f={class:"font-weight-medium"},p=["src"],y={key:1},_={key:2,class:"pt-4"},S={class:"d-flex align-center mb-6"},g={class:"font-weight-medium"},v={key:0,class:"ml-4"},k={class:"ml-auto pl-4"},C={key:1},I={key:2},b={class:"text-white"},w={key:3},F={key:4},T={key:5,class:"d-flex gap-2 flex-wrap"},x={key:6};function E(e,t,i,E,$,A){const D=(0,s.g2)("DownloadCertificatesModal"),R=(0,s.g2)("PlanitIcon"),L=(0,s.g2)("PlanitButton"),X=(0,s.g2)("PlanitDialog"),N=(0,s.g2)("PlanitAutocomplete"),P=(0,s.g2)("router-link"),V=(0,s.g2)("TooltipIcon"),B=(0,s.g2)("BaseCard");return(0,s.uX)(),(0,s.CE)("div",m,[$.showDownloadAllCertificatesModal?((0,s.uX)(),(0,s.Wv)(D,{key:0,"company-role":A.myCompanyRole,"finished-scorm-status":A.finishedScormStatus,dialog:$.showDownloadAllCertificatesModal,onClose:A.onCloseDownloadAllCertificatesModal},null,8,["company-role","finished-scorm-status","dialog","onClose"])):(0,s.Q3)("",!0),(0,s.bF)(X,{modelValue:$.certificatePreviewDialog,"onUpdate:modelValue":t[1]||(t[1]=e=>$.certificatePreviewDialog=e),persistent:"","max-width":"100rem","content-class":"bg-white"},{default:(0,s.k6)(()=>[(0,s.Lk)("div",u,[(0,s.Lk)("div",h,[(0,s.Lk)("h1",f,(0,a.v_)(e.$t("company.scorm_file.preview_certificate")),1),(0,s.bF)(L,{variant:"text",class:"icon-btn",onClick:t[0]||(t[0]=e=>$.certificatePreviewDialog=!1)},{default:(0,s.k6)(()=>[(0,s.bF)(R,{icon:"fal fa-times"})]),_:1})])]),(0,s.Lk)("div",null,[$.certificatePreviewUrl?((0,s.uX)(),(0,s.CE)("iframe",{key:0,src:$.certificatePreviewUrl,width:"100%",height:"800",frameborder:"0"},null,8,p)):(0,s.Q3)("",!0)])]),_:1},8,["modelValue"]),$.loading?((0,s.uX)(),(0,s.CE)("div",y,[(0,s.bF)(n.Z,{indeterminate:"",color:"primary"})])):((0,s.uX)(),(0,s.CE)("div",_,[(0,s.Lk)("div",S,[(0,s.Lk)("h1",g,(0,a.v_)(e.$t("components.nav_bar.my_training_session")),1),(0,s.bF)(N,{modelValue:$.selectedTrainingSessionId,"onUpdate:modelValue":[t[2]||(t[2]=e=>$.selectedTrainingSessionId=e),A.resetSelectedIteration],items:A.trainingSessions,"item-title":"name","item-value":"id",label:e.$t("company.scorm_file.training_session"),variant:"outlined",density:"compact","hide-details":"",style:{"max-width":"20rem"},class:"ml-4"},null,8,["modelValue","items","label","onUpdate:modelValue"]),$.selectedTrainingSessionId!==$.SHOW_CURRENT&&$.selectedTrainingSessionId!==$.COMPLETE_WITHOUT_TRAINING_SESSION?((0,s.uX)(),(0,s.CE)("div",v,[(0,s.bF)(N,{modelValue:$.selectedIteration,"onUpdate:modelValue":[t[3]||(t[3]=e=>$.selectedIteration=e),A.updateSelectedIteration],items:A.trainingSessionIterations,"item-title":"name","item-value":"id",label:e.$t("company.scorm_file.runs"),variant:"outlined",density:"compact","hide-details":"",style:{"max-width":"20rem"}},null,8,["modelValue","items","label","onUpdate:modelValue"])])):(0,s.Q3)("",!0),(0,s.Lk)("div",k,[A.activeLicensePermissionRole?((0,s.uX)(),(0,s.Wv)(L,{key:0,color:"primary",onClick:t[4]||(t[4]=e=>$.showDownloadAllCertificatesModal=!0)},{default:(0,s.k6)(()=>[(0,s.eW)((0,a.v_)(e.$t("company.scorm_file.download_certificates")),1)]),_:1})):(0,s.Q3)("",!0)])]),(0,s.bF)(c.h,{modelValue:$.tab,"onUpdate:modelValue":t[5]||(t[5]=e=>$.tab=e),color:"primary","hide-arrows":"",class:"mb-4"},{default:(0,s.k6)(()=>[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(A.visibleTabs,(e,t)=>((0,s.uX)(),(0,s.Wv)(d.U,{key:t,value:e.name},{default:(0,s.k6)(()=>[(0,s.eW)((0,a.v_)(e.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(A.visibleTabs,(i,c)=>((0,s.uX)(),(0,s.CE)(s.FK,{key:c},[i.name===$.tab?((0,s.uX)(),(0,s.Wv)(B,{key:0,"no-padding":"",color:"transparent"},{default:(0,s.k6)(()=>[(0,s.bF)(r.Z,null,{default:(0,s.k6)(()=>[(0,s.Lk)("thead",null,[(0,s.Lk)("tr",null,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(i.columns,(e,t)=>((0,s.uX)(),(0,s.CE)("th",{key:t},(0,a.v_)(e.text),1))),128))])]),(0,s.Lk)("tbody",null,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(i.data,r=>((0,s.uX)(),(0,s.CE)("tr",{key:r.id},[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(i.columns,(c,d)=>{var m,u;return(0,s.uX)(),(0,s.CE)("td",{key:d},["scorm_file.name"===c.key&&i.name===A.currentTrainingText&&r.scorm_file?((0,s.uX)(),(0,s.Wv)(P,{key:0,to:A.activeLicensePermissionRole?{name:"companyScormFile.detail",params:{scormFileId:null===(m=r.scorm_file)||void 0===m?void 0:m.id,companyId:A.company.id}}:""},{default:(0,s.k6)(()=>{var e;return[(0,s.bF)(R,{class:"mr-2",color:"primary",icon:A.getScormFileIconById(null===(e=r.scorm_file)||void 0===e?void 0:e.id)},null,8,["icon"]),(0,s.Lk)("span",null,(0,a.v_)(A.getTrainingName(r)),1)]}),_:2},1032,["to"])):"scorm_file.name"===c.key?((0,s.uX)(),(0,s.CE)("span",C,[(0,s.bF)(R,{class:"mr-2",color:"primary",icon:A.getScormFileIconById(null===(u=r.scorm_file)||void 0===u?void 0:u.id)},null,8,["icon"]),(0,s.Lk)("span",null,(0,a.v_)(A.getTrainingName(r)),1)])):"status"===c.key?((0,s.uX)(),(0,s.CE)("div",I,[(0,s.bF)(n.Z,{"model-value":r.progress,color:r.progress<100?"grey-darken-4":"success",height:"20",rounded:""},{default:(0,s.k6)(()=>[(0,s.Lk)("strong",b,(0,a.v_)(r.progress)+"%",1)]),_:2},1032,["model-value","color"])])):"session_start_date"===c.key||"session_end_date"===c.key?((0,s.uX)(),(0,s.CE)("span",w,(0,a.v_)(e.$filters.formatDate(A.getNestedValue(r,c.key))),1)):"scorm_file.name"==c.key||c.slot?"info"===c.key?((0,s.uX)(),(0,s.CE)("div",T,[(0,s.bF)(l.x,{size:"x-small",color:A.hasQuiz(r.scorm_file_id)?"primary":"secondary",variant:"tonal"},{default:(0,s.k6)(()=>[(0,s.eW)((0,a.v_)(A.hasQuiz(r.scorm_file_id)?e.$t("company.scorm_file.with_quiz"):e.$t("company.scorm_file.without_quiz")),1)]),_:2},1032,["color"]),A.getDurationLabel(r.scorm_file_id)?((0,s.uX)(),(0,s.Wv)(l.x,{key:0,size:"x-small",color:"grey-darken-1",variant:"tonal",class:"ml-1"},{default:(0,s.k6)(()=>[(0,s.bF)(o.w,{size:"x-small",class:"mr-1"},{default:(0,s.k6)(()=>t[6]||(t[6]=[(0,s.eW)(" fal fa-clock ",-1)])),_:1,__:[6]}),(0,s.eW)(" "+(0,a.v_)(A.getDurationLabel(r.scorm_file_id)),1)]),_:2},1024)):(0,s.Q3)("",!0)])):"certificate"===c.key?((0,s.uX)(),(0,s.CE)("span",x,[r.status===$.ScormStatus.FINISHED_SUCCESS?((0,s.uX)(),(0,s.Wv)(L,{key:0,color:"primary",variant:"text",class:"icon-btn px-2 ml-2",onClick:e=>A.openPreviewCertificate(r)},{default:(0,s.k6)(()=>[(0,s.bF)(V,{icon:"far fa-eye",tooltip:e.$t("company.scorm_file.preview_certificate"),small:""},null,8,["tooltip"])]),_:2},1032,["onClick"])):(0,s.Q3)("",!0),r.status===$.ScormStatus.FINISHED_SUCCESS?((0,s.uX)(),(0,s.Wv)(L,{key:1,color:"primary",variant:"text",class:"icon-btn px-2 ml-2",onClick:e=>r.downloadCertificate()},{default:(0,s.k6)(()=>[(0,s.bF)(V,{icon:"far fa-file-certificate",tooltip:e.$t("company.scorm_file.download_certificate"),small:""},null,8,["tooltip"])]),_:2},1032,["onClick"])):(0,s.Q3)("",!0)])):(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("span",F,(0,a.v_)(A.getNestedValue(r,c.key)),1))])}),128))]))),128))])]),_:2},1024)]),_:2},1024)):(0,s.Q3)("",!0)],64))),128))]))])}i(18111),i(22489),i(20116),i(30531),i(61701),i(18237),i(13579),i(17642),i(15024),i(31698);var $=i(84344),A=i(54989),D=i(45673),R=i(46982),L=i(66174),X=i(22957),N=i(97919);i(5626);const P="current",V="completed_without_training_session",B={name:"MyTrainingSession",components:{TooltipIcon:D.A,DownloadCertificatesModal:A.A,BaseCard:$.A},props:{companyId:{type:Number,required:!0}},data(){return{SHOW_CURRENT:P,COMPLETE_WITHOUT_TRAINING_SESSION:V,ScormStatus:R.NT,tab:null,certificatePreviewUrl:null,certificatePreviewDialog:!1,loading:!0,selectedTrainingSessionId:P,selectedIteration:P,selectedIterationDate:null,showDownloadAllCertificatesModal:!1}},computed:{isAdmin(){return N.A.getters["navbar/isAdmin"]},selectedTrainingSession(){return this.$store.getters["trainingSession/selectedTrainingSession"]},company(){return this.$store.getters["navbar/selectedCompany"]},myCompanyRole(){return this.$store.getters["trainingSession/companyRole"]},companyRoleScormStatus(){return this.myCompanyRole?this.$store.getters["trainingSession/companyRoleScormStatus"]:[]},trainingSessions(){return this.$store.getters["trainingSession/trainingSessionWithCurrentAndFinishedWithoutSessionItems"]},activeLicensePermissionRole(){return N.A.getters["auth/activeLicensePermissionRole"]},filteredCompanyRoleScormStatus:{get(){return this.filterAndSortScormStatus()},set(e){this.filteredCompanyRoleScormStatus=e}},enabledScormFiles(){const e=new Set(this.trainingSessions.filter(e=>e.id!==P).filter(e=>e.id!==V).flatMap(e=>e.session_scorm_links.map(e=>e.scorm_file_id))),t=new Set([...e]);return this.availableScormFiles.filter(e=>t.has(e.id))},availableScormFiles(){return N.A.getters["scormFile/availableScormFiles"]},activeTrainingSession(){return this.filteredCompanyRoleScormStatus.filter(this.isCurrentSession)},finishedScormStatus(){return this.filteredCompanyRoleScormStatus.filter(e=>e.status===R.NT.FINISHED_SUCCESS)},expiredScormStatus(){return this.filteredCompanyRoleScormStatus.filter(e=>e.is_expired&&e.status!==R.NT.FINISHED_SUCCESS)},today(){const e=new Date;return e.setHours(0,0,0,0),e},tabs(){return[{name:this.$t("company.scorm_file.open_trainings")+"("+this.activeTrainingSession.length+")",data:this.activeTrainingSession,columns:[{text:this.$t("company.scorm_file.training"),key:"scorm_file.name"},{text:this.$t("company.scorm_file.info"),key:"info",slot:!0},{text:this.$t("company.scorm_file.start_date"),key:"session_start_date"},{text:this.$t("company.scorm_file.end_date"),key:"session_end_date"},{text:this.$t("company.scorm_file.status"),key:"status"}],isVisible:this.selectedTrainingSessionId!==V&&this.selectedIteration===P},{name:this.$t("company.scorm_file.finished")+"("+this.finishedScormStatus.length+")",data:this.finishedScormStatus,columns:[{text:this.$t("company.scorm_file.training"),key:"scorm_file.name"},{text:this.$t("company.scorm_file.info"),key:"info",slot:!0},{text:this.$t("company.scorm_file.start_date"),key:"session_start_date"},{text:this.$t("company.scorm_file.end_date"),key:"session_end_date"},{text:this.$t("company.scorm_file.certificates"),key:"certificate",slot:!0}],isVisible:!0},{name:this.$t("company.scorm_file.expired")+"("+this.expiredScormStatus.length+")",data:this.expiredScormStatus,columns:[{text:this.$t("company.scorm_file.training"),key:"scorm_file.name"},{text:this.$t("company.scorm_file.info"),key:"info",slot:!0},{text:this.$t("company.scorm_file.start_date"),key:"session_start_date"},{text:this.$t("company.scorm_file.end_date"),key:"session_end_date"},{text:this.$t("company.scorm_file.status"),key:"status"}],isVisible:this.selectedTrainingSessionId!==P&&this.selectedTrainingSessionId!==V}]},visibleTabs(){return this.tabs.filter(e=>e.isVisible)},trainingSessionIterations(){return this.$store.getters["trainingSession/trainingSessionIterations"]},currentTrainingText(){return this.$t("company.scorm_file.open_trainings")+"("+this.activeTrainingSession.length+")"}},watch:{selectedTrainingSessionId(e,t){if(e)if(e!==P&&e!==V){const t=this.trainingSessions.find(t=>
1t.id===e);this.$store.dispatch("trainingSession/setSelectedTrainingSession",t),this.selectedTrainingSession.refreshCompanyRoleScormStatus(null,null,!1,this.myCompanyRole.id)}else e===P?this.myCompanyRole.refreshCompanyRoleScormStatus(!0):this.myCompanyRole.refreshCompanyRoleScormStatus(!1,!0)},selectedIteration(e,t){if(e)if(e!==P){const t=e.split(this.$t("company.scorm_file.to"))[0].trim(),i=e.split(this.$t("company.scorm_file.to"))[1].trim();this.selectedTrainingSession.refreshCompanyRoleScormStatus(t,i,!1,this.myCompanyRole.id)}else e===P&&this.selectedTrainingSession.refreshCompanyRoleScormStatus(this.selectedTrainingSession.start_date,this.selectedTrainingSession.end_date,!1,this.myCompanyRole.id)},visibleTabs(e){e.some(e=>e.name===this.tab)||(this.tab=e.length>0?e[0].name:"")}},async beforeMount(){await Promise.allSettled([X.A.deleteAll(),L.A.deleteAll()]),await this.refreshCompanyRoleScormStatus(),this.myCompanyRole?await X.A.$all({company_id:this.companyId,company_role_id:this.myCompanyRole.id}):this.isAdmin&&await X.A.$all({company_id:this.companyId}),this.loading=!1},created(){this.$store.dispatch("trainingSession/initCompanyRole"),this.company&&this.$store.dispatch("scormFile/refreshAvailableScormFiles",{company:this.company})},methods:{async refreshCompanyRoleScormStatus(){this.myCompanyRole&&await this.myCompanyRole.refreshCompanyRoleScormStatus(!0)},filterAndSortScormStatus(){let e=this.companyRoleScormStatus;if(!e)return[];if(this.selectedTrainingSessionId!==P&&this.selectedTrainingSessionId!==V){const t=this.selectedTrainingSession,i=t.session_scorm_links.map(e=>e.id);e=e.filter(e=>i.includes(e.session_scorm_link_id))}if(this.selectedIterationDate&&this.selectedIteration!==P){const{start:t,end:i}=this.selectedIterationDate,s=new Date(t),a=new Date(i);e=e.filter(e=>{const t=new Date(e.session_start_date),i=new Date(e.session_end_date);return t>=s&&i<=a})}return e.filter(e=>this.filterByEnabledOrFinished(e)).sort(this.sortByEndDate)},sortByEndDate(e,t){return e.session_end_date?t.session_end_date?new Date(e.session_end_date)-new Date(t.session_end_date):-1:1},filterByEnabledOrFinished(e){return this.enabledScormFiles.some(t=>t.id===e.scorm_file_id)||e.status===R.NT.FINISHED_SUCCESS},getTrainingName(e){var t;if(e.status===R.NT.FINISHED_SUCCESS){var i,s;const t=(null===(i=this.$i18n)||void 0===i?void 0:i.locale)||"de";return(null===(s=e.scorm_file_name_translations)||void 0===s?void 0:s[t])||Object.values(e.scorm_file_name_translations||{})[0]||this.$t("company.scorm_file.deleted_training")}return null===(t=e.scorm_file)||void 0===t?void 0:t.name},isCurrentSession(e){let t=!0;if(e.session_start_date){const i=new Date,s=new Date(e.session_start_date),a=e.session_end_date?new Date(e.session_end_date):null,l=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),o=l(i),n=l(s),r=a?l(a):null;t=(!n||o>=n)&&(!r||o<=r)}const i=[R.NT.STARTED,R.NT.INVITED,R.NT.FINISHED].includes(e.status),s=this.expiredScormStatus.some(t=>t.id===e.id);return i&&t&&!s},getNestedValue(e,t){return t.split(".").reduce((e,t)=>e?e[t]:null,e)},updateSelectedIteration(e){if(e!==P){const[t,i]=e.split(this.$t("company.scorm_file.to")).map(e=>e.trim());this.selectedIterationDate={start:t,end:i}}},resetSelectedIteration(e){this.selectedIteration=P,this.selectedIterationDate=null},getScormFileById(e){return this.availableScormFiles.find(t=>t.id===e)},getScormFileIconById(e){var t;const i=this.getScormFileById(e),s=null===i||void 0===i||null===(t=i.scorm_file_category_associations[0])||void 0===t||null===(t=t.scorm_file_category)||void 0===t?void 0:t.icon;return s?s+" fa-fw":"fal fa-fw fa-file-lines"},hasQuiz(e){const t=this.getScormFileById(e);return(null===t||void 0===t?void 0:t.completion_metric)===R.Ns.SCORE},getDurationLabel(e){const t=this.getScormFileById(e);return null!==t&&void 0!==t&&t.duration?this.$t("generic.minutes_short",{count:t.duration}):null},openPreviewCertificate(e){this.certificatePreviewUrl="/api/company-role-scorm-status/"+e.id+"/certificate?preview=true",this.certificatePreviewDialog=!0},calculateProgress(e){if(e&&e.data&&e.data.lesson_data){const t=e.data.lesson_data.length,i=e.scorm_file.data[e.scormFile.current_locale].total_slides;return Math.round(t/i*100)}return 0},async onCloseDownloadAllCertificatesModal(){this.showDownloadAllCertificatesModal=!1}}};var W=i(66262);const U=(0,W.A)(B,[["render",E]]),O=U},54989:(e,t,i)=>{i.d(t,{A:()=>P});var s=i(20641),a=i(90033),l=i(9111),o=i(76601),n=i(58969);const r={key:0,class:"pa-6"},c={key:1},d={class:"pa-6"},m={class:"d-flex align-center justify-space-between"},u={class:"font-weight-medium"},h={key:0},f={style:{"max-height":"50rem","overflow-y":"auto"}},p={style:{position:"sticky"}},y={style:{width:"54px"},class:"text-left"},_={class:"text-left"},S={key:0,class:"text-left"},g={class:"text-left"},v={key:0},k={class:"d-flex align-center justify-end pa-6"},C={key:1},I={class:"pa-6"};function b(e,t,i,b,w,F){const T=(0,s.g2)("IconButton"),x=(0,s.g2)("PlanitCheckbox"),E=(0,s.g2)("PlanitIcon"),$=(0,s.g2)("PlanitAlert"),A=(0,s.g2)("PlanitButton"),D=(0,s.g2)("PlanitDialog");return(0,s.uX)(),(0,s.CE)("div",null,[(0,s.bF)(D,{"model-value":i.dialog,persistent:"","no-click-animation":"","max-width":"90rem","content-class":"bg-white"},{default:(0,s.k6)(()=>[w.loading?((0,s.uX)(),(0,s.CE)("div",r,[(0,s.bF)(o.Z,{indeterminate:"",color:"primary"})])):(0,s.Q3)("",!0),w.loading?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("div",c,[(0,s.Lk)("div",d,[(0,s.Lk)("div",m,[(0,s.Lk)("h1",u,(0,a.v_)(e.$t("scorm_participants.download_certificates")),1),(0,s.bF)(T,{icon:"fa-times",large:"",onClick:t[0]||(t[0]=e=>F.closeDialog())})])]),w.finishedLocaleScormStatus.length?((0,s.uX)(),(0,s.CE)("div",h,[(0,s.Lk)("div",f,[(0,s.bF)(n.Z,null,{default:(0,s.k6)(()=>[(0,s.Lk)("thead",p,[(0,s.Lk)("tr",null,[(0,s.Lk)("th",y,[(0,s.bF)(x,{modelValue:w.allSelected,"onUpdate:modelValue":[t[1]||(t[1]=e=>w.allSelected=e),F.toggleSelectAll],"hide-details":"","model-value":w.allSelected},null,8,["modelValue","model-value","onUpdate:modelValue"])]),(0,s.Lk)("th",_,(0,a.v_)(e.$t("company.scorm_file.training")),1),i.isTrainingsAdmin?((0,s.uX)(),(0,s.CE)("th",S,(0,a.v_)(e.$t("company.scorm_file.participant")),1)):(0,s.Q3)("",!0),(0,s.Lk)("th",g,(0,a.v_)(e.$t("company.scorm_file.finished_at")),1)])]),(0,s.Lk)("tbody",null,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(w.finishedLocaleScormStatus,l=>{var o,n;return(0,s.uX)(),(0,s.CE)("tr",{key:l.id,style:{width:"100%"}},[(0,s.Lk)("td",null,[(0,s.bF)(x,{modelValue:w.selectedIds,"onUpdate:modelValue":t[2]||(t[2]=e=>w.selectedIds=e),value:l.id,"hide-details":""},null,8,["modelValue","value"])]),(0,s.Lk)("td",null,[(0,s.bF)(E,{class:"mr-2",color:"primary",size:"small",icon:F.getScormFileIconById(null===(o=l.scorm_file)||void 0===o?void 0:o.id)},null,8,["icon"]),(0,s.Lk)("span",null,(0,a.v_)(F.getScormFileName(l)),1)]),i.isTrainingsAdmin?((0,s.uX)(),(0,s.CE)("td",v,(0,a.v_)(F.getNameOrEmail(null===(n=l.company_role)||void 0===n?void 0:n.user)),1)):(0,s.Q3)("",!0),(0,s.Lk)("td",null,(0,a.v_)(e.$filters.formatDate(l.finished_at)),1)])}),128))])]),_:1})]),w.finishedLocaleScormStatus.length>100?((0,s.uX)(),(0,s.Wv)($,{key:0,color:"info",class:"mt-2"},{default:(0,s.k6)(()=>[(0,s.eW)((0,a.v_)(e.$t("company.scorm_file.download_certificate_with_many_crss")),1)]),_:1})):(0,s.Q3)("",!0),(0,s.Lk)("div",k,[w.downloadInProgress?((0,s.uX)(),(0,s.Wv)(l.x,{key:1,indeterminate:"",color:"primary"})):((0,s.uX)(),(0,s.Wv)(A,{key:0,color:"primary",onClick:t[3]||(t[3]=e=>F.downloadAllCertificates())},{default:(0,s.k6)(()=>[(0,s.eW)((0,a.v_)(e.$t("generic.download")),1)]),_:1}))])])):((0,s.uX)(),(0,s.CE)("div",C,[(0,s.Lk)("div",I,[(0,s.bF)($,{color:"info",border:"start"},{default:(0,s.k6)(()=>[(0,s.eW)((0,a.v_)(e.$t("company.scorm_file.no_finished_trainings")),1)]),_:1})])]))]))]),_:1},8,["model-value"])])}i(11558),i(18111),i(22489),i(20116),i(7588),i(61701);var w=i(41658),F=i(92464),T=i(97919),x=i(66174),E=(i(5626),i(70552)),$=i(46982),A=i(2543);const D="current",R="all",L={name:"DownloadCertificatesModal",components:{PlanitAlert:w.A,IconButton:F.A},props:{companyRole:{type:Object,required:!1,default:null},isTrainingsAdmin:{type:Boolean,required:!1},finishedScormStatus:{type:Array,required:!1,default:()=>[]},selectedIteration:{type:String,required:!1,default:""},trainingSession:{type:Object,required:!1,default:null},dialog:{type:Boolean,required:!0}},emits:["close"],data(){return{SHOW_ALL:R,SHOW_CURRENT:D,loading:!0,allSelected:!0,selectedIds:[],finishedLocaleScormStatus:[],downloadInProgress:!1,fileIds:[],timer:null}},computed:{user(){return T.A.getters["auth/user"]},availableScormFiles(){return T.A.getters["scormFile/availableScormFiles"]},company(){return T.A.getters["navbar/selectedCompany"]},companyRoleScormStatus(){return x.A.query().with("scorm_file").with("company_role.user").orderBy("company_role.user").all()},exportFiles(){return(0,A.sortBy)(E.A.query().where(e=>-1!==this.fileIds.indexOf(e.id)).all(),e=>-e.id)}},watch:{finishedLocaleScormStatus(e){this.selectedIds=e.map(e=>e.id)}},async beforeMount(){},async created(){if(this.isTrainingsAdmin){x.A.deleteAll();const e=[];
1if(this.trainingSession&&this.trainingSession.id!==R)if(this.selectedIteration&&!this.selectedIteration.includes(D)){const t=this.selectedIteration.split(this.$t("company.scorm_file.to"))[0].trim(),i=this.selectedIteration.split(this.$t("company.scorm_file.to"))[1].trim();e.push(this.trainingSession.refreshCompanyRoleScormStatus(t,i,!0))}else e.push(this.trainingSession.refreshCompanyRoleScormStatus(null,null,!0));else e.push(this.company.getCompanyRoleScormStatus(!0,!0));await Promise.allSettled(e),this.finishedLocaleScormStatus=this.companyRoleScormStatus,this.selectedIds=this.companyRoleScormStatus.map(e=>e.id)}this.companyRole&&(this.finishedLocaleScormStatus=this.finishedScormStatus,this.selectedIds=this.finishedLocaleScormStatus.map(e=>e.id)),this.loading=!1},beforeUnmount(){this.clearTimer()},methods:{downloadFile(e){const t=document.createElement("a");t.href=e.link,t.click()},setTimer(){this.clearTimer(),this.timer=setInterval(()=>{const e=this.exportFiles.filter(e=>e.export_status===$.FB.PROCESSING),t=this.exportFiles.filter(e=>e.export_status===$.FB.FINISHED);t.length==this.exportFiles.length?(t.forEach(e=>{this.downloadFile(e)}),this.downloadInProgress=!1,this.closeDialog()):e.forEach(e=>{e.refresh()})},2e3)},toggleSelectAll(){this.allSelected?this.selectedIds=this.finishedLocaleScormStatus.map(e=>e.id):this.selectedIds=[]},async downloadAllCertificates(){this.downloadInProgress=!0;let e=null;e=this.isTrainingsAdmin?await this.company.downloadAllScormFileCertificates(this.selectedIds):await this.companyRole.downloadAllScormFileCertificates(this.selectedIds),e?(e.save(),this.fileIds.push(e.response.data.id),this.setTimer()):this.downloadInProgress=!1},closeDialog(){this.clearTimer(),this.$emit("close")},getScormFileIconById(e){var t;if(!e)return"fal fa-file-certificate";const i=this.availableScormFiles.find(t=>t.id===e),s=null===i||void 0===i||null===(t=i.scorm_file_category_associations[0])||void 0===t||null===(t=t.scorm_file_category)||void 0===t?void 0:t.icon;return s||"fal fa-file-lines"},getScormFileName(e){if(e.scorm_file)return e.scorm_file.name;if(e.scorm_file_name_translations){var t;const i=(null===(t=this.$i18n)||void 0===t?void 0:t.locale)||"de";return e.scorm_file_name_translations[i]||Object.values(e.scorm_file_name_translations)[0]||this.$t("company.scorm_file.deleted_training")}return this.$t("company.scorm_file.deleted_training")},getNameOrEmail(e){return e.name||e.email},clearTimer(){this.timer&&(clearInterval(this.timer),this.timer=null)}}};var X=i(66262);const N=(0,X.A)(L,[["render",b]]),P=N},58969:(e,t,i)=>{i.d(t,{Z:()=>p,X:()=>f});var s=i(20641),a=i(90033),l=i(28312),o=i(52187),n=i(85435),r=i(51122),c=i(22995),d=i(17885),m=i(8064),u=i(70798),h=i(29340);const f=(0,c.j)({fixedHeader:Boolean,fixedFooter:Boolean,height:[Number,String],hover:Boolean,striped:{type:String,default:null,validator:e=>["even","odd"].includes(e)},...(0,l.u)(),...(0,o.r)(),...(0,n.X)(),...(0,r.yx)()},"VTable"),p=(0,d.RW)()({name:"VTable",props:f(),setup(e,t){let{slots:i,emit:l}=t;const{themeClasses:n}=(0,r.NX)(e),{densityClasses:c}=(0,o.Q)(e);return(0,m.C)(()=>{const t={VCheckboxBtn:{density:e.density}};return(0,s.bF)(e.tag,{class:(0,a.C4)(["v-table",{"v-table--fixed-height":!!e.height,"v-table--fixed-header":e.fixedHeader,"v-table--fixed-footer":e.fixedFooter,"v-table--has-top":!!i.top,"v-table--has-bottom":!!i.bottom,"v-table--hover":e.hover,"v-table--striped-even":"even"===e.striped,"v-table--striped-odd":"odd"===e.striped},n.value,c.value,e.class]),style:(0,a.Tr)(e.style)},{default:()=>[i.top?.(),(0,s.bF)(h.K,{defaults:t},{default:()=>[i.default?(0,s.Lk)("div",{class:"v-table__wrapper",style:{height:(0,u.Dg)(e.height)}},[(0,s.Lk)("table",null,[i.default()])]):i.wrapper?.()]}),i.bottom?.()]})}),{}}})}}]);

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.