text: !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lit"),require("@lrnwebcomponents/simple-tooltip/simple-tooltip.js"),require("@lrnwebcomponents/lrndesign-avatar/lrndesign-avatar.js"),require("@lrnwebcomponents/accent-card/accent-card.js"),require("@github/time-elements"),require("@lrnwebcomponents/nav-card/nav-card.js"),require("@lrnwebcomponents/hexagon-loader/hexagon-loader.js"),require("@lrnwebcomponents/simple-icon/lib/simple-icon-lite.js"),require("@lrnwebcomponents/hax-iconset/lib/simple-hax-iconset.js"),require("lit-element-router"),require("@lrnwebcomponents/simple-fields/lib/simple-fields-field.js"),require("@lrnwebcomponents/accent-card/lib/accent-card-clickable.js"),require("@vaadin/vaadin-upload/vaadin-upload.js"),require("@lrnwebcomponents/rich-text-editor/rich-text-editor.js"),require("@lrnwebcomponents/rich-text-editor/lib/toolbars/rich-text-editor-toolbar-full.js"),require("@lrnwebcomponents/img-view-modal/img-view-modal.js"),require("@lrnwebcomponents/hax-iconset/hax-iconset.js"),require("@lrnwebcomponents/threaded-discussion/threaded-discussion.js")):"function"==typeof define&&define.amd?define(["exports","lit","@lrnwebcomponents/simple-tooltip/simple-tooltip.js","@lrnwebcomponents/lrndesign-avatar/lrndesign-avatar.js","@lrnwebcomponents/accent-card/accent-card.js","@github/time-elements","@lrnwebcomponents/nav-card/nav-card.js","@lrnwebcomponents/hexagon-loader/hexagon-loader.js","@lrnwebcomponents/simple-icon/lib/simple-icon-lite.js","@lrnwebcomponents/hax-iconset/lib/simple-hax-iconset.js","lit-element-router","@lrnwebcomponents/simple-fields/lib/simple-fields-field.js","@lrnwebcomponents/accent-card/lib/accent-card-clickable.js","@vaadin/vaadin-upload/vaadin-upload.js","@lrnwebcomponents/rich-text-editor/rich-text-editor.js","@lrnwebcomponents/rich-text-editor/lib/toolbars/rich-text-editor-toolbar-full.js","@lrnwebcomponents/img-view-modal/img-view-modal.js","@lrnwebcomponents/hax-iconset/hax-iconset.js","@lrnwebcomponents/threaded-discussion/threaded-discussion.js"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).ElmslnStudio={},n.lit,null,null,null,null,null,null,null,null,n.litElementRouter)}(this,(function(n,t,e,i,s,o,a,l,r,c,d){"use strict";function u(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,i)}return e}function m(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?u(Object(e),!0).forEach((function(t){g(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}function p(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function h(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function f(n,t,e){return t&&h(n.prototype,t),e&&h(n,e),n}function g(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function b(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&y(n,t)}function v(n){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function y(n,t){return(y=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}function k(n,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(n)}function x(n){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(n){return!1}}();return function(){var e,i=v(n);if(t){var s=v(this).constructor;e=Reflect.construct(i,arguments,s)}else e=i.apply(this,arguments);return k(this,e)}}function w(n,t,e){return(w="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(n,t,e){var i=function(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&null!==(n=v(n)););return n}(n,t);if(i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(e):s.value}})(n,t,e||n)}function j(n,t){return t||(t=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(t)}}))}function S(n){return function(n){if(Array.isArray(n))return F(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,t){if(!n)return;if("string"==typeof n)return F(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);"Object"===e&&n.constructor&&(e=n.constructor.name);if("Map"===e||"Set"===e)return Array.from(n);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return F(n,t)}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}var L,z,_,D,O,A,N,T=function(n){return function(n){b(i,n);var e=x(i);function i(){return p(this,i),e.apply(this,arguments)}return f(i,null,[{key:"styles",get:function(){return[t.css(L||(L=j(['\n          :host {\n            font-family: var(\n              --elmsln-studio-secondary-FontFamily,\n              "Helvetica Neue",\n              sans-serif\n            );\n            font-family: var(--elmsln-studio-FontFamily, "Roboto", sans-serif);\n            font-size: var(--elmsln-studio-FontSize, 16px);\n          }\n          *[hidden] {\n            display: none !important;\n          }\n          .sr-only {\n            position: absolute;\n            left: -9999999px;\n            width: 0;\n            overflow: hidden;\n          }\n          #studio-nav {\n            display: flex;\n            align-items: stretch;\n            justify-content: center;\n            margin-bottom: var(--elmsln-studio-margin, 20px);\n            flex-wrap: wrap;\n          }\n          #studio-nav elmsln-studio-link {\n            font-family: var(--elmsln-studio-FontFamily, "Roboto", sans-serif);\n            font-size: calc(1.25 * var(--elmsln-studio-FontSize, 16px));\n            flex: 0 1 auto;\n            color: #9d9d9d;\n            padding: calc(0.25 * var(--elmsln-studio-margin, 20px))\n              calc(0.25 * var(--elmsln-studio-margin, 20px));\n          }\n          #studio-nav elmsln-studio-link[active] {\n            font-weight: bold;\n            color: #000;\n            --elmsln-studio-link-TextDecoration: underline !important;\n            --elmsln-studio-link-TextDecorationThickness: 3px;\n          }\n          #studio-nav elmsln-studio-link:not([disabled]):focus-within,\n          #studio-nav elmsln-studio-link:not([disabled]):hover {\n            --elmsln-studio-link-TextDecoration: underline !important;\n          }\n          .primary-404 {\n            min-height: 20vh;\n            display: flex;\n          }\n          #message-404 {\n            background-color: #ffffff;\n            margin: 0 auto;\n            padding: 20px;\n          }\n          #message-404 elmsln-studio-link {\n            color: blue;\n            display: inline;\n          }\n          #message-404 elmsln-studio-link:not([disabled]):hover,\n          #message-404 elmsln-studio-link:not([disabled]):focus-within {\n            text-decoration: underline;\n          }\n          .filters {\n            padding-bottom: calc(0.5 * var(--elmsln-studio-margin, 20px));\n            margin-bottom: calc(0.5 * var(--elmsln-studio-margin, 20px));\n            border-bottom: 1px solid #ddd;\n            line-height: calc(1.5 * var(--elmsln-studio-FontSize, 16px));\n          }\n          simple-fields-field {\n            color: #95989a;\n            --simple-fields-border-color: transparent;\n            --simple-fields-font-size: var(--elmsln-studio-FontSize, 16px);\n            --simple-fields-detail-font-size: var(\n              --elmsln-studio-FontSize,\n              16px\n            );\n            --simple-fields-line-height: calc(\n              1.5 * var(--elmsln-studio-FontSize, 16px)\n            );\n            --simple-fields-detail-line-height: calc(\n              1.5 * var(--elmsln-studio-FontSize, 16px)\n            );\n            --simple-fields-font-family: var(\n              --elmsln-studio-FontFamily,\n              "Roboto",\n              sans-serif\n            );\n            --simple-fields-detail-font-family: var(\n              --elmsln-studio-FontFamily,\n              "Roboto",\n              sans-serif\n            );\n          }\n          hexagon-loader {\n            margin-bottom: calc(0.5 * var(--elmsln-studio-margin, 20px));\n          }\n          accent-card img-view-modal[slot="image-corner"] {\n            float: right;\n          }\n          accent-card img-view-modal[slot="image-corner"],\n          accent-card img-view-modal[slot="image-corner"]:focus-within,\n          accent-card img-view-modal[slot="image-corner"]:hover {\n            background-color: transparent;\n          }\n          .card elmsln-studio-link {\n            --elmsln-studio-link-Color: var(--accent-card-color);\n            --elmsln-studio-link-TextDecoration: none !important;\n          }\n          .card elmsln-studio-link:not([disabled]):focus,\n          .card elmsln-studio-link:not([disabled]):focus-within,\n          .card elmsln-studio-link:not([disabled]):hover {\n            --elmsln-studio-link-TextDecoration: underline !important;\n          }\n          .card elmsln-studio-link[slot="subheading"] {\n            --elmsln-studio-link-FontWeight: bold;\n            --elmsln-studio-link-TextDecoration: underline !important;\n          }\n          .card elmsln-studio-link[slot="subheading"]:not([disabled]):focus,\n          .card\n            elmsln-studio-link[slot="subheading"]:not([disabled]):focus-within,\n          .card elmsln-studio-link[slot="subheading"]:not([disabled]):hover {\n            --elmsln-studio-link-TextDecoration: none !important;\n          }\n          button {\n            background-color: transparent;\n            border: none;\n            text-align: center;\n            display: block;\n            color: #4b4b4b;\n          }\n          button[disabled] {\n            cursor: not-allowed;\n          }\n          button:not([disabled]):focus,\n          button:not([disabled]):hover {\n            color: var(--simple-colors-default-theme-grey-11, #222);\n          }\n          button.load-more {\n            text-align: center;\n            display: block;\n            padding: 10px;\n            margin: 0;\n            border-radius: 3px;\n            border: none;\n            width: 100%;\n            color: var(--simple-colors-default-theme-grey-11, #222);\n            background-color: var(--simple-colors-default-theme-grey-2, #eee);\n          }\n          button.load-more:not([disabled]):focus,\n          button.load-more:not([disabled]):hover {\n            color: var(--simple-colors-default-theme-grey-12, #000);\n            background-color: var(--simple-colors-default-theme-grey-3, #ddd);\n          }\n          img-view-modal button {\n            padding: 0;\n            margin: 0;\n          }\n          img-view-modal simple-icon-lite {\n            color: white;\n            border-radius: 2px;\n            --simple-icon-width: 24px;\n            --simple-icon-height: 24px;\n            background-color: rgba(0, 0, 0, 0.5);\n          }\n          img-view-modal:not([disabled]) button:hover simple-icon-lite,\n          img-view-modal:not([disabled]) button:focus simple-icon-lite {\n            background-color: rgba(0, 0, 0, 0.25);\n          }\n\n          img-view-modal.thumbnail {\n            border-radius: 3px;\n          }\n          img-view-modal.thumbnail button {\n            border-radius: 3px;\n            position: relative;\n            width: 150px;\n            padding: 0;\n            margin: 0;\n          }\n          img-view-modal.thumbnail button .imgbg {\n            border-radius: 3px;\n            width: 100%;\n            padding-top: 100%;\n            background-image: var(\n              --elmsln-studio-image-button-backgroundImage,\n              none\n            );\n            background-position: center;\n            background-size: cover;\n            margin: 0;\n          }\n          img-view-modal.thumbnail button simple-icon-lite {\n            position: absolute;\n            bottom: 5px;\n            right: 5px;\n          }\n          .thumbnail-grid {\n            display: flex;\n            flex-wrap: wrap;\n          }\n          .thumbnail-grid > * {\n            flex: 0 0 50%;\n            margin: calc(0.5 * var(--elmsln-studio-margin, 20px));\n          }\n          .rubric-table {\n            border-collapse: collapse;\n            margin: 0 0 calc(1 * var(--elmsln-studio-margin, 20px));\n          }\n          .rubric-table th,\n          .rubric-table td {\n            padding: 5px;\n            border: 1px solid #eaeaea;\n          }\n          .rubric-table th {\n            font-weight: normal;\n          }\n          .rubric-table caption {\n            font-size: calc(1.25 * var(--elmsln-studio-FontSize, 16px));\n            font-weight: normal;\n            color: #555555;\n          }\n          .rubric-table thead th {\n            border-bottom: 1px solid #95989a;\n          }\n          .rubric-table thead th:first-child,\n          .rubric-table tbody th {\n            border-right: 1px solid #95989a;\n          }\n          .rubric-table tbody tr:nth-child(2n + 1) > * {\n            background-color: #f8f8f8;\n          }\n          #prev-next-nav {\n            align-items: center;\n            position: sticky;\n            bottom: 0;\n            margin: 0;\n            background-color: #ffffff;\n            -webkit-box-shadow: 0px -1px 5px 0px #b0b0b0;\n            box-shadow: 0px -1px 5px 0px #b0b0b0;\n          }\n          #prev-next-nav {\n            flex: 1 0 100%;\n            display: flex;\n            align-items: stretch;\n            justify-content: space-between;\n          }\n          #prev-next-nav elmsln-studio-link {\n            border: 1px solid #ddd;\n            flex: 1 1 50%;\n            padding: calc(0.5 * var(--elmsln-studio-margin, 20px));\n          }\n          #prev-next-nav elmsln-studio-link:not([disabled]):focus-within,\n          #prev-next-nav elmsln-studio-link:not([disabled]):hover {\n            border: 1px solid #000;\n          }\n          .prev-next-label span {\n            display: block;\n            font-weight: normal;\n            text-align: center;\n          }\n          .prev-next-label span:first-child {\n            flex: 1 0 auto;\n            font-size: calc(1.25 * var(--elmsln-studio-FontSize, 16px));\n            color: #4b4b4b;\n          }\n          .prev-next-label span:last-child {\n            flex: 1 1 auto;\n            font-size: calc(0.75 * var(--elmsln-studio-FontSize, 16px));\n            color: #222;\n          }\n          @media screen and (min-width: 600px) {\n            #studio-nav elmsln-studio-link {\n              padding: calc(0.25 * var(--elmsln-studio-margin, 20px))\n                calc(0.5 * var(--elmsln-studio-margin, 20px));\n              font-size: calc(1.5 * var(--elmsln-studio-FontSize, 16px));\n            }\n            .thumbnail-grid > * {\n              flex: 0 0 150px;\n            }\n          }\n          @media screen and (min-width: 900px) {\n            #studio-nav elmsln-studio-link {\n              padding: calc(0.25 * var(--elmsln-studio-margin, 20px))\n                calc(1 * var(--elmsln-studio-margin, 20px));\n            }\n            #primary {\n              flex: 0 0 calc(66.66666667% - var(--elmsln-studio-margin, 20px));\n            }\n            #secondary {\n              flex: 0 0 calc(33.33333333% - var(--elmsln-studio-margin, 20px));\n            }\n            .filters {\n              display: flex;\n              justify-content: space-between;\n              flex-wrap: nowrap;\n              height: calc(2 * var(--elmsln-studio-FontSize, 16px));\n            }\n          }\n        '])))]}}]),i}(n)},C=function(n){b(i,n);var e=x(i);function i(){var n;return p(this,i),(n=e.call(this)).href="",n.addEventListener("click",n.linkClick),n}return f(i,[{key:"disconnectedCallback",value:function(){w(v(i.prototype),"disconnectedCallback",this)&&w(v(i.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("click",this.linkClick)}},{key:"render",value:function(){return t.html(z||(z=j(['\n      <a href="','" @click="','">\n        <slot name="before"></slot>\n        ',"\n        <slot></slot>\n      </a>\n    "])),this.href,this.linkClick,this.icon?t.html(_||(_=j(['\n              <simple-icon-lite\n                aria-hidden="true"\n                icon="','"\n              ></simple-icon-lite>\n            '])),this.icon):"")}},{key:"linkClick",value:function(n){n.preventDefault(),n.stopPropagation(),this.disabled||this.navigate(this.href)}}],[{key:"tag",get:function(){return"elmsln-studio-link"}},{key:"properties",get:function(){return{disabled:{type:Boolean,reflect:!0},href:{type:String},icon:{type:String,reflect:!0}}}},{key:"styles",get:function(){return t.css(D||(D=j(["\n      :host {\n        display: block;\n      }\n      :host([hidden]) {\n        display: none;\n      }\n      :host([disabled]) {\n        opacity: 0.5;\n        cursor: not-allowed;\n      }\n      :host([icon]) a {\n        display: flex;\n        align-items: center;\n        justify-content: space-between;\n      }\n      :host([icon]) ::slotted(*) {\n        flex: 1 0 auto;\n      }\n      :host([icon]) simple-icon-lite {\n        flex: 0 0 auto;\n      }\n      a,\n      a:link {\n        transition: var(--elmsln-studio-link-Transition);\n        background: transparent;\n        color: var(--elmsln-studio-link-Color);\n        text-decoration: var(--elmsln-studio-link-TextDecoration);\n        text-decoration-style: var(--elmsln-studio-link-TextDecorationStyle);\n        text-decoration-skip: var(--elmsln-studio-link-TextDecorationSkip);\n        text-decoration-skip-ink: var(\n          --elmsln-studio-link-TextDecorationSkipInk\n        );\n        text-decoration-line: var(--elmsln-studio-link-TextDecorationLine);\n        text-decoration-color: var(--elmsln-studio-link-TextDecorationColor);\n        text-decoration: var(--elmsln-studio-link-TextDecoration);\n        text-decoration-thickness: var(\n          --elmsln-studio-link-TextDecorationThickness\n        );\n      }\n      a:hover,\n      a:focus {\n        background: transparent;\n        color: var(\n          --elmsln-studio-link-focus-Color,\n          var(--elmsln-studio-link-Color)\n        );\n        text-decoration: var(\n          --elmsln-studio-link-focus-TextDecoration,\n          var(--elmsln-studio-link-TextDecoration)\n        );\n        text-decoration-style: var(\n          --elmsln-studio-link-focus-TextDecorationStyle,\n          var(--elmsln-studio-link-TextDecorationStyle)\n        );\n        text-decoration-skip: var(\n          --elmsln-studio-link-focus-TextDecorationSkip,\n          var(--elmsln-studio-link-TextDecorationSkip)\n        );\n        text-decoration-skip-ink: var(\n          --elmsln-studio-link-focus-TextDecorationSkipInk,\n          var(--elmsln-studio-link-TextDecorationSkipInk)\n        );\n        text-decoration-line: var(\n          --elmsln-studio-link-focus-TextDecorationLine,\n          var(--elmsln-studio-link-TextDecorationLine)\n        );\n        text-decoration-color: var(\n          --elmsln-studio-link-focus-TextDecorationColor,\n          ar(--elmsln-studio-link-TextDecorationColor)\n        );\n        text-decoration: var(\n          --elmsln-studio-link-focus-TextDecoration,\n          var(--elmsln-studio-link-TextDecoration)\n        );\n        text-decoration-thickness: var(\n          --elmsln-studio-link-focus-TextDecorationThickness,\n          var(--elmsln-studio-link-TextDecorationThickness)\n        );\n      }\n    "])))}}]),i}(d.navigator(t.LitElement));customElements.define("elmsln-studio-link",C);var I,E,P,U,q,R,M,B,W,V,G,H,$,Y,X,J=function(n){b(i,n);var e=x(i);function i(){var n;return p(this,i),(n=e.call(this)).path="",n.icon="",n}return f(i,[{key:"render",value:function(){return t.html(O||(O=j(['\n      <button @click="','">\n        <slot name="before"></slot>\n        ',"\n        <slot></slot>\n      </button>\n    "])),this.buttonClick,this.icon?t.html(A||(A=j(['\n              <simple-icon-lite\n                aria-hidden="true"\n                icon="','"\n              ></simple-icon-lite>\n            '])),this.icon):"")}},{key:"buttonClick",value:function(n){this.disabled||this.navigate(this.path)}}],[{key:"tag",get:function(){return"elmsln-studio-button"}},{key:"properties",get:function(){return{path:{type:String},icon:{type:String}}}},{key:"styles",get:function(){return t.css(N||(N=j(["\n      :host {\n        display: block;\n      }\n      :host([hidden]) {\n        display: none;\n      }\n      button {\n        border: none;\n        background-color: transparent;\n        display: flex;\n        align-items: center;\n        height: 26px;\n        color: var(--elmsln-studio-button-icon-color);\n      }\n      button:focus,\n      button:hover {\n        outline: none;\n      }\n    "])))}}]),i}(d.navigator(t.LitElement));customElements.define("elmsln-studio-button",J);var K,Q,Z,nn,tn,en,sn,on,an,ln=function(n){return function(n){b(i,n);var e=x(i);function i(){var n;return p(this,i),(n=e.call(this)).demoMode=!1,n}return f(i,[{key:"defaultModalToolbars",get:function(){return{bottom:{id:"bottom",type:"toolbar-group",contents:["prevbutton","homebutton","rotategroup","zoomgroup","pageXofY","pangroup","fullscreenbutton","nextbutton"]}}}},{key:"sortDates",value:function(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n.sort((function(n,e){var i="string"==typeof n.date?Date.parse(n.date):n.date,s="string"==typeof e.date?Date.parse(e.date):e.date;return t?i-s:s-i}))}},{key:"addDays",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Date(Date.parse(n)+864e5*t)}},{key:"addWeeks",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Date(Date.parse(n)+6048e5*t)}},{key:"toArray",value:function(n,t){return Object.keys(n||{}).map((function(e){var i=n[e];return i.id=e,Object.keys(t||{}).forEach((function(n){return i[n]=t[n]})),i}))}},{key:"isEarly",value:function(n,t){return new Date(n)>(new Date(t)||new Date)}},{key:"onTime",value:function(n,t){return new Date(n)===(new Date(t)||new Date)}},{key:"isLate",value:function(n,t){return new Date(n)<(t?new Date(t):new Date)}},{key:"getStatus",value:function(n,t,e,i,s,o){var a=!!n&&!!n.date&&!!t.date&&n.date>t.date;return!n&&!!t.date&&this.isLate(t.date)?e:a?i:n?s:o}},{key:"getStatusIcon",value:function(n,t){return this.getStatus(n,t,"report-problem","assignment-late","assignment-turned-in","assignment")}},{key:"getStatusColor",value:function(n,t){return this.getStatus(n,t,"red","amber","green","grey")}},{key:"getStatusMessage",value:function(n,t){return this.getStatus(n,t,"Overdue","Submitted Late","Submitted","Not Submitted")}},{key:"_recentArray",value:function(n){return this.sortDates(this.toArray(n))}},{key:"getAncestor",value:function(n,t){if(n&&t&&t.length>0){t[0][1];var e=t[0][0],i=n["".concat(t[0][1])];return this.getAncestor(e[i],t.slice(1))}return n}},{key:"getFigures",value:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"src",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"alt",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"full",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"longdesc",a=(n||[]).map((function(n){return{src:n[s]||n[e],info:n[i]&&n[o]?t.html(I||(I=j(["\n                  <p>",":</p>\n                  <div>","</div>\n                "])),n[i],n[o]):n[i]?t.html(E||(E=j([" "," "])),n[i]):t.html(P||(P=j([" "," "])),n[o])}}));return a.filter((function(n){return!!n.src}))}},{key:"getThumnailGrid",value:function(n){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.html(U||(U=j(['\n        <div class="thumbnail-grid">\n          ',"\n        </div>\n      "])),(n.sources||[]).map((function(s,o){return t.html(q||(q=j(['\n              <img-view-modal\n                class="thumbnail"\n                ?disabled="','"\n                page="','"\n                title="'," by "," ",'"\n                .toolbars="','"\n                .figures="','"\n              >\n                <button\n                  ?disabled="','"\n                  id="view-thumb-','"\n                  .style="','"\n                >\n                  <span class="sr-only">','</span>\n                  <div class="zoombg"></div>\n                  <simple-icon-lite\n                    icon="zoom-in"\n                    class="zoomicon"\n                  ></simple-icon-lite>\n                  <div class="imgbg"></div>\n                </button>\n                <simple-tooltip for="view-thumb-','"\n                  >View Thumbnail</simple-tooltip\n                >\n              </img-view-modal>\n            '])),i,o,n.assignment,n.firstName,n.lastName,e.defaultModalToolbars,e.getFigures(n.sources),i,n.id,e.getThumbailStyle(s.src),s.alt,n.id)})))}},{key:"getThumbailStyle",value:function(n){return"--elmsln-studio-image-button-backgroundImage: url(".concat(n,");")}},{key:"fullName",value:function(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n&&!t?"".concat(n.firstName," ").concat(n.lastName):n?"".concat(n.lastName,", ").concat(n.firstName):""}},{key:"dateFormat",value:function(n,t){return"string"==typeof n&&(n=new Date(n)),n?"long"===t?n.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):"short"===t?n.toLocaleDateString(void 0,{month:"long",day:"numeric"}):n.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):""}},{key:"accentColor",value:function(n){var t=document.createElement("accent-card"),e=t&&t.colors?Object.keys(t.colors):[""],i=n&&n.charCodeAt(0)?n.charCodeAt(0):Math.floor(16*Math.random());return e[i%16+1]?e[i%16+1]:e[Math.floor(Math.random()*e.length)]}},{key:"getActivityLink",value:function(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return"submission"===n.activity?"project/".concat(n.portfolioId||n.id).concat(n.portfolioId?"?submission=".concat(n.id):"").concat(t?"":n.portfolioId?"&comment=true&sort-latest=".concat(e):"?comment=true&sort-latest=".concat(e)):"discussion"===n.activity?"project/".concat(n.projectId||n.submissionId).concat(n.portfolioId?"?submission=".concat(n.submissionId,"&"):"?","comment=").concat(n.id):"project/".concat(n.projectId||n.submissionId).concat(n.portfolioId?"?submission=".concat(n.submissionId,"&"):"?","comment=").concat(n.feedbackId)}},{key:"getActivityTitle",value:function(n){return t.html(R||(R=j(["\n        ","\n      "])),"submission"===n.activity?"".concat([n.firstName,n.lastName].join(" ")," submitted ").concat(n.assignment):"discussion"===n.activity?"".concat([n.firstName,n.lastName].join(" "),"'s feedback on ").concat([n.creatorFirstName,n.creatorLastName].join(" "),"'s ").concat(n.assignment):"".concat([n.firstName,n.lastName].join(" ")," replied to ").concat([n.reviewerFirstName,n.reviewerLastName].join(" ")))}},{key:"activityLink",value:function(n,t){return"submission"===t?this.submissionLink(n):"feedback"===n.activity?this.feedbackLink(n):this.replyLink(n)}},{key:"activityTitle",value:function(n,t){return"submission"===t?this.submissionTitle(n):"feedback"===n.activity?this.feedbackTitle(n):this.replyTitle(n)}},{key:"submissionLink",value:function(n){return"project/".concat(n.userId,"-").concat(n.projectId,"?submission=").concat(n.id)}},{key:"submissionTitle",value:function(n){return"".concat(n.firstName," submitted ").concat(n.assignment)}},{key:"feedbackLink",value:function(n){return"project/".concat(n.creator,"-").concat(n.projectId,"?submission=").concat(n.submissionId,"&comment=").concat(n.id)}},{key:"feedbackTitle",value:function(n){return"".concat(n.firstName," left feedback on ").concat(n.creatorFirstName,"'s\n        ").concat(n.assignment)}},{key:"replyLink",value:function(n){return"portfolios/".concat(n.creator,"-").concat(n.projectId,"?submission=").concat(n.submissionId,"&comment=").concat(n.id)}},{key:"replyTitle",value:function(n){return"".concat(n.firstName," replied to ").concat(n.feedbackFirstName,"'s feedback")}},{key:"getFeedbackIcon",value:function(n){return 0===n?"communication:comment":n<10?"hax:messages-".concat(n):"hax:messages-9-plus"}},{key:"rubricTable",value:function(n){return n?t.html(M||(M=j(['\n            <table class="rubric-table">\n              <caption>\n                Rubric\n              </caption>\n              ',"\n              <tbody>\n                ","\n              </tbody>\n            </table>\n          "])),n.key&&n.key?t.html(B||(B=j(['\n                    <thead>\n                      <th scope="col">Criteria</th>\n                      ',"\n                    </thead>\n                  "])),n.key.map((function(n){return t.html(W||(W=j(['<th scope="col">\n                          ',"\n                        </th>"])),n.description&&(n.points||n.points>-1)?"".concat(n.description," (").concat(n.points,")"):n.description||n.points)}))):"",Object.keys(n.values||{}).map((function(e){return t.html(V||(V=j(['\n                      <tr>\n                        <th scope="row">',"</th>\n                        ","\n                      </tr>\n                    "])),e,(n.values[e]||[]).map((function(n){return t.html(G||(G=j(["<td>","</td>"])),n)})))}))):""}},{key:"_getValign",value:function(n){return n&&n.indexOf("top")>-1?"top":n&&n.indexOf("bottom")>-1?"bottom":"center"}},{key:"_getAlign",value:function(n){return n&&n.indexOf("left")>-1?"left":n&&n.indexOf("right")>-1?"right":"center"}},{key:"message404",value:function(n,e,i){return t.html(H||(H=j([' <div id="primary" class="primary-404">\n        <p id="message-404">\n          ',' with this URL does not exist. Return to\n          <elmsln-studio-link href="','">\n            ',"</elmsln-studio-link\n          >\n          to search for assignment.\n        </p>\n      </div>"])),n,i,e)}},{key:"prevNextNav",value:function(n,e,i,s){return t.html($||($=j(['\n        <div id="prev-next-nav">\n          <elmsln-studio-link\n            href="','"\n            ?disabled="','"\n            icon="chevron-left"\n          >\n            <span class="prev-next-label">\n              <span>Previous</span>\n              <span>','</span>\n            </span>\n          </elmsln-studio-link>\n          <elmsln-studio-link\n            href="','"\n            ?disabled="','"\n            icon="chevron-right"\n          >\n            <span slot="before" class="prev-next-label">\n              <span>Next</span>\n              <span>',"</span>\n            </span>\n          </elmsln-studio-link>\n        </div>\n      "])),e,!e,n,s,!s,i)}},{key:"loading",value:function(n,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"small";return e?t.html(X||(X=j(['<hexagon-loader\n            loading\n            item-count="3"\n            size="','"\n            color="','"\n            slot="','"\n          >\n          </hexagon-loader>'])),i,n,e):t.html(Y||(Y=j(['<hexagon-loader\n            loading\n            item-count="3"\n            size="','"\n            color="','"\n          >\n          </hexagon-loader>'])),i,n)}},{key:"submitData",value:function(n,t){console.log("submitData",n,t),this.dispatchEvent(new CustomEvent("submit-data",{bubbles:!0,cancelable:!0,composed:!0,detail:{type:n,data:t}}))}},{key:"fetchData",value:function(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.dispatchEvent(new CustomEvent("fetch-data",{bubbles:!0,cancelable:!0,composed:!0,detail:{type:n,refresh:t}}))}},{key:"_handleLinkButton",value:function(n,t){location.href=t,this.dispatchEvent(new CustomEvent("link-button-click",{bubbles:!0,cancelable:!0,composed:!0,detail:t}))}}],[{key:"properties",get:function(){return m(m({},w(v(i),"properties",this)),{},{demoMode:{type:Boolean,attribute:"demo-mode",reflect:!0}})}}]),i}(n)},rn=function(n){b(i,n);var e=x(i);function i(){var n;return p(this,i),(n=e.call(this)).horizontal=!1,n}return f(i,[{key:"render",value:function(){return t.html(K||(K=j(['\n      <accent-card\n        image-src="','"\n        .image-alt="','"\n        ?horizontal="','"\n        .image-align="','"\n        .image-valign="','"\n        .gravity="','"\n        no-border\n      >\n        <slot name="student" slot="heading"></slot>\n        <slot name="datetime" slot="corner"></slot>\n        <slot name="assigmment" slot="subheading"></slot>\n        <slot name="project" slot="content"></slot>\n        <slot name="feature" slot="content"></slot>\n        <slot name="feedback" slot="footer"></slot>\n      </accent-card>\n    '])),this.imageSrc||"",this.imageAlt||void 0,this.horizontal,this.imageAlign,this.imageValign,this.imageGravity)}}],[{key:"tag",get:function(){return"elmsln-studio-submission-card"}},{key:"styles",get:function(){return[t.css(Q||(Q=j(['\n        :host,\n        accent-card {\n          line-height: 160%;\n          display: flex;\n          flex-direction: column;\n          align-items: stretch;\n          justify-content: stretch;\n        }\n        accent-card {\n          width: auto;\n          flex: 1 1 auto;\n          --accent-card-padding: 0;\n          --accent-card-heading-min-height: 30px;\n          --accent-card-heading-padding-top: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-heading-padding-left: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-heading-padding-right: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-subheading-padding-left: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-subheading-padding-right: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-content-padding-left: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-content-padding-right: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-content-padding-bottom: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-footer-padding-left: calc(\n            0.25 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-footer-padding-right: calc(\n            0.25 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-footer-padding-top: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-footer-padding-bottom: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-image-padding-bottom: 5px;\n          --accent-card-image-padding-right: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-image-width: 33.33333%;\n          --accent-card-image-height: 200px;\n        }\n        accent-card:focus-within,\n        accent-card:hover {\n          outline: 2px solid var(--accent-card-border-color);\n        }\n        [slot="feature"] {\n          margin-top: var(--elmsln-studio-margin, 20px);\n          height: calc(\n            var(--accent-card-image-height, 200px) -\n              var(--elmsln-studio-margin, 20px)\n          );\n          overflow: auto;\n        }\n        [slot="heading"] {\n          font-weight: var(--elmsln-studio-FontWeightLight, 300);\n          font-size: 22px;\n        }\n        [slot="corner"] {\n          font-weight: var(--elmsln-studio-FontWeightNormal, 400);\n          font-size: 12px;\n        }\n        [slot="subheading"] {\n          font-weight: var(--elmsln-studio-FontWeightBold, 500);\n          font-size: 18px;\n          font-style: normal;\n          color: #5d5e5f;\n        }\n        [slot="content"] {\n          font-weight: var(--elmsln-studio-FontWeightNormal, 400);\n          font-size: 14px;\n          color: #7e7e7e;\n        }\n        [slot="footer"] {\n          font-weight: var(--elmsln-studio-FontWeightNormal, 400);\n          font-size: 12px;\n          text-transform: uppercase;\n          text-align: right;\n          color: #95989a;\n        }\n        [slot="footer"] elmsln-studio-link {\n          margin: 0 calc(0.5 * var(--elmsln-studio-margin, 20px));\n          text-align: right;\n          --elmsln-studio-link-Color: #7e7e7e;\n        }\n        [slot="footer"] elmsln-studio-link:focus,\n        [slot="footer"] elmsln-studio-link:focus-within,\n        [slot="footer"] elmsln-studio-link:hover {\n          --elmsln-studio-link-Color: #95989a;\n          --elmsln-studio-link-TextDecoration: none !important;\n        }\n      '])))]}},{key:"properties",get:function(){return{imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},imageAlign:{type:String,attribute:"image-align"},imageValign:{type:String,attribute:"image-valign"},horizontal:{type:Boolean,attribute:"horizontal"}}}}]),i}(t.LitElement);customElements.define("elmsln-studio-submission-card",rn);var cn,dn,un,mn,pn,hn,fn,gn,bn,vn,yn,kn,xn,wn,jn,Sn,Fn,Ln,zn,_n,Dn,On,An,Nn,Tn=function(n){b(i,n);var e=x(i);function i(){var n;return p(this,i),(n=e.call(this)).list=!1,n.commentLoad=15,n}return f(i,[{key:"render",value:function(){var n=this;return t.html(Z||(Z=j(['\n      <h1 class="sr-only">Submissions</h1>\n      <div class="filters">\n        <simple-fields-field\n          inline\n          label="Project:"\n          .options="','"\n          value="','"\n          @value-changed="','"\n        >\n        </simple-fields-field>\n        <simple-fields-field\n          inline\n          label="Assignment:"\n          .options="','"\n          value="','"\n          @value-changed="','"\n        >\n        </simple-fields-field>\n        <simple-fields-field\n          inline\n          label="Student:"\n          .options="','"\n          value="','"\n          @value-changed="','"\n        >\n        </simple-fields-field>\n        <div id="layout">\n          <button\n            aria-pressed="','"\n            @click="','"\n          >\n            <simple-icon-lite icon="icons:view-list"></simple-icon-lite>\n            <span class="sr-only">display as list</span>\n          </button>\n          <button\n            aria-pressed="','"\n            @click="','"\n          >\n            <simple-icon-lite icon="icons:view-module"></simple-icon-lite>\n            <span class="sr-only">display as grid</span>\n          </button>\n        </div>\n      </div>\n      <div id="primary">\n        ','\n      </div>\n      <div id="secondary">\n        <nav-card flat no-border class="card">\n          <span slot="heading">\n            ',"\n          </span>\n          ","\n        </nav-card>\n      </div>\n    "])),this.projectOptions,this.projectFilter||"",(function(t){return n.projectFilter=t.detail.value}),this.assignmentOptions,this.assignmentFilter||"",(function(t){return n.assignmentFilter=t.detail.value}),this.studentOptions,this.studentFilter||"",(function(t){return n.studentFilter=t.detail.value}),this.list?"true":"false",(function(t){return n.list=!0}),this.list?"false":"true",(function(t){return n.list=!1}),this.submissions?t.html(nn||(nn=j(['\n              <div id="cards" class="','">\n                <div\n                  class="no-submissions"\n                  ?hidden="','"\n                >\n                  No submissions for applied filters.\n                </div>\n                ',"\n              </div>\n            "])),this.list?"list":"grid",this.filteredSubmissions.length>0,this.filteredSubmissions.map((function(e,i){return t.html(tn||(tn=j(['\n                    <accent-card-clickable\n                      id="accent-','"\n                      href="','"\n                      class="card submission-card"\n                      image-src="','"\n                      .image-alt="','"\n                      ?horizontal="','"\n                      .image-align="','"\n                      .image-valign="','"\n                      .gravity="','"\n                      no-border\n                    >\n                      <elmsln-studio-link\n                        data-clickable\n                        href="','"\n                        id="assignment-','"\n                        slot="heading"\n                      >\n                        ','\n                      </elmsln-studio-link>\n                      <elmsln-studio-link\n                        id="student-','"\n                        href="submissions','"\n                        slot="subheading"\n                      >\n                        ','\n                      </elmsln-studio-link>\n                      <local-time\n                        slot="corner"\n                        id="date-','"\n                        datetime="','"\n                        month="long"\n                        day="numeric"\n                        year="','"\n                      >\n                        ','\n                      </local-time>\n                      <div slot="content" id="project-','">\n                        ',"\n                        ",'\n                      </div>\n                      <elmsln-studio-link\n                        slot="footer"\n                        href="','"\n                      >\n                        Feedback\n                        <span class="sr-only">(',')</span>\n                        <simple-icon-lite\n                          icon="','"\n                        ></simple-icon-lite>\n                      </elmsln-studio-link>\n                    </accent-card-clickable>\n                  '])),i,n.getActivityLink(e,!0),n.getCoverImage(e),e.imageAlt||void 0,!(!e.feature&&!n.list),n._getAlign(e.imageGravity||void 0),n._getValign(e.imageGravity||void 0),e.imageGravity||void 0,n.getActivityLink(e,!0),e.id,e.assignment,e.id,e.userId?"?student=".concat(e.userId):"",[e.firstName,e.lastName].join(" "),e.id,e.date,n.list?"numeric":void 0,n.dateFormat(e.date,"short"),e.id,e.project,e.feature?t.html(en||(en=j(['<div class="feature">',"</div>"])),e.feature):"",n.getActivityLink(e),e.feedback.length,n.getFeedbackIcon(e.feedback.length))}))):this.loading("grey"),this.isFiltered?"Related Comments":"Recent Comments",this.comments?t.html(sn||(sn=j(['\n                <div slot="body" ?hidden="','">\n                  ','\n                </div>\n                <div slot="linklist">\n                  ','\n                </div>\n                <button\n                  class="load-more"\n                  slot="footer"\n                  ?disabled="','"\n                  ?hidden="','"\n                  @click="','"\n                >\n                  Load More '," /\n                  ","\n                </button>\n              "])),this.filteredComments.length>0,this.isFiltered?"No comments for applied filters.":"No comments.",(this.filteredComments||[]).slice(0,this.commentLoad).map((function(e){return t.html(on||(on=j(['\n                        <nav-card-item\n                          accent-color="','"\n                          .avatar="','"\n                          initials="','"\n                        >\n                          <elmsln-studio-link\n                            id="comment-','"\n                            aria-describedby="comment-','-desc"\n                            slot="label"\n                            href="','"\n                          >\n                            ','\n                          </elmsln-studio-link>\n\n                          <relative-time\n                            id="comment-','"\n                            slot="description"\n                            datetime="','"\n                          >\n                            ',"\n                          </relative-time>\n                        </nav-card-item>\n                      "])),n.accentColor(n.fullName(e)),e.avatar,n.fullName(e),e.id,e.id,n.getActivityLink(e),n.getActivityTitle(e),e.id,e.date,n.dateFormat(e.date,"long"))})),this.commentLoad>=this.filteredComments.length,this.commentLoad>=this.filteredComments.length,(function(t){return n.commentLoad+=10}),this.commentLoad,this.filteredComments.length):this.loading("grey","body"))}},{key:"firstUpdated",value:function(n){w(v(i.prototype),"firstUpdated",this)&&w(v(i.prototype),"firstUpdated",this).call(this,n),this.fetchData("submissions"),this.fetchData("discussion")}},{key:"updated",value:function(n){var t=this;w(v(i.prototype),"updated",this)&&w(v(i.prototype),"updated",this).call(this,n),n.forEach((function(n,e){["comments","assignmentFilter","studentFilter","projectFilter"].includes(e)&&(t.commentLoad=15)}))}},{key:"filteredComments",get:function(){var n=this;return(this.comments||[]).filter((function(t){return n._isFilteredStudent(t.creatorId)&&n._isFilteredAssignment(t.assignmentId)&&n._isFilteredProject(t.projectId)}))}},{key:"getCoverImage",value:function(n){var t=["ai","css","csv","doc","eps","html","js","pdf","ppt","rtf","url","xls"],e=["png","jpg","jpeg","gif","svg"],i=[].concat(S(n.sources||[]),S(n.links||[])),s=i.filter((function(n){return e.includes(n.type||"file")})),o=i.filter((function(n){return t.includes(n.type||"file")})),a=new URL("svgs/file.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("elmsln-studio.umd.js",document.baseURI).href).pathname;return s&&s[0]?a=s[0].src:o&&o[0]&&(a=new URL("svgs/".concat(o[0].type,".svg"),"undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("elmsln-studio.umd.js",document.baseURI).href).pathname),a}},{key:"isFiltered",get:function(){return""!==this.assignmentFilter||""!==this.studentFilter||""!==this.projectFilter}},{key:"studentOptions",get:function(){var n=this,t={"":"All"};return(this.submissions||[]).forEach((function(e){return t[e.userId]=n.fullName(e)})),t}},{key:"assignmentOptions",get:function(){var n=this,t={"":"All"};return(this.submissions||[]).filter((function(t){return n._isFilteredProject(t.projectId)})).forEach((function(n){return t[n.assignmentId]=n.assignment})),t}},{key:"projectOptions",get:function(){var n={"":"All"};return(this.submissions||[]).filter((function(n){return n.project})).forEach((function(t){return n[t.projectId]=t.project})),n}},{key:"filteredSubmissions",get:function(){var n=this;return(this.submissions||[]).filter((function(t){return n._isFilteredStudent(t.userId)&&n._isFilteredAssignment(t.assignmentId)&&n._isFilteredProject(t.projectId)}))}},{key:"modalTitle",get:function(){var n=[[this.projectOptions[this.projectFilter],this.assignmentOptions[this.assignmentFilter]].filter((function(n){return!!n&&"All"!==n})).join(":"),this.studentOptions[this.studentFilter]].filter((function(n){return!!n&&"All"!==n&&""!==n})).join(" by ");return n&&""!=n?n:"All Submissions"}},{key:"loadMoreComments",value:function(n){this.commentLoad+=10}},{key:"_isFilteredAssignment",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return""===this.assignmentFilter||n===this.assignmentFilter}},{key:"_isFilteredProject",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return""===this.projectFilter||n===this.projectFilter}},{key:"_isFilteredStudent",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return""===this.studentFilter||n===this.studentFilter}}],[{key:"tag",get:function(){return"elmsln-studio-submissions"}},{key:"styles",get:function(){return[].concat(S(w(v(i),"styles",this)),[t.css(an||(an=j(['\n        :host {\n          flex-wrap: wrap;\n        }\n        .filters {\n          flex: 1 0 100%;\n        }\n        #layout {\n          display: flex;\n          align-items: flex-end;\n          justify-content: space-between;\n        }\n        #layout > button {\n          background-color: transparent;\n          opacity: 0.25;\n          transform: opacity 0.5s ease-in-out;\n          height: calc(2 * var(--elmsln-studio-FontSize, 16px));\n          width: calc(2 * var(--elmsln-studio-FontSize, 16px));\n          flex: 1 0 auto;\n          border: 1px solid #ddd;\n          margin: 0;\n          padding: 0;\n        }\n        #layout button:focus,\n        #layout button:hover {\n          opacity: 0.75;\n        }\n        #layout button[aria-pressed="true"] {\n          opacity: 1;\n        }\n        #cards {\n          margin: var(--elmsln-studio-margin, 20px)\n            calc(-0.5 * var(--elmsln-studio-margin, 20px));\n          display: flex;\n          align-items: stretch;\n          justify-content: flex-start;\n          flex-wrap: wrap;\n        }\n        .no-submissions {\n          font-weight: var(--elmsln-studio-FontWeightLight, 300);\n          font-size: 22px;\n          margin: calc(0.5 * var(--elmsln-studio-margin, 20px));\n          padding: var(--elmsln-studio-margin, 20px);\n          width: calc(100% - 2 * var(--elmsln-studio-margin, 20px));\n          background-color: #e8e8e8;\n          text-align: center;\n        }\n        accent-card-clickable {\n          line-height: 160%;\n          display: flex;\n          flex-direction: column;\n          align-items: stretch;\n          justify-content: stretch;\n          width: auto;\n          cursor: pointer;\n          margin: calc(0.5 * var(--elmsln-studio-margin, 20px))\n            calc(0.5 * var(--elmsln-studio-margin, 20px));\n          flex: 1 1 calc(100% - var(--elmsln-studio-margin, 20px));\n          --accent-card-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.28),\n            0 1px 5px 0 rgba(0, 0, 0, 0.24), 0 3px 1px -2px rgba(0, 0, 0, 0.4);\n          --accent-card-padding: 0;\n          --accent-card-image-width: 33.33333%;\n          --accent-card-image-height: 200px;\n          --accent-card-heading-min-height: 30px;\n          --accent-card-heading-padding-top: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-heading-padding-left: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-heading-padding-right: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-subheading-padding-left: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-subheading-padding-right: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-content-padding-left: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-content-padding-right: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-content-padding-bottom: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-footer-padding-left: calc(\n            0.25 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-footer-padding-right: calc(\n            0.25 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-footer-padding-top: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-footer-padding-bottom: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n          --accent-card-image-padding-bottom: 5px;\n          --accent-card-image-padding-right: calc(\n            0.5 * var(--elmsln-studio-margin, 20px)\n          );\n        }\n        accent-card-clickable:hover {\n          --accent-card-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.14),\n            0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1.5px 1px -1px rgba(0, 0, 0, 0.2);\n        }\n        accent-card-clickable [slot="heading"] {\n          font-weight: var(--elmsln-studio-FontWeightLight, 300);\n          font-size: 22px;\n        }\n        accent-card-clickable [slot="corner"] {\n          font-weight: var(--elmsln-studio-FontWeightNormal, 400);\n          font-size: 12px;\n        }\n        accent-card-clickable [slot="subheading"] {\n          font-weight: var(--elmsln-studio-FontWeightBold, 500);\n          font-size: 18px;\n          font-style: normal;\n          color: #5d5e5f;\n        }\n        accent-card-clickable [slot="content"] {\n          font-weight: var(--elmsln-studio-FontWeightNormal, 400);\n          font-size: 14px;\n          color: #7e7e7e;\n        }\n        accent-card-clickable [slot="content"] .feature {\n          margin-top: var(--elmsln-studio-margin, 20px);\n          height: calc(\n            var(--accent-card-image-height, 200px) -\n              var(--elmsln-studio-margin, 20px)\n          );\n          overflow: auto;\n        }\n        accent-card-clickable [slot="footer"] {\n          font-weight: var(--elmsln-studio-FontWeightNormal, 400);\n          font-size: 12px;\n          text-transform: uppercase;\n          text-align: right;\n          color: #95989a;\n          --elmsln-studio-link-Color: currentColor;\n        }\n        accent-card-clickable [slot="footer"] elmsln-studio-link {\n          margin: 0 calc(0.5 * var(--elmsln-studio-margin, 20px));\n          text-align: right;\n        }\n        accent-card-clickable elmsln-studio-link {\n          --elmsln-studio-link-TextDecoration: none !important;\n        }\n        accent-card-clickable elmsln-studio-link:focus,\n        accent-card-clickable elmsln-studio-link:hover,\n        accent-card-clickable elmsln-studio-link:focus-within {\n          --elmsln-studio-link-TextDecoration: underline !important;\n        }\n        .feature {\n          margin-top: var(--elmsln-studio-margin, 20px);\n          height: calc(\n            var(--accent-card-image-height, 200px) -\n              var(--elmsln-studio-margin, 20px)\n          );\n          overflow: auto;\n        }\n        #secondary {\n          margin-top: 0;\n          --nav-card-linklist-margin-top: 0;\n          --nav-card-linklist-left-size: 36px;\n          --paper-avatar-width: var(--nav-card-linklist-left-size, 36px);\n        }\n        #secondary .filters {\n          justify-content: flex-start;\n        }\n        .comments {\n          color: #95989a;\n        }\n        nav-card {\n          margin: calc(1.5 * var(--elmsln-studio-margin, 20px)) 0 0;\n          --accent-card-footer-padding-left: 0;\n          --accent-card-footer-padding-right: 0;\n        }\n\n        @media screen and (min-width: 500px) {\n          accent-card-clickable {\n            --accent-card-image-width: 50%;\n          }\n          .grid accent-card-clickable:not([horizontal]) {\n            flex: 0 0 calc(50% - var(--elmsln-studio-margin, 20px));\n          }\n        }\n        @media screen and (min-width: 900px) {\n          :host {\n            display: flex;\n            align-items: flex-start;\n            justify-content: space-between;\n          }\n          .grid accent-card-clickable:not([horizontal]) {\n            flex: 0 0 calc(50% - var(--elmsln-studio-margin, 20px));\n          }\n          .filters > *,\n          #layout > * {\n            flex: 0 1 auto;\n            margin: 0 calc(0.5 * var(--elmsln-studio-margin, 20px));\n          }\n          #layout > button {\n            padding: 1px 6px;\n            margin: 0 5px;\n            border: 0px solid rgba(0, 0, 0, 0);\n          }\n        }\n        @media screen and (min-width: 1200px) {\n          .grid accent-card-clickable[horizontal] {\n            flex: 0 0 calc(66.66666667% - var(--elmsln-studio-margin, 20px));\n          }\n          .grid accent-card-clickable:not([horizontal]) {\n            flex: 0 0 calc(33.3333333333% - var(--elmsln-studio-margin, 20px));\n          }\n        }\n        @media screen and (min-width: 1600px) {\n          accent-card-clickable[horizontal] {\n            --accent-card-image-width: 33.33333%;\n            flex: 0 0 calc(75% - var(--elmsln-studio-margin, 20px));\n          }\n          accent-card-clickable:not([horizontal]) {\n            flex: 0 0 calc(25% - var(--elmsln-studio-margin, 20px));\n          }\n          accent-card-clickable {\n            --accent-card-image-width: 50%;\n          }\n        }\n      '])))])}},{key:"properties",get:function(){return m(m({},w(v(i),"properties",this)),{},{assignmentFilter:{type:String,attribute:"assignment-filter"},comments:{type:Array},commentLoad:{type:Number,attribute:"comment-load"},list:{type:Boolean,attribute:"list"},projectFilter:{type:String,attribute:"project-filter"},studentFilter:{type:String,attribute:"student-filter"},submissions:{type:Array}})}}]),i}(ln(T(t.LitElement)));customElements.define("elmsln-studio-submissions",Tn);var Cn,In,En,Pn,Un,qn,Rn=function(n){b(i,n);var e=x(i);function i(){var n;return p(this,i),(n=e.call(this)).__sources=[],n.__links=[],n.__editorConfig=[{label:"Basic Inline Operations",type:"button-group",buttons:[{command:"bold",icon:"editor:format-bold",label:"Bold",toggles:!0,type:"rich-text-editor-button"},{command:"italic",icon:"editor:format-italic",label:"Italics",toggles:!0,type:"rich-text-editor-button"},{command:"removeFormat",icon:"editor:format-clear",label:"Erase Format",type:"rich-text-editor-button"}]},{label:"Links",type:"button-group",buttons:[{type:"rich-text-editor-link"}]},{label:"Lists and Indents",type:"button-group",buttons:[{command:"insertOrderedList",icon:"editor:format-list-numbered",label:"Ordered List",toggles:!0,type:"rich-text-editor-button"},{command:"insertUnorderedList",icon:"editor:format-list-bulleted",label:"Unordered List",toggles:!0,type:"rich-text-editor-button"}]}],n}return f(i,[{key:"render",value:function(){return this.assignments&&!this.assignment?this.message404("Assignment","Assignments","/assignments"):t.html(cn||(cn=j(["\n          "," ",'\n          <div\n            id="primary"\n            class="view-assignment ','"\n          >\n            <article id="assignment">\n              <h1>\n                <span class="lesson-name">\n                  ','\n                </span>\n                <span class="assignment-name">\n                  ',"\n                </span>\n              </h1>\n              ",'\n              <p class="assignment-body">\n                ',"\n              </p>\n              ","\n              "," "," "," ","\n            </article>\n          </div>\n          ","\n        "])),this.breadcrumb,this.alert,this.assignmentStatus.toLowerCase().replace(/\s/,"-"),this.assignment?this.assignment.lesson:t.html(dn||(dn=j(["<em>Lesson</em>"]))),this.assignment?this.assignment.assignment:t.html(un||(un=j(["<em>Assignment</em>"]))),(this.assignment||{}).date?t.html(mn||(mn=j(['\n                    <p class="assignment-date">\n                      Due\n                      <local-time\n                        month="long"\n                        day="numeric"\n                        year="numeric"\n                        hour="2-digit"\n                        minute="2-digit"\n                        second="2-digit"\n                        time-zone-name="short"\n                        datetime="','"\n                        >',"\n                      </local-time>\n                    </p>\n                  "])),this.assignment.date,this.dateFormat(this.assignment.date)):"",this.assignment?this.assignment.body:this.loading("grey"),(this.assignment||{}).rubric?this.rubricTable(this.assignment.rubric):"",this.sources,this.links,this.bodytext,this.actions,this.nav)}},{key:"firstUpdated",value:function(n){w(v(i.prototype),"firstUpdated",this)&&w(v(i.prototype),"firstUpdated",this).call(this,n),this.fetchData("profile"),this.fetchData("assignments")}},{key:"updated",value:function(n){var t=this;w(v(i.prototype),"updated",this)&&w(v(i.prototype),"updated",this).call(this,n),n.forEach((function(n,e){"submission"==e&&(t.__links=t.submission&&t.submission.links?t.submission.links:[],t.__sources=t.submission&&t.submission.sources?t.submission.sources:[])}))}},{key:"actions",get:function(){return this.editable?t.html(hn||(hn=j(['\n          <section id="actions">\n            <elmsln-studio-button class="delete" icon="delete" path=""\n              >Delete</elmsln-studio-button\n            >\n            <span class="spacer"></span>\n            <elmsln-studio-button class="save" path=""\n              >Save Draft</elmsln-studio-button\n            >\n            <elmsln-studio-button class="submit" icon="done" path=""\n              ><span slot="before">Submit Assignment</span>\n            </elmsln-studio-button>\n          </section>\n        ']))):t.html(pn||(pn=j([""])))}},{key:"alert",get:function(){var n=this,e=function(e,i){var s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.html(fn||(fn=j([' <p\n            id="alert"\n            class="','"\n          >\n            ',"\n            ","\n            ",'\n          </p>\n          <simple-tooltip for="alert-avatar">\n            ',"\n          </simple-tooltip>"])),n.assignmentStatus.toLowerCase().replace(/\s/,"-"),s?t.html(gn||(gn=j(['\n                  <simple-icon-lite\n                    id="alert-avatar"\n                    accent-color="','"\n                    icon="','"\n                  >\n                  </simple-icon-lite>\n                '])),n.getStatusColor(n.submission,n.assignment||{}),n.getStatusIcon(n.submission,n.assignment||{})):"",e,i?t.html(bn||(bn=j(['\n                  <local-time\n                    month="long"\n                    day="numeric"\n                    year="numeric"\n                    hour="2-digit"\n                    minute="2-digit"\n                    second="2-digit"\n                    time-zone-name="short"\n                    datetime="','"\n                  >\n                    ',"\n                  </local-time>\n                "])),i,n.dateFormat(i)):"",n.assignmentStatus)};return this.getStatus(this.submission,this.assignment||{},this.tooLate?e("Assignment closed for submission on ",this.assignment.hideDate):e("Assignment is overdue!"),e("Assignment submitted late on ",(this.submission||{}).date),e("Assignment submitted on ",(this.submission||{}).date),this.tooEarly?e("Assignment will open for submission on",this.assignment.showDate,!1):"")}},{key:"assignmentStatus",get:function(){return this.getStatusMessage(this.submission,this.assignment||{})}},{key:"bodytext",get:function(){var n=(this.submission||{}).body?this.submission.body.trim():"",e=""==n&&!this.editable;return!this.assignment||e?"":t.html(vn||(vn=j(['\n          <section id="text">\n            <h2 class="sr-only">Text</h2>\n            ',"\n          </section>\n        "])),this.editable?t.html(yn||(yn=j(['\n                  <rich-text-editor-toolbar-full\n                    show="always"\n                    id="toolbar"\n                    controls="editor"\n                    .config="','"\n                    sticky\n                  >\n                  </rich-text-editor-toolbar-full>\n                  <rich-text-editor\n                    id="editor"\n                    toolbar="toolbar"\n                    type="rich-text-editor-toolbar-full"\n                  >\n                    ',"\n                  </rich-text-editor>\n                "])),this.__editorConfig,n||t.html(kn||(kn=j(["<p>Add text</p>"])))):n)}},{key:"breadcrumb",get:function(){return t.html(xn||(xn=j(['\n      <div id="breadcrumb">\n        <elmsln-studio-link href="assignments">Assignments</elmsln-studio-link>\n        <span> > </span>\n        <span>\n          ',"\n        </span>\n      </div>\n    "])),this.assignment?this.assignment.assignment:t.html(wn||(wn=j(["<em>Assignment</em>"]))))}},{key:"editable",get:function(){return!(this.submission||{}).date&&!this.tooEarly&&!this.tooLate}},{key:"links",get:function(){var n=this,e=(this.__links||[]).length<1&&!this.editable;return!this.assignment||e?"":t.html(jn||(jn=j(['\n          <section id="links">\n            <h2 class="sr-only">Links</h2>\n            <ul id="linklist">\n              ',"\n              ","\n            </ul>\n          </section>\n        "])),(this.__links||[]).map((function(e,i){return t.html(Sn||(Sn=j(['\n                  <li>\n                    <a id="link-','" href="link.url" class="link ','">\n                      '," (",")\n                    </a>\n                    ","\n                  </li>\n                "])),i,e.type,e.text,e.url,n.editable?t.html(Fn||(Fn=j(['\n                          <button\n                            aria-controls="source-','"\n                            @click="','"\n                          >\n                            <span class="sr-only">delete link</span>\n                            <simple-icon-lite icon="delete"></simple-icon-lite>\n                          </button>\n                        '])),i,(function(t){return n._removeLink(i)})):"")})),this.editable?t.html(Ln||(Ln=j(['\n                    <li>\n                      <label for="linktext" class="sr-only">Text</label>\n                      <input\n                        id="linktext"\n                        @change="','"\n                        placeholder="link text"\n                        type="text"\n                      />\n                      <label for="linkurl" class="sr-only">URL</label>\n                      <input\n                        id="linkurl"\n                        @change="','"\n                        placeholder="url"\n                        required\n                        type="url"\n                      />\n                      <button\n                        id="linkbutton"\n                        aria-controls="linklist"\n                        aria-describedby="linktext linkurl"\n                        @click="','"\n                        ?disabled="','"\n                      >\n                        <span class="sr-only">add link</span>\n                        <simple-icon-lite icon="add"></simple-icon-lite>\n                      </button>\n                      <simple-tooltip for="linkbutton"\n                        >Add this link.</simple-tooltip\n                      >\n                    </li>\n                  '])),(function(t){return n.__newLinkText=n._getFieldVal("linktext")}),(function(t){return n.__newLinkUrl=n._getFieldVal("linkurl")}),this._addLink,!this.__newLinkUrl):"")}},{key:"nav",get:function(){var n=(this.prevAssign||{}).assignment||"",t=(this.nextAssign||{}).assignment||"",e=(this.prevAssign||{}).id?"assignments/".concat(this.prevAssign.id):void 0,i=(this.nextAssign||{}).id?"assignments/".concat(this.nextAssign.id):void 0;return this.prevNextNav(n,e,t,i)}},{key:"newLinkType",get:function(){return this._getLinkType(this.__newLinkUrl)}},{key:"nextAssign",get:function(){var n=this.assignment?this.assignment.next:void 0;return n?(this.assignments||{})[n]:void 0}},{key:"prevAssign",get:function(){var n=this.assignment?this.assignment.prev:void 0;return n?(this.assignments||{})[n]:void 0}},{key:"sources",get:function(){var n=this,e=(this.__sources||[]).length<1&&!this.editable;return!this.assignment||e?"":t.html(zn||(zn=j(['\n          <section id="uploads">\n            <h2 class="sr-only">Uploads</h2>\n            <ul id="uploadlist">\n              ',"\n              ","\n            </ul>\n          </section>\n        "])),(this.__sources||[]).map((function(e,i){return t.html(_n||(_n=j(['\n                  <li\n                    id="source-','"\n                    style="background-image: url(',')"\n                  >\n                    ',"\n                  </li>\n                "])),i,e.src,n.editable?t.html(Dn||(Dn=j([' <button\n                          aria-controls="source-','"\n                          class="delete-upload"\n                          @click="','"\n                        >\n                          <span class="sr-only"\n                            >delete ','</span\n                          >\n                          <simple-icon-lite icon="delete"></simple-icon-lite>\n                        </button>'])),i,(function(t){return n._removeUpload(i)}),e.alt||e.src):"")})),this.editable?t.html(An||(An=j(['\n                    <li>\n                      <vaadin-upload\n                        id="add-upload"\n                        @upload-before="','"\n                      >\n                        <button slot="add-button">\n                          <simple-icon-lite icon="add"></simple-icon-lite>\n                          <span class="sr-only">Upload Files...</span>\n                        </button>\n                        <span slot="drop-label"\n                          ><span class="sr-only">Drop files here.</span></span\n                        >\n                      </vaadin-upload>\n                      <span class="spacer"></span>\n                      <simple-tooltip for="add-upload"\n                        >Upload or drop files.</simple-tooltip\n                      >\n                    </li>\n                  '])),this._addUpload):t.html(On||(On=j(["<div></div>"]))))}},{key:"tooEarly",get:function(){return this.assignment&&this.assignment.showDate&&this.isEarly(this.assignment.showDate)}},{key:"submittedLate",get:function(){return(this.submission||{}).date&&this.assignment&&this.isLate(this.assignment.date,this.submission.date)}},{key:"tooLate",get:function(){return this.assignment&&this.assignment.hideDate&&this.isLate(this.assignment.hideDate)}},{key:"_addLink",value:function(n){if(this.__newLinkUrl){var t=this.__links.slice(0);t.push({text:this.__newLinkText,url:this.__newLinkUrl,type:this.newLinkType}),this.__links=t,this._setFieldVal("linkurl"),this._setFieldVal("linktext")}}},{key:"_addUpload",value:function(n){console.log("_addUpload",n)}},{key:"_getFieldVal",value:function(n){return this.shadowRoot&&this.shadowRoot.querySelector("#".concat(n))?this.shadowRoot.querySelector("#".concat(n)).value:void 0}},{key:"_getLinkType",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=n.match(/\.\w+$/);return t&&t[0]?t[0].toLowerCase().replace(/\./,""):void 0}},{key:"_removeLink",value:function(n){var t=this.__links.slice(0);t.splice(n,1),this.__links=t}},{key:"_removeUpload",value:function(n){var t=this.__sources.slice(0);t.splice(n,1),this.__sources=t}},{key:"_setFieldVal",value:function(n,t){this.shadowRoot&&this.shadowRoot.querySelector("#".concat(n))&&(this.shadowRoot.querySelector("#".concat(n)).value="")}}],[{key:"styles",get:function(){return[].concat(S(w(v(i),"styles",this)),[t.css(Nn||(Nn=j(["\n        :host {\n          display: block;\n          flex-wrap: wrap;\n        }\n        h1 {\n          text-align: center;\n          margin-bottom: calc(0.25 * var(--elmsln-studio-margin, 20px));\n        }\n        #breadcrumb {\n          margin: 0 0 var(--elmsln-studio-margin, 20px);\n          flex: 1 0 100%;\n          --elmsln-studio-link-Color: var(\n            --simple-colors-fixed-theme-light-blue-8\n          );\n          --elmsln-studio-link-focus-Color: var(\n            --simple-colors-fixed-theme-light-blue-9\n          );\n        }\n        #breadcrumb > * {\n          display: inline;\n        }\n        #alert {\n          display: flex;\n          justify-content: center;\n          align-items: center;\n          margin: 0;\n          font-size: calc(1 * var(--elmsln-studio-FontSize, 16px));\n          background-color: var(\n            --elmsln-studio-assignment-backgroundColor,\n            #ffffff\n          );\n          border: 1px solid var(--elmsln-studio-assignment-borderColor, #eaeaea);\n          border-bottom: none;\n        }\n        #alert simple-icon-lite {\n          width: calc(1.5 * var(--elmsln-studio-FontSize, 16px));\n          height: calc(1.5 * var(--elmsln-studio-FontSize, 16px));\n        }\n        #alert > * {\n          margin: 0 0.25em;\n        }\n        .submitted {\n          --elmsln-studio-assignment-color: var(\n            --simple-colors-default-theme-green-8,\n            #00762e\n          );\n        }\n        .submitted-late {\n          --elmsln-studio-assignment-backgroundColor: #fff8e4;\n          --elmsln-studio-assignment-borderColor: var(\n            --simple-colors-default-theme-amber-8,\n            #876800\n          );\n          --elmsln-studio-assignment-color: var(\n            --simple-colors-default-theme-amber-8,\n            #876800\n          );\n        }\n        .overdue {\n          --elmsln-studio-assignment-backgroundColor: #ffeeee;\n          --elmsln-studio-assignment-borderColor: var(\n            --simple-colors-default-theme-red-8,\n            #ac0000\n          );\n          --elmsln-studio-assignment-color: var(\n            --simple-colors-default-theme-red-8,\n            #ac0000\n          );\n        }\n        .assignment-name,\n        .assignment-name,\n        .assignment-date {\n          font-weight: normal;\n          display: block;\n        }\n        .assignment-name {\n          font-size: calc(1.75 * var(--elmsln-studio-FontSize, 16px));\n          color: #95989a;\n        }\n        #project-buttons,\n        .submission-header {\n          position: relative;\n          height: 40px;\n          margin-top: -40px;\n        }\n        section {\n          border-top: 2px solid #eaeaea;\n          padding: calc(0.5 * var(--elmsln-studio-margin, 20px)) 0\n            var(--elmsln-studio-margin, 20px);\n        }\n        h2 {\n          margin: calc(2 * var(--elmsln-studio-margin, 20px)) auto;\n          text-align: center;\n        }\n        .assignment-name {\n          font-size: calc(1.5 * var(--elmsln-studio-FontSize, 16px));\n          color: #555555;\n        }\n        .assignment-date {\n          margin: 0 0 calc(1 * var(--elmsln-studio-margin, 20px));\n          text-align: center;\n          font-size: var(--elmsln-studio-FontSize, 16px);\n          color: #95989a;\n        }\n        .assignment-body {\n          color: #95989a;\n          line-height: 160%;\n          margin: calc(0.5 * var(--elmsln-studio-margin, 20px)) auto\n            var(--elmsln-studio-margin, 20px);\n        }\n        ul {\n          list-style-type: none;\n          padding-left: 0;\n        }\n        #uploadlist {\n          display: flex;\n          justify-content: flex-start;\n          flex-wrap: wrap;\n        }\n        #uploadlist li {\n          flex: 0 0 150px;\n          height: calc(32px + 150px);\n          background-position: center;\n          background-size: cover;\n          margin: calc(0.5 * var(--elmsln-studio-margin, 20px));\n        }\n        #uploadlist li:last-child {\n          display: flex;\n          flex: 1 0 auto;\n        }\n        #uploadlist button {\n          width: 150px;\n          height: 150px;\n          border: 1px solid #eaeaea;\n          transition: all 0.5s ease-in-out;\n        }\n        #uploadlist button.delete-upload {\n          background-color: rgba(255, 255, 255, 0.6);\n          opacity: 0;\n        }\n        #uploadlist button:focus,\n        #uploadlist button:hover {\n          opacity: 1;\n          border: 1px solid blue;\n        }\n        vaadin-upload {\n          flex: 0 1 auto;\n        }\n        #linklist li {\n          display: flex;\n          align-items: center;\n          padding-left: -1em;\n          justify-content: space-between;\n          margin: calc(0.5 * var(--elmsln-studio-margin, 20px)) 0;\n        }\n        #linklist .link,\n        #linkurl {\n          flex: 1 1 auto;\n        }\n        #linklist button {\n          flex: 0 1 auto;\n        }\n        #linklist input {\n          line-height: 2em;\n          margin: 0 calc(0.5 * var(--elmsln-studio-margin, 20px)) 0 0;\n          font-size: calc(1 * var(--elmsln-studio-FontSize, 16px));\n        }\n        #editor {\n          border: 1px solid #eaeaea;\n        }\n        #actions {\n          display: flex;\n          align-items: stretch;\n          justify-content: space-between;\n        }\n        .submit {\n          flex: 0 0 auto;\n          text-align: right;\n          --elmsln-studio-button-icon-color: var(\n            --simple-colors-default-theme-green-7\n          );\n        }\n        .save {\n          flex: 0 0 auto;\n          margin: 0 calc(0.5 * var(--elmsln-studio-margin, 20px));\n        }\n        .delete {\n          flex: 0 0 auto;\n          --elmsln-studio-button-icon-color: var(\n            --simple-colors-default-theme-red-7\n          );\n        }\n        .spacer {\n          flex: 1 1 auto;\n        }\n        #actions elmsln-studio-button:hover,\n        #actions elmsln-studio-button:focus-within {\n          text-decoration: underline;\n        }\n        @media screen and (min-width: 600px) {\n          #primary,\n          #alert {\n            max-width: calc(1000px - 2 * var(--elmsln-studio-margin, 20px));\n            margin: 0 auto;\n            border: 1px solid\n              var(--elmsln-studio-assignment-borderColor, #eaeaea);\n            padding: var(--elmsln-studio-margin, 20px);\n          }\n          #alert {\n            padding: calc(0.25 * var(--elmsln-studio-margin, 20px))\n              var(--elmsln-studio-margin, 20px);\n            border-bottom: 1px solid\n              var(--elmsln-studio-assignment-borderColor, #eaeaea);\n          }\n        }\n      "])))])}},{key:"properties",get:function(){return m(m({},w(v(i),"properties",this)),{},{assignments:{type:Object},assignment:{type:Object},submission:{type:Object},__sources:{type:Array},__links:{type:Array},__newLinkUrl:{type:String},__newLinkText:{type:String},__editorConfig:{type:Array}})}},{key:"tag",get:function(){return"elmsln-studio-assignment"}}]),i}(ln(T(t.LitElement)));customElements.define("elmsln-studio-assignment",Rn);var Mn,Bn,Wn,Vn,Gn,Hn,$n,Yn,Xn,Jn,Kn,Qn,Zn=function(n){b(i,n);var e=x(i);function i(){return p(this,i),e.call(this)}return f(i,[{key:"render",value:function(){var n=this;return t.html(Cn||(Cn=j(['\n      <h1 class="sr-only">Assignments</h1>\n      <div id="lessons">\n        ',"\n      </div>\n    "])),this.lessons?Object.keys(this.lessons||{}).map((function(e){return t.html(In||(In=j(['\n                <div class="lesson">\n                  <h2>',"</h2>\n                  ","\n                </div>\n              "])),n.lessons[e].lesson,(n.lessons[e].assignments||[]).map((function(e){return e.assignments?t.html(Pn||(Pn=j(['\n                          <nav-card flat no-border class="card secondary">\n                            <span slot="heading" ?hidden="','">\n                              ','\n                            </span>\n                            <div slot="linklist">\n                              ',"\n                            </div>\n                          </nav-card>\n                        "])),!e.project,e.project,n.sortDates(e.assignments||[],!0).map((function(t){return n.renderAssignment(t)}))):t.html(En||(En=j(['\n                          <div class="assignment">\n                            ',"\n                          </div>\n                        "])),n.renderAssignment(e))})))})):this.loading("green",void 0,"large"))}},{key:"renderAssignment",value:function(n){return n?t.html(Un||(Un=j(['\n          <nav-card-item\n            id="act-','-item"\n            accent-color="','"\n            allow-grey\n            avatar="','"\n            invert\n          >\n            <elmsln-studio-link\n              id="act-','"\n              class="assignment-link"\n              aria-describedby="act-',"-desc act-",'-item"\n              slot="label"\n              href="assignments/','"\n            >\n              ','\n            </elmsln-studio-link>\n            <div id="act-','-desc" slot="description">\n              Due:\n              <local-time\n                month="long"\n                day="numeric"\n                year="numeric"\n                hour="2-digit"\n                minute="2-digit"\n                second="2-digit"\n                time-zone-name="short"\n                datetime="','"\n              >\n                ','\n              </local-time>\n            </div>\n          </nav-card-item>\n          <simple-tooltip for="act-','" position="left">\n            ',"\n          </simple-tooltip>\n        "])),n.id,this.profile?this.getStatusColor(this.getSubmission(n.id),n):"grey",this.profile?this.getStatusIcon(this.getSubmission(n.id),n):void 0,n.id,n.id,n.id,n.id,n.assignment,n.id,n.date,this.dateFormat(n.date),n.id,this.getStatusMessage(this.getSubmission(n.id),n)):""}},{key:"firstUpdated",value:function(n){w(v(i.prototype),"firstUpdated",this)&&w(v(i.prototype),"firstUpdated",this).call(this,n),this.fetchData("profile"),this.fetchData("lessons")}},{key:"getSubmission",value:function(n){var t=this,e=this.profile&&this.profile.id&&this.profile.submissions?this.profile.submissions.filter((function(e){return e.id==="".concat(n,"-").concat(t.profile.id)})):[];return e.length>0?e[0]:void 0}}],[{key:"tag",get:function(){return"elmsln-studio-assignments"}},{key:"styles",get:function(){return[].concat(S(w(v(i),"styles",this)),[t.css(qn||(qn=j(['\n        :host {\n          display: flex;\n          color: #2c2c2c;\n          margin: 0 auto;\n          justify-content: center;\n        }\n        h2 {\n          color: #525252;\n          margin-top: calc(0.5 * var(--elmsln-studio-margin, 20px));\n        }\n        nav-card [slot="heading"] {\n          color: #4d4d4d;\n          font-size: 80%;\n        }\n        nav-card-item [slot="label"] {\n          font-weight: normal;\n        }\n        nav-card-item [slot="description"] {\n          color: #95989a;\n        }\n        .lesson {\n          background-color: #eee;\n          padding: calc(0.5 * var(--elmsln-studio-margin, 20px));\n          --lrndesign-avatar-border-radius: 0%;\n          --nav-card-item-avatar-width: 40px;\n          border: 1px solid var(--accent-card-border-color, #ddd);\n          border-bottom: none;\n        }\n        .lesson > .assignment {\n          background-color: #fff;\n          border: 1px solid var(--accent-card-border-color, #ddd);\n          padding: calc(0.5 * var(--elmsln-studio-margin, 20px))\n            var(--elmsln-studio-margin, 20px);\n          margin-bottom: 15px;\n        }\n        nav-card-item:not([avatar]) .assignment-link:before {\n          position: absolute;\n          overflow: hidden;\n          display: inline-block;\n          -webkit-animation: ellipsis steps(4, end) 900ms infinite;\n          animation: ellipsis steps(4, end) 900ms infinite;\n          content: "...";\n          font-size: 300%;\n          left: 0;\n          top: 0;\n          width: 0px;\n        }\n\n        @keyframes ellipsis {\n          to {\n            width: 1.25em;\n          }\n        }\n\n        @-webkit-keyframes ellipsis {\n          to {\n            width: 1.25em;\n          }\n        }\n        @media screen and (min-width: 400px) {\n          #lessons {\n            display: flex;\n            align-items: stretch;\n            justify-content: flex-start;\n            overflow-x: auto;\n            max-width: 100%;\n            padding: 0 calc(0.5 * var(--elmsln-studio-margin, 20px));\n          }\n          .lesson {\n            width: 300px;\n            flex: 0 0 300px;\n            margin: 0 var(--elmsln-studio-margin, 20px);\n            border-bottom: 1px solid var(--accent-card-border-color, #ddd);\n          }\n        }\n      '])))])}},{key:"properties",get:function(){return m(m({},w(v(i),"properties",this)),{},{lessons:{type:Object},profile:{type:Object}})}}]),i}(ln(T(t.LitElement)));customElements.define("elmsln-studio-assignments",Zn);var nt,tt,et=function(n){b(i,n);var e=x(i);function i(){var n;return p(this,i),(n=e.call(this)).feedback={},n.comment="",n}return f(i,[{key:"render",value:function(){var n=this;return t.html(Mn||(Mn=j(['\n      <div id="breadcrumb">\n        <elmsln-studio-link href="submissions">Submissions</elmsln-studio-link>\n        <span> > </span>\n        ',"\n        ","\n        <span> > </span>\n        <span\n          >",'</span\n        >\n      </div>\n      <div\n        id="primary"\n        class="','"\n      >\n        <article id="portfolio-project">\n          <h1>\n            <lrndesign-avatar\n              accent-color="','"\n              aria-hidden="true"\n              label="','"\n              .src="','"\n              two-chars\n            >\n            </lrndesign-avatar>\n            <span class="student-name"\n              >',"</span\n            >\n            ",'\n          </h1>\n          <div id="project-buttons">\n            <button\n              id="sort"\n              aria-pressed="','"\n              class="','"\n              @click="','"\n              controls="portfolio-project"\n            >\n              <simple-icon-lite icon="sort"></simple-icon-lite>\n              <simple-tooltip for="sort"\n                >Sort Submissions\n                ',"</simple-tooltip\n              >\n            </button>\n          </div>\n          ",'\n        </article>\n      </div>\n      <div\n        id="secondary"\n        ?hidden=','\n      >\n        <aside>\n          <div class="instructions callout">\n            <h2 class="callout-label">\n              <simple-icon-lite\n                icon="info"\n                aria-hidden="true"\n              ></simple-icon-lite>\n              Giving Feedback\n            </h2>\n            <div>\n              <ul>\n                <li>Things to look for: blah, blah, blah</li>\n                <li>How to say it: blah, blah, blah</li>\n                <li>Other info.</li>\n              </ul>\n            </div>\n          </div>\n          <h2 class="discussion-label">Feedback</h2>\n          <div class="discussion callout">\n            <p class="callout-label">\n              <simple-icon-lite\n                icon="communication:comment"\n                aria-hidden="true"\n              ></simple-icon-lite>\n              Post New Feedback\n            </p>\n            <threaded-discussion\n              comment-icon="send"\n              ?demo="','"\n              .data="','"\n              latest\n            >\n            </threaded-discussion>\n          </div>\n        </aside>\n      </div>\n      ',"\n    "])),this.portfolio?t.html(Bn||(Bn=j(["\n              ","\n            "])),this.portfolio.projectId&&this.portfolio.project?t.html(Wn||(Wn=j(['\n                    <elmsln-studio-link\n                      href="','"\n                      >',"</elmsln-studio-link\n                    >\n                    <span> > </span>\n                  "])),"submissions?project=".concat(this.portfolio.projectId),this.portfolio.project||"Project"):""):"",this.portfolio&&this.assignment?t.html(Gn||(Gn=j(['\n              <elmsln-studio-link\n                href="','"\n                >',"</elmsln-studio-link\n              >\n            "])),"submissions?".concat(this.portfolio.projectId&&this.portfolio.project?"project=".concat(this.portfolio.projectId,"&"):"","assignment=").concat(this.assignment.assignmentId),this.assignment.assignment||"Assignment"):t.html(Vn||(Vn=j(["<em>Assignment</em>"]))),this.portfolio?this.fullName(this.portfolio):t.html(Hn||(Hn=j(["<em>Student</em>"]))),this.comment&&""!==this.comment?"view-discussion":"",this.portfolio?this.accentColor(this.fullName(this.portfolio)):"grey",this.portfolio?this.fullName(this.portfolio):"undefined",this.portfolio&&this.portfolio.avatar?this.portfolio.avatar:void 0,this.portfolio?this.fullName(this.portfolio):"Loading...",this.portfolio&&this.portfolio.project?t.html($n||($n=j(['\n                  <span class="project-name">',"</span>\n                "])),this.portfolio.project):"",this.sortLatest?"false":"true",this.sortLatest?"sort-latest":"",(function(t){return n.sortLatest=!n.sortLatest}),this.sortLatest?"Newest First":"Oldest First",this.sortedSubmissions.map((function(e){return t.html(Yn||(Yn=j(['\n              <section\n                class="','"\n              >\n                <div class="submission-header">\n                  <h2 id="sub-','">\n                    <span class="assignment-name">','</span>\n                    <span class="submission-date"\n                      >Submitted:\n                      <local-time\n                        month="long"\n                        day="numeric"\n                        year="numeric"\n                        hour="2-digit"\n                        minute="2-digit"\n                        second="2-digit"\n                        time-zone-name="short"\n                        datetime="','"\n                      >\n                        ','\n                      </local-time>\n                    </span>\n                  </h2>\n                  <elmsln-studio-button\n                    id="sub-','-toggle-button"\n                    class="view-discussion-button"\n                    aria-describedby="sub-','"\n                    icon="','"\n                    path="','"\n                  >\n                    <span class="sr-only"\n                      >','</span\n                    >\n                    <span class="sr-only"\n                      >Give / View Feedback (',')</span\n                    >\n                  </elmsln-studio-button>\n                </div>\n                <div class="submission-body">\n                  ',"\n                </div>\n              </section>\n            "])),n.submissionFilter===e.id?"section-discussion":"",e.id,e.assignment,e.date,n.dateFormat(e.date),e.id,e.id,n.submissionFilter===e.id&&n.comment?"close":n.getFeedbackIcon(e.feedback.length),n.getActivityLink(e,n.submissionFilter===e.id&&n.comment),n.submissionFilter===e.id&&n.comment?"Close Feedback":"View Feedback (".concat(e.feedback.length,")"),e.feedback.length,e.links&&e.links.length>0?t.html(Xn||(Xn=j(['\n                        <ul class="submission-links">\n                          ',"\n                        </ul>\n                      "])),e.links.map((function(i){return t.html(Jn||(Jn=j(['\n                              <li>\n                                <elmsln-studio-link\n                                  href="','"\n                                  target="_blank"\n                                  ?disabled="','"\n                                >\n                                  <simple-icon-lite\n                                    aria-hidden="true"\n                                    icon="','"\n                                  ></simple-icon-lite>\n                                  ',"\n                                </elmsln-studio-link>\n                              </li>\n                            "])),i.url,!(n.submissionFilter===e.id||!n.comment),"pdf"===i.type?"hax:file-pdf":"link",i.text||i.url)}))):e.sources&&0!==e.sources.length?n.getThumnailGrid(e,n.submissionFilter!==e.id&&n.comment):t.html(Kn||(Kn=j([" "," "])),e.body))})),!this.portfolio||!this.comment||""===this.comment,this.demoMode,this.feedback||[],this.nav)}},{key:"firstUpdated",value:function(n){w(v(i.prototype),"firstUpdated",this)&&w(v(i.prototype),"firstUpdated",this).call(this,n),this.fetchData("submissions"),this.fetchData("portfolios"),this.fetchData("discussion"),console.log("updated",this.navigation,this.portfolios,this.feedback)}},{key:"updated",value:function(n){var t=this;w(v(i.prototype),"updated",this)&&w(v(i.prototype),"updated",this).call(this,n),n.forEach((function(n,e){"feedback"===e&&console.log("updated",t.feedback)}))}},{key:"nav",get:function(){if(this.navigation){var n=this.navigation.prev?this.fullName(this.navigation.prev):"",t=this.navigation.next?this.fullName(this.navigation.next):"",e=this.navigation.prev?this.getActivityLink(this.navigation.prev,!this.comment,this.sortLatest):void 0,i=this.navigation.next?this.getActivityLink(this.navigation.next,!this.comment,this.sortLatest):void 0;return this.prevNextNav(n,e,t,i)}}},{key:"sortedSubmissions",get:function(){return this.portfolio&&this.portfolio.submissions?this.sortDates(this.portfolio.submissions,this.sortLatest):[]}},{key:"assignment",get:function(){var n=this,t=this.portfolio&&this.portfolio.submissions?this.portfolio.submissions.filter((function(t){return!n.submissionFilter||t.id===n.submissionFilter})):[];return!!t&&t[0]}}],[{key:"styles",get:function(){return[].concat(S(w(v(i),"styles",this)),[t.css(Qn||(Qn=j(["\n        :host {\n          display: block;\n          flex-wrap: wrap;\n        }\n        h1 {\n          text-align: center;\n        }\n        #breadcrumb {\n          margin: 0 0 var(--elmsln-studio-margin, 20px);\n          flex: 1 0 100%;\n          --elmsln-studio-link-Color: var(\n            --simple-colors-fixed-theme-light-blue-8\n          );\n          --elmsln-studio-link-focus-Color: var(\n            --simple-colors-fixed-theme-light-blue-9\n          );\n        }\n        #breadcrumb > * {\n          display: inline;\n        }\n        lrndesign-avatar,\n        .student-name,\n        .project-name,\n        .assignment-name,\n        .submission-date {\n          font-weight: normal;\n          display: block;\n        }\n        .student-name {\n          font-size: calc(2 * var(--elmsln-studio-FontSize, 16px));\n          font-weight: bold;\n          color: #4b4b4b;\n        }\n        .project-name {\n          font-size: calc(1.75 * var(--elmsln-studio-FontSize, 16px));\n          color: #95989a;\n        }\n        #project-buttons,\n        .submission-header {\n          position: relative;\n          height: 40px;\n          margin-top: -40px;\n        }\n        #sort,\n        .submission-header elmsln-studio-button {\n          color: #95989a;\n          font-size: var(--elmsln-studio-FontSize, 16px);\n          text-transform: uppercase;\n          position: absolute;\n          right: 0;\n          top: 0;\n        }\n        #sort:focus,\n        #sort:hover,\n        .submission-header elmsln-studio-button:focus,\n        .submission-header elmsln-studio-button:hover {\n          color: #4b4b4b;\n        }\n        #sort.sort-latest {\n          transform: rotateX(180deg) rotateY(0deg);\n        }\n        section {\n          border-top: 2px solid #eaeaea;\n          padding: calc(0.5 * var(--elmsln-studio-margin, 20px)) 0\n            var(--elmsln-studio-margin, 20px);\n        }\n        .view-discussion {\n          border: 1px solid #eaeaea;\n          padding: calc(0.5 * var(--elmsln-studio-margin, 20px));\n          --elmsln-studio-discussion-multiplier: 1;\n        }\n        .view-discussion section {\n          opacity: 0.4;\n          display: none;\n        }\n        .view-discussion section.section-discussion {\n          display: block;\n          opacity: 1;\n        }\n        h2 {\n          margin: calc(2 * var(--elmsln-studio-margin, 20px)) auto;\n          text-align: center;\n        }\n        .assignment-name {\n          font-size: calc(\n            1.25 * var(--elmsln-studio-discussion-multiplier, 1) *\n              var(--elmsln-studio-FontSize, 16px)\n          );\n          color: #555555;\n        }\n        .submission-date {\n          font-size: calc(\n            0.75 * var(--elmsln-studio-discussion-multiplier, 1) *\n              var(--elmsln-studio-FontSize, 16px)\n          );\n          color: #95989a;\n        }\n        .submission-body {\n          color: #95989a;\n          line-height: 160%;\n          margin: calc(0.5 * var(--elmsln-studio-margin, 20px)) auto\n            var(--elmsln-studio-margin, 20px);\n        }\n        .submission-body:first-child {\n          margin-top: 0;\n        }\n        .submission-body:last-child {\n          margin-bottom: 0;\n        }\n        .submission-links {\n          list-style: none;\n          padding-inline-start: 0;\n        }\n        .submission-links > li {\n          display: flex;\n          align-items: flex-start;\n          justify-content: flex-start;\n        }\n        .submission-links a:link,\n        .submission-links a:visited {\n          font-size: calc(1.5 * var(--elmsln-studio-FontSize, 16px));\n          font-weight: bold;\n          color: #000;\n          text-decoration: none;\n        }\n        .submission-links a:focus,\n        .submission-links a:hover {\n          text-decoration: underline;\n        }\n        .submission-links simple-icon-lite {\n          margin-right: 0.5em;\n        }\n        .submission-links a:focus simple-icon-lite,\n        .submission-links a:hover simple-icon-lite {\n          text-decoration: none;\n        }\n        .callout {\n          font-size: calc(0.75 * var(--elmsln-studio-FontSize, 16px));\n          border: 1px solid #eaeaea;\n          padding: 0;\n        }\n        .discussion-label {\n          text-align: left;\n          font-size: calc(1 * var(--elmsln-studio-FontSize, 16px));\n          margin: var(--elmsln-studio-margin, 20px) 0\n            calc(0.25 * var(--elmsln-studio-margin, 20px));\n        }\n        .callout > * {\n          padding: calc(0.25 * var(--elmsln-studio-margin, 20px))\n            calc(0.5 * var(--elmsln-studio-margin, 20px));\n        }\n        .callout .callout-label {\n          font-size: calc(1 * var(--elmsln-studio-FontSize, 16px));\n          font-weight: normal;\n          display: flex;\n          align-items: center;\n          justify-content: flex-start;\n          margin: 0;\n          color: #4b4b4b;\n          border-bottom: 1px solid #eaeaea;\n        }\n        .callout .callout-label simple-icon-lite {\n          margin-right: 1em;\n        }\n        threaded-discussion {\n          background-color: #eaeaea;\n          padding: 1px;\n          --threaded-discussion-comment-button-BackgroundColor: var(\n            --simple-colors-fixed-theme-light-blue-8\n          );\n          --threaded-discussion-comment-button-focus-BackgroundColor: var(\n            --simple-colors-fixed-theme-light-blue-9\n          );\n        }\n        #prev-next-nav {\n          z-index: 1;\n          display: flex;\n        }\n        @media screen and (min-width: 600px) {\n          :host {\n            display: flex;\n            align-items: flex-start;\n            justify-content: space-between;\n          }\n          #primary {\n            flex: 1 0 100%;\n          }\n          #primary.view-discussion {\n            flex: 0 0 calc(50% - var(--elmsln-studio-margin, 20px));\n          }\n          #primary:not(.view-discussion) {\n            max-width: calc(1000px - 2 * var(--elmsln-studio-margin, 20px));\n            margin: 0 auto;\n            border: 1px solid #eaeaea;\n            padding: var(--elmsln-studio-margin, 20px);\n          }\n          .view-discussion {\n            --elmsln-studio-discussion-multiplier: 0.5;\n          }\n          .assignment-name {\n            font-size: calc(\n              1.5 * var(--elmsln-studio-discussion-multiplier, 1) *\n                var(--elmsln-studio-FontSize, 16px)\n            );\n          }\n          .submission-date {\n            font-size: calc(\n              1 * var(--elmsln-studio-discussion-multiplier, 1) *\n                var(--elmsln-studio-FontSize, 16px)\n            );\n          }\n          .view-discussion section {\n            display: block;\n          }\n          .view-discussion section.section-discussion {\n            border: 4px solid #95989a;\n            padding: calc(0.5 * var(--elmsln-studio-margin, 20px))\n              calc(0.5 * var(--elmsln-studio-margin, 20px))\n              var(--elmsln-studio-margin, 20px);\n            opacity: 1;\n          }\n          #secondary {\n            flex: 0 0 calc(50% - var(--elmsln-studio-margin, 20px));\n          }\n        }\n        @media screen and (min-width: 1000px) {\n          .view-discussion {\n            --elmsln-studio-discussion-multiplier: 0.75;\n          }\n        }\n        @media screen and (min-width: 1200px) {\n          .view-discussion {\n            --elmsln-studio-discussion-multiplier: 1;\n          }\n        }\n      "])))])}},{key:"properties",get:function(){return m(m({},w(v(i),"properties",this)),{},{portfolio:{type:Object},feedback:{type:Object},comment:{type:String,attribute:"comment"},navigation:{type:Object,attribute:"navigation"},submissionFilter:{type:String,attribute:"submission-filter"},sortLatest:{type:Boolean,attribute:"sort-latest",reflect:!0}})}},{key:"tag",get:function(){return"elmsln-studio-portfolio"}}]),i}(ln(T(t.LitElement)));customElements.define("elmsln-studio-portfolio",et);var it,st,ot,at,lt,rt,ct,dt,ut,mt,pt,ht,ft,gt,bt,vt,yt,kt,xt,wt=function(n){b(i,n);var e=x(i);function i(){return p(this,i),e.apply(this,arguments)}return f(i,[{key:"render",value:function(){return t.html(nt||(nt=j([" <slot></slot> "])))}}],[{key:"tag",get:function(){return"elmsln-studio-main"}},{key:"styles",get:function(){return[t.css(tt||(tt=j(["\n        :host {\n          display: block;\n          font-family: var(--elmsln-studio-FontFamily, sans-serif);\n        }\n\n        :host([hidden]) {\n          display: none;\n        }\n      "])))]}},{key:"properties",get:function(){return m({},w(v(i),"properties",this))}}]),i}(ln(d.outlet(t.LitElement)));customElements.define("elmsln-studio-main",wt);var jt,St=function(n){b(i,n);var e=x(i);function i(){var n;return p(this,i),(n=e.call(this)).profile={},n}return f(i,[{key:"render",value:function(){var n=this;return t.html(it||(it=j(['\n      <h1 class="sr-only">Overview</h1>\n      <div id="primary">\n        <div id="profile">\n          <h2>','</h2>\n          <accent-card accent-color="purple" class="card primary">\n            <span slot="heading" class="sr-only">My Progress</span>\n            ','\n          </accent-card>\n          <nav-card accent-color="green" class="card primary due">\n            <span slot="heading">Upcoming Assignments</span>\n            <elmsln-studio-link slot="subheading" href="assignments"\n              >All assignments</elmsln-studio-link\n            >\n            ','\n          </nav-card>\n        </div>\n        <div id="work">\n          <h2>Recent Work</h2>\n          <nav-card\n            accent-color="amber"\n            class="card primary recent"\n            link-icon="chevron-right"\n          >\n            <span slot="heading">My Submissions</span>\n            <elmsln-studio-link\n              slot="subheading"\n              href="submissions','"\n              >All my submissions</elmsln-studio-link\n            >\n            ','\n          </nav-card>\n          <nav-card\n            accent-color="cyan"\n            class="card feed primary"\n            link-icon="chevron-right"\n          >\n            <span slot="heading">Feedback for Me</span>\n            ','\n          </nav-card>\n        </div>\n      </div>\n      <div id="secondary">\n        <h2 slot="heading">Class Activity</h2>\n        <accent-card accent-color="pink" class="card feed secondary">\n          <nav-card flat no-border slot="content">\n            <span slot="heading">Recent Submissions</span>\n            <elmsln-studio-link slot="subheading" href="submissions"\n              >All submissions</elmsln-studio-link\n            >\n            ','\n          </nav-card>\n          <nav-card flat no-border slot="content">\n            <span slot="heading">Recent Comments</span>\n            ',"\n          </nav-card>\n        </accent-card>\n      </div>\n    "])),this.profileName||"Loading Your Profile...",!this.profile||Object.keys(this.profile).length<1?this.loading("purple","footer"):t.html(st||(st=j(['\n                  <lrndesign-avatar\n                    accent-color="','"\n                    slot="content"\n                    src="','"\n                    label="','"\n                    two-chars\n                    size="200px"\n                  ></lrndesign-avatar>\n                  <table slot="content">\n                    <tbody>\n                      <tr>\n                        <th scope="row">\n                          <simple-icon-lite\n                            icon="assignment-turned-in"\n                          ></simple-icon-lite>\n                          Assignments Completed\n                        </th>\n                        <td>\n                          ',"\n                        </td>\n                      </tr>\n                      ",'\n                      <tr>\n                        <th scope="row">\n                          <simple-icon-lite\n                            icon="communication:forum"\n                          ></simple-icon-lite>\n                          Peer Reviews Written\n                          ','\n                        </th>\n                        <td>\n                          <div id="rating">\n                            ',"\n                            ","\n                            ","\n                            ","\n                            ",'\n                          </div>\n                          <simple-tooltip\n                            for="rating"\n                            ?hidden="','"\n                            >Given peer reviews than\n                            ',"% of\n                            classmates.</simple-tooltip\n                          >\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                "])),this.accentColor(this.profileName),this.profile?this.profile.image:"unknown",this.profileName,this.profile&&this.profile.completed&&this.profile.due?"".concat(this.profile.completed.length," / ").concat(this.profile.completed.length+this.profile.due.length):"unknown",!this.profile||(this.profile.features||[]).length<1?"":t.html(ot||(ot=j(['\n                            <tr>\n                              <th scope="row">\n                                <simple-icon-lite\n                                  icon="icons:favorite"\n                                ></simple-icon-lite>\n                                Submissions Featured\n                              </th>\n                              <td>\n                                ',"\n                              </td>\n                            </tr>\n                          "])),this.profile&&this.profile.features?this.profile.features.length:"unknown"),this.profile&&this.profile.given?" (".concat(this.profile.given.length,")"):" (0)",this.profile.feedbackPercentile<25?"":t.html(at||(at=j(['<simple-icon\n                                  icon="star"\n                                  accent-color="purple"\n                                ></simple-icon>']))),this.profile.feedbackPercentile<50?"":t.html(lt||(lt=j(['<simple-icon\n                                  icon="star"\n                                  accent-color="purple"\n                                ></simple-icon>']))),this.profile.feedbackPercentile<75?"":t.html(rt||(rt=j(['<simple-icon\n                                  icon="star"\n                                  accent-color="purple"\n                                ></simple-icon>']))),this.profile.feedbackPercentile<90?"":t.html(ct||(ct=j(['<simple-icon\n                                  icon="star"\n                                  accent-color="purple"\n                                ></simple-icon>']))),this.profile.feedbackPercentile<95?"":t.html(dt||(dt=j(['<simple-icon\n                                  icon="star"\n                                  accent-color="purple"\n                                ></simple-icon>']))),!this.profile.feedbackPercentile,this.profile.feedbackPercentile),!this.profile||Object.keys(this.profile).length<1?this.loading("green","footer"):t.html(ut||(ut=j(['\n                  <div slot="linklist">\n                    ',"\n                  </div>\n                "])),(this.profile.due||[]).slice(0,5).map((function(e){return t.html(mt||(mt=j(['\n                        <nav-card-item\n                          id="due-','-item"\n                          accent-color="','"\n                          allow-grey\n                          avatar="','"\n                          invert\n                        >\n                          <elmsln-studio-link\n                            id="due-','"\n                            aria-describedby="due-','-desc"\n                            slot="label"\n                            href="assignments/','"\n                          >\n                            ','\n                          </elmsln-studio-link>\n                          <relative-time\n                            id="due-','-desc"\n                            slot="description"\n                            datetime="','"\n                          >\n                            ','\n                          </relative-time>\n                        </nav-card-item>\n                        <simple-tooltip for="due-','-item" position="left">\n                          ',"\n                        </simple-tooltip>\n                      "])),e.id,n.isLate(e.date)?"red":"grey",n.isLate(e.date)?"report-problem":"assignment",e.id,e.id,e.id,e.assignment,e.id,e.date,n.dateFormat(e.date,"long"),e.id,n.isLate(e.date)?"Overdue":"Not Submitted")}))),this.profile?"?student=".concat(this.profile.id):"",!this.profile||Object.keys(this.profile).length<1?this.loading("orange","footer"):t.html(pt||(pt=j([' <div slot="linklist">\n                  ',"\n                </div>"])),(this.profile.submissions||[]).slice(0,5).map((function(e){return t.html(ht||(ht=j(['\n                      <nav-card-item\n                        id="due-','-item"\n                        accent-color="','"\n                        allow-grey\n                        avatar="','"\n                        invert\n                      >\n                        <elmsln-studio-link\n                          id="sub-','"\n                          aria-describedby="sub-','-desc"\n                          slot="label"\n                          href="project/',"?submission=",'"\n                        >\n                          ','\n                        </elmsln-studio-link>\n                        <relative-time\n                          id="sub-','-desc"\n                          slot="description"\n                          datetime="','"\n                        >\n                          ','\n                        </relative-time>\n                      </nav-card-item>\n                      <simple-tooltip for="due-','-item" position="left">\n                        ',"\n                      </simple-tooltip>\n                    "])),e.id,n.isLate(e.assignmentDate,e.date)?"amber":"green",n.isLate(e.assignmentDate,e.date)?"assignment-late":"assignment-turned-in",e.id,e.id,e.portfolioId,e.id,e.assignment,e.id,e.date,n.dateFormat(e.date),e.id,n.isLate(e.assignmentDate,e.date)?"Submitted Late":"Submitted")}))),!this.profile||Object.keys(this.profile).length<1?this.loading("cyan","footer"):t.html(ft||(ft=j([' <div slot="linklist">\n                  ',"\n                </div>"])),(this.profile.feedback||[]).slice(0,5).map((function(e){return t.html(gt||(gt=j(['\n                      <nav-card-item\n                        accent-color="','"\n                        .avatar="','"\n                        .initials="','"\n                      >\n                        <elmsln-studio-link\n                          id="feed-','"\n                          aria-describedby="feed-','-desc"\n                          slot="label"\n                          href="project/',"?submission=","&comment=",'"\n                        >\n                          ',"'s feedback on\n                          ",'\n                        </elmsln-studio-link>\n                        <relative-time\n                          id="feed-','-desc"\n                          slot="description"\n                          datetime="','"\n                        >\n                          ',"\n                        </relative-time>\n                      </nav-card-item>\n                    "])),n.accentColor([e.firstName,e.lastName].join(" ")),e.avatar,[e.firstName,e.lastName].join(" "),e.id,e.id,e.portfolioId,e.submissionId,e.id,[e.firstName,e.lastName].join(" "),e.assignment,e.id,e.date,n.dateFormat(e.date))}))),this.submissions?t.html(bt||(bt=j([' <div slot="linklist">\n                  ',"\n                </div>"])),(this.submissions||[]).map((function(e){return t.html(vt||(vt=j(['\n                      <nav-card-item\n                        accent-color="','"\n                        .avatar="','"\n                        .initials="','"\n                      >\n                        <elmsln-studio-link\n                          id="act-','"\n                          aria-describedby="act-','-desc"\n                          slot="label"\n                          href="','"\n                        >\n                          ','\n                        </elmsln-studio-link>\n                        <relative-time\n                          id="act-','-desc"\n                          slot="description"\n                          datetime="','"\n                        >\n                          ',"\n                        </relative-time>\n                      </nav-card-item>\n                    "])),n.accentColor([e.firstName,e.lastName].join(" ")),e.avatar,[e.firstName,e.lastName].join(" "),e.id,e.id,n.getActivityLink(e),n.getActivityTitle(e),e.id,e.date,n.dateFormat(e.date))}))):this.loading("pink","body"),this.discussion?t.html(yt||(yt=j(['\n                  <div slot="linklist">\n                    ',"\n                  </div>\n                "])),(this.discussion||[]).map((function(e){return t.html(kt||(kt=j(['\n                        <nav-card-item\n                          accent-color="','"\n                          .avatar="','"\n                          .initials="','"\n                        >\n                          <elmsln-studio-link\n                            id="act-','"\n                            aria-describedby="act-','-desc"\n                            slot="label"\n                            href="','"\n                          >\n                            ','\n                          </elmsln-studio-link>\n                          <relative-time\n                            id="act-','-desc"\n                            slot="description"\n                            datetime="','"\n                          >\n                            ',"\n                          </relative-time>\n                        </nav-card-item>\n                      "])),n.accentColor([e.firstName,e.lastName].join(" ")),e.avatar,[e.firstName,e.lastName].join(" "),e.id,e.id,n.getActivityLink(e),n.getActivityTitle(e),e.id,e.date,n.dateFormat(e.date))}))):this.loading("pink","body"))}},{key:"firstUpdated",value:function(n){w(v(i.prototype),"firstUpdated",this)&&w(v(i.prototype),"firstUpdated",this).call(this,n),this.fetchData("profile"),this.fetchData("submissions")}},{key:"profileName",get:function(){return this.profile&&this.profile.firstName&&this.profile.lastName?"".concat(this.profile.firstName," ").concat(this.profile.lastName):""}}],[{key:"tag",get:function(){return"elmsln-studio-dashboard"}},{key:"styles",get:function(){return[].concat(S(w(v(i),"styles",this)),[t.css(xt||(xt=j(['\n        h1,\n        h2,\n        h3,\n        .card [slot="heading"] {\n          margin: 0;\n          color: #9d9d9d;\n          font-weight: normal;\n          font-size: calc(1.5 * var(--elmsln-studio-FontSize, 16px));\n          font-family: var(--elmsln-studio-FontFamily, "Roboto", sans-serif);\n        }\n        h2 {\n          font-weight: bold;\n          color: #989898;\n        }\n        #primary > div {\n          margin: 0;\n        }\n        .card {\n          font-size: var(--elmsln-studio-FontSize, 16px);\n          font-family: var(--elmsln-studio-FontFamily, "Roboto", sans-serif);\n          margin: calc(0.5 * var(--elmsln-studio-margin, 20px)) 0\n            calc(2 * var(--elmsln-studio-margin, 20px));\n          flex: 1 0 50%;\n          color: #95989a;\n          --accent-card-footer-border-color: transparent;\n        }\n        .card [slot="subheading"] {\n          font-weight: bold;\n          border: none;\n          font-size: calc(0.75 * var(--elmsln-studio-FontSize, 16px));\n        }\n        .card.primary [slot="heading"],\n        .card [slot="subheading"] {\n          text-align: center;\n          display: block;\n          margin: 0 auto;\n        }\n        .card.primary [slot="label"] {\n          color: #5c5c5c;\n        }\n        .card.primary [slot="description"] {\n          color: #818181;\n          font-size: calc(0.75 * var(--elmsln-studio-FontSize, 16px));\n        }\n        .card.feed {\n          font-size: calc(0.75 * var(--elmsln-studio-FontSize, 16px));\n          --lrndesign-avatar-width: var(--nav-card-linklist-left-size, 36px);\n          --nav-card-item-avatar-width: var(\n            --nav-card-linklist-left-size,\n            36px\n          );\n          --nav-card-item-avatar-height: var(\n            --nav-card-linklist-left-size,\n            36px\n          );\n        }\n        .card.due,\n        .card.recent {\n          --nav-card-linklist-left-size: 36px;\n          --nav-card-item-avatar-size: 40px;\n        }\n        .card.secondary nav-card {\n          border: none !important;\n        }\n        #profile {\n          --lrndesign-avatar-width: 100px;\n        }\n        #profile lrndesign-avatar {\n          margin: 0 auto;\n          text-align: center;\n        }\n        accent-card {\n          --accent-card-heading-padding-top: 0;\n        }\n        accent-card table {\n          width: 100%;\n          border-collapse: collapse;\n          font-family: var(\n            --elmsln-studio-secondary-FontFamily,\n            "Helvetica Neue",\n            sans-serif\n          );\n        }\n        accent-card th,\n        accent-card td {\n          font-weight: normal;\n          padding: 5px 0;\n          text-align: left;\n          min-height: 25px;\n          border-bottom: 1px solid\n            var(--simple-colors-default-theme-grey-4, #666);\n        }\n        accent-card td {\n          text-align: right;\n        }\n        accent-card th simple-icon-lite {\n          width: 20px;\n          height: 20px;\n        }\n        accent-card.card th elmsln-studio-link {\n          --elmsln-studio-link-TextDecoration: underline !important;\n        }\n        accent-card.card th elmsln-studio-link:focus,\n        accent-card.card th elmsln-studio-link:focus-within,\n        accent-card.card th elmsln-studio-link:hover {\n          --elmsln-studio-link-TextDecoration: none !important;\n        }\n        @media screen and (min-width: 600px) {\n          #profile {\n            --lrndesign-avatar-width: 150px;\n          }\n          #profile lrndesign-avatar {\n            margin: 0 auto;\n          }\n          h1,\n          h2 {\n            flex: 0 0 100%;\n          }\n          #primary > div {\n            display: flex;\n            align-items: stretch;\n            justify-content: space-between;\n            flex-wrap: wrap;\n          }\n          .card.primary {\n            flex: 0 0 calc(50% - var(--elmsln-studio-margin, 20px));\n          }\n        }\n        @media screen and (min-width: 900px) {\n          :host {\n            display: flex;\n            align-items: flex-start;\n            justify-content: space-between;\n          }\n          #profile {\n            --lrndesign-avatar-width: 200px;\n          }\n          #profile lrndesign-avatar {\n            margin: 0 auto;\n          }\n        }\n      '])))])}},{key:"properties",get:function(){return m(m({},w(v(i),"properties",this)),{},{discussion:{type:Array},profile:{type:Object},submissions:{type:Array}})}}]),i}(ln(T(t.LitElement)));customElements.define(St.tag,St);var Ft=function(n){b(i,n);var e=x(i);function i(){var n;return p(this,i),(n=e.call(this)).route="",n.params={},n.query={},n.data={},n.refreshDates={},n}return f(i,[{key:"render",value:function(){var n=this;return t.html(jt||(jt=j(['\n      <div id="studio-nav">\n        <elmsln-studio-link\n          ?active="','"\n          href="','"\n          >Dashboard</elmsln-studio-link\n        >\n        <elmsln-studio-link\n          ?active="','"\n          href="','submissions"\n          >Submissions</elmsln-studio-link\n        >\n        <elmsln-studio-link\n          ?active="','"\n          href="','assignments"\n          >Assignments</elmsln-studio-link\n        >\n        <elmsln-studio-link\n          ?active="','"\n          href="','activity"\n          >Activity Index</elmsln-studio-link\n        >\n      </div>\n      <br />\n      <elmsln-studio-main active-route="','">\n        <elmsln-studio-dashboard\n          ?demo-mode="','"\n          .discussion="','"\n          @fetch-data="','"\n          route="dashboard"\n          .profile="','"\n          .submissions="','"\n        >\n        </elmsln-studio-dashboard>\n        <elmsln-studio-submissions\n          assignment-filter="','"\n          .comments="','"\n          ?demo-mode="','"\n          @fetch-data="','"\n          ?grid="','"\n          route="submissions"\n          project-filter="','"\n          student-filter="','"\n          .submissions="','"\n        >\n        </elmsln-studio-submissions>\n        <elmsln-studio-portfolio\n          comment="','"\n          ?demo-mode="','"\n          .feedback="','"\n          @fetch-data="','"\n          .portfolio="','"\n          route="project"\n          ?sort-latest="','"\n          submission-filter="','"\n          .navigation="','"\n        >\n        </elmsln-studio-portfolio>\n        <elmsln-studio-assignments\n          ?demo-mode="','"\n          @fetch-data="','"\n          .lessons="','"\n          .profile="','"\n          route="assignments"\n        >\n        </elmsln-studio-assignments>\n        <elmsln-studio-assignment\n          .assignment="','"\n          .assignments="','"\n          ?demo-mode="','"\n          @fetch-data="','"\n          route="assignment"\n          .submission="','"\n        >\n        </elmsln-studio-assignment>\n      </elmsln-studio-main>\n    '])),"dashboard"===this.route,this.basePath,"submissions"===this.route||"project"===this.route,this.basePath,"assignments"===this.route||"assignment"===this.route,this.basePath,"activity"===this.route,this.basePath,this.route,this.demoMode,this.recentDiscussions,this._handleFetch,this.profile,this.recentSubmissions,this.query.assignment||"",this.discussion?Object.keys(this.discussion||{}).map((function(t){return n.discussion[t]})):void 0,this.demoMode,this._handleFetch,this.query.grid||!1,this.query.project||"",this.query.student||"",this.completedSubmissions,this.query.comment||"",this.demoMode,this.submissionFeedback,this._handleFetch,this.portfolio,"latest"===this.query.sort,this.query.submission||"",this.prevNextSubmission,this.demoMode,this._handleFetch,this.lessons,this.profile,this.assignment,this.assignments,this.demoMode,this._handleFetch,this.submission)}},{key:"router",value:function(n,t,e,i){console.log(n,t,e,i),this.route=n,this.params=t,this.query=e,this.data=i}},{key:"firstUpdated",value:function(n){w(v(i.prototype),"firstUpdated",this)&&w(v(i.prototype),"firstUpdated",this).call(this,n),this.fetchData(this.usersSource,"users")}},{key:"updated",value:function(n){var t=this;w(v(i.prototype),"updated",this)&&w(v(i.prototype),"updated",this).call(this,n),n.forEach((function(n,e){"route"===e&&(t[e],console.log(t[e]))}))}},{key:"assignment",get:function(){return this.assignments&&this.params.assignment?this.assignments[this.params.assignment]:void 0}},{key:"lesson",get:function(){var n=(this.assignment||{}).lessonId;return this.getLesson(n)}},{key:"project",get:function(){var n=(this.assignment||{}).projectId,t=(this.assignment||{}).lessonId;return this.getProject(t,n)}},{key:"getLesson",value:function(n){return n?this.lessons[n]||{assignments:[]}:void 0}},{key:"getProject",value:function(n,t){var e=this.getLesson(n),i=e&&t?(e.assignments||[]).filter((function(n){return n.id===t})):[];return i?i[0]:void 0}},{key:"feedbackPercentile",get:function(){var n=this.profile&&this.profile.given?this.profile.length:void 0,t=this.profiles?this.profiles.map((function(n){return n.given?n.given.length:void 0})).filter((function(n){return!!n})):void 0;return console.log("feedbackPercentile",n,t),!n||t.length<2?void 0:this.getPercentile(t,n)}},{key:"recentDiscussions",get:function(){var n=this;if(this.discussion){var t=[];return(t=Object.keys(this.discussion||{}).map((function(t){return n.discussion[t]}))).forEach((function(n){return(n.replies||[]).forEach((function(n){return t.push(n)}))})),this.sortDates(t).slice(0,10)}}},{key:"filteredPortfolios",get:function(){var n,t=this,e={},i=function(n){return n?n.replace(/-\w+$/,""):void 0},s=this.params.portfolio?i(this.params.portfolio):void 0,o=this.query.submission?i(this.query.submission):void 0;return s&&this.portfolios?(Object.keys(this.portfolios||{}).forEach((function(a){var l=t.portfolios[a],r=i(a)===s,c=r&&o&&l.userId?"".concat(o,"-").concat(l.userId):void 0;(r||t.portfolios[a].submissions&&c&&t.portfolios[a].submissions.includes(c))&&(e[a]=l,e[a].prev=n,n&&(n.next=e[a]),n=e[a])})),e):void 0}},{key:"recentSubmissions",get:function(){var n=this;return this.completedSubmissions?this.sortDates(Object.keys(this.completedSubmissions||{}).map((function(t){return n.completedSubmissions[t]}))).slice(0,5):void 0}},{key:"completedSubmissions",get:function(){var n=this;return this.submissions?Object.keys(this.submissions||{}).filter((function(t){return!!n.submissions[t].date})).map((function(t){return n.submissions[t]})):void 0}},{key:"peerSubmissions",get:function(){var n=this;return this.completedSubmissions&&this.query.submission?this.completedSubmissions.filter((function(t){return t.assignmentId===n.query.submission.replace(/\-\w+$/,"")})):void 0}},{key:"prevNextSubmission",get:function(){for(var n={},t=0;t<(this.peerSubmissions||[]).length;t++)console.log(this.peerSubmissions[t],this.query.submission),this.peerSubmissions[t].id===this.query.submission&&(n.prev=this.peerSubmissions[t-1]?m(m({},this.peerSubmissions[t-1]),{},{activity:"submission"}):void 0,n.next=this.peerSubmissions[t+1]?m(m({},this.peerSubmissions[t+1]),{},{activity:"submission"}):void 0,t=this.peerSubmissions.length);return console.log("prevNextSubmission",n,n!=={},n!=={}?n:void 0,this.peerSubmissions),n!=={}?n:void 0}},{key:"submission",get:function(){var n=this,t=this.profile&&this.profile.submissions&&this.params.assignment?this.profile.submissions.filter((function(t){return t.assignmentId===n.params.assignment})):void 0;return t&&t[0]?t[0]:void 0}},{key:"portfolio",get:function(){return this.params.portfolio&&this.filteredPortfolios?this.filteredPortfolios[this.params.portfolio]:void 0}},{key:"submissionFeedback",get:function(){var n=this;return console.log("submissionFeedback",this.query.submission,this.query.submission&&this.discussion?Object.keys(this.discussion||{}).filter((function(t){return n.discussion[t].submissionId==n.query.submission})).map((function(t){return n.discussion[t]})):void 0),this.query.submission&&this.discussion?Object.keys(this.discussion||{}).filter((function(t){return n.discussion[t].submissionId==n.query.submission})).map((function(t){return n.discussion[t]})):void 0}},{key:"_filterBy",value:function(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return n&&t&&n["".concat(e).concat(t)]?n["".concat(e).concat(t)]:{}}},{key:"fetchData",value:function(n,t,e){var i=this;fetch(this._getPath(n,e)).then((function(n){return!(!n||!n.json)&&n.json()})).then((function(e){200===e.status&&(i[t]=e.data,i.refreshDates[t]=new Date,console.log("".concat(t," Loaded"),n,e,i[t],i.refreshDates))}))}},{key:"_handleFetch",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{detail:{}},t=n.detail.type,e=n.detail.refresh,i="".concat(t,"Source");!e&&this.refreshDates[t]||this.fetchData(this[i],t)}},{key:"_getPath",value:function(n,t){var e=Object.keys(t||{}).map((function(n){return"".concat(encodeURI(n),"=").concat(encodeURI(t[n]))})).join("&");return e?"".concat(n,"?").concat(e):n}}],[{key:"tag",get:function(){return"elmsln-studio"}},{key:"properties",get:function(){return m(m({},w(v(i),"properties",this)),{},{assignments:{type:Object},assignmentsSource:{type:String,reflect:!0,attribute:"assignments-source"},discussion:{type:Object},discussionSource:{type:String,reflect:!0,attribute:"discussion-source"},lessons:{type:Object},lessonsSource:{type:String,reflect:!0,attribute:"lessons-source"},portfolios:{type:Object},portfoliosSource:{type:String,reflect:!0,attribute:"portfolios-source"},profile:{type:Object},profileSource:{type:String,reflect:!0,attribute:"profile-source"},profiles:{type:Object},profilesSource:{type:String,reflect:!0,attribute:"profiles-source"},sourcePath:{type:String,reflect:!0,attribute:"source-path"},submissions:{type:Object},submissionsSource:{type:String,reflect:!0,attribute:"submissions-source"},users:{type:Object},usersSource:{type:String,reflect:!0,attribute:"users-source"},route:{type:String},params:{type:Object},query:{type:Object},data:{type:Object}})}},{key:"routes",get:function(){return[{name:"assignments",pattern:"assignments"},{name:"assignment",pattern:"assignments/:assignment"},{name:"submissions",pattern:"submissions"},{name:"project",pattern:"project/:portfolio"},{name:"dashboard",pattern:"*",data:{title:"Home"}}]}}]),i}(d.router(ln(T(t.LitElement))));customElements.define(Ft.tag,Ft),n.ElmslnStudio=Ft,Object.defineProperty(n,"__esModule",{value:!0})}));
  