-1}function eF(a,u){var p=this.__data__,v=Ed(p,a);return v<0?(++this.size,p.push([a,u])):p[v][1]=u,this}cs.prototype.clear=K2,cs.prototype.delete=Q2,cs.prototype.get=Z2,cs.prototype.has=J2,cs.prototype.set=eF;function ds(a){var u=-1,p=a==null?0:a.length;for(this.clear();++u=u?a:u)),a}function zr(a,u,p,v,T,C){var A,M=u&_,q=u&y,ee=u&b;if(p&&(A=T?p(a,v,T,C):p(a)),A!==n)return A;if(!$t(a))return a;var te=ze(a);if(te){if(A=i$(a),!M)return Zn(a,A)}else{var re=Rn(a),he=re==jt||re==qn;if(Ks(a))return S0(a,M);if(re==Vt||re==Y||he&&!T){if(A=q||he?{}:q0(a),!M)return q?VF(a,gF(A,a)):zF(a,Q1(A,a))}else{if(!kt[re])return T?a:{};A=s$(a,re,M)}}C||(C=new fi);var Te=C.get(a);if(Te)return Te;C.set(a,A),mx(a)?a.forEach(function(Ae){A.add(zr(Ae,u,p,Ae,a,C))}):px(a)&&a.forEach(function(Ae,nt){A.set(nt,zr(Ae,u,p,nt,a,C))});var Ne=ee?q?Qm:Km:q?er:sn,Qe=te?n:Ne(a);return Hr(Qe||a,function(Ae,nt){Qe&&(nt=Ae,Ae=a[nt]),du(A,nt,zr(Ae,u,p,nt,a,C))}),A}function _F(a){var u=sn(a);return function(p){return Z1(p,a,u)}}function Z1(a,u,p){var v=p.length;if(a==null)return!v;for(a=St(a);v--;){var T=p[v],C=u[T],A=a[T];if(A===n&&!(T in a)||!C(A))return!1}return!0}function J1(a,u,p){if(typeof a!="function")throw new Wr(o);return yu(function(){a.apply(n,p)},u)}function fu(a,u,p,v){var T=-1,C=cd,A=!0,M=a.length,q=[],ee=u.length;if(!M)return q;p&&(u=It(u,mr(p))),v?(C=_m,A=!1):u.length>=i&&(C=su,A=!1,u=new Fo(u));e:for(;++TT?0:T+p),v=v===n||v>T?T:Ge(v),v<0&&(v+=T),v=p>v?0:_x(v);p0&&p(M)?u>1?_n(M,u-1,p,v,T):Hs(T,M):v||(T[T.length]=M)}return T}var Dm=E0(),n0=E0(!0);function ji(a,u){return a&&Dm(a,u,sn)}function Nm(a,u){return a&&n0(a,u,sn)}function Od(a,u){return Bs(u,function(p){return gs(a[p])})}function qo(a,u){u=Gs(u,a);for(var p=0,v=u.length;a!=null&&pu}function bF(a,u){return a!=null&>.call(a,u)}function SF(a,u){return a!=null&&u in St(a)}function xF(a,u,p){return a>=Tn(u,p)&&a=120&&te.length>=120)?new Fo(A&&te):n}te=a[0];var re=-1,he=M[0];e:for(;++re-1;)M!==a&&bd.call(M,q,1),bd.call(a,q,1);return a}function p0(a,u){for(var p=a?u.length:0,v=p-1;p--;){var T=u[p];if(p==v||T!==C){var C=T;ms(T)?bd.call(a,T,1):Hm(a,T)}}return a}function qm(a,u){return a+wd(V1()*(u-a+1))}function jF(a,u,p,v){for(var T=-1,C=tn(xd((u-a)/(p||1)),0),A=z(C);C--;)A[v?C:++T]=a,a+=p;return A}function Um(a,u){var p="";if(!a||u<1||u>Ee)return p;do u%2&&(p+=a),u=wd(u/2),u&&(a+=a);while(u);return p}function et(a,u){return ig(H0(a,u,tr),a+"")}function IF(a){return K1(Ya(a))}function MF(a,u){var p=Ya(a);return qd(p,$o(u,0,p.length))}function mu(a,u,p,v){if(!$t(a))return a;u=Gs(u,a);for(var T=-1,C=u.length,A=C-1,M=a;M!=null&&++TT?0:T+u),p=p>T?T:p,p<0&&(p+=T),T=u>p?0:p-u>>>0,u>>>=0;for(var C=z(T);++v>>1,A=a[C];A!==null&&!_r(A)&&(p?A<=u:A=i){var ee=u?null:QF(a);if(ee)return fd(ee);A=!1,T=su,q=new Fo}else q=u?[]:M;e:for(;++v=v?a:Vr(a,u,p)}var b0=C2||function(a){return gn.clearTimeout(a)};function S0(a,u){if(u)return a.slice();var p=a.length,v=B1?B1(p):new a.constructor(p);return a.copy(v),v}function Vm(a){var u=new a.constructor(a.byteLength);return new yd(u).set(new yd(a)),u}function BF(a,u){var p=u?Vm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function HF(a){var u=new a.constructor(a.source,i1.exec(a));return u.lastIndex=a.lastIndex,u}function WF(a){return cu?St(cu.call(a)):{}}function x0(a,u){var p=u?Vm(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function w0(a,u){if(a!==u){var p=a!==n,v=a===null,T=a===a,C=_r(a),A=u!==n,M=u===null,q=u===u,ee=_r(u);if(!M&&!ee&&!C&&a>u||C&&A&&q&&!M&&!ee||v&&A&&q||!p&&q||!T)return 1;if(!v&&!C&&!ee&&a=M)return q;var ee=p[v];return q*(ee=="desc"?-1:1)}}return a.index-u.index}function T0(a,u,p,v){for(var T=-1,C=a.length,A=p.length,M=-1,q=u.length,ee=tn(C-A,0),te=z(q+ee),re=!v;++M1?p[T-1]:n,A=T>2?p[2]:n;for(C=a.length>3&&typeof C=="function"?(T--,C):n,A&&Wn(p[0],p[1],A)&&(C=T<3?n:C,T=1),u=St(u);++v-1?T[C?u[A]:A]:n}}function P0(a){return hs(function(u){var p=u.length,v=p,T=Yr.prototype.thru;for(a&&u.reverse();v--;){var C=u[v];if(typeof C!="function")throw new Wr(o);if(T&&!A&&Fd(C)=="wrapper")var A=new Yr([],!0)}for(v=A?v:p;++v1&&st.reverse(),te&&qM))return!1;var ee=C.get(a),te=C.get(u);if(ee&&te)return ee==u&&te==a;var re=-1,he=!0,Te=p&R?new Fo:n;for(C.set(a,u),C.set(u,a);++re1?"& ":"")+u[v],u=u.join(p>2?", ":" "),a.replace(lM,`{
+/* [wrapped with `+u+`] */
+`)}function a$(a){return ze(a)||Ho(a)||!!(Y1&&a&&a[Y1])}function ms(a,u){var p=typeof a;return u=u??Ee,!!u&&(p=="number"||p!="symbol"&&vM.test(a))&&a>-1&&a%1==0&&a0){if(++u>=B)return arguments[0]}else u=0;return a.apply(n,arguments)}}function qd(a,u){var p=-1,v=a.length,T=v-1;for(u=u===n?v:u;++p1?a[u-1]:n;return p=typeof p=="function"?(a.pop(),p):n,tx(a,p)});function nx(a){var u=k(a);return u.__chain__=!0,u}function yq(a,u){return u(a),a}function Ud(a,u){return u(a)}var vq=hs(function(a){var u=a.length,p=u?a[0]:0,v=this.__wrapped__,T=function(C){return Lm(C,a)};return u>1||this.__actions__.length||!(v instanceof rt)||!ms(p)?this.thru(T):(v=v.slice(p,+p+(u?1:0)),v.__actions__.push({func:Ud,args:[T],thisArg:n}),new Yr(v,this.__chain__).thru(function(C){return u&&!C.length&&C.push(n),C}))});function bq(){return nx(this)}function Sq(){return new Yr(this.value(),this.__chain__)}function xq(){this.__values__===n&&(this.__values__=gx(this.value()));var a=this.__index__>=this.__values__.length,u=a?n:this.__values__[this.__index__++];return{done:a,value:u}}function wq(){return this}function Tq(a){for(var u,p=this;p instanceof kd;){var v=X0(p);v.__index__=0,v.__values__=n,u?T.__wrapped__=v:u=v;var T=v;p=p.__wrapped__}return T.__wrapped__=a,u}function Rq(){var a=this.__wrapped__;if(a instanceof rt){var u=a;return this.__actions__.length&&(u=new rt(this)),u=u.reverse(),u.__actions__.push({func:Ud,args:[sg],thisArg:n}),new Yr(u,this.__chain__)}return this.thru(sg)}function kq(){return y0(this.__wrapped__,this.__actions__)}var Eq=Nd(function(a,u,p){gt.call(a,p)?++a[p]:fs(a,p,1)});function Cq(a,u,p){var v=ze(a)?L1:yF;return p&&Wn(a,u,p)&&(u=n),v(a,De(u,3))}function Oq(a,u){var p=ze(a)?Bs:t0;return p(a,De(u,3))}var Pq=O0(K0),Lq=O0(Q0);function Dq(a,u){return _n(Bd(a,u),1)}function Nq(a,u){return _n(Bd(a,u),we)}function Aq(a,u,p){return p=p===n?1:Ge(p),_n(Bd(a,u),p)}function rx(a,u){var p=ze(a)?Hr:zs;return p(a,De(u,3))}function ix(a,u){var p=ze(a)?JM:e0;return p(a,De(u,3))}var jq=Nd(function(a,u,p){gt.call(a,p)?a[p].push(u):fs(a,p,[u])});function Iq(a,u,p,v){a=Jn(a)?a:Ya(a),p=p&&!v?Ge(p):0;var T=a.length;return p<0&&(p=tn(T+p,0)),Vd(a)?p<=T&&a.indexOf(u,p)>-1:!!T&&Na(a,u,p)>-1}var Mq=et(function(a,u,p){var v=-1,T=typeof u=="function",C=Jn(a)?z(a.length):[];return zs(a,function(A){C[++v]=T?hr(u,A,p):pu(A,u,p)}),C}),Fq=Nd(function(a,u,p){fs(a,p,u)});function Bd(a,u){var p=ze(a)?It:a0;return p(a,De(u,3))}function $q(a,u,p,v){return a==null?[]:(ze(u)||(u=u==null?[]:[u]),p=v?n:p,ze(p)||(p=p==null?[]:[p]),d0(a,u,p))}var qq=Nd(function(a,u,p){a[p?0:1].push(u)},function(){return[[],[]]});function Uq(a,u,p){var v=ze(a)?ym:j1,T=arguments.length<3;return v(a,De(u,4),p,T,zs)}function Bq(a,u,p){var v=ze(a)?e2:j1,T=arguments.length<3;return v(a,De(u,4),p,T,e0)}function Hq(a,u){var p=ze(a)?Bs:t0;return p(a,Yd(De(u,3)))}function Wq(a){var u=ze(a)?K1:IF;return u(a)}function Yq(a,u,p){(p?Wn(a,u,p):u===n)?u=1:u=Ge(u);var v=ze(a)?pF:MF;return v(a,u)}function zq(a){var u=ze(a)?hF:$F;return u(a)}function Vq(a){if(a==null)return 0;if(Jn(a))return Vd(a)?ja(a):a.length;var u=Rn(a);return u==Rt||u==mn?a.size:Mm(a).length}function Gq(a,u,p){var v=ze(a)?vm:qF;return p&&Wn(a,u,p)&&(u=n),v(a,De(u,3))}var Xq=et(function(a,u){if(a==null)return[];var p=u.length;return p>1&&Wn(a,u[0],u[1])?u=[]:p>2&&Wn(u[0],u[1],u[2])&&(u=[u[0]]),d0(a,_n(u,1),[])}),Hd=O2||function(){return gn.Date.now()};function Kq(a,u){if(typeof u!="function")throw new Wr(o);return a=Ge(a),function(){if(--a<1)return u.apply(this,arguments)}}function sx(a,u,p){return u=p?n:u,u=a&&u==null?a.length:u,ps(a,U,n,n,n,n,u)}function ox(a,u){var p;if(typeof u!="function")throw new Wr(o);return a=Ge(a),function(){return--a>0&&(p=u.apply(this,arguments)),a<=1&&(u=n),p}}var ag=et(function(a,u,p){var v=S;if(p.length){var T=Ws(p,Ha(ag));v|=j}return ps(a,v,u,p,T)}),ax=et(function(a,u,p){var v=S|x;if(p.length){var T=Ws(p,Ha(ax));v|=j}return ps(u,v,a,p,T)});function lx(a,u,p){u=p?n:u;var v=ps(a,E,n,n,n,n,n,u);return v.placeholder=lx.placeholder,v}function ux(a,u,p){u=p?n:u;var v=ps(a,I,n,n,n,n,n,u);return v.placeholder=ux.placeholder,v}function cx(a,u,p){var v,T,C,A,M,q,ee=0,te=!1,re=!1,he=!0;if(typeof a!="function")throw new Wr(o);u=Xr(u)||0,$t(p)&&(te=!!p.leading,re="maxWait"in p,C=re?tn(Xr(p.maxWait)||0,u):C,he="trailing"in p?!!p.trailing:he);function Te(Xt){var hi=v,ys=T;return v=T=n,ee=Xt,A=a.apply(ys,hi),A}function Ne(Xt){return ee=Xt,M=yu(nt,u),te?Te(Xt):A}function Qe(Xt){var hi=Xt-q,ys=Xt-ee,Ox=u-hi;return re?Tn(Ox,C-ys):Ox}function Ae(Xt){var hi=Xt-q,ys=Xt-ee;return q===n||hi>=u||hi<0||re&&ys>=C}function nt(){var Xt=Hd();if(Ae(Xt))return st(Xt);M=yu(nt,Qe(Xt))}function st(Xt){return M=n,he&&v?Te(Xt):(v=T=n,A)}function yr(){M!==n&&b0(M),ee=0,v=q=T=M=n}function Yn(){return M===n?A:st(Hd())}function vr(){var Xt=Hd(),hi=Ae(Xt);if(v=arguments,T=this,q=Xt,hi){if(M===n)return Ne(q);if(re)return b0(M),M=yu(nt,u),Te(q)}return M===n&&(M=yu(nt,u)),A}return vr.cancel=yr,vr.flush=Yn,vr}var Qq=et(function(a,u){return J1(a,1,u)}),Zq=et(function(a,u,p){return J1(a,Xr(u)||0,p)});function Jq(a){return ps(a,J)}function Wd(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new Wr(o);var p=function(){var v=arguments,T=u?u.apply(this,v):v[0],C=p.cache;if(C.has(T))return C.get(T);var A=a.apply(this,v);return p.cache=C.set(T,A)||C,A};return p.cache=new(Wd.Cache||ds),p}Wd.Cache=ds;function Yd(a){if(typeof a!="function")throw new Wr(o);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function e3(a){return ox(2,a)}var t3=UF(function(a,u){u=u.length==1&&ze(u[0])?It(u[0],mr(De())):It(_n(u,1),mr(De()));var p=u.length;return et(function(v){for(var T=-1,C=Tn(v.length,p);++T=u}),Ho=i0(function(){return arguments}())?i0:function(a){return Ht(a)&>.call(a,"callee")&&!W1.call(a,"callee")},ze=z.isArray,g3=R1?mr(R1):TF;function Jn(a){return a!=null&&zd(a.length)&&!gs(a)}function Gt(a){return Ht(a)&&Jn(a)}function _3(a){return a===!0||a===!1||Ht(a)&&Hn(a)==pe}var Ks=L2||vg,y3=k1?mr(k1):RF;function v3(a){return Ht(a)&&a.nodeType===1&&!vu(a)}function b3(a){if(a==null)return!0;if(Jn(a)&&(ze(a)||typeof a=="string"||typeof a.splice=="function"||Ks(a)||Wa(a)||Ho(a)))return!a.length;var u=Rn(a);if(u==Rt||u==mn)return!a.size;if(_u(a))return!Mm(a).length;for(var p in a)if(gt.call(a,p))return!1;return!0}function S3(a,u){return hu(a,u)}function x3(a,u,p){p=typeof p=="function"?p:n;var v=p?p(a,u):n;return v===n?hu(a,u,n,p):!!v}function ug(a){if(!Ht(a))return!1;var u=Hn(a);return u==Bt||u==Fe||typeof a.message=="string"&&typeof a.name=="string"&&!vu(a)}function w3(a){return typeof a=="number"&&z1(a)}function gs(a){if(!$t(a))return!1;var u=Hn(a);return u==jt||u==qn||u==ae||u==qr}function fx(a){return typeof a=="number"&&a==Ge(a)}function zd(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=Ee}function $t(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function Ht(a){return a!=null&&typeof a=="object"}var px=E1?mr(E1):EF;function T3(a,u){return a===u||Im(a,u,Jm(u))}function R3(a,u,p){return p=typeof p=="function"?p:n,Im(a,u,Jm(u),p)}function k3(a){return hx(a)&&a!=+a}function E3(a){if(c$(a))throw new We(s);return s0(a)}function C3(a){return a===null}function O3(a){return a==null}function hx(a){return typeof a=="number"||Ht(a)&&Hn(a)==Qn}function vu(a){if(!Ht(a)||Hn(a)!=Vt)return!1;var u=vd(a);if(u===null)return!0;var p=gt.call(u,"constructor")&&u.constructor;return typeof p=="function"&&p instanceof p&&md.call(p)==R2}var cg=C1?mr(C1):CF;function P3(a){return fx(a)&&a>=-Ee&&a<=Ee}var mx=O1?mr(O1):OF;function Vd(a){return typeof a=="string"||!ze(a)&&Ht(a)&&Hn(a)==as}function _r(a){return typeof a=="symbol"||Ht(a)&&Hn(a)==La}var Wa=P1?mr(P1):PF;function L3(a){return a===n}function D3(a){return Ht(a)&&Rn(a)==Ao}function N3(a){return Ht(a)&&Hn(a)==am}var A3=Md(Fm),j3=Md(function(a,u){return a<=u});function gx(a){if(!a)return[];if(Jn(a))return Vd(a)?di(a):Zn(a);if(ou&&a[ou])return p2(a[ou]());var u=Rn(a),p=u==Rt?Rm:u==mn?fd:Ya;return p(a)}function _s(a){if(!a)return a===0?a:0;if(a=Xr(a),a===we||a===-we){var u=a<0?-1:1;return u*Se}return a===a?a:0}function Ge(a){var u=_s(a),p=u%1;return u===u?p?u-p:u:0}function _x(a){return a?$o(Ge(a),0,Re):0}function Xr(a){if(typeof a=="number")return a;if(_r(a))return D;if($t(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=$t(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=I1(a);var p=gM.test(a);return p||yM.test(a)?KM(a.slice(2),p?2:8):mM.test(a)?D:+a}function yx(a){return Ii(a,er(a))}function I3(a){return a?$o(Ge(a),-Ee,Ee):a===0?a:0}function mt(a){return a==null?"":gr(a)}var M3=Ua(function(a,u){if(_u(u)||Jn(u)){Ii(u,sn(u),a);return}for(var p in u)gt.call(u,p)&&du(a,p,u[p])}),vx=Ua(function(a,u){Ii(u,er(u),a)}),Gd=Ua(function(a,u,p,v){Ii(u,er(u),a,v)}),F3=Ua(function(a,u,p,v){Ii(u,sn(u),a,v)}),$3=hs(Lm);function q3(a,u){var p=qa(a);return u==null?p:Q1(p,u)}var U3=et(function(a,u){a=St(a);var p=-1,v=u.length,T=v>2?u[2]:n;for(T&&Wn(u[0],u[1],T)&&(v=1);++p1),C}),Ii(a,Qm(a),p),v&&(p=zr(p,_|y|b,ZF));for(var T=u.length;T--;)Hm(p,u[T]);return p});function sU(a,u){return Sx(a,Yd(De(u)))}var oU=hs(function(a,u){return a==null?{}:NF(a,u)});function Sx(a,u){if(a==null)return{};var p=It(Qm(a),function(v){return[v]});return u=De(u),f0(a,p,function(v,T){return u(v,T[0])})}function aU(a,u,p){u=Gs(u,a);var v=-1,T=u.length;for(T||(T=1,a=n);++vu){var v=a;a=u,u=v}if(p||a%1||u%1){var T=V1();return Tn(a+T*(u-a+XM("1e-"+((T+"").length-1))),u)}return qm(a,u)}var yU=Ba(function(a,u,p){return u=u.toLowerCase(),a+(p?Tx(u):u)});function Tx(a){return pg(mt(a).toLowerCase())}function Rx(a){return a=mt(a),a&&a.replace(bM,l2).replace($M,"")}function vU(a,u,p){a=mt(a),u=gr(u);var v=a.length;p=p===n?v:$o(Ge(p),0,v);var T=p;return p-=u.length,p>=0&&a.slice(p,T)==u}function bU(a){return a=mt(a),a&&eM.test(a)?a.replace(n1,u2):a}function SU(a){return a=mt(a),a&&oM.test(a)?a.replace(lm,"\\$&"):a}var xU=Ba(function(a,u,p){return a+(p?"-":"")+u.toLowerCase()}),wU=Ba(function(a,u,p){return a+(p?" ":"")+u.toLowerCase()}),TU=C0("toLowerCase");function RU(a,u,p){a=mt(a),u=Ge(u);var v=u?ja(a):0;if(!u||v>=u)return a;var T=(u-v)/2;return Id(wd(T),p)+a+Id(xd(T),p)}function kU(a,u,p){a=mt(a),u=Ge(u);var v=u?ja(a):0;return u&&v>>0,p?(a=mt(a),a&&(typeof u=="string"||u!=null&&!cg(u))&&(u=gr(u),!u&&Aa(a))?Xs(di(a),0,p):a.split(u,p)):[]}var NU=Ba(function(a,u,p){return a+(p?" ":"")+pg(u)});function AU(a,u,p){return a=mt(a),p=p==null?0:$o(Ge(p),0,a.length),u=gr(u),a.slice(p,p+u.length)==u}function jU(a,u,p){var v=k.templateSettings;p&&Wn(a,u,p)&&(u=n),a=mt(a),u=Gd({},u,v,j0);var T=Gd({},u.imports,v.imports,j0),C=sn(T),A=Tm(T,C),M,q,ee=0,te=u.interpolate||ad,re="__p += '",he=km((u.escape||ad).source+"|"+te.source+"|"+(te===r1?hM:ad).source+"|"+(u.evaluate||ad).source+"|$","g"),Te="//# sourceURL="+(gt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++WM+"]")+`
+`;a.replace(he,function(Ae,nt,st,yr,Yn,vr){return st||(st=yr),re+=a.slice(ee,vr).replace(SM,c2),nt&&(M=!0,re+=`' +
+__e(`+nt+`) +
+'`),Yn&&(q=!0,re+=`';
+`+Yn+`;
+__p += '`),st&&(re+=`' +
+((__t = (`+st+`)) == null ? '' : __t) +
+'`),ee=vr+Ae.length,Ae}),re+=`';
+`;var Ne=gt.call(u,"variable")&&u.variable;if(!Ne)re=`with (obj) {
+`+re+`
+}
+`;else if(fM.test(Ne))throw new We(l);re=(q?re.replace(iu,""):re).replace(ci,"$1").replace(ZI,"$1;"),re="function("+(Ne||"obj")+`) {
+`+(Ne?"":`obj || (obj = {});
+`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(q?`, __j = Array.prototype.join;
+function print() { __p += __j.call(arguments, '') }
+`:`;
+`)+re+`return __p
+}`;var Qe=Ex(function(){return ft(C,Te+"return "+re).apply(n,A)});if(Qe.source=re,ug(Qe))throw Qe;return Qe}function IU(a){return mt(a).toLowerCase()}function MU(a){return mt(a).toUpperCase()}function FU(a,u,p){if(a=mt(a),a&&(p||u===n))return I1(a);if(!a||!(u=gr(u)))return a;var v=di(a),T=di(u),C=M1(v,T),A=F1(v,T)+1;return Xs(v,C,A).join("")}function $U(a,u,p){if(a=mt(a),a&&(p||u===n))return a.slice(0,q1(a)+1);if(!a||!(u=gr(u)))return a;var v=di(a),T=F1(v,di(u))+1;return Xs(v,0,T).join("")}function qU(a,u,p){if(a=mt(a),a&&(p||u===n))return a.replace(um,"");if(!a||!(u=gr(u)))return a;var v=di(a),T=M1(v,di(u));return Xs(v,T).join("")}function UU(a,u){var p=V,v=K;if($t(u)){var T="separator"in u?u.separator:T;p="length"in u?Ge(u.length):p,v="omission"in u?gr(u.omission):v}a=mt(a);var C=a.length;if(Aa(a)){var A=di(a);C=A.length}if(p>=C)return a;var M=p-ja(v);if(M<1)return v;var q=A?Xs(A,0,M).join(""):a.slice(0,M);if(T===n)return q+v;if(A&&(M+=q.length-M),cg(T)){if(a.slice(M).search(T)){var ee,te=q;for(T.global||(T=km(T.source,mt(i1.exec(T))+"g")),T.lastIndex=0;ee=T.exec(te);)var re=ee.index;q=q.slice(0,re===n?M:re)}}else if(a.indexOf(gr(T),M)!=M){var he=q.lastIndexOf(T);he>-1&&(q=q.slice(0,he))}return q+v}function BU(a){return a=mt(a),a&&JI.test(a)?a.replace(t1,_2):a}var HU=Ba(function(a,u,p){return a+(p?" ":"")+u.toUpperCase()}),pg=C0("toUpperCase");function kx(a,u,p){return a=mt(a),u=p?n:u,u===n?f2(a)?b2(a):r2(a):a.match(u)||[]}var Ex=et(function(a,u){try{return hr(a,n,u)}catch(p){return ug(p)?p:new We(p)}}),WU=hs(function(a,u){return Hr(u,function(p){p=Mi(p),fs(a,p,ag(a[p],a))}),a});function YU(a){var u=a==null?0:a.length,p=De();return a=u?It(a,function(v){if(typeof v[1]!="function")throw new Wr(o);return[p(v[0]),v[1]]}):[],et(function(v){for(var T=-1;++TEe)return[];var p=Re,v=Tn(a,Re);u=De(u),a-=Re;for(var T=wm(v,u);++p0||u<0)?new rt(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),u!==n&&(u=Ge(u),p=u<0?p.dropRight(-u):p.take(u-a)),p)},rt.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},rt.prototype.toArray=function(){return this.take(Re)},ji(rt.prototype,function(a,u){var p=/^(?:filter|find|map|reject)|While$/.test(u),v=/^(?:head|last)$/.test(u),T=k[v?"take"+(u=="last"?"Right":""):u],C=v||/^find/.test(u);T&&(k.prototype[u]=function(){var A=this.__wrapped__,M=v?[1]:arguments,q=A instanceof rt,ee=M[0],te=q||ze(A),re=function(nt){var st=T.apply(k,Hs([nt],M));return v&&he?st[0]:st};te&&p&&typeof ee=="function"&&ee.length!=1&&(q=te=!1);var he=this.__chain__,Te=!!this.__actions__.length,Ne=C&&!he,Qe=q&&!Te;if(!C&&te){A=Qe?A:new rt(this);var Ae=a.apply(A,M);return Ae.__actions__.push({func:Ud,args:[re],thisArg:n}),new Yr(Ae,he)}return Ne&&Qe?a.apply(this,M):(Ae=this.thru(re),Ne?v?Ae.value()[0]:Ae.value():Ae)})}),Hr(["pop","push","shift","sort","splice","unshift"],function(a){var u=pd[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",v=/^(?:pop|shift)$/.test(a);k.prototype[a]=function(){var T=arguments;if(v&&!this.__chain__){var C=this.value();return u.apply(ze(C)?C:[],T)}return this[p](function(A){return u.apply(ze(A)?A:[],T)})}}),ji(rt.prototype,function(a,u){var p=k[u];if(p){var v=p.name+"";gt.call($a,v)||($a[v]=[]),$a[v].push({name:u,func:p})}}),$a[Ad(n,x).name]=[{name:"wrapper",func:n}],rt.prototype.clone=B2,rt.prototype.reverse=H2,rt.prototype.value=W2,k.prototype.at=vq,k.prototype.chain=bq,k.prototype.commit=Sq,k.prototype.next=xq,k.prototype.plant=Tq,k.prototype.reverse=Rq,k.prototype.toJSON=k.prototype.valueOf=k.prototype.value=kq,k.prototype.first=k.prototype.head,ou&&(k.prototype[ou]=wq),k},Ia=S2();jo?((jo.exports=Ia)._=Ia,mm._=Ia):gn._=Ia}).call(bu)})(Wp,Wp.exports);var Ve=Wp.exports;const ic=class ic extends X.Component{render(){const{orientation:t,isVisible:n,gridArea:r}=this.props,i=typeof t=="string"?t:t.desktop,s=typeof t=="string"?t:t.mobile,o=typeof n=="boolean"?n:n.desktop,l=typeof n=="boolean"?n:n.mobile;return c.jsx("div",{className:g("divider",i===ic.Orientation.HORIZONTAL?"divider--desktop-horizontal":"divider--desktop-vertical",s===ic.Orientation.HORIZONTAL?"divider--mobile-horizontal":"divider--mobile-vertical",o?null:"desktop-hidden",l?null:"mobile-hidden"),style:r?{gridArea:r}:null})}};N(ic,"Orientation",{HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL"});let Ce=ic;const R_=h.oneOf([Ce.Orientation.HORIZONTAL,Ce.Orientation.VERTICAL]);Ce.propTypes={orientation:h.oneOfType([R_,h.shape({desktop:R_.isRequired,mobile:R_.isRequired})]).isRequired,isVisible:h.oneOfType([h.bool,h.shape({desktop:h.bool.isRequired,mobile:h.bool.isRequired})]).isRequired,gridArea:h.string};class lD extends X.Component{render(){const{value:t,name:n,label:r,isRadio:i,isDimmed:s,onChange:o,isChecked:l}=this.props,d=t==="ALL",f=`${n}-${t}`;return c.jsxs("label",{className:g("search-fields__label",s?"search-fields__label--dimmed":""),htmlFor:f,children:[c.jsx("input",{id:f,className:d?"chkall":"chkelem",type:"checkbox",autoComplete:"off",name:n,value:t,onChange:o,checked:l}),r,c.jsx("i",{className:g("icon",i?"icon--radio":"icon--checkbox")})]})}}lD.propTypes={value:h.string.isRequired,name:h.string.isRequired,label:h.string.isRequired,isRadio:h.bool,isDimmed:h.bool,onChange:h.func.isRequired,isChecked:h.bool.isRequired};const gf=0,lZ=1,uZ=2;class Dt extends X.Component{constructor(){super(...arguments);N(this,"_isChecked",n=>{const{checkedValues:r}=this.props;return r.has(n)});N(this,"_handleValueCheckedChange",(n,r)=>{const{isRadio:i,options:s,checkedValues:o,updateCheckedValues:l}=this.props;if(i)l(new Set([n]));else if(r)if(n==="ALL")l(new Set(["ALL"]));else{const d=new Set(o);d.add(n),d.delete("ALL"),l(d)}else if(n!=="ALL"){const d=new Set(o);d.delete(n),d.size===0&&s.some(f=>f[gf]==="ALL")&&d.add("ALL"),l(d)}})}render(){const{inputName:n,titleName:r,options:i,checkedValues:s,isRadio:o}=this.props,l=d=>c.jsx(lD,{value:d[gf],name:n,label:d[lZ],isRadio:o,isDimmed:d[uZ],onChange:f=>this._handleValueCheckedChange(f.target.value,f.target.checked),isChecked:s.has(d[gf])},d[gf]);return c.jsxs("div",{className:g("attribute"),children:[c.jsx("span",{children:r}),c.jsx("div",{className:g("search-fields"),children:i.map(l)})]})}}Dt.propTypes={updateCheckedValues:h.func.isRequired,inputName:h.string.isRequired,titleName:h.string.isRequired,options:h.arrayOf(h.arrayOf(h.oneOfType([h.string,h.bool]))).isRequired,checkedValues:h.instanceOf(Set).isRequired,isRadio:h.bool};const Yh="D_CA_",uD=Yh+"RESET",cD=Yh+"OPEN_SEARCH",dD=Yh+"CLOSE_SEARCH",fD=Yh+"SET_LAST_SEARCH_OPTION";function cZ(){return{type:uD}}function pD(){return{type:cD}}function xS(){return{type:dD}}function dZ(e){return{type:fD,lastSearchOption:e}}const Gl="D_CA_",hD=Gl+"RESET",mD=Gl+"SET_COURSE_FOCUS",gD=Gl+"CLEAR_COURSE_FOCUS",_D=Gl+"SET_REVIEWS",yD=Gl+"UPDATE_REVIEW",vD=Gl+"SET_LECTURES";function fZ(){return{type:hD}}function bD(e){return{type:mD,course:e}}function wS(){return{type:gD}}function pZ(e){return{type:_D,reviews:e}}function hZ(e,t){return{type:yD,review:e,isNew:t}}function mZ(e){return{type:vD,lectures:e}}const Xl=()=>[["ALL",ge.t("ui.type.allShort")],["BR",ge.t("ui.type.basicRequiredShort")],["BE",ge.t("ui.type.basicElectiveShort")],["MR",ge.t("ui.type.majorRequiredShort")],["ME",ge.t("ui.type.majorElectiveShort")],["MGC",ge.t("ui.type.mandatoryGeneralCourseShort")],["HSE",ge.t("ui.type.humanitiesSocialElectiveShort")],["GR",ge.t("ui.type.generalRequiredShort")],["EG",ge.t("ui.type.electiveGraduateShort")],["OE",ge.t("ui.type.otherElectiveShort")],["ETC",ge.t("ui.type.etcShort")]],Kl=()=>[["ALL",ge.t("ui.department.allShort"),100],["HSS",ge.t("ui.department.hssShort"),200],["CE",ge.t("ui.department.ceShort"),500],["MSB",ge.t("ui.department.msbShort"),500],["ME",ge.t("ui.department.meShort"),500],["PH",ge.t("ui.department.phShort"),500],["BiS",ge.t("ui.department.bisShort"),500],["IE",ge.t("ui.department.ieShort"),500],["ID",ge.t("ui.department.idShort"),500],["BS",ge.t("ui.department.bsShort"),500],["MAS",ge.t("ui.department.masShort"),500],["NQE",ge.t("ui.department.nqeShort"),500],["EE",ge.t("ui.department.eeShort"),500],["CS",ge.t("ui.department.csShort"),500],["AE",ge.t("ui.department.aeShort"),500],["CH",ge.t("ui.department.chShort"),500],["CBE",ge.t("ui.department.cbeShort"),500],["MS",ge.t("ui.department.msShort"),500],["TS",ge.t("ui.department.tsShort"),500],["ETC",ge.t("ui.department.etcShort"),900]].sort((e,t)=>e[2]!==t[2]?e[2]-t[2]:e[1]e.slice(0,2)),Ql=()=>[["ALL",ge.t("ui.level.allShort")],["100",ge.t("ui.level.100sShort")],["200",ge.t("ui.level.200sShort")],["300",ge.t("ui.level.300sShort")],["400",ge.t("ui.level.400sShort")]],zh=()=>[["ALL",ge.t("ui.term.allShort")],["3",ge.t("ui.term.3yearsShort")]],Si=(e,t)=>{const n=e.find(r=>r[0]===t);return n?n[1]:"Unknown"},TS=(e,t,n,r)=>{if((!e.keyword||e.keyword.length===0)&&(!e.type||e.type.includes("ALL"))&&(!e.department||e.department.includes("ALL"))&&(!e.grade||e.grade.includes("ALL"))){alert(ge.t("ui.message.blankSearch"));return}n(),me.get("/api/courses",{params:{...e,order:["old_code"],limit:t},metadata:{gaCategory:"Course",gaVariable:"GET / List"}}).then(i=>{r(i.data)}).catch(i=>{})},SD=(e,t,n,r,i,s)=>{if(e.classtimes.some(o=>t.lectures.some(l=>l.classtimes.some(d=>d.day===o.day&&d.begino.begin)))){alert(ge.t("ui.message.timetableOverlap"));return}i(),n?me.post(`/api/users/${n.id}/timetables/${t.id}/add-lecture`,{lecture:e.id},{metadata:{gaCategory:"Timetable",gaVariable:"POST Update / Instance"}}).then(o=>{s()}).catch(o=>{}):s(),Je.event({category:"Timetable - Lecture",action:"Added Lecture to Timetable",label:`Lecture : ${e.id} / From : ${r}`})},xD=(e,t,n,r,i,s)=>{i(),n?me.post(`/api/users/${n.id}/timetables/${t.id}/remove-lecture`,{lecture:e.id},{metadata:{gaCategory:"Timetable",gaVariable:"POST Update / Instance"}}).then(o=>{s()}).catch(o=>{}):s(),Je.event({category:"Timetable - Lecture",action:"Deleted Lecture from Timetable",label:`Lecture : ${e.id} / From : ${r}`})},wD=(e,t,n,r,i)=>{r(),t?me.post(`/api/users/${t.id}/wishlist/add-lecture`,{lecture:e.id},{metadata:{gaCategory:"Wishlist",gaVariable:"POST Update / Instance"}}).then(s=>{i()}).catch(s=>{}):i(),Je.event({category:"Timetable - Lecture",action:"Added Lecture to Cart",label:`Lecture : ${e.id} / From : ${n}`})},TD=(e,t,n,r,i)=>{r(),t?me.post(`/api/users/${t.id}/wishlist/remove-lecture`,{lecture:e.id},{metadata:{gaCategory:"Wishlist",gaVariable:"POST Update / Instance"}}).then(s=>{i()}).catch(s=>{}):i(),Je.event({category:"Timetable - Lecture",action:"Deleted Lecture from Cart",label:`Lecture : ${e.id} / From : ${n}`})},gZ=(e,t,n,r,i,s,o,l,d,f)=>{if(n.length===0){alert(ge.t("ui.message.emptyContent"));return}if(r===void 0||s===void 0||i===void 0){alert(ge.t("ui.message.scoreNotSelected"));return}if(o){alert(ge.t("ui.message.alreadyUploading"));return}d(),e?(me.patch(`/api/reviews/${e.id}`,{content:n,grade:r,speech:i,load:s},{metadata:{gaCategory:"Review",gaVariable:"POST / List"}}).then(m=>{f(m.data)}).catch(m=>{}),Je.event({category:"Review",action:"Edited Review",label:`Lecture : ${t.id} / From : ${l}`})):(me.post("/api/reviews",{lecture:t.id,content:n,grade:r,speech:i,load:s},{metadata:{gaCategory:"Review",gaVariable:"POST / List"}}).then(m=>{f(m.data)}).catch(m=>{}),Je.event({category:"Review",action:"Uploaded Review",label:`Lecture : ${t.id} / From : ${l}`}))};let RD=class extends X.Component{constructor(n){super(n);N(this,"INITIAL_STATE",{keyword:"",autocompleteText:"",selectedTypes:new Set(["ALL"]),selectedDepartments:new Set(["ALL"]),selectedLevels:new Set(["ALL"]),selectedTerms:new Set(["ALL"])});N(this,"hideSearch",()=>{const{closeSearchDispatch:n}=this.props;this.setState(this.INITIAL_STATE),n()});N(this,"searchStart",()=>{const{t:r}=this.props,{selectedTypes:i,selectedDepartments:s,selectedLevels:o,selectedTerms:l,keyword:d}=this.state,{closeSearchDispatch:f,clearSearchListCoursesDispatch:m,setListCoursesDispatch:_,clearCourseFocusDispatch:y,setLastSearchOptionDispatch:b}=this.props,w={keyword:d.trim(),type:Array.from(i),department:Array.from(s),level:Array.from(o),term:Array.from(l)};TS(w,150,()=>{this.setState(this.INITIAL_STATE),f(),m(),b(w),y()},x=>{x.length===150&&alert(r("ui.message.tooManySearchResults",{count:150})),_(je.SEARCH,x)}),Je.event({category:"Dictionary - Search",action:"Searched Course"})});N(this,"updateCheckedValues",n=>r=>{this.setState({[n]:r})});N(this,"handleSubmit",n=>{n.preventDefault(),this.searchStart()});N(this,"handleInput",n=>{const{value:r}=n.target;this.setState({keyword:n.target.value,autocompleteText:""}),r.trim()&&this._fetchAutocomplete(r)});N(this,"_fetchAutocomplete",Ve.debounce(n=>{me.get("/api/courses/autocomplete",{params:{keyword:n},metadata:{gaCategory:"Course",gaVariable:"GET Autocomplete / List"}}).then(r=>{const{keyword:i}=this.state,s=r.data;n===i&&this.setState({autocompleteText:s.substring(n.length,s.length)})}).catch(r=>{})},500));N(this,"applyAutocomplete",()=>{this.setState(n=>({keyword:n.keyword+n.autocompleteText,autocompleteText:""}))});N(this,"clearAutocomplete",()=>{this.setState({keyword:"",autocompleteText:""})});N(this,"onKeyPress",n=>{n.keyCode===9&&(this.applyAutocomplete(),n.stopPropagation(),n.preventDefault(),n.nativeEvent.stopImmediatePropagation())});this.state=this.INITIAL_STATE}render(){const{t:n,searchOpen:r}=this.props,{keyword:i,autocompleteText:s,selectedTypes:o,selectedDepartments:l,selectedLevels:d,selectedTerms:f}=this.state;return c.jsx("div",{className:g("search-area",r?null:"search-area--hidden"),children:c.jsxs("form",{onSubmit:this.handleSubmit,children:[c.jsxs("div",{className:g("list-title","list-title--search-input"),children:[c.jsx("i",{className:g("icon","icon--search")}),c.jsxs("div",{children:[c.jsx("input",{type:"text",name:"keyword",autoComplete:"off",placeholder:n("ui.tab.search"),value:i,onKeyDown:m=>this.onKeyPress(m),onChange:m=>this.handleInput(m)}),c.jsxs("div",{className:g("search-keyword-autocomplete"),children:[c.jsx("span",{className:g("search-keyword-autocomplete-space"),children:i}),c.jsx("span",{className:g("search-keyword-autocomplete-body"),children:s})]})]})]}),c.jsxs(ct,{expandBottom:0,children:[c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedTypes"),inputName:"type",titleName:n("ui.search.type"),options:Xl(),checkedValues:o}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedDepartments"),inputName:"department",titleName:n("ui.search.department"),options:Kl(),checkedValues:l}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedLevels"),inputName:"level",titleName:n("ui.search.level"),options:Ql(),checkedValues:d}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedTerms"),inputName:"term",titleName:n("ui.search.term"),options:zh(),checkedValues:f})]}),c.jsxs("div",{className:g("buttons"),children:[c.jsx("button",{type:"submit",className:g("text-button"),children:n("ui.button.search")}),c.jsx("button",{type:"button",className:g("text-button"),onClick:()=>this.hideSearch(),children:n("ui.button.cancel")})]}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0})]})})}};const _Z=e=>({searchOpen:e.dictionary.search.open}),yZ=e=>({closeSearchDispatch:()=>{e(xS())},setListCoursesDispatch:(t,n)=>{e(mS(t,n))},clearSearchListCoursesDispatch:()=>{e(WL())},clearCourseFocusDispatch:()=>{e(wS())},setLastSearchOptionDispatch:t=>{e(dZ(t))}});RD.propTypes={searchOpen:h.bool.isRequired,closeSearchDispatch:h.func.isRequired,setListCoursesDispatch:h.func.isRequired,clearSearchListCoursesDispatch:h.func.isRequired,clearCourseFocusDispatch:h.func.isRequired,setLastSearchOptionDispatch:h.func.isRequired};const vZ=de()(Pe(_Z,yZ)(RD)),BR=(e,t)=>!!t.course&&t.course.id===e.id,bZ=(e,t)=>!!t.course&&t.course.id!==e.id,SZ=(e,t)=>t.review_writable_lectures.some(n=>n.course===e),xZ=e=>e.professors.slice().sort((r,i)=>r.namer[ge.t("js.property.name")]).join(", "),HR=e=>e.title.includes("특강")||e.title_en.includes("Special Lectures")||e.title_en.includes("Special Topics"),ir=h.exact({id:h.number.isRequired,old_code:h.string.isRequired,department:bi,type:h.string.isRequired,type_en:h.string.isRequired,title:h.string.isRequired,title_en:h.string.isRequired,summary:h.string.isRequired,review_total_weight:h.number.isRequired,credit:h.number.isRequired,credit_au:h.number.isRequired,num_classes:h.number.isRequired,num_labs:h.number.isRequired,related_courses_prior:h.arrayOf(av).isRequired,related_courses_posterior:h.arrayOf(av).isRequired,professors:h.arrayOf(hS).isRequired,grade:h.number.isRequired,load:h.number.isRequired,speech:h.number.isRequired,userspecific_is_read:h.bool.isRequired}),RS=h.oneOfType([h.string,h.shape({pathname:h.string,search:h.string,hash:h.string,state:h.object})]);class kD extends X.Component{render(){const{t,entries:n,fixedWidthName:r,longName:i,longInfo:s}=this.props;return c.jsx("div",{children:n.map(o=>c.jsxs("div",{className:g("attribute",i?"attribute--long-name":null,s?"attribute--long-info":null),onMouseOver:o.onMouseOver,onMouseOut:o.onMouseOut,children:[c.jsx("div",{className:g(r?t("jsx.className.fixedByLang"):null),children:o.name}),o.onInfoClick?c.jsx("div",{className:g("text-button",o.isInfoClickDisabled?"text-button--disabled":null),onClick:o.onInfoClick,children:o.info}):c.jsx("div",{children:o.info})]},o.name))})}}kD.propTypes={entries:h.arrayOf(h.shape({name:h.string.isRequired,info:h.oneOfType([h.string,h.node]).isRequired,onMouseOver:h.func,onMouseOut:h.func,onInfoClick:h.func,isInfoClickDisabled:h.bool})).isRequired,fixedWidthName:h.bool,longName:h.bool,longInfo:h.bool};const Ci=de()(kD),ED=({t:e,course:t,shouldShowReadStatus:n,isRead:r,isRaised:i,isDimmed:s,onMouseOver:o,onMouseOut:l,onClick:d,linkTo:f})=>{const m=o?w=>{o(t)}:null,_=l?w=>{l(t)}:null,y=d?w=>{d(t)}:null,b=f?Et:"div";return c.jsxs(b,{className:g("block","block--course",d?"block--clickable":null,i?"block--raised":null,s?"block--dimmed":null),onClick:y,onMouseOver:m,onMouseOut:_,to:f,children:[c.jsxs("div",{className:g("block--course__title"),children:[n?r?c.jsx("i",{className:g("icon","icon--status-read")}):c.jsx("i",{className:g("icon","icon--status-unread")}):null,c.jsx("strong",{children:t[e("js.property.title")]})," ",c.jsx("span",{children:t.old_code})]}),c.jsx(Ci,{entries:[{name:e("ui.attribute.classification"),info:`${t.department[e("js.property.name")]}, ${t[e("js.property.type")]}`},{name:e("ui.attribute.professors"),info:xZ(t)},{name:e("ui.attribute.description"),info:t.summary}],longInfo:!0})]})};ED.propTypes={course:ir.isRequired,shouldShowReadStatus:h.bool,isRead:h.bool,isRaised:h.bool,isDimmed:h.bool,onMouseOver:h.func,onMouseOut:h.func,onClick:h.func,linkTo:RS};const CD=de()(xe.memo(ED)),Zl=h.oneOfType([h.exact({course:h.oneOf([null]),reviews:h.oneOf([null]),lectures:h.oneOf([null])}),h.exact({course:ir.isRequired,reviews:h.arrayOf(pn),lectures:h.arrayOf(Yt)})]),Vh=h.shape({search:h.exact({courses:h.arrayOf(ir)}).isRequired,basic:h.exact({courses:h.arrayOf(ir)}).isRequired,humanity:h.exact({courses:h.arrayOf(ir)}).isRequired,taken:h.exact({courses:h.arrayOf(ir)}).isRequired}),OD=h.exact({keyword:h.string,type:h.arrayOf(h.string),department:h.arrayOf(h.string),grade:h.arrayOf(h.string),term:h.arrayOf(h.string)});let PD=class extends X.Component{constructor(){super(...arguments);N(this,"showSearch",()=>{const{openSearchDispatch:n}=this.props;n()});N(this,"focusCourseWithClick",n=>{const{courseFocus:r,selectedListCode:i,setCourseFocusDispatch:s,clearCourseFocusDispatch:o}=this.props;if(BR(n,r)){o();const l=new Map([[je.SEARCH,"Search"],[je.BASIC,"Basic"],[je.HUMANITY,"Humanity"],[je.TAKEN,"Taken"]]);Je.event({category:"Dictionary - Selection",action:"Unselected Course",label:`Course : ${n.id} / From : Course List : ${l.get(i)||i}`})}else{s(n);const l=new Map([[je.SEARCH,"Search"],[je.BASIC,"Basic"],[je.HUMANITY,"Humanity"],[je.TAKEN,"Taken"]]);Je.event({category:"Dictionary - Selection",action:"Selected Course",label:`Course : ${n.id} / From : Course List : ${l.get(i)||i}`})}});N(this,"_getCourses",n=>{const{lists:r}=this.props;return r[n]?r[n].courses:null})}render(){const{t:n}=this.props,{user:r,courseFocus:i,selectedListCode:s,lastSearchOption:o,readCourses:l}=this.props,d=()=>{if(s===je.SEARCH){const m=Object.entries(o).map(_=>_[0]==="keyword"&&_[1].length>0?_[1]:_[0]==="type"&&!_[1].includes("ALL")?_[1].map(y=>Si(Xl(),y)):_[0]==="department"&&!_[1].includes("ALL")?_[1].map(y=>Si(Kl(),y)):_[0]==="grade"&&!_[1].includes("ALL")?_[1].map(y=>Si(Ql(),y)):_[0]==="term"&&!_[1].includes("ALL")?_[1].map(y=>Si(zh(),y)):[]).flat(1).join(", ");return c.jsxs("div",{className:g("list-title","list-title--search"),onClick:()=>this.showSearch(),children:[c.jsx("i",{className:g("icon","icon--search")}),c.jsx("span",{children:n("ui.tab.search")}),c.jsx("span",{children:m.length>0?`:${m}`:""})]})}if(s===je.BASIC)return c.jsx("div",{className:g("list-title"),children:n("ui.tab.basic")});if(r&&r.departments.some(m=>s===m.code)){const m=r.departments.find(_=>s===_.code);return c.jsx("div",{className:g("list-title"),children:`${m[n("js.property.name")]} ${n("ui.tab.major")}`})}return s===je.HUMANITY?c.jsx("div",{className:g("list-title"),children:n("ui.tab.humanity")}):s===je.TAKEN?c.jsx("div",{className:g("list-title"),children:n("ui.tab.taken")}):null},f=()=>{const m=this._getCourses(s);return m?m.length===0?c.jsx("div",{className:g("list-placeholder"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})}):c.jsx(ct,{children:c.jsx("div",{className:g("block-list"),children:m.map(_=>c.jsx(CD,{course:_,shouldShowReadStatus:!0,isRead:_.userspecific_is_read||l.some(y=>y.id===_.id),isRaised:BR(_,i),isDimmed:bZ(_,i),onClick:this.focusCourseWithClick},_.id))})},s):c.jsx("div",{className:g("list-placeholder"),children:c.jsx("div",{children:n("ui.placeholder.loading")})})};return c.jsx("div",{className:g("section","section--course-list"),children:c.jsxs("div",{className:g("subsection","subsection--flex","subsection--course-list"),children:[s===je.SEARCH?c.jsx(vZ,{}):null,d(),f()]})})}};const wZ=e=>({user:e.common.user.user,selectedListCode:e.dictionary.list.selectedListCode,lists:e.dictionary.list.lists,readCourses:e.dictionary.list.readCourses,courseFocus:e.dictionary.courseFocus,lastSearchOption:e.dictionary.search.lastSearchOption}),TZ=e=>({openSearchDispatch:()=>{e(pD())},setCourseFocusDispatch:t=>{e(bD(t))},clearCourseFocusDispatch:()=>{e(wS())}});PD.propTypes={user:ht,selectedListCode:h.string.isRequired,lists:Vh,readCourses:h.arrayOf(ir).isRequired,courseFocus:Zl.isRequired,lastSearchOption:OD.isRequired,openSearchDispatch:h.func.isRequired,setCourseFocusDispatch:h.func.isRequired,clearCourseFocusDispatch:h.func.isRequired};const RZ=de()(Pe(wZ,TZ)(PD));class Fr extends X.Component{render(){const{onClick:t}=this.props;return c.jsx("div",{className:g("close-button-wrap"),children:c.jsx("button",{onClick:t,children:c.jsx("i",{className:g("icon","icon--close-section")})})})}}Fr.propTypes={onClick:h.func.isRequired};const ma=e=>["?","F","D","C","B","A"][e],cn=(e,t)=>t===0?"?":["?","F","F","F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"][Math.round(e)],_f=e=>{const t=new Date().getFullYear(),n=e.lecture.year,r=t>n?t-n:0;return(Math.sqrt(e.like)+2)*.85**r},kZ=e=>{const t=e.filter(m=>m.grade!==0&&m.load!==0&&m.speech!==0),n=e.length,r=Ve.sumBy(t,m=>_f(m)),i=Ve.sumBy(t,m=>_f(m)*m.grade*3),s=Ve.sumBy(t,m=>_f(m)*m.load*3),o=Ve.sumBy(t,m=>_f(m)*m.speech*3),l=r!==0?(i+0)/r:0,d=r!==0?(s+0)/r:0,f=r!==0?(o+0)/r:0;return[n,r,[i,s,o],[l,d,f]]};class ni extends X.Component{render(){const{entries:t,big:n}=this.props;return c.jsx("div",{className:g("scores",n?"scores--big":null),children:t.map(r=>c.jsxs("div",{onMouseOver:r.onMouseOver,onMouseOut:r.onMouseOut,children:[c.jsx("div",{children:r.score}),c.jsx("div",{children:r.name})]},r.name))})}}ni.propTypes={entries:h.arrayOf(h.shape({name:h.string.isRequired,score:h.oneOfType([h.string,h.node]).isRequired,onMouseOver:h.func,onMouseOut:h.func})).isRequired,big:h.bool};let LD=class extends X.Component{render(){const{t}=this.props,{courseFocus:n}=this.props;return n.course?c.jsxs("div",{className:g("subsection","subsection--course-info"),children:[c.jsx(Ci,{entries:[{name:t("ui.attribute.classification"),info:`${n.course.department[t("js.property.name")]}, ${n.course[t("js.property.type")]}`},{name:t("ui.attribute.description"),info:n.course.summary}],longInfo:!0}),c.jsx(ni,{entries:[{name:t("ui.score.lectureHours"),score:n.course.num_classes},{name:t("ui.score.labHours"),score:n.course.num_labs},{name:n.course.credit===0?t("ui.score.au"):t("ui.score.credit"),score:n.course.credit===0?n.course.credit_au:n.course.credit}],big:!0}),c.jsx(ni,{entries:[{name:t("ui.score.grade"),score:cn(n.course.grade)},{name:t("ui.score.load"),score:cn(n.course.load)},{name:t("ui.score.speech"),score:cn(n.course.speech)}],big:!0})]}):null}};const EZ=e=>({courseFocus:e.dictionary.courseFocus}),CZ=e=>({});LD.propTypes={courseFocus:Zl.isRequired};const OZ=de()(Pe(EZ,CZ)(LD)),DD=({t:e,course:t})=>c.jsxs("div",{className:g("block","block--course-simple"),children:[c.jsx("div",{className:g("block--course-simple__title"),children:t[e("js.property.title")]}),c.jsx("div",{className:g("block--course-simple__subtitle"),children:t.old_code})]});DD.propTypes={course:ir.isRequired};const WR=de()(xe.memo(DD));class ND extends X.Component{render(){const{t}=this.props,{courseFocus:n}=this.props;if(!n.course)return null;const r=i=>i.length?i.map(s=>c.jsx(WR,{course:s},s.id)):c.jsx("div",{className:g("list-placeholder"),children:c.jsx("div",{children:t("ui.placeholder.unknown")})});return c.jsxs("div",{className:g("subsection","subsection--course-related-courses"),children:[c.jsx("div",{className:g("small-title"),children:t("ui.title.relatedCourses")}),c.jsx("div",{children:c.jsx(ct,{noScrollX:!1,noScrollY:!0,children:c.jsxs("div",{className:g("related-courses"),children:[c.jsx("div",{children:r(n.course.related_courses_prior)}),c.jsx("div",{children:c.jsx("i",{className:g("icon","icon--related-arrow")})}),c.jsx("div",{children:c.jsx(WR,{course:n.course})}),c.jsx("div",{children:c.jsx("i",{className:g("icon","icon--related-arrow")})}),c.jsx("div",{children:r(n.course.related_courses_posterior)})]})})})]})}}const PZ=e=>({courseFocus:e.dictionary.courseFocus}),LZ=e=>({});ND.propTypes={courseFocus:Zl.isRequired};const DZ=de()(Pe(PZ,LZ)(ND)),Jl="T_LA_",AD=Jl+"RESET",jD=Jl+"SET_LECTURE_FOCUS",ID=Jl+"CLEAR_LECTURE_FOCUS",MD=Jl+"SET_REVIEWS",FD=Jl+"SET_MULTIPLE_FOCUS",$D=Jl+"CLEAR_MULTIPLE_FOCUS";function NZ(){return{type:AD}}function qD(e,t,n){return{type:jD,lecture:e,from:t,clicked:n}}function Gh(){return{type:ID}}function AZ(e){return{type:MD,reviews:e}}function kS(e,t){return{type:FD,multipleTitle:e,multipleDetails:t}}function ES(){return{type:$D}}const Ue={NONE:"NONE",LIST:"LIST",TABLE:"TABLE",MULTIPLE:"MULTIPLE"},YR={from:Ue.NONE,clicked:!1,lecture:null,reviews:null,multipleTitle:"",multipleDetails:[]},jZ=(e=YR,t)=>{switch(t.type){case AD:return YR;case jD:{const n=!e.lecture||e.lecture.id!==t.lecture.id;return Object.assign({},e,{from:t.from,clicked:t.clicked,lecture:t.lecture},n?{reviews:null}:{})}case ID:return Object.assign({},e,{from:Ue.NONE,clicked:!1,lecture:null,reviews:null});case MD:return Object.assign({},e,{reviews:t.reviews});case FD:return Object.assign({},e,{from:Ue.MULTIPLE,multipleTitle:t.multipleTitle,multipleDetails:t.multipleDetails});case $D:return Object.assign({},e,{from:Ue.NONE,multipleTitle:"",multipleDetails:[]});default:return e}},UD=e=>e[ge.t("js.property.str")],zR=e=>{const t=UD(e);return t.slice(t.indexOf(" "))},IZ=e=>!(e.class_title===e.class_no||e.class_title==="A"&&!e.class_no),Ml=(e,t)=>t&&t.lectures.some(n=>n.id===e.id),BD=(e,t)=>t.lectureGroups!==null&&t.lectureGroups.some(n=>n.some(r=>r.id===e.id)),k_=(e,t)=>t.from===Ue.LIST&&t.clicked===!0&&t.lecture.id===e.id,MZ=(e,t)=>t.from===Ue.LIST&&t.lecture.id===e.id,VR=(e,t)=>t.from===Ue.TABLE&&t.clicked===!0&&t.lecture.id===e.id,Yp=(e,t)=>t.lecture!==null&&t.lecture.id===e.id,FZ=(e,t)=>t.from===Ue.MULTIPLE&&t.multipleDetails.some(n=>n.lecture.id===e.id),$Z=(e,t)=>t.clicked===!0&&t.lecture.id!==e.id,qZ=(e,t)=>t.clicked===!0&&(e.every(n=>t.lecture.id!==n.id)||t.from!==Ue.LIST),UZ=(e,t)=>Yp(e,t)||FZ(e,t),Os=(e,t)=>{const n=e?e.lectures:[],r=t.lecture&&!Ml(t.lecture,e);return n.concat(r?[t.lecture]:[])},eu=e=>{const n=e.professors.slice().sort((r,i)=>r.namer[ge.t("js.property.name")]);return n.length<=2?n.join(", "):ge.t("ui.others.sthAndNumOtherPeople",{something:n[0],count:n.length-1})},BZ=e=>e.professors.slice().sort((r,i)=>r.namer[ge.t("js.property.name")]).join(", "),GR=e=>{const{classtimes:t}=e;return t.length===0?ge.t("ui.placeholder.unknown"):t[0].building_code},HD=e=>{const{classtimes:t}=e;return t.length===0?ge.t("ui.placeholder.unknown"):t[0][ge.t("js.property.classroom")]},HZ=e=>{const{classtimes:t}=e;return t.length===0?ge.t("ui.placeholder.unknown"):t[0][ge.t("js.property.room_name")]},WZ=e=>{const{examtimes:t}=e,n=t.map(r=>UD(r));return n.length===0?ge.t("ui.placeholder.unknown"):n.join(", ")},CS=e=>e.course%16+1,WD=e=>`https://cais.kaist.ac.kr/syllabusInfo?year=${e.year}&term=${e.semester}&subject_no=${e.code}&lecture_class=${e.class_no}&dept_id=${e.department}`,YD=({t:e,lectures:t})=>{const n=r=>{if(!r.class_title)return g("");switch(r.class_title.length){case 1:return g("block--lecture-group-simple__row-content__texts__fixed-1");case 2:return g("block--lecture-group-simple__row-content__texts__fixed-2");default:return g("")}};return c.jsx("div",{className:g("block","block--lecture-group-simple"),children:t.map(r=>c.jsx("div",{className:g("block--lecture-group-simple__row"),children:c.jsx("div",{className:g("block--lecture-group-simple__row-content"),children:c.jsxs("div",{className:g("block--lecture-group-simple__row-content__texts"),children:[c.jsx("strong",{className:n(r),children:r[e("js.property.class_title")]})," ",c.jsx("span",{children:eu(r)})]})})},r.id))})};YD.propTypes={lectures:h.arrayOf(Yt).isRequired};const YZ=de()(xe.memo(YD)),zZ=["courseDesciptionSubmission","courseRegistrationPeriodStart","courseRegistrationPeriodEnd","courseAddDropPeriodEnd","courseDropDeadline","courseEvaluationDeadline","gradePosting"],Zi=h.exact({year:h.number.isRequired,semester:h.oneOf([1,2,3,4]).isRequired,beginning:h.string.isRequired,end:h.string.isRequired,...Object.assign({},...zZ.map(e=>({[e]:h.string})))});class zD extends X.Component{constructor(t){super(t),this.scrollRef=xe.createRef()}componentDidUpdate(t,n,r){const{courseFocus:i}=this.props;if(t.courseFocus.lectures===null&&i.lectures!==null){const s=this.scrollRef.current.querySelector(".ScrollbarsCustom-Scroller");s.scrollLeft=s.scrollWidth}}render(){const{t}=this.props,{semesters:n,courseFocus:r}=this.props;if(!r.course)return null;if(r.lectures===null)return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:g("small-title"),children:t("ui.title.courseHistory")}),c.jsx("div",{ref:this.scrollRef,children:c.jsx("div",{className:g("list-placeholder","list-placeholder--history"),children:c.jsx("div",{children:t("ui.placeholder.loading")})})})]});const i=n!=null?n.map(y=>y.year):[],s=r.lectures!=null?r.lectures.map(y=>y.year):[],o=(y,b)=>{const w=r.lectures.filter(R=>R.year===y&&R.semester===b);return w.length===0?c.jsx("td",{className:g("history__cell--unopen"),children:c.jsx("div",{children:t("ui.others.notOffered")})},`${y}-1`):c.jsx("td",{children:c.jsx(YZ,{lectures:w})},`${y}-1`)},l=Math.min(...i,...s),d=Math.max(...i,...s),f=Ve.range(l,d+1),_=r.lectures.filter(y=>y[t("js.property.class_title")].length>3).length/r.lectures.length>.3;return c.jsxs("div",{className:g("subsection","subsection--course-history"),children:[c.jsx("div",{className:g("small-title"),children:t("ui.title.courseHistory")}),c.jsx("div",{ref:this.scrollRef,children:c.jsx(ct,{noScrollX:!1,noScrollY:!0,children:c.jsx("table",{className:g("history",_?"history--special-lecture":null),children:c.jsxs("tbody",{children:[c.jsxs("tr",{children:[c.jsx("th",{children:t("ui.semester.spring")}),f.map(y=>o(y,1))]}),c.jsxs("tr",{children:[c.jsx("th",{}),f.map(y=>c.jsx("td",{className:g("history__cell--year-label"),children:y},`${y}-l`))]}),c.jsxs("tr",{children:[c.jsx("th",{children:t("ui.semester.fall")}),f.map(y=>o(y,3))]})]})})})})]})}}const VZ=e=>({semesters:e.common.semester.semesters,courseFocus:e.dictionary.courseFocus}),GZ=e=>({});zD.propTypes={semesters:h.arrayOf(Zi),courseFocus:Zl.isRequired};const XZ=de()(Pe(VZ,GZ)(zD)),OS=(e,t=void 0)=>t?e.filter((n,r)=>e.findIndex(i=>t(n,i))===r):Array.from(new Set(e)),VD=e=>{const t=e.split(`
+`);return t.map((n,r)=>({key:r,content:n})).map((n,r)=>r===t.length-1?c.jsx(xe.Fragment,{children:n.content},n.key):c.jsxs(xe.Fragment,{children:[n.content,c.jsx("br",{})]},n.key))},ar=e=>({1:ge.t("ui.semester.spring"),2:ge.t("ui.semester.summer"),3:ge.t("ui.semester.fall"),4:ge.t("ui.semester.winter")})[e],GD=e=>{const t=e.filter(i=>i.courseDesciptionSubmission!==null).map(i=>({semesterObject:i,timetableStartTime:new Date(i.courseDesciptionSubmission)})).sort((i,s)=>s.timetableStartTime-i.timetableStartTime),n=Date.now(),r=t.find(i=>i.timetableStartTime{const t=Date.now();return e.find(r=>new Date(r.beginning){const t=["beginning","end","courseRegistrationPeriodStart","courseRegistrationPeriodEnd","courseAddDropPeriodEnd","courseDropDeadline","courseEvaluationDeadline","gradePosting"],n=e.map(s=>t.map(o=>{if(s[o]!==null)return{year:s.year,semester:s.semester,type:o,time:new Date(s[o])}})).flat(1).filter(s=>s!==void 0).sort((s,o)=>s.time-o.time),r=Date.now();return n.find(s=>s.time>r)},xa="otlplus@sparcs.org",Or=8,Sc=24,ZZ=24,XD=({t:e,review:t,shouldLimitLines:n,linkTo:r,pageFrom:i})=>{const[s,o]=X.useState(t.like),[l,d]=X.useState(t.userspecific_is_liked),f=b=>{b.stopPropagation(),b.preventDefault(),me.post(`/api/reviews/${t.id}/like`,{},{metadata:{gaCategory:"Review",gaVariable:"POST Like / Instance"}}).then(w=>{o(s+1),d(!0)}).catch(w=>{}),Je.event({category:"Review",action:"Liked Review",label:`Review : ${t.id} / From : Page : ${i}`})},m=b=>{b.stopPropagation(),b.preventDefault(),alert(e("ui.message.reportUnderDevelopment",{contact:xa})),Je.event({category:"Review",action:"Reported Review",label:`Review : ${t.id} / From : Page : ${i}`})},_=r?Et:"div",y=VD(t.content);return c.jsxs(_,{className:g("block","block--review"),to:r,children:[c.jsxs("div",{className:g("block--review__title"),children:[c.jsx("strong",{children:t.lecture[e("js.property.title")]}),c.jsx("span",{children:eu(t.lecture)}),c.jsx("span",{children:`${t.lecture.year} ${ar(t.lecture.semester)}`})]}),c.jsx("div",{className:g("block--review__content",n?"block--review__content--limit-5":null),children:y}),c.jsxs("div",{className:g("block--review__menus"),children:[c.jsxs("span",{children:[c.jsxs("span",{className:g("block--review__menus__score"),children:[e("ui.score.likes")," ",c.jsx("strong",{children:s})]}),c.jsxs("span",{className:g("block--review__menus__score"),children:[e("ui.score.grade")," ",c.jsx("strong",{children:ma(t.grade)})]}),c.jsxs("span",{className:g("block--review__menus__score"),children:[e("ui.score.load")," ",c.jsx("strong",{children:ma(t.load)})]}),c.jsxs("span",{className:g("block--review__menus__score"),children:[e("ui.score.speech")," ",c.jsx("strong",{children:ma(t.speech)})]})]}),c.jsxs("span",{children:[l?c.jsx("button",{className:g("text-button","text-button--disabled","text-button--review-block"),children:e("ui.button.like")}):c.jsx("button",{className:g("text-button","text-button--review-block"),onClick:f,children:e("ui.button.like")}),c.jsx("button",{className:g("text-button","text-button--black","text-button--review-block"),onClick:m,children:e("ui.button.report")})]})]})]})};XD.propTypes={review:pn.isRequired,shouldLimitLines:h.bool.isRequired,linkTo:RS,pageFrom:h.string.isRequired};const Ni=de()(xe.memo(XD)),KD=({t:e,lecture:t,review:n,pageFrom:r,updateOnSubmit:i})=>{const[s,o]=X.useState(!1),[l,d]=X.useState(n?n.content:""),[f,m]=X.useState(n?n.grade:void 0),[_,y]=X.useState(n?n.load:void 0),[b,w]=X.useState(n?n.speech:void 0),R=I=>{d(I.target.value)},S=I=>{const{name:j,value:P}=I.target;j==="grade"?m(Number(P)):j==="load"?y(Number(P)):j==="speech"&&w(Number(P))},x=I=>{I.preventDefault(),I.stopPropagation();const j=()=>{o(!0)},P=U=>{o(!1),i!==void 0&&i(U,!0)};gZ(n,t,l,f,b,_,s,`Page : ${r}`,j,P)},L=!n||l!==n.content||f!==n.grade||_!==n.load||b!==n.speech,E=(I,j,P)=>{const U=`${t.id}-${I}-${j}`;return c.jsxs("label",{className:g("block--review-write__score__option"),htmlFor:U,children:[c.jsx("input",{id:U,type:"radio",name:I,value:`${j}`,checked:P===j,onChange:S}),c.jsx("span",{children:ma(j)})]})};return c.jsxs("form",{className:g("block","block--review-write"),onSubmit:x,children:[c.jsxs("div",{className:g("block--review-write__title"),children:[c.jsx("strong",{children:t[e("js.property.title")]}),c.jsx("span",{children:eu(t)}),c.jsx("span",{children:`${t.year} ${ar(t.semester)}`})]}),c.jsx("textarea",{className:g("block--review-write__content"),placeholder:e("ui.placeholder.reviewContent"),value:l,onChange:R}),c.jsxs("div",{children:[c.jsxs("div",{className:g("block--review-write__score"),children:[c.jsx("span",{className:g("block--review-write__score__name"),children:e("ui.score.grade")}),E("grade",5,f),E("grade",4,f),E("grade",3,f),E("grade",2,f),E("grade",1,f)]}),c.jsxs("div",{className:g("block--review-write__score"),children:[c.jsx("span",{className:g("block--review-write__score__name"),children:e("ui.score.load")}),E("load",5,_),E("load",4,_),E("load",3,_),E("load",2,_),E("load",1,_)]}),c.jsxs("div",{className:g("block--review-write__score"),children:[c.jsx("span",{className:g("block--review-write__score__name"),children:e("ui.score.speech")}),E("speech",5,b),E("speech",4,b),E("speech",3,b),E("speech",2,b),E("speech",1,b)]})]}),c.jsx("div",{className:g("block--review-write__buttons"),children:L?c.jsx("button",{className:g("text-button","text-button--review-write-block"),type:"submit",children:e(n?"ui.button.edit":"ui.button.upload")}):c.jsx("button",{className:g("text-button","text-button--review-write-block","text-button--disabled"),children:e(n?"ui.button.edit":"ui.button.upload")})})]})};KD.propTypes={lecture:Yt.isRequired,review:pn,pageFrom:h.string.isRequired,updateOnSubmit:h.func.isRequired};const PS=de()(xe.memo(KD)),QD="C_U_",ZD=QD+"SET_USER",JD=QD+"UPDATE_USER_REVIEW";function dv(e){return{type:ZD,user:e}}function LS(e){return{type:JD,review:e}}let eN=class extends X.Component{constructor(n){super(n);N(this,"updateCheckedValues",n=>r=>{this.setState({[n]:r}),Je.event({category:"Dictionary - Review",action:"Filtered Review"})});N(this,"_getProfessorFormValue",n=>String(n.professor_id));N(this,"_checkLectureProfessor",n=>{const{selectedProfessors:r}=this.state;return r.has("ALL")?!0:n.professors.some(i=>r.has(this._getProfessorFormValue(i)))});N(this,"_checkLectureCourse",n=>{const{courseFocus:r}=this.props;return n.course===r.course.id});N(this,"_checkReviewLanguage",n=>{const{selectedLanguages:r}=this.state;if(r.has("ALL"))return!0;if(r.has("ENG")){const i=(n.content.match(/[A-Za-z가-힣]/g)||[]).length,s=(n.content.match(/[A-Za-z]/g)||[]).length;return i===0||s/i>.55}return!1});N(this,"updateOnReviewSubmit",(n,r)=>{const{updateUserReviewDispatch:i,updateReviewDispatch:s}=this.props;i(n),s(n,r)});this.state={selectedProfessors:new Set(["ALL"]),selectedLanguages:new Set(["ALL"])}}render(){const{t:n}=this.props,{selectedProfessors:r,selectedLanguages:i}=this.state,{user:s,courseFocus:o}=this.props;if(!o.course)return null;const l=[["ALL",n("ui.type.allShort")],...o.course.professors.map(S=>[this._getProfessorFormValue(S),S[n("js.property.name")]])],d=[["ALL",n("ui.language.allShort")],["ENG",n("ui.language.englishShort")]],f=s?s.review_writable_lectures.filter(S=>this._checkLectureCourse(S)&&this._checkLectureProfessor(S)):[],m=f.length===0?void 0:c.jsx("div",{className:g("block-list"),children:f.map(S=>c.jsx(PS,{lecture:S,review:s.reviews.find(x=>x.lecture.id===S.id),pageFrom:"Dictionary",updateOnSubmit:this.updateOnReviewSubmit},S.id))}),_=o.reviews==null?null:o.reviews.filter(S=>this._checkLectureProfessor(S.lecture)&&this._checkReviewLanguage(S)),y=_==null?c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.loading")})}):_.length?c.jsx("div",{className:g("block-list","min-height-area"),children:_.map(S=>c.jsx(Ni,{review:S,shouldLimitLines:!1,pageFrom:"Dictionary"},S.id))}):c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})}),[,,,[b,w,R]]=_?kZ(_):[0,0,[0,0,0],[0,0,0]];return c.jsxs("div",{className:g("subsection","subsection--course-reviews"),children:[c.jsx("div",{className:g("small-title"),children:n("ui.title.reviews")}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedProfessors"),inputName:"professor",titleName:n("ui.search.professor"),options:l,checkedValues:r}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedLanguages"),inputName:"language",titleName:n("ui.search.language"),options:d,checkedValues:i}),c.jsx(ni,{entries:[{name:n("ui.score.grade"),score:cn(b)},{name:n("ui.score.load"),score:cn(w)},{name:n("ui.score.speech"),score:cn(R)}],big:!0}),m,y]})}};const JZ=e=>({user:e.common.user.user,courseFocus:e.dictionary.courseFocus}),eJ=e=>({updateUserReviewDispatch:t=>{e(LS(t))},updateReviewDispatch:(t,n)=>{e(hZ(t,n))}});eN.propTypes={user:ht,courseFocus:Zl.isRequired,updateUserReviewDispatch:h.func.isRequired,updateReviewDispatch:h.func.isRequired};const tJ=de()(Pe(JZ,eJ)(eN));class tN extends X.Component{render(){const{t}=this.props;return c.jsxs("div",{className:g("otlplus-placeholder"),children:[c.jsx("div",{children:"OTL PLUS"}),c.jsxs("div",{children:[c.jsx(Et,{to:"/credits/",children:t("ui.menu.credit")})," | ",c.jsx(Et,{to:"/licenses/",children:t("ui.menu.licences")})," | ",c.jsx(Et,{to:"/privacy/",children:t("ui.menu.privacy")})]}),c.jsx("div",{children:c.jsx("a",{href:`mailto:${xa}`,children:xa})}),c.jsxs("div",{children:["© 2016, ",c.jsx("a",{href:"http://sparcs.org",children:"SPARCS"})," OTL Team"]})]})}}tN.propTypes={};const Xh=de()(tN);class nN extends X.Component{constructor(n){super(n);N(this,"_fetchLectures",()=>{const{courseFocus:n,setLecturesDispatch:r}=this.props;me.get(`/api/courses/${n.course.id}/lectures`,{params:{order:["year","semester","class_no"]},metadata:{gaCategory:"Course",gaVariable:"GET Lectures / Instance"}}).then(i=>{this.props.courseFocus.course.id===n.course.id&&r(i.data)}).catch(i=>{})});N(this,"_fetchReviews",()=>{const{courseFocus:r,setReviewsDispatch:i}=this.props;me.get(`/api/courses/${r.course.id}/reviews`,{params:{order:["-lecture__year","-lecture__semester","-written_datetime","-id"],limit:100},metadata:{gaCategory:"Course",gaVariable:"GET Reviews / Instance"}}).then(s=>{this.props.courseFocus.course.id===r.course.id&&(this._markRead(r.course),s.data.length,i(s.data))}).catch(s=>{})});N(this,"_markRead",n=>{const{user:r,addCourseReadDispatch:i}=this.props;if(!r){i(n);return}me.post(`/api/courses/${n.id}/read`,{},{metadata:{gaCategory:"Review",gaVariable:"POST Read / Instance"}}).then(s=>{i(n)}).catch(s=>{})});N(this,"unfix",()=>{const{clearCourseFocusDispatch:n}=this.props;n()});this.scoresRef=xe.createRef()}componentDidUpdate(n){const{selectedListCode:r,courseFocus:i,clearCourseFocusDispatch:s}=this.props;n.selectedListCode!==r&&s(),!n.courseFocus.course&&i.course&&(this._fetchLectures(),this._fetchReviews()),n.courseFocus.course&&i.course&&n.courseFocus.course.id!==i.course.id&&(this._fetchLectures(),this._fetchReviews())}render(){const{t:n}=this.props,{isPortrait:r,courseFocus:i}=this.props,s=i.course?c.jsxs(c.Fragment,{children:[c.jsx(Fr,{onClick:this.unfix}),c.jsxs("div",{className:g("detail-title-area"),children:[c.jsx("div",{className:g("title"),children:i.course[n("js.property.title")]}),c.jsx("div",{className:g("subtitle"),children:i.course.old_code})]}),c.jsxs(ct,{children:[c.jsx(OZ,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx(DZ,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx(XZ,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx(tJ,{})]},i.course.id)]}):c.jsx(Xh,{});return c.jsx("div",{className:g("section","section--course-detail",r&&"section--modal",i.course?null:"mobile-hidden"),children:c.jsx("div",{className:g("subsection","subsection--flex","subsection--course-detail"),children:s})})}}const nJ=e=>({user:e.common.user.user,isPortrait:e.common.media.isPortrait,courseFocus:e.dictionary.courseFocus,selectedListCode:e.dictionary.list.selectedListCode}),rJ=e=>({clearCourseFocusDispatch:()=>{e(wS())},setLecturesDispatch:t=>{e(mZ(t))},setReviewsDispatch:t=>{e(pZ(t))},addCourseReadDispatch:t=>{e(sQ(t))}});nN.propTypes={user:ht,isPortrait:h.bool.isRequired,courseFocus:Zl.isRequired,selectedListCode:h.string.isRequired,clearCourseFocusDispatch:h.func.isRequired,setLecturesDispatch:h.func.isRequired,setReviewsDispatch:h.func.isRequired,addCourseReadDispatch:h.func.isRequired};const iJ=de()(Pe(nJ,rJ)(nN));let rN=class extends X.Component{constructor(){super(...arguments);N(this,"_fetchList",(n,r=!1)=>{const{user:i,lists:s}=this.props;n!==je.SEARCH&&(!r&&s[n]&&s[n].courses||(n===je.BASIC?this._performFetchBasicList():i&&i.departments.some(o=>o.code===n)?this._performFetchMajorList(n):n===je.HUMANITY?this._performFetchHumanityList():n===je.TAKEN&&this._performFetchTakenList()))});N(this,"_performFetchBasicList",()=>{const{setListCoursesDispatch:n}=this.props;me.get("/api/courses",{params:{group:"Basic",term:["3"],order:["old_code"]},metadata:{gaCategory:"Course",gaVariable:"GET / List"}}).then(r=>{n(je.BASIC,r.data)}).catch(r=>{})});N(this,"_performFetchMajorList",n=>{const{setListCoursesDispatch:r}=this.props;me.get("/api/courses",{params:{group:[n],term:["3"],order:["old_code"]},metadata:{gaCategory:"Course",gaVariable:"GET / List"}}).then(i=>{this.props.user.departments.some(o=>o.code===n)&&r(n,i.data)}).catch(i=>{})});N(this,"_performFetchHumanityList",()=>{const{setListCoursesDispatch:n}=this.props;me.get("/api/courses",{params:{group:"Humanity",term:["3"],order:["old_code"]},metadata:{gaCategory:"Course",gaVariable:"GET / List"}}).then(r=>{n(je.HUMANITY,r.data)}).catch(r=>{})});N(this,"_performFetchTakenList",()=>{const{user:n,setListCoursesDispatch:r}=this.props;if(!n){r(je.TAKEN,[]);return}r(je.TAKEN,null),me.get(`/api/users/${n.id}/taken-courses`,{params:{order:["old_code"]},metadata:{gaCategory:"User",gaVariable:"GET Taken Courses / Instance"}}).then(i=>{r(je.TAKEN,i.data)}).catch(i=>{})});N(this,"changeTab",n=>{const{lists:r,setSelectedListCodeDispatch:i,openSearchDispatch:s,closeSearchDispatch:o}=this.props;i(n),n===je.SEARCH&&(r[je.SEARCH].courses&&r[je.SEARCH].courses.length?o():s());const l=new Map([[je.SEARCH,"Search"],[je.BASIC,"Basic"],[je.HUMANITY,"Humanity"],[je.TAKEN,"Taken"]]);Je.event({category:"Dictionary - List",action:"Switched Course List",label:`Course List : ${l.get(n)||n}`})})}componentDidUpdate(n,r,i){const{user:s,selectedListCode:o}=this.props;s&&!n.user&&o===je.TAKEN&&this._fetchList(o,!0),o!==n.selectedListCode&&this._fetchList(o)}render(){const{t:n}=this.props,{user:r,selectedListCode:i}=this.props;return c.jsx("div",{className:g("tabs","tabs--course-list"),children:c.jsx(ct,{noScrollX:!1,noScrollY:!0,expandBottom:2,children:c.jsxs("div",{className:g("tabs__flexbox"),children:[c.jsxs("div",{className:g("tabs__elem",i===je.SEARCH?"tabs__elem--selected":null),onClick:()=>this.changeTab(je.SEARCH),children:[c.jsx("i",{className:g("icon","icon--tab-search")}),c.jsx("span",{children:n("ui.tab.searchShort")})]}),c.jsxs("div",{className:g("tabs__elem",i===je.BASIC?"tabs__elem--selected":null),onClick:()=>this.changeTab(je.BASIC),children:[c.jsx("i",{className:g("icon","icon--tab-basic")}),c.jsx("span",{children:n("ui.tab.basicShort")})]}),r?r.departments.map(s=>c.jsxs("div",{className:g("tabs__elem",i===s.code?"tabs__elem--selected":null),onClick:()=>this.changeTab(s.code),children:[c.jsx("i",{className:g("icon","icon--tab-major")}),c.jsx("span",{children:n("ui.tab.majorShort")})]},s.code)):null,c.jsxs("div",{className:g("tabs__elem",i===je.HUMANITY?"tabs__elem--selected":null),onClick:()=>this.changeTab(je.HUMANITY),children:[c.jsx("i",{className:g("icon","icon--tab-humanity")}),c.jsx("span",{children:n("ui.tab.humanityShort")})]}),c.jsxs("div",{className:g("tabs__elem",i===je.TAKEN?"tabs__elem--selected":null),onClick:()=>this.changeTab(je.TAKEN),children:[c.jsx("i",{className:g("icon","icon--tab-taken")}),c.jsx("span",{children:n("ui.tab.takenShort")})]})]})})})}};const sJ=e=>({user:e.common.user.user,selectedListCode:e.dictionary.list.selectedListCode,lists:e.dictionary.list.lists}),oJ=e=>({openSearchDispatch:()=>{e(pD())},closeSearchDispatch:()=>{e(xS())},setSelectedListCodeDispatch:t=>{e(HL(t))},setListCoursesDispatch:(t,n)=>{e(mS(t,n))}});rN.propTypes={user:ht,selectedListCode:h.string.isRequired,lists:Vh,openSearchDispatch:h.func.isRequired,closeSearchDispatch:h.func.isRequired,setSelectedListCodeDispatch:h.func.isRequired,setListCoursesDispatch:h.func.isRequired};const aJ=de()(Pe(sJ,oJ)(rN));class iN extends X.Component{componentDidMount(){const{t}=this.props,{startCourseId:n,startTab:r,startSearchKeyword:i}=this.props.location.state||{},{setCourseFocusDispatch:s,setSelectedListCodeDispatch:o,setListCoursesDispatch:l,closeSearchDispatch:d,clearSearchListCoursesDispatch:f}=this.props;if(n&&me.get(`/api/courses/${n}`,{metadata:{gaCategory:"Course",gaVariable:"GET / Instance"}}).then(m=>{s(m.data)}).catch(m=>{}),r&&o(r),i&&i.trim()){const _={keyword:i.trim()};TS(_,150,()=>{d(),f()},w=>{w.length===150&&alert(t("ui.message.tooManySearchResults",{count:150})),l(je.SEARCH,w)})}else if(i!==void 0&&i.trim().length===0){alert(t("ui.message.blankSearchKeyword"));return}}componentWillUnmount(){const{resetCourseFocusDispatch:t,resetListDispatch:n,resetSearchDispatch:r}=this.props;t(),n(),r()}render(){return c.jsx(c.Fragment,{children:c.jsx("section",{className:g("content","content--no-scroll"),children:c.jsxs("div",{className:g("page-grid","page-grid--dictionary"),children:[c.jsx(aJ,{}),c.jsx(RZ,{}),c.jsx(iJ,{})]})})})}}const lJ=e=>({}),uJ=e=>({resetCourseFocusDispatch:()=>{e(fZ())},resetListDispatch:()=>{e(iQ())},resetSearchDispatch:()=>{e(cZ())},setCourseFocusDispatch:t=>{e(bD(t))},setSelectedListCodeDispatch:t=>{e(HL(t))},setListCoursesDispatch:(t,n)=>{e(mS(t,n))},closeSearchDispatch:()=>{e(xS())},clearSearchListCoursesDispatch:()=>{e(WL())}});iN.propTypes={location:h.shape({state:h.shape({startCourseId:h.number,startTab:h.string,startSearchKeyword:h.string})}).isRequired,resetCourseFocusDispatch:h.func.isRequired,resetListDispatch:h.func.isRequired,resetSearchDispatch:h.func.isRequired,setCourseFocusDispatch:h.func.isRequired,setSelectedListCodeDispatch:h.func.isRequired,setListCoursesDispatch:h.func.isRequired,closeSearchDispatch:h.func.isRequired,clearSearchListCoursesDispatch:h.func.isRequired};const cJ=de()(Pe(lJ,uJ)(iN)),Ea="I_CA_",sN=Ea+"RESET",oN=Ea+"SET_ITEM_FOCUS",aN=Ea+"CLEAR_ITEM_FOCUS",lN=Ea+"SET_CATEGORY_FOCUS",uN=Ea+"CLEAR_CATEGORY_FOCUS",cN=Ea+"SET_REVIEWS",dN=Ea+"SET_LECTURES";function dJ(){return{type:sN}}function Kh(e,t,n,r){return{type:oN,item:e,course:t,from:n,clicked:r}}function Qh(){return{type:aN}}function fJ(e){return{type:lN,category:e}}function pJ(){return{type:uN}}function hJ(e){return{type:cN,reviews:e}}function mJ(e){return{type:dN,lectures:e}}const Xc="P_L_",fN=Xc+"RESET",pN=Xc+"SER_SELECTED_LIST_CODE",hN=Xc+"SET_LIST_COURSES",mN=Xc+"CLEAR_SEARCH_LIST_COURSES",gJ=Xc+"ADD_COURSE_READ";function _J(){return{type:fN}}function yJ(e){return{type:pN,listCode:e}}function gN(e,t){return{type:hN,code:e,courses:t}}function vJ(){return{type:mN}}const Zh="P_S_",_N=Zh+"RESET",yN=Zh+"OPEN_SEARCH",vN=Zh+"CLOSE_SEARCH",bN=Zh+"SET_LAST_SEARCH_OPTION";function bJ(){return{type:_N}}function SN(){return{type:yN}}function xN(){return{type:vN}}function SJ(e){return{type:bN,lastSearchOption:e}}const $r="P_P_",wN=$r+"RESET",TN=$r+"SET_PLANNERS",RN=$r+"CLEAR_PLANNERS",kN=$r+"SET_SELECTED_PLANNER",EN=$r+"CREATE_PLANNER",CN=$r+"DELETE_PLANNER",ON=$r+"UPDATE_PLANNER",PN=$r+"ADD_ITEM_TO_PLANNER",LN=$r+"UPDATE_ITEM_IN_PLANNER",DN=$r+"REMOVE_ITEM_FROM_PLANNER",NN=$r+"REORDER_PLANNER",AN=$r+"UPDATE_CELL_SIZE",jN=$r+"SET_IS_TRACK_SETTINGS_SECTION_OPEN";function xJ(){return{type:wN}}function wJ(e){return{type:TN,planners:e}}function TJ(){return{type:RN}}function RJ(e){return{type:kN,planner:e}}function kJ(e){return{type:EN,newPlanner:e}}function EJ(e){return{type:CN,planner:e}}function CJ(e){return{type:ON,updatedPlanner:e}}function OJ(e){return{type:PN,item:e}}function IN(e){return{type:LN,item:e}}function PJ(e){return{type:DN,item:e}}function LJ(e,t){return{type:NN,planner:e,arrangeOrder:t}}function DJ(e,t){return{type:AN,width:e,height:t}}function MN(e){return{type:jN,isTrackSettingsSectionOpen:e}}const DS=h.exact({id:h.number.isRequired,item_type:h.oneOf(["TAKEN"]).isRequired,is_excluded:h.bool.isRequired,lecture:Yt.isRequired,course:ir.isRequired}),NS=h.exact({id:h.number.isRequired,item_type:h.oneOf(["FUTURE"]).isRequired,is_excluded:h.bool.isRequired,year:h.number.isRequired,semester:h.oneOf([1,2,3,4]).isRequired,course:ir.isRequired}),AS=h.exact({id:h.number.isRequired,item_type:h.oneOf(["ARBITRARY"]).isRequired,is_excluded:h.bool.isRequired,year:h.number.isRequired,semester:h.oneOf([1,2,3,4]).isRequired,department:bi,type:h.string.isRequired,type_en:h.string.isRequired,credit:h.number.isRequired,credit_au:h.number.isRequired}),jS=h.exact({id:h.number.isRequired,start_year:h.number.isRequired,end_year:h.number.isRequired,is_foreign:h.bool.isRequired,total_credit:h.number.isRequired,total_au:h.number.isRequired,basic_required:h.number.isRequired,basic_elective:h.number.isRequired,thesis_study:h.number.isRequired,thesis_study_doublemajor:h.number.isRequired,general_required_credit:h.number.isRequired,general_required_au:h.number.isRequired,humanities:h.number.isRequired,humanities_doublemajor:h.number.isRequired}),IS=h.exact({id:h.number.isRequired,start_year:h.number.isRequired,end_year:h.number.isRequired,department:bi.isRequired,basic_elective_doublemajor:h.number.isRequired,major_required:h.number.isRequired,major_elective:h.number.isRequired}),MS=h.exact({id:h.number.isRequired,start_year:h.number.isRequired,end_year:h.number.isRequired,type:h.oneOf(["DOUBLE","MINOR","ADVANCED","INTERDISCIPLINARY"]).isRequired,department:bi,major_required:h.number.isRequired,major_elective:h.number.isRequired}),Oi=h.exact({id:h.number.isRequired,start_year:h.number.isRequired,end_year:h.number.isRequired,general_track:jS.isRequired,major_track:IS.isRequired,additional_tracks:h.arrayOf(MS).isRequired,taken_items:h.arrayOf(DS).isRequired,future_items:h.arrayOf(NS).isRequired,arbitrary_items:h.arrayOf(AS).isRequired,arrange_order:h.number.isRequired});class FN extends X.Component{constructor(n){super(n);N(this,"_fetchPlanners",()=>{const{user:n,setPlannersDispatch:r}=this.props;if(!n){r([]),this._performCreatePlanner();return}me.get(`/api/users/${n.id}/planners`,{params:{order:["arrange_order","id"]},metadata:{gaCategory:"Planner",gaVariable:"GET / List"}}).then(i=>{r(i.data),i.data.length===0&&this._performCreatePlanner()}).catch(i=>{})});N(this,"_createRandomPlannerId",()=>Math.floor(Math.random()*1e8));N(this,"_getPlannerStartYear",n=>{const r=new Date().getFullYear();if(!n)return r;if(n.student_id&&n.student_id.length!==8&&n.student_id[4]==="0"){const i=parseInt(n.student_id.substring(0,4),10);if(i>=2e3&&i<=r)return i}if(n.review_writable_lectures.length>0){const i=Ve.min(n.review_writable_lectures.map(s=>s.year));if(i>=2e3&&i<=r)return i}return r});N(this,"_getPlannerGeneralTrack",(n,r)=>{const{tracks:i}=this.props,s=i.general.filter(l=>r>=l.start_year&&r<=l.end_year),o=s.filter(l=>!l.is_foreign);return o.length>0?o[0]:s[0]});N(this,"_getPlannerMajorTrack",(n,r)=>{const{tracks:i}=this.props,s=i.major.filter(l=>r>=l.start_year&&r<=l.end_year),o=s.filter(l=>{var d;return l.department.code===((d=n==null?void 0:n.department)==null?void 0:d.code)});return o.length>0?o[0]:s[0]});N(this,"changeTab",n=>{const{setSelectedPlannerDispatch:r}=this.props;r(n),Je.event({category:"Planner - Planner",action:"Switched Planner"})});N(this,"_performCreatePlanner",()=>{const{user:n,createPlannerDispatch:r,planners:i}=this.props,s=this._getPlannerStartYear(n),o=Math.max(s+3,new Date().getFullYear()),l=this._getPlannerGeneralTrack(n,s),d=this._getPlannerMajorTrack(n,s),f=i&&i.length>0?Math.max(...i.map(m=>m.arrange_order))+1:0;n?me.post(`/api/users/${n.id}/planners`,{start_year:s,end_year:o,general_track:l.id,major_track:d.id,additional_tracks:[],should_update_taken_semesters:!0,taken_items_to_copy:[],future_items_to_copy:[],arbitrary_items_to_copy:[]},{metadata:{gaCategory:"Planner",gaVariable:"POST / List"}}).then(m=>{r(m.data)}).catch(m=>{}):r({id:this._createRandomPlannerId(),start_year:s,end_year:o,general_track:l,major_track:d,additional_tracks:[],taken_items:[],future_items:[],arbitrary_items:[],arrange_order:f})});N(this,"createPlanner",()=>{this._performCreatePlanner(),Je.event({category:"Planner - Planner",action:"Created Planner"})});N(this,"deletePlanner",(n,r)=>{const{t:i}=this.props,{user:s,planners:o,deletePlannerDispatch:l}=this.props;if(n.stopPropagation(),o.length===1){alert(i("ui.message.lastPlanner"));return}window.confirm(i("ui.message.plannerDelete"))&&(s?me.delete(`/api/users/${s.id}/planners/${r.id}`,{metadata:{gaCategory:"Planner",gaVariable:"DELETE / Instance"}}).then(d=>{l(r)}).catch(d=>{}):l(r),Je.event({category:"Planner - Planner",action:"Deleted Planner"}))});N(this,"duplicatePlanner",(n,r)=>{const{user:i,planners:s,createPlannerDispatch:o}=this.props;n.stopPropagation();const l=Math.max(...s.map(d=>d.arrange_order))+1;if(i)me.post(`/api/users/${i.id}/planners`,{start_year:r.start_year,end_year:r.end_year,general_track:r.general_track.id,major_track:r.major_track.id,additional_tracks:r.additional_tracks.map(d=>d.id),taken_items_to_copy:r.taken_items.map(d=>d.id),future_items_to_copy:r.future_items.map(d=>d.id),arbitrary_items_to_copy:r.arbitrary_items.map(d=>d.id)},{metadata:{gaCategory:"Planner",gaVariable:"POST / List"}}).then(d=>{o(d.data)}).catch(d=>{});else{const d={...r,id:this._createRandomPlannerId(),taken_items:r.taken_items.map(f=>({...f,id:this._createRandomPlannerId()})),future_items:r.future_items.map(f=>({...f,id:this._createRandomPlannerId()})),arbitrary_items:r.arbitrary_items.map(f=>({...f,id:this._createRandomPlannerId()})),arrange_order:l};o(d)}Je.event({category:"Planner - Planner",action:"Duplicated Planner"})});N(this,"handlePointerDown",n=>{n.stopPropagation(),n.preventDefault();const{draggingPlannerId:r}=this.state,{isPortrait:i}=this.props;r===void 0&&(this.setState({draggingPlannerId:Number(n.currentTarget.dataset.id),dragStartPosition:i?n.clientY:n.clientX,dragCurrentPosition:i?n.clientY:n.clientX,dragOrderChanged:!1}),document.addEventListener("pointermove",this.handlePointerMove),document.addEventListener("pointerup",this.handlePointerUp),document.body.style.cursor="grabbing")});N(this,"_checkAndReorderPlannerPrev",(n,r)=>{const{draggingPlannerId:i,dragStartPosition:s}=this.state,{user:o,planners:l,reorderPlannerDispatch:d}=this.props,f=r?"right":"bottom",m=r?"width":"height",_=r?6:8,y=Array.from(document.querySelectorAll(`.${g("tabs--planner")} .${g("tabs__elem--draggable")}`)),b=document.querySelector(`.${g("tabs--planner")} .${g("tabs__elem--dragging")}`),w=y.findIndex(S=>S===b);if(w===0)return;const R=y[w-1];if(nE.id===i),x=l[S],L=l[S-1];o&&me.post(`/api/users/${o.id}/planners/${x.id}/reorder`,{arrange_order:L.arrange_order},{metadata:{gaCategory:"Planner",gaVariable:"POST Reorder / Instance"}}).then(E=>{}).catch(E=>{}),d(x,L.arrange_order),this.setState({dragStartPosition:s-(R.getBoundingClientRect()[m]+_)})}});N(this,"_checkAndReorderPlannerNext",(n,r)=>{const{draggingPlannerId:i,dragStartPosition:s}=this.state,{user:o,planners:l,reorderPlannerDispatch:d}=this.props,f=r?"left":"top",m=r?"width":"height",_=r?6:8,y=Array.from(document.querySelectorAll(`.${g("tabs--planner")} .${g("tabs__elem--draggable")}`)),b=document.querySelector(`.${g("tabs--planner")} .${g("tabs__elem--dragging")}`),w=y.findIndex(S=>S===b);if(w===y.length-1)return;const R=y[w+1];if(n>R.getBoundingClientRect()[f]){const S=l.findIndex(E=>E.id===i),x=l[S],L=l[S+1];o&&me.post(`/api/users/${o.id}/planners/${x.id}/reorder`,{arrange_order:L.arrange_order},{metadata:{gaCategory:"Planner",gaVariable:"POST Reorder / Instance"}}).then(E=>{}).catch(E=>{}),d(x,L.arrange_order),this.setState({dragStartPosition:s+(R.getBoundingClientRect()[m]+_)})}});N(this,"handlePointerMove",n=>{const{dragStartPosition:r,dragCurrentPosition:i,draggingPlannerId:s}=this.state,{isPortrait:o}=this.props,l=o?n.clientY:n.clientX,d=l-i;s!==void 0&&(this.setState({dragCurrentPosition:l}),Math.abs(l-r)>10&&this.setState({dragOrderChanged:!0}),d>0?this._checkAndReorderPlannerNext(l,!o):d<0&&this._checkAndReorderPlannerPrev(l,!o))});N(this,"handlePointerUp",n=>{const{draggingPlannerId:r}=this.state;r!==void 0&&(this.setState({draggingPlannerId:void 0,dragStartPosition:void 0,dragCurrentPosition:void 0,dragOrderChanged:!1}),document.removeEventListener("pointermove",this.handlePointerMove),document.removeEventListener("pointerup",this.handlePointerUp),document.body.style.cursor="")});N(this,"_isSelected",n=>{const{selectedPlanner:r}=this.props;return r&&n.id===r.id});N(this,"_isDragging",n=>{const{draggingPlannerId:r}=this.state;return r!==void 0&&n.id===r});N(this,"_getTabRelativePosition",n=>{if(!this._isDragging(n))return;const{dragStartPosition:r,dragCurrentPosition:i}=this.state,{planners:s}=this.props,o=i-r;return s.findIndex(l=>l.id===n.id)===0&&o<0||s.findIndex(l=>l.id===n.id)===s.length-1&&o>0?0:o});this.state={draggingPlannerId:void 0,dragStartPosition:void 0,dragCurrentPosition:void 0,dragOrderChanged:!1}}componentDidMount(){const{tracks:n}=this.props;n&&this._fetchPlanners()}componentDidUpdate(n,r,i){const{user:s,tracks:o,clearPlannersDispatch:l}=this.props;!n.tracks&&o&&this._fetchPlanners(),o&&!n.user&&s&&(l(),this._fetchPlanners())}render(){const{dragOrderChanged:n}=this.state,{t:r}=this.props,{isPortrait:i,planners:s}=this.props,o=s&&s.length?s.map((d,f)=>c.jsxs("div",{className:g("tabs__elem","tabs__elem--draggable",this._isSelected(d)?"tabs__elem--selected":null,this._isDragging(d)?"tabs__elem--dragging":null),onClick:()=>this.changeTab(d),onPointerDown:this.handlePointerDown,"data-id":d.id,style:{[i?"top":"left"]:this._getTabRelativePosition(d),pointerEvents:n?"none":void 0},children:[c.jsx("span",{children:`${r("ui.others.planner")} ${f+1}`}),c.jsxs("button",{onClick:m=>this.duplicatePlanner(m,d),children:[c.jsx("i",{className:g("icon","icon--duplicate-table")}),c.jsx("span",{children:r("ui.button.duplicatePlanner")})]}),c.jsxs("button",{onClick:m=>this.deletePlanner(m,d),children:[c.jsx("i",{className:g("icon","icon--delete-table")}),c.jsx("span",{children:r("ui.button.deletePlanner")})]})]},d.id)):c.jsx("div",{className:g("tabs__elem"),style:{pointerEvents:"none"},children:c.jsx("span",{children:r("ui.placeholder.loading")})}),l=s&&s.length?c.jsx("div",{className:g("tabs__elem","tabs__elem--add-button"),onClick:()=>this.createPlanner(),children:c.jsx("i",{className:g("icon","icon--add-table")})}):null;return c.jsxs("div",{className:g("tabs","tabs--planner"),children:[o,l]})}}const NJ=e=>({user:e.common.user.user,isPortrait:e.common.media.isPortrait,tracks:e.common.track.tracks,planners:e.planner.planner.planners,selectedPlanner:e.planner.planner.selectedPlanner,myPlanner:e.planner.planner.myPlanner}),AJ=e=>({setPlannersDispatch:t=>{e(wJ(t))},clearPlannersDispatch:()=>{e(TJ())},setSelectedPlannerDispatch:t=>{e(RJ(t))},createPlannerDispatch:t=>{e(kJ(t))},deletePlannerDispatch:t=>{e(EJ(t))},reorderPlannerDispatch:(t,n)=>{e(LJ(t,n))}});FN.propTypes={user:ht,isPortrait:h.bool.isRequired,tracks:h.exact({general:h.arrayOf(jS),major:h.arrayOf(IS),additional:h.arrayOf(MS)}),planners:h.arrayOf(Oi),selectedPlanner:Oi,setPlannersDispatch:h.func.isRequired,clearPlannersDispatch:h.func.isRequired,setSelectedPlannerDispatch:h.func.isRequired,createPlannerDispatch:h.func.isRequired,deletePlannerDispatch:h.func.isRequired,reorderPlannerDispatch:h.func.isRequired};const jJ=de()(Pe(NJ,AJ)(FN)),qe={NONE:"NONE",LIST:"LIST",TABLE_TAKEN:"TABLE_TAKEN",TABLE_FUTURE:"TABLE_FUTURE",TABLE_ARBITRARY:"TABLE_ARBITRARY",CATEGORY:"CATEGORY"},XR={from:qe.NONE,clicked:!1,item:null,course:null,category:null,reviews:null,lectures:null},IJ=(e=XR,t)=>{switch(t.type){case sN:return XR;case oN:{const n=!e.course||e.course.id!==t.course.id;return Object.assign({},e,{from:t.from,clicked:t.clicked,item:t.item,course:t.course},n?{reviews:null,lectures:null}:{})}case aN:return Object.assign({},e,{from:qe.NONE,clicked:!1,item:null,course:null,reviews:null,lectures:null});case lN:return Object.assign({},e,{from:qe.CATEGORY,category:t.category});case uN:return Object.assign({},e,{from:qe.NONE,category:null});case cN:return Object.assign({},e,{reviews:t.reviews});case dN:return Object.assign({},e,{lectures:t.lectures});default:return e}},fv=h.exact({id:h.number.isRequired,isArbitrary:h.oneOf([!0]).isRequired,department:bi,type:h.string.isRequired,type_en:h.string.isRequired,credit:h.number.isRequired,credit_au:h.number.isRequired,title:h.string.isRequired,title_en:h.string.isRequired,old_code:h.string.isRequired}),Lo=h.oneOfType([h.exact({from:h.oneOf([qe.NONE]).isRequired,clicked:h.oneOf([!1]).isRequired,item:h.oneOf([null]),course:h.oneOf([null]),category:h.oneOf([null]),reviews:h.oneOf([null]),lectures:h.oneOf([null])}),h.exact({from:h.oneOf([qe.LIST]).isRequired,clicked:h.bool.isRequired,item:h.oneOf([null]),course:h.oneOfType([ir,fv]),category:h.oneOf([null]),reviews:h.arrayOf(pn),lectures:h.arrayOf(Yt)}),h.exact({from:h.oneOf([qe.TABLE_TAKEN,qe.TABLE_FUTURE,qe.TABLE_ARBITRARY]).isRequired,clicked:h.bool.isRequired,item:h.oneOfType([DS,NS,AS]),course:h.oneOfType([ir,fv]),category:h.oneOf([null]),reviews:h.arrayOf(pn),lectures:h.arrayOf(Yt)}),h.exact({from:h.oneOf([qe.CATEGORY]).isRequired,clicked:h.bool.isRequired,item:h.oneOf([null]),course:h.oneOf([null]),category:h.arrayOf(h.number).isRequired,reviews:h.oneOf([null]),lectures:h.oneOf([null])})]),$N=e=>{switch(e.item_type){case"TAKEN":return e.lecture.semester;case"FUTURE":return e.semester;case"ARBITRARY":return e.semester;default:return 2e3}},ra=e=>e.item_type==="TAKEN"?e.lecture.credit:e.item_type==="FUTURE"?e.course.credit:e.item_type==="ARBITRARY"?e.credit:0,ia=e=>e.item_type==="TAKEN"?e.lecture.credit_au:e.item_type==="FUTURE"?e.course.credit_au:e.item_type==="ARBITRARY"?e.credit_au:0,cl=e=>ra(e)+ia(e),zf=(e,t,n)=>n?t.endsWith("Required")?-(n.id*100+1):t.endsWith("Elective")?-(n.id*100+2):-(n.id*100+3):-991,Vf=(e,t,n)=>`임의의 ${e} 과목`,Gf=(e,t,n)=>`Arbitrary ${t} Course`,Xf=(e,t,n)=>t.startsWith("Major")?`${n.code}---`:"HSS---",Sn=e=>{switch(e.item_type){case"TAKEN":return e.course;case"FUTURE":return e.course;case"ARBITRARY":return{id:zf(e.type,e.type_en,e.department),isArbitrary:!0,department:e.department,type:e.type,type_en:e.type_en,credit:e.credit,credit_au:e.credit_au,title:Vf(e.type,e.type_en,e.department),title_en:Gf(e.type,e.type_en,e.department),old_code:Xf(e.type,e.type_en,e.department)};default:return null}},MJ=(e,t)=>t&&[...t.taken_items,...t.future_items,...t.arbitrary_items].some(n=>!n.is_excluded&&Sn(n).id===e.id),Ye={TOTAL:-1,BASIC:0,MAJOR:1,RESEARCH:2,GENERAL_AND_HUMANITY:3,OTHERS:4},sa=(e,t)=>e&&t&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2],zp=e=>e?[e.major_track,...e.additional_tracks.filter(t=>t.type==="DOUBLE"),...e.additional_tracks.filter(t=>t.type==="MINOR"),...e.additional_tracks.filter(t=>t.type==="INTERDISCIPLINARY")]:[],qu=(e,t,n)=>{switch(t){case"Basic Required":return[Ye.BASIC,0,0];case"Basic Elective":return[Ye.BASIC,0,1];case"Major Required":{const r=zp(e),i=r.find(s=>{var o;return((o=s.department)==null?void 0:o.code)===n})||r.find(s=>s.type==="INTERDISCIPLINARY");if(i){const s=r.findIndex(o=>o.id===i.id);return[Ye.MAJOR,s,0]}return[Ye.OTHERS,0,0]}case"Major Elective":case"Elective(Graduate)":{const r=zp(e),i=r.find(s=>{var o;return((o=s.department)==null?void 0:o.code)===n})||r.find(s=>s.type==="INTERDISCIPLINARY");if(i){const s=r.findIndex(o=>o.id===i.id);return[Ye.MAJOR,s,1]}return[Ye.OTHERS,0,0]}case"Thesis Study(Undergraduate)":return[Ye.RESEARCH,0,0];case"Individual Study":return[Ye.RESEARCH,0,1];case"General Required":case"Mandatory General Courses":return[Ye.GENERAL_AND_HUMANITY,0,0];case"Humanities & Social Elective":return[Ye.GENERAL_AND_HUMANITY,0,1];case"Other Elective":return[Ye.OTHERS,0,0]}return t!=null&&t.startsWith("Humanities & Social Elective")?[Ye.GENERAL_AND_HUMANITY,0,1]:[Ye.OTHERS,0,0]},oa=(e,t)=>{var n;switch(t.item_type){case"TAKEN":return qu(e,t.lecture.type_en,t.lecture.department_code);case"FUTURE":return qu(e,t.course.type_en,t.course.department.code);case"ARBITRARY":return qu(e,t.type_en,(n=t.department)==null?void 0:n.code);default:return qu(e,"","")}},qN=(e,t)=>{switch(t[0]){case 0:return 1;case 1:return 3+t[1]*2%7;case 2:return 11;case 3:return 14;case 4:return 17;default:return 17}},FJ=(e,t)=>qN(e,oa(e,t)),$J=(e,t)=>e!=null&&t!=null&&e.item_type===t.item_type&&e.id===t.id,UN=(e,t)=>(t.from===qe.TABLE_TAKEN||t.from===qe.TABLE_FUTURE||t.from===qe.TABLE_ARBITRARY)&&$J(e,t.item),KR=(e,t)=>UN(e,t)&&t.clicked===!0,qJ=(e,t)=>UN(e,t)||t.from===qe.LIST&&Sn(e)&&t.course&&Sn(e).id===t.course.id,UJ=(e,t,n)=>{if(t.from!==qe.CATEGORY||!n)return!1;const r=t.category,i=oa(n,e);if(r[0]===Ye.TOTAL)return r[2]===0?ra(e)>0:ia(e)>0;if(r[0]!==i[0])return!1;switch(r[0]){case Ye.MAJOR:{if(zp(n)[r[1]].major_required===0){if(r[2]===0)return!1;const o=[r[0],r[1],0];return sa(i,r)||sa(i,o)}return sa(i,r)}default:return sa(i,r)}},BN=(e,t,n)=>qJ(e,t)||UJ(e,t,n),BJ=(e,t)=>!BN(e,t)&&t.clicked===!0,E_=(e,t)=>t.from===qe.LIST&&t.course.id===e.id&&t.clicked===!0,QR=(e,t)=>t.from===qe.LIST&&t.clicked===!0&&t.course.id!==e.id,HN=({t:e,item:t,yearIndex:n,semesterIndex:r,beginIndex:i,endIndex:s,color:o,tableSize:l,cellWidth:d,cellHeight:f,isPlannerWithSummer:m,isPlannerWithWinter:_,isDuplicate:y,isRaised:b,isHighlighted:w,isDimmed:R,isSimple:S,onMouseOver:x,onMouseOut:L,onClick:E,deleteLecture:I})=>{const j=x?V=>{x(t)}:null,P=L?V=>{L(t)}:null,U=E?V=>{E(t)}:null,W=V=>{V.stopPropagation(),I(t)},J=()=>{const V=17+(m?15:0)+f*l;return r===0?V-f*s+2:r===1?V+f*2+11+f*i+1:V};return c.jsxs("div",{className:g("tile","tile--planner",`background-color--${o}`,t.item_type==="TAKEN"?null:"background-color--stripe",b?"tile--raised":null,w?"tile--highlighted":null,R?"tile--dimmed":null,t.is_excluded?"tile--planner--excluded":null),style:{left:26+(d+15)*n-1,top:J(),width:d+2,height:f*(s-i)-3},onMouseOver:j,onMouseOut:P,onClick:U,children:[t.item_type!=="TAKEN"?c.jsx("button",{className:g("tile--planner__button"),onClick:W,children:c.jsx("i",{className:g("icon","icon--delete-lecture")})}):null,c.jsxs("div",{className:g("tile--planner__content"),children:[c.jsx("p",{className:g("tile--planner__content__title",S?"mobile-hidden":null),children:Sn(t)[e("js.property.title")]}),$N(t)%2===0&&c.jsx("p",{className:g("tile--planner__content__label",S?"mobile-hidden":null,`background-color--${o}`,"background-color--dark"),children:"S"}),t.item_type==="ARBITRARY"&&c.jsx("p",{className:g("tile--planner__content__label",S?"mobile-hidden":null,`background-color--${o}`,"background-color--dark"),children:"?"}),t.is_excluded&&c.jsx("p",{className:g("tile--planner__content__label",S?"mobile-hidden":null,`background-color--${o}`,"background-color--dark"),children:"X"}),y&&c.jsx("p",{className:g("tile--planner__content__label",S?"mobile-hidden":null,`background-color--${o}`,"background-color--dark"),children:"!"})]})]})};HN.propTypes={item:h.oneOfType([DS,NS,AS]).isRequired,yearIndex:h.number.isRequired,semesterIndex:h.oneOf([0,1]).isRequired,beginIndex:h.number.isRequired,endIndex:h.number.isRequired,color:h.number.isRequired,tableSize:h.number.isRequired,cellWidth:h.number.isRequired,cellHeight:h.number.isRequired,isPlannerWithSummer:h.bool.isRequired,isPlannerWithWinter:h.bool.isRequired,isDuplicate:h.bool.isRequired,isRaised:h.bool.isRequired,isHighlighted:h.bool.isRequired,isDimmed:h.bool.isRequired,isSimple:h.bool.isRequired,onMouseOver:h.func,onMouseOut:h.func,onClick:h.func,deleteLecture:h.func.isRequired};const HJ=de()(xe.memo(HN));class WN extends X.Component{constructor(){super(...arguments);N(this,"_getItemsForSemester",(n,r,i)=>n?Ve.sortBy([...n.taken_items.filter(s=>s.lecture.year===r&&s.lecture.semester===i),...n.future_items.filter(s=>s.year===r&&s.semester===i),...n.arbitrary_items.filter(s=>s.year===r&&s.semester===i)],s=>{const o=oa(n,s);return s.is_excluded?100**4:0+o[0]*100**3+o[1]*100**2+o[2]*100+(100-cl(s))}):[]);N(this,"resize",()=>{const{updateCellSizeDispatch:n}=this.props,r=document.getElementsByClassName(g("subsection--planner__table__body__cell"))[0].getBoundingClientRect();n(r.width,r.height+1)});N(this,"_getFromOfItem",n=>n.item_type==="TAKEN"?qe.TABLE_TAKEN:n.item_type==="FUTURE"?qe.TABLE_FUTURE:n.item_type==="ARBITRARY"?qe.TABLE_ARBITRARY:"");N(this,"_getTileSizeOfItem",n=>cl(n));N(this,"focusItemWithHover",n=>{const{itemFocus:r,isDragging:i,setItemFocusDispatch:s}=this.props;!r.clicked&&!i&&s(n,Sn(n),this._getFromOfItem(n),!1)});N(this,"unfocusItemWithHover",n=>{const{itemFocus:r,clearItemFocusDispatch:i}=this.props;r.clicked||i()});N(this,"focusItemWithClick",n=>{const{itemFocus:r,setItemFocusDispatch:i}=this.props;KR(n,r)?i(n,Sn(n),this._getFromOfItem(n),!1):i(n,Sn(n),this._getFromOfItem(n),!0)});N(this,"deleteItemFromPlanner",n=>{const{selectedPlanner:r,user:i,removeItemFromPlannerDispatch:s,clearItemFocusDispatch:o}=this.props;r&&(i?me.post(`/api/users/${i.id}/planners/${r.id}/remove-item`,{item:n.id,item_type:n.item_type},{metadata:{gaCategory:"Planner",gaVariable:"POST Update / Instance"}}).then(l=>{const d=this.props;!d.selectedPlanner||d.selectedPlanner.id!==r.id||(s(n),o())}).catch(l=>{}):(s(n),o()))})}componentDidMount(){this.resize(),window.addEventListener("resize",this.resize)}componentDidUpdate(){this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.resize)}render(){const{t:n,selectedPlanner:r,itemFocus:i,cellWidth:s,cellHeight:o}=this.props,l=new Date().getFullYear(),d=r?r.start_year:l,f=r?r.end_year:l+3,m=Ve.range(d,f+1),_=Math.max(...m.map(E=>[1,3].map(I=>{const j=this._getItemsForSemester(r,E,I),P=this._getItemsForSemester(r,E,I+1),U=Ve.sumBy(j,W=>this._getTileSizeOfItem(W))+Ve.sumBy(P,W=>this._getTileSizeOfItem(W));return Math.floor(U/3)*3})).flat(),ZZ),y=m.map(E=>this._getItemsForSemester(r,E,2).length).some(E=>E>0),b=m.map(E=>this._getItemsForSemester(r,E,4).length).some(E=>E>0),w=(E,I)=>{const j=this._getItemsForSemester(r,E,I),P=Ve.sumBy(j,W=>ra(W)),U=Ve.sumBy(j,W=>ia(W));return I%2===0&&P===0&&U===0?null:c.jsxs(c.Fragment,{children:[c.jsx("span",{children:`${E} ${ar(I)}`}),c.jsx("span",{children:U===0?`${n("ui.others.creditCount",{count:P})}`:`${n("ui.others.creditCount",{count:P})} ${n("ui.others.auCount",{count:U})}`})]})},R=Ve.range(0,_/3),S=()=>{const E=[y&&c.jsx("div",{className:g("subsection--planner__table__label__toptitle")},"title:summer"),c.jsx("div",{className:g("subsection--planner__table__label__toptitle")},"title:spring"),c.jsx("div",{className:g("subsection--planner__table__label__line"),children:c.jsx("strong",{children:_})},`line:${_}`),...R.slice().reverse().map(j=>{const P=3*j%12===0&&j!==0?"strong":"span";return[c.jsx("div",{className:g("subsection--planner__table__label__cell")},`cell:${3*j+3}`),c.jsx("div",{className:g("subsection--planner__table__label__line")},`line:${3*j+2}`),c.jsx("div",{className:g("subsection--planner__table__label__cell")},`cell:${3*j+2}`),c.jsx("div",{className:g("subsection--planner__table__label__line")},`line:${3*j+1}`),c.jsx("div",{className:g("subsection--planner__table__label__cell")},`cell:${3*j+1}`),c.jsx("div",{className:g("subsection--planner__table__label__line"),children:c.jsx(P,{children:3*j})},`line:${3*j}`)]}).flat(1)],I=[...R.map(j=>{const P=3*j%12===0&&j!==0?"strong":"span";return[c.jsx("div",{className:g("subsection--planner__table__label__line"),children:c.jsx(P,{children:3*j})},`line:${3*j}`),c.jsx("div",{className:g("subsection--planner__table__label__cell")},`cell:${3*j+1}`),c.jsx("div",{className:g("subsection--planner__table__label__line")},`line:${3*j+1}`),c.jsx("div",{className:g("subsection--planner__table__label__cell")},`cell:${3*j+2}`),c.jsx("div",{className:g("subsection--planner__table__label__line")},`line:${3*j+2}`),c.jsx("div",{className:g("subsection--planner__table__label__cell")},`cell:${3*j+3}`)]}).flat(1),c.jsx("div",{className:g("subsection--planner__table__label__line"),children:c.jsx("strong",{children:_})},`line:${_}`),c.jsx("div",{className:g("subsection--planner__table__label__bottomtitle")},"title:fall"),b&&c.jsx("div",{className:g("subsection--planner__table__label__bottomtitle")},"title:winter")];return c.jsxs("div",{className:g("subsection--planner__table__label"),children:[E,c.jsx("div",{className:g("subsection--planner__table__label__cell")}),c.jsx("div",{className:g("subsection--planner__table__label__year")}),c.jsx("div",{className:g("subsection--planner__table__label__cell")}),I]})},x=E=>{const I=[y&&c.jsx("div",{className:g("subsection--planner__table__body__toptitle"),children:w(E,2)},"title:summer"),c.jsx("div",{className:g("subsection--planner__table__body__toptitle"),children:w(E,1)},"title:spring"),c.jsx("div",{className:g("subsection--planner__table__body__line","subsection--planner__table__body__line--bold")},`line:${_}`),...R.slice().reverse().map(P=>[c.jsx("div",{className:g("subsection--planner__table__body__cell")},`cell:${3*P+3}`),c.jsx("div",{className:g("subsection--planner__table__body__line","subsection--planner__table__body__line--dashed",null)},`line:${3*P+2}`),c.jsx("div",{className:g("subsection--planner__table__body__cell")},`cell:${3*P+2}`),c.jsx("div",{className:g("subsection--planner__table__body__line","subsection--planner__table__body__line--dashed",null)},`line:${3*P+1}`),c.jsx("div",{className:g("subsection--planner__table__body__cell")},`cell:${3*P+1}`),c.jsx("div",{className:g("subsection--planner__table__body__line",3*P%12===0&&P!==0?"subsection--planner__table__body__line--bold":null)},`line:${3*P}`)]).flat(1)],j=[...R.map(P=>[c.jsx("div",{className:g("subsection--planner__table__body__line",3*P%12===0&&P!==0?"subsection--planner__table__body__line--bold":null)},`line:${3*P}`),c.jsx("div",{className:g("subsection--planner__table__body__cell")},`cell:${3*P+1}`),c.jsx("div",{className:g("subsection--planner__table__body__line","subsection--planner__table__body__line--dashed",null)},`line:${3*P+1}`),c.jsx("div",{className:g("subsection--planner__table__body__cell")},`cell:${3*P+2}`),c.jsx("div",{className:g("subsection--planner__table__body__line","subsection--planner__table__body__line--dashed",null)},`line:${3*P+2}`),c.jsx("div",{className:g("subsection--planner__table__body__cell")},`cell:${3*P+3}`)]).flat(1),c.jsx("div",{className:g("subsection--planner__table__body__line","subsection--planner__table__body__line--bold")},`line:${_}`),c.jsx("div",{className:g("subsection--planner__table__body__bottomtitle"),children:w(E,3)},"title:fall"),b&&c.jsx("div",{className:g("subsection--planner__table__body__bottomtitle"),children:w(E,4)},"title:winter")];return c.jsxs("div",{className:g("subsection--planner__table__body"),children:[I,c.jsx("div",{className:g("subsection--planner__table__body__cell")}),c.jsx("div",{className:g("subsection--planner__table__body__year"),children:c.jsx("strong",{children:E})}),c.jsx("div",{className:g("subsection--planner__table__body__cell")}),j]},E)},L=(E,I,j)=>{const P=[...this._getItemsForSemester(r,E,I),...j?this._getItemsForSemester(r,E,I+1):[]],U=P.map(W=>this._getTileSizeOfItem(W));return P.map((W,J)=>c.jsx(HJ,{item:W,yearIndex:E-d,semesterIndex:I<=2?0:1,beginIndex:Ve.sum(U.slice(0,J)),endIndex:Ve.sum(U.slice(0,J))+U[J],color:FJ(r,W),tableSize:_,cellWidth:s,cellHeight:o,isPlannerWithSummer:y,isPlannerWithWinter:b,isDuplicate:W.item_type!=="ARBITRARY"&&!W.is_excluded&&[...r.taken_items,...r.future_items].filter(V=>Sn(V).id===Sn(W).id&&!V.is_excluded).length>1,isRaised:KR(W,i),isHighlighted:BN(W,i,r),isDimmed:BJ(W,i),isSimple:!1,onMouseOver:this.focusItemWithHover,onMouseOut:this.unfocusItemWithHover,onClick:this.focusItemWithClick,deleteLecture:this.deleteItemFromPlanner},`Tile:${E}-${I}-${W.item_type}-${W.id}`))};return c.jsx("div",{className:g("subsection","subsection--planner"),children:c.jsxs("div",{className:g("subsection--planner__table"),children:[S(),m.map(E=>x(E)),m.map(E=>[1,3].map(I=>L(E,I,!0)))]})})}}const WJ=e=>({user:e.common.user.user,selectedPlanner:e.planner.planner.selectedPlanner,itemFocus:e.planner.itemFocus,cellWidth:e.planner.planner.cellWidth,cellHeight:e.planner.planner.cellHeight,isDragging:e.planner.planner.isDragging}),YJ=e=>({updateCellSizeDispatch:(t,n)=>{e(DJ(t,n))},setItemFocusDispatch:(t,n,r,i)=>{e(Kh(t,n,r,i))},clearItemFocusDispatch:()=>{e(Qh())},removeItemFromPlannerDispatch:t=>{e(PJ(t))}});WN.propTypes={user:ht,selectedPlanner:Oi,itemFocus:Lo.isRequired,cellWidth:h.number.isRequired,cellHeight:h.number.isRequired,isDragging:h.bool.isRequired,updateCellSizeDispatch:h.func.isRequired,setItemFocusDispatch:h.func.isRequired,clearItemFocusDispatch:h.func.isRequired,removeItemFromPlannerDispatch:h.func.isRequired};const zJ=de()(Pe(WJ,YJ)(WN)),Me={SEARCH:"search",BASIC:"basic",HUMANITY:"humanity",TAKEN:"taken"},ZR={selectedListCode:Me.SEARCH,lists:{[Me.SEARCH]:{courses:[]},[Me.BASIC]:{courses:null},[Me.HUMANITY]:{courses:null},[Me.TAKEN]:{courses:null}},readCourses:[]},VJ=(e=ZR,t)=>{switch(t.type){case fN:return ZR;case pN:return Object.assign({},e,{selectedListCode:t.listCode});case hN:{const n={...e};return n.lists={...n.lists},n.lists[t.code]={...n.lists[t.code]},n.lists[t.code].courses=t.courses,Object.assign({},e,n)}case mN:{const n={...e};return n.lists={...n.lists},n.lists[Me.SEARCH]={...n.lists[Me.SEARCH]},n.lists[Me.SEARCH].courses=null,Object.assign({},e,n)}case gJ:{const n={readCourses:[...e.readCourses,t.course]};return Object.assign({},e,n)}default:return e}};class YN extends X.Component{constructor(){super(...arguments);N(this,"_fetchList",(n,r=!1)=>{const{user:i,lists:s}=this.props;n!==Me.SEARCH&&(!r&&s[n]&&s[n].courses||(n===Me.BASIC?this._performFetchBasicList():i&&i.departments.some(o=>o.code===n)?this._performFetchMajorList(n):n===Me.HUMANITY?this._performFetchHumanityList():n===Me.TAKEN&&this._performFetchTakenList()))});N(this,"_performFetchBasicList",()=>{const{setListCoursesDispatch:n}=this.props;me.get("/api/courses",{params:{group:"Basic",term:["3"],order:["old_code"]},metadata:{gaCategory:"Course",gaVariable:"GET / List"}}).then(r=>{n(Me.BASIC,r.data)}).catch(r=>{})});N(this,"_performFetchMajorList",n=>{const{setListCoursesDispatch:r}=this.props;me.get("/api/courses",{params:{group:[n],term:["3"],order:["old_code"]},metadata:{gaCategory:"Course",gaVariable:"GET / List"}}).then(i=>{this.props.user.departments.some(o=>o.code===n)&&r(n,i.data)}).catch(i=>{})});N(this,"_performFetchHumanityList",()=>{const{setListCoursesDispatch:n}=this.props;me.get("/api/courses",{params:{group:"Humanity",term:["3"],order:["old_code"]},metadata:{gaCategory:"Course",gaVariable:"GET / List"}}).then(r=>{n(Me.HUMANITY,r.data)}).catch(r=>{})});N(this,"_performFetchTakenList",()=>{const{user:n,setListCoursesDispatch:r}=this.props;if(!n){r(Me.TAKEN,[]);return}r(Me.TAKEN,null),me.get(`/api/users/${n.id}/taken-courses`,{params:{order:["old_code"]},metadata:{gaCategory:"User",gaVariable:"GET Taken Courses / Instance"}}).then(i=>{r(Me.TAKEN,i.data)}).catch(i=>{})});N(this,"changeTab",n=>{const{lists:r,setSelectedListCodeDispatch:i,openSearchDispatch:s,closeSearchDispatch:o}=this.props;i(n),n===Me.SEARCH&&(r[Me.SEARCH].courses&&r[Me.SEARCH].courses.length?o():s());const l=new Map([[Me.SEARCH,"Search"],[Me.BASIC,"Basic"],[Me.HUMANITY,"Humanity"],[Me.TAKEN,"Taken"]]);Je.event({category:"Dictionary - List",action:"Switched Course List",label:`Course List : ${l.get(n)||n}`})})}componentDidUpdate(n,r,i){const{user:s,selectedListCode:o}=this.props;s&&!n.user&&o===Me.TAKEN&&this._fetchList(o,!0),o!==n.selectedListCode&&this._fetchList(o)}render(){const{t:n}=this.props,{user:r,selectedListCode:i}=this.props;return c.jsx("div",{className:g("tabs","tabs--course-list","mobile-hidden"),children:c.jsx(ct,{noScrollX:!1,noScrollY:!0,expandBottom:2,children:c.jsxs("div",{className:g("tabs__flexbox"),children:[c.jsxs("div",{className:g("tabs__elem",i===Me.SEARCH?"tabs__elem--selected":null),onClick:()=>this.changeTab(Me.SEARCH),children:[c.jsx("i",{className:g("icon","icon--tab-search")}),c.jsx("span",{children:n("ui.tab.searchShort")})]}),c.jsxs("div",{className:g("tabs__elem",i===Me.BASIC?"tabs__elem--selected":null),onClick:()=>this.changeTab(Me.BASIC),children:[c.jsx("i",{className:g("icon","icon--tab-basic")}),c.jsx("span",{children:n("ui.tab.basicShort")})]}),r?r.departments.map(s=>c.jsxs("div",{className:g("tabs__elem",i===s.code?"tabs__elem--selected":null),onClick:()=>this.changeTab(s.code),children:[c.jsx("i",{className:g("icon","icon--tab-major")}),c.jsx("span",{children:n("ui.tab.majorShort")})]},s.code)):null,c.jsxs("div",{className:g("tabs__elem",i===Me.HUMANITY?"tabs__elem--selected":null),onClick:()=>this.changeTab(Me.HUMANITY),children:[c.jsx("i",{className:g("icon","icon--tab-humanity")}),c.jsx("span",{children:n("ui.tab.humanityShort")})]}),c.jsxs("div",{className:g("tabs__elem",i===Me.TAKEN?"tabs__elem--selected":null),onClick:()=>this.changeTab(Me.TAKEN),children:[c.jsx("i",{className:g("icon","icon--tab-taken")}),c.jsx("span",{children:n("ui.tab.takenShort")})]})]})})})}}const GJ=e=>({user:e.common.user.user,selectedListCode:e.planner.list.selectedListCode,lists:e.planner.list.lists}),XJ=e=>({openSearchDispatch:()=>{e(SN())},closeSearchDispatch:()=>{e(xN())},setSelectedListCodeDispatch:t=>{e(yJ(t))},setListCoursesDispatch:(t,n)=>{e(gN(t,n))}});YN.propTypes={user:ht,selectedListCode:h.string.isRequired,lists:Vh,openSearchDispatch:h.func.isRequired,closeSearchDispatch:h.func.isRequired,setSelectedListCodeDispatch:h.func.isRequired,setListCoursesDispatch:h.func.isRequired};const KJ=de()(Pe(GJ,XJ)(YN));class zN extends X.Component{constructor(n){super(n);N(this,"hideSearch",()=>{const{closeSearchDispatch:n}=this.props;n()});N(this,"searchStart",()=>{const{t:r}=this.props,{selectedTypes:i,selectedDepartments:s,selectedLevels:o,selectedTerms:l,keyword:d}=this.state,{closeSearchDispatch:f,clearSearchListCoursesDispatch:m,setListCoursesDispatch:_,clearItemFocusDispatch:y,setLastSearchOptionDispatch:b}=this.props,w={keyword:d.trim(),type:Array.from(i),department:Array.from(s),grade:Array.from(o),term:Array.from(l)};TS(w,150,()=>{f(),m(),b(w),y()},x=>{x.length===150&&alert(r("ui.message.tooManySearchResults",{count:150})),_(Me.SEARCH,x)})});N(this,"updateCheckedValues",n=>r=>{this.setState({[n]:r})});N(this,"handleSubmit",n=>{n.preventDefault(),this.searchStart()});N(this,"handleInput",n=>{const{value:r}=n.target;this.setState({keyword:n.target.value,autocompleteText:""}),r.trim()&&this._fetchAutocomplete(r)});N(this,"_fetchAutocomplete",Ve.debounce(n=>{me.get("/api/courses/autocomplete",{params:{keyword:n},metadata:{gaCategory:"Course",gaVariable:"GET Autocomplete / List"}}).then(r=>{const{keyword:i}=this.state,s=r.data;n===i&&this.setState({autocompleteText:s.substring(n.length,s.length)})}).catch(r=>{})},500));N(this,"applyAutocomplete",()=>{this.setState(n=>({keyword:n.keyword+n.autocompleteText,autocompleteText:""}))});N(this,"clearAutocomplete",()=>{this.setState({keyword:"",autocompleteText:""})});N(this,"onKeyPress",n=>{n.keyCode===9&&(this.applyAutocomplete(),n.stopPropagation(),n.preventDefault(),n.nativeEvent.stopImmediatePropagation())});this.state={keyword:"",autocompleteText:"",selectedTypes:new Set(["ALL"]),selectedDepartments:new Set(["ALL"]),selectedLevels:new Set(["ALL"]),selectedTerms:new Set(["ALL"])}}render(){const{t:n}=this.props,{keyword:r,autocompleteText:i,selectedTypes:s,selectedDepartments:o,selectedLevels:l,selectedTerms:d}=this.state;return c.jsx("div",{className:g("search-area"),children:c.jsxs("form",{onSubmit:this.handleSubmit,children:[c.jsxs("div",{className:g("list-title","list-title--search-input"),children:[c.jsx("i",{className:g("icon","icon--search")}),c.jsxs("div",{children:[c.jsx("input",{type:"text",name:"keyword",autoComplete:"off",placeholder:n("ui.tab.search"),value:r,onKeyDown:f=>this.onKeyPress(f),onChange:f=>this.handleInput(f)}),c.jsxs("div",{className:g("search-keyword-autocomplete"),children:[c.jsx("span",{className:g("search-keyword-autocomplete-space"),children:r}),c.jsx("span",{className:g("search-keyword-autocomplete-body"),children:i})]})]})]}),c.jsxs(ct,{expandBottom:0,children:[c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedTypes"),inputName:"type",titleName:n("ui.search.type"),options:Xl(),checkedValues:s}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedDepartments"),inputName:"department",titleName:n("ui.search.department"),options:Kl(),checkedValues:o}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedLevels"),inputName:"grade",titleName:n("ui.search.level"),options:Ql(),checkedValues:l}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedTerms"),inputName:"term",titleName:n("ui.search.term"),options:zh(),checkedValues:d})]}),c.jsxs("div",{className:g("buttons"),children:[c.jsx("button",{type:"submit",className:g("text-button"),children:n("ui.button.search")}),c.jsx("button",{type:"button",className:g("text-button"),onClick:()=>this.hideSearch(),children:n("ui.button.cancel")})]}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0})]})})}}const QJ=e=>({}),ZJ=e=>({closeSearchDispatch:()=>{e(xN())},setListCoursesDispatch:(t,n)=>{e(gN(t,n))},clearSearchListCoursesDispatch:()=>{e(vJ())},clearItemFocusDispatch:()=>{e(Qh())},setLastSearchOptionDispatch:t=>{e(SJ(t))}});zN.propTypes={closeSearchDispatch:h.func.isRequired,setListCoursesDispatch:h.func.isRequired,clearSearchListCoursesDispatch:h.func.isRequired,clearItemFocusDispatch:h.func.isRequired,setLastSearchOptionDispatch:h.func.isRequired};const JJ=de()(Pe(QJ,ZJ)(zN)),VN=({t:e,course:t,isRaised:n,isDimmed:r,isAdded:i,onMouseOver:s,onMouseOut:o,onClick:l})=>{const d=s?_=>{s(t)}:null,f=o?_=>{o(t)}:null,m=l?_=>{l(t)}:null;return c.jsxs("div",{className:g("block","block--planner-course",l?"block--clickable":null,n?"block--raised":null,r?"block--dimmed":null,i?"block--completed":null),onClick:m,onMouseOver:d,onMouseOut:f,children:[c.jsx("div",{className:g("block__completed-text"),children:e("ui.others.added")}),c.jsx("div",{className:g("block--planner-course__title"),children:t[e("js.property.title")]}),c.jsx("div",{className:g("block--planner-course__subtitle"),children:t.old_code})]})};VN.propTypes={course:h.oneOfType([ir,fv]).isRequired,isRaised:h.bool,isDimmed:h.bool,isAdded:h.bool.isRequired,onMouseOver:h.func,onMouseOut:h.func,onClick:h.func};const JR=de()(xe.memo(VN));class GN extends X.Component{constructor(){super(...arguments);N(this,"showSearch",()=>{const{openSearchDispatch:n}=this.props;n()});N(this,"focusCourseWithHover",n=>{const{itemFocus:r,setItemFocusDispatch:i}=this.props;r.clicked||i(null,n,qe.LIST,!1)});N(this,"unfocusCourseWithHover",n=>{const{itemFocus:r,clearItemFocusDispatch:i}=this.props;r.clicked||i()});N(this,"focusCourseWithClick",n=>{const{itemFocus:r,selectedListCode:i,setItemFocusDispatch:s,clearItemFocusDispatch:o}=this.props;if(E_(n,r)){o();const l=new Map([[Me.SEARCH,"Search"],[Me.BASIC,"Basic"],[Me.HUMANITY,"Humanity"],[Me.TAKEN,"Taken"]]);Je.event({category:"Dictionary - Selection",action:"Unselected Course",label:`Course : ${n.id} / From : Course List : ${l.get(i)||i}`})}else{s(null,n,qe.LIST,!0);const l=new Map([[Me.SEARCH,"Search"],[Me.BASIC,"Basic"],[Me.HUMANITY,"Humanity"],[Me.TAKEN,"Taken"]]);Je.event({category:"Dictionary - Selection",action:"Selected Course",label:`Course : ${n.id} / From : Course List : ${l.get(i)||i}`})}});N(this,"_getArbitraryCourses",()=>{var s;const{user:n,selectedListCode:r}=this.props;if(r===Me.HUMANITY)return[{id:zf("인문사회선택","Humanities & Social Elective",null),isArbitrary:!0,department:null,type:"인문사회선택",type_en:"Humanities & Social Elective",credit:3,credit_au:0,title:Vf("인문사회선택"),title_en:Gf("인문사회선택","Humanities & Social Elective"),old_code:Xf("인문사회선택","Humanities & Social Elective",null)}];const i=(s=n==null?void 0:n.departments)==null?void 0:s.find(o=>r===o.code);return i?[{id:zf("전공선택","Major Required",i),isArbitrary:!0,department:i,type:"전공필수",type_en:"Major Required",credit:3,credit_au:0,title:Vf("전공필수"),title_en:Gf("전공필수","Major Required"),old_code:Xf("전공필수","Major Required",i)},{id:zf("전공선택","Major Elective",i),isArbitrary:!0,department:i,type:"전공선택",type_en:"Major Elective",credit:3,credit_au:0,title:Vf("전공선택"),title_en:Gf("전공선택","Major Elective"),old_code:Xf("전공선택","Major Elective",i)}]:[]});N(this,"_getCourses",n=>{const{lists:r}=this.props;return r[n]?r[n].courses:null})}render(){const{t:n}=this.props,{user:r,itemFocus:i,selectedListCode:s,selectedPlanner:o,searchOpen:l,lastSearchOption:d}=this.props,f=()=>{if(s===Me.SEARCH){const _=Object.entries(d).map(y=>y[0]==="keyword"&&y[1].length>0?y[1]:y[0]==="type"&&!y[1].includes("ALL")?y[1].map(b=>Si(Xl(),b)):y[0]==="department"&&!y[1].includes("ALL")?y[1].map(b=>Si(Kl(),b)):y[0]==="grade"&&!y[1].includes("ALL")?y[1].map(b=>Si(Ql(),b)):y[0]==="term"&&!y[1].includes("ALL")?y[1].map(b=>Si(zh(),b)):[]).flat(1).join(", ");return c.jsxs("div",{className:g("list-title","list-title--search"),onClick:()=>this.showSearch(),children:[c.jsx("i",{className:g("icon","icon--search")}),c.jsx("span",{children:n("ui.tab.search")}),c.jsx("span",{children:_.length>0?`:${_}`:""})]})}if(s===Me.BASIC)return c.jsx("div",{className:g("list-title"),children:n("ui.tab.basic")});if(r&&r.departments.some(_=>s===_.code)){const _=r.departments.find(y=>s===y.code);return c.jsx("div",{className:g("list-title"),children:`${_[n("js.property.name")]} ${n("ui.tab.major")}`})}return s===Me.HUMANITY?c.jsx("div",{className:g("list-title"),children:n("ui.tab.humanity")}):s===Me.TAKEN?c.jsx("div",{className:g("list-title"),children:n("ui.tab.taken")}):null},m=()=>{const _=this._getCourses(s);return _?_.length===0?c.jsx("div",{className:g("list-placeholder"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})}):c.jsx(ct,{children:c.jsxs("div",{className:g("block-list"),children:[this._getArbitraryCourses(s).map(y=>c.jsx(JR,{course:y,isRaised:E_(y,i),isDimmed:QR(y,i),isAdded:!1,onMouseOver:this.focusCourseWithHover,onMouseOut:this.unfocusCourseWithHover,onClick:this.focusCourseWithClick},y.id)),_.map(y=>c.jsx(JR,{course:y,isRaised:E_(y,i),isDimmed:QR(y,i),isAdded:MJ(y,o),onMouseOver:this.focusCourseWithHover,onMouseOut:this.unfocusCourseWithHover,onClick:this.focusCourseWithClick},y.id))]})},s):c.jsx("div",{className:g("list-placeholder"),children:c.jsx("div",{children:n("ui.placeholder.loading")})})};return c.jsx("div",{className:g("section","section--course-list","mobile-hidden"),children:c.jsxs("div",{className:g("subsection","subsection--flex","subsection--course-list"),children:[s===Me.SEARCH&&l&&c.jsx(JJ,{}),f(),m()]})})}}const eee=e=>({user:e.common.user.user,selectedListCode:e.planner.list.selectedListCode,lists:e.planner.list.lists,selectedPlanner:e.planner.planner.selectedPlanner,itemFocus:e.planner.itemFocus,searchOpen:e.planner.search.open,lastSearchOption:e.planner.search.lastSearchOption}),tee=e=>({openSearchDispatch:()=>{e(SN())},setItemFocusDispatch:(t,n,r,i)=>{e(Kh(t,n,r,i))},clearItemFocusDispatch:()=>{e(Qh())}});GN.propTypes={user:ht,selectedListCode:h.string.isRequired,lists:Vh,selectedPlanner:Oi,itemFocus:Lo.isRequired,searchOpen:h.bool.isRequired,lastSearchOption:OD.isRequired,openSearchDispatch:h.func.isRequired,setItemFocusDispatch:h.func.isRequired,clearItemFocusDispatch:h.func.isRequired};const nee=de()(Pe(eee,tee)(GN));let XN=class extends X.Component{constructor(n){super(n);N(this,"hasAnyChanges",()=>{const{selectedSemester:n,selectedRetake:r}=this.state;return!n.has("NORMAL")||!r.has("NORMAL")});N(this,"resetCustomizations",()=>{const{itemFocus:n}=this.props;n.item.item_type!=="TAKEN"&&this.updateCheckedValuesForSemester(new Set(["NORMAL"])),this.updateCheckedValuesForRetake(new Set(["NORMAL"]))});N(this,"updateCheckedValuesForSemester",n=>{const{user:r,selectedPlanner:i,itemFocus:s,updateItemInPlannerDispatch:o,setItemFocusDispatch:l}=this.props;this.setState({selectedSemester:n});const f=Array.from(n)[0]==="NORMAL"?Math.ceil(s.item.semester/2)*2-1:Math.ceil(s.item.semester/2)*2;if(r)me.post(`/api/users/${r.id}/planners/${i.id}/update-item`,{item:s.item.id,item_type:s.item.item_type,semester:f},{metadata:{gaCategory:"Planner",gaVariable:"POST Update / Instance"}}).then(m=>{const _=this.props;!_.selectedPlanner||_.selectedPlanner.id!==i.id||(o(m.data),l(m.data,Sn(m.data),s.from,s.clicked))}).catch(m=>{});else{const m={...s.item,semester:f};o(m),l(m,Sn(m),s.from,s.clicked)}});N(this,"updateCheckedValuesForRetake",n=>{const{user:r,selectedPlanner:i,itemFocus:s,updateItemInPlannerDispatch:o,setItemFocusDispatch:l}=this.props;this.setState({selectedRetake:n});const f=Array.from(n)[0]!=="NORMAL";if(r)me.post(`/api/users/${r.id}/planners/${i.id}/update-item`,{item:s.item.id,item_type:s.item.item_type,is_excluded:f},{metadata:{gaCategory:"Planner",gaVariable:"POST Update / Instance"}}).then(m=>{const _=this.props;!_.selectedPlanner||_.selectedPlanner.id!==i.id||(o(m.data),l(m.data,Sn(m.data),s.from,s.clicked))}).catch(m=>{});else{const m={...s.item,is_excluded:f};o(m),l(m,Sn(m),s.from,s.clicked)}});this.state={selectedSemester:new Set([$N(n.itemFocus.item)%2===1?"NORMAL":"SEASONAL"]),selectedRetake:new Set([n.itemFocus.item.is_excluded?"RETAKE":"NORMAL"])}}render(){const{t:n,itemFocus:r}=this.props,{selectedSemester:i,selectedRetake:s}=this.state,o=()=>{switch(r.from){case qe.TABLE_TAKEN:return`수강 완료 - ${r.item.lecture.year} ${ar(r.item.lecture.semester)}`;case qe.TABLE_FUTURE:return`수강 예정 - ${r.item.year} ${ar(r.item.semester)}`;case qe.TABLE_ARBITRARY:return`수강 예정 - ${r.item.year} ${ar(r.item.semester)}`;default:return"Unknown"}},l=()=>r.item.item_type!=="TAKEN"?[["NORMAL",n("ui.semesterInfo.normal")],["SEASONAL",n("ui.semesterInfo.seasonal")]]:r.item.lecture.semester%2===1?[["NORMAL",n("ui.semesterInfo.normal")]]:[["SEASONAL",n("ui.semesterInfo.seasonal")]];return c.jsxs("div",{className:g("subsection","subsection--course-manage-right"),children:[c.jsxs("div",{className:g("detail-title-area"),children:[c.jsx("div",{className:g("title"),children:n("ui.title.lectureInformation")}),c.jsx("div",{className:g("subtitle"),children:o()}),c.jsx("div",{className:g("buttons"),children:c.jsx("button",{type:"reset",className:g("text-button","text-button--right",!this.hasAnyChanges()&&"text-button--disabled"),onClick:this.resetCustomizations,children:n("ui.button.reset")})})]}),c.jsxs(ct,{children:[c.jsx(Dt,{updateCheckedValues:this.updateCheckedValuesForSemester,inputName:"semester",titleName:n("ui.search.semester"),options:l(),checkedValues:i,isRadio:!0}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValuesForRetake,inputName:"retake",titleName:n("ui.search.retake"),options:[["NORMAL",n("ui.retake.normal")],["RETAKE",n("ui.retake.retake")]],checkedValues:s,isRadio:!0})]})]})}};const ree=e=>({user:e.common.user.user,itemFocus:e.planner.itemFocus,selectedPlanner:e.planner.planner.selectedPlanner}),iee=e=>({updateItemInPlannerDispatch:t=>{e(IN(t))},setItemFocusDispatch:(t,n,r,i)=>{e(Kh(t,n,r,i))}});XN.propTypes={user:ht,itemFocus:Lo,selectedPlanner:Oi,updateItemInPlannerDispatch:h.func.isRequired,setItemFocusDispatch:h.func.isRequired};const see=de()(Pe(ree,iee)(XN));class KN extends X.Component{render(){const{t}=this.props,{itemFocus:n}=this.props;return n.course?c.jsxs("div",{className:g("subsection","subsection--course-info"),children:[c.jsx(Ci,{entries:[{name:t("ui.attribute.classification"),info:`${n.course.department[t("js.property.name")]}, ${n.course[t("js.property.type")]}`},{name:t("ui.attribute.description"),info:n.course.summary}],longInfo:!0}),c.jsx(ni,{entries:[{name:t("ui.score.lectureHours"),score:n.course.num_classes},{name:t("ui.score.labHours"),score:n.course.num_labs},{name:n.course.credit===0?t("ui.score.au"):t("ui.score.credit"),score:n.course.credit===0?n.course.credit_au:n.course.credit}],big:!0}),c.jsx(ni,{entries:[{name:t("ui.score.grade"),score:cn(n.course.grade)},{name:t("ui.score.load"),score:cn(n.course.load)},{name:t("ui.score.speech"),score:cn(n.course.speech)}],big:!0})]}):null}}const oee=e=>({itemFocus:e.planner.itemFocus}),aee=e=>({});KN.propTypes={itemFocus:Lo.isRequired};const lee=de()(Pe(oee,aee)(KN));class QN extends X.Component{render(){const{t}=this.props,{itemFocus:n}=this.props;if(!n.course)return null;const r=n.reviews==null?c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:t("ui.placeholder.loading")})}):n.reviews.length?c.jsx("div",{className:g("block-list","min-height-area"),children:n.reviews.map(i=>c.jsx(Ni,{review:i,shouldLimitLines:!1,pageFrom:"Dictionary"},i.id))}):c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:t("ui.placeholder.noResults")})});return c.jsxs("div",{className:g("subsection","subsection--course-reviews"),children:[c.jsx("div",{className:g("small-title"),children:t("ui.title.reviews")}),r]})}}const uee=e=>({itemFocus:e.planner.itemFocus}),cee=e=>({});QN.propTypes={itemFocus:Lo.isRequired};const dee=de()(Pe(uee,cee)(QN));class ZN extends X.Component{constructor(){super(...arguments);N(this,"_createRandomItemId",()=>Math.floor(Math.random()*1e8));N(this,"addCourseToPlanner",(n,r,i)=>{const{user:s,selectedPlanner:o,addItemToPlannerDispatch:l,setItemFocusDispatch:d,updateItemInPlannerDispatch:f}=this.props;if(o.future_items.filter(y=>!y.is_excluded&&!HR(Sn(y))&&Sn(y).id===n.id).length>0){alert("동일한 과목의 수강 예정이 이미 추가되어 있습니다.");return}const _=o.taken_items.filter(y=>!y.is_excluded&&!HR(Sn(y))&&Sn(y).id===n.id);if(!(_.length>0&&!window.confirm("동일한 과목의 수강 기록이 플래너에 이미 추가되어 있습니다. 정말 추가하시겠습니까? 이전에 수강한 과목은 제외 처리됩니다.")))if(s)me.post(`/api/users/${s.id}/planners/${o.id}/add-future-item`,{course:n.id,year:r,semester:i},{metadata:{gaCategory:"Timetable",gaVariable:"POST Update / Instance"}}).then(y=>{const b=this.props;!b.selectedPlanner||b.selectedPlanner.id!==o.id||(l(y.data),d(y.data,n,qe.TABLE_FUTURE,!0))}).catch(y=>{}),_.forEach(y=>{me.post(`/api/users/${s.id}/planners/${o.id}/update-item`,{item:y.id,item_type:y.item_type,is_excluded:!0}).then(b=>{const w=this.props;!w.selectedPlanner||w.selectedPlanner.id!==o.id||f(b.data)}).catch(b=>{})});else{const b={id:this._createRandomItemId(),item_type:"FUTURE",is_excluded:!1,course:n,year:r,semester:i};l(b),d(b,n,qe.TABLE_FUTURE,!0),_.forEach(w=>{const R={...w,is_excluded:!0};f(R)})}});N(this,"addArbitraryCourseToPlanner",(n,r,i)=>{const{user:s,selectedPlanner:o,addItemToPlannerDispatch:l,setItemFocusDispatch:d}=this.props;if(s)me.post(`/api/users/${s.id}/planners/${o.id}/add-arbitrary-item`,{year:r,semester:i,department:n.department?n.department.id:void 0,type:n.type,type_en:n.type_en,credit:n.credit,credit_au:n.credit_au},{metadata:{gaCategory:"Planner",gaVariable:"POST Update / Instance"}}).then(f=>{const m=this.props;!m.selectedPlanner||m.selectedPlanner.id!==o.id||(l(f.data),d(f.data,n,qe.TABLE_ARBITRARY,!0))}).catch(f=>{});else{const m={id:this._createRandomItemId(),item_type:"ARBITRARY",is_excluded:!1,year:r,semester:i,department:n.department,type:n.type,type_en:n.type_en,credit:n.credit,credit_au:n.credit_au};l(m),d(m,n,qe.TABLE_ARBITRARY,!0)}})}render(){const{t:n,selectedPlanner:r,itemFocus:i,semesters:s}=this.props;if(!r)return null;const o=Ve.range(r.start_year,r.end_year+1),l=GD(s),d=(_,y)=>_>l.year||_===l.year&&y>l.semester,f=c.jsx(c.Fragment,{children:c.jsxs("div",{className:g("detail-title-area"),children:[c.jsx("div",{className:g("title"),children:n("ui.title.lectureInformation")}),c.jsx("div",{className:g("subtitle"),children:"수강 예정 추가"}),c.jsx("div",{className:g("buttons"),children:" "})]})}),m=c.jsx(c.Fragment,{children:c.jsxs(ct,{children:[c.jsx(Ci,{entries:o.map(_=>[1,3].map(y=>({name:`${_} ${ar(y)}`,info:"추가하기",onInfoClick:i.course.isArbitrary?()=>this.addArbitraryCourseToPlanner(i.course,_,y):()=>this.addCourseToPlanner(i.course,_,y),isInfoClickDisabled:!d(_,y)}))).flat(),fixedWidthName:!0}),c.jsxs("div",{className:g("caption"),style:{marginTop:8},children:["Beta UI:",c.jsx("br",{}),"본 UI는 완성되지 않은 임시 UI로, 추후 다른 UI로 대체될 예정입니다."]})]})});return c.jsxs("div",{className:g("subsection","subsection--course-manage-right"),children:[f,m]})}}const fee=e=>({user:e.common.user.user,semesters:e.common.semester.semesters,selectedPlanner:e.planner.planner.selectedPlanner,itemFocus:e.planner.itemFocus}),pee=e=>({addItemToPlannerDispatch:t=>{e(OJ(t))},setItemFocusDispatch:(t,n,r,i)=>{e(Kh(t,n,r,i))},updateItemInPlannerDispatch:t=>{e(IN(t))}});ZN.propTypes={user:ht,semesters:h.arrayOf(Zi),selectedPlanner:Oi,itemFocus:Lo,addItemToPlannerDispatch:h.func.isRequired,setItemFocusDispatch:h.func.isRequired,updateItemInPlannerDispatch:h.func.isRequired};const hee=de()(Pe(fee,pee)(ZN));class JN extends X.Component{constructor(n){super(n);N(this,"_fetchLectures",()=>{const{itemFocus:n,setLecturesDispatch:r}=this.props;n.course.isArbitrary||me.get(`/api/courses/${n.course.id}/lectures`,{params:{order:["year","semester","class_no"]},metadata:{gaCategory:"Course",gaVariable:"GET Lectures / Instance"}}).then(i=>{this.props.itemFocus.course.id===n.course.id&&r(i.data)}).catch(i=>{})});N(this,"_fetchReviews",()=>{const{itemFocus:r,setReviewsDispatch:i}=this.props;r.course.isArbitrary||me.get(`/api/courses/${r.course.id}/reviews`,{params:{order:["-lecture__year","-lecture__semester","-written_datetime","-id"],limit:100},metadata:{gaCategory:"Course",gaVariable:"GET Reviews / Instance"}}).then(s=>{this.props.itemFocus.course.id===r.course.id&&(s.data.length,i(s.data))}).catch(s=>{})});N(this,"unfix",()=>{const{clearItemFocusDispatch:n}=this.props;n()});this.scoresRef=xe.createRef()}componentDidUpdate(n){var l,d;const{selectedListCode:r,selectedPlanner:i,itemFocus:s,clearItemFocusDispatch:o}=this.props;s.from===qe.LIST&&n.selectedListCode!==r&&o(),(s.from===qe.TABLE_TAKEN||s.from===qe.TABLE_FUTURE||s.from===qe.TABLE_ARBITRARY)&&n.selectedPlanner.id!==i.id&&o(),!n.itemFocus.clicked&&s.clicked&&(this._fetchLectures(),this._fetchReviews()),n.itemFocus.clicked&&s.clicked&&((l=n.itemFocus.course)==null?void 0:l.id)!==((d=s.course)==null?void 0:d.id)&&(this._fetchLectures(),this._fetchReviews())}render(){const{t:n,itemFocus:r}=this.props,i=r.course?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:g("subsection","subsection--course-manage-left"),children:c.jsxs("div",{className:g("subsection","subsection--flex"),children:[c.jsx(Fr,{onClick:this.unfix}),c.jsxs("div",{className:g("detail-title-area"),children:[c.jsx("div",{className:g("title"),children:r.course[n("js.property.title")]}),c.jsx("div",{className:g("subtitle"),children:r.course.old_code}),c.jsx("div",{className:g("buttons"),children:c.jsx(Et,{className:g("text-button","text-button--right",r.course.isArbitrary?"text-button--disabled":""),to:{pathname:"/dictionary",search:Ut.stringify({startCourseId:r.course.id})},target:"_blank",rel:"noopener noreferrer",children:n("ui.button.dictionary")})})]}),!r.course.isArbitrary&&c.jsxs(ct,{children:[c.jsx(lee,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx(dee,{})]},r.course.id)]})}),c.jsx(Ce,{orientation:{desktop:Ce.Orientation.VERTICAL,mobile:Ce.Orientation.HORIZONTAL},isVisible:!0,gridArea:"divider-main"}),r.from===qe.LIST?c.jsx(hee,{}):c.jsx(see,{},`${r.item.item_type}:${r.item.id}`)]}):c.jsx(Xh,{});return c.jsx("div",{className:g("section","section--course-manage","mobile-hidden"),children:i})}}const mee=e=>({itemFocus:e.planner.itemFocus,selectedListCode:e.planner.list.selectedListCode,selectedPlanner:e.planner.planner.selectedPlanner}),gee=e=>({clearItemFocusDispatch:()=>{e(Qh())},setLecturesDispatch:t=>{e(mJ(t))},setReviewsDispatch:t=>{e(hJ(t))}});JN.propTypes={itemFocus:Lo.isRequired,selectedListCode:h.string.isRequired,selectedPlanner:Oi,clearItemFocusDispatch:h.func.isRequired,setLecturesDispatch:h.func.isRequired,setReviewsDispatch:h.func.isRequired};const _ee=de()(Pe(mee,gee)(JN)),Fl=e=>e<=2e3||e>=2100?"":e.toString(),eA=(e,t=!1)=>{const n=ge.t("ui.track.general"),r=`${Fl(e.start_year)}~${Fl(e.end_year)}`;return`${n} (${r})`},tA=(e,t=!1)=>{const n=e.department[ge.t("js.property.name")],r=`${Fl(e.start_year)}~${Fl(e.end_year)}`;return`${n} (${r})`},Uu=(e,t=!1)=>{const n=e.type==="DOUBLE"?ge.t("ui.track.doubleMajor"):e.type==="MINOR"?ge.t("ui.track.minor"):e.type==="ADVANCED"?ge.t("ui.track.advancedMajor"):e.type==="INTERDISCIPLINARY"?ge.t("ui.track.interdisciplinaryMajor"):"기타",r=e.type!=="INTERDISCIPLINARY"?e.department[ge.t("js.property.name")]:"",i=`${Fl(e.start_year)}~${Fl(e.end_year)}`;return e.type==="INTERDISCIPLINARY"?`${n} (${i})`:t?`${r} (${i})`:`${n} - ${r} (${i})`};class nA extends X.Component{render(){const{t,selectedPlanner:n,setIsTrackSettingsSectionOpenDispatch:r}=this.props;return c.jsx(c.Fragment,{children:c.jsxs("div",{className:g("subsection","subsection--track","mobile-hidden"),children:[c.jsx(Ci,{entries:[{name:t("ui.attribute.general"),info:n?eA(n.general_track):"-"},{name:t("ui.attribute.major"),info:n?tA(n.major_track):"-"},{name:t("ui.attribute.additional"),info:n?n.additional_tracks.map(i=>Uu(i)).join(", "):"-"}],longInfo:!0}),c.jsx("div",{className:g("buttons"),children:c.jsx("button",{className:g("text-button",!n&&"text-button--disabled"),onClick:()=>r(!0),children:t("ui.button.change")})})]})})}}const yee=e=>({selectedPlanner:e.planner.planner.selectedPlanner}),vee=e=>({setIsTrackSettingsSectionOpenDispatch:t=>{e(MN(t))}});nA.propTypes={selectedPlanner:Oi,setIsTrackSettingsSectionOpenDispatch:h.func.isRequired};const bee=de()(Pe(yee,vee)(nA));class rA extends X.Component{render(){const{takenCredit:t,plannedCredit:n,totalCredit:r,focusedCredit:i,colorIndex:s,isCategoryFocused:o,focusFrom:l}=this.props,d=b=>r===0?100:b/r*100,f=i===0?0:l===qe.LIST?3:l===qe.TABLE_TAKEN?1:2,m=o?"span":xe.Fragment,_=c.jsxs(c.Fragment,{children:[c.jsx(m,{children:t}),f===1&&c.jsx("span",{children:`(${i})`})," → ",c.jsx(m,{children:t+n}),f===2&&c.jsx("span",{children:`(${i})`}),f===3&&c.jsx("span",{children:`+${i}`})," / ",r]}),y=[d(t-(f===1?i:0)),d(f===1?i:0),d(n-(f===2?i:0)),d(f===2||f===3?i:0)];return c.jsxs("div",{className:g("credit-bar"),children:[c.jsx("div",{className:g("credit-bar__text"),children:_}),c.jsxs("div",{className:g("credit-bar__body"),children:[c.jsx("div",{className:g("credit-bar__body__bar","credit-bar__body__bar--taken",`background-color--${o?19:s}`,"background-color--dark"),style:{width:`${y[0]}%`}}),c.jsx("div",{className:g("credit-bar__body__bar","credit-bar__body__bar--focused","background-color--19","background-color--dark"),style:{width:`${y[1]}%`}}),c.jsx("div",{className:g("credit-bar__body__bar","credit-bar__body__bar--planned",`background-color--${o?19:s}`,"background-color--dark","background-color--stripe"),style:{width:`${y[2]}%`}}),c.jsx("div",{className:g("credit-bar__body__bar","credit-bar__body__bar--focused","background-color--19","background-color--dark","background-color--stripe"),style:{width:`${y[3]}%`}})]})]})}}rA.propTypes={takenCredit:h.number.isRequired,plannedCredit:h.number.isRequired,totalCredit:h.number.isRequired,focusedCredit:h.number.isRequired,colorIndex:h.number.isRequired,isCategoryFocused:h.bool.isRequired,focusFrom:h.oneOf(Object.values(qe)).isRequired};const C_=de()(rA);class iA extends X.Component{render(){const{entries:t}=this.props;return c.jsx("div",{children:t.map(n=>c.jsxs("div",{className:g("course-status"),children:[c.jsx("div",{className:g("course-status--name"),children:n.name}),c.jsx("div",{children:n.info.map(r=>c.jsxs("div",{className:g("course-status--info"),onMouseOver:r.onMouseOver,onMouseOut:r.onMouseOut,children:[c.jsx("div",{className:g("course-status--info--name"),children:r.name}),c.jsx("div",{}),r.controller]},r.name))})]},n.name))})}}iA.propTypes={entries:h.arrayOf(h.shape({name:h.string.isRequired,info:h.arrayOf(h.exact({name:h.string.isRequired,controller:h.any.isRequired,onMouseOver:h.func,onMouseOut:h.func})).isRequired})).isRequired};const See=de()(iA);let sA=class extends X.Component{constructor(){super(...arguments);N(this,"setFocusOnCategory",n=>{const{itemFocus:r,selectedPlanner:i,setCategoryFocusDispatch:s}=this.props;r.from!==qe.NONE||!i||s(n)});N(this,"clearFocus",()=>{const{itemFocus:n,clearCategoryFocusDispatch:r}=this.props;n.from===qe.CATEGORY&&r()})}render(){var b;const{t:n,itemFocus:r,selectedPlanner:i}=this.props,s=i?zp(i):[],o=i?i.additional_tracks.find(w=>w.type==="ADVANCED"):void 0,l=()=>({taken:0,planned:0,focused:0,requirement:0}),d=l(),f=l(),m={[Ye.BASIC]:[[l(),l()]],[Ye.MAJOR]:s.map(w=>[l(),l()]),[Ye.RESEARCH]:[[l(),l()]],[Ye.GENERAL_AND_HUMANITY]:[[l(),l()]],[Ye.OTHERS]:[[l()]]},_={[Ye.BASIC]:[n("ui.type.basic")],[Ye.MAJOR]:s.map((w,R)=>R===0?`${n(o?"ui.type.advancedMajor":"ui.type.major")} - ${w.department[n("js.property.name")]}`:w.type==="DOUBLE"?`${n("ui.type.doubleMajor")} - ${w.department[n("js.property.name")]}`:w.type==="MINOR"?`${n("ui.type.minor")} - ${w.department[n("js.property.name")]}`:w.type==="INTERDISCIPLINARY"?`${n("ui.type.interdisciplinaryMajor")}`:"Unknown"),[Ye.RESEARCH]:[`${n("ui.type.research")}`],[Ye.GENERAL_AND_HUMANITY]:[n("ui.type.general")],[Ye.OTHERS]:[n("ui.type.etc")]},y={[Ye.BASIC]:[[n("ui.type.basicRequired"),n("ui.type.basicElective")]],[Ye.MAJOR]:s.map(w=>[n("ui.type.majorRequired"),n("ui.type.majorElective")]),[Ye.RESEARCH]:[[n("ui.type.thesisStudy"),n("ui.type.individualStudy")]],[Ye.GENERAL_AND_HUMANITY]:[[n("ui.type.generalRequired"),n("ui.type.humanities")]],[Ye.OTHERS]:[[n("ui.type.otherElective")]]};if(i!=null&&i.general_track){const w=i.additional_tracks.filter(R=>R.type==="DOUBLE").length!==0;d.requirement=i.general_track.total_credit,f.requirement=i.general_track.total_au,m[Ye.BASIC][0][0].requirement=i.general_track.basic_required,m[Ye.BASIC][0][1].requirement=w?i.major_track.basic_elective_doublemajor:i.general_track.basic_elective,m[Ye.RESEARCH][0][0].requirement=w?i.general_track.thesis_study_doublemajor:i.general_track.thesis_study,m[Ye.GENERAL_AND_HUMANITY][0][0].requirement=i.general_track.general_required_credit+i.general_track.general_required_au,m[Ye.GENERAL_AND_HUMANITY][0][1].requirement=w?i.general_track.humanities_doublemajor:i.general_track.humanities}if(s.forEach((w,R)=>{m[Ye.MAJOR][R][0].requirement=w.major_required,m[Ye.MAJOR][R][1].requirement=w.major_elective}),o&&(m[Ye.MAJOR][0][0].requirement+=o.major_required,m[Ye.MAJOR][0][1].requirement+=o.major_elective),i&&(i.taken_items.filter(w=>!w.is_excluded).forEach(w=>{const R=oa(i,w);d.taken+=ra(w),f.taken+=ia(w),m[R[0]][R[1]][R[2]].taken+=cl(w)}),i.future_items.filter(w=>!w.is_excluded).forEach(w=>{const R=oa(i,w);d.planned+=ra(w),f.planned+=ia(w),m[R[0]][R[1]][R[2]].planned+=cl(w)}),i.arbitrary_items.filter(w=>!w.is_excluded).forEach(w=>{const R=oa(i,w);d.planned+=ra(w),f.planned+=ia(w),m[R[0]][R[1]][R[2]].planned+=cl(w)})),r.from===qe.LIST){const w=r.course,R=qu(i,w.type_en,(b=w.department)==null?void 0:b.code);d.focused+=w.credit,f.focused+=w.credit_au,m[R[0]][R[1]][R[2]].focused+=w.credit+w.credit_au}else if((r.from===qe.TABLE_TAKEN||r.from===qe.TABLE_FUTURE||r.from===qe.TABLE_ARBITRARY)&&!r.item.is_excluded){const w=r.item,R=oa(i,w);d.focused+=ra(w),f.focused+=ia(w),m[R[0]][R[1]][R[2]].focused+=cl(w)}return s.forEach((w,R)=>{const S=m[Ye.MAJOR][R];if(S[0].taken>S[0].requirement){const x=S[0].taken-S[0].requirement;S[0].taken-=x,S[1].taken+=x}if(S[0].taken+S[0].planned>S[0].requirement){const x=S[0].taken+S[0].planned-S[0].requirement;S[0].planned-=x,S[1].planned+=x}S[0].requirement===0&&(S[1].focused+=S[0].focused,S[0].focused=0)}),c.jsx(c.Fragment,{children:c.jsx("div",{className:g("subsection","subsection--planner-summary","mobile-hidden"),children:c.jsx(ct,{expandTop:12,children:c.jsx(See,{entries:[{name:n("ui.type.total"),info:[{name:n("ui.type.totalCredit"),controller:c.jsx(C_,{takenCredit:d.taken,plannedCredit:d.planned,focusedCredit:d.focused,totalCredit:d.requirement,colorIndex:18,isCategoryFocused:r.from===qe.CATEGORY&&sa([Ye.TOTAL,0,0],r.category),focusFrom:r.from}),onMouseOver:()=>this.setFocusOnCategory([Ye.TOTAL,0,0]),onMouseOut:()=>this.clearFocus()},{name:n("ui.type.totalAu"),controller:c.jsx(C_,{takenCredit:f.taken,plannedCredit:f.planned,focusedCredit:f.focused,totalCredit:f.requirement,colorIndex:18,isCategoryFocused:r.from===qe.CATEGORY&&sa([Ye.TOTAL,0,1],r.category),focusFrom:r.from}),onMouseOver:()=>this.setFocusOnCategory([Ye.TOTAL,0,1]),onMouseOut:()=>this.clearFocus()}]},...Ve.range(0,5).map(w=>Ve.range(0,m[w].length).map(R=>({name:_[w][R],info:Ve.range(0,m[w][R].length).map(S=>({name:y[w][R][S],controller:c.jsx(C_,{takenCredit:m[w][R][S].taken,plannedCredit:m[w][R][S].planned,focusedCredit:m[w][R][S].focused,totalCredit:m[w][R][S].requirement,colorIndex:qN(i,[w,R,S]),isCategoryFocused:r.from===qe.CATEGORY&&sa([w,R,S],r.category),focusFrom:r.from}),onMouseOver:()=>this.setFocusOnCategory([w,R,S]),onMouseOut:()=>this.clearFocus()}))}))).flat()]})})})})}};const xee=e=>({selectedPlanner:e.planner.planner.selectedPlanner,itemFocus:e.planner.itemFocus}),wee=e=>({setCategoryFocusDispatch:(t,n)=>{e(fJ(t))},clearCategoryFocusDispatch:()=>{e(pJ())}});sA.propTypes={selectedPlanner:Oi,itemFocus:Lo.isRequired,setCategoryFocusDispatch:h.func.isRequired,clearCategoryFocusDispatch:h.func.isRequired};const Tee=de()(Pe(xee,wee)(sA));class oA extends X.Component{constructor(n){super(n);N(this,"_getSelectedStartYear",()=>{const{selectedStartYears:n}=this.state;return parseInt(Array.from(n)[0],10)});N(this,"_getSelectedDuration",()=>{const{selectedDurations:n}=this.state;return parseInt(Array.from(n)[0],10)});N(this,"_getSelectedGeneralTrack",()=>{const{selectedGeneralTracks:n}=this.state,{tracks:r}=this.props,i=parseInt(Array.from(n)[0],10);return r.general.find(s=>s.id===i)});N(this,"_getSelectedMajorTrack",()=>{const{selectedMajorTracks:n}=this.state,{tracks:r}=this.props,i=parseInt(Array.from(n)[0],10);return r.major.find(s=>s.id===i)});N(this,"_getSelectedAdditionalTracks",()=>{const{selectedMinorTracks:n,selectedDoubleTracks:r,selectedAdvancedTracks:i,selectedInterdisciplinaryTracks:s}=this.state,{tracks:o}=this.props;return[...n,...r,...i,...s].map(d=>parseInt(d,10)).map(d=>o.additional.find(f=>f.id===d))});N(this,"updateCheckedValues",n=>r=>{this.setState({[n]:r})});N(this,"submit",()=>{const{user:n,selectedPlanner:r,updatePlannerDispatch:i}=this.props,s=this._getSelectedStartYear(),o=this._getSelectedDuration(),l=s+o-1,d=this._getSelectedGeneralTrack(),f=this._getSelectedMajorTrack(),m=this._getSelectedAdditionalTracks();if(m.some(b=>(b.type==="DOUBLE"||b.type==="MINOR")&&b.department.code===f.department.code)){alert("전공과 동일한 학과의 부전공 또는 복수전공은 추가할 수 없습니다.");return}if(m.some(b=>(b.type==="DOUBLE"||b.type==="MINOR")&&m.filter(w=>(w.type==="DOUBLE"||w.type==="MINOR")&&w.department.code===b.department.code).length>1)){alert("동일한 학과의 부전공 또는 복수전공을 여러 개 추가할 수 없습니다.");return}if(m.some(b=>b.type==="ADVANCED"&&b.department.code!==f.department.code)){alert("전공과 다른 학과의 심화전공은 추가할 수 없습니다.");return}if(m.filter(b=>b.type==="ADVANCED").length>1){alert("심화전공은 여러 개 추가할 수 없습니다.");return}if(m.filter(b=>b.type==="INTERDISCIPLINARY").length>1){alert("자유융합전공은 여러 개 추가할 수 없습니다.");return}const _=Ve.sum([r.taken_items.filter(b=>!this._checkYearInRange(s,l,b.lecture.year)).length,r.future_items.filter(b=>!this._checkYearInRange(s,l,b.year)).length,r.arbitrary_items.filter(b=>!this._checkYearInRange(s,l,b.year)).length]);if(_>0&&!window.confirm(`플래너 기간을 ${s}~${l}년으로 변경하면 ${_}개의 과목이 삭제됩니다. 정말 변경하시겠습니까?`))return;const y=(this._checkYearInTrackRange(d,s)?0:1)+(this._checkYearInTrackRange(f,s)?0:1)+m.filter(b=>!this._checkYearInTrackRange(b,s)).length;if(!(y>0&&!window.confirm(`선택한 졸업요건 중 ${y}개의 졸업요건은 입학년도가 ${s}년일 경우 적용이 불가능할 수 있습니다. 정말 변경하시겠습니까? 해당 요건의 적용 가능 여부는 학사요람을 참고 바랍니다.`))){if(!n){i({...r,start_year:s,end_year:l,general_track:d,major_track:f,additional_tracks:m,taken_items:r.taken_items.filter(b=>b.lecture.year>=s&&b.lecture.year<=l),future_items:r.future_items.filter(b=>b.year>=s&&b.year<=l),arbitrary_items:r.arbitrary_items.filter(b=>b.year>=s&&b.year<=l)}),this.close();return}me.patch(`/api/users/${n.id}/planners/${r.id}`,{start_year:s,end_year:l,general_track:d.id,major_track:f.id,additional_tracks:m.map(b=>b.id),should_update_taken_semesters:!0},{metadata:{gaCategory:"Review",gaVariable:"POST / List"}}).then(b=>{i(b.data),this.close()}).catch(b=>{})}});N(this,"close",()=>{const{setIsTrackSettingsSectionOpenDispatch:n}=this.props;n(!1)});N(this,"_checkYearInRange",(n,r,i)=>n<=i&&i<=r);N(this,"_checkYearInTrackRange",(n,r)=>this._checkYearInRange(n.start_year,n.end_year,r));const{selectedPlanner:r}=n,i=r.end_year-r.start_year+1;this.state={selectedStartYears:new Set([r.start_year.toString()]),selectedDurations:new Set([i.toString()]),selectedGeneralTracks:new Set([r.general_track.id.toString()]),selectedMajorTracks:new Set([r.major_track.id.toString()]),selectedMinorTracks:new Set(r.additional_tracks.filter(s=>s.type==="MINOR").map(s=>s.id.toString())),selectedDoubleTracks:new Set(r.additional_tracks.filter(s=>s.type==="DOUBLE").map(s=>s.id.toString())),selectedAdvancedTracks:new Set(r.additional_tracks.filter(s=>s.type==="ADVANCED").map(s=>s.id.toString())),selectedInterdisciplinaryTracks:new Set(r.additional_tracks.filter(s=>s.type==="INTERDISCIPLINARY").map(s=>s.id.toString()))}}render(){const{selectedStartYears:n,selectedDurations:r,selectedGeneralTracks:i,selectedMajorTracks:s,selectedMinorTracks:o,selectedDoubleTracks:l,selectedAdvancedTracks:d,selectedInterdisciplinaryTracks:f}=this.state,{t:m,tracks:_}=this.props,y=this._getSelectedStartYear(),b=this._getSelectedMajorTrack();return c.jsxs("div",{className:g("section","section--modal","section--track-settings"),children:[c.jsx(Fr,{onClick:this.close}),c.jsx("div",{className:g("title"),children:m("ui.title.plannerSettings")}),c.jsxs(ct,{children:[c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedStartYears"),inputName:"startYear",titleName:m("ui.attribute.entranceYear"),options:Ve.range(2015,new Date().getFullYear()+1).map(w=>[w.toString(),w.toString()]),checkedValues:n,isRadio:!0}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedDurations"),inputName:"duration",titleName:m("ui.attribute.enrollmentPeriod"),options:Ve.range(4,9).map(w=>[w.toString(),m("ui.others.yearCount",{count:w})]),checkedValues:r,isRadio:!0}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedGeneralTracks"),inputName:"general",titleName:m("ui.attribute.general"),options:_.general.filter(w=>w.end_year>=2020).sort((w,R)=>w.start_year-R.start_year).map(w=>[w.id.toString(),eA(w,!0),!this._checkYearInTrackRange(w,y)]),checkedValues:i,isRadio:!0}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedMajorTracks"),inputName:"major",titleName:m("ui.attribute.major"),options:_.major.filter(w=>w.end_year>=2020).sort((w,R)=>w.department[m("js.property.name")]R.department[m("js.property.name")]?1e3:w.start_year-R.start_year).map(w=>[w.id.toString(),tA(w,!0),!this._checkYearInTrackRange(w,y)]),checkedValues:new Set(s),isRadio:!0}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedMinorTracks"),inputName:"minor",titleName:`${m("ui.attribute.additional")} - ${m("ui.type.minor")}`,options:_.additional.filter(w=>w.end_year>=2020&&w.type==="MINOR").sort((w,R)=>w.department[m("js.property.name")]R.department[m("js.property.name")]?1e3:w.start_year-R.start_year).map(w=>[w.id.toString(),Uu(w,!0),!this._checkYearInTrackRange(w,y)||w.department.code===b.department.code]),checkedValues:new Set(o)}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedDoubleTracks"),inputName:"double",titleName:`${m("ui.attribute.additional")} - ${m("ui.type.doubleMajor")}`,options:_.additional.filter(w=>w.end_year>=2020&&w.type==="DOUBLE").sort((w,R)=>w.department[m("js.property.name")]R.department[m("js.property.name")]?1e3:w.start_year-R.start_year).map(w=>[w.id.toString(),Uu(w,!0),!this._checkYearInTrackRange(w,y)||w.department.code===b.department.code]),checkedValues:new Set(l)}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedAdvancedTracks"),inputName:"advanced",titleName:`${m("ui.attribute.additional")} - ${m("ui.type.advancedMajor")}`,options:_.additional.filter(w=>w.end_year>=2020&&w.type==="ADVANCED").sort((w,R)=>w.department[m("js.property.name")]R.department[m("js.property.name")]?1e3:w.start_year-R.start_year).map(w=>[w.id.toString(),Uu(w,!0),!this._checkYearInTrackRange(w,y)||w.department.code!==b.department.code]),checkedValues:new Set(d)}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedInterdisciplinaryTracks"),inputName:"interdisciplinary",titleName:`${m("ui.attribute.additional")} - ${m("ui.type.interdisciplinaryMajor")}`,options:_.additional.filter(w=>w.end_year>=2020&&w.type==="INTERDISCIPLINARY").sort((w,R)=>w.start_year-R.start_year).map(w=>[w.id.toString(),Uu(w,!0),!this._checkYearInTrackRange(w,y)]),checkedValues:new Set(f)}),c.jsxs("div",{className:g("caption"),children:["Beta UI:",c.jsx("br",{}),"본 UI는 완성되지 않은 임시 UI로, 추후 다른 UI로 대체될 예정입니다.",c.jsx("br",{}),"일부 요건은 함께 선택할 수 없습니다."]})]}),c.jsxs("div",{className:g("buttons"),children:[c.jsx("button",{className:g("text-button"),onClick:this.submit,children:m("ui.button.confirm")}),c.jsx("button",{className:g("text-button"),onClick:this.close,children:m("ui.button.cancel")})]})]})}}const Ree=e=>({user:e.common.user.user,tracks:e.common.track.tracks,selectedPlanner:e.planner.planner.selectedPlanner}),kee=e=>({setIsTrackSettingsSectionOpenDispatch:t=>{e(MN(t))},updatePlannerDispatch:t=>{e(CJ(t))}});oA.propTypes={user:ht,tracks:h.exact({general:h.arrayOf(jS),major:h.arrayOf(IS),additional:h.arrayOf(MS)}),selectedPlanner:Oi.isRequired,setIsTrackSettingsSectionOpenDispatch:h.func.isRequired,updatePlannerDispatch:h.func.isRequired};const Eee=de()(Pe(Ree,kee)(oA));class aA extends X.Component{constructor(n){super(n);N(this,"close",()=>{this.setState({isOpen:!1})});this.state={isOpen:!0}}render(){const{isOpen:n}=this.state,{title:r,content:i,link:s}=this.props;return n?c.jsxs("div",{className:g("section","section--popup"),children:[c.jsx(Fr,{onClick:this.close}),c.jsxs("div",{className:g("subsection","subsection--flex","subsection--beta-popup"),children:[c.jsx("div",{className:g("title"),children:r}),c.jsx("div",{className:g("subsection--beta-popup__content"),children:i.map(o=>c.jsx("div",{children:o}))}),c.jsx("div",{className:g("buttons"),children:c.jsx("a",{href:s,className:g("text-button"),target:"_blank",rel:"noopener noreferrer",children:"피드백 제출하기"})})]})]}):null}}aA.propTypes={title:h.string.isRequired,content:h.arrayOf(h.string).isRequired,link:h.string.isRequired};const Cee=de()(aA);class lA extends X.Component{componentWillUnmount(){const{resetCourseFocusDispatch:t,resetListDispatch:n,resetSearchDispatch:r,resetPlannerDispatch:i}=this.props;t(),n(),r(),i()}render(){const{isTrackSettingsSectionOpen:t,selectedPlanner:n}=this.props;return c.jsx(c.Fragment,{children:c.jsxs("section",{className:g("content","content--no-scroll"),children:[c.jsxs("div",{className:g("page-grid","page-grid--planner"),children:[c.jsx(jJ,{}),c.jsx(KJ,{}),c.jsxs("div",{className:g("section","section--planner-and-infos"),children:[c.jsx(zJ,{}),c.jsx(Ce,{orientation:{desktop:Ce.Orientation.VERTICAL,mobile:Ce.Orientation.HORIZONTAL},isVisible:{desktop:!0,mobile:!1},gridArea:"divider-main"}),c.jsx(bee,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:{desktop:!0,mobile:!1},gridArea:"divider-sub-1"}),c.jsx(Tee,{})]}),c.jsx(nee,{}),c.jsx(_ee,{}),t&&n&&c.jsx(Eee,{})]}),c.jsx(Cee,{title:"졸업플래너 베타 서비스 안내",content:["졸업플레너 서비스는 현재 베타 상태입니다.","일부 학점 계산이 정확하지 않거나 기능 사용이 불편할 수 있으며, 이는 정식 출시 때 개선될 예정입니다."],link:"https://sparcs.page.link/otl-feedback"})]})})}}const Oee=e=>({isTrackSettingsSectionOpen:e.planner.planner.isTrackSettingsSectionOpen,selectedPlanner:e.planner.planner.selectedPlanner}),Pee=e=>({resetCourseFocusDispatch:()=>{e(dJ())},resetListDispatch:()=>{e(_J())},resetSearchDispatch:()=>{e(bJ())},resetPlannerDispatch:()=>{e(xJ())}});lA.propTypes={isTrackSettingsSectionOpen:h.bool.isRequired,selectedPlanner:Oi,resetCourseFocusDispatch:h.func.isRequired,resetListDispatch:h.func.isRequired,resetSearchDispatch:h.func.isRequired,resetPlannerDispatch:h.func.isRequired};const Lee=Pe(Oee,Pee)(lA),Do="T_L_",uA=Do+"RESET",cA=Do+"SER_SELECTED_LIST_CODE",dA=Do+"SET_LIST_LECTURES",fA=Do+"CLEAR_ALL_LISTS_LECTURES",pA=Do+"CLEAR_SEARCH_LIST_LECTURES",hA=Do+"ADD_LECTURE_TO_CART",mA=Do+"DELETE_LECTURE_FROM_CART",gA=Do+"SET_MOBILE_IS_LECTURE_LIST_OPEN";function Dee(){return{type:uA}}function _A(e){return{type:cA,listCode:e}}function yA(e,t){return{type:dA,code:e,lectures:t}}function Nee(){return{type:fA}}function Aee(){return{type:pA}}function vA(e){return{type:hA,lecture:e}}function bA(e){return{type:mA,lecture:e}}function FS(e){return{type:gA,isLectureListOpenOnMobile:e}}const tu="T_S_",SA=tu+"RESET",xA=tu+"OPEN_SEARCH",wA=tu+"CLOSE_SEARCH",TA=tu+"SET_CLASSTIME_OPTIONS",RA=tu+"CLEAR_CLASSTIME_OPTIONS",kA=tu+"SET_LAST_SEARCH_OPTION";function jee(){return{type:SA}}function $S(){return{type:xA}}function EA(){return{type:wA}}function CA(e){return{type:kA,lastSearchOption:e}}function Iee(e,t,n){return{type:TA,classtimeDay:e,classtimeBegin:t,classtimeEnd:n}}function OA(){return{type:RA}}const PA="T_SM_",LA=PA+"RESET",DA=PA+"SET_SEMESTER";function Mee(){return{type:LA}}function Fee(e,t){return{type:DA,year:e,semester:t}}const dr="T_T_",NA=dr+"RESET",AA=dr+"SET_TIMETABLES",jA=dr+"CLEAR_TIMETABLES",IA=dr+"SET_MY_TIMETABLE_LECTURES",MA=dr+"SET_SELECTED_TIMETABLE",FA=dr+"CREATE_TIMETABLE",$A=dr+"DELETE_TIMETABLE",qA=dr+"DUPLICATE_TIMETABLE",UA=dr+"ADD_LECTURE_TO_TIMETABLE",BA=dr+"REMOVE_LECTURE_FROM_TIMETABLE",HA=dr+"REORDER_TIMETABLE",WA=dr+"UPDATE_CELL_SIZE",YA=dr+"SET_IS_DRAGGING",zA=dr+"SET_MOBILE_IS_TIMETABLE_TABS_OPEN";function $ee(){return{type:NA}}function VA(e){return{type:UA,lecture:e}}function GA(e){return{type:BA,lecture:e}}function qee(e){return{type:AA,timetables:e}}function Uee(){return{type:jA}}function Bee(e){return{type:IA,lectures:e}}function XA(e){return{type:MA,timetable:e}}function Hee(e){return{type:FA,id:e}}function Wee(e){return{type:$A,timetable:e}}function Yee(e,t){return{type:qA,id:e,timetable:t}}function zee(e,t){return{type:HA,timetable:e,arrangeOrder:t}}function Vee(e,t){return{type:WA,width:e,height:t}}function Gee(e){return{type:YA,isDragging:e}}function qS(e){return{type:zA,isTimetableTabsOpenOnMobile:e}}const KA=({t:e,review:t,linkTo:n})=>{const r=n?Et:"div";return c.jsxs(r,{to:n,className:g("block","block--review-simple"),target:"_blank",rel:"noopener noreferrer",children:[c.jsxs("div",{children:[c.jsx("span",{children:`${t.lecture.year} ${ar(t.lecture.semester)}`}),IZ(t.lecture)?c.jsx("span",{children:t.lecture[e("js.property.class_title")]}):null]}),c.jsx("div",{children:t.content}),c.jsxs("div",{children:[c.jsxs("span",{children:[e("ui.score.likes")," ",c.jsx("strong",{children:t.like})]}),c.jsxs("span",{children:[e("ui.score.grade")," ",c.jsx("strong",{children:ma(t.grade)})]}),c.jsxs("span",{children:[e("ui.score.load")," ",c.jsx("strong",{children:ma(t.load)})]}),c.jsxs("span",{children:[e("ui.score.speech")," ",c.jsx("strong",{children:ma(t.speech)})]})]})]})};KA.propTypes={review:pn.isRequired,linkTo:RS};const Xee=de()(xe.memo(KA)),ue={SEARCH:"search",BASIC:"basic",HUMANITY:"humanity",CART:"cart"},ek={selectedListCode:ue.SEARCH,lists:{[ue.SEARCH]:{lectureGroups:[]},[ue.BASIC]:{lectureGroups:null},[ue.HUMANITY]:{lectureGroups:null},[ue.CART]:{lectureGroups:null}},isLectureListOpenOnMobile:!1},Kee=(e=ek,t)=>{const n=i=>{if(i.length===0)return[];const s=i.sort((d,f)=>d.old_code!==f.old_code?d.old_code>f.old_code?10:-10:d.class_no>f.class_no?1:-1);return OS(s.map(d=>d.course)).map(d=>s.filter(f=>f.course===d)).filter(d=>d.length>0)},r=i=>i.flat(1);switch(t.type){case uA:return ek;case cA:return Object.assign({},e,{selectedListCode:t.listCode});case dA:{const i={...e};return i.lists={...i.lists},i.lists[t.code]={...i.lists[t.code]},i.lists[t.code].lectureGroups=n(t.lectures),Object.assign({},e,i)}case fA:{const i={...e};return i.lists={...i.lists},Object.keys(i.lists).forEach(s=>{i.lists[s]={...i.lists[s]},s===ue.SEARCH?i.lists[s].lectureGroups=[]:i.lists[s].lectureGroups=null}),Object.assign({},e,i)}case pA:{const i={...e};return i.lists={...i.lists},i.lists[ue.SEARCH]={...i.lists[ue.SEARCH]},i.lists[ue.SEARCH].lectureGroups=null,Object.assign({},e,i)}case hA:{const{lectureGroups:i}=e.lists[ue.CART],o=[...r(i),t.lecture],l=n(o),d={...e};return d.lists={...d.lists},d.lists[ue.CART]={...d.lists[ue.CART]},d.lists[ue.CART].lectureGroups=l,Object.assign({},e,d)}case mA:{const{lectureGroups:i}=e.lists[ue.CART],o=r(i).filter(f=>f.id!==t.lecture.id),l=n(o),d={...e};return d.lists={...d.lists},d.lists[ue.CART]={...d.lists[ue.CART]},d.lists[ue.CART].lectureGroups=l,Object.assign({},e,d)}case gA:return Object.assign({},e,{isLectureListOpenOnMobile:t.isLectureListOpenOnMobile});default:return e}},O_=(e,t,n)=>{if(!(e[t]instanceof Array&&e[t].length===0))return new Error(`Invalid prop \`${t}\` supplied to \`${n}\`. Validation failed.`)},Ca=h.oneOfType([h.exact({from:h.oneOf([Ue.NONE]).isRequired,clicked:h.oneOf([!1]).isRequired,lecture:h.oneOf([null]),reviews:h.oneOf([null]),multipleTitle:h.oneOf([""]).isRequired,multipleDetails:O_}),h.exact({from:h.oneOf([Ue.LIST]).isRequired,clicked:h.bool.isRequired,lecture:Yt,reviews:h.arrayOf(pn),multipleTitle:h.oneOf([""]).isRequired,multipleDetails:O_}),h.exact({from:h.oneOf([Ue.TABLE]).isRequired,clicked:h.bool.isRequired,lecture:Yt,reviews:h.arrayOf(pn),multipleTitle:h.oneOf([""]).isRequired,multipleDetails:O_}),h.exact({from:h.oneOf([Ue.MULTIPLE]).isRequired,clicked:h.oneOf([!1]).isRequired,lecture:h.oneOf([null]),reviews:h.oneOf([null]),multipleTitle:h.string.isRequired,multipleDetails:h.arrayOf(h.exact({lecture:Yt,name:h.string.isRequired,info:h.string.isRequired}))})]),Ji=h.exact({id:h.number.isRequired,lectures:h.arrayOf(Yt).isRequired,isReadOnly:h.oneOf([!0]).isRequired}),Fs=h.exact({id:h.number.isRequired,lectures:h.arrayOf(Yt).isRequired,arrange_order:h.number.isRequired}),yf=h.arrayOf(Yt),US=h.shape({search:h.exact({lectureGroups:h.arrayOf(yf)}).isRequired,basic:h.exact({lectureGroups:h.arrayOf(yf)}).isRequired,humanity:h.exact({lectureGroups:h.arrayOf(yf)}).isRequired,cart:h.exact({lectureGroups:h.arrayOf(yf)}).isRequired});class QA extends X.Component{constructor(n){super(n);N(this,"_resetIsReviewLoading",()=>{this.setState({isReviewLoading:!1})});N(this,"openDictPreview",()=>{const n=this.openDictRef.current.getBoundingClientRect().top-this.scrollRef.current.querySelector(".ScrollbarsCustom-Content").getBoundingClientRect().top+1;this.scrollRef.current.querySelector(".ScrollbarsCustom-Scroller").scrollTop=n});N(this,"closeDictPreview",()=>{this.scrollRef.current.querySelector(".ScrollbarsCustom-Scroller").scrollTop=0});N(this,"unfix",()=>{const{clearLectureFocusDispatch:n}=this.props;n()});N(this,"addToTable",n=>{const{user:r,lectureFocus:i,selectedListCode:s,selectedTimetable:o,addLectureToTimetableDispatch:l}=this.props;n.stopPropagation();const d=new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]),f=i.from===Ue.TABLE?"Timetable":i.from===Ue.LIST?`Lecture List : ${d.get(s)||s}`:"Unknown",m=()=>{},_=()=>{const y=this.props;!y.selectedTimetable||y.selectedTimetable.id!==o.id||l(i.lecture)};SD(i.lecture,o,r,f,m,_)});N(this,"deleteFromTable",n=>{const{user:r,lectureFocus:i,selectedListCode:s,selectedTimetable:o,removeLectureFromTimetableDispatch:l}=this.props;n.stopPropagation();const d=new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]),f=i.from===Ue.TABLE?"Timetable":i.from===Ue.LIST?`Lecture List : ${d.get(s)||s}`:"Unknown",m=()=>{},_=()=>{const y=this.props;!y.selectedTimetable||y.selectedTimetable.id!==o.id||l(i.lecture)};xD(i.lecture,o,r,f,m,_)});N(this,"addToCart",n=>{const{user:r,lectureFocus:i,selectedListCode:s,year:o,semester:l,addLectureToCartDispatch:d}=this.props;n.stopPropagation();const f=new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]),m=i.from===Ue.TABLE?"Timetable":i.from===Ue.LIST?`Lecture List : ${f.get(s)||s}`:"Unknown",_=()=>{},y=()=>{const b=this.props;b.year!==o||b.semester!==l||d(i.lecture)};wD(i.lecture,r,m,_,y)});N(this,"deleteFromCart",n=>{const{user:r,lectureFocus:i,selectedListCode:s,year:o,semester:l,deleteLectureFromCartDispatch:d}=this.props;n.stopPropagation();const f=new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]),m=i.from===Ue.TABLE?"Timetable":i.from===Ue.LIST?`Lecture List : ${f.get(s)||s}`:"Unknown",_=()=>{},y=()=>{const b=this.props;b.year!==o||b.semester!==l||d(i.lecture)};TD(i.lecture,r,m,_,y)});N(this,"onScroll",()=>{this._updateDictButton(),this._checkAndLoadReviews()});N(this,"_updateDictButton",()=>{const n=this.openDictRef.current,r=n.closest(".ScrollbarsCustom-Scroller");n.getBoundingClientRect().top-r.getBoundingClientRect().top<1?this.setState({shouldShowCloseDict:!0}):this.setState({shouldShowCloseDict:!1})});N(this,"_checkAndLoadReviews",()=>{const{isReviewLoading:r}=this.state,{lectureFocus:i,setReviewsDispatch:s}=this.props;if(r||i.reviews!==null)return;const o=this.openDictRef.current;o.closest(".ScrollbarsCustom-Scroller").getBoundingClientRect().bottom-o.getBoundingClientRect().bottom<12+1||(this.setState({isReviewLoading:!0}),me.get(`/api/lectures/${i.lecture.id}/related-reviews`,{params:{order:["-written_datetime","-id"],limit:100},metadata:{gaCategory:"Lecture",gaVariable:"GET Related Reviews / Instance"}}).then(f=>{this.props.lectureFocus.lecture.id===i.lecture.id&&(f.data,this.setState({isReviewLoading:!1}),s(f.data))}).catch(f=>{}))});this.state={shouldShowCloseDict:!1,isReviewLoading:!1},this.openDictRef=xe.createRef(),this.scrollRef=xe.createRef()}componentDidUpdate(n,r,i){const{isPortrait:s,lectureFocus:o,selectedListCode:l,selectedTimetable:d,year:f,semester:m,clearLectureFocusDispatch:_}=this.props;!n.lectureFocus.lecture&&o.lecture&&this._checkAndLoadReviews(),n.lectureFocus.lecture&&o.lecture&&n.lectureFocus.lecture.id!==o.lecture.id&&(this._resetIsReviewLoading(),this._checkAndLoadReviews()),n.lectureFocus.lecture&&o.lecture&&n.lectureFocus.clicked!==o.clicked&&this._checkAndLoadReviews(),n.lectureFocus.lecture&&!o.lecture&&this._resetIsReviewLoading(),n.lectureFocus.clicked&&o.clicked?n.lectureFocus.lecture.id!==o.lecture.id&&(s||this.openDictPreview()):n.lectureFocus.clicked&&!o.clicked?o.lecture&&this.closeDictPreview():!n.lectureFocus.clicked&&o.clicked&&(s||this.openDictPreview()),(o.from===Ue.LIST&&n.selectedListCode!==l||o.from===Ue.TABLE&&n.selectedTimetable.id!==d.id||n.year!==f||n.semester!==m)&&_()}render(){const{t:n}=this.props,{shouldShowCloseDict:r}=this.state,{isPortrait:i,lectureFocus:s,selectedTimetable:o,lists:l}=this.props,d=s.from===Ue.LIST||s.from===Ue.TABLE,f=d&&s.clicked,m=(y,b)=>c.jsx(Xee,{review:y,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:y.course.id})}},`review_${b}`),_=()=>{if(d){const y=s.reviews==null?c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.loading")})}):s.reviews.length?c.jsx("div",{className:g("block-list","min-height-area"),children:s.reviews.map(m)}):c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})});return c.jsxs(c.Fragment,{children:[c.jsx(Fr,{onClick:this.unfix}),c.jsxs("div",{className:g("detail-title-area"),children:[c.jsx("div",{className:g("title"),children:s.lecture[n("js.property.title")]}),c.jsxs("div",{className:g("subtitle"),children:[s.lecture.old_code,s.lecture.class_no.length?` (${s.lecture.class_no})`:""]}),c.jsxs("div",{className:g("buttons"),children:[c.jsx("button",{onClick:this.unfix,className:g("text-button",f?null:"text-button--disabled"),children:n("ui.button.unfix")}),c.jsx("a",{className:g("text-button","text-button--right"),href:WD(s.lecture),target:"_blank",rel:"noopener noreferrer",children:n("ui.button.syllabus")}),c.jsx(Et,{className:g("text-button","text-button--right"),to:{pathname:"/dictionary",search:Ut.stringify({startCourseId:s.lecture.course})},target:"_blank",rel:"noopener noreferrer",children:n("ui.button.dictionary")})]})]}),c.jsxs(ct,{onScroll:this.onScroll,children:[c.jsx(Ci,{entries:[{name:n("ui.attribute.type"),info:s.lecture[n("js.property.type")]},{name:n("ui.attribute.department"),info:s.lecture[n("js.property.department_name")]},{name:n("ui.attribute.professors"),info:BZ(s.lecture)},{name:n("ui.attribute.classroom"),info:HD(s.lecture)},{name:n("ui.attribute.limit"),info:s.lecture.limit},{name:n("ui.attribute.exam"),info:WZ(s.lecture)}],fixedWidthName:!0}),c.jsx(ni,{entries:[{name:n("ui.score.language"),score:s.lecture.is_english?"Eng":"한"},{name:s.lecture.credit>0?n("ui.score.credit"):"AU",score:s.lecture.credit>0?s.lecture.credit:s.lecture.credit_au},{name:n("ui.score.competition"),score:s.lecture.limit===0?"0.0:1":`${(s.lecture.num_people/s.lecture.limit).toFixed(1).toString()}:1`}]}),c.jsx(ni,{entries:[{name:n("ui.score.grade"),score:cn(s.lecture.grade)},{name:n("ui.score.load"),score:cn(s.lecture.load)},{name:n("ui.score.speech"),score:cn(s.lecture.speech)}]}),r?c.jsxs("button",{className:g("small-title","top-sticky"),onClick:this.closeDictPreview,ref:this.openDictRef,children:[c.jsx("span",{children:n("ui.title.reviews")}),c.jsx("i",{className:g("icon","icon--lecture-uparrow")})]}):c.jsxs("button",{className:g("small-title","top-sticky"),onClick:this.openDictPreview,ref:this.openDictRef,children:[c.jsx("span",{children:n("ui.title.reviews")}),c.jsx("i",{className:g("icon","icon--lecture-downarrow")})]}),y]},s.lecture.id),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:{desktop:!1,mobile:!0}}),c.jsxs("div",{className:g("subsection--lecture-detail__mobile-buttons","desktop-hidden"),children:[BD(s.lecture,l[ue.CART])?c.jsxs("button",{className:g("text-button","text-button--black"),onClick:this.deleteFromCart,children:[c.jsx("i",{className:g("icon","icon--delete-cart")}),c.jsx("span",{children:n("ui.button.deleteFromWishlist")})]}):c.jsxs("button",{className:g("text-button","text-button--black"),onClick:this.addToCart,children:[c.jsx("i",{className:g("icon","icon--add-cart")}),c.jsx("span",{children:n("ui.button.addToWishlist")})]}),o&&!o.isReadOnly?Ml(s.lecture,o)?c.jsxs("button",{className:g("text-button","text-button--black"),onClick:this.deleteFromTable,children:[c.jsx("i",{className:g("icon","icon--delete-from-table")}),c.jsx("span",{children:n("ui.button.deleteFromTable")})]}):c.jsxs("button",{className:g("text-button","text-button--black"),onClick:this.addToTable,children:[c.jsx("i",{className:g("icon","icon--add-lecture")}),c.jsx("span",{children:n("ui.button.addToTable")})]}):Ml(s.lecture,o)?c.jsxs("button",{className:g("text-button","text-button--black","text-button--disabled"),children:[c.jsx("i",{className:g("icon","icon--delete-from-table")}),c.jsx("span",{children:n("ui.button.deleteFromTable")})]}):c.jsxs("button",{className:g("text-button","text-button--black","text-button--disabled"),children:[c.jsx("i",{className:g("icon","icon--add-lecture")}),c.jsx("span",{children:n("ui.button.addToTable")})]})]})]})}return s.from===Ue.MULTIPLE?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:g("detail-title-area"),children:[c.jsx("div",{className:g("title"),children:s.multipleTitle}),c.jsx("div",{className:g("subtitle"),children:n("ui.others.multipleDetailCount",{count:s.multipleDetails.length})}),c.jsxs("div",{className:g("buttons"),children:[c.jsx("span",{className:g("text-button","text-button--disabled"),children:n("ui.button.unfix")}),c.jsx("span",{className:g("text-button","text-button--right","text-button--disabled"),children:n("ui.button.syllabus")}),c.jsx("span",{className:g("text-button","text-button--right","text-button--disabled"),children:n("ui.button.dictionary")})]})]}),c.jsx(Ci,{entries:s.multipleDetails.map(y=>({name:y.name,info:y.info})),longName:!0})]}):c.jsx(Xh,{})};return c.jsx("div",{className:g("section","section--lecture-detail",i&&"section--modal",s.clicked?null:"mobile-hidden"),children:c.jsx("div",{className:g("subsection","subsection--lecture-detail","subsection--flex"),ref:this.scrollRef,children:_()})})}}const Qee=e=>({user:e.common.user.user,isPortrait:e.common.media.isPortrait,lectureFocus:e.timetable.lectureFocus,selectedListCode:e.timetable.list.selectedListCode,selectedTimetable:e.timetable.timetable.selectedTimetable,lists:e.timetable.list.lists,year:e.timetable.semester.year,semester:e.timetable.semester.semester}),Zee=e=>({clearLectureFocusDispatch:()=>{e(Gh())},setReviewsDispatch:t=>{e(AZ(t))},addLectureToTimetableDispatch:t=>{e(VA(t))},removeLectureFromTimetableDispatch:t=>{e(GA(t))},addLectureToCartDispatch:t=>{e(vA(t))},deleteLectureFromCartDispatch:t=>{e(bA(t))}});QA.propTypes={user:ht,isPortrait:h.bool.isRequired,lectureFocus:Ca.isRequired,selectedListCode:h.string.isRequired,selectedTimetable:h.oneOfType([Fs,Ji]),lists:US.isRequired,year:h.number,semester:h.oneOf([1,2,3,4]),clearLectureFocusDispatch:h.func.isRequired,setReviewsDispatch:h.func.isRequired,addLectureToTimetableDispatch:h.func.isRequired,removeLectureFromTimetableDispatch:h.func.isRequired,addLectureToCartDispatch:h.func.isRequired,deleteLectureFromCartDispatch:h.func.isRequired};const Jee=de()(Pe(Qee,Zee)(QA));class ZA extends X.Component{constructor(){super(...arguments);N(this,"_fetchList",(n,r=!1)=>{const{user:i,lists:s}=this.props;n!==ue.SEARCH&&(!r&&s[n]&&s[n].lectureGroups||(n===ue.BASIC?this._performFetchBasicList():i&&i.departments.some(o=>o.code===n)?this._performFetchMajorList(n):n===ue.HUMANITY?this._performFetchHumanityList():n===ue.CART&&this._performFetchCartList()))});N(this,"_performFetchBasicList",()=>{const{year:n,semester:r,setListLecturesDispatch:i}=this.props;me.get("/api/lectures",{params:{year:n,semester:r,group:"Basic",order:["old_code","class_no"]},metadata:{gaCategory:"Lecture",gaVariable:"GET / List"}}).then(s=>{const o=this.props;o.year!==n||o.semester!==r||i(ue.BASIC,s.data)}).catch(s=>{})});N(this,"_performFetchMajorList",n=>{const{year:r,semester:i,setListLecturesDispatch:s}=this.props;me.get("/api/lectures",{params:{year:r,semester:i,group:[n],order:["old_code","class_no"]},metadata:{gaCategory:"Lecture",gaVariable:"GET / List"}}).then(o=>{const l=this.props;l.year!==r||l.semester!==i||!l.user.departments.some(d=>d.code===n)||s(n,o.data)}).catch(o=>{})});N(this,"_performFetchHumanityList",(n=!1)=>{const{year:r,semester:i,setListLecturesDispatch:s}=this.props;me.get("/api/lectures",{params:{year:r,semester:i,group:"Humanity",order:["old_code","class_no"]},metadata:{gaCategory:"Lecture",gaVariable:"GET / List"}}).then(o=>{const l=this.props;l.year!==r||l.semester!==i||s(ue.HUMANITY,o.data)}).catch(o=>{})});N(this,"_performFetchCartList",(n=!1)=>{const{user:r,year:i,semester:s,setListLecturesDispatch:o}=this.props;if(!r){o(ue.CART,[]);return}me.get(`/api/users/${r.id}/wishlist`,{metadata:{gaCategory:"User",gaVariable:"GET Wishlist / Instance"}}).then(l=>{const d=this.props;if(d.year!==i||d.semester!==s)return;const f=l.data.lectures.filter(m=>m.year===i&&m.semester===s);o(ue.CART,f)}).catch(l=>{})});N(this,"changeTab",n=>{var d;const{lists:r,setSelectedListCodeDispatch:i,openSearchDispatch:s,closeSearchDispatch:o}=this.props;i(n),n===ue.SEARCH&&((d=r[ue.SEARCH].lectureGroups)!=null&&d.length?o():s());const l=new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]);Je.event({category:"Timetable - List",action:"Switched Lecture List",label:`Lecture List : ${l.get(n)||n}`})})}componentDidMount(){const{user:n}=this.props;n&&this._fetchList(ue.CART,!0)}componentDidUpdate(n,r,i){const{user:s,selectedListCode:o,year:l,semester:d,clearAllListsLecturesDispatch:f,setLastSearchOptionDispatch:m}=this.props;s&&!n.user&&this._fetchList(ue.CART,!0),(l!==n.year||d!==n.semester)&&(f(),m({}),this._fetchList(ue.CART,!0),o!==ue.CART&&this._fetchList(o,!0)),o!==n.selectedListCode&&this._fetchList(o)}render(){const{t:n}=this.props,{user:r,selectedListCode:i}=this.props;return c.jsx("div",{className:g("tabs","tabs--lecture-list"),children:c.jsx(ct,{noScrollX:!1,noScrollY:!0,expandBottom:2,children:c.jsxs("div",{className:g("tabs__flexbox"),children:[c.jsxs("div",{className:g("tabs__elem",i===ue.SEARCH?"tabs__elem--selected":null),onClick:()=>this.changeTab(ue.SEARCH),children:[c.jsx("i",{className:g("icon","icon--tab-search")}),c.jsx("span",{children:n("ui.tab.searchShort")})]}),c.jsxs("div",{className:g("tabs__elem",i===ue.BASIC?"tabs__elem--selected":null),onClick:()=>this.changeTab(ue.BASIC),children:[c.jsx("i",{className:g("icon","icon--tab-basic")}),c.jsx("span",{children:n("ui.tab.basicShort")})]}),r?r.departments.map(s=>c.jsxs("div",{className:g("tabs__elem",i===s.code?"tabs__elem--selected":null),onClick:()=>this.changeTab(s.code),children:[c.jsx("i",{className:g("icon","icon--tab-major")}),c.jsx("span",{children:n("ui.tab.majorShort")})]},s.code)):null,c.jsxs("div",{className:g("tabs__elem",i===ue.HUMANITY?"tabs__elem--selected":null),onClick:()=>this.changeTab(ue.HUMANITY),children:[c.jsx("i",{className:g("icon","icon--tab-humanity")}),c.jsx("span",{children:n("ui.tab.humanityShort")})]}),c.jsxs("div",{className:g("tabs__elem",i===ue.CART?"tabs__elem--selected":null),onClick:()=>this.changeTab(ue.CART),children:[c.jsx("i",{className:g("icon","icon--tab-cart")}),c.jsx("span",{children:n("ui.tab.wishlistShort")})]})]})})})}}const ete=e=>({user:e.common.user.user,selectedListCode:e.timetable.list.selectedListCode,year:e.timetable.semester.year,semester:e.timetable.semester.semester,lists:e.timetable.list.lists}),tte=e=>({openSearchDispatch:()=>{e($S())},closeSearchDispatch:()=>{e(EA())},setSelectedListCodeDispatch:t=>{e(_A(t))},setListLecturesDispatch:(t,n)=>{e(yA(t,n))},clearAllListsLecturesDispatch:()=>{e(Nee())},setLastSearchOptionDispatch:t=>{e(CA(t))}});ZA.propTypes={user:ht,selectedListCode:h.string.isRequired,year:h.number,semester:h.oneOf([1,2,3,4]),lists:US,openSearchDispatch:h.func.isRequired,closeSearchDispatch:h.func.isRequired,setSelectedListCodeDispatch:h.func.isRequired,setListLecturesDispatch:h.func.isRequired,clearAllListsLecturesDispatch:h.func.isRequired,setLastSearchOptionDispatch:h.func.isRequired};const nte=de()(Pe(ete,tte)(ZA)),BS=e=>[ge.t("ui.day.monday"),ge.t("ui.day.tuesday"),ge.t("ui.day.wednesday"),ge.t("ui.day.thursday"),ge.t("ui.day.friday"),ge.t("ui.day.saturday"),ge.t("ui.day.sunday")][e],tk=e=>{const t=Math.floor(e/60),n=e%60;return`${t}:${String(n).padStart(2,"0")}`},HS=(e,t,n)=>`${BS(e)} ${tk(t)} ~ ${tk(n)}`;class JA extends X.Component{constructor(n){super(n);N(this,"INITIAL_STATE",{keyword:"",autocompleteText:"",selectedTypes:new Set(["ALL"]),selectedDepartments:new Set(["ALL"]),selectedLevels:new Set(["ALL"])});N(this,"hideSearch",()=>{const{closeSearchDispatch:n}=this.props;this.setState(this.INITIAL_STATE),n()});N(this,"searchStart",()=>{const{t:r}=this.props,{selectedTypes:i,selectedDepartments:s,selectedLevels:o,keyword:l}=this.state,{lectureFocus:d,year:f,semester:m,classtimeBegin:_,classtimeDay:y,classtimeEnd:b,closeSearchDispatch:w,clearSearchListLecturesDispatch:R,setListLecturesDispatch:S,clearLectureFocusDispatch:x,setLastSearchOptionDispatch:L}=this.props;if(i.size===1&&i.has("ALL")&&s.size===1&&s.has("ALL")&&o.size===1&&o.has("ALL")&&l.trim().length===0&&!(_!==null&&b!==null&&y!==null)){alert(r("ui.message.blankSearch"));return}const E={keyword:l,type:Array.from(i),department:Array.from(s),level:Array.from(o),day:y!==null?y:void 0,begin:_!==null?_/30-8*2:void 0,end:b!==null?b/30-8*2:void 0};this.setState(this.INITIAL_STATE),w(),R(),L(E),d.from===Ue.LIST&&x(),me.get("/api/lectures",{params:{year:f,semester:m,...E,order:["old_code","class_no"],limit:300},metadata:{gaCategory:"Timetable",gaVariable:"POST / List"}}).then(I=>{const j=this.props;j.year!==f||j.semester!==m||(I.data.length===300&&alert(r("ui.message.tooManySearchResults",{count:300})),S(ue.SEARCH,I.data))}).catch(I=>{}),Je.event({category:"Timetable - Search",action:"Searched Lecture"})});N(this,"updateCheckedValues",n=>r=>{this.setState({[n]:r})});N(this,"handleSubmit",n=>{n.preventDefault(),this.searchStart()});N(this,"handleInput",n=>{const{value:r}=n.target;this.setState({keyword:n.target.value,autocompleteText:""}),r.trim()&&this._fetchAutocomplete(r)});N(this,"_fetchAutocomplete",Ve.debounce(n=>{const{year:r,semester:i}=this.props;me.get("/api/lectures/autocomplete",{params:{year:r,semester:i,keyword:n},metadata:{gaCategory:"Lecture",gaVariable:"GET Autocomplete / List"}}).then(s=>{const{keyword:o}=this.state,l=this.props,d=s.data;n!==o||l.year!==r||l.semester!==i||this.setState({autocompleteText:d.substring(n.length,d.length)})}).catch(s=>{})},500));N(this,"applyAutocomplete",()=>{this.setState(n=>({keyword:n.keyword+n.autocompleteText,autocompleteText:""}))});N(this,"clearAutocomplete",()=>{this.setState({keyword:"",autocompleteText:""})});N(this,"onKeyPress",n=>{n.keyCode===9&&(this.applyAutocomplete(),n.stopPropagation(),n.preventDefault(),n.nativeEvent.stopImmediatePropagation())});N(this,"clearSearchTime",()=>{const{clearClasstimeOptionsDispatch:n}=this.props;n()});this.state=this.INITIAL_STATE}render(){const{t:n,searchOpen:r}=this.props,{keyword:i,autocompleteText:s,selectedTypes:o,selectedDepartments:l,selectedLevels:d}=this.state,{classtimeBegin:f,classtimeEnd:m,classtimeDay:_}=this.props;return c.jsx("div",{className:g("search-area",r?null:"search-area--hidden"),children:c.jsxs("form",{onSubmit:this.handleSubmit,children:[c.jsxs("div",{className:g("list-title","list-title--search-input"),children:[c.jsx("i",{className:g("icon","icon--search")}),c.jsxs("div",{children:[c.jsx("input",{type:"text",name:"keyword",autoComplete:"off",placeholder:n("ui.tab.search"),value:i,onKeyDown:y=>this.onKeyPress(y),onChange:y=>this.handleInput(y)}),c.jsxs("div",{className:g("search-keyword-autocomplete"),children:[c.jsx("span",{className:g("search-keyword-autocomplete-space"),children:i}),c.jsx("span",{className:g("search-keyword-autocomplete-body"),children:s})]})]})]}),c.jsxs(ct,{expandBottom:0,children:[c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedTypes"),inputName:"type",titleName:n("ui.search.type"),options:Xl(),checkedValues:o}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedDepartments"),inputName:"department",titleName:n("ui.search.department"),options:Kl(),checkedValues:l}),c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedLevels"),inputName:"level",titleName:n("ui.search.level"),options:Ql(),checkedValues:d}),c.jsxs("div",{className:g("attribute"),children:[c.jsx("span",{children:n("ui.search.time")}),c.jsx("div",{children:_!==null?c.jsx("span",{className:g("text-button"),onClick:this.clearSearchTime,children:`${HS(_,f,m)}`}):c.jsx("span",{children:n("ui.others.dragTimetable")})})]})]}),c.jsxs("div",{className:g("buttons"),children:[c.jsx("button",{type:"submit",className:g("text-button"),children:n("ui.button.search")}),c.jsx("button",{type:"button",className:g("text-button"),onClick:()=>this.hideSearch(),children:n("ui.button.cancel")})]}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0})]})})}}const rte=e=>({classtimeBegin:e.timetable.search.classtimeBegin,classtimeEnd:e.timetable.search.classtimeEnd,classtimeDay:e.timetable.search.classtimeDay,year:e.timetable.semester.year,semester:e.timetable.semester.semester,lectureFocus:e.timetable.lectureFocus,searchOpen:e.timetable.search.open}),ite=e=>({closeSearchDispatch:()=>{e(EA())},clearClasstimeOptionsDispatch:()=>{e(OA())},setListLecturesDispatch:(t,n)=>{e(yA(t,n))},clearSearchListLecturesDispatch:()=>{e(Aee())},clearLectureFocusDispatch:()=>{e(Gh())},setLastSearchOptionDispatch:t=>{e(CA(t))}});JA.propTypes={classtimeBegin:h.number,classtimeEnd:h.number,classtimeDay:h.number,year:h.number,semester:h.oneOf([1,2,3,4]),lectureFocus:Ca,searchOpen:h.bool.isRequired,closeSearchDispatch:h.func.isRequired,clearClasstimeOptionsDispatch:h.func.isRequired,setListLecturesDispatch:h.func.isRequired,clearSearchListLecturesDispatch:h.func.isRequired,clearLectureFocusDispatch:h.func.isRequired,setLastSearchOptionDispatch:h.func.isRequired};const ste=de()(Pe(rte,ite)(JA)),ej=({t:e,lectureGroup:t,isRaised:n,isDimmed:r,isTaken:i,children:s})=>c.jsxs("div",{className:g("block","block--lecture-group",n?"block--raised":null,r?"block--dimmed":null,i?"block--completed":null),children:[c.jsx("div",{className:g("block__completed-text"),children:e("ui.others.taken")}),c.jsxs("div",{className:g("block--lecture-group__title"),children:[c.jsx("strong",{children:t[0][e("js.property.common_title")]})," ",t[0].old_code]}),s]});ej.propTypes={lectureGroup:h.arrayOf(Yt).isRequired,isRaised:h.bool.isRequired,isDimmed:h.bool.isRequired,isTaken:h.bool.isRequired};const ote=de()(xe.memo(ej)),ate=h.exact({keyword:h.string,type:h.arrayOf(h.string),department:h.arrayOf(h.string),grade:h.arrayOf(h.string),day:h.number,begin:h.number,end:h.number}),tj=({t:e,lecture:t,isHighlighted:n,inTimetable:r,isTimetableReadonly:i,inCart:s,fromCart:o,addToCart:l,addToTable:d,deleteFromCart:f,onMouseOver:m,onMouseOut:_,onClick:y})=>{const b=P=>{switch(P.class_title.length){case 1:return g("block--lecture-group__row-content__texts__main__fixed-1");case 2:return g("block--lecture-group__row-content__texts__main__fixed-2");default:return g("")}},w=m?P=>{m(t)}:null,R=_?P=>{_(t)}:null,S=y?P=>{y(t)}:null,x=P=>{P.stopPropagation(),f(t)},L=P=>{P.stopPropagation(),l(t)},E=P=>{P.stopPropagation(),d(t)},I=o?c.jsx("button",{className:g("block--lecture-group__row-content__button"),onClick:x,children:c.jsx("i",{className:g("icon","icon--delete-cart")})}):s?c.jsx("button",{className:g("block--lecture-group__row-content__button","block--lecture-group__row-content__button--disable"),children:c.jsx("i",{className:g("icon","icon--add-cart")})}):c.jsx("button",{className:g("block--lecture-group__row-content__button"),onClick:L,children:c.jsx("i",{className:g("icon","icon--add-cart")})}),j=!r&&!i?c.jsx("button",{className:g("block--lecture-group__row-content__button"),onClick:E,children:c.jsx("i",{className:g("icon","icon--add-lecture")})}):c.jsx("button",{className:g("block--lecture-group__row-content__button","block--lecture-group__row-content__button--disable"),children:c.jsx("i",{className:g("icon","icon--add-lecture")})});return c.jsx("div",{className:g("block--lecture-group__row",n?"block--lecture-group__row--highlighted":null),"data-id":t.id,onClick:S,onMouseOver:w,onMouseOut:R,children:c.jsxs("div",{className:g("block--lecture-group__row-content"),children:[c.jsxs("div",{className:g("block--lecture-group__row-content__texts"),children:[c.jsxs("div",{className:g("block--lecture-group__row-content__texts__sub"),children:[t[e("js.property.department_name")]," / ",t[e("js.property.type")]]}),c.jsxs("div",{className:g("block--lecture-group__row-content__texts__main"),children:[c.jsx("strong",{className:b(t),children:t[e("js.property.class_title")]})," ",c.jsx("span",{children:eu(t)})]}),c.jsxs("div",{className:g("block--lecture-group__row-content__texts__sub"),children:[HD(t)," / ",t.limit]})]}),I,j]})})};tj.propTypes={lecture:Yt.isRequired,isHighlighted:h.bool.isRequired,inTimetable:h.bool.isRequired,isTimetableReadonly:h.bool.isRequired,inCart:h.bool.isRequired,fromCart:h.bool.isRequired,addToCart:h.func.isRequired,addToTable:h.func.isRequired,deleteFromCart:h.func.isRequired,onMouseOver:h.func,onMouseOut:h.func,onClick:h.func};const lte=de()(xe.memo(tj));class nj extends X.Component{constructor(n){super(n);N(this,"showSearch",()=>{const{openSearchDispatch:n}=this.props;n()});N(this,"addLectureToTable",n=>{const{user:r,selectedTimetable:i,selectedListCode:s,addLectureToTimetableDispatch:o}=this.props,d=`Lecture List : ${new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]).get(s)||s}`;SD(n,i,r,d,()=>{},()=>{const _=this.props;!_.selectedTimetable||_.selectedTimetable.id!==i.id||o(n)})});N(this,"addLectureToCart",n=>{const{user:r,selectedListCode:i,year:s,semester:o,addLectureToCartDispatch:l}=this.props,f=`Lecture List : ${new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]).get(i)||i}`;wD(n,r,f,()=>{},()=>{const y=this.props;y.year!==s||y.semester!==o||l(n)})});N(this,"deleteLectureFromCart",n=>{const{user:r,selectedListCode:i,year:s,semester:o,deleteLectureFromCartDispatch:l}=this.props,f=`Lecture List : ${new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]).get(i)||i}`;TD(n,r,f,()=>{},()=>{const y=this.props;y.year!==s||y.semester!==o||l(n)})});N(this,"focusLectureWithHover",n=>{const{lectureFocus:r,setLectureFocusDispatch:i}=this.props,s=this.arrowRef.current;window.getComputedStyle(s).getPropertyValue("display")==="none"&&(r.clicked||i(n,Ue.LIST,!1))});N(this,"unfocusLectureWithHover",n=>{const{lectureFocus:r,clearLectureFocusDispatch:i}=this.props,s=this.arrowRef.current;window.getComputedStyle(s).getPropertyValue("display")==="none"&&(r.clicked||i())});N(this,"focusLectureWithClick",n=>{const{lectureFocus:r,selectedListCode:i,setLectureFocusDispatch:s}=this.props;if(k_(n,r)){s(n,Ue.LIST,!1);const o=new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]);Je.event({category:"Timetable - Selection",action:"Unselected Lecture",label:`Lecture : ${n.id} / From : Lecture List : ${o.get(i)||i}`})}else{s(n,Ue.LIST,!0);const o=new Map([[ue.SEARCH,"Search"],[ue.BASIC,"Basic"],[ue.HUMANITY,"Humanity"],[ue.CART,"Cart"]]);Je.event({category:"Timetable - Selection",action:"Selected Lecture",label:`Lecture : ${n.id} / From : Lecture List : ${o.get(i)||i}`})}});N(this,"selectWithArrow",()=>{const{lists:n,selectedListCode:r,lectureFocus:i,clearLectureFocusDispatch:s,setLectureFocusDispatch:o}=this.props;if(i.clicked)return;const l=this.arrowRef.current,d=this.arrowRef.current.getBoundingClientRect(),f=d.left,m=(d.top+d.bottom)/2;if(window.getComputedStyle(l).getPropertyValue("display")==="none"||m===0)return;const y=[document.elementFromPoint(f-15,m),document.elementFromPoint(f-15,m-25),document.elementFromPoint(f-15,m+25)].filter(S=>S&&S.closest(`.${g("block--lecture-group__row")}`));if(y.length===0){s();return}const b=Number(y[0].closest(`.${g("block--lecture-group__row")}`).dataset.id),R=this._getLectureGroups(r,n).map(S=>S.map(x=>x.id===b?x:null)).flat(1).filter(S=>S!==null)[0];o(R,Ue.LIST,!1)});N(this,"mobileCloseLectureList",()=>{const{setIsLectureListOpenOnMobileDispatch:n,clearLectureFocusDispatch:r}=this.props;n(!1),r()});N(this,"_getLectureGroups",(n,r)=>r[n]?r[n].lectureGroups:null);this.arrowRef=xe.createRef()}componentDidMount(){window.addEventListener("resize",this.selectWithArrow)}componentDidUpdate(n,r,i){const{lists:s,selectedListCode:o,lectureFocus:l,isLectureListOpenOnMobile:d}=this.props;o!==n.selectedListCode&&this.selectWithArrow(),!this._getLectureGroups(n.selectedListCode,n.lists)&&this._getLectureGroups(o,s)&&this.selectWithArrow(),n.lectureFocus.clicked&&!l.clicked&&this.selectWithArrow(),!n.isLectureListOpenOnMobile&&d&&Ve.range(.15/.05+1).forEach(_=>{const y=(_+2)*.05*1e3;window.setTimeout(this.selectWithArrow,y)})}componentWillUnmount(){window.removeEventListener("resize",this.selectWithArrow)}render(){const{t:n}=this.props,{user:r,lectureFocus:i,selectedTimetable:s,selectedListCode:o,lastSearchOption:l,lists:d}=this.props,f=()=>{if(o===ue.SEARCH){const _=Object.entries(l).map(y=>y[0]==="keyword"&&y[1].length>0?y[1]:y[0]==="type"&&!y[1].includes("ALL")?y[1].map(b=>Si(Xl(),b)):y[0]==="department"&&!y[1].includes("ALL")?y[1].map(b=>Si(Kl(),b)):y[0]==="grade"&&!y[1].includes("ALL")?y[1].map(b=>Si(Ql(),b)):[]).flat(1).concat(l.day&&l.day!==""?[`${HS(l.day,(l.begin+Or*2)*30,(l.end+Or*2)*30)}`]:[]).join(", ");return c.jsxs("div",{className:g("list-title","list-title--search"),onClick:()=>this.showSearch(),children:[c.jsx("i",{className:g("icon","icon--search")}),c.jsx("span",{children:n("ui.tab.search")}),c.jsx("span",{children:_.length>0?`:${_}`:""})]})}if(o===ue.BASIC)return c.jsx("div",{className:g("list-title"),children:n("ui.tab.basic")});if(r&&r.departments.some(_=>o===_.code)){const _=r.departments.find(y=>o===y.code);return c.jsx("div",{className:g("list-title"),children:`${_[n("js.property.name")]} ${n("ui.tab.major")}`})}return o===ue.HUMANITY?c.jsx("div",{className:g("list-title"),children:n("ui.tab.humanity")}):o===ue.CART?c.jsx("div",{className:g("list-title"),children:n("ui.tab.wishlist")}):null},m=()=>{const _=this._getLectureGroups(o,d);return _?_.length===0?c.jsx("div",{className:g("list-placeholder"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})}):c.jsx(ct,{onScroll:this.selectWithArrow,children:c.jsx("div",{className:g("block-list"),children:_.map(y=>c.jsx(ote,{lectureGroup:y,isRaised:y.some(b=>k_(b,i)),isDimmed:qZ(y,i),isTaken:r&&SZ(y[0].course,r),children:y.map(b=>c.jsx(lte,{lecture:b,isHighlighted:k_(b,i)||MZ(b,i),inTimetable:Ml(b,s),isTimetableReadonly:!!(!s||s.isReadOnly),inCart:BD(b,d[ue.CART]),fromCart:o===ue.CART,addToCart:this.addLectureToCart,addToTable:this.addLectureToTable,deleteFromCart:this.deleteLectureFromCart,onMouseOver:this.focusLectureWithHover,onMouseOut:this.unfocusLectureWithHover,onClick:this.focusLectureWithClick},b.id))},y[0].course))})},o):c.jsx("div",{className:g("list-placeholder"),children:c.jsx("div",{children:n("ui.placeholder.loading")})})};return c.jsx("div",{className:g("section","section--lecture-list"),children:c.jsxs("div",{className:g("subsection","subsection--flex","subsection--lecture-list"),children:[o===ue.SEARCH?c.jsx(ste,{}):null,c.jsx(Fr,{onClick:this.mobileCloseLectureList}),f(),c.jsx("div",{className:g("subsection--lecture-list__selector",i.clicked?"subsection--lecture-list__selector--dimmed":null),ref:this.arrowRef,children:c.jsx("i",{className:g("icon","icon--lecture-selector")})}),m()]})})}}const ute=e=>({user:e.common.user.user,selectedListCode:e.timetable.list.selectedListCode,lists:e.timetable.list.lists,isLectureListOpenOnMobile:e.timetable.list.isLectureListOpenOnMobile,selectedTimetable:e.timetable.timetable.selectedTimetable,lectureFocus:e.timetable.lectureFocus,year:e.timetable.semester.year,semester:e.timetable.semester.semester,lastSearchOption:e.timetable.search.lastSearchOption}),cte=e=>({openSearchDispatch:()=>{e($S())},setLectureFocusDispatch:(t,n,r)=>{e(qD(t,n,r))},clearLectureFocusDispatch:()=>{e(Gh())},addLectureToTimetableDispatch:t=>{e(VA(t))},addLectureToCartDispatch:t=>{e(vA(t))},deleteLectureFromCartDispatch:t=>{e(bA(t))},setIsLectureListOpenOnMobileDispatch:t=>{e(FS(t))}});nj.propTypes={user:ht,selectedListCode:h.string.isRequired,lists:US.isRequired,isLectureListOpenOnMobile:h.bool.isRequired,selectedTimetable:h.oneOfType([Fs,Ji]),lectureFocus:Ca.isRequired,year:h.number,semester:h.oneOf([1,2,3,4]),lastSearchOption:ate.isRequired,openSearchDispatch:h.func.isRequired,setLectureFocusDispatch:h.func.isRequired,clearLectureFocusDispatch:h.func.isRequired,addLectureToTimetableDispatch:h.func.isRequired,addLectureToCartDispatch:h.func.isRequired,deleteLectureFromCartDispatch:h.func.isRequired,setIsLectureListOpenOnMobileDispatch:h.func.isRequired};const dte=de()(Pe(ute,cte)(nj));class rj extends X.Component{constructor(n){super(n);N(this,"_fetchTables",()=>{const{user:n,year:r,semester:i,setTimetablesDispatch:s}=this.props;if(!n){s([]),this._performCreateTable();return}r==null||i==null||me.get(`/api/users/${n.id}/timetables`,{params:{year:r,semester:i,order:["arrange_order","id"]},metadata:{gaCategory:"Timetable",gaVariable:"GET / List"}}).then(o=>{const l=this.props;l.year!==r||l.semester!==i||(s(o.data),o.data.length===0&&this._performCreateTable())}).catch(o=>{})});N(this,"_createRandomTimetableId",()=>Math.floor(Math.random()*1e8));N(this,"_setMyTimetable",()=>{const{user:n,year:r,semester:i,setMyTimetableLecturesDispatch:s}=this.props,o=n.my_timetable_lectures.filter(l=>l.year===r&&l.semester===i);s(o)});N(this,"changeTab",n=>{const{setSelectedTimetableDispatch:r,setIsTimetableTabsOpenOnMobileDispatch:i}=this.props;r(n),i(!1),Je.event({category:"Timetable - Timetable",action:"Switched Timetable"})});N(this,"_performCreateTable",()=>{const{user:n,year:r,semester:i,createTimetableDispatch:s}=this.props;n?me.post(`/api/users/${n.id}/timetables`,{year:r,semester:i,lectures:[]},{metadata:{gaCategory:"Timetable",gaVariable:"POST / List"}}).then(o=>{const l=this.props;l.year!==r||l.semester!==i||s(o.data.id)}).catch(o=>{}):s(this._createRandomTimetableId())});N(this,"createTable",()=>{this._performCreateTable(),Je.event({category:"Timetable - Timetable",action:"Created Timetable"})});N(this,"deleteTable",(n,r)=>{const{t:i}=this.props,{user:s,timetables:o,year:l,semester:d,deleteTimetableDispatch:f}=this.props;if(n.stopPropagation(),o.length===1){alert(i("ui.message.lastTimetable"));return}r.lectures.length>0&&!window.confirm(i("ui.message.timetableDelete"))||(s?me.delete(`/api/users/${s.id}/timetables/${r.id}`,{metadata:{gaCategory:"Timetable",gaVariable:"DELETE / Instance"}}).then(m=>{const _=this.props;_.year!==l||_.semester!==d||f(r)}).catch(m=>{}):f(r),Je.event({category:"Timetable - Timetable",action:"Deleted Timetable"}))});N(this,"duplicateTable",(n,r)=>{const{user:i,year:s,semester:o,duplicateTimetableDispatch:l}=this.props;n.stopPropagation(),i?me.post(`/api/users/${i.id}/timetables`,{year:s,semester:o,lectures:r.lectures.map(d=>d.id)},{metadata:{gaCategory:"Timetable",gaVariable:"POST / List"}}).then(d=>{const f=this.props;f.year!==s||f.semester!==o||l(d.data.id,r)}).catch(d=>{}):l(this._createRandomTimetableId(),r),Je.event({category:"Timetable - Timetable",action:"Duplicated Timetable"})});N(this,"handlePointerDown",n=>{n.stopPropagation(),n.preventDefault();const{draggingTimetableId:r}=this.state,{isPortrait:i}=this.props;r===void 0&&(this.setState({draggingTimetableId:Number(n.currentTarget.dataset.id),dragStartPosition:i?n.clientY:n.clientX,dragCurrentPosition:i?n.clientY:n.clientX,dragOrderChanged:!1}),document.addEventListener("pointermove",this.handlePointerMove),document.addEventListener("pointerup",this.handlePointerUp),document.body.style.cursor="grabbing")});N(this,"_checkAndReorderTimetablePrev",(n,r)=>{const{draggingTimetableId:i,dragStartPosition:s}=this.state,{user:o,timetables:l,reorderTimetableDispatch:d}=this.props,f=r?"right":"bottom",m=r?"width":"height",_=r?6:8,y=Array.from(document.querySelectorAll(`.${g("tabs--timetable")} .${g("tabs__elem--draggable")}`)),b=document.querySelector(`.${g("tabs--timetable")} .${g("tabs__elem--dragging")}`),w=y.findIndex(S=>S===b);if(w===0)return;const R=y[w-1];if(nE.id===i),x=l[S],L=l[S-1];o&&me.post(`/api/users/${o.id}/timetables/${x.id}/reorder`,{arrange_order:L.arrange_order},{metadata:{gaCategory:"Timetable",gaVariable:"POST Reorder / Instance"}}).then(E=>{}).catch(E=>{}),d(x,L.arrange_order),this.setState({dragStartPosition:s-(R.getBoundingClientRect()[m]+_)})}});N(this,"_checkAndReorderTimetableNext",(n,r)=>{const{draggingTimetableId:i,dragStartPosition:s}=this.state,{user:o,timetables:l,reorderTimetableDispatch:d}=this.props,f=r?"left":"top",m=r?"width":"height",_=r?6:8,y=Array.from(document.querySelectorAll(`.${g("tabs--timetable")} .${g("tabs__elem--draggable")}`)),b=document.querySelector(`.${g("tabs--timetable")} .${g("tabs__elem--dragging")}`),w=y.findIndex(S=>S===b);if(w===y.length-1)return;const R=y[w+1];if(n>R.getBoundingClientRect()[f]){const S=l.findIndex(E=>E.id===i),x=l[S],L=l[S+1];o&&me.post(`/api/users/${o.id}/timetables/${x.id}/reorder`,{arrange_order:L.arrange_order},{metadata:{gaCategory:"Timetable",gaVariable:"POST Reorder / Instance"}}).then(E=>{}).catch(E=>{}),d(x,L.arrange_order),this.setState({dragStartPosition:s+(R.getBoundingClientRect()[m]+_)})}});N(this,"handlePointerMove",n=>{const{dragStartPosition:r,dragCurrentPosition:i,draggingTimetableId:s}=this.state,{isPortrait:o}=this.props,l=o?n.clientY:n.clientX,d=l-i;s!==void 0&&(this.setState({dragCurrentPosition:l}),Math.abs(l-r)>10&&this.setState({dragOrderChanged:!0}),d>0?this._checkAndReorderTimetableNext(l,!o):d<0&&this._checkAndReorderTimetablePrev(l,!o))});N(this,"handlePointerUp",n=>{const{draggingTimetableId:r}=this.state;r!==void 0&&(this.setState({draggingTimetableId:void 0,dragStartPosition:void 0,dragCurrentPosition:void 0,dragOrderChanged:!1}),document.removeEventListener("pointermove",this.handlePointerMove),document.removeEventListener("pointerup",this.handlePointerUp),document.body.style.cursor="")});N(this,"_isSelected",n=>{const{selectedTimetable:r}=this.props;return r&&n.id===r.id});N(this,"_isDragging",n=>{const{draggingTimetableId:r}=this.state;return r!==void 0&&n.id===r});N(this,"_getTabRelativePosition",n=>{if(!this._isDragging(n))return;const{dragStartPosition:r,dragCurrentPosition:i}=this.state,{timetables:s}=this.props,o=i-r;return s.findIndex(l=>l.id===n.id)===0&&o<0||s.findIndex(l=>l.id===n.id)===s.length-1&&o>0?0:o});this.state={draggingTimetableId:void 0,dragStartPosition:void 0,dragCurrentPosition:void 0,dragOrderChanged:!1}}componentDidMount(){const{user:n}=this.props;n&&this._setMyTimetable()}componentDidUpdate(n,r,i){const{user:s,year:o,semester:l,clearTimetablesDispatch:d}=this.props;o!==n.year||l!==n.semester?(d(),this._fetchTables()):!n.user&&s&&(d(),this._fetchTables()),!n.user&&s?this._setMyTimetable():s&&(n.year!==o||l!==n.semester)&&this._setMyTimetable()}render(){const{dragOrderChanged:n}=this.state,{t:r}=this.props,{user:i,isPortrait:s,timetables:o,myTimetable:l}=this.props,d=i?c.jsxs("div",{className:g("tabs__elem",this._isSelected(l)?"tabs__elem--selected":null),onClick:()=>this.changeTab(l),children:[c.jsx("span",{children:`${r("ui.others.myTable")}`}),c.jsxs("button",{onClick:_=>this.duplicateTable(_,l),children:[c.jsx("i",{className:g("icon","icon--duplicate-table")}),c.jsx("span",{children:r("ui.button.duplicateTable")})]}),c.jsxs("button",{className:g("disabled"),children:[c.jsx("i",{className:g("icon","icon--delete-table")}),c.jsx("span",{children:r("ui.button.deleteTable")})]})]},l.id):null,f=o&&o.length?o.map((_,y)=>c.jsxs("div",{className:g("tabs__elem","tabs__elem--draggable",this._isSelected(_)?"tabs__elem--selected":null,this._isDragging(_)?"tabs__elem--dragging":null),onClick:()=>this.changeTab(_),onPointerDown:this.handlePointerDown,"data-id":_.id,style:{[s?"top":"left"]:this._getTabRelativePosition(_),pointerEvents:n?"none":void 0},children:[c.jsx("span",{children:`${r("ui.others.table")} ${y+1}`}),c.jsxs("button",{onClick:b=>this.duplicateTable(b,_),children:[c.jsx("i",{className:g("icon","icon--duplicate-table")}),c.jsx("span",{children:r("ui.button.duplicateTable")})]}),c.jsxs("button",{onClick:b=>this.deleteTable(b,_),children:[c.jsx("i",{className:g("icon","icon--delete-table")}),c.jsx("span",{children:r("ui.button.deleteTable")})]})]},_.id)):c.jsx("div",{className:g("tabs__elem"),style:{pointerEvents:"none"},children:c.jsx("span",{children:r("ui.placeholder.loading")})}),m=o&&o.length?c.jsx("div",{className:g("tabs__elem","tabs__elem--add-button"),onClick:()=>this.createTable(),children:c.jsx("i",{className:g("icon","icon--add-table")})}):null;return c.jsxs("div",{className:g("tabs","tabs--timetable"),children:[d,f,m]})}}const fte=e=>({user:e.common.user.user,isPortrait:e.common.media.isPortrait,timetables:e.timetable.timetable.timetables,selectedTimetable:e.timetable.timetable.selectedTimetable,myTimetable:e.timetable.timetable.myTimetable,year:e.timetable.semester.year,semester:e.timetable.semester.semester}),pte=e=>({setTimetablesDispatch:t=>{e(qee(t))},clearTimetablesDispatch:()=>{e(Uee())},setMyTimetableLecturesDispatch:t=>{e(Bee(t))},setSelectedTimetableDispatch:t=>{e(XA(t))},createTimetableDispatch:t=>{e(Hee(t))},deleteTimetableDispatch:t=>{e(Wee(t))},duplicateTimetableDispatch:(t,n)=>{e(Yee(t,n))},reorderTimetableDispatch:(t,n)=>{e(zee(t,n))},setIsTimetableTabsOpenOnMobileDispatch:t=>{e(qS(t))}});rj.propTypes={user:ht,isPortrait:h.bool.isRequired,timetables:h.arrayOf(Fs),selectedTimetable:h.oneOfType([Fs,Ji]),myTimetable:Ji.isRequired,year:h.number,semester:h.oneOf([1,2,3,4]),setTimetablesDispatch:h.func.isRequired,clearTimetablesDispatch:h.func.isRequired,setMyTimetableLecturesDispatch:h.func.isRequired,setSelectedTimetableDispatch:h.func.isRequired,createTimetableDispatch:h.func.isRequired,deleteTimetableDispatch:h.func.isRequired,duplicateTimetableDispatch:h.func.isRequired,reorderTimetableDispatch:h.func.isRequired,setIsTimetableTabsOpenOnMobileDispatch:h.func.isRequired};const hte=de()(Pe(fte,pte)(rj));class ij extends X.Component{constructor(){super(...arguments);N(this,"_initializeSemester",()=>{const{startSemester:n,semesters:r,setSemesterDispatch:i}=this.props,s=n!==void 0?n:GD(r);i(s.year,s.semester)});N(this,"_getSemesterIndex",(n,r)=>{const{semesters:i}=this.props;return i.findIndex(s=>s.year===n&&s.semester===r)});N(this,"_isFirstSemester",(n,r)=>this._getSemesterIndex(n,r)===0);N(this,"_isLastSemester",(n,r)=>{const{semesters:i}=this.props;return this._getSemesterIndex(n,r)===i.length-1});N(this,"changeToPreviousSemester",()=>{const{semesters:n,year:r,semester:i,setSemesterDispatch:s}=this.props;if(this._isFirstSemester(r,i))return;const o=this._getSemesterIndex(r,i),l=n[o-1];s(l.year,l.semester),Je.event({category:"Timetable - Semester",action:"Switched Semester",label:`Semester : ${l.year}-${l.semester}`})});N(this,"changeToNextSemester",()=>{const{semesters:n,year:r,semester:i,setSemesterDispatch:s}=this.props;if(this._isLastSemester(r,i))return;const o=this._getSemesterIndex(r,i),l=n[o+1];s(l.year,l.semester),Je.event({category:"Timetable - Semester",action:"Switched Semester",label:`Semester : ${l.year}-${l.semester}`})})}componentDidMount(){const{semesters:n}=this.props;n!==null&&this._initializeSemester()}componentDidUpdate(n){const{semesters:r}=this.props;n.semesters===null&&r!==null&&this._initializeSemester()}render(){const{t:n}=this.props,{isPortrait:r,year:i,semester:s}=this.props,o=i&&s?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:g(this._isFirstSemester(i,s)?"disable":null),onClick:()=>this.changeToPreviousSemester(),children:c.jsx("i",{className:g("icon","icon--semester-prev")})}),c.jsx("span",{children:`${i} ${ar(s)}`}),c.jsx("button",{className:g(this._isLastSemester(i,s)?"disable":null),onClick:()=>this.changeToNextSemester(),children:c.jsx("i",{className:g("icon","icon--semester-next")})})]}):c.jsx("span",{className:g("placeholder"),children:n("ui.placeholder.loading")});return c.jsx("div",{className:g("section","section--semester",r&&"section--transparent"),children:c.jsx("div",{className:g("subsection","subsection--semester",n("jsx.className.semesterByLang")),children:o})})}}const mte=e=>({semesters:e.common.semester.semesters,isPortrait:e.common.media.isPortrait,year:e.timetable.semester.year,semester:e.timetable.semester.semester}),gte=e=>({setSemesterDispatch:(t,n)=>{e(Fee(t,n))}});ij.propTypes={startSemester:Zi,isPortrait:h.bool.isRequired,semesters:h.arrayOf(Zi),year:h.number,semester:h.oneOf([1,2,3,4]),setSemesterDispatch:h.func.isRequired};const _te=de()(Pe(mte,gte)(ij)),sj=({t:e,lecture:t,classtime:n,tableIndex:r,dayIndex:i,beginIndex:s,endIndex:o,color:l,cellWidth:d,cellHeight:f,isTimetableReadonly:m,isRaised:_,isHighlighted:y,isDimmed:b,isTemp:w,isSimple:R,onMouseOver:S,onMouseOut:x,onClick:L,deleteLecture:E,occupiedIndices:I})=>{const j=S?V=>{S(t)}:null,P=x?V=>{x(t)}:null,U=L?V=>{L(t)}:null,W=V=>{V.stopPropagation(),E(t)},J=()=>{if(r===0)return 17+f*s+2;const V=17+f*((Sc-Or)*2),K=17+f*3,B=f,ce=17+f*s;return V+K*(r-1)+B*r+ce+2};return c.jsxs("div",{className:g("tile","tile--timetable",`background-color--${l}`,_?"tile--raised":null,w?"tile--temp":null,y?"tile--highlighted":null,b?"tile--dimmed":null),style:{left:18+(d+5)*i-1,top:J(),width:d+2,height:f*(o-s)-3},onMouseOver:j,onMouseOut:P,onClick:U,children:[!w&&!m?c.jsx("button",{className:g("tile--timetable__button"),onClick:W,children:c.jsx("i",{className:g("icon","icon--delete-lecture")})}):null,c.jsxs("div",{className:g("tile--timetable__content"),children:[c.jsx("p",{className:g("tile--timetable__content__title",R?"mobile-hidden":null),children:t[e("js.property.title")]}),c.jsx("p",{className:g("tile--timetable__content__info","mobile-hidden"),children:eu(t)}),c.jsx("p",{className:g("tile--timetable__content__info","mobile-hidden"),children:n?n[e("js.property.classroom")]:null})]}),I===void 0?null:I.map(V=>c.jsx("div",{className:g("tile--timetable__occupied-area"),style:{top:f*(V[0]-s),height:f*(V[1]-V[0])-3}},`${V[0]}:${V[1]}`))]})};sj.propTypes={lecture:Yt.isRequired,classtime:pS,tableIndex:h.number.isRequired,dayIndex:h.number.isRequired,beginIndex:h.number.isRequired,endIndex:h.number.isRequired,color:h.number.isRequired,cellWidth:h.number.isRequired,cellHeight:h.number.isRequired,isTimetableReadonly:h.bool.isRequired,isRaised:h.bool.isRequired,isHighlighted:h.bool.isRequired,isDimmed:h.bool.isRequired,isTemp:h.bool.isRequired,isSimple:h.bool.isRequired,onMouseOver:h.func,onMouseOut:h.func,onClick:h.func,deleteLecture:h.func.isRequired,occupiedIndices:h.arrayOf(h.arrayOf(h.number))};const yte=de()(xe.memo(sj)),oj=({t:e,dayIndex:t,beginIndex:n,endIndex:r,cellWidth:i,cellHeight:s})=>c.jsx("div",{className:g("tile","tile--timetable-drag"),style:{left:(i+5)*t+17,width:i+2,top:s*n+19,height:s*(r-n)-3}});oj.propTypes={dayIndex:h.number.isRequired,beginIndex:h.number.isRequired,endIndex:h.number.isRequired,cellWidth:h.number.isRequired,cellHeight:h.number.isRequired};const vte=de()(xe.memo(oj));class aj extends X.Component{constructor(n){super(n);N(this,"resize",()=>{const{updateCellSizeDispatch:n}=this.props,r=document.getElementsByClassName(g("subsection--timetable__table__body__cell"))[0].getBoundingClientRect();n(r.width,r.height+1)});N(this,"_getIndexOfMinute",n=>n/30-2*Or);N(this,"onMouseDown",n=>{n.stopPropagation(),n.preventDefault(),this._dragStart(n.target)});N(this,"onTouchStart",n=>{n.stopPropagation(),n.preventDefault();const r=document.elementFromPoint(n.touches[0].pageX,n.touches[0].pageY);if(r===null)return;const i=r.closest(`.${g("subsection--timetable__table__body__cell--drag")}`);i!==null&&this._dragStart(i)});N(this,"_dragStart",n=>{const{clearLectureFocusDispatch:r,setIsDraggingDispatch:i}=this.props;this.setState({firstDragCell:n,secondDragCell:n}),r(),i(!0)});N(this,"_getOccupiedTimes",(n,r,i)=>{const{selectedTimetable:s}=this.props;return s?s.lectures.map(l=>l.classtimes).flat(1).filter(l=>l.day===n&&rl.begin).map(l=>[Math.max(r,l.begin),Math.min(i,l.end)]):[]});N(this,"onMouseMove",n=>{this._dragMove(n.target)});N(this,"onTouchMove",n=>{const r=document.elementFromPoint(n.touches[0].pageX,n.touches[0].pageY);if(r===null)return;const i=r.closest(`.${g("subsection--timetable__table__body__cell--drag")}`);i!==null&&this._dragMove(i)});N(this,"_dragMove",n=>{const{firstDragCell:r}=this.state,{isDragging:i}=this.props;if(!i)return;const s=Number(r.dataset.day),o=Number(r.dataset.minute),l=Number(n.dataset.minute),d=Math.min(o,l),f=Math.max(o,l)+30;this._getOccupiedTimes(s,d,f).length>0||this.setState({secondDragCell:n})});N(this,"onMouseUp",n=>{this._dragEnd()});N(this,"onTouchEnd",n=>{this._dragEnd()});N(this,"_dragEnd",()=>{const{firstDragCell:n,secondDragCell:r}=this.state,{isDragging:i,setIsDraggingDispatch:s,openSearchDispatch:o,setClasstimeOptionsDispatch:l,clearClasstimeOptionsDispatch:d,setSelectedListCodeDispatch:f,setIsLectureListOpenOnMobileDispatch:m}=this.props;if(!i)return;s(!1),this.setState({firstDragCell:null,secondDragCell:null});const _=Number(n.dataset.day),y=Number(n.dataset.minute),b=Number(r.dataset.minute);if(y===b){d();return}const w=Math.min(y,b),R=Math.max(y,b)+30;l(_,w,R),m(!0),f(ue.SEARCH),o()});N(this,"focusLectureWithHover",n=>{const{lectureFocus:r,isDragging:i,setLectureFocusDispatch:s}=this.props;!r.clicked&&!i&&s(n,Ue.TABLE,!1)});N(this,"unfocusLectureWithHover",n=>{const{lectureFocus:r,clearLectureFocusDispatch:i}=this.props;r.clicked||i()});N(this,"focusLectureWithClick",n=>{const{lectureFocus:r,setLectureFocusDispatch:i}=this.props;VR(n,r)?i(n,Ue.TABLE,!1):i(n,Ue.TABLE,!0)});N(this,"deleteLectureFromTimetable",n=>{const{selectedTimetable:r,user:i,removeLectureFromTimetableDispatch:s,clearLectureFocusDispatch:o}=this.props;if(!r)return;xD(n,r,i,"Timetable",()=>{},()=>{const f=this.props;!f.selectedTimetable||f.selectedTimetable.id!==r.id||(s(n),o())})});this.state={firstDragCell:null,secondDragCell:null}}componentDidMount(){this.resize(),window.addEventListener("resize",this.resize)}componentDidUpdate(n){const{isLectureListOpenOnMobile:r}=this.props;this.resize(),n.isLectureListOpenOnMobile!==r&&Ve.range(.15/.05+1).forEach(o=>{const l=(o+2)*.05*1e3;window.setTimeout(this.resize,l)})}componentWillUnmount(){window.removeEventListener("resize",this.resize)}render(){const{t:n}=this.props,{firstDragCell:r,secondDragCell:i}=this.state,{selectedTimetable:s,lectureFocus:o,cellWidth:l,cellHeight:d,isLectureListOpenOnMobile:f}=this.props,m=Os(s,o),_=V=>V.day<0||V.day>4||V.begin<60*Or||V.end>60*Sc,y=m.map(V=>V.classtimes.map(K=>({lecture:V,classtime:K}))).flat(1),b=m.filter(V=>V.classtimes.length===0).map(V=>({lecture:V,classtime:null})),w=y.filter(V=>!_(V.classtime)),R=[...y.filter(V=>_(V.classtime)),...b],S=V=>V?HS(V.day,V.begin,V.end):n("ui.others.timeNone"),x=(V,K,B,ce,ne)=>c.jsx(yte,{lecture:V,classtime:K,tableIndex:B?Math.floor(ce/5)+1:0,dayIndex:B?ce%5:K.day,beginIndex:B?0:K.begin/30-Or*2,endIndex:B?3:K.end/30-Or*2,color:CS(V),cellWidth:l,cellHeight:d,isTimetableReadonly:!s||!!s.isReadOnly,isRaised:VR(V,o),isHighlighted:UZ(V,o),isDimmed:$Z(V,o),isTemp:ne,isSimple:f,onMouseOver:ne?null:this.focusLectureWithHover,onMouseOut:ne?null:this.unfocusLectureWithHover,onClick:ne?null:this.focusLectureWithClick,deleteLecture:this.deleteLectureFromTimetable,occupiedIndices:ne&&!B?this._getOccupiedTimes(K.day,K.begin,K.end).map(fe=>[this._getIndexOfMinute(fe[0]),this._getIndexOfMinute(fe[1])]):void 0},K?`${V.id}:${K.day}:${K.begin}`:`${V.id}:no-time`),L=V=>o.from===Ue.LIST&&o.lecture.id===V.id&&!Ml(o.lecture,s),E=w.map(V=>x(V.lecture,V.classtime,!1,void 0,L(V.lecture))),I=R.map((V,K)=>x(V.lecture,V.classtime,!0,K,L(V.lecture))),j=R.map(V=>S(V.classtime)),P=Ve.range(Or,Sc),U=()=>{const V=[c.jsx("div",{className:g("subsection--timetable__table__label__title")},"title"),...P.map(B=>{const ce=B%6===0?"strong":"span";return[c.jsx("div",{className:g("subsection--timetable__table__label__line"),children:c.jsx(ce,{children:(B-1)%12+1})},`line:${B*60}`),c.jsx("div",{className:g("subsection--timetable__table__label__cell")},`cell:${B*60}`),c.jsx("div",{className:g("subsection--timetable__table__label__line")},`line:${B*60+30}`),c.jsx("div",{className:g("subsection--timetable__table__label__cell")},`cell:${B*60+30}`)]}).flat(1),c.jsx("div",{className:g("subsection--timetable__table__label__line"),children:c.jsx("strong",{children:12})},"line:1440")],K=Ve.range(Math.ceil(j.length/5)).map((B,ce)=>[c.jsx("div",{className:g("subsection--timetable__table__label__gap")},"gap"),c.jsx("div",{className:g("subsection--timetable__table__label__title")},"title"),c.jsx("div",{className:g("subsection--timetable__table__label__line")},"line:1"),c.jsx("div",{className:g("subsection--timetable__table__label__cell")},"cell:1"),c.jsx("div",{className:g("subsection--timetable__table__label__line")},"line:2"),c.jsx("div",{className:g("subsection--timetable__table__label__cell")},"cell:2"),c.jsx("div",{className:g("subsection--timetable__table__label__line")},"line:3"),c.jsx("div",{className:g("subsection--timetable__table__label__cell")},"cell:3"),c.jsx("div",{className:g("subsection--timetable__table__label__line")},"line:4")]);return c.jsxs("div",{className:g("subsection--timetable__table__label"),children:[V,K]})},W=V=>{const K=[c.jsx("div",{className:g("subsection--timetable__table__body__title"),children:BS(V)},"title"),...P.map(ce=>[c.jsx("div",{className:g("subsection--timetable__table__body__line",ce%6===0?"subsection--timetable__table__body__line--bold":null)},`line:${ce*60}`),c.jsx("div",{className:g("subsection--timetable__table__body__cell","subsection--timetable__table__body__cell--drag"),"data-day":V,"data-minute":ce*60,onMouseDown:ne=>this.onMouseDown(ne),onTouchStart:ne=>this.onTouchStart(ne),onMouseMove:ne=>this.onMouseMove(ne),onTouchMove:ne=>this.onTouchMove(ne)},`cell:${ce*60}`),c.jsx("div",{className:g("subsection--timetable__table__body__line","subsection--timetable__table__body__line--dashed",f?"subsection--timetable__table__body__line--mobile-noline":null)},`line:${ce*60+30}`),c.jsx("div",{className:g("subsection--timetable__table__body__cell","subsection--timetable__table__body__cell--drag"),"data-day":V,"data-minute":ce*60+30,onMouseDown:ne=>this.onMouseDown(ne),onTouchStart:ne=>this.onTouchStart(ne),onMouseMove:ne=>this.onMouseMove(ne),onTouchMove:ne=>this.onTouchMove(ne)},`cell:${ce*60+30}`)]).flat(1),c.jsx("div",{className:g("subsection--timetable__table__body__line","subsection--timetable__table__body__line--bold")},"line:1440")],B=Ve.range(Math.ceil(j.length/5)).map(ce=>[c.jsx("div",{className:g("subsection--timetable__table__body__gap")},"gap"),c.jsx("div",{className:g("subsection--timetable__table__body__title"),children:j[ce*5+V]},"title"),c.jsx("div",{className:g("subsection--timetable__table__body__line","subsection--timetable__table__body__line--bold")},"line:1"),c.jsx("div",{className:g("subsection--timetable__table__body__cell")},"cell:1"),c.jsx("div",{className:g("subsection--timetable__table__body__line","subsection--timetable__table__body__line--dashed",f?"subsection--timetable__table__body__line--mobile-noline":null)},"line:2"),c.jsx("div",{className:g("subsection--timetable__table__body__cell")},"cell:2"),c.jsx("div",{className:g("subsection--timetable__table__body__line","subsection--timetable__table__body__line--dashed",f?"subsection--timetable__table__body__line--mobile-noline":null)},"line:3"),c.jsx("div",{className:g("subsection--timetable__table__body__cell")},"cell:3"),c.jsx("div",{className:g("subsection--timetable__table__body__line","subsection--timetable__table__body__line--bold")},"line:4")]);return c.jsxs("div",{className:g("subsection--timetable__table__body"),children:[K,B]})},J=r&&i?c.jsx(vte,{dayIndex:Number(r.dataset.day),beginIndex:Math.min(this._getIndexOfMinute(Number(r.dataset.minute)),this._getIndexOfMinute(Number(i.dataset.minute))),endIndex:Math.max(this._getIndexOfMinute(Number(r.dataset.minute)),this._getIndexOfMinute(Number(i.dataset.minute)))+1,cellWidth:l,cellHeight:d}):null;return c.jsxs("div",{className:g("subsection","subsection--timetable"),onMouseUp:V=>this.onMouseUp(V),onTouchEnd:V=>this.onTouchEnd(V),children:[c.jsxs("div",{className:g("subsection--timetable__table"),children:[U(),W(0),W(1),W(2),W(3),W(4)]}),J,E,I]})}}const bte=e=>({user:e.common.user.user,selectedTimetable:e.timetable.timetable.selectedTimetable,lectureFocus:e.timetable.lectureFocus,cellWidth:e.timetable.timetable.cellWidth,cellHeight:e.timetable.timetable.cellHeight,isDragging:e.timetable.timetable.isDragging,isLectureListOpenOnMobile:e.timetable.list.isLectureListOpenOnMobile}),Ste=e=>({updateCellSizeDispatch:(t,n)=>{e(Vee(t,n))},openSearchDispatch:()=>{e($S())},setClasstimeOptionsDispatch:(t,n,r)=>{e(Iee(t,n,r))},clearClasstimeOptionsDispatch:()=>{e(OA())},setIsDraggingDispatch:t=>{e(Gee(t))},setLectureFocusDispatch:(t,n,r)=>{e(qD(t,n,r))},clearLectureFocusDispatch:()=>{e(Gh())},removeLectureFromTimetableDispatch:t=>{e(GA(t))},setSelectedListCodeDispatch:t=>{e(_A(t))},setIsLectureListOpenOnMobileDispatch:t=>{e(FS(t))}});aj.propTypes={user:ht,selectedTimetable:h.oneOfType([Fs,Ji]),lectureFocus:Ca.isRequired,cellWidth:h.number.isRequired,cellHeight:h.number.isRequired,isDragging:h.bool.isRequired,isLectureListOpenOnMobile:h.bool.isRequired,updateCellSizeDispatch:h.func.isRequired,openSearchDispatch:h.func.isRequired,setClasstimeOptionsDispatch:h.func.isRequired,clearClasstimeOptionsDispatch:h.func.isRequired,setIsDraggingDispatch:h.func.isRequired,setLectureFocusDispatch:h.func.isRequired,clearLectureFocusDispatch:h.func.isRequired,removeLectureFromTimetableDispatch:h.func.isRequired,setSelectedListCodeDispatch:h.func.isRequired,setIsLectureListOpenOnMobileDispatch:h.func.isRequired};const xte=de()(Pe(bte,Ste)(aj)),wte="/assets/kaist_map-70258a52.jpg",Tte=new Map([["E2",{left:60,top:81}],["E3",{left:67,top:75}],["E6",{left:68,top:63}],["E6-5",{left:63,top:56}],["E7",{left:77,top:61}],["E11",{left:53,top:58}],["E16",{left:53,top:49}],["N1",{left:88,top:39}],["N3",{left:53,top:45}],["N4",{left:62,top:41}],["N5",{left:74,top:39}],["N7",{left:33,top:41}],["N22",{left:79,top:35}],["N24",{left:76,top:31}],["N25",{left:59,top:36}],["N27",{left:57,top:24}],["W1",{left:31,top:84}],["W8",{left:35,top:55}],["W16",{left:40,top:87}]]);class lj extends X.Component{constructor(n){super(n);N(this,"_getLecturesOnBuilding",n=>{const{lectureFocus:r,selectedTimetable:i}=this.props;return Os(i,r).filter(s=>GR(s)===n)});N(this,"setFocusOnMap",n=>{const{t:r}=this.props,{lectureFocus:i,selectedTimetable:s,setMultipleFocusDispatch:o}=this.props;if(i.from!==Ue.NONE||!s)return;const d=this._getLecturesOnBuilding(n).map(f=>({lecture:f,name:f[r("js.property.title")],info:HZ(f)}));o(n,d),this.setState({multipleFocusBuilding:n})});N(this,"clearFocus",()=>{const{lectureFocus:n,clearMultipleFocusDispatch:r}=this.props;n.from===Ue.MULTIPLE&&(r(),this.setState({multipleFocusBuilding:null}))});this.state={multipleFocusBuilding:null}}render(){const{multipleFocusBuilding:n}=this.state,{selectedTimetable:r,lectureFocus:i}=this.props,s=OS(Os(r,i).map(l=>GR(l))),o=l=>{if(!l)return null;const d=this._getLecturesOnBuilding(l),f=d.some(_=>Yp(_,i))||n===l,m=Tte.get(l)||{};return c.jsxs("div",{className:g("subsection--map__pin"),onMouseOver:()=>this.setFocusOnMap(l),onMouseOut:()=>this.clearFocus(),style:{left:`${m.left}%`,top:`${m.top}%`,zIndex:m.top},children:[c.jsxs("div",{className:g("subsection--map__pin__box",f?"highlighted":null),children:[c.jsx("span",{children:l}),d.map(_=>{const y=Yp(_,i)||n===l;return c.jsx("span",{className:g("background-color--dark",`background-color--${CS(_)}`,y?"highlighted":null)},_.id)})]}),c.jsx("div",{className:g("subsection--map__pin__arrow-shadow",f?"highlighted":null)}),c.jsx("div",{className:g("subsection--map__pin__arrow",f?"highlighted":null)})]},l)};return c.jsx("div",{className:g("subsection","subsection--map","mobile-hidden"),children:c.jsxs("div",{children:[c.jsx("img",{src:wte,alt:"KAIST Map"}),s.map(l=>o(l))]})})}}const Rte=e=>({selectedTimetable:e.timetable.timetable.selectedTimetable,lectureFocus:e.timetable.lectureFocus}),kte=e=>({setMultipleFocusDispatch:(t,n)=>{e(kS(t,n))},clearMultipleFocusDispatch:()=>{e(ES())}});lj.propTypes={selectedTimetable:h.oneOfType([Fs,Ji]),lectureFocus:Ca.isRequired,setMultipleFocusDispatch:h.func.isRequired,clearMultipleFocusDispatch:h.func.isRequired};const Ete=de()(Pe(Rte,kte)(lj)),uj=["Basic Required","Basic Elective","Major Required","Major Elective","Humanities & Social Elective"],ju=e=>{const t=uj.findIndex(n=>e.startsWith(n));return t===-1?5:t},P_=e=>e===5?"Etc":uj[e];class cj extends X.Component{constructor(n){super(n);N(this,"setFocusOnType",n=>{const{t:r}=this.props,{lectureFocus:i,selectedTimetable:s,setMultipleFocusDispatch:o}=this.props;if(i.from!==Ue.NONE||!s)return;const l=Os(s,i).filter(d=>ju(d.type_en)===ju(n)).map(d=>({lecture:d,name:d[r("js.property.title")],info:d.credit>0?r("ui.others.creditCount",{count:d.credit}):r("ui.others.auCount",{count:d.credit_au})}));o(n,l),this.setState({multipleFocusCode:n})});N(this,"setFocusOnCredit",n=>{const{t:r}=this.props,{lectureFocus:i,selectedTimetable:s,setMultipleFocusDispatch:o}=this.props;if(i.from!==Ue.NONE||!s)return;const l=n==="Credit"?Os(s,i).filter(d=>d.credit>0).map(d=>({lecture:d,name:d[r("js.property.title")],info:r("ui.others.creditCount",{count:d.credit})})):n==="Credit AU"?Os(s,i).filter(d=>d.credit_au>0).map(d=>({lecture:d,name:d[r("js.property.title")],info:r("ui.others.auCount",{count:d.credit_au})})):[];o(n,l),this.setState({multipleFocusCode:n})});N(this,"setFocusOnScore",n=>{const{t:r}=this.props,{lectureFocus:i,selectedTimetable:s,setMultipleFocusDispatch:o}=this.props;if(i.from!==Ue.NONE||!s)return;const l=Os(s,i).map(d=>({lecture:d,name:d[r("js.property.title")],info:n==="Grade"?cn(d.grade):n==="Load"?cn(d.load):n==="Speech"?cn(d.speech):"?"}));o(n,l),this.setState({multipleFocusCode:n})});N(this,"clearFocus",()=>{const{lectureFocus:n,clearMultipleFocusDispatch:r}=this.props;n.from===Ue.MULTIPLE&&(r(),this.setState({multipleFocusCode:""}))});this.state={multipleFocusCode:""}}render(){const{t:n}=this.props,{multipleFocusCode:r}=this.state,{selectedTimetable:i,lectureFocus:s}=this.props,o=i?i.lectures:[],l=Os(i,s),d=B=>(s.from===Ue.LIST||s.from===Ue.TABLE)&&ju(s.lecture.type_en)===B,f=B=>r===P_(B),m=[0,1,2,3,4,5].map(B=>{const ce=o.filter(ne=>ju(ne.type_en)===B);return Ve.sumBy(ce,ne=>ne.credit+ne.credit_au)}),_=[0,1,2,3,4,5].map(B=>d(B)?Ml(s.lecture,i)?`(${s.lecture.credit+s.lecture.credit_au})`:`+${s.lecture.credit+s.lecture.credit_au}`:null),y=[0,1,2,3,4,5].map(B=>{const ce=l.filter(ne=>ju(ne.type_en)===B);return Ve.sumBy(ce,ne=>ne.credit+ne.credit_au)}),b=Ve.sumBy(l,B=>B.credit),w=Ve.sumBy(l,B=>B.credit_au),R=s.lecture!==null&&s.lecture.credit>0,S=s.lecture!==null&&s.lecture.credit_au>0,x=r==="Credit",L=r==="Credit AU",E=o.filter(B=>B.review_total_weight>0),I=B=>B.credit+B.credit_au,j=Ve.sumBy(E,B=>I(B)),P=Ve.sumBy(E,B=>B.grade*I(B)),U=Ve.sumBy(E,B=>B.load*I(B)),W=Ve.sumBy(E,B=>B.speech*I(B)),J=r==="Grade",V=r==="Load",K=r==="Speech";return c.jsxs("div",{className:g("subsection--summary"),children:[c.jsxs("div",{className:g("subsection--summary__type"),children:[c.jsx(Ci,{entries:[[0,n("ui.type.basicRequiredShort"),"Basic Required"],[2,n("ui.type.majorRequiredShort"),"Major Required"],[4,n("ui.type.humanitiesSocialElectiveShort"),"Humanities & Social Elective"]].map(([B,ce])=>({name:ce,info:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:g("mobile-hidden",f(B)?"focused":null),children:m[B]}),c.jsx("span",{className:g("mobile-hidden","focused"),children:_[B]}),c.jsx("span",{className:g("desktop-hidden",f(B)||d(B)?"focused":null),children:y[B]})]}),onMouseOver:()=>this.setFocusOnType(P_(B)),onMouseOut:()=>this.clearFocus()})),fixedWidthName:!0}),c.jsx(Ci,{entries:[[1,n("ui.type.basicElectiveShort"),"Basic Elective"],[3,n("ui.type.majorElectiveShort"),"Major Elective"],[5,n("ui.type.etcShort"),"Etc"]].map(([B,ce])=>({name:ce,info:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:g("mobile-hidden",f(B)?"focused":null),children:m[B]}),c.jsx("span",{className:g("mobile-hidden","focused"),children:_[B]}),c.jsx("span",{className:g("desktop-hidden",f(B)||d(B)?"focused":null),children:y[B]})]}),onMouseOver:()=>this.setFocusOnType(P_(B)),onMouseOut:()=>this.clearFocus()})),fixedWidthName:!0})]}),c.jsx(ni,{entries:[{name:n("ui.score.credit"),score:c.jsx("span",{className:g(R||x?"focused":null),children:b}),onMouseOver:()=>this.setFocusOnCredit("Credit"),onMouseOut:()=>this.clearFocus()},{name:n("ui.score.au"),score:c.jsx("span",{className:g(S||L?"focused":null),children:w}),onMouseOver:()=>this.setFocusOnCredit("Credit AU"),onMouseOut:()=>this.clearFocus()}]}),c.jsx(ni,{entries:[{name:n("ui.score.grade"),score:c.jsx("span",{className:g(J?"focused":null),children:j!==0?cn(P/j):"?"}),onMouseOver:()=>this.setFocusOnScore("Grade"),onMouseOut:()=>this.clearFocus()},{name:n("ui.score.load"),score:c.jsx("span",{className:g(V?"focused":null),children:j!==0?cn(U/j):"?"}),onMouseOver:()=>this.setFocusOnScore("Load"),onMouseOut:()=>this.clearFocus()},{name:n("ui.score.speech"),score:c.jsx("span",{className:g(K?"focused":null),children:j!==0?cn(W/j):"?"}),onMouseOver:()=>this.setFocusOnScore("Speech"),onMouseOut:()=>this.clearFocus()}]})]})}}const Cte=e=>({selectedTimetable:e.timetable.timetable.selectedTimetable,lectureFocus:e.timetable.lectureFocus}),Ote=e=>({setMultipleFocusDispatch:(t,n)=>{e(kS(t,n))},clearMultipleFocusDispatch:()=>{e(ES())}});cj.propTypes={selectedTimetable:h.oneOfType([Fs,Ji]),lectureFocus:Ca.isRequired,setMultipleFocusDispatch:h.func.isRequired,clearMultipleFocusDispatch:h.func.isRequired};const Pte=de()(Pe(Cte,Ote)(cj));class dj extends X.Component{constructor(n){super(n);N(this,"_getOverallLecEtPairs",()=>{const{lectureFocus:n,selectedTimetable:r}=this.props;return Os(r,n).map(i=>i.examtimes.map(s=>({lecture:i,examtime:s}))).flat(1)});N(this,"_getLecEtPairsOnDay",n=>this._getOverallLecEtPairs().filter(r=>r.examtime.day===n));N(this,"setFocusOnExam",n=>{const{t:r}=this.props,{lectureFocus:i,selectedTimetable:s,setMultipleFocusDispatch:o}=this.props;if(i.from!==Ue.NONE||!s)return;const d=this._getLecEtPairsOnDay(n).map(f=>({lecture:f.lecture,name:f.lecture[r("js.property.title")],info:zR(f.examtime)}));o(r("ui.others.examOfDay",{day:BS(n)}),d),this.setState({multipleFocusDayIndex:n})});N(this,"clearFocus",()=>{const{lectureFocus:n,clearMultipleFocusDispatch:r}=this.props;n.from===Ue.MULTIPLE&&(r(),this.setState({multipleFocusDayIndex:null}))});this.state={multipleFocusDayIndex:null}}render(){const{t:n}=this.props,{multipleFocusDayIndex:r}=this.state,{lectureFocus:i}=this.props,s=o=>{const l=Yp(o.lecture,i)||r===o.examtime.day;return c.jsxs("li",{className:g(l?"focused":null),children:[c.jsx("div",{children:o.lecture[n("js.property.title")]}),c.jsx("div",{children:zR(o.examtime)})]},o.lecture.id)};return c.jsxs("div",{className:g("subsection--exam","mobile-hidden"),children:[c.jsx("div",{className:g("subsection--exam__title"),children:c.jsx("span",{children:n("ui.title.exams")})}),c.jsx("div",{className:g("subsection--exam__content"),children:c.jsxs(ct,{children:[c.jsxs("div",{className:g("subsection--exam__content__day"),onMouseOver:()=>this.setFocusOnExam(0),onMouseOut:()=>this.clearFocus(),children:[c.jsx("div",{className:g(n("jsx.className.fixedByLang")),children:n("ui.day.mondayShort")}),c.jsx("ul",{children:this._getLecEtPairsOnDay(0).map(o=>s(o))})]}),c.jsxs("div",{className:g("subsection--exam__content__day"),onMouseOver:()=>this.setFocusOnExam(1),onMouseOut:()=>this.clearFocus(),children:[c.jsx("div",{className:g(n("jsx.className.fixedByLang")),children:n("ui.day.tuesdayShort")}),c.jsx("ul",{children:this._getLecEtPairsOnDay(1).map(o=>s(o))})]}),c.jsxs("div",{className:g("subsection--exam__content__day"),onMouseOver:()=>this.setFocusOnExam(2),onMouseOut:()=>this.clearFocus(),children:[c.jsx("div",{className:g(n("jsx.className.fixedByLang")),children:n("ui.day.wednesdayShort")}),c.jsx("ul",{children:this._getLecEtPairsOnDay(2).map(o=>s(o))})]}),c.jsxs("div",{className:g("subsection--exam__content__day"),onMouseOver:()=>this.setFocusOnExam(3),onMouseOut:()=>this.clearFocus(),children:[c.jsx("div",{className:g(n("jsx.className.fixedByLang")),children:n("ui.day.thursdayShort")}),c.jsx("ul",{children:this._getLecEtPairsOnDay(3).map(o=>s(o))})]}),c.jsxs("div",{className:g("subsection--exam__content__day"),onMouseOver:()=>this.setFocusOnExam(4),onMouseOut:()=>this.clearFocus(),children:[c.jsx("div",{className:g(n("jsx.className.fixedByLang")),children:n("ui.day.fridayShort")}),c.jsx("ul",{children:this._getLecEtPairsOnDay(4).map(o=>s(o))})]})]})})]})}}const Lte=e=>({selectedTimetable:e.timetable.timetable.selectedTimetable,lectureFocus:e.timetable.lectureFocus}),Dte=e=>({setMultipleFocusDispatch:(t,n)=>{e(kS(t,n))},clearMultipleFocusDispatch:()=>{e(ES())}});dj.propTypes={selectedTimetable:h.oneOfType([Fs,Ji]),lectureFocus:Ca.isRequired,setMultipleFocusDispatch:h.func.isRequired,clearMultipleFocusDispatch:h.func.isRequired};const Nte=de()(Pe(Lte,Dte)(dj));class fj extends X.Component{render(){const{t,i18n:n}=this.props,{selectedTimetable:r,year:i,semester:s,user:o,isLectureListOpenOnMobile:l,setIsTimetableTabsOpenOnMobileDispatch:d,setIsLectureListOpenOnMobileDispatch:f}=this.props,m=r?`timetable=${r.id}&year=${i}&semester=${s}&language=${n.language}`:"";return c.jsxs("div",{className:g("subsection--share",l?"mobile-hidden":null),children:[c.jsx("div",{children:o&&r&&i&&s?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:g("subsection--share__item"),children:c.jsxs("a",{href:`/api/share/timetable/image?${m}`,download:!0,children:[c.jsx("i",{className:g("icon","icon--share-image")}),c.jsx("span",{children:t("ui.button.shareImage")})]})}),c.jsx("div",{className:g("subsection--share__item"),children:c.jsxs("a",{href:`/api/share/timetable/ical?${m}`,download:!0,children:[c.jsx("i",{className:g("icon","icon--share-icalendar")}),c.jsx("span",{children:t("ui.button.shareCalendar")})]})}),c.jsx(Ce,{className:g("divider"),orientation:Ce.Orientation.HORIZONTAL,isVisible:{desktop:!0,mobile:!1}}),c.jsx("div",{className:g("subsection--share__item"),children:c.jsxs(Et,{to:{pathname:"/timetable/syllabus",search:Ut.stringify({timetable:r.id,year:i,semester:s})},target:"_blank",rel:"noopener noreferrer",children:[c.jsx("i",{className:g("icon","icon--share-syllabus")}),c.jsx("span",{children:t("ui.button.openSyllabus")})]})})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:g("subsection--share__item"),children:c.jsxs("span",{className:g("disabled"),children:[c.jsx("i",{className:g("icon","icon--share-image")}),c.jsx("span",{children:t("ui.button.shareImage")})]})}),c.jsx("div",{className:g("subsection--share__item"),children:c.jsxs("span",{className:g("disabled"),children:[c.jsx("i",{className:g("icon","icon--share-icalendar")}),c.jsx("span",{children:t("ui.button.shareCalendar")})]})}),c.jsx(Ce,{className:g("divider"),orientation:Ce.Orientation.HORIZONTAL,isVisible:{desktop:!0,mobile:!1}}),c.jsx("div",{className:g("subsection--share__item"),children:c.jsxs("span",{className:g("disabled"),children:[c.jsx("i",{className:g("icon","icon--share-syllabus")}),c.jsx("span",{children:t("ui.button.openSyllabus")})]})})]})}),c.jsxs("div",{children:[c.jsxs("button",{onClick:()=>d(!0),className:g("text-button","text-button--black"),children:[c.jsx("i",{className:g("icon","icon--switch-table")}),c.jsx("span",{children:t("ui.button.switchTable")})]}),c.jsxs("button",{onClick:()=>f(!0),className:g("text-button","text-button--black"),children:[c.jsx("i",{className:g("icon","icon--show-lectures")}),c.jsx("span",{children:t("ui.button.showLectures")})]})]}),c.jsx("div",{})]})}}const Ate=e=>({selectedTimetable:e.timetable.timetable.selectedTimetable,isLectureListOpenOnMobile:e.timetable.list.isLectureListOpenOnMobile,year:e.timetable.semester.year,semester:e.timetable.semester.semester,user:e.common.user.user}),jte=e=>({setIsTimetableTabsOpenOnMobileDispatch:t=>{e(qS(t))},setIsLectureListOpenOnMobileDispatch:t=>{e(FS(t))}});fj.propTypes={selectedTimetable:h.oneOfType([Fs,Ji]),isLectureListOpenOnMobile:h.bool.isRequired,year:h.number,semester:h.oneOf([1,2,3,4]),user:ht,setIsTimetableTabsOpenOnMobileDispatch:h.func.isRequired,setIsLectureListOpenOnMobileDispatch:h.func.isRequired};const Ite=de()(Pe(Ate,jte)(fj));class pj extends X.Component{componentDidMount(){const{startInMyTable:t}=this.props.location.state||{},{user:n,myTimetable:r,setSelectedTimetableDispatch:i}=this.props;t&&n&&i(r)}componentWillUnmount(){const{resetLectureFocusDispatch:t,resetListDispatch:n,resetSearchDispatch:r,resetSemesterDispatch:i,resetTimetableDispatch:s}=this.props;t(),n(),r(),i(),s()}render(){const{startSemester:t}=this.props.location.state||{},{isPortrait:n,isTimetableTabsOpenOnMobile:r,isLectureListOpenOnMobile:i,setIsTimetableTabsOpenOnMobileDispatch:s}=this.props;return c.jsx(c.Fragment,{children:c.jsx("section",{className:g("content","content--no-scroll"),children:c.jsxs("div",{className:g("page-grid","page-grid--timetable",i?"page-grid--timetable--mobile-expanded":null),children:[c.jsx(Jee,{}),c.jsx(nte,{}),c.jsx(dte,{}),c.jsxs("div",{className:g("section","section--semester-and-timetable-list",!n&&"section--transparent",n&&"section--modal",r?null:"mobile-hidden"),children:[c.jsx(Fr,{onClick:()=>s(!1)}),c.jsx(hte,{}),c.jsx(_te,{startSemester:t})]}),c.jsxs("div",{className:g("section","section--timetable-and-infos"),children:[c.jsx(xte,{}),c.jsx(Ce,{orientation:{desktop:Ce.Orientation.VERTICAL,mobile:Ce.Orientation.HORIZONTAL},isVisible:!0,gridArea:"divider-main"}),c.jsx(Ete,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:{desktop:!0,mobile:!1},gridArea:"divider-sub-1"}),c.jsx(Pte,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:{desktop:!0,mobile:!1},gridArea:"divider-sub-2"}),c.jsx(Nte,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:{desktop:!0,mobile:!i},gridArea:"divider-sub-3"}),c.jsx(Ite,{})]})]})})})}}const Mte=e=>({user:e.common.user.user,isPortrait:e.common.media.isPortrait,myTimetable:e.timetable.timetable.myTimetable,isTimetableTabsOpenOnMobile:e.timetable.timetable.isTimetableTabsOpenOnMobile,isLectureListOpenOnMobile:e.timetable.list.isLectureListOpenOnMobile}),Fte=e=>({setSelectedTimetableDispatch:t=>{e(XA(t))},resetLectureFocusDispatch:()=>{e(NZ())},resetListDispatch:()=>{e(Dee())},resetSearchDispatch:()=>{e(jee())},resetSemesterDispatch:()=>{e(Mee())},resetTimetableDispatch:()=>{e($ee())},setIsTimetableTabsOpenOnMobileDispatch:t=>{e(qS(t))}});pj.propTypes={location:h.shape({state:h.shape({startSemester:Zi,startInMyTable:h.bool})}).isRequired,user:ht,isPortrait:h.bool.isRequired,myTimetable:Ji.isRequired,isTimetableTabsOpenOnMobile:h.bool.isRequired,isLectureListOpenOnMobile:h.bool.isRequired,setSelectedTimetableDispatch:h.func.isRequired,resetLectureFocusDispatch:h.func.isRequired,resetListDispatch:h.func.isRequired,resetSearchDispatch:h.func.isRequired,resetSemesterDispatch:h.func.isRequired,resetTimetableDispatch:h.func.isRequired,setIsTimetableTabsOpenOnMobileDispatch:h.func.isRequired};const $te=Pe(Mte,Fte)(pj);class hj extends X.Component{render(){const{t}=this.props,{user:n}=this.props,r=n?n.review_writable_lectures:[],i=n?n.reviews.filter(s=>r.some(o=>o.id===s.lecture.id)):[];return c.jsxs("div",{className:g("subsection","subsection--my-summary"),children:[c.jsx("div",{className:g("title"),children:t("ui.title.takenLectures")}),c.jsx(ni,{entries:[{name:t("ui.score.reviewsWritten"),score:c.jsxs(c.Fragment,{children:[c.jsx("span",{children:n?i.length:"-"}),c.jsx("span",{children:n?`/${r.length}`:"/-"})]})},{name:t("ui.score.likes"),score:n?Ve.sumBy(i,s=>s.like):"-"}]})]})}}const qte=e=>({user:e.common.user.user}),Ute=e=>({});hj.propTypes={user:ht};const Bte=de()(Pe(qte,Ute)(hj)),mj=({t:e,lecture:t,isRaised:n,isDimmed:r,hasReview:i,onClick:s})=>{const o=s?l=>{s(t)}:null;return c.jsxs("div",{className:g("block","block--lecture-simple",s?"block--clickable":null,n?"block--raised":null,r?"block--dimmed":null,i?"block--completed":null),onClick:o,children:[c.jsx("div",{className:g("block__completed-text"),children:e("ui.others.written")}),c.jsx("div",{className:g("block--lecture-simple__title"),children:t[e("js.property.title")]}),c.jsx("div",{className:g("block--lecture-simple__subtitle"),children:t.old_code})]})};mj.propTypes={lecture:Yt.isRequired,isRaised:h.bool.isRequired,isDimmed:h.bool.isRequired,hasReview:h.bool.isRequired,onClick:h.func.isRequired};const nk=de()(xe.memo(mj)),Jh="WR_RF_",gj=Jh+"RESET",_j=Jh+"SET_REVIEWS_FOCUS",yj=Jh+"CLEAR_REVIEWS_FOCUS",vj=Jh+"SET_REVIEWS";function Hte(){return{type:gj}}function WS(e,t){return{type:_j,from:e,lecture:t}}function nu(){return{type:yj}}function Wte(e){return{type:vj,reviews:e}}const xt={NONE:"NONE",LECTURE:"LECTURE",REVIEWS_LATEST:"LATEST",REVIEWS_MY:"MY",REVIEWS_LIKED:"LIKED",REVIEWS_RANKED:"RANKED"},rk={from:xt.NONE,lecture:null,reviews:null},Yte=(e=rk,t)=>{switch(t.type){case gj:return rk;case _j:return Object.assign({},e,{from:t.from,lecture:t.lecture,reviews:null});case yj:return Object.assign({},e,{from:xt.NONE,lecture:null,reviews:null});case vj:return Object.assign({},e,{reviews:t.reviews});default:return e}};class bj extends X.Component{constructor(){super(...arguments);N(this,"focusLectureWithClick",n=>{const{selectedLecture:r,setReviewsFocusDispatch:i,clearReviewsFocusDispatch:s}=this.props;r&&n.id===r.id?(s(),Je.event({category:"Write Reviews - Selection",action:"Selected Lecture",label:`Lecture : ${n.id}`})):(i(xt.LECTURE,n),Je.event({category:"Write Reviews - Selection",action:"Unelected Lecture",label:`Lecture : ${n.id}`}))})}render(){const{t:n}=this.props,{user:r,selectedLecture:i}=this.props,s=r?r.review_writable_lectures:[],o=OS(s.map(d=>({year:d.year,semester:d.semester})),(d,f)=>d.year===f.year&&d.semester===f.semester).sort((d,f)=>d.year!==f.year?f.year-d.year:f.semester-d.semester),l=()=>r?o.length===0?c.jsx("div",{className:g("list-placeholder"),children:n("ui.placeholder.noResults")}):c.jsx(ct,{expandTop:12,children:o.map((d,f)=>c.jsxs(xe.Fragment,{children:[f!==0?c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}):null,c.jsx("div",{className:g("small-title"),children:`${d.year} ${ar(d.semester)}`}),c.jsx("div",{className:g("block-grid"),children:s.filter(m=>m.year===d.year&&m.semester===d.semester).map(m=>i?c.jsx(nk,{lecture:m,isRaised:i.id===m.id,isDimmed:i.id!==m.id,hasReview:r.reviews.some(_=>_.lecture.id===m.id),onClick:this.focusLectureWithClick},m.id):c.jsx(nk,{lecture:m,isRaised:!1,isDimmed:!1,hasReview:r.reviews.some(_=>_.lecture.id===m.id),onClick:this.focusLectureWithClick},m.id))})]},`${d.year}-${d.semester}`))}):c.jsx("div",{className:g("list-placeholder"),children:n("ui.placeholder.loginRequired")});return c.jsx("div",{className:g("subsection","subsection--taken-lectures"),children:l()})}}const zte=e=>({user:e.common.user.user,selectedLecture:e.writeReviews.reviewsFocus.lecture}),Vte=e=>({setReviewsFocusDispatch:(t,n)=>{e(WS(t,n))},clearReviewsFocusDispatch:()=>{e(nu())}});bj.propTypes={user:ht,selectedLecture:Yt,setReviewsFocusDispatch:h.func.isRequired,clearReviewsFocusDispatch:h.func.isRequired};const Gte=de()(Pe(zte,Vte)(bj)),Oa=h.oneOfType([h.exact({from:h.oneOf([xt.NONE]).isRequired,lecture:h.oneOf([null]),reviews:h.oneOf([null])}),h.exact({from:h.oneOf([xt.LECTURE]).isRequired,lecture:Yt.isRequired,reviews:h.arrayOf(pn)}),h.exact({from:h.oneOf([xt.REVIEWS_LATEST,xt.REVIEWS_MY,xt.REVIEWS_LIKED,xt.REVIEWS_RANKED]).isRequired,lecture:h.oneOf([null]),reviews:h.arrayOf(pn)})]);class Sj extends X.Component{constructor(){super(...arguments);N(this,"handleMenuClick",n=>r=>{const{setReviewsFocusDispatch:i}=this.props;i(n,null),Je.event({category:"Write Reviews - Selection",action:"Selected List",label:`List : ${n}`})})}render(){const{t:n}=this.props,{user:r,reviewsFocus:i}=this.props;return c.jsxs("div",{className:g("subsection","subsection--reviews-menus"),children:[c.jsx("div",{children:c.jsx("button",{className:g("text-button",i.from===xt.REVIEWS_LATEST?"text-button--disabled":null),onClick:this.handleMenuClick(xt.REVIEWS_LATEST),children:n("ui.title.latestReviews")})}),c.jsx("div",{children:c.jsx("button",{className:g("text-button",i.from===xt.REVIEWS_RANKED?"text-button--disabled":null),onClick:this.handleMenuClick(xt.REVIEWS_RANKED),children:n("ui.title.rankedReviews")})}),c.jsx("div",{children:c.jsx("button",{className:g("text-button",!r||i.from===xt.REVIEWS_MY?"text-button--disabled":null),onClick:this.handleMenuClick(xt.REVIEWS_MY),children:n("ui.title.myReviews")})}),c.jsx("div",{children:c.jsx("button",{className:g("text-button",!r||i.from===xt.REVIEWS_LIKED?"text-button--disabled":null),onClick:this.handleMenuClick(xt.REVIEWS_LIKED),children:n("ui.title.likedReviews")})})]})}}const Xte=e=>({user:e.common.user.user,reviewsFocus:e.writeReviews.reviewsFocus}),Kte=e=>({setReviewsFocusDispatch:(t,n)=>{e(WS(t,n))}});Sj.propTypes={user:ht,reviewsFocus:Oa.isRequired,setReviewsFocusDispatch:h.func.isRequired};const Qte=de()(Pe(Xte,Kte)(Sj)),YS="WR_LR_",xj=YS+"RESET",wj=YS+"ADD_REVIEWS",Tj=YS+"UPDATE_REVIEW";function Zte(){return{type:xj}}function Jte(e){return{type:wj,reviews:e}}function ene(e,t){return{type:Tj,review:e,isNew:t}}class Rj extends X.Component{constructor(){super(...arguments);N(this,"_fetchLectureRelatedReviews",()=>{const{reviewsFocus:n,setReviewsDispatch:r}=this.props;me.get(`/api/lectures/${n.lecture.id}/related-reviews`,{params:{order:["-written_datetime","-id"]},metadata:{gaCategory:"Course",gaVariable:"GET Reviews / Instance"}}).then(i=>{const s=this.props;!s.reviewsFocus.lecture||s.reviewsFocus.lecture.id!==n.lecture.id||r(i.data)}).catch(i=>{})});N(this,"updateOnReviewSubmit",(n,r)=>{const{updateUserReviewDispatch:i,UpdateLatestReviewDispatch:s}=this.props;i(n),s(n,r)});N(this,"unfix",()=>{const{clearReviewsFocusDispatch:n}=this.props;n()})}componentDidMount(){this._fetchLectureRelatedReviews()}componentDidUpdate(n){const{reviewsFocus:r}=this.props;n.reviewsFocus.lecture.id!==r.lecture.id&&this._fetchLectureRelatedReviews()}render(){const{t:n}=this.props,{user:r,reviewsFocus:i}=this.props,s=i.lecture,o=i.reviews,l=o==null?c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.loading")})}):o.length?c.jsx("div",{className:g("block-list","min-height-area"),children:o.map(d=>c.jsx(Ni,{review:d,shouldLimitLines:!1,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:d.course.id})},pageFrom:"Write Reviews"},d.id))}):c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})});return c.jsxs("div",{className:g("subsection","subsection--flex","subsection--various-reviews"),children:[c.jsx(Fr,{onClick:this.unfix}),c.jsxs(ct,{expandTop:12,children:[c.jsx("div",{className:g("title"),children:`${n("ui.title.writeReview")} - ${s[n("js.property.title")]}`}),c.jsx(PS,{lecture:s,review:r.reviews.find(d=>d.lecture.id===s.id),pageFrom:"Write Reviews",updateOnSubmit:this.updateOnReviewSubmit},s.id),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx("div",{className:g("title"),children:`${n("ui.title.relatedReviews")} - ${i.lecture[n("js.property.title")]}`}),l]},i.lecture.id)]})}}const tne=e=>({user:e.common.user.user,reviewsFocus:e.writeReviews.reviewsFocus}),nne=e=>({setReviewsDispatch:t=>{e(Wte(t))},updateUserReviewDispatch:t=>{e(LS(t))},UpdateLatestReviewDispatch:(t,n)=>{e(ene(t,n))},clearReviewsFocusDispatch:()=>{e(nu())}});Rj.propTypes={user:ht,reviewsFocus:Oa.isRequired,setReviewsDispatch:h.func.isRequired,updateUserReviewDispatch:h.func.isRequired,UpdateLatestReviewDispatch:h.func.isRequired,clearReviewsFocusDispatch:h.func.isRequired};const rne=de()(Pe(tne,nne)(Rj));class kj extends X.Component{constructor(n){super(n);N(this,"_fetchLatestReviews",()=>{const{latestReviews:n,addReviewsDispatch:r}=this.props,{isLoading:i}=this.state,s=10;if(i)return;const o=(n||[]).length;this.setState({isLoading:!0}),me.get("/api/reviews",{params:{order:["-written_datetime","-id"],offset:o,limit:s},metadata:{gaCategory:"Review",gaVariable:"GET Latest / List"}}).then(l=>{this.setState(d=>({isLoading:!1})),r(l.data)}).catch(l=>{}),o!==0&&Je.event({category:"Write Reviews - Latest Review",action:"Loaded More Review",label:`Review Order : ${o}-${o+s-1}`})});N(this,"handleScroll",()=>{if(!this.blockListRef.current)return;const r=this.blockListRef.current,i=r.closest(".ScrollbarsCustom-Scroller");r.getBoundingClientRect().bottom-i.getBoundingClientRect().bottom<100&&this._fetchLatestReviews()});N(this,"unfix",()=>{const{clearReviewsFocusDispatch:n}=this.props;n()});this.state={isLoading:!1},this.blockListRef=xe.createRef()}componentDidMount(){const{latestReviews:n}=this.props;n==null&&this._fetchLatestReviews()}render(){const{t:n}=this.props,{reviewsFocus:r,latestReviews:i}=this.props,s=i,o=s==null?c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.loading")})}):s.length?c.jsx("div",{className:g("block-list","min-height-area"),ref:this.blockListRef,children:s.map(l=>c.jsx(Ni,{review:l,shouldLimitLines:!1,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:l.course.id})},pageFrom:"Write Reviews"},l.id))}):c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})});return c.jsxs("div",{className:g("subsection","subsection--flex","subsection--various-reviews"),children:[c.jsx(Fr,{onClick:this.unfix}),c.jsxs(ct,{onScroll:this.handleScroll,expandTop:12,children:[c.jsx("div",{className:g("title"),children:n("ui.title.latestReviews")}),o]},r.from)]})}}const ine=e=>({latestReviews:e.writeReviews.latestReviews.reviews,reviewsFocus:e.writeReviews.reviewsFocus}),sne=e=>({addReviewsDispatch:t=>{e(Jte(t))},clearReviewsFocusDispatch:()=>{e(nu())}});kj.propTypes={latestReviews:h.arrayOf(pn),reviewsFocus:Oa.isRequired,addReviewsDispatch:h.func.isRequired,clearReviewsFocusDispatch:h.func.isRequired};const one=de()(Pe(ine,sne)(kj));class Ej extends X.Component{constructor(){super(...arguments);N(this,"unfix",()=>{const{clearReviewsFocusDispatch:n}=this.props;n()})}render(){const{t:n}=this.props,{user:r,reviewsFocus:i}=this.props;if(!r)return null;const s=r.reviews,o=s==null?c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.loading")})}):s.length?c.jsx("div",{className:g("block-list","min-height-area"),children:s.map(l=>c.jsx(Ni,{review:l,shouldLimitLines:!1,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:l.course.id})},pageFrom:"Write Reviews"},l.id))}):c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})});return c.jsxs("div",{className:g("subsection","subsection--flex","subsection--various-reviews"),children:[c.jsx(Fr,{onClick:this.unfix}),c.jsxs(ct,{expandTop:12,children:[c.jsx("div",{className:g("title"),children:n("ui.title.myReviews")}),o]},i.from)]})}}const ane=e=>({user:e.common.user.user,reviewsFocus:e.writeReviews.reviewsFocus}),lne=e=>({clearReviewsFocusDispatch:()=>{e(nu())}});Ej.propTypes={user:ht,reviewsFocus:Oa.isRequired,clearReviewsFocusDispatch:h.func.isRequired};const une=de()(Pe(ane,lne)(Ej)),zS="WR_LkR_",Cj=zS+"RESET",Oj=zS+"SET_REVIEWS",cne=zS+"UPDATE_REVIEW";function dne(){return{type:Cj}}function fne(e){return{type:Oj,reviews:e}}class Pj extends X.Component{constructor(){super(...arguments);N(this,"_fetchLikedReviews",()=>{const{user:n,setReviewsDispatch:r}=this.props;n&&me.get(`/api/users/${n.id}/liked-reviews`,{params:{order:["-written_datetime","-id"]},metadata:{gaCategory:"User",gaVariable:"GET Liked Reviews / Instance"}}).then(i=>{r(i.data)}).catch(i=>{})});N(this,"unfix",()=>{const{clearReviewsFocusDispatch:n}=this.props;n()})}componentDidMount(){const{user:n,likedReviews:r}=this.props;n&&!r&&this._fetchLikedReviews()}componentDidUpdate(n){const{user:r,likedReviews:i}=this.props;r&&!n.user&&!i&&this._fetchLikedReviews()}render(){const{t:n}=this.props,{user:r,reviewsFocus:i,likedReviews:s}=this.props;if(!r)return null;const o=s,l=o==null?c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.loading")})}):o.length?c.jsx("div",{className:g("block-list","min-height-area"),children:o.map(d=>c.jsx(Ni,{review:d,shouldLimitLines:!1,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:d.course.id})},pageFrom:"Write Reviews"},d.id))}):c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})});return c.jsxs("div",{className:g("subsection","subsection--flex","subsection--various-reviews"),children:[c.jsx(Fr,{onClick:this.unfix}),c.jsxs(ct,{expandTop:12,children:[c.jsx("div",{className:g("title"),children:n("ui.title.likedReviews")}),l]},i.from)]})}}const pne=e=>({user:e.common.user.user,reviewsFocus:e.writeReviews.reviewsFocus,likedReviews:e.writeReviews.likedReviews.reviews}),hne=e=>({setReviewsDispatch:t=>{e(fne(t))},clearReviewsFocusDispatch:()=>{e(nu())}});Pj.propTypes={user:ht,reviewsFocus:Oa.isRequired,likedReviews:h.arrayOf(pn),setReviewsDispatch:h.func.isRequired,clearReviewsFocusDispatch:h.func.isRequired};const mne=de()(Pe(pne,hne)(Pj)),Lj=({t:e,semester:t,isRaised:n,onClick:r})=>{const i=r?o=>{r(t)}:null,s=t==="ALL"?e("ui.semester.all"):`${t.year} ${ar(t.semester)}`;return c.jsx("div",{className:g("block","block--semester",r?"block--clickable":null,n?"block--raised":null),onClick:i,children:c.jsx("div",{className:g("block--semester__title"),children:s})})};Lj.propTypes={semester:h.oneOfType([Zi,h.oneOf(["ALL"])]).isRequired,isRaised:h.bool.isRequired,onClick:h.func.isRequired};const ik=de()(xe.memo(Lj)),VS="WR_RR_",Dj=VS+"RESET",Nj=VS+"ADD_SEMESTER_REVIEWS",Aj=VS+"SET_SEMESTER_REVIEW_COUNT";function gne(){return{type:Dj}}function _ne(e,t){return{type:Nj,semester:e,reviews:t}}function yne(e,t){return{type:Aj,semester:e,count:t}}const eo="ALL";class jj extends X.Component{constructor(n){super(n);N(this,"_getTargetSemesters",()=>{const{semesters:n}=this.props,r=new Date;return n.filter(i=>i.year>=2013&&r-new Date(i.gradePosting)>30*24*60*60*1e3)});N(this,"_getSemesterKey",n=>n===eo?"ALL":`${n.year}-${n.semester}`);N(this,"_setStartSemester",()=>{const n=this._getTargetSemesters();this.setState({selectedSemester:n[n.length-1]})});N(this,"_fetchReviewsCount",()=>{const{selectedSemester:n}=this.state,{setSemesterReviewCountDispatch:r}=this.props,i=n===eo?{}:{lecture_year:n.year,lecture_semester:n.semester};me.get("/api/reviews",{params:{...i,response_type:"count"},metadata:{gaCategory:"Review",gaVariable:"GET / List Count"}}).then(s=>{r(this._getSemesterKey(n),s.data)}).catch(s=>{})});N(this,"_fetchRankedReviews",()=>{const{loadingSemesters:n,selectedSemester:r}=this.state,{addSemesterReviewsDispatch:i}=this.props,s=10;if(n.includes(this._getSemesterKey(r)))return;const o=(this._getReviewsOfSemester(r)||[]).length,l=r===eo?{}:{lecture_year:r.year,lecture_semester:r.semester};this.setState({loadingSemesters:n.concat([this._getSemesterKey(r)])}),me.get("/api/reviews",{params:{...l,order:["-like"],offset:o,limit:s},metadata:{gaCategory:"Review",gaVariable:"GET Latest / List"}}).then(d=>{this.setState(f=>({loadingSemesters:f.loadingSemesters.filter(m=>m!==this._getSemesterKey(r))})),i(this._getSemesterKey(r),d.data)}).catch(d=>{}),o!==0&&Je.event({category:"Write Reviews - Ranked Review",action:"Loaded More Review",label:`Semester : ${r.year}-${r.semester} / Review Order : ${o}-${o+s-1}`})});N(this,"_getReviewCountOfSemester",n=>{const{reviewCountBySemester:r}=this.props;return r[this._getSemesterKey(n)]});N(this,"_getReviewsOfSemester",n=>{const{reviewsBySemester:r}=this.props;return r[this._getSemesterKey(n)]||null});N(this,"handleScroll",()=>{if(!this.blockListRef.current)return;const r=this.blockListRef.current,i=r.closest(".ScrollbarsCustom-Scroller");r.getBoundingClientRect().bottom-i.getBoundingClientRect().bottom<100&&this._fetchRankedReviews()});N(this,"unfix",()=>{const{clearReviewsFocusDispatch:n}=this.props;n()});N(this,"selectSemester",n=>{this.setState({selectedSemester:n})});this.state={selectedSemester:eo,loadingSemesters:[]},this.blockListRef=xe.createRef()}componentDidMount(){const{selectedSemester:n}=this.state,{semesters:r}=this.props;r&&this._setStartSemester(),this._getReviewCountOfSemester(n)===void 0&&this._fetchReviewsCount(),this._getReviewsOfSemester(n)===null&&this._fetchRankedReviews()}componentDidUpdate(n,r){const{semesters:i}=this.props,{selectedSemester:s}=this.state;!n.semesters&&i&&this._setStartSemester(),s!==r.selectedSemester&&(this._getReviewCountOfSemester(s)===void 0&&this._fetchReviewsCount(),this._getReviewsOfSemester(s)===null&&this._fetchRankedReviews())}render(){const{t:n}=this.props,{selectedSemester:r}=this.state,{reviewsFocus:i,semesters:s}=this.props,o=s===null?null:[c.jsx(ik,{semester:eo,isRaised:r===eo,onClick:this.selectSemester},eo),this._getTargetSemesters().map(m=>c.jsx(ik,{semester:m,isRaised:r===m,onClick:this.selectSemester},`${m.year}-${m.semester}`))],l=r===eo?n("ui.semester.all"):`${r.year} ${ar(r.semester)}`,d=this._getReviewsOfSemester(r),f=d==null?c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.loading")})}):d.length?c.jsx("div",{className:g("block-list","min-height-area"),ref:this.blockListRef,children:d.map(m=>c.jsx(Ni,{review:m,shouldLimitLines:!1,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:m.course.id})},pageFrom:"Write Reviews"},m.id))}):c.jsx("div",{className:g("list-placeholder","min-height-area"),children:c.jsx("div",{children:n("ui.placeholder.noResults")})});return c.jsxs("div",{className:g("subsection","subsection--flex","subsection--various-reviews"),children:[c.jsx(Fr,{onClick:this.unfix}),c.jsx("div",{className:g("block-grid"),children:o}),c.jsxs(ct,{onScroll:this.handleScroll,children:[c.jsx("div",{className:g("title"),children:`${n("ui.title.rankedReviews")} - ${l}`}),c.jsx(ni,{entries:[{name:n("ui.score.totalReviews"),score:this._getReviewCountOfSemester(r)!==void 0?this._getReviewCountOfSemester(r):"-"}]}),f]},`${i.from}-${this._getSemesterKey(r)}`)]})}}const vne=e=>({semesters:e.common.semester.semesters,reviewsFocus:e.writeReviews.reviewsFocus,reviewsBySemester:e.writeReviews.rankedReviews.reviewsBySemester,reviewCountBySemester:e.writeReviews.rankedReviews.reviewCountBySemester}),bne=e=>({clearReviewsFocusDispatch:()=>{e(nu())},addSemesterReviewsDispatch:(t,n)=>{e(_ne(t,n))},setSemesterReviewCountDispatch:(t,n)=>{e(yne(t,n))}});jj.propTypes={semesters:h.arrayOf(Zi),reviewsFocus:Oa.isRequired,reviewsBySemester:h.objectOf(h.arrayOf(pn)).isRequired,reviewCountBySemester:h.objectOf(h.number).isRequired,clearReviewsFocusDispatch:h.func.isRequired,addSemesterReviewsDispatch:h.func.isRequired,setSemesterReviewCountDispatch:h.func.isRequired};const Sne=de()(Pe(vne,bne)(jj));class Ij extends X.Component{componentDidMount(){const{setReviewsFocusDispatch:t}=this.props,{startList:n}=this.props.location.state||{};n&&t(n,null)}componentWillUnmount(){const{resetReviewsFocusDispatch:t,resetLatestReviewsDispatch:n,resetLikedReviewsDispatch:r,resetRankedReviewsDispatch:i}=this.props;t(),n(),r(),i()}render(){const{isPortrait:t,reviewsFocus:n}=this.props,r=i=>i===xt.NONE?c.jsx("div",{className:g("subsection","subsection--flex","subsection--write-reviews-right"),children:c.jsx(Xh,{})}):i===xt.LECTURE?c.jsx(rne,{}):i===xt.REVIEWS_LATEST?c.jsx(one,{}):i===xt.REVIEWS_MY?c.jsx(une,{}):i===xt.REVIEWS_LIKED?c.jsx(mne,{}):i===xt.REVIEWS_RANKED?c.jsx(Sne,{}):null;return c.jsx(c.Fragment,{children:c.jsx("section",{className:g("content","content--no-scroll"),children:c.jsxs("div",{className:g("page-grid","page-grid--write-reviews"),children:[c.jsxs("div",{className:g("section","section--write-reviews-left"),children:[c.jsx(Bte,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx(Gte,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx(Qte,{})]}),c.jsx("div",{className:g("section","section--write-reviews-right",t&&"section--modal",n.from!==xt.NONE?null:"mobile-hidden"),children:r(n.from)})]})})})}}const xne=e=>({isPortrait:e.common.media.isPortrait,reviewsFocus:e.writeReviews.reviewsFocus}),wne=e=>({setReviewsFocusDispatch:(t,n)=>{e(WS(t,n))},resetReviewsFocusDispatch:()=>{e(Hte())},resetLatestReviewsDispatch:()=>{e(Zte())},resetLikedReviewsDispatch:()=>{e(dne())},resetRankedReviewsDispatch:()=>{e(gne())}});Ij.propTypes={location:h.shape({state:h.shape({startList:h.oneOf(Object.values(xt))})}).isRequired,isPortrait:h.bool.isRequired,reviewsFocus:Oa.isRequired,setReviewsFocusDispatch:h.func.isRequired,resetReviewsFocusDispatch:h.func.isRequired,resetLatestReviewsDispatch:h.func.isRequired,resetLikedReviewsDispatch:h.func.isRequired,resetRankedReviewsDispatch:h.func.isRequired};const Tne=de()(Pe(xne,wne)(Ij));class Mj extends X.Component{constructor(n){super(n);N(this,"_setTimetableLectures",()=>{const{user:n}=this.props,{timetable:r,year:i,semester:s}=this.props.location.state;if(r===-1){const o=n.my_timetable_lectures.filter(l=>l.year===i&&l.semester===s);this.setState({lectures:o,selectedLecture:o[0]})}else me.get(`/api/users/${n.id}/timetables/${r}`,{params:{},metadata:{gaCategory:"Timetable",gaVariable:"GET / Instance"}}).then(o=>{const l=o.data.lectures;this.setState({lectures:l,selectedLecture:l[0]})}).catch(o=>{})});N(this,"updateShowingLecture",n=>{this.setState({selectedLecture:n})});this.state={lectures:void 0,selectedLecture:void 0}}componentDidMount(){const{user:n}=this.props;n&&this._setTimetableLectures()}componentDidUpdate(n,r){const{user:i}=this.props;!n.user&&i&&this._setTimetableLectures()}render(){const{t:n}=this.props,{lectures:r,selectedLecture:i}=this.state,s=r?r.map(l=>c.jsx("div",{className:g("tabs__elem",i===l?"tabs__elem--selected":null),onClick:()=>this.updateShowingLecture(l),children:l[n("js.property.title")]})):c.jsx("div",{className:g("tabs__elem"),style:{pointerEvents:"none"},children:n("ui.placeholder.loading")}),o=r?r.map(l=>c.jsx("iframe",{src:WD(l),title:`syllabus-${l.title}`,style:l.id===i.id?{}:{display:"none"},children:l[n("js.property.title")]},l.id)):null;return c.jsx("section",{className:g("content","content--no-scroll"),children:c.jsxs("div",{className:g("page-grid","page-grid--syllabus"),children:[c.jsx("div",{className:g("tabs","tabs--syllabus"),children:c.jsx(ct,{noScrollX:!1,noScrollY:!0,expandBottom:2,children:s})}),c.jsx("div",{className:g("section","section--syllabus"),children:c.jsx("div",{className:g("subsection","subsection--syllabus"),children:o})})]})})}}const Rne=e=>({user:e.common.user.user}),kne=e=>({});Mj.propTypes={location:h.shape({state:h.shape({timetable:h.number.isRequired,year:h.number.isRequired,semester:h.oneOf([1,2,3,4]).isRequired}).isRequired}).isRequired,user:ht};const Ene=de()(Pe(Rne,kne)(Mj)),Cne="/assets/SPARCS_black-0409e753.svg";class One extends X.Component{render(){const{t}=this.props;return c.jsx("footer",{children:c.jsxs("div",{className:Zt("content"),children:[c.jsxs("div",{className:Zt("content-left","reverse"),children:[c.jsx("div",{className:Zt("logo"),children:c.jsx("span",{children:c.jsx("a",{href:"http://sparcs.org",target:"_blank",rel:"noopener noreferrer",children:c.jsx("img",{src:Cne,alt:"OTL Logo"})})})}),c.jsxs("div",{className:Zt("menus"),children:[c.jsx("span",{children:c.jsx(Et,{to:"/credits",children:t("ui.menu.credit")})}),c.jsx("span",{children:c.jsx(Et,{to:"/licenses",children:t("ui.menu.licences")})}),c.jsx("span",{children:c.jsx(Et,{to:"/privacy",children:t("ui.menu.privacy")})})]})]}),c.jsx("div",{className:Zt("contact"),children:c.jsx("span",{children:c.jsx("a",{href:`mailto:${xa}`,children:xa})})})]})})}}const Pne=e=>({}),Lne=e=>({}),Dne=de()(Pe(Pne,Lne)(One)),Fj=({t:e,lecture:t,classtime:n,beginIndex:r,endIndex:i,color:s,cellWidth:o,cellHeight:l})=>c.jsx("div",{className:g("tile","tile--horizonatal-timetable",`background-color--${s}`),style:{left:2+o*r+2,top:15+3,width:o*(i-r)-3,height:l-3*2},children:c.jsxs("div",{className:g("tile--horizonatal-timetable__content"),children:[c.jsx("p",{className:g("tile--horizonatal-timetable__content__title"),children:t[e("js.property.title")]}),c.jsx("p",{className:g("tile--horizonatal-timetable__content__info"),children:eu(t)}),c.jsx("p",{className:g("tile--horizonatal-timetable__content__info"),children:n[e("js.property.classroom")]})]})});Fj.propTypes={lecture:Yt.isRequired,classtime:pS,beginIndex:h.number.isRequired,endIndex:h.number.isRequired,color:h.number.isRequired,cellWidth:h.number.isRequired,cellHeight:h.number.isRequired};const Nne=de()(xe.memo(Fj));class $j extends X.Component{constructor(n){super(n);N(this,"setInitialScrollPosition",()=>{const r=this.scrollRef.current.querySelector(".ScrollbarsCustom-Scroller");r.scrollLeft=this._getBarLeftPosition()-58});N(this,"resize",()=>{const n=document.getElementsByClassName(g("subsection--todays-timetable__table__body__cell"))[0].getBoundingClientRect();this.setState({cellWidth:n.width+1,cellHeight:n.height})});N(this,"_getBarLeftPosition",()=>{const{cellWidth:s,now:o}=this.state,l=o.getHours(),d=o.getMinutes(),f=o.getSeconds();return(l+d/60+f/60/60-Or)*s*2+2-(5-1)/2});this.state={cellWidth:0,cellHeight:0,now:new Date},this.scrollRef=xe.createRef()}componentDidMount(){this.resize(),window.addEventListener("resize",this.resize),this.interval=setInterval(()=>this.setState({now:new Date}),100)}componentDidUpdate(n,r){const{cellWidth:i}=this.state;r.cellWidth===0&&i>0&&this.setInitialScrollPosition()}componentWillUnmount(){window.removeEventListener("resize",this.resize),clearInterval(this.interval)}render(){const{t:n}=this.props,{cellWidth:r,cellHeight:i,now:s}=this.state,{user:o,semesters:l}=this.props,d=l?KZ(l):void 0,f=o&&d?o.my_timetable_lectures.filter(_=>_.year===d.year&&_.semester===d.semester):[],m=s.getDay();return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--feed","subsection--todays-timetable"),ref:this.scrollRef,children:[c.jsxs(ct,{noScrollX:!1,noScrollY:!0,children:[c.jsxs("div",{className:g("subsection--todays-timetable__table"),children:[c.jsx("div",{className:g("subsection--todays-timetable__table__label"),children:[...Ve.range(Or,Sc).map(_=>{const y=_%6===0?"strong":"span";return[c.jsx("div",{className:g("subsection--todays-timetable__table__label__line"),children:c.jsx(y,{children:(_-1)%12+1})},`line:${_*60}`),c.jsx("div",{className:g("subsection--todays-timetable__table__label__cell")},`cell:${_*60}`),c.jsx("div",{className:g("subsection--todays-timetable__table__label__line")},`line:${_*60+30}`),c.jsx("div",{className:g("subsection--todays-timetable__table__label__cell")},`cell:${_*60+30}`)]}).flat(1),c.jsx("div",{className:g("subsection--todays-timetable__table__label__line"),children:c.jsx("strong",{children:12})},"line:1440")]}),c.jsx("div",{className:g("subsection--todays-timetable__table__body"),children:[...Ve.range(Or,Sc).map(_=>[c.jsx("div",{className:g("subsection--todays-timetable__table__body__line",_%6===0?"subsection--todays-timetable__table__body__line--bold":null)},`line:${_*60}`),c.jsx("div",{className:g("subsection--todays-timetable__table__body__cell")},`cell:${_*60}`),c.jsx("div",{className:g("subsection--todays-timetable__table__body__line","subsection--todays-timetable__table__body__line--dashed")},`line:${_*60+30}`),c.jsx("div",{className:g("subsection--todays-timetable__table__body__cell")},`cell:${_*60+30}`)]),c.jsx("div",{className:g("subsection--todays-timetable__table__body__line","subsection--todays-timetable__table__body__line--bold")},"line:1440")]})]}),f.map(_=>_.classtimes.filter(y=>y.day===m-1).map(y=>c.jsx(Nne,{lecture:_,classtime:y,beginIndex:y.begin/30-Or*2,endIndex:y.end/30-Or*2,color:CS(_),cellWidth:r,cellHeight:i},`${_.id}:${y.day}:${y.begin}`))),c.jsxs("div",{className:g("subsection--todays-timetable__bar"),style:{top:11+4-2,left:this._getBarLeftPosition()},children:[c.jsx("div",{}),c.jsx("div",{})]})]}),c.jsx("div",{className:g("buttons"),children:c.jsx(Et,{to:{pathname:"/timetable",search:Ut.stringify({startSemester:d,startInMyTable:!0})},className:g("text-button"),children:n("ui.button.seeDetails")})})]})})}}const Ane=e=>({user:e.common.user.user,semesters:e.common.semester.semesters}),jne=e=>({});$j.propTypes={user:ht,semesters:h.arrayOf(Zi)};const Ine=de()(Pe(Ane,jne)($j));class qj extends X.Component{constructor(t){super(t),this.state={now:new Date}}componentDidMount(){this.interval=setInterval(()=>this.setState({now:new Date}),100)}componentWillUnmount(){clearInterval(this.interval)}render(){const{t}=this.props,{now:n}=this.state,{semesters:r}=this.props,i=()=>{if(r==null)return c.jsxs("div",{className:g("academic-schedule","placeholder"),children:[c.jsx("div",{children:t("ui.placeholder.loading")}),c.jsxs("div",{children:[c.jsx("strong",{children:"-"}),c.jsx("span",{children:"-"})]})]});const s=QZ(r);if(!s)return c.jsxs("div",{className:g("academic-schedule","placeholder"),children:[c.jsx("div",{children:t("ui.placeholder.unknown")}),c.jsxs("div",{children:[c.jsx("strong",{children:"-"}),c.jsx("span",{children:"-"})]})]});const o=s.time,l=o-n,d=Math.floor(l/1e3%60),f=Math.floor(l/(1e3*60)%60),m=Math.floor(l/(1e3*60*60)%24),_=Math.floor(l/(1e3*60*60*24));return c.jsxs("div",{className:g("academic-schedule"),children:[c.jsx("div",{children:`D-${t("ui.others.dayCount",{count:_})} ${t("ui.others.hourCount",{count:m})} ${t("ui.others.minuteCount",{count:f})} ${t("ui.others.secondCount",{count:d})}`}),c.jsxs("div",{children:[c.jsx("strong",{children:`${s.year} ${ar(s.semester)} ${t(`ui.schedule.${s.type}`)}`}),c.jsx("span",{children:`${o.getFullYear()}.${o.getMonth()+1}.${o.getDate()}`})]})]})};return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--feed"),children:[i(),c.jsx("div",{className:g("buttons"),children:c.jsx("a",{href:"https://ssogw6.kaist.ac.kr",className:g("text-button"),target:"_blank",rel:"noopener noreferrer",children:t("ui.button.goToAcademicSystem")})})]})})}}const Mne=e=>({semesters:e.common.semester.semesters}),Fne=e=>({});qj.propTypes={semesters:h.arrayOf(Zi)};const $ne=de()(Pe(Mne,Fne)(qj));class Uj extends X.Component{render(){const{t}=this.props,{course:n}=this.props;return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--feed"),children:[c.jsx("div",{className:g("title"),children:`${t("ui.title.relatedCourses")} - ${n[t("js.property.title")]}`}),n.related_courses_posterior.length?n.related_courses_posterior.map(r=>c.jsx(CD,{course:r,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:r.id})}},r.id)):c.jsx("div",{className:g("list-placeholder"),children:c.jsx("div",{children:t("ui.placeholder.unknown")})}),c.jsx("div",{className:g("buttons"),children:c.jsx(Et,{to:{pathname:"/dictionary",search:Ut.stringify({startCourseId:n.id})},className:g("text-button"),children:t("ui.button.seeDetails")})})]})})}}Uj.propTypes={course:ir.isRequired};const qne=de()(Uj);class Une extends X.Component{constructor(n){super(n);N(this,"mapReviewsToElement",n=>{const{t:r}=this.props;return n==null?c.jsx("div",{className:g("list-placeholder"),children:r("ui.placeholder.loading")}):n.length===0?c.jsx("div",{className:g("list-placeholder"),children:r("ui.placeholder.noResults")}):c.jsx("div",{className:g("block-list"),children:n.map(i=>c.jsx(Ni,{review:i,shouldLimitLines:!0,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:i.course.id})},pageFrom:"Main"},i.id))})});this.state={reviews:null}}componentDidMount(){me.get("/api/reviews",{params:{order:["-written_datetime","-id"],offset:0,limit:3},metadata:{gaCategory:"Review",gaVariable:"GET Latest / List"}}).then(n=>{this.setState(r=>({reviews:n.data}))}).catch(n=>{})}render(){const{t:n}=this.props,{reviews:r}=this.state;return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--feed"),children:[c.jsx("div",{className:g("title"),children:n("ui.title.latestReviews")}),this.mapReviewsToElement(r),c.jsx("div",{className:g("buttons"),children:c.jsx(Et,{to:{pathname:"/write-reviews",search:Ut.stringify({startList:xt.REVIEWS_LATEST})},className:g("text-button"),children:n("ui.button.seeMoreReviews")})})]})})}}const Bne=de()(Une);class Bj extends X.Component{render(){const{t}=this.props,{department:n,reviews:r}=this.props;return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--feed"),children:[c.jsx("div",{className:g("title"),children:`${t("ui.title.famousMajorReviews")} - ${n[t("js.property.name")]}`}),c.jsx("div",{className:g("block-list"),children:r.map(i=>c.jsx(Ni,{review:i,shouldLimitLines:!0,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:i.course.id})},pageFrom:"Main"},i.id))}),c.jsx("div",{className:g("buttons"),children:c.jsx(Et,{to:{pathname:"/dictionary",search:Ut.stringify({startTab:n.code})},className:g("text-button"),children:t("ui.button.seeMoreReviews")})})]})})}}Bj.propTypes={department:bi.isRequired,reviews:h.arrayOf(pn).isRequired};const Hne=de()(Bj);class Hj extends X.Component{render(){const{t}=this.props,{reviews:n}=this.props;return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--feed"),children:[c.jsx("div",{className:g("title"),children:t("ui.title.famousHumanityReviews")}),c.jsx("div",{className:g("block-list"),children:n.map(r=>c.jsx(Ni,{review:r,shouldLimitLines:!0,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:r.course.id})},pageFrom:"Main"},r.id))}),c.jsx("div",{className:g("buttons"),children:c.jsx(Et,{to:{pathname:"/dictionary",search:Ut.stringify({startTab:je.HUMANITY})},className:g("text-button"),children:t("ui.button.seeMoreReviews")})})]})})}}Hj.propTypes={reviews:h.arrayOf(pn).isRequired};const Wne=de()(Hj);class Wj extends X.Component{render(){const{t}=this.props,{semester:n,reviews:r}=this.props,i=n?`${n.year} ${ar(n.semester)}`:t("ui.semester.all");return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--feed"),children:[c.jsx("div",{className:g("title"),children:`${t("ui.title.rankedReviews")} - ${i}`}),c.jsx("div",{className:g("block-list"),children:r.map(s=>c.jsx(Ni,{review:s,shouldLimitLines:!0,linkTo:{pathname:"/dictionary",search:Ut.stringify({startCourseId:s.course.id})},pageFrom:"Main"},s.id))}),c.jsx("div",{className:g("buttons"),children:c.jsx(Et,{to:{pathname:"/write-reviews",search:Ut.stringify({startList:xt.REVIEWS_RANKED})},className:g("text-button"),children:t("ui.button.seeMoreReviews")})})]})})}}Wj.propTypes={semester:Zi,reviews:h.arrayOf(pn).isRequired};const Yne=de()(Wj);class Yj extends X.Component{constructor(){super(...arguments);N(this,"updateOnReviewSubmit",(n,r)=>{const{updateUserReviewDispatch:i}=this.props;i(n)})}render(){const{t:n}=this.props,{lecture:r,review:i}=this.props;return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--feed"),children:[c.jsx("div",{className:g("title"),children:`${n("ui.title.writeReview")} - ${r[n("js.property.title")]}`}),c.jsx(PS,{lecture:r,review:i,pageFrom:"Main",updateOnSubmit:this.updateOnReviewSubmit}),c.jsx("div",{className:g("buttons"),children:c.jsx(Et,{to:"/write-reviews",className:g("text-button"),children:n("ui.button.writeMoreReviews")})})]})})}}const zne=e=>({}),Vne=e=>({updateUserReviewDispatch:t=>{e(LS(t))}});Yj.propTypes={review:pn,lecture:Yt.isRequired,updateUserReviewDispatch:h.func.isRequired};const Gne=de()(Pe(zne,Vne)(Yj));class zj extends X.Component{constructor(n){super(n);N(this,"onKeywordChange",n=>{this.setState({keyword:n.target.value})});this.state={keyword:""}}render(){const{t:n}=this.props,{keyword:r}=this.state;return c.jsx("div",{className:g("section","section--main-search"),children:c.jsxs("form",{className:g("subsection","subsection--main-search"),children:[c.jsx("i",{}),c.jsx("input",{type:"text",placeholder:n("ui.tab.search"),onChange:this.onKeywordChange}),c.jsx(Et,{to:{pathname:"/dictionary",search:Ut.stringify({startSearchKeyword:r})},children:c.jsx("button",{className:g("text-button"),type:"submit",children:n("ui.button.search")})})]})})}}zj.propTypes={};const Xne=de()(zj);class Vj extends X.Component{render(){const{notice:t}=this.props,n=VD(t.content);return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--notice"),children:[c.jsx("div",{className:g("title"),children:t.title}),c.jsx("div",{className:g("subsection--notice__content"),children:n})]})})}}Vj.propTypes={notice:h.shape({title:h.string.isRequired,content:h.string.isRequired}).isRequired};const Kne=de()(Vj);class Gj extends X.Component{constructor(n){super(n);N(this,"isRated",()=>{const{rated:n}=this.props,{ratedNow:r}=this.state;return n||r});N(this,"setScore",n=>{this.setState({score:n})});N(this,"submit",()=>{const{score:n}=this.state;this.isRated()||!n||n<1||n>5||(this.setState({ratedNow:!0}),me.post("/api/rates",{score:n},{metadata:{gaCategory:"Review",gaVariable:"POST Like / Instance"}}).then(r=>{}).catch(r=>{}),Je.event({category:"Rate",action:"Created Rate"}))});this.state={ratedNow:!1,score:0}}render(){const{t:n}=this.props,{score:r}=this.state;return c.jsx("div",{className:g("section","section--feed"),children:c.jsxs("div",{className:g("subsection","subsection--feed"),children:[c.jsx("div",{className:g("title"),children:n("ui.title.rateOtl")}),c.jsxs("div",{className:g("rate"),children:[[1,2,3,4,5].map(i=>c.jsx("button",{className:g("rate__star",r>=i&&!this.isRated()?"rate__star--selected":null),onClick:()=>this.setScore(i),children:c.jsx("i",{className:g("icon","icon--star")})},i)),this.isRated()?c.jsx("div",{className:g("rate__overlay","placeholder"),children:n("ui.message.alreadyRated")}):null]}),c.jsx("div",{className:g("buttons"),children:c.jsx("button",{className:g("text-button",this.isRated()?"text-button--disabled":null),onClick:this.submit,children:n("ui.button.submit")})})]})})}}Gj.propTypes={rated:h.bool.isRequired};const Qne=de()(Gj);class Xj extends X.Component{constructor(n){super(n);N(this,"handleScroll",n=>{this._checkAndLoadFeeds()});N(this,"_checkAndLoadFeeds",()=>{const{isLoading:n}=this.state,{user:r}=this.props,i=100;if(n||!r)return;Array.from(this.contentRef.current.querySelectorAll(`.${g("page-grid--main")} > div`)).some(l=>l.lastChild.getBoundingClientRect().top{const{feedDays:n}=this.state,r=new Date(n[n.length-1].date);return r.setDate(r.getDate()-1),r});N(this,"_fetchFeeds",n=>{const{feedDays:r,isLoading:i}=this.state,{user:s}=this.props;if(i||!s||this._getDateDifference(n)>=14)return;this.setState({isLoading:!0});const o=n.toJSON().slice(0,10);me.get(`/api/users/${s.id}/feeds`,{params:{date:o},metadata:{gaCategory:"Feed",gaVariable:"GET / List"}}).then(l=>{this.setState({isLoading:!1,feedDays:[...r,{date:o,feeds:l.data}]}),this._checkAndLoadFeeds()}).catch(l=>{})});N(this,"_fetchNotices",()=>{const n=new Date;me.get("/api/notices",{params:{time:n.toJSON(),order:["start_time","id"]},metadata:{gaCategory:"Notice",gaVariable:"GET / List"}}).then(r=>{this.setState({notices:r.data})}).catch(r=>{})});N(this,"_getDateDifference",n=>{const r=new Date(n),i=new Date;return r.setHours(0,0,0,0),i.setHours(0,0,0,0),(i-r)/(24*60*60*1e3)});this.state={feedDays:[],notices:null,isLoading:!1},this.contentRef=xe.createRef()}componentDidMount(){const{user:n}=this.props;window.addEventListener("scroll",this.handleScroll);const r=new Date;n&&this._fetchFeeds(r),this._fetchNotices()}componentDidUpdate(n,r,i){const{user:s}=this.props,o=new Date;s&&!n.user&&this._fetchFeeds(o)}componentWillUnmount(){window.removeEventListener("scroll",this.handleScroll)}render(){const{t:n}=this.props,{feedDays:r,notices:i}=this.state,{user:s,isPortrait:o}=this.props,l=(m,_)=>m.type==="REVIEW_WRITE"?c.jsx(Gne,{lecture:m.lecture,review:s.reviews.find(y=>y.lecture.id===m.lecture.id)},`${_.date}-${m.type}-${m.lecture.id}`):m.type==="RELATED_COURSE"?c.jsx(qne,{course:m.course},`${_.date}-${m.type}-${m.course.id}`):m.type==="FAMOUS_MAJOR_REVIEW"?c.jsx(Hne,{department:m.department,reviews:m.reviews},`${_.date}-${m.type}-${m.department.code}`):m.type==="FAMOUS_HUMANITY_REVIEW"?c.jsx(Wne,{reviews:m.reviews},`${_.date}-${m.type}`):m.type==="RANKED_REVIEW"?c.jsx(Yne,{semester:m.semester,reviews:m.reviews},`${_.date}-${m.type}`):m.type==="RATE"?c.jsx(Qne,{rated:m.rated},`${_.date}-${m.type}`):null,d=o?1:3,f=[c.jsx(Ine,{},"TODAYS_TIMETABLE"),c.jsx($ne,{},"ACADEMIC_SCHEDULE"),i?i.map(m=>c.jsx(Kne,{notice:m},`${m.start_date}-${m.end_date}-${m.title}`)):[],c.jsx(Bne,{},"LATEST_REVIEW"),s?r.map(m=>m.feeds.map(_=>l(_,m))):[]].flat(3);return c.jsxs(c.Fragment,{children:[c.jsx("section",{className:g("main-image"),children:c.jsx(Xne,{})}),c.jsx("section",{className:g("content"),ref:this.contentRef,children:c.jsxs("div",{className:g("page-grid","page-grid--main"),children:[Ve.range(d).map(m=>c.jsxs("div",{style:{gridArea:`feeds-column-${m+1}`,position:"relative",overflow:"initial",minWidth:0},children:[f.filter((_,y)=>y%d===m),c.jsx("div",{style:{position:"absolute",width:"100%"},children:Ve.range(10).map(_=>c.jsx("div",{className:g("section","section--feed--placeholder")},_))})]},m)),c.jsx("div",{className:g("main-date"),children:s?c.jsx("span",{onClick:()=>this._fetchFeeds(this._getPrevDate()),children:n("ui.button.loadMore")}):c.jsxs(c.Fragment,{children:[c.jsx("a",{href:`/session/login/?next=${window.location.href}`,children:n("ui.button.signInWithSso")}),c.jsx("div",{children:n("ui.message.signInForMore")})]})})]})}),c.jsx(Dne,{})]})}}const Zne=e=>({user:e.common.user.user,isPortrait:e.common.media.isPortrait}),Jne=e=>({});Xj.propTypes={user:ht,isPortrait:h.bool.isRequired};const ere=de()(Pe(Zne,Jne)(Xj));class Kj extends X.Component{render(){const{t}=this.props,{user:n}=this.props;return n==null?null:c.jsxs("div",{className:g("subsection","subsection--my-info"),children:[c.jsx("div",{className:g("title"),children:t("ui.title.myInformation")}),c.jsx(Ci,{entries:[{name:t("ui.attribute.name"),info:IL(n)},{name:t("ui.attribute.email"),info:n.email}]}),c.jsxs("div",{className:g("caption"),children:[t("ui.message.myInfoCaptionHead"),c.jsx("a",{href:"https://sparcssso.kaist.ac.kr/",className:g("text-button"),target:"_blank",rel:"noopener noreferrer",children:"SPARCS SSO"}),t("ui.message.myInfoCaptionTail")]})]})}}const tre=e=>({user:e.common.user.user}),nre=e=>({});Kj.propTypes={user:ht};const rre=de()(Pe(tre,nre)(Kj));class Qj extends X.Component{render(){const{t}=this.props,{user:n}=this.props;return n==null?null:c.jsxs("div",{className:g("subsection","subsection--academic-info"),children:[c.jsx("div",{className:g("title"),children:t("ui.title.academicInformation")}),c.jsx(Ci,{entries:[{name:t("ui.attribute.studentId"),info:n.student_id},{name:t("ui.attribute.major"),info:n.majors.map(r=>r[t("js.property.name")]).join(", ")}]}),c.jsxs("div",{className:g("caption"),children:[t("ui.message.academicInfoCaptionHead"),c.jsx("a",{href:`mailto:${xa}`,className:g("text-button"),children:xa}),t("ui.message.academicInfoCaptionTail")]})]})}}const ire=e=>({user:e.common.user.user}),sre=e=>({});Qj.propTypes={user:ht};const ore=de()(Pe(ire,sre)(Qj));class Zj extends X.Component{constructor(n){super(n);N(this,"_setUserDepartment",()=>{const{user:n}=this.props;this.setState({savedSelectedDepartments:new Set(n.favorite_departments.map(r=>String(r.id))),selectedDepartments:new Set(n.favorite_departments.map(r=>String(r.id)))})});N(this,"updateCheckedValues",n=>r=>{this.setState({[n]:r})});N(this,"handleSubmit",n=>{const{selectedDepartments:r}=this.state;n.preventDefault(),n.stopPropagation(),me.post("/session/favorite-departments",{fav_department:Array.from(r).filter(i=>i!=="ALL")},{}).then(i=>{this.setState({savedSelectedDepartments:r}),this._refetchUser()}).catch(i=>{})});N(this,"_refetchUser",()=>{const{setUserDispatch:n}=this.props;me.get("/session/info",{metadata:{gaCategory:"User",gaVariable:"GET / Instance"}}).then(r=>{n(r.data)}).catch(r=>{})});this.state={savedSelectedDepartments:new Set([]),selectedDepartments:new Set([]),allDepartments:[]}}componentDidMount(){const{user:n}=this.props;n&&this._setUserDepartment(),me.get("/session/department-options",{}).then(r=>{this.setState({allDepartments:r.data.flat(1)})}).catch(r=>{})}componentDidUpdate(n){const{user:r}=this.props;!n.user&&r&&this._setUserDepartment()}render(){const{t:n}=this.props,{user:r}=this.props,{allDepartments:i,savedSelectedDepartments:s,selectedDepartments:o}=this.state;if(r==null)return null;const l=i.map(m=>[String(m.id),`${m[n("js.property.name")]} (${m.code})`]),d=o.size!==s.size||Array.from(o).some(m=>!s.has(m)),f=i.length===0?null:c.jsxs("form",{onSubmit:this.handleSubmit,children:[c.jsx(Dt,{updateCheckedValues:this.updateCheckedValues("selectedDepartments"),inputName:"department",titleName:n("ui.search.favoriteDepartment"),options:l,checkedValues:o}),c.jsx("div",{className:g("buttons"),children:d?c.jsx("button",{type:"submit",className:g("text-button"),children:n("ui.button.save")}):c.jsx("button",{className:g("text-button","text-button--disabled"),children:n("ui.button.save")})})]});return c.jsxs("div",{className:g("subsection","subsection--favorite-department"),children:[c.jsx("div",{className:g("title"),children:n("ui.title.settings")}),f]})}}const are=e=>({user:e.common.user.user}),lre=e=>({setUserDispatch:t=>{e(dv(t))}});Zj.propTypes={user:ht,setUserDispatch:h.func.isRequired};const ure=de()(Pe(are,lre)(Zj));class Jj extends X.Component{render(){const{t}=this.props;return c.jsx("section",{className:g("content","content--no-scroll"),children:c.jsx("div",{className:g("page-grid","page-grid--full"),children:c.jsx("div",{className:g("section","section--account"),children:c.jsxs(ct,{expandTop:12,children:[c.jsx(rre,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx(ore,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx(ure,{}),c.jsx(Ce,{orientation:Ce.Orientation.HORIZONTAL,isVisible:!0}),c.jsx("div",{children:c.jsx("a",{href:`${cb}/session/logout?next=${window.location.origin}`,className:g("text-button"),children:t("ui.button.signOut")})})]})})})})}}Jj.propTypes={};const cre=de()(Jj),eI=({t:e,project:t,isRaised:n,onClick:r})=>{const i=r?s=>{r(t)}:null;return c.jsxs("div",{className:g("block","block--project",r?"block--clickable":null,n?"block--raised":null),onClick:i,children:[c.jsx("div",{className:g("block--project__title"),children:t.mainTitle}),c.jsx("div",{className:g("block--project__title"),children:t.subTitle}),c.jsx("div",{className:g("block--project__content"),children:t.period})]})};eI.propTypes={project:h.shape({index:h.number.isRequired,mainTitle:h.string.isRequired,subTitle:h.string.isRequired,period:h.string.isRequired}).isRequired,onClick:h.func,isRaised:h.bool.isRequired};const dre=de()(xe.memo(eI)),fre="/assets/Members-05-battery_kor-d80534eb.png",pre="/assets/Members-05-daybreaker_kor-906f60ac.png",hre="/assets/Members-05-julingks_kor-5cf01e83.png",mre="/assets/Members-ext-majja_kor-d513cca1.png",gre="/assets/Members-07-cancho_kor-ac17d13b.png",_re="/assets/Members-07-dynaman_kor-1aa6dd84.png",yre="/assets/Members-07-elaborate_kor-a47ac45d.png",vre="/assets/Members-07-gangok_kor-6533dfbf.png",bre="/assets/Members-07-truth_kor-a160dd91.png",Sre="/assets/Members-08-mayflower_kor-ae915667.png",xre="/assets/Members-08-reno_kor-a3dd47a6.png",L_="/assets/Members-09-imai_kor-d3e839e5.png",wre="/assets/Members-09-kuss_kor-71c3c3d6.png",vf="/assets/Members-10-alphamin_kor-7c838683.png",Tre="/assets/Members-10-boolgom_kor-9d83b727.png",D_="/assets/Members-10-noname_kor-b2660d1e.png",Rre="/assets/Members-10-leeopop_kor-28dfc157.png",kre="/assets/Members-10-pillibi_kor-0d2e2c8d.png",Ere="/assets/Members-11-overmania_kor-1f93fee8.png",Cre="/assets/Members-11-raon_kor-b928deb2.png",sk="/assets/Members-11-rodumani_kor-64508a20.png",Ore="/assets/Members-11-seal_kor-fb6ad523.png",ok="/assets/Members-11-sunguard_kor-76a1c19f.png",Pre="/assets/Members-12-aon_kor-62856a85.png",bf="/assets/Members-12-chaos_kor-707911bd.png",Lre="/assets/Members-12-coffee_kor-3f5114b5.png",Dre="/assets/Members-12-daedoo_kor-18b0c93a.png",Nre="/assets/Members-12-naldo_kor-d5808373.png",Are="/assets/Members-12-whitegold_kor-fd5f6918.png",jre="/assets/Members-12-yasik_kor-dc86caa6.png",N_="/assets/Members-13-mandu_kor-7c2c4d7c.png",Ire="/assets/Members-13-nobrain_kor-b5c12e39.png",Mre="/assets/Members-13-samjo_kor-e82a1a03.png",Qa="/assets/Members-14-stein_kor-232d330f.png",ak="/assets/Members-14-coearth_kor-b054e07c.png",Fre="/assets/Members-14-george_kor-93c6ac9f.png",$re="/assets/Members-14-leejeok_kor-5b5985a3.png",qre="/assets/Members-15-allkinds_kor-d8e15c98.png",Ure="/assets/Members-15-bogo_kor-f7e14b86.png",Bre="/assets/Members-15-cheshire_kor-1ca0add0.png",Hre="/assets/Members-15-didee_kor-6be2ab43.png",Wre="/assets/Members-15-etranger_kor-89d2b348.png",A_="/assets/Members-15-hood_kor-e3f38ff5.png",j_="/assets/Members-15-mango_kor-864b075f.png",Yre="/assets/Members-15-moss_kor-ba8381f7.png",zre="/assets/Members-15-null_kor-123186a4.png",lk="/assets/Members-15-potato_kor-ac8c7edf.png",Vre="/assets/Members-15-swan_kor-a229fdcb.png",xr="/assets/Members-15-zealot_kor-27ac69b7.png",Gre="/assets/Members-16-akais_kor-c0e2fbc9.png",Xre="/assets/Members-16-hershey_kor-cc8f7564.png",Kre="/assets/Members-16-james_kor-381dea08.png",Qre="/assets/Members-16-jaydub_kor-ee1a7508.png",Zre="/assets/Members-16-juheeuu_kor-89a910cd.png",Jre="/assets/Members-16-leesia_kor-de92729c.png",eie="/assets/Members-16-parang_kor-73717dbf.png",tie="/assets/Members-16-semi_kor-5d3a7b7c.png",nie="/assets/Members-16-youns_kor-8358690f.png",rie="/assets/Members-17-tink_kor-e04f2b64.png",iie="/assets/Members-17-yolo_kor-4e7a1d86.png",sie="/assets/Members-18-appleseed_kor-4ec6cac4.png",oie="/assets/Members-19-mini_kor-34891bd2.png",uk="/assets/Members-19-winrobrine_kor-e56b8d7e.png",aie="/assets/Members-20-dora_kor-fe8135f7.png",lie="/assets/Members-21-kkoma_kor-3d58300e.png",Sf="/assets/Members-21-platypus_kor-1626ad8c.png";class uie extends X.Component{constructor(n){super(n);N(this,"projects",[{index:1,mainTitle:"LKIN",subTitle:"-",period:"-",fields:[{title:"Project Manager",people:[]},{title:"Designer",people:[]},{title:"Developer",people:[]}]},{index:20,mainTitle:"OTL",subTitle:"모의시간표",period:"2009",fields:[{title:"Developer",people:[{name:"김민우",image:hre},{name:"김종균",image:bre},{name:"김준기",image:pre},{name:"유충국",image:mre}]},{title:"Special Thanks To",people:[{name:"강철",image:gre},{name:"안병욱",image:yre}]}]},{index:21,mainTitle:"OTL",subTitle:"추가개발",period:"2010 ~ 2012",fields:[{title:"Project Manager",people:[{name:"배성경",image:L_,caption:"2011"},{name:"김재겸",image:D_,caption:"2012"}]},{title:"Developer",people:[{name:"김재겸",image:D_},{name:"박일우",image:Ere},{name:"배성경",image:L_},{name:"심규민",image:Tre},{name:"안재만",image:wre},{name:"유민정",image:vf},{name:"이윤석",image:vre},{name:"정재성",image:fre},{name:"정종혁",image:ok},{name:"정창제",image:sk},{name:"조유정",image:Sre},{name:"진태진",image:_re}]}]},{index:22,mainTitle:"OTL",subTitle:"과목사전",period:"2012 ~ 2013",fields:[{title:"Project Manager",people:[{name:"유민정",image:vf,caption:"2012.05 ~ 2012.09"},{name:"마재의",image:bf,caption:"2012.09 ~ 2013.03"}]},{title:"Designer",people:[{name:"박지향",image:Ore}]},{title:"Developer",people:[{name:"김정민",image:Lre},{name:"마재의",image:bf},{name:"박중언",image:jre},{name:"박지혁",image:Nre},{name:"유민정",image:vf},{name:"윤필립",image:kre},{name:"이태현",image:Are},{name:"정종혁",image:ok},{name:"정창제",image:sk},{name:"채종욱",image:Pre}]}]},{index:30,mainTitle:"OTL Plus",subTitle:"과목사전",period:"2015.09 ~ 2016.06",fields:[{title:"Project Manager",people:[{name:"황태현",image:N_,caption:"2015.09 ~ 2015.11"},{name:"서동민",image:A_,caption:"2015.12 ~ 2016.06"}]},{title:"Designer",people:[{name:"김찬욱",image:Dre}]},{title:"Developer",people:[{name:"고지훈",image:j_},{name:"김강인",image:Cre},{name:"김재성",image:Qa},{name:"서동민",image:A_},{name:"이강원",image:lk},{name:"조성원",image:Mre},{name:"최정운",image:ak},{name:"한승현",image:xr},{name:"황태현",image:N_}]}]},{index:31,mainTitle:"OTL Plus",subTitle:"모의시간표",period:"2016.09 ~ 2017.12",fields:[{title:"Project Manager",people:[{name:"김재성",image:Qa,caption:"2016.09 ~ 2017.05"},{name:"한승현",image:xr,caption:"2017.06 ~ 2017.12"}]},{title:"Designer",people:[{name:"한승현",image:xr,caption:"3 credits"}]},{title:"Developer",people:[{name:"고지훈",image:j_,caption:"3 credits"},{name:"김재성",image:Qa,caption:"3 credits"},{name:"김태준",image:Ire,caption:"2 credits"},{name:"서덕담",image:Hre,caption:"2 credits"},{name:"오종훈",image:$re,caption:"2 credits"},{name:"이강원",image:lk,caption:"2 credits"},{name:"조형준",image:Fre,caption:"3 credits"},{name:"최정운",image:ak,caption:"3 credits"},{name:"한승현",image:xr,caption:"2 credits"}]}]},{index:32,mainTitle:"OTL Plus",subTitle:"모바일 & 리뉴얼",period:"2018.01 ~ 2020.01",fields:[{title:"Project Manager",people:[{name:"한승현",image:xr,caption:"2018.01 ~ 2020.01"}]},{title:"Designer",people:[{name:"한승현",image:xr,caption:"4 credits"}]},{title:"Developer",people:[{name:"강찬규",image:sie,caption:"1 credit"},{name:"강현우",image:Jre,caption:"2 credits"},{name:"고지훈",image:j_,caption:"1 credit"},{name:"김경서",image:Yre,caption:"1 credit"},{name:"마재의",image:bf,caption:"1 credit"},{name:"문재호",image:Kre,caption:"1 credit"},{name:"박수호",image:Wre,caption:"1 credit"},{name:"박현우",image:uk,caption:"1 credit"},{name:"서혜인",image:Ure,caption:"1 credit"},{name:"손주희",image:Zre,caption:"2 credits"},{name:"엄성하",image:tie,caption:"1 credit"},{name:"이선민",image:qre,caption:"1 credit"},{name:"이세연",image:Bre,caption:"1 credit"},{name:"이정연",image:eie,caption:"1 credit"},{name:"이주영",image:zre,caption:"1 credit"},{name:"지수환",image:Vre,caption:"1 credit"},{name:"최윤서",image:nie,caption:"1 credit"},{name:"하현정",image:iie,caption:"1 credit"},{name:"허미나",image:Xre,caption:"1 credit"},{name:"황재영",image:Gre,caption:"1 credit"},{name:"한승현",image:xr,caption:"4 credits"},{name:"한우현",image:rie,caption:"1 credit"}]}]},{index:1e3,mainTitle:"OTL App",subTitle:"-",period:"2020.02 ~",fields:[{title:"TF Lead",people:[{name:"박현우",image:uk,caption:"2020.02 ~ 2021.01"},{name:"오승빈",image:Sf,caption:"2021.07 ~"}]},{title:"Designer",people:[{name:"조유민",image:null,caption:"1 credits"}]},{title:"Developer",people:[{name:"오승빈",image:Sf,caption:"3 credits"},{name:"문동우",image:null,caption:"2 credits"},{name:"정성엽",image:null,caption:"1 credits"}]}]},{index:33,mainTitle:"OTL Plus",subTitle:"졸업플래너",period:"2021.09 ~",fields:[{title:"Project Manager",people:[{name:"한승현",image:xr,caption:"2021.09 ~ 2023.03"},{name:"조유민",image:null,caption:"2023.03 ~"}]},{title:"TF Lead",people:[{name:"한승현",image:xr,caption:"2023.03 ~"}]},{title:"Designer",people:[{name:"양성현",image:null,caption:"1 credit"},{name:"이혜원",image:null,caption:"1 credit"},{name:"한승현",image:xr,caption:"4 credits"}]},{title:"Developer",people:[{name:"김동혁",image:lie,caption:"3 credits"},{name:"김민희",image:oie,caption:"3 credits"},{name:"김재성",image:Qa,caption:"1 credits"},{name:"오승빈",image:Sf,caption:"1 credit"},{name:"이지윤",image:aie,caption:"4 credits"},{name:"이진우",image:Qre,caption:"3 credits"},{name:"한승현",image:xr,caption:"4 credits"},{name:"홍은기",image:null,caption:"1 credits"},{name:"황제욱",image:null,caption:"1 credits"}]}]},{index:9001,mainTitle:"Sysops & Tech Leads",subTitle:"-",period:"-",fields:[{title:"LKIN",people:[{name:"서창민",caption:"2009 ~ 2010",image:xre},{name:"이근홍",caption:"2011 ~ 2012",image:Rre}]},{title:"OTL",people:[{name:"배성경",image:L_,caption:"2011"},{name:"김재겸",image:D_,caption:"2012"},{name:"유민정",image:vf,caption:"2012.05 ~ 2012.09"},{name:"마재의",image:bf,caption:"2012.09 ~ 2015.04"},{name:"황태현",image:N_,caption:"2015.05 ~ 2015.11"},{name:"서동민",image:A_,caption:"2015.12 ~ 2016.05"},{name:"김재성",image:Qa,caption:"2016.06 ~ 2017.06"},{name:"한승현",image:xr,caption:"2017.06 ~ 2017.12"}]},{title:"OTL Plus",people:[{name:"김재성",image:Qa,caption:"2016.06 ~ 2017.06"},{name:"한승현",image:xr,caption:"2017.06 ~ 2023.03"},{name:"오승빈",image:Sf,caption:"2023.03 ~"}]}]}]);N(this,"selectProject",n=>{this.setState({selectedProjectIndex:n.index})});this.state={selectedProjectIndex:33}}render(){const{selectedProjectIndex:n}=this.state,r=this.projects.find(i=>i.index===n);return c.jsx("section",{className:g("content","content--no-scroll"),children:c.jsx("div",{className:g("page-grid","page-grid--full"),children:c.jsx("div",{className:g("section"),children:c.jsxs("div",{className:g("subsection","subsection--credit"),children:[c.jsx("div",{className:g("block-grid"),children:this.projects.map(i=>c.jsx(dre,{project:i,index:i.index,onClick:this.selectProject,isRaised:n===i.index},i.index))}),c.jsx(ct,{children:c.jsx("div",{className:g("subsection--credit__people-list"),children:r.fields.map(i=>c.jsxs("div",{className:g("subsection--credit__people-list__group"),children:[c.jsx("div",{className:g("title"),children:i.title}),i.people.map(s=>c.jsxs("div",{className:g("subsection--credit__people-list__group__elem"),children:[c.jsx("img",{src:s.image,alt:s.name}),s.caption?c.jsx("div",{className:g("caption"),children:s.caption}):null]},s.name))]},i.title))})},n)]})})})})}}class cie extends X.Component{render(){return c.jsx("section",{className:g("content","content--no-scroll"),children:c.jsx("div",{className:g("page-grid","page-grid--full"),children:c.jsx("div",{className:g("section"),children:c.jsxs("div",{className:g("subsection","subsection--license"),children:[c.jsx("div",{className:g("title"),children:" Licenses "}),c.jsx("div",{children:`Copyright © 2016-${new Date().getFullYear()}, SPARCS OTL Team. All rights reserved.`})]})})})})}}const ck=["http","https","mailto","tel"];function die(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let i=-1;for(;++ii||(i=t.indexOf("#"),i!==-1&&r>i)?t:"javascript:void(0)"}/*!
+ * Determine if an object is a Buffer
+ *
+ * @author Feross Aboukhadijeh
+ * @license MIT
+ */var fie=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};const tI=Mn(fie);function nc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?dk(e.position):"start"in e||"end"in e?dk(e):"line"in e||"column"in e?pv(e):""}function pv(e){return fk(e&&e.line)+":"+fk(e&&e.column)}function dk(e){return pv(e&&e.start)+"-"+pv(e&&e.end)}function fk(e){return e&&typeof e=="number"?e:1}class li extends Error{constructor(t,n,r){const i=[null,null];let s={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const o=r.indexOf(":");o===-1?i[1]=r:(i[0]=r.slice(0,o),i[1]=r.slice(o+1))}n&&("type"in n||"position"in n?n.position&&(s=n.position):"start"in n||"end"in n?s=n:("line"in n||"column"in n)&&(s.start=n)),this.name=nc(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=s.start.line,this.column=s.start.column,this.position=s,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}li.prototype.file="";li.prototype.name="";li.prototype.reason="";li.prototype.message="";li.prototype.stack="";li.prototype.fatal=null;li.prototype.column=null;li.prototype.line=null;li.prototype.source=null;li.prototype.ruleId=null;li.prototype.position=null;const $i={basename:pie,dirname:hie,extname:mie,join:gie,sep:"/"};function pie(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Kc(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),l>-1&&(e.charCodeAt(i)===t.charCodeAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function hie(e){if(Kc(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function mie(e){Kc(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const l=e.charCodeAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function gie(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yie(e,t){let n="",r=0,i=-1,s=0,o=-1,l,d;for(;++o<=e.length;){if(o2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function Kc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vie={cwd:bie};function bie(){return"/"}function hv(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function Sie(e){if(typeof e=="string")e=new URL(e);else if(!hv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return xie(e)}function xie(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||Kf.call(t,i)},vk=function(t,n){mk&&n.name==="__proto__"?mk(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},bk=function(t,n){if(n==="__proto__")if(Kf.call(t,n)){if(gk)return gk(t,n).value}else return;return t[n]},Tie=function e(){var t,n,r,i,s,o,l=arguments[0],d=1,f=arguments.length,m=!1;for(typeof l=="boolean"&&(m=l,l=arguments[1]||{},d=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});do.length;let d;l&&o.push(i);try{d=e.apply(this,o)}catch(f){const m=f;if(l&&n)throw m;return i(m)}l||(d instanceof Promise?d.then(s,i):d instanceof Error?i(d):s(d))}function i(o,...l){n||(n=!0,t(o,...l))}function s(o){i(null,o)}}const Eie=sI().freeze(),iI={}.hasOwnProperty;function sI(){const e=Rie(),t=[];let n={},r,i=-1;return s.data=o,s.Parser=void 0,s.Compiler=void 0,s.freeze=l,s.attachers=t,s.use=d,s.parse=f,s.stringify=m,s.run=_,s.runSync=y,s.process=b,s.processSync=w,s;function s(){const R=sI();let S=-1;for(;++S{if(P||!U||!W)j(P);else{const J=s.stringify(U,W);J==null||(Pie(J)?W.value=J:W.result=J),j(P,W)}});function j(P,U){P||!U?E(P):L?L(U):S(null,U)}}}function w(R){let S;s.freeze(),$_("processSync",s.Parser),q_("processSync",s.Compiler);const x=Iu(R);return s.process(x,L),Tk("processSync","process",S),x;function L(E){S=!0,hk(E)}}}function xk(e,t){return typeof e=="function"&&e.prototype&&(Cie(e.prototype)||t in e.prototype)}function Cie(e){let t;for(t in e)if(iI.call(e,t))return!0;return!1}function $_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function q_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function U_(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wk(e){if(!mv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Iu(e){return Oie(e)?e:new nI(e)}function Oie(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Pie(e){return typeof e=="string"||tI(e)}const Lie={};function Die(e,t){const n=t||Lie,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return oI(e,r,i)}function oI(e,t,n){if(Nie(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Rk(e.children,t,n)}return Array.isArray(e)?Rk(e,t,n):""}function Rk(e,t,n){const r=[];let i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(es(e,e.length,0,t),e):t}const kk={}.hasOwnProperty;function Aie(e){const t={};let n=-1;for(;++no))return;const U=t.events.length;let W=U,J,V;for(;W--;)if(t.events[W][0]==="exit"&&t.events[W][1].type==="chunkFlow"){if(J){V=t.events[W][1].end;break}J=!0}for(x(r),P=U;PE;){const j=n[I];t.containerState=j[1],j[0].exit.call(t,e)}n.length=E}function L(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Vie(e,t,n){return Ct(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ck(e){if(e===null||lr(e)||Bie(e))return 1;if(Uie(e))return 2}function GS(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const _=Object.assign({},e[r][1].end),y=Object.assign({},e[n][1].start);Ok(_,-d),Ok(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:_,end:Object.assign({},e[r][1].end)},l={type:d>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:y},s={type:d>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:d>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},l.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},l.end),f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Zr(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Zr(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),f=Zr(f,GS(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Zr(f,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=Zr(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,es(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n0&&pt(P)?Ct(e,L,"linePrefix",s+1)(P):L(P)}function L(P){return P===null||$e(P)?e.check(Lk,R,I)(P):(e.enter("codeFlowValue"),E(P))}function E(P){return P===null||$e(P)?(e.exit("codeFlowValue"),L(P)):(e.consume(P),E)}function I(P){return e.exit("codeFenced"),t(P)}function j(P,U,W){let J=0;return V;function V(fe){return P.enter("lineEnding"),P.consume(fe),P.exit("lineEnding"),K}function K(fe){return P.enter("codeFencedFence"),pt(fe)?Ct(P,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(fe):B(fe)}function B(fe){return fe===l?(P.enter("codeFencedFenceSequence"),ce(fe)):W(fe)}function ce(fe){return fe===l?(J++,P.consume(fe),ce):J>=o?(P.exit("codeFencedFenceSequence"),pt(fe)?Ct(P,ne,"whitespace")(fe):ne(fe)):W(fe)}function ne(fe){return fe===null||$e(fe)?(P.exit("codeFencedFence"),U(fe)):W(fe)}}}function sse(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const B_={name:"codeIndented",tokenize:ase},ose={tokenize:lse,partial:!0};function ase(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Ct(e,s,"linePrefix",4+1)(f)}function s(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?d(f):$e(f)?e.attempt(ose,o,d)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||$e(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function d(f){return e.exit("codeIndented"),t(f)}}function lse(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):$e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ct(e,s,"linePrefix",4+1)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):$e(o)?i(o):n(o)}}const use={name:"codeText",tokenize:fse,resolve:cse,previous:dse};function cse(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function dI(e,t,n,r,i,s,o,l,d){const f=d||Number.POSITIVE_INFINITY;let m=0;return _;function _(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),y):x===null||x===32||x===41||gv(x)?n(x):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),R(x))}function y(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),b(x))}function b(x){return x===62?(e.exit("chunkString"),e.exit(l),y(x)):x===null||x===60||$e(x)?n(x):(e.consume(x),x===92?w:b)}function w(x){return x===60||x===62||x===92?(e.consume(x),b):b(x)}function R(x){return!m&&(x===null||x===41||lr(x))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(x)):m999||b===null||b===91||b===93&&!d||b===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(s),e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):$e(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),_(b))}function _(b){return b===null||b===91||b===93||$e(b)||l++>999?(e.exit("chunkString"),m(b)):(e.consume(b),d||(d=!pt(b)),b===92?y:_)}function y(b){return b===91||b===92||b===93?(e.consume(b),l++,_):_(b)}}function pI(e,t,n,r,i,s){let o;return l;function l(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(s),f(y))}function f(y){return y===o?(e.exit(s),d(o)):y===null?n(y):$e(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Ct(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===o||y===null||$e(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?_:m)}function _(y){return y===o||y===92?(e.consume(y),m):m(y)}}function rc(e,t){let n;return r;function r(i){return $e(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):pt(i)?Ct(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function wl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vse={name:"definition",tokenize:Sse},bse={tokenize:xse,partial:!0};function Sse(e,t,n){const r=this;let i;return s;function s(b){return e.enter("definition"),o(b)}function o(b){return fI.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function l(b){return i=wl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),d):n(b)}function d(b){return lr(b)?rc(e,f)(b):f(b)}function f(b){return dI(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(bse,_,_)(b)}function _(b){return pt(b)?Ct(e,y,"whitespace")(b):y(b)}function y(b){return b===null||$e(b)?(e.exit("definition"),r.parser.defined.push(i),t(b)):n(b)}}function xse(e,t,n){return r;function r(l){return lr(l)?rc(e,i)(l):n(l)}function i(l){return pI(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return pt(l)?Ct(e,o,"whitespace")(l):o(l)}function o(l){return l===null||$e(l)?t(l):n(l)}}const wse={name:"hardBreakEscape",tokenize:Tse};function Tse(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return $e(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Rse={name:"headingAtx",tokenize:Ese,resolve:kse};function kse(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},es(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Ese(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),o(m)}function o(m){return m===35&&r++<6?(e.consume(m),o):m===null||lr(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||$e(m)?(e.exit("atxHeading"),t(m)):pt(m)?Ct(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||lr(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const Cse=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Nk=["pre","script","style","textarea"],Ose={name:"htmlFlow",tokenize:Nse,resolveTo:Dse,concrete:!0},Pse={tokenize:jse,partial:!0},Lse={tokenize:Ase,partial:!0};function Dse(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Nse(e,t,n){const r=this;let i,s,o,l,d;return f;function f(O){return m(O)}function m(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),_}function _(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),s=!0,R):O===63?(e.consume(O),i=3,r.interrupt?t:D):Bi(O)?(e.consume(O),o=String.fromCharCode(O),S):n(O)}function y(O){return O===45?(e.consume(O),i=2,b):O===91?(e.consume(O),i=5,l=0,w):Bi(O)?(e.consume(O),i=4,r.interrupt?t:D):n(O)}function b(O){return O===45?(e.consume(O),r.interrupt?t:D):n(O)}function w(O){const $="CDATA[";return O===$.charCodeAt(l++)?(e.consume(O),l===$.length?r.interrupt?t:B:w):n(O)}function R(O){return Bi(O)?(e.consume(O),o=String.fromCharCode(O),S):n(O)}function S(O){if(O===null||O===47||O===62||lr(O)){const $=O===47,Y=o.toLowerCase();return!$&&!s&&Nk.includes(Y)?(i=1,r.interrupt?t(O):B(O)):Cse.includes(o.toLowerCase())?(i=6,$?(e.consume(O),x):r.interrupt?t(O):B(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):s?L(O):E(O))}return O===45||xi(O)?(e.consume(O),o+=String.fromCharCode(O),S):n(O)}function x(O){return O===62?(e.consume(O),r.interrupt?t:B):n(O)}function L(O){return pt(O)?(e.consume(O),L):V(O)}function E(O){return O===47?(e.consume(O),V):O===58||O===95||Bi(O)?(e.consume(O),I):pt(O)?(e.consume(O),E):V(O)}function I(O){return O===45||O===46||O===58||O===95||xi(O)?(e.consume(O),I):j(O)}function j(O){return O===61?(e.consume(O),P):pt(O)?(e.consume(O),j):E(O)}function P(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,U):pt(O)?(e.consume(O),P):W(O)}function U(O){return O===d?(e.consume(O),d=null,J):O===null||$e(O)?n(O):(e.consume(O),U)}function W(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||lr(O)?j(O):(e.consume(O),W)}function J(O){return O===47||O===62||pt(O)?E(O):n(O)}function V(O){return O===62?(e.consume(O),K):n(O)}function K(O){return O===null||$e(O)?B(O):pt(O)?(e.consume(O),K):n(O)}function B(O){return O===45&&i===2?(e.consume(O),Ie):O===60&&i===1?(e.consume(O),we):O===62&&i===4?(e.consume(O),Re):O===63&&i===3?(e.consume(O),D):O===93&&i===5?(e.consume(O),Se):$e(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Pse,H,ce)(O)):O===null||$e(O)?(e.exit("htmlFlowData"),ce(O)):(e.consume(O),B)}function ce(O){return e.check(Lse,ne,H)(O)}function ne(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),fe}function fe(O){return O===null||$e(O)?ce(O):(e.enter("htmlFlowData"),B(O))}function Ie(O){return O===45?(e.consume(O),D):B(O)}function we(O){return O===47?(e.consume(O),o="",Ee):B(O)}function Ee(O){if(O===62){const $=o.toLowerCase();return Nk.includes($)?(e.consume(O),Re):B(O)}return Bi(O)&&o.length<8?(e.consume(O),o+=String.fromCharCode(O),Ee):B(O)}function Se(O){return O===93?(e.consume(O),D):B(O)}function D(O){return O===62?(e.consume(O),Re):O===45&&i===2?(e.consume(O),D):B(O)}function Re(O){return O===null||$e(O)?(e.exit("htmlFlowData"),H(O)):(e.consume(O),Re)}function H(O){return e.exit("htmlFlow"),t(O)}}function Ase(e,t,n){const r=this;return i;function i(o){return $e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function jse(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(em,t,n)}}const Ise={name:"htmlText",tokenize:Mse};function Mse(e,t,n){const r=this;let i,s,o;return l;function l(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),j):D===63?(e.consume(D),E):Bi(D)?(e.consume(D),W):n(D)}function f(D){return D===45?(e.consume(D),m):D===91?(e.consume(D),s=0,w):Bi(D)?(e.consume(D),L):n(D)}function m(D){return D===45?(e.consume(D),b):n(D)}function _(D){return D===null?n(D):D===45?(e.consume(D),y):$e(D)?(o=_,we(D)):(e.consume(D),_)}function y(D){return D===45?(e.consume(D),b):_(D)}function b(D){return D===62?Ie(D):D===45?y(D):_(D)}function w(D){const Re="CDATA[";return D===Re.charCodeAt(s++)?(e.consume(D),s===Re.length?R:w):n(D)}function R(D){return D===null?n(D):D===93?(e.consume(D),S):$e(D)?(o=R,we(D)):(e.consume(D),R)}function S(D){return D===93?(e.consume(D),x):R(D)}function x(D){return D===62?Ie(D):D===93?(e.consume(D),x):R(D)}function L(D){return D===null||D===62?Ie(D):$e(D)?(o=L,we(D)):(e.consume(D),L)}function E(D){return D===null?n(D):D===63?(e.consume(D),I):$e(D)?(o=E,we(D)):(e.consume(D),E)}function I(D){return D===62?Ie(D):E(D)}function j(D){return Bi(D)?(e.consume(D),P):n(D)}function P(D){return D===45||xi(D)?(e.consume(D),P):U(D)}function U(D){return $e(D)?(o=U,we(D)):pt(D)?(e.consume(D),U):Ie(D)}function W(D){return D===45||xi(D)?(e.consume(D),W):D===47||D===62||lr(D)?J(D):n(D)}function J(D){return D===47?(e.consume(D),Ie):D===58||D===95||Bi(D)?(e.consume(D),V):$e(D)?(o=J,we(D)):pt(D)?(e.consume(D),J):Ie(D)}function V(D){return D===45||D===46||D===58||D===95||xi(D)?(e.consume(D),V):K(D)}function K(D){return D===61?(e.consume(D),B):$e(D)?(o=K,we(D)):pt(D)?(e.consume(D),K):J(D)}function B(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,ce):$e(D)?(o=B,we(D)):pt(D)?(e.consume(D),B):(e.consume(D),ne)}function ce(D){return D===i?(e.consume(D),i=void 0,fe):D===null?n(D):$e(D)?(o=ce,we(D)):(e.consume(D),ce)}function ne(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||lr(D)?J(D):(e.consume(D),ne)}function fe(D){return D===47||D===62||lr(D)?J(D):n(D)}function Ie(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function we(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Ee}function Ee(D){return pt(D)?Ct(e,Se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):Se(D)}function Se(D){return e.enter("htmlTextData"),o(D)}}const KS={name:"labelEnd",tokenize:Hse,resolveTo:Bse,resolveAll:Use},Fse={tokenize:Wse},$se={tokenize:Yse},qse={tokenize:zse};function Use(e){let t=-1;for(;++t=3&&(f===null||$e(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),pt(f)?Ct(e,l,"whitespace")(f):l(f))}}const nr={name:"list",tokenize:toe,continuation:{tokenize:noe},exit:ioe},Jse={tokenize:soe,partial:!0},eoe={tokenize:roe,partial:!0};function toe(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(b){const w=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:_v(b)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Qf,n,f)(b):f(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(b)}return n(b)}function d(b){return _v(b)&&++o<10?(e.consume(b),d):(!r.interrupt||o<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),f(b)):n(b)}function f(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(em,r.interrupt?n:m,e.attempt(Jse,y,_))}function m(b){return r.containerState.initialBlankLine=!0,s++,y(b)}function _(b){return pt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function noe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(em,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ct(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!pt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(eoe,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ct(e,e.attempt(nr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function roe(e,t,n){const r=this;return Ct(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function ioe(e){e.exit(this.containerState.type)}function soe(e,t,n){const r=this;return Ct(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(s){const o=r.events[r.events.length-1];return!pt(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Ak={name:"setextUnderline",tokenize:aoe,resolveTo:ooe};function ooe(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[s][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function aoe(e,t,n){const r=this;let i;return s;function s(f){let m=r.events.length,_;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){_=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||_)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===i?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),pt(f)?Ct(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||$e(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const loe={tokenize:uoe};function uoe(e){const t=this,n=e.attempt(em,r,e.attempt(this.parser.constructs.flowInitial,i,Ct(e,e.attempt(this.parser.constructs.flow,i,e.attempt(hse,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const coe={resolveAll:mI()},doe=hI("string"),foe=hI("text");function hI(e){return{tokenize:t,resolveAll:mI(e==="text"?poe:void 0)};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,l);return o;function o(m){return f(m)?s(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return f(m)?(n.exit("data"),s(m)):(n.consume(m),d)}function f(m){if(m===null)return!0;const _=i[m];let y=-1;if(_)for(;++y<_.length;){const b=_[y];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function mI(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function poe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,l=0,d;for(;s--;){const f=i[s];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(f===-2)d=!0,l++;else if(f!==-1){s++;break}}if(l){const f={type:n===e.length||d||l<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-l,offset:r.end.offset-l,_index:r.start._index+s,_bufferIndex:s?o:r.start._bufferIndex+o},end:Object.assign({},r.end)};r.end=Object.assign({},f.start),r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}function hoe(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},s=[];let o=[],l=[];const d={consume:L,enter:E,exit:I,attempt:U(j),check:U(P),interrupt:U(P,{interrupt:!0})},f={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:b,sliceSerialize:y,now:w,defineSkip:R,write:_};let m=t.tokenize.call(f,d);return t.resolveAll&&s.push(t),f;function _(K){return o=Zr(o,K),S(),o[o.length-1]!==null?[]:(W(t,0),f.events=GS(s,f.events,f),f.events)}function y(K,B){return goe(b(K),B)}function b(K){return moe(o,K)}function w(){const{line:K,column:B,offset:ce,_index:ne,_bufferIndex:fe}=r;return{line:K,column:B,offset:ce,_index:ne,_bufferIndex:fe}}function R(K){i[K.line]=K.column,V()}function S(){let K;for(;r._index-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function goe(e,t){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const Poe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Loe(e){return e.replace(Poe,Doe)}function Doe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return gI(n.slice(s?2:1),s?16:10)}return XS(n)||e}const _I={}.hasOwnProperty,Noe=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Aoe(n)(Ooe(Eoe(n).document().write(Coe()(e,t,!0))))};function Aoe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Un),autolinkProtocol:K,autolinkEmail:K,atxHeading:l(fr),blockQuote:l(Bt),characterEscape:K,characterReference:K,codeFenced:l(jt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:l(jt,d),codeText:l(qn,d),codeTextData:K,data:K,codeFlowValue:K,definition:l(Rt),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:l(Qn),hardBreakEscape:l(Vt),hardBreakTrailing:l(Vt),htmlFlow:l(os,d),htmlFlowData:K,htmlText:l(os,d),htmlTextData:K,image:l(qr),label:d,link:l(Un),listItem:l(as),listItemValue:w,listOrdered:l(mn,b),listUnordered:l(mn),paragraph:l(La),reference:Y,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:l(fr),strong:l(om),thematicBreak:l(am)},exit:{atxHeading:m(),atxHeadingSequence:U,autolink:m(),autolinkEmail:Fe,autolinkProtocol:He,blockQuote:m(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:pe,codeFenced:m(L),codeFencedFence:x,codeFencedFenceInfo:R,codeFencedFenceMeta:S,codeFlowValue:B,codeIndented:m(E),codeText:m(we),codeTextData:B,data:B,definition:m(),definitionDestinationString:P,definitionLabelString:I,definitionTitleString:j,emphasis:m(),hardBreakEscape:m(ne),hardBreakTrailing:m(ne),htmlFlow:m(fe),htmlFlowData:B,htmlText:m(Ie),htmlTextData:B,image:m(Se),label:Re,labelText:D,lineEnding:ce,link:m(Ee),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:G,resourceDestinationString:H,resourceTitleString:O,resource:$,setextHeading:m(V),setextHeadingLineSequence:J,setextHeadingText:W,strong:m(),thematicBreak:m()}};yI(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Q){let le={type:"root",children:[]};const Le={stack:[le],tokenStack:[],config:t,enter:f,exit:_,buffer:d,resume:y,setData:s,getData:o},at=[];let dt=-1;for(;++dt0){const Bn=Le.tokenStack[Le.tokenStack.length-1];(Bn[1]||Ik).call(Le,void 0,Bn[0])}for(le.position={start:to(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:to(Q.length>0?Q[Q.length-2][1].end:{line:1,column:1,offset:0})},dt=-1;++dt{const r=this.data("settings");return Noe(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}const fn=function(e,t,n){const r={type:String(e)};return n==null&&(typeof t=="string"||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r},Zf={}.hasOwnProperty;function Moe(e,t){const n=t.data||{};return"value"in t&&!(Zf.call(n,"hName")||Zf.call(n,"hProperties")||Zf.call(n,"hChildren"))?e.augment(t,fn("text",t.value)):e(t,"div",Kn(e,t))}function vI(e,t,n){const r=t&&t.type;let i;if(!r)throw new Error("Expected node, got `"+t+"`");return Zf.call(e.handlers,r)?i=e.handlers[r]:e.passThrough&&e.passThrough.includes(r)?i=Foe:i=e.unknownHandler,(typeof i=="function"?i:Moe)(e,t,n)}function Foe(e,t){return"children"in t?{...t,children:Kn(e,t)}:t}function Kn(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i":""))+")"})}return _;function _(){let y=[],b,w,R;if((!t||i(l,d,f[f.length-1]||null))&&(y=zoe(n(l,f)),y[0]===Mk))return y;if(l.children&&y[0]!==Woe)for(w=(r?l.children.length:-1)+s,R=f.concat(l);w>-1&&w-1?r.offset:null}}}function Voe(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const Fk={}.hasOwnProperty;function Goe(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return QS(e,"definition",r=>{const i=$k(r.identifier);i&&!Fk.call(t,i)&&(t[i]=r)}),n;function n(r){const i=$k(r);return i&&Fk.call(t,i)?t[i]:null}}function $k(e){return String(e||"").toUpperCase()}function TI(e,t){return e(t,"hr")}function mo(e,t){const n=[];let r=-1;for(t&&n.push(fn("text",`
+`));++r0&&n.push(fn("text",`
+`)),n}function RI(e,t){const n={},r=t.ordered?"ol":"ul",i=Kn(e,t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s"u"&&(n=!0),l=iae(t),r=0,i=e.length;r=55296&&s<=57343){if(s>=55296&&s<=56319&&r+1=56320&&o<=57343)){d+=encodeURIComponent(e[r]+e[r+1]),r++;continue}d+="%EF%BF%BD";continue}d+=encodeURIComponent(e[r])}return d}nm.defaultChars=";/?:@&=+$,-_.!~*'()#";nm.componentChars="-_.!~*'()";var sae=nm;const rm=Mn(sae);function EI(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return fn("text","!["+t.alt+r);const i=Kn(e,t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift(fn("text","["));const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push(fn("text",r)),i}function oae(e,t){const n=e.definition(t.identifier);if(!n)return EI(e,t);const r={src:rm(n.url||""),alt:t.alt};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"img",r)}function aae(e,t){const n={src:rm(t.url),alt:t.alt};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"img",n)}function lae(e,t){return e(t,"code",[fn("text",t.value.replace(/\r?\n|\r/g," "))])}function uae(e,t){const n=e.definition(t.identifier);if(!n)return EI(e,t);const r={href:rm(n.url||"")};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"a",r,Kn(e,t))}function cae(e,t){const n={href:rm(t.url)};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"a",n,Kn(e,t))}function dae(e,t,n){const r=Kn(e,t),i=n?fae(n):CI(t),s={},o=[];if(typeof t.checked=="boolean"){let f;r[0]&&r[0].type==="element"&&r[0].tagName==="p"?f=r[0]:(f=e(null,"p",[]),r.unshift(f)),f.children.length>0&&f.children.unshift(fn("text"," ")),f.children.unshift(e(null,"input",{type:"checkbox",checked:t.checked,disabled:!0})),s.className=["task-list-item"]}let l=-1;for(;++l1}function pae(e,t){return e(t,"p",Kn(e,t))}function hae(e,t){return e.augment(t,fn("root",mo(Kn(e,t))))}function mae(e,t){return e(t,"strong",Kn(e,t))}function gae(e,t){const n=t.children;let r=-1;const i=t.align||[],s=[];for(;++r{const d=String(l.identifier).toUpperCase();vae.call(i,d)||(i[d]=l)}),o;function s(l,d){if(l&&"data"in l&&l.data){const f=l.data;f.hName&&(d.type!=="element"&&(d={type:"element",tagName:"",properties:{},children:[]}),d.tagName=f.hName),d.type==="element"&&f.hProperties&&(d.properties={...d.properties,...f.hProperties}),"children"in d&&d.children&&f.hChildren&&(d.children=f.hChildren)}if(l){const f="type"in l?l:{position:l};Voe(f)||(d.position={start:SI(f),end:xI(f)})}return d}function o(l,d,f,m){return Array.isArray(f)&&(m=f,f={}),s(l,{type:"element",tagName:d,properties:f||{},children:m||[]})}}function OI(e,t){const n=bae(e,t),r=vI(n,e,null),i=Xoe(n);return i&&r.children.push(fn("text",`
+`),i),Array.isArray(r)?{type:"root",children:r}:r}const Sae=function(e,t){return e&&"run"in e?wae(e,t):Tae(e)},xae=Sae;function wae(e,t){return(n,r,i)=>{e.run(OI(n,t),r,s=>{i(s)})}}function Tae(e){return t=>OI(t,e)}class Qc{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Qc.prototype.property={};Qc.prototype.normal={};Qc.prototype.space=null;function PI(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Oae.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Bk,Nae);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Bk.test(s)){let o=s.replace(Pae,Dae);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=ZS}return new i(r,t)}function Dae(e){return"-"+e.toLowerCase()}function Nae(e){return e.charAt(1).toUpperCase()}const Hk={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Aae=PI([NI,DI,II,MI,Eae],"html"),jae=PI([NI,DI,II,MI,Cae],"svg");function Iae(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{QS(t,"element",(n,r,i)=>{const s=i;let o;if(e.allowedElements?o=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(o=e.disallowedElements.includes(n.tagName)),!o&&e.allowElement&&typeof r=="number"&&(o=!e.allowElement(n,r,s)),o&&typeof r=="number")return e.unwrapDisallowed&&n.children?s.children.splice(r,1,...n.children):s.children.splice(r,1),r})}}var FI={exports:{}},Tt={};/** @license React v17.0.2
+ * react-is.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var im=60103,sm=60106,Zc=60107,Jc=60108,ed=60114,td=60109,nd=60110,rd=60112,id=60113,JS=60120,sd=60115,od=60116,$I=60121,qI=60122,UI=60117,BI=60129,HI=60131;if(typeof Symbol=="function"&&Symbol.for){var vn=Symbol.for;im=vn("react.element"),sm=vn("react.portal"),Zc=vn("react.fragment"),Jc=vn("react.strict_mode"),ed=vn("react.profiler"),td=vn("react.provider"),nd=vn("react.context"),rd=vn("react.forward_ref"),id=vn("react.suspense"),JS=vn("react.suspense_list"),sd=vn("react.memo"),od=vn("react.lazy"),$I=vn("react.block"),qI=vn("react.server.block"),UI=vn("react.fundamental"),BI=vn("react.debug_trace_mode"),HI=vn("react.legacy_hidden")}function Ai(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case im:switch(e=e.type,e){case Zc:case ed:case Jc:case id:case JS:return e;default:switch(e=e&&e.$$typeof,e){case nd:case rd:case od:case sd:case td:return e;default:return t}}case sm:return t}}}var Mae=td,Fae=im,$ae=rd,qae=Zc,Uae=od,Bae=sd,Hae=sm,Wae=ed,Yae=Jc,zae=id;Tt.ContextConsumer=nd;Tt.ContextProvider=Mae;Tt.Element=Fae;Tt.ForwardRef=$ae;Tt.Fragment=qae;Tt.Lazy=Uae;Tt.Memo=Bae;Tt.Portal=Hae;Tt.Profiler=Wae;Tt.StrictMode=Yae;Tt.Suspense=zae;Tt.isAsyncMode=function(){return!1};Tt.isConcurrentMode=function(){return!1};Tt.isContextConsumer=function(e){return Ai(e)===nd};Tt.isContextProvider=function(e){return Ai(e)===td};Tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===im};Tt.isForwardRef=function(e){return Ai(e)===rd};Tt.isFragment=function(e){return Ai(e)===Zc};Tt.isLazy=function(e){return Ai(e)===od};Tt.isMemo=function(e){return Ai(e)===sd};Tt.isPortal=function(e){return Ai(e)===sm};Tt.isProfiler=function(e){return Ai(e)===ed};Tt.isStrictMode=function(e){return Ai(e)===Jc};Tt.isSuspense=function(e){return Ai(e)===id};Tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Zc||e===ed||e===BI||e===Jc||e===id||e===JS||e===HI||typeof e=="object"&&e!==null&&(e.$$typeof===od||e.$$typeof===sd||e.$$typeof===td||e.$$typeof===nd||e.$$typeof===rd||e.$$typeof===UI||e.$$typeof===$I||e[0]===qI)};Tt.typeOf=Ai;FI.exports=Tt;var Vae=FI.exports;const Gae=Mn(Vae);function Xae(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function Kae(e){return e.join(" ").trim()}function Qae(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var Wk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Zae=/\n/g,Jae=/^\s*/,ele=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,tle=/^:\s*/,nle=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,rle=/^[;\s]*/,ile=/^\s+|\s+$/g,sle=`
+`,Yk="/",zk="*",Go="",ole="comment",ale="declaration",lle=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var R=w.match(Zae);R&&(n+=R.length);var S=w.lastIndexOf(sle);r=~S?w.length-S:r+w.length}function s(){var w={line:n,column:r};return function(R){return R.position=new o(w),f(),R}}function o(w){this.start=w,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(w){var R=new Error(t.source+":"+n+":"+r+": "+w);if(R.reason=w,R.filename=t.source,R.line=n,R.column=r,R.source=e,!t.silent)throw R}function d(w){var R=w.exec(e);if(R){var S=R[0];return i(S),e=e.slice(S.length),R}}function f(){d(Jae)}function m(w){var R;for(w=w||[];R=_();)R!==!1&&w.push(R);return w}function _(){var w=s();if(!(Yk!=e.charAt(0)||zk!=e.charAt(1))){for(var R=2;Go!=e.charAt(R)&&(zk!=e.charAt(R)||Yk!=e.charAt(R+1));)++R;if(R+=2,Go===e.charAt(R-1))return l("End of comment missing");var S=e.slice(2,R-2);return r+=2,i(S),e=e.slice(R),r+=2,w({type:ole,comment:S})}}function y(){var w=s(),R=d(ele);if(R){if(_(),!d(tle))return l("property missing ':'");var S=d(nle),x=w({type:ale,property:Vk(R[0].replace(Wk,Go)),value:S?Vk(S[0].replace(Wk,Go)):Go});return d(rle),x}}function b(){var w=[];m(w);for(var R;R=y();)R!==!1&&(w.push(R),m(w));return w}return f(),b()};function Vk(e){return e?e.replace(ile,Go):Go}var ule=lle;function cle(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=ule(e),s=typeof t=="function",o,l,d=0,f=i.length;d0?xe.createElement(y,l,m):xe.createElement(y,l)}function mle(e){let t=-1;for(;++tString(t)).join("")}const Gk={}.hasOwnProperty,ble="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wf={renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function e1(e){for(const s in wf)if(Gk.call(wf,s)&&Gk.call(e,s)){const o=wf[s];console.warn(`[react-markdown] Warning: please ${o.to?`use \`${o.to}\` instead of`:"remove"} \`${s}\` (see <${ble}#${o.id}> for more info)`),delete wf[s]}const t=Eie().use(Ioe).use(e.remarkPlugins||e.plugins||[]).use(xae,{allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(Iae,e),n=new nI;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=xe.createElement(xe.Fragment,{},WI({options:e,schema:Aae,listDepth:0},r));return e.className&&(i=xe.createElement("div",{className:e.className},i)),i}e1.defaultProps={transformLinkUri:die};e1.propTypes={children:h.string,className:h.string,allowElement:h.func,allowedElements:h.arrayOf(h.string),disallowedElements:h.arrayOf(h.string),unwrapDisallowed:h.bool,remarkPlugins:h.arrayOf(h.oneOfType([h.object,h.func,h.arrayOf(h.oneOfType([h.object,h.func]))])),rehypePlugins:h.arrayOf(h.oneOfType([h.object,h.func,h.arrayOf(h.oneOfType([h.object,h.func]))])),sourcePos:h.bool,rawSourcePos:h.bool,skipHtml:h.bool,includeElementIndex:h.bool,transformLinkUri:h.oneOfType([h.func,h.bool]),linkTarget:h.oneOfType([h.func,h.string]),transformImageUri:h.func,components:h.object};const Sle=`# 개인정보취급방침
+
+KAIST 학부 총학생회 산하 자치단체 SPARCS 소속 OTL 개발팀(이하 "개발팀")는 개인정보 보호법 제30조에 따라 과목사전 및 모의시간표 서비스 OTL (이하 "서비스")을 이용하는 사용자(이하 "사용자")의 개인정보를 보호하고 이와 관련한 고충을 신속하고 원활하게 처리할 수 있도록 하기 위하여 다음과 같이 개인정보 처리방침을 수립 및 공개합니다.
+
+## 1. 개인정보의 처리 목적
+
+"개발팀"은 다음의 목적을 위하여 개인정보를 처리합니다. 처리하고 있는 개인정보는 다음의 목적 이외의 용도로는 이용되지 않으며, 이용 목적이 변경되는 경우에는 개인정보 보호법 제18조에 따라 별도의 동의를 받는 등 필요한 조치를 이행해야 합니다.
+
+- **회원 가입 및 관리.** **[SPARCS SSO의 개인정보취급방침](https://sparcssso.kaist.ac.kr/privacy/)** 을 따릅니다.
+- **서비스 제공.** "개발팀"은 서비스를 제공하는 데 필요한 개인 데이터를
+ 수집하며, 여기에는 서비스를 향상하기 위해, 감사나 데이터 분석 등의 내부 목적을 위해 또는 문제 해결을 위해 수집되는 개인 데이터가 포함될 수 있습니다. 과목 사전 및 후기, 모의 시간표 기능이 포함됩니다.
+- **사용자와의 통신.** 통신 내용에 응답하거나, "사용자"의 "서비스" 이용 또는 계정에 대해 "사용자"에게 연락하거나, 문제 해결을 위한 정보 제공을 요청하거나 제품에 대한 피드백을 요청하기 위한 것입니다.
+- **법률 준수.** 법률 등에 의해 수사기관의 적법한 요청에 대응하기 위함입니다.
+
+## 2. 개인정보의 처리 및 보유 기간
+
+- "개발팀"은 법령에 따른 개인정보 보유/이용기간 또는 "사용자"로부터 개인정보를 수집 시에 동의 받은 개인정보 보유/이용기간 내에서 개인정보를 처리/보유합니다.
+- 각각의 개인정보 처리 및 보유 기간은 다음과 같습니다.
+ - 회원 가입 및 관리. **[SPARCS SSO의 개인정보취급방침](https://sparcssso.kaist.ac.kr/privacy/)** 을 따릅니다.
+ - 그 외
+ - "서비스" 탈퇴 시까지
+ - 관계 법령 위반에 따른 수사 및 조사 등이 진행 중인 경우에는 해당 수사 및 조사 종료 시까지
+
+## 3. 개인정보의 제3자 제공
+
+"개발팀"은 정보주체의 개인정보를 『1. 개인정보의 처리 목적』 에서 명시한 범위 내에서만 처리하며, 정보주체의 동의, 법률의 특별한 규정 등 개인정보 보호법 제17조 및 제18조에 해당하는 경우에만 개인정보를 제3자에게 제공합니다. "개발팀"은 다음과 같이 개인정보를 제3자에게 제공하되, 제한된 정보 만을 제공하여 실제로 제3자가 개인에 관해 식별이 불가능하도록 하였습니다.
+
+- Google LLC (인터넷 서비스 제공 업체)
+ - 개인정보를 제공받는 자: Google LLC
+ - 제공받는 자의 개인정보 이용목적: "개발팀"이 "서비스"의 기능 향상을 위해서 Google로부터 필요로 하는 비즈니스 데이터 분석 기능 (Google Analytics) 제공, "개발팀"이 "서비스"의 문제 해결을 위해서 Googl로부터 필요로 하는 오류 보고 솔루션(Firebase Crashlytics)의 데이터 제공
+ - 제공하는 개인정보 항목: 후기에 대한 비식별화된 "좋아요" 및 "신고" 활동 기록, 비식별화된 "사용자"가 "서비스"에 대해 평가를 내렸는지 여부, 비식별화된 모의 시간표 및 위시리스트 수정 기록, 비식별화된 후기 작성 기록, 오류 발생 시 해당 로그를 전송하는 "사용자"의 비식별화된 고유번호, 기기 정보 및 앱 정보
+
+## 4. 정보주체와 법정대리인의 권리, 의무 및 행사방법
+
+- 정보주체는 "개발팀"에 대해 언제든지 개인정보 열람/정정/삭제/처리정지 요구 등의 권리를 행사할 수 있습니다.
+- 위 사항에 따른 권리 행사는 "개발팀"에 대해 전자우편 (주소: otlplus@sparcs.org) 을 통해 하실 수 있으며, "개발팀"은 해당 요청을 전달 받았을 경우 가능한 범위 내에서 지체 없이 조치해야 합니다.
+- 권리 행사는 정보주체의 법정대리인이나 위임을 받은 자 등 대리인을 통하여 하실 수 있습니다. 이 경우 "개인정보 처리 방법에 대한 고시(제2020-7호)" 별지 제11호 서식에 따른 위임장을 제출하셔야 합니다.
+- 개인정보 열람 및 처리정지 요구는 개인정보보호법 제35조 제4항, 제37조 제2항에 의하여 정보주체의 권리가 제한될 수 있습니다.
+- 개인정보의 정정 및 삭제 요구는 다른 법령에서 그 개인정보가 수집 대상으로 명시되어 있는 경우에는 그 삭제를 요구할 수 없습니다.
+- "개발팀"은 정보주체 권리에 따른 열람의 요구, 정정/삭제의 요구, 처리정지의 요구 시 열람 등 요구를 한 자가 본인이거나 정당한 대리인인지 확인해야 합니다.
+- 그 외 SPARCS SSO 서비스에 의해 관리되는 개인 정보의 권리 행사에 관해서는 **[SPARCS SSO의 개인정보취급방침](https://sparcssso.kaist.ac.kr/privacy/)** 을 따릅니다.
+
+## 5. 처리하는 개인정보 항목
+
+"개발팀"은 다음의 개인정보 항목을 처리하고 있습니다.
+
+- 회원 가입 및 관리
+ - 필수항목: 학번
+ - 선택항목: 이메일, SNS 계정 식별자
+ - 그 외 **[SPARCS SSO의 개인정보취급방침](https://sparcssso.kaist.ac.kr/privacy/)** 에 정의되어 있는 항목
+- 과목 사전 및 후기 기능 제공
+ - 필수항목: 소속학과, 전공, 수강한 강의
+ - 선택항목: 관심학과, 작성한 후기 목록, 좋아요한 후기 목록, 신고한 후기 목록, 열람한 강좌 목록
+- 모의 시간표 기능 제공
+ - 필수항목: 수강한 강의
+ - 선택항목: 모의 시간표에 추가한 과목 목록, 위시리스트에 추가한 과목 목록
+- 번역 기능 제공
+ - 선택항목: 사용 언어
+- 서비스 개선
+ - 선택항목: "서비스" 자체에 "사용자"가 내린 별점 평가, 각 기능의 사용 시점과 관련 매개변수
+ - 선택항목: "서비스" 이용 중 오류가 발생한 "사용자"의 식별자, 기기 및 앱 정보
+- 인터넷 서비스 이용과정에서 아래 개인정보 항목이 자동으로 생성되어 수집될 수 있습니다.
+ - IP주소, 쿠키, MAC주소, 서비스 이용기록, 방문기록
+
+## 6. 개인정보 파기 절차 및 방법
+
+- "개발팀"은 개인정보 보유기간의 경과, 처리목적 달성 등 개인정보가 불필요하게 되었을 때에는 지체없이 해당 개인정보를 파기합니다.
+- "사용자"로부터 동의받은 개인정보 보유기간이 경과하거나 처리목적이 달성되었음에도 불구하고 다른 법령에 따라 개인정보를 계속 보존하여야 하는 경우에는, 해당 개인정보를 계속 보존할 수 있습니다.
+- 개인정보 파기의 절차 및 방법은 다음과 같습니다.
+ - 파기절차
+ "개발팀"은 파기 사유가 발생한 개인정보를 선정하고, "사용자"의 개인정보 보호책임자의 승인을 받아 개인정보를 파기합니다.
+ - 파기방법
+ "개발팀"은 전자적 파일 형태로 기록/저장된 개인정보는 기록을 재생할 수 없도록 파기합니다.
+
+## 7. 개인정보의 안전성 확보 조치
+
+"개발팀"은 개인정보의 안전성 확보를 위해 다음과 같은 조치를 취하고 있습니다.
+
+- 관리적 조치: 제한된 관리자에게만 접근 권한 허용
+- 기술적 조치: 클라우드 서비스에서 제공하는 방화벽 등의 보안 기능 사용, 비밀번호 해쉬화 저장, 비정상적 접속 감지 및 기록, 인증 과정에서의 암호화, 그 외 **[SPARCS SSO의 개인정보취급방침](https://sparcssso.kaist.ac.kr/privacy/)** 에 언급된 사항
+
+## 8. 개인정보 자동 수집 장치의 설치/운영 및 거부
+
+- "개발팀"은 "사용자"에게 로그인 세션 유지 기능을 제공하기 위해 이용정보를 저장하고 수시로 불러오는 '쿠키(Cookie)'를 사용합니다.
+ - 거부 방법: 웹 브라우저 설정에서 쿠키 사용을 비활성화하여 거부할 수 있습니다.
+ - 쿠키 저장을 거부할 경우 기능 상에 문제가 발생할 수 있습니다.
+- "개발팀"은 데이터 분석을 통한 서비스 개선을 위해 Google Analytics 를 사용하여 사용 기록을 수집합니다.
+ - 거부 방법(웹): [Google Analytics 차단 브라우저 확장 기능](https://support.google.com/analytics/answer/181881?hl=ko) 을 설치하여 웹사이트 활동 제공을 차단할 수 있습니다.
+ - 거부 방법(앱): 현재 Firebase Flutter SDK의 기능 미구현으로 인해 Google Analytics 비활성화가 불가능합니다. 거부하시려면 모바일 웹 버전을 사용하여 주십시오.
+- "개발팀"은 "서비스"의 모바일 애플리케이션에 한하여 오류 분석을 위해 Firebase Crashlytics를 사용하여 자동으로 수집합니다.
+ - 거부 방법: 앱 설정에서 "오류 로그 전송"을 꺼주십시오. 오류 로그에 "사용자"의 식별자가 포함되는 것을 거부하려면 "익명으로 전송"을 켜주십시오.
+
+## 9. 개인정보 보호책임자
+
+- "개발팀"은 개인정보 처리에 관한 업무를 총괄해서 책임지고, 개인정보 처리와 관련한 "사용자"의 불만처리 및 피해구제 등을 위하여 아래와 같이 개인정보 보호책임자를 지정하고 있습니다.
+ - 성명: 한승현
+ - 직책: OTL 프로젝트 매니저
+ - 연락처: otlplus@sparcs.org (개발팀으로 연결됩니다)
+- "사용자"는 "서비스"를 이용하면서 발생한 모든 개인정보 보호 관련 문의, 불만처리, 피해구제 등에 관한 사항 개인정보 보호책임자 및 개발팀에 문의할 수 있습니다. "개발팀"은 "사용자"의 문의에 대해 가능한 범위 내에서 지체없이 답변 및 처리해야 합니다.
+
+## 10. 추가적인 이용/제공 판단 기준
+
+"개발팀"은 『개인정보 보호법』 제15조제3항 및 제17조제4항에 따라 『개인정보 보호법 시행령』 제14조의2에 따른 사항을 고려하여 "사용자"의 동의 없이 개인정보를 추가적으로 이용/제공할 수 있습니다.
+
+이에 따라 "개발팀"은 "사용자"의 동의 없이 추가적인 이용/제공을 하기 위해 다음과 같은 사항을 고려해야 합니다.
+
+- 개인정보를 추가적으로 이용/제공하려는 목적이 당초 수집 목적과 관련성이 있는지 여부
+- 개인정보를 수집한 정황 또는 처리 관행에 비추어 볼 때 추가적인 이용/제공에 대한 예측 가능성이 있는지 여부
+- 개인정보의 추가적인 이용/제공이 "사용자"의 이익을 부당하게 침해하였는지 여부
+- 가명처리 또는 암호화 등 안전성 확보에 필요한 조치를 하였는지 여부
+
+추가적인 이용/제공 시 고려사항에 대한 판단기준은 "개발팀" 스스로 자율적으로 판단하여 작성/공개해야 합니다.
+
+## 11. 개인정보 열람청구
+
+"사용자"는 『개인정보 보호법』 제35조에 따른 개인정보의 열람 청구는 『9. 개인정보 보호책임자』 에 명시된 연락처를 통해 가능합니다.
+
+## 12. 개인정보 처리방침 변경
+
+이 개인정보 처리방침은 2022년 2월 15일에 마지막으로 수정되었으며, 2022년 2월 15일부터 적용됩니다.
+`,xle={h1:e=>c.jsx("div",{...e,className:g("title")}),h2:e=>c.jsx("div",{...e,className:g("small-title")})};class wle extends X.Component{render(){return c.jsx("section",{className:g("content","content--no-scroll"),children:c.jsx("div",{className:g("page-grid","page-grid--full"),children:c.jsx("div",{className:g("section"),children:c.jsx("div",{className:g("subsection","subsection--privacy"),children:c.jsx(ct,{children:c.jsx("div",{className:g("subsection--privacy__content"),children:c.jsx(e1,{components:xle,children:Sle})})})})})})})}}class Tle extends X.Component{componentDidMount(){me.get("/api/feeds",{params:{date:new Date().toJSON().slice(0,10)}}).then(t=>{console.log(t.data)}).catch(t=>{console.log(t)})}render(){return c.jsx("div",{})}}class YI extends X.Component{constructor(){super(...arguments);N(this,"_getMessageName",n=>{const r={"invalid-login":"invalidLogin","no-such-user":"noSuchUser","problem-unregister":"problemUnregister"}[n];return r===void 0?"unknown":r})}render(){const{t:n}=this.props,{match:r}=this.props,i=this._getMessageName(r.params.message),s=n(`ui.error.${i}.title`),o=n(`ui.error.${i}.message`);return c.jsx("section",{className:g("content","content--no-scroll"),children:c.jsx("div",{className:g("page-grid","page-grid--full"),children:c.jsx("div",{className:g("section"),children:c.jsxs("div",{className:g("subsection","subsection--error"),children:[c.jsx("div",{children:s}),c.jsx("div",{children:o})]})})})})}}YI.propTypes={};const Rle=de()(YI),Xk={course:null,reviews:null,lectures:null},kle=(e=Xk,t)=>{switch(t.type){case hD:return Xk;case mD:{const n=!e.course||e.course.id!==t.course.id;return Object.assign({},e,{course:t.course},n?{reviews:null,lectures:null}:{})}case gD:return Object.assign({},e,{course:null,reviews:null,lectures:null});case _D:return Object.assign({},e,{reviews:t.reviews});case yD:{const n=e.reviews,{review:r,isNew:i}=t,s=n.findIndex(l=>l.id===r.id),o=s!==-1?[...n.slice(0,s),r,...n.slice(s+1,n.length)]:i?[r,...n.slice()]:[...n.slice()];return Object.assign({},e,{reviews:o})}case vD:return Object.assign({},e,{lectures:t.lectures});default:return e}},Kk={open:!0,lastSearchOption:{}},Ele=(e=Kk,t)=>{switch(t.type){case uD:return Kk;case cD:return Object.assign({},e,{open:!0});case dD:return Object.assign({},e,{open:!1,start:null,end:null,day:null});case fD:return Object.assign({},e,{lastSearchOption:t.lastSearchOption});default:return e}},Cle=Vl({list:oQ,courseFocus:kle,search:Ele}),Qk={year:null,semester:null},Ole=(e=Qk,t)=>{switch(t.type){case LA:return Qk;case DA:return Object.assign({},e,{year:t.year,semester:t.semester});default:return e}},Zk={open:!0,lastSearchOption:{},classtimeBegin:null,classtimeEnd:null,classtimeDay:null},Ple=(e=Zk,t)=>{switch(t.type){case SA:return Zk;case xA:return Object.assign({},e,{open:!0});case wA:return Object.assign({},e,{open:!1,classtimeBegin:null,classtimeEnd:null,classtimeDay:null});case kA:return Object.assign({},e,{lastSearchOption:t.lastSearchOption});case TA:return Object.assign({},e,{classtimeBegin:t.classtimeBegin,classtimeEnd:t.classtimeEnd,classtimeDay:t.classtimeDay});case RA:return Object.assign({},e,{classtimeBegin:null,classtimeEnd:null,classtimeDay:null});default:return e}},zI=-1,Jk={timetables:null,myTimetable:{id:zI,lectures:[],isReadOnly:!0},selectedTimetable:null,cellWidth:200,cellHeight:50,isDragging:!1,isTimetableTabsOpenOnMobile:!1},Lle=(e=Jk,t)=>{switch(t.type){case NA:return Jk;case AA:return Object.assign({},e,{timetables:t.timetables,selectedTimetable:e.selectedTimetable&&e.selectedTimetable.id===e.myTimetable.id?e.selectedTimetable:t.timetables[0]});case jA:return Object.assign({},e,{timetables:null,selectedTimetable:e.selectedTimetable&&e.selectedTimetable.id===e.myTimetable.id?{...e.selectedTimetable,lectures:[]}:null});case IA:return Object.assign({},e,{myTimetable:{...e.myTimetable,lectures:t.lectures},selectedTimetable:e.selectedTimetable&&e.selectedTimetable.id===e.myTimetable.id?{...e.selectedTimetable,lectures:t.lectures}:e.selectedTimetable});case MA:return Object.assign({},e,{selectedTimetable:t.timetable});case FA:{const n=e.timetables.length>0?Math.max(...e.timetables.map(i=>i.arrange_order))+1:0,r={id:t.id,lectures:[],arrange_order:n};return Object.assign({},e,{selectedTimetable:r,timetables:[...e.timetables,r]})}case $A:{const n=e.timetables.findIndex(s=>s.id===t.timetable.id),r=e.timetables.filter(s=>s.id!==t.timetable.id),i=n!==e.timetables.length-1?r[n]:r[n-1];return Object.assign({},e,{selectedTimetable:i,timetables:r})}case qA:{const n={id:t.id,lectures:t.timetable.lectures.slice(),arrange_order:Math.max(...e.timetables.map(r=>r.arrange_order))+1};return Object.assign({},e,{selectedTimetable:n,timetables:[...e.timetables,n]})}case UA:{const n={...e.selectedTimetable,lectures:e.selectedTimetable.lectures.concat([t.lecture])},r=e.timetables.map(i=>i.id===n.id?n:i);return Object.assign({},e,{selectedTimetable:n,timetables:r})}case BA:{const n={...e.selectedTimetable,lectures:e.selectedTimetable.lectures.filter(i=>i.id!==t.lecture.id)},r=e.timetables.map(i=>i.id===n.id?n:i);return Object.assign({},e,{selectedTimetable:n,timetables:r})}case HA:{const n=e.timetables.map(i=>i.id===t.timetable.id?{...i,arrange_order:t.arrangeOrder}:t.arrangeOrder<=i.arrange_order&&i.arrange_orderi.arrange_order-s.arrange_order);const r=e.selectedTimetable.id===zI?e.selectedTimetable:n.find(i=>i.id===e.selectedTimetable.id);return Object.assign({},e,{timetables:n,selectedTimetable:r})}case WA:return Object.assign({},e,{cellWidth:t.width,cellHeight:t.height});case YA:return Object.assign({},e,{isDragging:t.isDragging});case zA:return Object.assign({},e,{isTimetableTabsOpenOnMobile:t.isTimetableTabsOpenOnMobile});default:return e}},Dle=Vl({semester:Ole,search:Ple,list:Kee,timetable:Lle,lectureFocus:jZ}),eE={reviews:null},Nle=(e=eE,t)=>{switch(t.type){case xj:return eE;case wj:{const n=[...e.reviews!==null?e.reviews:[],...t.reviews];return Object.assign({},e,{reviews:n})}case Tj:{const n=e.reviews,{review:r,isNew:i}=t,s=n.findIndex(l=>l.id===r.id),o=s!==-1?[...n.slice(0,s),r,...n.slice(s+1,n.length)]:i?[r,...n.slice()]:[...n.slice()];return Object.assign({},e,{reviews:o})}default:return e}},tE={reviews:null},Ale=(e=tE,t)=>{switch(t.type){case Cj:return tE;case Oj:return Object.assign({},e,{reviews:t.reviews});case cne:{const n=e.reviews,{review:r,isNew:i}=t,s=n.findIndex(l=>l.id===r.id),o=s!==-1?[...n.slice(0,s),r,...n.slice(s+1,n.length)]:i?[r,...n.slice()]:[...n.slice()];return Object.assign({},e,{reviews:o})}default:return e}},nE={reviewsBySemester:{},reviewCountBySemester:{}},jle=(e=nE,t)=>{switch(t.type){case Dj:return nE;case Nj:{const n=e.reviewsBySemester[t.semester]||[];return Object.assign({},e,{reviewsBySemester:{...e.reviewsBySemester,[t.semester]:n.concat(t.reviews)}})}case Aj:return Object.assign({},e,{reviewCountBySemester:{...e.reviewCountBySemester,[t.semester]:t.count}});default:return e}},Ile=Vl({reviewsFocus:Yte,latestReviews:Nle,likedReviews:Ale,rankedReviews:jle}),Mle={user:void 0},Fle=(e=Mle,t)=>{switch(t.type){case ZD:return Object.assign({},e,{user:t.user});case JD:{const n=e.user.reviews,{review:r}=t,i=n.findIndex(o=>o.id===r.id),s=i!==-1?[...n.slice(0,i),r,...n.slice(i+1,n.length)]:[...n.slice(),r];return Object.assign({},e,{user:{...e.user,reviews:s}})}default:return e}},$le="C_S_",VI=$le+"SET_SEMESTERS";function qle(e){return{type:VI,semesters:e}}const Ule={semesters:null},Ble=(e=Ule,t)=>{switch(t.type){case VI:return Object.assign({},e,{semesters:t.semesters});default:return e}},Hle="C_T_",GI=Hle+"SET_TRACKS";function Wle(e){return{type:GI,tracks:e}}const Yle={tracks:null},zle=(e=Yle,t)=>{switch(t.type){case GI:return Object.assign({},e,{tracks:t.tracks});default:return e}},Vle="C_M_",XI=Vle+"SET_IS_PORTRAIT";function Gle(e){return{type:XI,isPortrait:e}}const Xle={isPortrait:!1},Kle=(e=Xle,t)=>{switch(t.type){case XI:return Object.assign({},e,{isPortrait:t.isPortrait});default:return e}},Qle=Vl({user:Fle,semester:Ble,track:zle,media:Kle}),rE={planners:null,selectedPlanner:null,cellWidth:200,cellHeight:50,isDragging:!1,isTrackSettingsSectionOpen:!1,isPlannerTabsOpenOnMobile:!1},z_=e=>{switch(e){case"TAKEN":return"taken_items";case"FUTURE":return"future_items";case"ARBITRARY":return"arbitrary_items";default:return}},Zle=(e=rE,t)=>{switch(t.type){case wN:return rE;case TN:return Object.assign({},e,{planners:t.planners,selectedPlanner:t.planners.length>0?t.planners[0]:null});case RN:return Object.assign({},e,{planners:null,selectedPlanner:null});case kN:return Object.assign({},e,{selectedPlanner:t.planner});case EN:return Object.assign({},e,{selectedPlanner:t.newPlanner,planners:[...e.planners,t.newPlanner]});case CN:{const n=e.planners.findIndex(s=>s.id===t.planner.id),r=e.planners.filter(s=>s.id!==t.planner.id),i=n!==e.planners.length-1?r[n]:r[n-1];return Object.assign({},e,{selectedPlanner:i,planners:r})}case ON:return Object.assign({},e,{selectedPlanner:e.selectedPlanner.id===t.updatedPlanner.id?t.updatedPlanner:e.selectedPlanner,planners:e.planners.map(n=>n.id===t.updatedPlanner.id?t.updatedPlanner:n)});case PN:{const n=z_(t.item.item_type),r={...e.selectedPlanner,[n]:e.selectedPlanner[n].concat([t.item])},i=e.planners.map(s=>s.id===r.id?r:s);return Object.assign({},e,{selectedPlanner:r,planners:i})}case LN:{const n=z_(t.item.item_type),r={...e.selectedPlanner,[n]:e.selectedPlanner[n].map(s=>s.id===t.item.id?t.item:s)},i=e.planners.map(s=>s.id===r.id?r:s);return Object.assign({},e,{selectedPlanner:r,planners:i})}case DN:{const n=z_(t.item.item_type),r={...e.selectedPlanner,[n]:e.selectedPlanner[n].filter(s=>s.id!==t.item.id)},i=e.planners.map(s=>s.id===r.id?r:s);return Object.assign({},e,{selectedPlanner:r,planners:i})}case NN:{const n=e.planners.map(i=>i.id===t.planner.id?{...i,arrange_order:t.arrangeOrder}:t.arrangeOrder<=i.arrange_order&&i.arrange_orderi.arrange_order-s.arrange_order);const r=n.find(i=>i.id===e.selectedPlanner.id);return Object.assign({},e,{planners:n,selectedPlanner:r})}case AN:return Object.assign({},e,{cellWidth:t.width,cellHeight:t.height});case jN:return Object.assign({},e,{isTrackSettingsSectionOpen:t.isTrackSettingsSectionOpen});default:return e}},iE={open:!0,lastSearchOption:{}},Jle=(e=iE,t)=>{switch(t.type){case _N:return iE;case yN:return Object.assign({},e,{open:!0});case vN:return Object.assign({},e,{open:!1,start:null,end:null,day:null});case bN:return Object.assign({},e,{lastSearchOption:t.lastSearchOption});default:return e}},eue=Vl({itemFocus:IJ,list:VJ,planner:Zle,search:Jle}),Za=yL(Vl({common:Qle,dictionary:Cle,timetable:Dle,writeReviews:Ile,planner:eue}));class tue extends X.Component{constructor(){super(...arguments);N(this,"portraitMediaQuery",window.matchMedia("(max-aspect-ratio: 4/3)"));N(this,"_fetchUser",()=>{me.get("/session/info",{metadata:{gaCategory:"User",gaVariable:"Get / Instance"}}).then(n=>{Za.dispatch(dv(n.data))}).catch(n=>{n.response&&n.response.status===401&&Za.dispatch(dv(null))})});N(this,"_fetchSemesters",()=>{me.get("/api/semesters",{params:{order:["year","semester"]},metadata:{gaCategory:"Semester",gaVariable:"GET / List"}}).then(n=>{Za.dispatch(qle(n.data))}).catch(n=>{}),me.get("/api/tracks",{params:{},metadata:{gaCategory:"Track",gaVariable:"GET / List"}}).then(n=>{Za.dispatch(Wle(n.data))}).catch(n=>{})});N(this,"_updateSizeProperty",()=>{document.documentElement.style.setProperty("--window-inner-height",`${window.innerHeight}px`)});N(this,"_updateIsPortrait",()=>{Za.dispatch(Gle(this.portraitMediaQuery.matches))})}componentDidMount(){this._fetchUser(),this._fetchSemesters(),this._updateSizeProperty(),window.addEventListener("resize",this._updateSizeProperty),this._updateIsPortrait(),this.portraitMediaQuery.addEventListener("change",this._updateIsPortrait)}componentWillUnmount(){window.removeEventListener("resize",this._updateSizeProperty),this.portraitMediaQuery.removeEventListener("change",this._updateIsPortrait)}render(){const n=i=>{if(typeof i=="object")return Object.entries(i).map(([o,l])=>[o,n(l)]).reduce((o,l)=>Object.assign({},o,{[l[0]]:l[1]}),{});if(/^-?[0-9]+$/.test(i))return parseInt(i,10);const s={true:!0,false:!1,null:null,undefined:void 0};return i in s?s[i]:i},r=i=>{const s=Ut.parse(i,{ignoreQueryPrefix:!0});return n(s)};return c.jsx(yX,{store:Za,children:c.jsxs(c.Fragment,{children:[c.jsx(rQ,{}),c.jsxs(u9,{children:[c.jsx(wr,{exact:!0,path:"/",component:ere}),c.jsx(wr,{exact:!0,path:"/dictionary",render:i=>i.location.search?c.jsx(Qs,{to:{...i.location,state:{...i.location.state,...r(i.location.search)},search:""}}):c.jsx(cJ,{...i})}),c.jsx(wr,{exact:!0,path:"/planner",render:i=>i.location.search?c.jsx(Qs,{to:{...i.location,state:{...i.location.state,...r(i.location.search)},search:""}}):c.jsx(Lee,{...i})}),c.jsx(wr,{exact:!0,path:"/timetable",render:i=>i.location.search?c.jsx(Qs,{to:{...i.location,state:{...i.location.state,...r(i.location.search)},search:""}}):c.jsx($te,{...i})}),c.jsx(wr,{exact:!0,path:"/timetable/syllabus",render:i=>i.location.search?c.jsx(Qs,{to:{...i.location,state:{...i.location.state,...r(i.location.search)},search:""}}):c.jsx(Ene,{...i})}),c.jsx(wr,{exact:!0,path:"/write-reviews",render:i=>i.location.search?c.jsx(Qs,{to:{...i.location,state:{...i.location.state,...r(i.location.search)},search:""}}):c.jsx(Tne,{...i})}),c.jsx(wr,{exact:!0,path:"/account",component:cre}),c.jsx(wr,{exact:!0,path:"/credits",component:uie}),c.jsx(wr,{exact:!0,path:"/licenses",component:cie}),c.jsx(wr,{exact:!0,path:"/privacy",component:wle}),c.jsx(wr,{exact:!0,path:"/test",component:Tle}),c.jsx(wr,{exact:!0,path:"/error/:message",component:Rle}),c.jsx(Qs,{exact:!0,from:"/index.html",to:"/"}),c.jsx(Qs,{exact:!0,from:"/main",to:"/"}),c.jsx(Qs,{from:"/",to:"/"})]})]})})}}const nue=!!(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function rue(){if("serviceWorker"in navigator){if(new URL({}.PUBLIC_URL,window.location).origin!==window.location.origin)return;window.addEventListener("load",()=>{const t=`${{}.PUBLIC_URL}/service-worker.js`;nue?(iue(t),navigator.serviceWorker.ready.then(()=>{console.log("This web app is being served cache-first by a service worker. To learn more, visit https://goo.gl/SC7cgQ")})):KI(t)})}}function KI(e){navigator.serviceWorker.register(e).then(t=>{t.onupdatefound=()=>{const n=t.installing;n.onstatechange=()=>{n.state==="installed"&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}}).catch(t=>{console.error("Error during service worker registration:",t)})}function iue(e){fetch(e).then(t=>{t.status===404||t.headers.get("content-type").indexOf("javascript")===-1?navigator.serviceWorker.ready.then(n=>{n.unregister().then(()=>{window.location.reload()})}):KI(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const QI=_7(),sue="UA-144615112-2";Je.initialize(sue);QI.listen(e=>{Je.set({page:e.pathname}),Je.pageview(e.pathname)});ge.use(YE).use(VE).use(PH).init({resources:{en:{translation:u5},ko:{translation:p5}},fallbackLng:["ko","en"],debug:!1,react:{useSuspense:!1},interpolation:{escapeValue:!1,formatSeparator:",",format:(e,t,n)=>e instanceof Date?ye(e).locale(n).format(t):e.toString()}});me.defaults.xsrfHeaderName="X-CSRFToken";me.defaults.xsrfCookieName="csrftoken";me.defaults.baseURL=cb;me.defaults.withCredentials=!0;me.defaults.paramsSerializer=e=>Ut.stringify(e,{arrayFormat:"repeat"});me.interceptors.request.use(e=>(e.metadata={...e.metadata,startTime:new Date},e),e=>Promise.reject(e));me.interceptors.response.use(e=>(e.config.metadata.endTime=new Date,e.config.metadata.duration=e.config.metadata.endTime-e.config.metadata.startTime,Je.timing({category:e.config.metadata.gaCategory||"Undefined",variable:e.config.metadata.gaVariable||"Undefined",value:e.config.metadata.duration}),e),e=>(e.config.metadata.endTime=new Date,e.config.metadata.duration=e.config.metadata.endTime-e.config.metadata.startTime,Promise.reject(e)));dX.render(c.jsx(LV,{history:QI,children:c.jsx(tue,{})}),document.getElementById("root"));try{rue()}catch(e){console.log(e)}});export default oue();
diff --git a/dist/assets/kaist_map-70258a52.jpg b/dist/assets/kaist_map-70258a52.jpg
new file mode 100644
index 0000000..04233ff
Binary files /dev/null and b/dist/assets/kaist_map-70258a52.jpg differ
diff --git a/dist/assets/lecture_downarrow-031c69b7.svg b/dist/assets/lecture_downarrow-031c69b7.svg
new file mode 100644
index 0000000..54fa13e
--- /dev/null
+++ b/dist/assets/lecture_downarrow-031c69b7.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/lecture_downarrow_hover-a7115288.svg b/dist/assets/lecture_downarrow_hover-a7115288.svg
new file mode 100644
index 0000000..4a85636
--- /dev/null
+++ b/dist/assets/lecture_downarrow_hover-a7115288.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/lecture_selector-1881f565.svg b/dist/assets/lecture_selector-1881f565.svg
new file mode 100644
index 0000000..79d3def
--- /dev/null
+++ b/dist/assets/lecture_selector-1881f565.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/lecture_uparrow-79b4db93.svg b/dist/assets/lecture_uparrow-79b4db93.svg
new file mode 100644
index 0000000..c6f7e2e
--- /dev/null
+++ b/dist/assets/lecture_uparrow-79b4db93.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/lecture_uparrow_hover-d81fc5e0.svg b/dist/assets/lecture_uparrow_hover-d81fc5e0.svg
new file mode 100644
index 0000000..0c2ffb1
--- /dev/null
+++ b/dist/assets/lecture_uparrow_hover-d81fc5e0.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/minus_circled-6624aad7.svg b/dist/assets/minus_circled-6624aad7.svg
new file mode 100644
index 0000000..535f000
--- /dev/null
+++ b/dist/assets/minus_circled-6624aad7.svg
@@ -0,0 +1,11 @@
+
+
+
\ No newline at end of file
diff --git a/dist/assets/plus_circled-19ac88aa.svg b/dist/assets/plus_circled-19ac88aa.svg
new file mode 100644
index 0000000..48090fc
--- /dev/null
+++ b/dist/assets/plus_circled-19ac88aa.svg
@@ -0,0 +1,12 @@
+
+
+
\ No newline at end of file
diff --git a/dist/assets/radio_selected-bbcca5bb.svg b/dist/assets/radio_selected-bbcca5bb.svg
new file mode 100644
index 0000000..db552ec
--- /dev/null
+++ b/dist/assets/radio_selected-bbcca5bb.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/radio_selected_hover-db074344.svg b/dist/assets/radio_selected_hover-db074344.svg
new file mode 100644
index 0000000..b93a88d
--- /dev/null
+++ b/dist/assets/radio_selected_hover-db074344.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/radio_unselected-9aa58def.svg b/dist/assets/radio_unselected-9aa58def.svg
new file mode 100644
index 0000000..217358c
--- /dev/null
+++ b/dist/assets/radio_unselected-9aa58def.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/radio_unselected_hover-4e8c1a3d.svg b/dist/assets/radio_unselected_hover-4e8c1a3d.svg
new file mode 100644
index 0000000..d34bace
--- /dev/null
+++ b/dist/assets/radio_unselected_hover-4e8c1a3d.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/related_arrow-7efa263a.svg b/dist/assets/related_arrow-7efa263a.svg
new file mode 100644
index 0000000..b2d2ea3
--- /dev/null
+++ b/dist/assets/related_arrow-7efa263a.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/search-bcdade24.svg b/dist/assets/search-bcdade24.svg
new file mode 100644
index 0000000..5c20fd4
--- /dev/null
+++ b/dist/assets/search-bcdade24.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/search_hover-8039fec1.svg b/dist/assets/search_hover-8039fec1.svg
new file mode 100644
index 0000000..941b747
--- /dev/null
+++ b/dist/assets/search_hover-8039fec1.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/semester_next-811848bb.svg b/dist/assets/semester_next-811848bb.svg
new file mode 100644
index 0000000..a651067
--- /dev/null
+++ b/dist/assets/semester_next-811848bb.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/semester_next_disabled-30d46b7f.svg b/dist/assets/semester_next_disabled-30d46b7f.svg
new file mode 100644
index 0000000..4c05ccd
--- /dev/null
+++ b/dist/assets/semester_next_disabled-30d46b7f.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/semester_next_hover-c40b4d50.svg b/dist/assets/semester_next_hover-c40b4d50.svg
new file mode 100644
index 0000000..7f1c2e0
--- /dev/null
+++ b/dist/assets/semester_next_hover-c40b4d50.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/semester_prev-4afe1da8.svg b/dist/assets/semester_prev-4afe1da8.svg
new file mode 100644
index 0000000..1688ccb
--- /dev/null
+++ b/dist/assets/semester_prev-4afe1da8.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/semester_prev_disabled-fc0ce483.svg b/dist/assets/semester_prev_disabled-fc0ce483.svg
new file mode 100644
index 0000000..e7c1acb
--- /dev/null
+++ b/dist/assets/semester_prev_disabled-fc0ce483.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/semester_prev_hover-5aec42e2.svg b/dist/assets/semester_prev_hover-5aec42e2.svg
new file mode 100644
index 0000000..7da275f
--- /dev/null
+++ b/dist/assets/semester_prev_hover-5aec42e2.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_googlecalendar-433698c5.svg b/dist/assets/share_googlecalendar-433698c5.svg
new file mode 100644
index 0000000..b1c0a98
--- /dev/null
+++ b/dist/assets/share_googlecalendar-433698c5.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_googlecalendar_disable-8a352618.svg b/dist/assets/share_googlecalendar_disable-8a352618.svg
new file mode 100644
index 0000000..555ef8a
--- /dev/null
+++ b/dist/assets/share_googlecalendar_disable-8a352618.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_googlecalendar_hover-079533be.svg b/dist/assets/share_googlecalendar_hover-079533be.svg
new file mode 100644
index 0000000..58013b2
--- /dev/null
+++ b/dist/assets/share_googlecalendar_hover-079533be.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_icalendar-2352a6b5.svg b/dist/assets/share_icalendar-2352a6b5.svg
new file mode 100644
index 0000000..57e773b
--- /dev/null
+++ b/dist/assets/share_icalendar-2352a6b5.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_icalendar_disable-862542be.svg b/dist/assets/share_icalendar_disable-862542be.svg
new file mode 100644
index 0000000..06f33eb
--- /dev/null
+++ b/dist/assets/share_icalendar_disable-862542be.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_icalendar_hover-bafc17b5.svg b/dist/assets/share_icalendar_hover-bafc17b5.svg
new file mode 100644
index 0000000..971f236
--- /dev/null
+++ b/dist/assets/share_icalendar_hover-bafc17b5.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_image-fab40112.svg b/dist/assets/share_image-fab40112.svg
new file mode 100644
index 0000000..5b9bc60
--- /dev/null
+++ b/dist/assets/share_image-fab40112.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_image_disable-3bda0234.svg b/dist/assets/share_image_disable-3bda0234.svg
new file mode 100644
index 0000000..eb5fd8b
--- /dev/null
+++ b/dist/assets/share_image_disable-3bda0234.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_image_hover-56b9bcd1.svg b/dist/assets/share_image_hover-56b9bcd1.svg
new file mode 100644
index 0000000..34c365f
--- /dev/null
+++ b/dist/assets/share_image_hover-56b9bcd1.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_syllabus-4f8a89bb.svg b/dist/assets/share_syllabus-4f8a89bb.svg
new file mode 100644
index 0000000..7c75c3f
--- /dev/null
+++ b/dist/assets/share_syllabus-4f8a89bb.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_syllabus_disable-4d8f0aed.svg b/dist/assets/share_syllabus_disable-4d8f0aed.svg
new file mode 100644
index 0000000..25e1a65
--- /dev/null
+++ b/dist/assets/share_syllabus_disable-4d8f0aed.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/share_syllabus_hover-7b3ea40c.svg b/dist/assets/share_syllabus_hover-7b3ea40c.svg
new file mode 100644
index 0000000..8ef918f
--- /dev/null
+++ b/dist/assets/share_syllabus_hover-7b3ea40c.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/show_lectures-a9622f61.svg b/dist/assets/show_lectures-a9622f61.svg
new file mode 100644
index 0000000..b67d647
--- /dev/null
+++ b/dist/assets/show_lectures-a9622f61.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/show_lectures_hover-4e4f1136.svg b/dist/assets/show_lectures_hover-4e4f1136.svg
new file mode 100644
index 0000000..480f27b
--- /dev/null
+++ b/dist/assets/show_lectures_hover-4e4f1136.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/star-991bf703.svg b/dist/assets/star-991bf703.svg
new file mode 100644
index 0000000..2671fca
--- /dev/null
+++ b/dist/assets/star-991bf703.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/star_selected-07508c42.svg b/dist/assets/star_selected-07508c42.svg
new file mode 100644
index 0000000..8eeb5d6
--- /dev/null
+++ b/dist/assets/star_selected-07508c42.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/status_read-15f480dc.svg b/dist/assets/status_read-15f480dc.svg
new file mode 100644
index 0000000..8e6d73e
--- /dev/null
+++ b/dist/assets/status_read-15f480dc.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/status_unread-c8988fc2.svg b/dist/assets/status_unread-c8988fc2.svg
new file mode 100644
index 0000000..9f4e7a0
--- /dev/null
+++ b/dist/assets/status_unread-c8988fc2.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/switch_table-221c60a1.svg b/dist/assets/switch_table-221c60a1.svg
new file mode 100644
index 0000000..049172b
--- /dev/null
+++ b/dist/assets/switch_table-221c60a1.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/switch_table_hover-58c3f8d0.svg b/dist/assets/switch_table_hover-58c3f8d0.svg
new file mode 100644
index 0000000..b5ac3c7
--- /dev/null
+++ b/dist/assets/switch_table_hover-58c3f8d0.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_basic-f8694e88.svg b/dist/assets/tab_basic-f8694e88.svg
new file mode 100644
index 0000000..0b788c2
--- /dev/null
+++ b/dist/assets/tab_basic-f8694e88.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_basic_hover-7df8b205.svg b/dist/assets/tab_basic_hover-7df8b205.svg
new file mode 100644
index 0000000..e322d26
--- /dev/null
+++ b/dist/assets/tab_basic_hover-7df8b205.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_cart-aaa614f8.svg b/dist/assets/tab_cart-aaa614f8.svg
new file mode 100644
index 0000000..8e0d2fa
--- /dev/null
+++ b/dist/assets/tab_cart-aaa614f8.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_cart_hover-06c8430f.svg b/dist/assets/tab_cart_hover-06c8430f.svg
new file mode 100644
index 0000000..ddeafbd
--- /dev/null
+++ b/dist/assets/tab_cart_hover-06c8430f.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_humanity-f1065016.svg b/dist/assets/tab_humanity-f1065016.svg
new file mode 100644
index 0000000..bb3edc9
--- /dev/null
+++ b/dist/assets/tab_humanity-f1065016.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_humanity_hover-46069a67.svg b/dist/assets/tab_humanity_hover-46069a67.svg
new file mode 100644
index 0000000..f3b48ec
--- /dev/null
+++ b/dist/assets/tab_humanity_hover-46069a67.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_major-6b73ff47.svg b/dist/assets/tab_major-6b73ff47.svg
new file mode 100644
index 0000000..429d49a
--- /dev/null
+++ b/dist/assets/tab_major-6b73ff47.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_major_hover-c4a65745.svg b/dist/assets/tab_major_hover-c4a65745.svg
new file mode 100644
index 0000000..7b597e5
--- /dev/null
+++ b/dist/assets/tab_major_hover-c4a65745.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_search-85df18a3.svg b/dist/assets/tab_search-85df18a3.svg
new file mode 100644
index 0000000..f60e40d
--- /dev/null
+++ b/dist/assets/tab_search-85df18a3.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_search_hover-3cffbc38.svg b/dist/assets/tab_search_hover-3cffbc38.svg
new file mode 100644
index 0000000..f22a810
--- /dev/null
+++ b/dist/assets/tab_search_hover-3cffbc38.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_taken-4eecf8c5.svg b/dist/assets/tab_taken-4eecf8c5.svg
new file mode 100644
index 0000000..13784b1
--- /dev/null
+++ b/dist/assets/tab_taken-4eecf8c5.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/assets/tab_taken_hover-d2c5dfe0.svg b/dist/assets/tab_taken_hover-d2c5dfe0.svg
new file mode 100644
index 0000000..6877214
--- /dev/null
+++ b/dist/assets/tab_taken_hover-d2c5dfe0.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/index.html b/dist/index.html
new file mode 100644
index 0000000..cc76a5e
--- /dev/null
+++ b/dist/index.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+ OTL
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/static/favicon-120.png b/dist/static/favicon-120.png
new file mode 100644
index 0000000..07e4647
Binary files /dev/null and b/dist/static/favicon-120.png differ
diff --git a/dist/static/favicon-128.png b/dist/static/favicon-128.png
new file mode 100644
index 0000000..551cce6
Binary files /dev/null and b/dist/static/favicon-128.png differ
diff --git a/dist/static/favicon-152.png b/dist/static/favicon-152.png
new file mode 100644
index 0000000..f39de01
Binary files /dev/null and b/dist/static/favicon-152.png differ
diff --git a/dist/static/favicon-16.png b/dist/static/favicon-16.png
new file mode 100644
index 0000000..cc8f9ab
Binary files /dev/null and b/dist/static/favicon-16.png differ
diff --git a/dist/static/favicon-167.png b/dist/static/favicon-167.png
new file mode 100644
index 0000000..4af4090
Binary files /dev/null and b/dist/static/favicon-167.png differ
diff --git a/dist/static/favicon-180.png b/dist/static/favicon-180.png
new file mode 100644
index 0000000..d6715e2
Binary files /dev/null and b/dist/static/favicon-180.png differ
diff --git a/dist/static/favicon-192.png b/dist/static/favicon-192.png
new file mode 100644
index 0000000..4972eb9
Binary files /dev/null and b/dist/static/favicon-192.png differ
diff --git a/dist/static/favicon-196.png b/dist/static/favicon-196.png
new file mode 100644
index 0000000..5a494b6
Binary files /dev/null and b/dist/static/favicon-196.png differ
diff --git a/dist/static/favicon-32.png b/dist/static/favicon-32.png
new file mode 100644
index 0000000..910aef0
Binary files /dev/null and b/dist/static/favicon-32.png differ
diff --git a/dist/static/favicon-48.png b/dist/static/favicon-48.png
new file mode 100644
index 0000000..494a2dc
Binary files /dev/null and b/dist/static/favicon-48.png differ
diff --git a/dist/static/favicon-512.png b/dist/static/favicon-512.png
new file mode 100644
index 0000000..b243839
Binary files /dev/null and b/dist/static/favicon-512.png differ
diff --git a/dist/static/favicon-64.png b/dist/static/favicon-64.png
new file mode 100644
index 0000000..843b8a0
Binary files /dev/null and b/dist/static/favicon-64.png differ
diff --git a/dist/static/manifest.json b/dist/static/manifest.json
new file mode 100644
index 0000000..70b0abd
--- /dev/null
+++ b/dist/static/manifest.json
@@ -0,0 +1,48 @@
+{
+ "short_name": "OTL",
+ "name": "OTL - Online Timetable with Lectures",
+ "icons": [
+ {
+ "src": "favicon-192.png",
+ "sizes": "192x192",
+ "type": "image/png",
+ "purpose": "any"
+ },
+ {
+ "src": "maskable-192.png",
+ "sizes": "192x192",
+ "type": "image/png",
+ "purpose": "maskable"
+ },
+ {
+ "src": "favicon-512.png",
+ "sizes": "512x512",
+ "type": "image/png",
+ "purpose": "any"
+ },
+ {
+ "src": "maskable-512.png",
+ "sizes": "512x512",
+ "type": "image/png",
+ "purpose": "maskable"
+ }
+ ],
+ "start_url": "/",
+ "shortcuts": [
+ {
+ "name": "Dictionary",
+ "url": "/dictionary"
+ },
+ {
+ "name": "Timetable",
+ "url": "/timetable"
+ },
+ {
+ "name": "Write Reviews",
+ "url": "/write-reviews"
+ }
+ ],
+ "display": "standalone",
+ "theme_color": "#F9F0F0",
+ "background_color": "#F9F0F0"
+}
diff --git a/dist/static/maskable-192.png b/dist/static/maskable-192.png
new file mode 100644
index 0000000..231511c
Binary files /dev/null and b/dist/static/maskable-192.png differ
diff --git a/dist/static/maskable-512.png b/dist/static/maskable-512.png
new file mode 100644
index 0000000..a6d73e2
Binary files /dev/null and b/dist/static/maskable-512.png differ
diff --git a/public/index.html b/index.html
similarity index 94%
rename from public/index.html
rename to index.html
index 14c1c9d..4a42202 100644
--- a/public/index.html
+++ b/index.html
@@ -10,7 +10,7 @@
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
-
+