System.register(["./p-6cc918a4.system.js","./p-bb7ef5f0.system.js"],(function(t){"use strict";var e,o,s,n,i;return{setters:[function(t){e=t.r;o=t.f;s=t.h;n=t.e},function(t){i=t.i}],execute:function(){var a=":host,stencila-document-toolbar{--background:var(--color-neutral-100);display:block}:host([position=fixed]),stencila-document-toolbar[position=fixed]{left:0;max-width:none!important;position:fixed;top:0;width:100%;z-index:30}:host([position=fixed])+*,stencila-document-toolbar[position=fixed]+*{margin-top:3rem}:host .hidden-sm,stencila-document-toolbar .hidden-sm{display:none}@media (min-width:640px){:host .hidden-sm,stencila-document-toolbar .hidden-sm{display:inline}}:host .documentStatus,stencila-document-toolbar .documentStatus{color:#4a4a4a;color:var(--color-key,#4a4a4a);font-size:.875rem;line-height:1.25rem;line-height:1}:host .documentStatus.success,stencila-document-toolbar .documentStatus.success{color:#1b5430;color:var(--color-success-700,#1b5430)}:host .documentStatus.danger,stencila-document-toolbar .documentStatus.danger{color:#cf445e;color:var(--color-danger-500,#cf445e)}:host .documentStatus stencila-icon,stencila-document-toolbar .documentStatus stencila-icon{margin-right:.25rem}:host .documentStatus stencila-tooltip,stencila-document-toolbar .documentStatus stencila-tooltip{cursor:help}:host .documentStatus span,stencila-document-toolbar .documentStatus span{vertical-align:middle}";var c=":host,stencila-document-toolbar{--background:var(--color-neutral-100);display:block}:host([position=fixed]),stencila-document-toolbar[position=fixed]{left:0;max-width:none!important;position:fixed;top:0;width:100%;z-index:30}:host([position=fixed])+*,stencila-document-toolbar[position=fixed]+*{margin-top:3rem}:host .hidden-sm,stencila-document-toolbar .hidden-sm{display:none}@media (min-width:640px){:host .hidden-sm,stencila-document-toolbar .hidden-sm{display:inline}}:host .documentStatus,stencila-document-toolbar .documentStatus{color:#4a4a4a;color:var(--color-key,#4a4a4a);font-size:.875rem;line-height:1.25rem;line-height:1}:host .documentStatus.success,stencila-document-toolbar .documentStatus.success{color:#1b5430;color:var(--color-success-700,#1b5430)}:host .documentStatus.danger,stencila-document-toolbar .documentStatus.danger{color:#cf445e;color:var(--color-danger-500,#cf445e)}:host .documentStatus stencila-icon,stencila-document-toolbar .documentStatus stencila-icon{margin-right:.25rem}:host .documentStatus stencila-tooltip,stencila-document-toolbar .documentStatus stencila-tooltip{cursor:help}:host .documentStatus span,stencila-document-toolbar .documentStatus span{vertical-align:middle}";var l=t("stencila_document_toolbar",function(){function t(t){var s=this;e(this,t);this.codeExecuteEvent=o(this,"stencila-code-execute",7);this.kernelRestart=o(this,"stencila-kernel-restart",7);this.codeExecuteCancelEvent=o(this,"stencila-code-execute-cancel",7);var n,a;this.position="fixed";this.isExecutable=Object.keys((a=(n=window.stencilaWebClient)===null||n===void 0?void 0:n.executableLanguages)!==null&&a!==void 0?a:{}).length>0;this.shiftIsPressed=false;this.altIsPressed=false;this.onKeyPress=function(t){s.shiftIsPressed=t.shiftKey;s.altIsPressed=t.altKey};this.addKeyListeners=function(){window.addEventListener("keydown",s.onKeyPress);window.addEventListener("keyup",s.onKeyPress)};this.removeKeyListeners=function(){window.removeEventListener("keydown",s.onKeyPress);window.removeEventListener("keyup",s.onKeyPress);s.shiftIsPressed=false;s.altIsPressed=false};this.runDocument=function(t){if(i(s.executeStatus)){s.codeExecuteCancelEvent.emit({nodeId:null,scope:"All"})}else{if(s.altIsPressed){s.kernelRestart.emit()}else{s.codeExecuteEvent.emit({nodeId:null,ordering:t.shiftKey?"Appearance":"Topological"})}}}}t.prototype.onDiscoverExecutableLanguages=function(t){var e=t.detail;this.isExecutable=Object.keys(e.languages).length>0};t.prototype.render=function(){return s(n,{position:this.position},s("stencila-toolbar",null,s("span",{slot:"start"},s("stencila-button",{onKeyDown:this.onKeyPress,color:"stock",icon:this.altIsPressed?"restart":i(this.executeStatus)?"loader-2":"play",size:"small",onClick:this.runDocument,disabled:!this.isExecutable,dataEl:"Toolbar/Run Document",onMouseEnter:this.addKeyListeners,onMouseLeave:this.removeKeyListeners,tooltip:this.altIsPressed?undefined:this.shiftIsPressed?"Run sequentially":"Run topologically"},this.altIsPressed?"Restart kernel":i(this.executeStatus)?"Cancel":["Run",s("span",{class:"hidden-sm"}," Document")])),this.sourceUrl!==undefined&&s("span",{slot:"end"},s("stencila-button",{color:"stock",href:this.sourceUrl,target:"_blank",rel:"nofollow noopener",icon:"external-link",size:"small",dataEl:"Toolbar/Project Source"},"Source"))))};return t}());l.style={default:a,material:c}}}}));
//# sourceMappingURL=p-33e72789.system.entry.js.map