Socket
Socket
Sign inDemoInstall

@codersrank/timeline

Package Overview
Dependencies
0
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.0 to 0.9.1

19

cjs/shared/fetch-data.js

@@ -43,4 +43,19 @@ "use strict";

}).then(function (data) {
cache[endpoint][username] = data.projects || data.work_experiences || [];
return data.projects || data.work_experiences || [];
var projects = [];
var workExperiences = [];
if (typeof data.projects !== 'undefined') {
projects = data.projects.filter(function (e) {
return e.start_date !== '0001-01';
});
}
if (typeof data.work_experiences !== 'undefined') {
workExperiences = data.work_experiences.filter(function (e) {
return e.start_date !== '0001-01';
});
}
cache[endpoint][username] = projects || workExperiences || [];
return projects || workExperiences || [];
})["catch"](function (err) {

@@ -47,0 +62,0 @@ // eslint-disable-next-line

/**
* Codersrank Timeline Widget 0.9.0
* Codersrank Timeline Widget 0.9.1
* undefined

@@ -10,3 +10,3 @@ * https://github.com/codersrank-org/timeline-widget#readme

*
* Released on: March 23, 2021
* Released on: June 18, 2021
*/

@@ -188,4 +188,19 @@

}).then(function (data) {
cache[endpoint][username] = data.projects || data.work_experiences || [];
return data.projects || data.work_experiences || [];
var projects = [];
var workExperiences = [];
if (typeof data.projects !== 'undefined') {
projects = data.projects.filter(function (e) {
return e.start_date !== '0001-01';
});
}
if (typeof data.work_experiences !== 'undefined') {
workExperiences = data.work_experiences.filter(function (e) {
return e.start_date !== '0001-01';
});
}
cache[endpoint][username] = projects || workExperiences || [];
return projects || workExperiences || [];
})["catch"](function (err) {

@@ -192,0 +207,0 @@ // eslint-disable-next-line

6

codersrank-timeline.min.js
/**
* Codersrank Timeline Widget 0.9.0
* Codersrank Timeline Widget 0.9.1
* undefined

@@ -10,6 +10,6 @@ * https://github.com/codersrank-org/timeline-widget#readme

*
* Released on: March 23, 2021
* Released on: June 18, 2021
*/
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function n(t){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function r(t,e,n){return(r=o()?Reflect.construct:function(t,e,n){var o=[null];o.push.apply(o,e);var r=new(Function.bind.apply(t,o));return n&&i(r,n.prototype),r}).apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||(o=t,-1===Function.toString.call(o).indexOf("[native code]")))return t;var o;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return r(t,arguments,n(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),i(a,t)})(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var s={projects:{},work_experiences:{}},c=function t(e,n){var i="work_experiences";return"portfolio"===n&&(i="projects"),s[i][e]?Promise.resolve(s[i][e]):"technologies"===n?Promise.all([t(e,"portfolio"),t(e,"workexperience")]).then((function(t){var e=t[0],n=t[1];return e.forEach((function(t){t._type="portfolio"})),n.forEach((function(t){t._type="workexperience"})),[].concat(e,n)})).catch((function(t){return console.error(t),Promise.reject(t)})):fetch("https://api.codersrank.io/v2/users/"+e+"/"+i,{method:"GET",headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){return s[i][e]=t.projects||t.work_experiences||[],t.projects||t.work_experiences||[]})).catch((function(t){return console.error(t),Promise.reject(t)}))},d=function(t){var e=void 0===t?{}:t,n=e.data,i=e.preloader,o=e.branding,r=e.type,a=n.rows,l=void 0===a?[]:a,s=n.years,c=void 0===s?[]:s;return'\n <div class="codersrank-timeline '+(i?"codersrank-timeline-loading":"")+'">\n '+(i?'\n <div class="codersrank-timeline-preloader"></div>\n ':"")+'\n <div class="codersrank-timeline-wrap">\n <div class="codersrank-timeline-year-lines">\n '+c.map((function(t,e){return'\n <div class="codersrank-timeline-year-line" style="left: calc(var(--col-width) * '+12*e+')"></div>\n '})).join("")+'\n </div>\n <div class="codersrank-timeline-years">\n '+c.map((function(t){return'\n <div class="codersrank-timeline-year" style="width: calc(var(--col-width) * 12)">\n <span>'+t+"</span>\n </div>\n "})).join("")+'\n </div>\n <div class="codersrank-timeline-chart" style="height: calc(var(--row-height) * '+l.length+')">\n '+l.map((function(t,e){return'\n <div class="codersrank-timeline-row">\n '+t.map((function(t){return'\n <div class="codersrank-timeline-item-wrap" style="left: calc(var(--col-width) * '+t.start_col+"); width: calc(var(--col-width) * "+(t.end_col-t.start_col)+"); height: var(--row-height); top: calc(var(--row-height) * "+e+')">\n <div class="codersrank-timeline-item" data-id="'+t.id+'">\n <span>'+function(t){return t.end_col-t.start_col<2?"":"workexperience"===r?t.title+" @ "+t.company:"portfolio"===r?t.project_title||"":"technologies"===r?'<img src="https://icon-widget.codersrank.io/api/'+encodeURIComponent(t.name)+'">'+t.name:""}(t)+"</span>\n </div>\n </div>\n "})).join("")+"\n </div>\n "})).join("")+"\n </div>\n </div>\n\n "+(o?'\n <div class="codersrank-timeline-branding">\n <a href="https://codersrank.io" target="_blank" rel="noopener noreferrer">\n <span>Powered by </span>\n <svg xmlns="http://www.w3.org/2000/svg" width="258" height="39" viewBox="0 0 258 39"><path fill="#19223C" d="M71.358 27.687A8.076 8.076 0 0 1 69 21.999c0-2.122.846-4.162 2.358-5.687a8.022 8.022 0 0 1 2.664-1.688 8.175 8.175 0 0 1 3.126-.543 8.298 8.298 0 0 1 4.723 1.339 7.155 7.155 0 0 1 2.895 3.791H80.12a3 3 0 0 0-1.182-1.283 3.106 3.106 0 0 0-1.713-.427 4.128 4.128 0 0 0-1.694.264 4.046 4.046 0 0 0-1.43.926 5.197 5.197 0 0 0-1.133 3.234c0 1.17.399 2.309 1.134 3.234.403.405.89.72 1.43.926a4.128 4.128 0 0 0 1.693.264c.586.039 1.17-.087 1.684-.364a3.01 3.01 0 0 0 1.211-1.198h4.571a7.156 7.156 0 0 1-2.895 3.792 8.298 8.298 0 0 1-4.723 1.338 8.173 8.173 0 0 1-3.085-.557 8.02 8.02 0 0 1-2.629-1.673zM88.652 27.687a8.076 8.076 0 0 1-2.359-5.688c0-2.122.846-4.162 2.359-5.687a8.57 8.57 0 0 1 5.79-2.238c2.15 0 4.221.8 5.79 2.238a8.076 8.076 0 0 1 2.358 5.687 8.076 8.076 0 0 1-2.359 5.688 8.491 8.491 0 0 1-5.79 2.266 8.491 8.491 0 0 1-5.79-2.266zm8.837-2.454A5.197 5.197 0 0 0 98.623 22c0-1.17-.4-2.308-1.134-3.234a4.398 4.398 0 0 0-3.048-1.219c-1.14 0-2.234.438-3.047 1.22a5.197 5.197 0 0 0-1.134 3.233c0 1.171.399 2.309 1.134 3.234a4.398 4.398 0 0 0 3.047 1.219c1.14 0 2.235-.438 3.048-1.219zM110.592 14.304a9.126 9.126 0 0 1 6.247 2.156 7.73 7.73 0 0 1 1.8 2.546 7.573 7.573 0 0 1 0 6.06 7.73 7.73 0 0 1-1.8 2.546 9.049 9.049 0 0 1-6.247 2.156h-5.561V14.304h5.561zm-1.752 12.64h1.752a4.596 4.596 0 0 0 1.903-.295 4.504 4.504 0 0 0 1.602-1.044 4.909 4.909 0 0 0 1.295-3.569 4.909 4.909 0 0 0-1.295-3.568 4.504 4.504 0 0 0-1.602-1.044 4.595 4.595 0 0 0-1.903-.294h-1.752v9.813zM131.313 14.23v2.9h-5.714v3.345h5.104v2.9H125.6v3.568h5.714v2.9h-9.599V14.23zM138.55 23.746v6.022h-3.885V14.304h6.247a6.19 6.19 0 0 1 4.266 1.413c.486.418.874.933 1.137 1.51.263.578.395 1.204.387 1.836a4.752 4.752 0 0 1-.838 2.602 4.578 4.578 0 0 1-2.743 1.784l3.885 6.32h-4.418l-3.58-6.023h-.458zm0-6.616v3.717h2.362c.253.01.505-.03.742-.12.236-.09.45-.226.63-.4.175-.178.312-.388.404-.617.091-.23.135-.475.128-.722a1.819 1.819 0 0 0-.128-.721 1.854 1.854 0 0 0-.405-.617 1.833 1.833 0 0 0-.63-.4 1.87 1.87 0 0 0-.741-.12h-2.362zM155.158 17.055a1.86 1.86 0 0 0-1.22.372c-.159.138-.284.311-.363.505-.08.193-.111.402-.093.61a1.528 1.528 0 0 0 .457 1.115c.32.31.712.539 1.143.67l1.523.445 1.676.52 1.524.744c.487.317.881.753 1.143 1.264.31.6.466 1.262.457 1.933a4.227 4.227 0 0 1-.45 1.859 4.333 4.333 0 0 1-1.226 1.487 6.424 6.424 0 0 1-4.343 1.412 6.899 6.899 0 0 1-4.342-1.263 4.331 4.331 0 0 1-1.278-1.588 4.223 4.223 0 0 1-.398-1.981h4.114c-.012.253.032.507.128.742.097.236.244.449.431.625a1.87 1.87 0 0 0 1.421.492c.475.02.94-.14 1.296-.447a1.382 1.382 0 0 0 .457-1.115 1.455 1.455 0 0 0-.457-1.115 2.986 2.986 0 0 0-1.143-.669l-1.524-.446-1.676-.52-1.523-.744a3.148 3.148 0 0 1-1.143-1.264 4 4 0 0 1-.305-1.859 4.15 4.15 0 0 1 .407-1.944 4.258 4.258 0 0 1 1.27-1.55 6.582 6.582 0 0 1 4.19-1.338 6.982 6.982 0 0 1 4.113 1.115 4.33 4.33 0 0 1 1.278 1.588c.292.62.428 1.299.398 1.98h-4.19a2.056 2.056 0 0 0-.533-1.263 1.611 1.611 0 0 0-1.22-.372zM168.261 23.746v6.022h-3.885V14.304h6.247a6.19 6.19 0 0 1 4.266 1.413c.486.418.874.933 1.137 1.51.263.578.395 1.204.387 1.836a4.752 4.752 0 0 1-.838 2.602 4.578 4.578 0 0 1-2.743 1.784l3.885 6.32H172.3l-3.58-6.023h-.458zm0-6.616v3.717h2.362c.253.01.505-.03.742-.12.236-.09.45-.226.63-.4.175-.178.312-.388.404-.617.091-.23.135-.475.128-.722a1.819 1.819 0 0 0-.128-.721 1.854 1.854 0 0 0-.405-.617 1.833 1.833 0 0 0-.63-.4 1.87 1.87 0 0 0-.741-.12h-2.362zM189.592 29.768l-.914-2.602h-5.714l-.914 2.602h-4.114l5.485-15.538h4.723l5.485 15.538h-4.037zm-5.638-5.501h3.733l-1.828-5.428-1.905 5.428zM205.972 14.23h3.885v15.538h-3.885l-6.476-9.813v9.813h-3.885V14.23h3.885l6.476 9.814zM217.093 29.768h-3.885V14.304h3.885v6.766l5.257-6.766h5.104l-6.552 7.732 6.552 7.732h-4.952l-5.333-6.84zM232.863 27.761a1.98 1.98 0 0 1-.5 1.253 2.07 2.07 0 0 1-1.197.664 2.1 2.1 0 0 1-1.359-.222 2.024 2.024 0 0 1-.91-1.01 1.962 1.962 0 0 1-.054-1.342c.141-.44.433-.82.827-1.076a2.096 2.096 0 0 1 2.583.246c.201.194.359.426.464.682.105.256.154.53.146.805z"></path> <path fill="#67a4ac" d="M235.301 29.768V14.304h3.885v15.464zM244.062 27.687a8.076 8.076 0 0 1-2.358-5.688c0-2.122.846-4.162 2.358-5.687a8.57 8.57 0 0 1 5.79-2.238c2.151 0 4.222.8 5.79 2.238A8.076 8.076 0 0 1 258 21.999a8.076 8.076 0 0 1-2.358 5.688 8.491 8.491 0 0 1-5.79 2.266 8.491 8.491 0 0 1-5.79-2.266zm8.837-2.454A5.197 5.197 0 0 0 254.033 22c0-1.17-.399-2.308-1.134-3.234a4.398 4.398 0 0 0-3.047-1.219c-1.14 0-2.235.438-3.047 1.22a5.197 5.197 0 0 0-1.134 3.233c0 1.171.399 2.309 1.134 3.234a4.398 4.398 0 0 0 3.047 1.219c1.14 0 2.235-.438 3.047-1.219z"></path> <path d="M33.25.054L2.147 19.634C.682 20.52-.034 21.512.001 22.611v2.98c.035 1.1.768 2.075 2.2 2.926l15.393 8.885a.726.726 0 0 0 1.047-.373l3.456-8.352-7.33-4.15a1.317 1.317 0 0 1-.514-.477 1.346 1.346 0 0 1 .461-1.864l13.457-8.247L33.72.427a.324.324 0 0 0-.103-.36.31.31 0 0 0-.369-.013z" fill="#19223c"></path> <path d="M58.8 10.961L43.618 1.757a.726.726 0 0 0-1.047.32l-3.56 8.352 7.225 4.31c.208.113.381.282.502.488a1.347 1.347 0 0 1 0 1.363 1.318 1.318 0 0 1-.502.49l-13.561 7.98-5.76 13.407a.323.323 0 0 0 .026.452.312.312 0 0 0 .445-.026l9.949-6.012 3.927 5.64a.947.947 0 0 0 .785.425h9.425a.932.932 0 0 0 .832-.506.97.97 0 0 0-.047-.984l-6.388-9.79 12.933-7.82c1.466-.887 2.199-1.88 2.199-2.98V13.94c0-1.1-.733-2.092-2.2-2.979z" fill="#67a4ac"></path></svg>\n </a>\n </div>\n ':"")+"\n </div>\n "},p=function(t,e){var n;return n=12*(e.getFullYear()-t.getFullYear()),n-=t.getMonth(),n+=e.getMonth(),Math.abs(n<=0?0:n)},h=function(t,n){void 0===t&&(t=[]);var i,o,r=[],a=[],l=function(t,e,n,i){a.push({name:t,start_date:e,end_date:n,items:[i]})};"technologies"===n&&(t.sort((function(t,e){return(t.start_date?new Date(t.start_date):new Date)-(e.start_date?new Date(e.start_date):new Date)})),t.forEach((function(t){[].concat(t.highlighted_technologies||[]).forEach((function(e){!function(t,e){var n,i=e.start_date,o=e.end_date,r=e.is_current,s=i?new Date(i):new Date,c=o&&!r?new Date(o):new Date,d=a.filter((function(e){return e.name.toLowerCase()===t.toLowerCase()}));d.length?(d.forEach((function(t){if(!n){var i,o,r,a,l=t.start_date?new Date(t.start_date):new Date,d=t.end_date?new Date(t.end_date):new Date;o=c,a=d,((i=s)<=(r=l)&&r<=o||i<=a&&a<=o||r<i&&o<a)&&(n=!0,t.start_date=new Date(Math.min(s,l)),t.end_date=new Date(Math.max(c,d)),t.items.push(e))}})),n||l(t,s,c,e)):l(t,s,c,e)}(e,t)}))})),t=a);var s=function(t){void 0===t&&(t=""),(i=new Date(t)).setMonth(0,1)};s(new Date),t.forEach((function(t){var e,n=new Date(t.start_date),r=t.is_current?new Date:new Date(t.end_date);n<i&&s(n),(!o||r>o)&&(void 0===(e=r)&&(e=""),o=new Date(e))}));var c=[];t.forEach((function(t,n){var o=new Date(t.start_date),r=t.is_current?new Date:new Date(t.end_date),a=p(i,o),l=a+p(o,r);c.push(e({start_col:a,end_col:l,id:n},t))})),c.sort((function(t,e){return t.start_col>e.start_col?1:-1}));var d=function t(e,n){var i=e.start_col;return r[n]&&r[n].slice(0,c.indexOf(e)).filter((function(t){return t.end_col>i})).length>0?t(e,n+=1):n};c.forEach((function(t){var e=d(t,0);r[e]||(r[e]=[]),r[e].push(t)}));return{rows:r,years:function(){var t=i.getFullYear(),e=o.getFullYear(),n=[t];if(e>t)for(var r=1;r<=e-t;r+=1)n.push(t+r);return n}()}};var m=function(t,e){var n,i,o=("#"+(n=function(t){for(var e=0,n=0;n<t.length;n+=1)e=t.charCodeAt(n)+((e<<5)-e);return e}(t||""),i=(16777215&n).toString(16).toUpperCase(),"00000".substring(0,6-i.length)+i)).toLowerCase();return e?'\n <img src="'+e+'" alt="'+t+'" title="'+t+'" />\n ':'\n <svg title="'+t+'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">\n <rect width="32" height="32" fill="'+o+'" rx="3" />\n '+(t?'\n <text\n x="50%"\n y="50%"\n font-weight="bold"\n font-size="20"\n fill="#fff"\n dy="0"\n text-anchor="middle"\n dominant-baseline="middle"\n >\n '+t[0].toUpperCase()+"\n </text>\n ":"")+"\n\n </svg>\n "},u=function t(e,n){var i,o,r,a,l=function(t){return t?Intl.DateTimeFormat("en",{month:"short",year:"numeric"}).format(new Date(t)):""},s=function(t){void 0===t&&(t=!0);var n,i,o=l(e.start_date||e.date_from),r=e.is_current?"Present":l(e.end_date||e.date_to);return t?o+" - "+r+" ("+(n=function(t,e,n){var i=n?new Date:new Date(e);return p(new Date(t),i)}(e.start_date||e.date_from,e.end_date||e.date_to,e.is_current),i="",(0===n?"Less than a month":(n>=12&&(i+=Math.floor(n/12),i+=" year",1!==Math.floor(n/12)&&(i+="s")),n%12!=0&&(n>=12&&(i+=" "),i+=n%12,i+=" month",n%12!=1&&(i+="s")),i))+")"):o+" - "+r},c=function(){return"technologies"===n?'<img src="https://icon-widget.codersrank.io/api/'+encodeURIComponent(e.name)+'">':"workexperience"===n?m(e.company,e.company_logo):m(e.project_title,e.image)},d=function(){return"workexperience"===n?e.title:e.role};return"technologies"===n?'\n <div class="codersrank-timeline-tooltip-item">\n <div class="logo">\n '+c()+'\n </div>\n <div class="content">\n <div class="title">\n '+e.name+'\n </div>\n <div class="details">\n <div>'+s(!0)+'</div>\n </div>\n </div>\n </div>\n <div class="codersrank-timeline-tooltip-divider"></div>\n '+e.items.map((function(e){return t(e,e._type)})).join("")+"\n ":'\n <div class="codersrank-timeline-tooltip-item">\n <div class="logo">\n '+c()+'\n </div>\n <div class="content">\n <div class="title">\n '+("workexperience"===n?e.company:e.project_title)+"\n </div>\n "+(d()?'\n <div class="subtitle">\n '+d()+"\n </div>\n ":"")+'\n <div class="details">\n <div>'+s(!0)+"</div>\n "+(e.location?"\n <div>"+(r=(o=e).location,a=o.is_remote,("Remote, Earth"===r||a?"Remote":r||"")+"</div>\n "):"")+"\n </div>\n "+(e.description?'\n <div class="description">\n <div>'+(void 0===(i=e.description)&&(i=""),(i||"").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>")+"</div>\n </div>\n "):"")+"\n "+(e.highlighted_technologies||e.other_technologies?'\n <div class="tags">\n '+e.highlighted_technologies.map((function(t){return'\n <span class="tag"><span class="tag-star">★</span>'+t+"</span>\n "})).join("")+"\n\n "+e.other_technologies.map((function(t){return'\n <span class="tag">'+t+"</span>\n "})).join("")+"\n </div>\n ":"")+"\n </div>\n </div>\n "},f="codersrank-timeline",g=function(n){var i,o;function r(){var t;return(t=n.call(this)||this).shadowEl=t.attachShadow({mode:"closed"}),t.tempDiv=document.createElement("div"),t.stylesEl=document.createElement("style"),t.stylesEl.textContent=":host{--preloader-color:#72a0a8;--year-font-size:12px;--year-opacity:0.5;--year-height:24px;--year-text-color:currentColor;--year-line-color:currentColor;--year-line-opacity:0.25;--col-width:24px;--row-height:36px;--timeline-item-bg-color:#f1f1f1;--timeline-item-text-color:inherit;--timeline-item-font-size:12px;--timeline-item-padding:4px 8px;--timeline-item-border-radius:4px;--tooltip-logo-size:32px;--tooltip-font-size:14px;--tooltip-width:320px;--tooltip-padding:16px;--tooltip-bg-color:#fff;--tooltip-border-radius:4px;--tooltip-text-color:#333;--tooltip-box-shadow:0px 10px 20px rgba(0, 0, 0, 0.1);--tag-border:none;--tag-star-color:#ff9900;--tag-bg-color:rgba(0, 0, 100, 0.075);--tag-font-size:0.85em;--tag-font-weight:bold;--tag-padding:0.35em 0.57em;--tag-margin:0.28em;--tag-border-radius:4px;--tag-text-color:inherit;--branding-text-color:inherit;width:100%;display:block;position:relative}.codersrank-timeline{position:relative}.codersrank-timeline-loading{height:100px}.codersrank-timeline-preloader{position:absolute;left:50%;top:50%;width:32px;height:32px;margin:-16px 0 0 -16px;border:3px solid var(--preloader-color);border-left-color:transparent;border-bottom-color:transparent;border-radius:50%;box-sizing:border-box;-webkit-animation:preloader 1s infinite linear;animation:preloader 1s infinite linear}.codersrank-timeline-wrap{position:relative;overflow:auto;padding-bottom:var(--year-height)}.codersrank-timeline-years{display:flex}.codersrank-timeline-year{font-size:var(--year-font-size);opacity:var(--year-opacity);flex-shrink:0;height:var(--year-height);display:flex;align-items:center;color:var(--year-text-color)}.codersrank-timeline-year>span{padding-left:4px;padding-right:4px;position:-webkit-sticky;position:sticky;left:0}.codersrank-timeline-year-line{position:absolute;top:0;border-left:1px dashed var(--year-line-color);opacity:var(--year-line-opacity);height:100%;z-index:0;margin-left:-2px}.codersrank-timeline-chart{position:relative;z-index:10}.codersrank-timeline-item-wrap{position:absolute}.codersrank-timeline-item{position:absolute;left:2px;top:2px;right:2px;bottom:2px;background-color:var(--timeline-item-bg-color);font-size:var(--timeline-item-font-size);display:flex;align-items:center;border-radius:var(--timeline-item-border-radius);color:var(--timeline-item-text-color);cursor:pointer;transition-duration:.2s}.codersrank-timeline-item:hover{opacity:.8}.codersrank-timeline-item span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%;position:-webkit-sticky;position:sticky;padding:var(--timeline-item-padding);left:0;display:flex;align-items:center}.codersrank-timeline-item span img{width:24px;height:24px;margin-right:4px}.codersrank-timeline-tooltip{text-align:left;position:absolute;background:var(--tooltip-bg-color);transform:translateX(-50%) translateY(-100%);border-radius:var(--tooltip-border-radius);color:var(--tooltip-text-color);box-shadow:var(--tooltip-box-shadow);font-family:var(--font-family);font-size:var(--tooltip-font-size,14px);margin-top:-10px;width:var(--tooltip-width);max-width:80vw;line-height:1.5;z-index:1000}.codersrank-timeline-tooltip-content{max-height:80vh;overflow:auto;padding:var(--tooltip-padding)}.codersrank-timeline-tooltip-angle{width:0px;height:0px;position:absolute;left:50%;top:100%;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid var(--tooltip-bg-color);margin-left:-5px}.codersrank-timeline-tooltip-bottom{transform:translateX(-50%);margin-top:34px}.codersrank-timeline-tooltip-bottom .codersrank-timeline-tooltip-angle{bottom:100%;top:auto;transform:rotate(180deg)}.codersrank-timeline-tooltip-divider{height:1px;background:rgba(0,0,0,.1);margin:16px 0}.codersrank-timeline-tooltip-item+.codersrank-timeline-tooltip-item{margin-top:16px}.codersrank-timeline-tooltip-item{display:flex}.codersrank-timeline-tooltip-item .logo{width:var(--tooltip-logo-size);height:var(--tooltip-logo-size);margin-right:16px;flex-shrink:0}.codersrank-timeline-tooltip-item .logo img,.codersrank-timeline-tooltip-item .logo svg{width:100%}.codersrank-timeline-tooltip-item .content{width:100%;min-width:0;flex-shrink:10}.codersrank-timeline-tooltip-item .title{font-weight:700;font-size:1.25em}.codersrank-timeline-tooltip-item .subtitle{font-weight:700}.codersrank-timeline-tooltip-item .details{opacity:.5}.codersrank-timeline-tooltip-item .description{margin:.5em 0}.codersrank-timeline-tooltip-item .tags{margin-top:.5em;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start}.codersrank-timeline-tooltip-item .tag{display:inline-flex;padding:var(--tag-padding);font-size:var(--tag-font-size);background:var(--tag-bg-color);border-radius:var(--tag-border-radius);font-weight:var(--tag-font-weight);line-height:1;margin-right:var(--tag-margin);margin-bottom:var(--tag-margin);border:var(--tag-border);color:var(--tag-text-color)}.codersrank-timeline-tooltip-item .tag-star{color:var(--tag-star-color);margin-right:4px}.codersrank-timeline-branding{justify-content:flex-end;align-items:center;font-size:12px;color:var(--branding-text-color);display:flex;margin-top:.5em}.codersrank-timeline-branding a{opacity:.5;display:flex;align-items:center;color:inherit;text-decoration:none;transition-duration:.2s;position:relative;z-index:1;transform:translate3d(0,0,0)}.codersrank-timeline-branding a:hover{opacity:1}.codersrank-timeline-branding span{margin-right:4px}.codersrank-timeline-branding svg{height:16px;width:auto}@-webkit-keyframes preloader{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes preloader{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}",t.shadowEl.appendChild(t.stylesEl),t.onDocumentClick=t.onDocumentClick.bind(l(t)),t.onWidgetClick=t.onWidgetClick.bind(l(t)),t.mounted=!1,t.state=0,t.data=null,t}o=n,(i=r).prototype=Object.create(o.prototype),i.prototype.constructor=i,i.__proto__=o;var a,s,p,m=r.prototype;return m.render=function(){var t=this.username,n=this.mounted,i=this.state,o=this.shadowEl,r={data:this.data,type:this.type,branding:this.branding};if(t&&n){3===i?this.tempDiv.innerHTML=d(r):2===i?this.tempDiv.innerHTML="":0!==i&&1!==i||(this.tempDiv.innerHTML=function(t){return d(e({},t,{preloader:!0,data:[]}))}(r));var a=o.querySelector(".codersrank-timeline");a&&a.parentNode.removeChild(a),(a=this.tempDiv.querySelector(".codersrank-timeline"))&&(this.widgetEl=a,this.detachEvents(),this.attachEvents(),o.appendChild(a))}},m.loadAndRender=function(){var t=this,e=this.username,n=this.type;this.state=1,this.render(),c(e,n).then((function(e){t.data=h(e,n),t.state=3,t.render()})).catch((function(){t.state=2,t.render()}))},m.tooltipText=function(t){var e;return this.data.rows.forEach((function(n){n.forEach((function(n){n.id===parseInt(t,10)&&(e=n)}))})),e?u(e,this.type):""},m.showTooltip=function(t){if(this.data&&t&&this.widgetEl){var e=this.shadowEl.querySelector('[data-id="'+t+'"]');if(e){var n=this.tooltipText(t);if(n){this.tempDiv.innerHTML='\n <div class="codersrank-timeline-tooltip">\n <div class="codersrank-timeline-tooltip-content">\n '+n+'\n </div>\n <div class="codersrank-timeline-tooltip-angle"></div>\n </div>\n ';var i=this.getBoundingClientRect(),o=e.getBoundingClientRect(),r=this.tempDiv.querySelector(".codersrank-timeline-tooltip"),a=o.left-i.left<0?0:o.left-i.left,l=o.width;o.left<0&&(l=o.width+o.left-i.left),a+l>i.width&&(l=i.width-a);var s=a+l/2;s<0&&(s=0),s>i.width&&(s=i.width),r.style.left=s+"px",r.style.top=o.top-i.top+"px",r.querySelector(".codersrank-timeline-tooltip-angle"),this.shadowEl.appendChild(r),r.getBoundingClientRect().top<0&&r.classList.add("codersrank-timeline-tooltip-bottom")}}}},m.hideTooltip=function(){if(this.widgetEl){var t=this.shadowEl.querySelector(".codersrank-timeline-tooltip");t&&this.shadowEl.removeChild(t)}},m.onDocumentClick=function(t){t.target!==this&&this.hideTooltip()},m.onWidgetClick=function(t){this.hideTooltip();var e,n=t.target,i=n&&n.parentElement;n.classList&&n.classList.contains("codersrank-timeline-item")?e=n:i.classList&&i.classList.contains("codersrank-timeline-item")&&(e=i),e&&this.showTooltip(e.getAttribute("data-id"))},m.attachEvents=function(){this.widgetEl&&(document.addEventListener("click",this.onDocumentClick,!0),this.widgetEl.addEventListener("click",this.onWidgetClick,!0))},m.detachEvents=function(){this.widgetEl&&(document.removeEventListener("click",this.onDocumentClick,!0),this.widgetEl.removeEventListener("click",this.onWidgetClick,!0))},m.attributeChangedCallback=function(){this.mounted&&this.loadAndRender()},m.connectedCallback=function(){this.width=this.offsetWidth,this.mounted=!0,this.loadAndRender()},m.disconnectedCallback=function(){this.mounted=!1,this.detachEvents()},a=r,p=[{key:"observedAttributes",get:function(){return["username","type"]}}],(s=[{key:"username",get:function(){return this.getAttribute("username")},set:function(t){this.setAttribute("username",t)}},{key:"type",get:function(){return this.getAttribute("type")||"workexperience"},set:function(t){this.setAttribute("type",t)}},{key:"branding",get:function(){return"false"!==this.getAttribute("branding")},set:function(t){this.setAttribute("branding",t)}}])&&t(a.prototype,s),p&&t(a,p),r}(a(HTMLElement));window.customElements&&!window.customElements.get(f)&&window.customElements.define(f,g)}));
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function n(t){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function o(t,e,n){return(o=r()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&i(o,n.prototype),o}).apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return o(t,arguments,n(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),i(a,t)})(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var s={projects:{},work_experiences:{}},c=function t(e,n){var i="work_experiences";return"portfolio"===n&&(i="projects"),s[i][e]?Promise.resolve(s[i][e]):"technologies"===n?Promise.all([t(e,"portfolio"),t(e,"workexperience")]).then((function(t){var e=t[0],n=t[1];return e.forEach((function(t){t._type="portfolio"})),n.forEach((function(t){t._type="workexperience"})),[].concat(e,n)})).catch((function(t){return console.error(t),Promise.reject(t)})):fetch("https://api.codersrank.io/v2/users/"+e+"/"+i,{method:"GET",headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){var n=[],r=[];return void 0!==t.projects&&(n=t.projects.filter((function(t){return"0001-01"!==t.start_date}))),void 0!==t.work_experiences&&(r=t.work_experiences.filter((function(t){return"0001-01"!==t.start_date}))),s[i][e]=n||r||[],n||r||[]})).catch((function(t){return console.error(t),Promise.reject(t)}))},d=function(t){var e=void 0===t?{}:t,n=e.data,i=e.preloader,r=e.branding,o=e.type,a=n.rows,l=void 0===a?[]:a,s=n.years,c=void 0===s?[]:s;return'\n <div class="codersrank-timeline '+(i?"codersrank-timeline-loading":"")+'">\n '+(i?'\n <div class="codersrank-timeline-preloader"></div>\n ':"")+'\n <div class="codersrank-timeline-wrap">\n <div class="codersrank-timeline-year-lines">\n '+c.map((function(t,e){return'\n <div class="codersrank-timeline-year-line" style="left: calc(var(--col-width) * '+12*e+')"></div>\n '})).join("")+'\n </div>\n <div class="codersrank-timeline-years">\n '+c.map((function(t){return'\n <div class="codersrank-timeline-year" style="width: calc(var(--col-width) * 12)">\n <span>'+t+"</span>\n </div>\n "})).join("")+'\n </div>\n <div class="codersrank-timeline-chart" style="height: calc(var(--row-height) * '+l.length+')">\n '+l.map((function(t,e){return'\n <div class="codersrank-timeline-row">\n '+t.map((function(t){return'\n <div class="codersrank-timeline-item-wrap" style="left: calc(var(--col-width) * '+t.start_col+"); width: calc(var(--col-width) * "+(t.end_col-t.start_col)+"); height: var(--row-height); top: calc(var(--row-height) * "+e+')">\n <div class="codersrank-timeline-item" data-id="'+t.id+'">\n <span>'+function(t){return t.end_col-t.start_col<2?"":"workexperience"===o?t.title+" @ "+t.company:"portfolio"===o?t.project_title||"":"technologies"===o?'<img src="https://icon-widget.codersrank.io/api/'+encodeURIComponent(t.name)+'">'+t.name:""}(t)+"</span>\n </div>\n </div>\n "})).join("")+"\n </div>\n "})).join("")+"\n </div>\n </div>\n\n "+(r?'\n <div class="codersrank-timeline-branding">\n <a href="https://codersrank.io" target="_blank" rel="noopener noreferrer">\n <span>Powered by </span>\n <svg xmlns="http://www.w3.org/2000/svg" width="258" height="39" viewBox="0 0 258 39"><path fill="#19223C" d="M71.358 27.687A8.076 8.076 0 0 1 69 21.999c0-2.122.846-4.162 2.358-5.687a8.022 8.022 0 0 1 2.664-1.688 8.175 8.175 0 0 1 3.126-.543 8.298 8.298 0 0 1 4.723 1.339 7.155 7.155 0 0 1 2.895 3.791H80.12a3 3 0 0 0-1.182-1.283 3.106 3.106 0 0 0-1.713-.427 4.128 4.128 0 0 0-1.694.264 4.046 4.046 0 0 0-1.43.926 5.197 5.197 0 0 0-1.133 3.234c0 1.17.399 2.309 1.134 3.234.403.405.89.72 1.43.926a4.128 4.128 0 0 0 1.693.264c.586.039 1.17-.087 1.684-.364a3.01 3.01 0 0 0 1.211-1.198h4.571a7.156 7.156 0 0 1-2.895 3.792 8.298 8.298 0 0 1-4.723 1.338 8.173 8.173 0 0 1-3.085-.557 8.02 8.02 0 0 1-2.629-1.673zM88.652 27.687a8.076 8.076 0 0 1-2.359-5.688c0-2.122.846-4.162 2.359-5.687a8.57 8.57 0 0 1 5.79-2.238c2.15 0 4.221.8 5.79 2.238a8.076 8.076 0 0 1 2.358 5.687 8.076 8.076 0 0 1-2.359 5.688 8.491 8.491 0 0 1-5.79 2.266 8.491 8.491 0 0 1-5.79-2.266zm8.837-2.454A5.197 5.197 0 0 0 98.623 22c0-1.17-.4-2.308-1.134-3.234a4.398 4.398 0 0 0-3.048-1.219c-1.14 0-2.234.438-3.047 1.22a5.197 5.197 0 0 0-1.134 3.233c0 1.171.399 2.309 1.134 3.234a4.398 4.398 0 0 0 3.047 1.219c1.14 0 2.235-.438 3.048-1.219zM110.592 14.304a9.126 9.126 0 0 1 6.247 2.156 7.73 7.73 0 0 1 1.8 2.546 7.573 7.573 0 0 1 0 6.06 7.73 7.73 0 0 1-1.8 2.546 9.049 9.049 0 0 1-6.247 2.156h-5.561V14.304h5.561zm-1.752 12.64h1.752a4.596 4.596 0 0 0 1.903-.295 4.504 4.504 0 0 0 1.602-1.044 4.909 4.909 0 0 0 1.295-3.569 4.909 4.909 0 0 0-1.295-3.568 4.504 4.504 0 0 0-1.602-1.044 4.595 4.595 0 0 0-1.903-.294h-1.752v9.813zM131.313 14.23v2.9h-5.714v3.345h5.104v2.9H125.6v3.568h5.714v2.9h-9.599V14.23zM138.55 23.746v6.022h-3.885V14.304h6.247a6.19 6.19 0 0 1 4.266 1.413c.486.418.874.933 1.137 1.51.263.578.395 1.204.387 1.836a4.752 4.752 0 0 1-.838 2.602 4.578 4.578 0 0 1-2.743 1.784l3.885 6.32h-4.418l-3.58-6.023h-.458zm0-6.616v3.717h2.362c.253.01.505-.03.742-.12.236-.09.45-.226.63-.4.175-.178.312-.388.404-.617.091-.23.135-.475.128-.722a1.819 1.819 0 0 0-.128-.721 1.854 1.854 0 0 0-.405-.617 1.833 1.833 0 0 0-.63-.4 1.87 1.87 0 0 0-.741-.12h-2.362zM155.158 17.055a1.86 1.86 0 0 0-1.22.372c-.159.138-.284.311-.363.505-.08.193-.111.402-.093.61a1.528 1.528 0 0 0 .457 1.115c.32.31.712.539 1.143.67l1.523.445 1.676.52 1.524.744c.487.317.881.753 1.143 1.264.31.6.466 1.262.457 1.933a4.227 4.227 0 0 1-.45 1.859 4.333 4.333 0 0 1-1.226 1.487 6.424 6.424 0 0 1-4.343 1.412 6.899 6.899 0 0 1-4.342-1.263 4.331 4.331 0 0 1-1.278-1.588 4.223 4.223 0 0 1-.398-1.981h4.114c-.012.253.032.507.128.742.097.236.244.449.431.625a1.87 1.87 0 0 0 1.421.492c.475.02.94-.14 1.296-.447a1.382 1.382 0 0 0 .457-1.115 1.455 1.455 0 0 0-.457-1.115 2.986 2.986 0 0 0-1.143-.669l-1.524-.446-1.676-.52-1.523-.744a3.148 3.148 0 0 1-1.143-1.264 4 4 0 0 1-.305-1.859 4.15 4.15 0 0 1 .407-1.944 4.258 4.258 0 0 1 1.27-1.55 6.582 6.582 0 0 1 4.19-1.338 6.982 6.982 0 0 1 4.113 1.115 4.33 4.33 0 0 1 1.278 1.588c.292.62.428 1.299.398 1.98h-4.19a2.056 2.056 0 0 0-.533-1.263 1.611 1.611 0 0 0-1.22-.372zM168.261 23.746v6.022h-3.885V14.304h6.247a6.19 6.19 0 0 1 4.266 1.413c.486.418.874.933 1.137 1.51.263.578.395 1.204.387 1.836a4.752 4.752 0 0 1-.838 2.602 4.578 4.578 0 0 1-2.743 1.784l3.885 6.32H172.3l-3.58-6.023h-.458zm0-6.616v3.717h2.362c.253.01.505-.03.742-.12.236-.09.45-.226.63-.4.175-.178.312-.388.404-.617.091-.23.135-.475.128-.722a1.819 1.819 0 0 0-.128-.721 1.854 1.854 0 0 0-.405-.617 1.833 1.833 0 0 0-.63-.4 1.87 1.87 0 0 0-.741-.12h-2.362zM189.592 29.768l-.914-2.602h-5.714l-.914 2.602h-4.114l5.485-15.538h4.723l5.485 15.538h-4.037zm-5.638-5.501h3.733l-1.828-5.428-1.905 5.428zM205.972 14.23h3.885v15.538h-3.885l-6.476-9.813v9.813h-3.885V14.23h3.885l6.476 9.814zM217.093 29.768h-3.885V14.304h3.885v6.766l5.257-6.766h5.104l-6.552 7.732 6.552 7.732h-4.952l-5.333-6.84zM232.863 27.761a1.98 1.98 0 0 1-.5 1.253 2.07 2.07 0 0 1-1.197.664 2.1 2.1 0 0 1-1.359-.222 2.024 2.024 0 0 1-.91-1.01 1.962 1.962 0 0 1-.054-1.342c.141-.44.433-.82.827-1.076a2.096 2.096 0 0 1 2.583.246c.201.194.359.426.464.682.105.256.154.53.146.805z"></path> <path fill="#67a4ac" d="M235.301 29.768V14.304h3.885v15.464zM244.062 27.687a8.076 8.076 0 0 1-2.358-5.688c0-2.122.846-4.162 2.358-5.687a8.57 8.57 0 0 1 5.79-2.238c2.151 0 4.222.8 5.79 2.238A8.076 8.076 0 0 1 258 21.999a8.076 8.076 0 0 1-2.358 5.688 8.491 8.491 0 0 1-5.79 2.266 8.491 8.491 0 0 1-5.79-2.266zm8.837-2.454A5.197 5.197 0 0 0 254.033 22c0-1.17-.399-2.308-1.134-3.234a4.398 4.398 0 0 0-3.047-1.219c-1.14 0-2.235.438-3.047 1.22a5.197 5.197 0 0 0-1.134 3.233c0 1.171.399 2.309 1.134 3.234a4.398 4.398 0 0 0 3.047 1.219c1.14 0 2.235-.438 3.047-1.219z"></path> <path d="M33.25.054L2.147 19.634C.682 20.52-.034 21.512.001 22.611v2.98c.035 1.1.768 2.075 2.2 2.926l15.393 8.885a.726.726 0 0 0 1.047-.373l3.456-8.352-7.33-4.15a1.317 1.317 0 0 1-.514-.477 1.346 1.346 0 0 1 .461-1.864l13.457-8.247L33.72.427a.324.324 0 0 0-.103-.36.31.31 0 0 0-.369-.013z" fill="#19223c"></path> <path d="M58.8 10.961L43.618 1.757a.726.726 0 0 0-1.047.32l-3.56 8.352 7.225 4.31c.208.113.381.282.502.488a1.347 1.347 0 0 1 0 1.363 1.318 1.318 0 0 1-.502.49l-13.561 7.98-5.76 13.407a.323.323 0 0 0 .026.452.312.312 0 0 0 .445-.026l9.949-6.012 3.927 5.64a.947.947 0 0 0 .785.425h9.425a.932.932 0 0 0 .832-.506.97.97 0 0 0-.047-.984l-6.388-9.79 12.933-7.82c1.466-.887 2.199-1.88 2.199-2.98V13.94c0-1.1-.733-2.092-2.2-2.979z" fill="#67a4ac"></path></svg>\n </a>\n </div>\n ':"")+"\n </div>\n "},p=function(t,e){var n;return n=12*(e.getFullYear()-t.getFullYear()),n-=t.getMonth(),n+=e.getMonth(),Math.abs(n<=0?0:n)},h=function(t,n){void 0===t&&(t=[]);var i,r,o=[],a=[],l=function(t,e,n,i){a.push({name:t,start_date:e,end_date:n,items:[i]})};"technologies"===n&&(t.sort((function(t,e){return(t.start_date?new Date(t.start_date):new Date)-(e.start_date?new Date(e.start_date):new Date)})),t.forEach((function(t){[].concat(t.highlighted_technologies||[]).forEach((function(e){!function(t,e){var n,i=e.start_date,r=e.end_date,o=e.is_current,s=i?new Date(i):new Date,c=r&&!o?new Date(r):new Date,d=a.filter((function(e){return e.name.toLowerCase()===t.toLowerCase()}));d.length?(d.forEach((function(t){if(!n){var i,r,o,a,l=t.start_date?new Date(t.start_date):new Date,d=t.end_date?new Date(t.end_date):new Date;r=c,a=d,((i=s)<=(o=l)&&o<=r||i<=a&&a<=r||o<i&&r<a)&&(n=!0,t.start_date=new Date(Math.min(s,l)),t.end_date=new Date(Math.max(c,d)),t.items.push(e))}})),n||l(t,s,c,e)):l(t,s,c,e)}(e,t)}))})),t=a);var s=function(t){void 0===t&&(t=""),(i=new Date(t)).setMonth(0,1)};s(new Date),t.forEach((function(t){var e,n=new Date(t.start_date),o=t.is_current?new Date:new Date(t.end_date);n<i&&s(n),(!r||o>r)&&(void 0===(e=o)&&(e=""),r=new Date(e))}));var c=[];t.forEach((function(t,n){var r=new Date(t.start_date),o=t.is_current?new Date:new Date(t.end_date),a=p(i,r),l=a+p(r,o);c.push(e({start_col:a,end_col:l,id:n},t))})),c.sort((function(t,e){return t.start_col>e.start_col?1:-1}));var d=function t(e,n){var i=e.start_col;return o[n]&&o[n].slice(0,c.indexOf(e)).filter((function(t){return t.end_col>i})).length>0?t(e,n+=1):n};c.forEach((function(t){var e=d(t,0);o[e]||(o[e]=[]),o[e].push(t)}));return{rows:o,years:function(){var t=i.getFullYear(),e=r.getFullYear(),n=[t];if(e>t)for(var o=1;o<=e-t;o+=1)n.push(t+o);return n}()}};var m=function(t,e){var n,i,r=("#"+(n=function(t){for(var e=0,n=0;n<t.length;n+=1)e=t.charCodeAt(n)+((e<<5)-e);return e}(t||""),i=(16777215&n).toString(16).toUpperCase(),"00000".substring(0,6-i.length)+i)).toLowerCase();return e?'\n <img src="'+e+'" alt="'+t+'" title="'+t+'" />\n ':'\n <svg title="'+t+'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">\n <rect width="32" height="32" fill="'+r+'" rx="3" />\n '+(t?'\n <text\n x="50%"\n y="50%"\n font-weight="bold"\n font-size="20"\n fill="#fff"\n dy="0"\n text-anchor="middle"\n dominant-baseline="middle"\n >\n '+t[0].toUpperCase()+"\n </text>\n ":"")+"\n\n </svg>\n "},u=function t(e,n){var i,r,o,a,l=function(t){return t?Intl.DateTimeFormat("en",{month:"short",year:"numeric"}).format(new Date(t)):""},s=function(t){void 0===t&&(t=!0);var n,i,r=l(e.start_date||e.date_from),o=e.is_current?"Present":l(e.end_date||e.date_to);return t?r+" - "+o+" ("+(n=function(t,e,n){var i=n?new Date:new Date(e);return p(new Date(t),i)}(e.start_date||e.date_from,e.end_date||e.date_to,e.is_current),i="",(0===n?"Less than a month":(n>=12&&(i+=Math.floor(n/12),i+=" year",1!==Math.floor(n/12)&&(i+="s")),n%12!=0&&(n>=12&&(i+=" "),i+=n%12,i+=" month",n%12!=1&&(i+="s")),i))+")"):r+" - "+o},c=function(){return"technologies"===n?'<img src="https://icon-widget.codersrank.io/api/'+encodeURIComponent(e.name)+'">':"workexperience"===n?m(e.company,e.company_logo):m(e.project_title,e.image)},d=function(){return"workexperience"===n?e.title:e.role};return"technologies"===n?'\n <div class="codersrank-timeline-tooltip-item">\n <div class="logo">\n '+c()+'\n </div>\n <div class="content">\n <div class="title">\n '+e.name+'\n </div>\n <div class="details">\n <div>'+s(!0)+'</div>\n </div>\n </div>\n </div>\n <div class="codersrank-timeline-tooltip-divider"></div>\n '+e.items.map((function(e){return t(e,e._type)})).join("")+"\n ":'\n <div class="codersrank-timeline-tooltip-item">\n <div class="logo">\n '+c()+'\n </div>\n <div class="content">\n <div class="title">\n '+("workexperience"===n?e.company:e.project_title)+"\n </div>\n "+(d()?'\n <div class="subtitle">\n '+d()+"\n </div>\n ":"")+'\n <div class="details">\n <div>'+s(!0)+"</div>\n "+(e.location?"\n <div>"+(o=(r=e).location,a=r.is_remote,("Remote, Earth"===o||a?"Remote":o||"")+"</div>\n "):"")+"\n </div>\n "+(e.description?'\n <div class="description">\n <div>'+(void 0===(i=e.description)&&(i=""),(i||"").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>")+"</div>\n </div>\n "):"")+"\n "+(e.highlighted_technologies||e.other_technologies?'\n <div class="tags">\n '+e.highlighted_technologies.map((function(t){return'\n <span class="tag"><span class="tag-star">★</span>'+t+"</span>\n "})).join("")+"\n\n "+e.other_technologies.map((function(t){return'\n <span class="tag">'+t+"</span>\n "})).join("")+"\n </div>\n ":"")+"\n </div>\n </div>\n "},f="codersrank-timeline",g=function(n){var i,r;function o(){var t;return(t=n.call(this)||this).shadowEl=t.attachShadow({mode:"closed"}),t.tempDiv=document.createElement("div"),t.stylesEl=document.createElement("style"),t.stylesEl.textContent=":host{--preloader-color:#72a0a8;--year-font-size:12px;--year-opacity:0.5;--year-height:24px;--year-text-color:currentColor;--year-line-color:currentColor;--year-line-opacity:0.25;--col-width:24px;--row-height:36px;--timeline-item-bg-color:#f1f1f1;--timeline-item-text-color:inherit;--timeline-item-font-size:12px;--timeline-item-padding:4px 8px;--timeline-item-border-radius:4px;--tooltip-logo-size:32px;--tooltip-font-size:14px;--tooltip-width:320px;--tooltip-padding:16px;--tooltip-bg-color:#fff;--tooltip-border-radius:4px;--tooltip-text-color:#333;--tooltip-box-shadow:0px 10px 20px rgba(0, 0, 0, 0.1);--tag-border:none;--tag-star-color:#ff9900;--tag-bg-color:rgba(0, 0, 100, 0.075);--tag-font-size:0.85em;--tag-font-weight:bold;--tag-padding:0.35em 0.57em;--tag-margin:0.28em;--tag-border-radius:4px;--tag-text-color:inherit;--branding-text-color:inherit;width:100%;display:block;position:relative}.codersrank-timeline{position:relative}.codersrank-timeline-loading{height:100px}.codersrank-timeline-preloader{position:absolute;left:50%;top:50%;width:32px;height:32px;margin:-16px 0 0 -16px;border:3px solid var(--preloader-color);border-left-color:transparent;border-bottom-color:transparent;border-radius:50%;box-sizing:border-box;-webkit-animation:preloader 1s infinite linear;animation:preloader 1s infinite linear}.codersrank-timeline-wrap{position:relative;overflow:auto;padding-bottom:var(--year-height)}.codersrank-timeline-years{display:flex}.codersrank-timeline-year{font-size:var(--year-font-size);opacity:var(--year-opacity);flex-shrink:0;height:var(--year-height);display:flex;align-items:center;color:var(--year-text-color)}.codersrank-timeline-year>span{padding-left:4px;padding-right:4px;position:-webkit-sticky;position:sticky;left:0}.codersrank-timeline-year-line{position:absolute;top:0;border-left:1px dashed var(--year-line-color);opacity:var(--year-line-opacity);height:100%;z-index:0;margin-left:-2px}.codersrank-timeline-chart{position:relative;z-index:10}.codersrank-timeline-item-wrap{position:absolute}.codersrank-timeline-item{position:absolute;left:2px;top:2px;right:2px;bottom:2px;background-color:var(--timeline-item-bg-color);font-size:var(--timeline-item-font-size);display:flex;align-items:center;border-radius:var(--timeline-item-border-radius);color:var(--timeline-item-text-color);cursor:pointer;transition-duration:.2s}.codersrank-timeline-item:hover{opacity:.8}.codersrank-timeline-item span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%;position:-webkit-sticky;position:sticky;padding:var(--timeline-item-padding);left:0;display:flex;align-items:center}.codersrank-timeline-item span img{width:24px;height:24px;margin-right:4px}.codersrank-timeline-tooltip{text-align:left;position:absolute;background:var(--tooltip-bg-color);transform:translateX(-50%) translateY(-100%);border-radius:var(--tooltip-border-radius);color:var(--tooltip-text-color);box-shadow:var(--tooltip-box-shadow);font-family:var(--font-family);font-size:var(--tooltip-font-size,14px);margin-top:-10px;width:var(--tooltip-width);max-width:80vw;line-height:1.5;z-index:1000}.codersrank-timeline-tooltip-content{max-height:80vh;overflow:auto;padding:var(--tooltip-padding)}.codersrank-timeline-tooltip-angle{width:0px;height:0px;position:absolute;left:50%;top:100%;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid var(--tooltip-bg-color);margin-left:-5px}.codersrank-timeline-tooltip-bottom{transform:translateX(-50%);margin-top:34px}.codersrank-timeline-tooltip-bottom .codersrank-timeline-tooltip-angle{bottom:100%;top:auto;transform:rotate(180deg)}.codersrank-timeline-tooltip-divider{height:1px;background:rgba(0,0,0,.1);margin:16px 0}.codersrank-timeline-tooltip-item+.codersrank-timeline-tooltip-item{margin-top:16px}.codersrank-timeline-tooltip-item{display:flex}.codersrank-timeline-tooltip-item .logo{width:var(--tooltip-logo-size);height:var(--tooltip-logo-size);margin-right:16px;flex-shrink:0}.codersrank-timeline-tooltip-item .logo img,.codersrank-timeline-tooltip-item .logo svg{width:100%}.codersrank-timeline-tooltip-item .content{width:100%;min-width:0;flex-shrink:10}.codersrank-timeline-tooltip-item .title{font-weight:700;font-size:1.25em}.codersrank-timeline-tooltip-item .subtitle{font-weight:700}.codersrank-timeline-tooltip-item .details{opacity:.5}.codersrank-timeline-tooltip-item .description{margin:.5em 0}.codersrank-timeline-tooltip-item .tags{margin-top:.5em;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start}.codersrank-timeline-tooltip-item .tag{display:inline-flex;padding:var(--tag-padding);font-size:var(--tag-font-size);background:var(--tag-bg-color);border-radius:var(--tag-border-radius);font-weight:var(--tag-font-weight);line-height:1;margin-right:var(--tag-margin);margin-bottom:var(--tag-margin);border:var(--tag-border);color:var(--tag-text-color)}.codersrank-timeline-tooltip-item .tag-star{color:var(--tag-star-color);margin-right:4px}.codersrank-timeline-branding{justify-content:flex-end;align-items:center;font-size:12px;color:var(--branding-text-color);display:flex;margin-top:.5em}.codersrank-timeline-branding a{opacity:.5;display:flex;align-items:center;color:inherit;text-decoration:none;transition-duration:.2s;position:relative;z-index:1;transform:translate3d(0,0,0)}.codersrank-timeline-branding a:hover{opacity:1}.codersrank-timeline-branding span{margin-right:4px}.codersrank-timeline-branding svg{height:16px;width:auto}@-webkit-keyframes preloader{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes preloader{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}",t.shadowEl.appendChild(t.stylesEl),t.onDocumentClick=t.onDocumentClick.bind(l(t)),t.onWidgetClick=t.onWidgetClick.bind(l(t)),t.mounted=!1,t.state=0,t.data=null,t}r=n,(i=o).prototype=Object.create(r.prototype),i.prototype.constructor=i,i.__proto__=r;var a,s,p,m=o.prototype;return m.render=function(){var t=this.username,n=this.mounted,i=this.state,r=this.shadowEl,o={data:this.data,type:this.type,branding:this.branding};if(t&&n){3===i?this.tempDiv.innerHTML=d(o):2===i?this.tempDiv.innerHTML="":0!==i&&1!==i||(this.tempDiv.innerHTML=function(t){return d(e({},t,{preloader:!0,data:[]}))}(o));var a=r.querySelector(".codersrank-timeline");a&&a.parentNode.removeChild(a),(a=this.tempDiv.querySelector(".codersrank-timeline"))&&(this.widgetEl=a,this.detachEvents(),this.attachEvents(),r.appendChild(a))}},m.loadAndRender=function(){var t=this,e=this.username,n=this.type;this.state=1,this.render(),c(e,n).then((function(e){t.data=h(e,n),t.state=3,t.render()})).catch((function(){t.state=2,t.render()}))},m.tooltipText=function(t){var e;return this.data.rows.forEach((function(n){n.forEach((function(n){n.id===parseInt(t,10)&&(e=n)}))})),e?u(e,this.type):""},m.showTooltip=function(t){if(this.data&&t&&this.widgetEl){var e=this.shadowEl.querySelector('[data-id="'+t+'"]');if(e){var n=this.tooltipText(t);if(n){this.tempDiv.innerHTML='\n <div class="codersrank-timeline-tooltip">\n <div class="codersrank-timeline-tooltip-content">\n '+n+'\n </div>\n <div class="codersrank-timeline-tooltip-angle"></div>\n </div>\n ';var i=this.getBoundingClientRect(),r=e.getBoundingClientRect(),o=this.tempDiv.querySelector(".codersrank-timeline-tooltip"),a=r.left-i.left<0?0:r.left-i.left,l=r.width;r.left<0&&(l=r.width+r.left-i.left),a+l>i.width&&(l=i.width-a);var s=a+l/2;s<0&&(s=0),s>i.width&&(s=i.width),o.style.left=s+"px",o.style.top=r.top-i.top+"px",o.querySelector(".codersrank-timeline-tooltip-angle"),this.shadowEl.appendChild(o),o.getBoundingClientRect().top<0&&o.classList.add("codersrank-timeline-tooltip-bottom")}}}},m.hideTooltip=function(){if(this.widgetEl){var t=this.shadowEl.querySelector(".codersrank-timeline-tooltip");t&&this.shadowEl.removeChild(t)}},m.onDocumentClick=function(t){t.target!==this&&this.hideTooltip()},m.onWidgetClick=function(t){this.hideTooltip();var e,n=t.target,i=n&&n.parentElement;n.classList&&n.classList.contains("codersrank-timeline-item")?e=n:i.classList&&i.classList.contains("codersrank-timeline-item")&&(e=i),e&&this.showTooltip(e.getAttribute("data-id"))},m.attachEvents=function(){this.widgetEl&&(document.addEventListener("click",this.onDocumentClick,!0),this.widgetEl.addEventListener("click",this.onWidgetClick,!0))},m.detachEvents=function(){this.widgetEl&&(document.removeEventListener("click",this.onDocumentClick,!0),this.widgetEl.removeEventListener("click",this.onWidgetClick,!0))},m.attributeChangedCallback=function(){this.mounted&&this.loadAndRender()},m.connectedCallback=function(){this.width=this.offsetWidth,this.mounted=!0,this.loadAndRender()},m.disconnectedCallback=function(){this.mounted=!1,this.detachEvents()},a=o,p=[{key:"observedAttributes",get:function(){return["username","type"]}}],(s=[{key:"username",get:function(){return this.getAttribute("username")},set:function(t){this.setAttribute("username",t)}},{key:"type",get:function(){return this.getAttribute("type")||"workexperience"},set:function(t){this.setAttribute("type",t)}},{key:"branding",get:function(){return"false"!==this.getAttribute("branding")},set:function(t){this.setAttribute("branding",t)}}])&&t(a.prototype,s),p&&t(a,p),o}(a(HTMLElement));window.customElements&&!window.customElements.get(f)&&window.customElements.define(f,g)}));
//# sourceMappingURL=codersrank-timeline.min.js.map

@@ -38,4 +38,19 @@ var cache = {

}).then(function (data) {
cache[endpoint][username] = data.projects || data.work_experiences || [];
return data.projects || data.work_experiences || [];
var projects = [];
var workExperiences = [];
if (typeof data.projects !== 'undefined') {
projects = data.projects.filter(function (e) {
return e.start_date !== '0001-01';
});
}
if (typeof data.work_experiences !== 'undefined') {
workExperiences = data.work_experiences.filter(function (e) {
return e.start_date !== '0001-01';
});
}
cache[endpoint][username] = projects || workExperiences || [];
return projects || workExperiences || [];
})["catch"](function (err) {

@@ -42,0 +57,0 @@ // eslint-disable-next-line

{
"name": "@codersrank/timeline",
"version": "0.9.0",
"version": "0.9.1",
"description": "Codersrank Timeline Widget",

@@ -5,0 +5,0 @@ "main": "cjs/codersrank-timeline.js",

@@ -42,3 +42,3 @@ # Codersrank Timeline Widget

```html
<codersrank-timeline username="YOUR_USERNAME"></codersrank-timeline>
<codersrank-timeline type="technologies" username="YOUR_USERNAME"></codersrank-timeline>
```

@@ -45,0 +45,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc