import{i as B,D as y,e as s,k as D,_ as C,r as h,o as n,c as u,a as f,t as k,b as v,f as i,F}from"./index-20f16f2f.js";import{D as N,k as g}from"./DateAndResourceTimeTable-5ccd4f8a.js";import"./timeline-435273bb.js";const T={name:"PagePrintingtimeline",components:{DateAndResourceTimeTable:N},props:{classroom:{type:String,required:!0},mode:{type:String,required:!0},resource:{type:String,default:""},date:{type:String,required:!0},hideConfidence:{type:Boolean,default:!1}},setup(t){const o=B(D.resourceStore),c=y.today(),e=s(()=>o.resources.value.find(r=>r.id===t.classroom)??null),l=s(()=>{if(!t.date)return null;try{return t.date.split(",").map(r=>y.fromISOFormat(r))}catch{return null}}),d=s(()=>o.resources.value.find(r=>r.id===t.resource)??null),m=s(()=>t.mode==="date-teacher"?o.resources.value.filter(r=>r.type==="teacher"):d.value?[d.value]:null),_=s(()=>{var r;if(t.mode==="resource-date"){const a=o.resources.value.find(p=>p.id===t.resource);return!a||a.type==="classroom"?"":a.type==="student"?t.hideConfidence?`${g(a.lastNameKana)[0].toUpperCase()}. ${g(a.firstNameKana)[0].toUpperCase()}. 様`:`${a.lastName} ${a.firstName} 様`:`${a.lastName} ${a.firstName}`}else if(t.mode==="date-teacher")return((r=l.value)==null?void 0:r[0].strftime("%Y/%m/%d"))??""});return{today:c,classroom:e,dates:l,resources:m,title:_}}};const E={key:0,class:"page"},S={class:"header"},A={key:1},b={key:2},x={key:3};function R(t,o,c,e,l,d){const m=h("DateTime"),_=h("DateAndResourceTimeTable");return n(),u(F,null,[e.classroom&&e.dates&&e.resources?(n(),u("div",E,[f("header",S,[f("h1",null,k(e.title),1),f("small",null,[v(m,{value:e.today,format:"%Y/%m/%d"},null,8,["value"])])]),v(_,{classroom:e.classroom,mode:c.mode==="date-teacher"?"date":"resource",dates:e.dates,resources:e.resources,class:"printingtimetable","hide-confidence":c.hideConfidence},null,8,["classroom","mode","dates","resources","hide-confidence"])])):i("",!0),e.classroom?i("",!0):(n(),u("p",A,"教室がみつかりません。")),e.dates?i("",!0):(n(),u("p",b,"日付の形式が不正です。")),e.resources?i("",!0):(n(),u("p",x,"リソースがみつかりません。"))],64)}const K=C(T,[["render",R],["__scopeId","data-v-79e6ec05"]]);export{K as default};
