UNPKG

@stencil/core

Version:

A Compiler for Web Components and Progressive Web Apps

1 lines 3.69 kB
var __awaiter=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function a(t){try{u(n.next(t))}catch(t){s(t)}}function o(t){try{u(n["throw"](t))}catch(t){s(t)}}function u(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(a,o)}u((n=n.apply(t,e||[])).next())})};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(t){return function(e){return u([t,e])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(s=a[0]&2?i["return"]:a[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;if(i=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(s=r.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1];s=a;break}if(s&&r.label<s[2]){r.label=s[2];r.ops.push(a);break}if(s[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-459b95cc.system.js"],function(t){"use strict";var e,r;return{setters:[function(t){e=t.r;r=t.h}],execute:function(){var n=function(){function t(t){e(this,t);this.appSrcUrl="";this.imagesUrl="/data/images/";this.buildsUrl="/data/builds/"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,function(){var t,e,r,n;return __generator(this,function(i){switch(i.label){case 0:t="master";if(this.match&&this.match.params.buildId){t=this.match.params.buildId.substr(0,7)}e=""+this.buildsUrl+t+".json";if(t==="master"){e+="?ts="+Date.now()}return[4,fetch(e)];case 1:r=i.sent();if(!r.ok)return[3,3];n=this;return[4,r.json()];case 2:n.build=i.sent();document.title=this.build.id+" Preview: "+this.build.message;i.label=3;case 3:return[2]}})})};t.prototype.render=function(){var t=this;var e=[];if(this.build){this.build.screenshots.forEach(function(r){var n=r.testPath.split("/");n.pop();var i="/data/tests/"+t.build.id+"/"+n.join("/")+"/";if(!e.some(function(t){return t.url===i})){var s={desc:r.desc.split(",")[0],url:i};e.push(s)}})}e.sort(function(t,e){if(t.desc.toLowerCase()<e.desc.toLowerCase())return-1;if(t.desc.toLowerCase()>e.desc.toLowerCase())return 1;return 0});return[r("compare-header",{appSrcUrl:this.appSrcUrl}),r("section",{class:"scroll-y"},r("section",{class:"content"},this.build?r("h1",null,r("a",{href:this.build.url},this.build.message)):null,e.map(function(t){return r("div",null,r("a",{href:t.url},t.desc))})))]};Object.defineProperty(t,"style",{get:function(){return"screenshot-preview{display:block}screenshot-preview .scroll-y{width:100%}screenshot-preview h1{color:var(--analysis-data-color);font-size:16px;margin:0}screenshot-preview .content{padding:80px 20px 140px 20px}screenshot-preview a{display:block;padding:8px;color:var(--analysis-data-color);text-decoration:none}screenshot-preview a:hover{text-decoration:underline}screenshot-preview compare-header{left:0;padding:0;width:100%;height:auto;padding-top:env(safe-area-inset-top)}screenshot-preview compare-header compare-filter{display:none}\@media (max-width:480px){screenshot-preview a{padding:12px;font-size:18px}screenshot-preview a:hover{text-decoration:none}}"},enumerable:true,configurable:true});return t}();t("screenshot_preview",n)}}});