-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.min.js
175 lines (174 loc) · 17.1 KB
/
index.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
function s(v,t={}){let e=Object.keys(t),i=Object.values(t);try{return new Function(...e,`return \`${v}\`;`)(...i)}catch(a){throw new x(v,t,a)}}var x=class extends Error{constructor(t,e,i){super();this.name="TemplateError";let a=`
------------------
`;a+=`Template: \`${t}\``,a+=`
------------------
`,a+=`Tags: ${JSON.stringify(e,null,2)}`,a+=`
------------------
`,a+=i,this.message=a}};var r=class extends HTMLElement{constructor(){super();this.id="contact",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={name:this.__data.name,label:this.__data.label,image:this.__data.image,email:this.__data.email,phone:this.__data.phone,url:this.__data.url,location:this.__data.location};this.__template||(this.__template=r.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({name:t,label:e,image:i,email:a,phone:T,url:g,location:l}){return`
<h1>${t}${e?`, ${e}`:""}</h1>
${a?`<div><a href="mailto:${a}">${a}</a></div>`:""}
${T?`<div>${T}</div>`:""}
${l?`<div>
<div>${l.address}</div>
<div>${l.city}, ${l.postalCode}</div>
${l.region?`<div>${l.region}</div>`:""}
${l.countryCode?`<div>${l.countryCode}</div>`:""}
</div>`:""}
${g?`<div><a href="${g}">${g}</a></div>`:""}
<hr>`}};customElements.define("wc-contact",r);var h=class extends HTMLElement{constructor(){super();this.id="about",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={summary:this.__data.summary};this.__template||(this.__template=h.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({summary:t}){return`
${t?`<div>${t}</div>`:""}
<hr>`}};customElements.define("wc-about",h);var d=class extends HTMLElement{constructor(){super();this.id="profiles",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={profiles:this.__data.profiles};this.__template||(this.__template=d.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({profiles:t}){return`
${t.map(e=>`
<div>
<span>${e.network}:</span>
${e.url?`<span><a href="${e.url}">${e.username}</a></span>`:""}
${e.url?"":`<span>${e.username}</span>`}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-profiles",d);var _=class extends HTMLElement{constructor(){super();this.id="skills",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={skills:this.__data};this.__template||(this.__template=_.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({skills:t}){return`
${t.map(e=>`
<div>
<span style="font-weight: bold">${e.name}${e.level?` (${e.level})`:""}: </span>
${e.keywords?`<span>${e.keywords.join(", ")}</span>`:""}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-skills",_);var o=class extends HTMLElement{constructor(){super();this.id="work",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={jobs:this.__data};this.__template||(this.__template=o.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({jobs:t}){return`
${t.map(e=>`
<div>
<div style="float:left; font-weight: bold">${e.name}${e.position?`, ${e.position}`:""}</div>
<div style="float:right;">
${e.startDate}${e.endDate?` - ${e.endDate}`:""}
</div>
<div style="clear:both;"></div>
${e.url?`<div><a href="${e.url}">${e.url}</a></div>`:""}
${e.url?`<div>${e.location}</div>`:""}
${e.description?`<div>${e.description}</div>`:""}
${e.summary?`<div>${e.summary}</div>`:""}
${e.highlights?`<ul>
${e.highlights.map(i=>`
<li>${i}</li>
`).join(`
`)}
</ul>`:""}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-work",o);var u=class extends HTMLElement{constructor(){super();this.id="projects",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={projects:this.__data};this.__template||(this.__template=u.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({projects:t}){return`
${t.map(e=>`
<div>
<div style="float:left; font-weight: bold">${e.name}
${e.type?`(${e.type})`:""}
</div>
${e.startDate&&e.endDate?`<div style="float:right;">${e.startDate} - ${e.endDate}</div>`:""}
<div style="clear:both"></div>
${e.url?`<div><a href="${e.url}">${e.url}</a></div>`:""}
${e.description?`<div>${e.description}</div>`:""}
${e.entity?`<div>${e.entity}</div>`:""}
${e.roles?`<div>${e.roles.join(", ")}</div>`:""}
${e.highlights?`<ul>
${e.highlights.map(i=>`
<li>${i}</li>
`).join(`
`)}
</ul>`:""}
${t.keywords?`<div>${e.keywords.join(", ")}</div>`:""}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-projects",u);var c=class extends HTMLElement{constructor(){super();this.id="education",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={schools:this.__data};this.__template||(this.__template=c.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({schools:t}){return`
${t.map(e=>`
<div>
<div style="float:left; font-weight: bold">${e.institution}</div>
<div style="float:right;">${e.startDate} - ${e.endDate}</div>
<div style="clear: both">${e.studyType} - ${e.area}
${e.gpa?`(${e.gpa} GPA)`:""}
</div>
${e.courses?`<ul>
${e.courses.map(i=>`
<li>${i}</li>
`).join(`
`)}
</ul>`:""}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-education",c);var m=class extends HTMLElement{constructor(){super();this.id="publications",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={publications:this.__data};this.__template||(this.__template=m.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({publications:t}){return`
${t.map(e=>`
<div>
<div style="float:left; font-weight: bold">${e.name}${e.publisher?`, ${e.publisher}`:""}</div>
${e.releaseDate?`<div style="float:right;">${e.releaseDate}</div>`:""}
<div style="clear:both"></div>
${e.url?`<div<a href="${e.url}">${e.url}</a></div>`:""}
${e.summary?`<div>${e.summary}</div>`:""}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-publications",m);var p=class extends HTMLElement{constructor(){super();this.id="awards",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={awards:this.__data};this.__template||(this.__template=p.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({awards:t}){return`
${t.map(e=>`
<div>
<div style="float:left; font-weight: bold">${e.title}
${e.awarder?`, ${e.awarder}`:""}
</div>
${e.date?`<div style="float:right;">${e.date}</div>`:""}
<div style="clear:both"></div>
${e.summary?`<div>${e.summary}</div>`:""}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-awards",p);var f=class extends HTMLElement{constructor(){super();this.id="volunteer",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={roles:this.__data};this.__template||(this.__template=f.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({roles:t}){return`
${t.map(e=>`
<div>
<div style="float:left; font-weight: bold">${e.organization}${e.position?`, ${e.position}`:""}</div>
<div style="float:right;">${e.startDate} - ${e.endDate}</div>
<div style="clear:both"></div>
${e.url?`<div><a href="${e.url}">${e.url}</a></div>`:""}
${e.summary?`<div>${e.summary}</div>`:""}
${e.highlights?`<ul>
${e.highlights.map(i=>`
<li>${i}</li>
`).join(`
`)}
</ul>`:""}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-volunteer",f);var y=class extends HTMLElement{constructor(){super();this.id="languages",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={languages:this.__data};this.__template||(this.__template=y.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({languages:t}){return`
${t.map(e=>`
<div><span style="font-weight: bold">${e.language}
${e.fluency?`(${e.fluency})`:""}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-languages",y);var w=class extends HTMLElement{constructor(){super();this.id="interests",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={interests:this.__data};this.__template||(this.__template=w.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({interests:t}){return`
${t.map(e=>`
<div>
<span style="font-weight: bold">${e.name}:</span>
${e.keywords?`<span>[ ${e.keywords.join(", ")} ]</span>`:""}
</div>
`).join(`
`)}
<hr>`}};customElements.define("wc-interests",w);var $=class extends HTMLElement{constructor(){super();this.id="references",this.__data=null,this.__template=null}get data(){return this.__data}set data(t){this.__data=t,t?this.render():this.renderNull()}get template(){return this.__template}set template(t){this.__template=t}async render(){this.style.display="";let t={references:this.__data};this.__template||(this.__template=$.default(t)),this.innerHTML=s(this.__template,t)}renderNull(){this.style.display="none",this.innerHTML=""}static default({references:t}){return`
${t.map(e=>`
<blockquote>
<p>${e.reference}</p>
<footer>\u2014 <cite>${e.name}</cite></footer>
</blockquote>
`).join(`
`)}
<hr>`}};customElements.define("wc-references",$);var n=class extends HTMLElement{static get observedAttributes(){return["src","data"]}attributeChangedCallback(t,e,i){!this.__initialized||e!==i&&(this[t]=i)}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",t),this.setSrc(),this.render()}get data(){return this.__data}set data(t){this.__data=t,this.render()}constructor(){super();this.attachShadow({mode:"open"}),this.__data=null,this.__style=null,this.__contact=null,this.__about=null,this.__profiles=null,this.__skills=null,this.__work=null,this.__projects=null,this.__education=null,this.__publications=null,this.__awards=null,this.__volunteer=null,this.__languages=null,this.__interests=null,this.__references=null,this.__initialized=!1}async connectedCallback(){let t=document.createElement("template");if(t.innerHTML=this.innerHTML===""?n.default():this.innerHTML,this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.querySelector("style")===null){let e=document.createElement("style");this.shadowRoot.insertBefore(e,this.firstChild)}await this.setSrc(),this.init(),this.hasAttribute("theme")&&await this.setTheme(),this.render()}init(){this.__style=this.shadowRoot.querySelector("style"),this.__contact=this.shadowRoot.querySelector("wc-contact"),this.__about=this.shadowRoot.querySelector("wc-about"),this.__profiles=this.shadowRoot.querySelector("wc-profiles"),this.__skills=this.shadowRoot.querySelector("wc-skills"),this.__work=this.shadowRoot.querySelector("wc-work"),this.__projects=this.shadowRoot.querySelector("wc-projects"),this.__education=this.shadowRoot.querySelector("wc-education"),this.__publications=this.shadowRoot.querySelector("wc-publications"),this.__awards=this.shadowRoot.querySelector("wc-awards"),this.__volunteer=this.shadowRoot.querySelector("wc-volunteer"),this.__languages=this.shadowRoot.querySelector("wc-languages"),this.__interests=this.shadowRoot.querySelector("wc-interests"),this.__references=this.shadowRoot.querySelector("wc-references"),this.__initialized=!0}async setTheme(){let t=this.getAttribute("theme");/\/$/.test(t)||(t=t+"/"),this.__style.innerHTML=await this.fetchTheme(t,"style.css"),this.__contact&&(this.__contact.template=await this.fetchTheme(t,"contact.html")),this.__about&&(this.__about.template=await this.fetchTheme(t,"about.html")),this.__profiles&&(this.__profiles.template=await this.fetchTheme(t,"profiles.html")),this.__skills&&(this.__skills.template=await this.fetchTheme(t,"skills.html")),this.__work&&(this.__work.template=await this.fetchTheme(t,"work.html")),this.__projects&&(this.__projects.template=await this.fetchTheme(t,"projects.html")),this.__education&&(this.__education.template=await this.fetchTheme(t,"education.html")),this.__publications&&(this.__publications.template=await this.fetchTheme(t,"publications.html")),this.__awards&&(this.__awards.template=await this.fetchTheme(t,"awards.html")),this.__volunteer&&(this.__volunteer.template=await this.fetchTheme(t,"volunteer.html")),this.__languages&&(this.__languages.template=await this.fetchTheme(t,"languages.html")),this.__interests&&(this.__interests.template=await this.fetchTheme(t,"interests.html")),this.__references&&(this.__references.template=await this.fetchTheme(t,"references.html"))}async fetchTheme(t,e){let i=await fetch(t+e);return i.status!==200?"":i.text()}async setSrc(){let t=await this.fetchSrc();this.__data=t}async fetchSrc(){let t=await fetch(this.src);if(t.status!==200)throw Error(`ERR ${t.status}: ${t.statusText}`);return t.json()}render(){this.__contact&&(this.__contact.data=this.__data.basics),this.__about&&(this.__about.data=this.__data.basics),this.__profiles&&(this.__profiles.data=this.__data.basics),this.__skills&&(this.__skills.data=this.__data.skills),this.__work&&(this.__work.data=this.__data.work),this.__projects&&(this.__projects.data=this.__data.projects),this.__education&&(this.__education.data=this.__data.education),this.__publications&&(this.__publications.data=this.__data.publications),this.__awards&&(this.__awards.data=this.__data.awards),this.__volunteer&&(this.__volunteer.data=this.__data.volunteer),this.__languages&&(this.__languages.data=this.__data.languages),this.__interests&&(this.__interests.data=this.__data.interests),this.__references&&(this.__references.data=this.__data.references)}static default(){return`
<style></style>
<wc-contact></wc-contact>
<wc-about></wc-about>
<wc-profiles></wc-profiles>
<wc-skills></wc-skills>
<wc-work></wc-work>
<wc-projects></wc-projects>
<wc-education></wc-education>
<wc-publications></wc-publications>
<wc-awards></wc-awards>
<wc-volunteer></wc-volunteer>
<wc-languages></wc-languages>
<wc-interests></wc-interests>
<wc-references></wc-references>`}},ot=n;customElements.define("wc-resume",n);export{ot as default};