@citolab/qti-components 6.5.0 → 6.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +119 -121
- package/dist/index.cjs +145 -146
- package/dist/index.d.cts +141 -142
- package/dist/index.d.ts +141 -142
- package/dist/index.js +145 -146
- package/dist/qti-components/index.cjs +99 -89
- package/dist/qti-components/index.d.cts +141 -142
- package/dist/qti-components/index.d.ts +141 -142
- package/dist/qti-components/index.js +122 -112
- package/dist/qti-transformers/index.cjs +1 -1
- package/dist/qti-transformers/index.js +1 -1
- package/dist/styles.bundled.css +422 -50
- package/dist/styles.css +7 -50
- package/package.json +6 -9
- package/src/styles/qti-interactions.css +6 -6
package/dist/index.js
CHANGED
|
@@ -1,59 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);this.__definitions.set(t,{ctor:e,observedAttributes:(r=e.observedAttributes)!=null?r:[]})}get(t){let e=this.__definitions.get(t);return e==null?void 0:e.ctor}},qs=As;var Er=new qs;var qe=globalThis,ze=qe.ShadowRoot&&(qe.ShadyCSS===void 0||qe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Tt=Symbol(),_r=new WeakMap,$e=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Tt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(ze&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=_r.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&_r.set(e,t))}return t}toString(){return this.cssText}},Cr=i=>new $e(typeof i=="string"?i:i+"",void 0,Tt),b=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,s,n)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[n+1],i[0]);return new $e(e,i,Tt)},Lt=(i,t)=>{if(ze)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=qe.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},Xe=ze||qe.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return Cr(e)})(i):i;var{is:$s,defineProperty:ws,getOwnPropertyDescriptor:Ss,getOwnPropertyNames:ks,getOwnPropertySymbols:Rs,getPrototypeOf:Ts}=Object,D=globalThis,$r;($r=D.customElements)!=null||(D.customElements=Er);var Ar=D.trustedTypes,Ls=Ar?Ar.emptyScript:"",Mt=D.reactiveElementPolyfillSupport,we=(i,t)=>i,Se={toAttribute(i,t){switch(t){case Boolean:i=i?Ls:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch(r){e=null}}return e}},Ye=(i,t)=>!$s(i,t),qr={attribute:!0,type:String,converter:Se,reflect:!1,hasChanged:Ye},wr,Sr;(wr=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Sr=D.litPropertyMetadata)!=null||(D.litPropertyMetadata=new WeakMap);var kr,X=class extends((kr=globalThis.HTMLElement)!=null?kr:xr){static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=qr){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&ws(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){var o;let{get:s,set:n}=(o=Ss(this.prototype,t))!=null?o:{get(){return this[e]},set(a){this[e]=a}};return{get(){return s==null?void 0:s.call(this)},set(a){let l=s==null?void 0:s.call(this);n.call(this,a),this.requestUpdate(t,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:qr}static _$Ei(){if(this.hasOwnProperty(we("elementProperties")))return;let t=Ts(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(we("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(we("properties"))){let e=this.properties,r=[...ks(e),...Rs(e)];for(let s of r)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let s of r)e.unshift(Xe(s))}else t!==void 0&&e.push(Xe(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,r;((e=this._$ES)!=null?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$ES)==null||e.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return Lt(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EO(t,e){var n;let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let o=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Se).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var n;let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let o=r.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:Se;this._$Em=s,this[s]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,r,s=!1,n){var o;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((o=r.hasChanged)!=null?o:Ye)(s?n:this[t],e))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(t,e,r){var s;this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&((s=this._$Ej)!=null?s:this._$Ej=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,o]of s)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.C(n,this[n],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(r=this._$ES)==null||r.forEach(s=>{var n;return(n=s.hostUpdate)==null?void 0:n.call(s)}),this.update(e)):this._$ET()}catch(s){throw t=!1,this._$ET(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)==null||e.forEach(r=>{var s;return(s=r.hostUpdated)==null?void 0:s.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}},Rr;X.elementStyles=[],X.shadowRootOptions={mode:"open"},X[we("elementProperties")]=new Map,X[we("finalized")]=new Map,Mt==null||Mt({ReactiveElement:X}),((Rr=D.reactiveElementVersions)!=null?Rr:D.reactiveElementVersions=[]).push("2.0.0");var Ms={attribute:!0,type:String,converter:Se,reflect:!1,hasChanged:Ye},Ps=(i=Ms,t,e)=>{let{kind:r,metadata:s}=e,n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),n.set(e.name,i),r==="accessor"){let{name:o}=e;return{set(a){let l=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,l,i)},init(a){return a!==void 0&&this.C(o,void 0,i),a}}}if(r==="setter"){let{name:o}=e;return function(a){let l=this[o];t.call(this,a),this.requestUpdate(o,l,i)}}throw Error("Unsupported decorator location: "+r)};function d(i){return(t,e)=>typeof e=="object"?Ps(i,t,e):((r,s,n)=>{let o=s.hasOwnProperty(n);return s.constructor.createProperty(n,o?k(E({},r),{wrapped:!0}):r),o?Object.getOwnPropertyDescriptor(s,n):void 0})(i,t,e)}function $(i){return d(k(E({},i),{state:!0,attribute:!1}))}var Z=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);function ke(i,t){return(e,r,s)=>{let n=o=>{var a,l;return(l=(a=o.renderRoot)==null?void 0:a.querySelector(i))!=null?l:null};if(t){let{get:o,set:a}=typeof r=="object"?e:s!=null?s:(()=>{let l=Symbol();return{get(){return this[l]},set(u){this[l]=u}}})();return Z(e,r,{get(){if(t){let l=o.call(this);return l===void 0&&(l=n(this),a.call(this,l)),l}return n(this)}})}return Z(e,r,{get(){return n(this)}})}}function Tr(i){return(t,e)=>{let{slot:r,selector:s}=i!=null?i:{},n="slot"+(r?`[name=${r}]`:":not([name])");return Z(t,e,{get(){var l,u;let o=(l=this.renderRoot)==null?void 0:l.querySelector(n),a=(u=o==null?void 0:o.assignedElements(i))!=null?u:[];return s===void 0?a:a.filter(h=>h.matches(s))}})}}var ce=globalThis,We=ce.trustedTypes,Lr=We?We.createPolicy("lit-html",{createHTML:i=>i}):void 0,Vt="$lit$",Y=`lit$${(Math.random()+"").slice(9)}$`,Nt="?"+Y,Hs=`<${Nt}>`,te=ce.document===void 0?{createTreeWalker:()=>({})}:document,Te=()=>te.createComment(""),Le=i=>i===null||typeof i!="object"&&typeof i!="function",Or=Array.isArray,Ur=i=>Or(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Pt=`[
|
|
3
|
-
\f\r]`,
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Hr=/'/g,Vr=/"/g,Ir=/^(?:script|style|textarea|title)$/i,Fr=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),p=Fr(1),Pe=Fr(2),M=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),Nr=new WeakMap,ee=te.createTreeWalker(te,129);function Br(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Lr!==void 0?Lr.createHTML(t):t}var jr=(i,t)=>{let e=i.length-1,r=[],s,n=t===2?"<svg>":"",o=Re;for(let a=0;a<e;a++){let l=i[a],u,h,m=-1,y=0;for(;y<l.length&&(o.lastIndex=y,h=o.exec(l),h!==null);)y=o.lastIndex,o===Re?h[1]==="!--"?o=Mr:h[1]!==void 0?o=Pr:h[2]!==void 0?(Ir.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=Q):h[3]!==void 0&&(o=Q):o===Q?h[0]===">"?(o=s!=null?s:Re,m=-1):h[1]===void 0?m=-2:(m=o.lastIndex-h[2].length,u=h[1],o=h[3]===void 0?Q:h[3]==='"'?Vr:Hr):o===Vr||o===Hr?o=Q:o===Mr||o===Pr?o=Re:(o=Q,s=void 0);let g=o===Q&&i[a+1].startsWith("/>")?" ":"";n+=o===Re?l+Hs:m>=0?(r.push(u),l.slice(0,m)+Vt+l.slice(m)+Y+g):l+Y+(m===-2?a:g)}return[Br(i,n+(i[e]||"<?>")+(t===2?"</svg>":"")),r]},Me=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let n=0,o=0,a=t.length-1,l=this.parts,[u,h]=jr(t,e);if(this.el=i.createElement(u,r),ee.currentNode=this.el.content,e===2){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(s=ee.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let m of s.getAttributeNames())if(m.endsWith(Vt)){let y=h[o++],g=s.getAttribute(m).split(Y),A=/([.?@])?(.*)/.exec(y);l.push({type:1,index:n,name:A[2],strings:g,ctor:A[1]==="."?Je:A[1]==="?"?Ze:A[1]==="@"?Ge:se}),s.removeAttribute(m)}else m.startsWith(Y)&&(l.push({type:6,index:n}),s.removeAttribute(m));if(Ir.test(s.tagName)){let m=s.textContent.split(Y),y=m.length-1;if(y>0){s.textContent=We?We.emptyScript:"";for(let g=0;g<y;g++)s.append(m[g],Te()),ee.nextNode(),l.push({type:2,index:++n});s.append(m[y],Te())}}}else if(s.nodeType===8)if(s.data===Nt)l.push({type:2,index:n});else{let m=-1;for(;(m=s.data.indexOf(Y,m+1))!==-1;)l.push({type:7,index:n}),m+=Y.length-1}n++}}static createElement(t,e){let r=te.createElement("template");return r.innerHTML=t,r}};function re(i,t,e=i,r){var o,a,l;if(t===M)return t;let s=r!==void 0?(o=e._$Co)==null?void 0:o[r]:e._$Cl,n=Le(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==n&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),n===void 0?s=void 0:(s=new n(i),s._$AT(i,e,r)),r!==void 0?((l=e._$Co)!=null?l:e._$Co=[])[r]=s:e._$Cl=s),s!==void 0&&(t=re(i,s._$AS(i,t.values),s,r)),t}var Ke=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var u;let{el:{content:e},parts:r}=this._$AD,s=((u=t==null?void 0:t.creationScope)!=null?u:te).importNode(e,!0);ee.currentNode=s;let n=ee.nextNode(),o=0,a=0,l=r[0];for(;l!==void 0;){if(o===l.index){let h;l.type===2?h=new pe(n,n.nextSibling,this,t):l.type===1?h=new l.ctor(n,l.name,l.strings,this,t):l.type===6&&(h=new Qe(n,this,t)),this._$AV.push(h),l=r[++a]}o!==(l==null?void 0:l.index)&&(n=ee.nextNode(),o++)}return ee.currentNode=te,s}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},pe=class i{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,r,s){var n;this.type=2,this._$AH=x,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=(n=s==null?void 0:s.isConnected)!=null?n:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=re(this,t,e),Le(t)?t===x||t==null||t===""?(this._$AH!==x&&this._$AR(),this._$AH=x):t!==this._$AH&&t!==M&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Ur(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==x&&Le(this._$AH)?this._$AA.nextSibling.data=t:this.$(te.createTextNode(t)),this._$AH=t}g(t){var n;let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Me.createElement(Br(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(e);else{let o=new Ke(s,this),a=o.u(this.options);o.p(e),this.$(a),this._$AH=o}}_$AC(t){let e=Nr.get(t.strings);return e===void 0&&Nr.set(t.strings,e=new Me(t)),e}T(t){Or(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let n of t)s===e.length?e.push(r=new i(this.k(Te()),this.k(Te()),this,this.options)):r=e[s],r._$AI(n),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},se=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,n){this.type=1,this._$AH=x,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=x}_$AI(t,e=this,r,s){let n=this.strings,o=!1;if(n===void 0)t=re(this,t,e,0),o=!Le(t)||t!==this._$AH&&t!==M,o&&(this._$AH=t);else{let a=t,l,u;for(t=n[0],l=0;l<n.length-1;l++)u=re(this,a[r+l],e,l),u===M&&(u=this._$AH[l]),o||(o=!Le(u)||u!==this._$AH[l]),u===x?t=x:t!==x&&(t+=(u!=null?u:"")+n[l+1]),this._$AH[l]=u}o&&!s&&this.j(t)}j(t){t===x?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},Je=class extends se{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===x?void 0:t}},Ze=class extends se{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==x)}},Ge=class extends se{constructor(t,e,r,s,n){super(t,e,r,s,n),this.type=5}_$AI(t,e=this){var o;if((t=(o=re(this,t,e,0))!=null?o:x)===M)return;let r=this._$AH,s=t===x&&r!==x||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==x&&(r===x||s);s&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;typeof this._$AH=="function"?this._$AH.call((r=(e=this.options)==null?void 0:e.host)!=null?r:this.element,t):this._$AH.handleEvent(t)}},Qe=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){re(this,t)}},zr={S:Vt,A:Y,P:Nt,C:1,M:jr,L:Ke,R:Ur,V:re,D:pe,I:se,H:Ze,N:Ge,U:Je,B:Qe},Ht=ce.litHtmlPolyfillSupport,Dr;Ht==null||Ht(Me,pe),((Dr=ce.litHtmlVersions)!=null?Dr:ce.litHtmlVersions=[]).push("3.0.0");var Xr=(i,t,e)=>{var n,o;let r=(n=e==null?void 0:e.renderBefore)!=null?n:t,s=r._$litPart$;if(s===void 0){let a=(o=e==null?void 0:e.renderBefore)!=null?o:null;r._$litPart$=s=new pe(t.insertBefore(Te(),a),a,void 0,e!=null?e:{})}return s._$AI(i),s};var f=class extends X{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let t=super.createRenderRoot();return(r=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Xr(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return M}},Yr;f._$litElement$=!0,f["finalized"]=!0,(Yr=globalThis.litElementHydrateSupport)==null||Yr.call(globalThis,{LitElement:f});var Dt=globalThis.litElementPolyfillSupport;Dt==null||Dt({LitElement:f});var Wr;((Wr=globalThis.litElementVersions)!=null?Wr:globalThis.litElementVersions=[]).push("4.0.0");function w(i,t){let e=E({waitUntilFirstUpdate:!1},t);return(r,s)=>{let{update:n}=r,o=Array.isArray(i)?i:[i];r.update=function(a){o.forEach(l=>{let u=l;if(a.has(u)){let h=a.get(u),m=this[u];h!==m&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[s](h,m)}}),n.call(this,a)}}}var ie=class extends Event{constructor(t,e,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=e,this.subscribe=r!=null?r:!1}};var et=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){let r=e||!Object.is(t,this.o);this.o=t,r&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:r}]of this.subscriptions)e(this.o,r)},t!==void 0&&(this.value=t)}addCallback(t,e,r){if(!r)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});let{disposer:s}=this.subscriptions.get(t);t(this.value,s)}clearCallbacks(){this.subscriptions.clear()}};var Ot=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},de=class extends et{constructor(t,e,r){super(e.context!==void 0?e.initialValue:r),this.onContextRequest=s=>{let n=s.composedPath()[0];s.context===this.context&&n!==this.host&&(s.stopPropagation(),this.addCallback(s.callback,n,s.subscribe))},this.onProviderRequest=s=>{let n=s.composedPath()[0];if(s.context!==this.context||n===this.host)return;let o=new Set;for(let[a,{consumerHost:l}]of this.subscriptions)o.has(a)||(o.add(a),l.dispatchEvent(new ie(this.context,a,!0)));s.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Ot(this.context))}};function Ut({context:i}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new de(this,{context:i}))}),{get(){return t.get.call(this)},set(s){var n;return(n=r.get(this))==null||n.setValue(s),t.set.call(this,s)},init(s){var n;return(n=r.get(this))==null||n.setValue(s),s}};{t.constructor.addInitializer(o=>{r.set(o,new de(o,{context:i}))});let s=Object.getOwnPropertyDescriptor(t,e),n;if(s===void 0){let o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){r.get(this).setValue(a),o.set(this,a)}}}else{let o=s==null?void 0:s.set;n=k(E({},s),{set:function(a){var l;(l=r.get(this))==null||l.setValue(a),o==null||o.call(this,a)}})}return void Object.defineProperty(t,e,n)}}}var Kr="item";var P=class extends f{constructor(){super();this.identifier=void 0;this.adaptive="false";this.timeDependent="false";this._handleDisabledChange=(e,r)=>{this._interactionElements.forEach(s=>s.disabled=r)};this._handleReadonlyChange=(e,r)=>this._interactionElements.forEach(s=>s.readonly=r);this._context={identifier:this.getAttribute("identifier"),variables:[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}]};this._initialContext=k(E({},this.context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",({detail:e})=>{this._context=k(E({},this._context),{variables:[...this._context.variables,e.variable]}),this._initialContext=this._context}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let r=e.detail;this._feedbackElements.push(r),r.checkShowFeedback(r.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:r,countAttempt:s}=e.detail;this.updateResponseVariable(r,"true"),this.processResponse(s)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:r,value:s}=e.detail;this.updateOutcomeVariable(r,s)}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get context(){return E({},this._context)}set variables(e){this._context=k(E({},this.context),{variables:e}),this.context.variables.forEach(r=>{if(r.type==="response"){let s=this._interactionElements.find(n=>n.responseIdentifier===r.identifier);s&&(s.response=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(s=>s.checkShowFeedback(r.identifier))})}firstUpdated(e){super.firstUpdated(e),this._emit("qti-item-first-updated",this)}disconnectedCallback(){super.disconnectedCallback(),this._emit("qti-item-disconnected")}set responses(e){if(e)for(let r of e){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let n=this._interactionElements.find(o=>o.getAttribute("response-identifier")===r.responseIdentifier);n&&(n.response=r.response)}}render(){return p`<slot></slot>`}showCorrectResponse(e){let s=this.context.variables.filter(n=>"correctResponse"in n&&n.correctResponse).map(n=>({responseIdentifier:n.identifier,response:n.correctResponse}));for(let n of s){let o=this._interactionElements.find(a=>a.getAttribute("response-identifier")===n.responseIdentifier);o&&(o.correctResponse=e?n.response:"")}}processResponse(e=!0){var s;let r=this.querySelector("qti-response-processing");return r?r.process?(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+((s=this._context.variables.find(n=>n.identifier==="numAttempts"))==null?void 0:s.value)+1).toString()),this._emit("qti-response-processed"),!0):(console.info("Client side response webcomponents not available"),!1):(console.info("Client side response processing template not available"),!1)}resetResponses(){this._context=this._initialContext}getResponse(e){return this.getVariable(e)}getOutcome(e){return this.getVariable(e)}getVariable(e){return this._context.variables.find(r=>r.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:r,response:s}=e.detail;this.updateResponseVariable(r,s)}updateResponseVariable(e,r){this._context=k(E({},this._context),{variables:this._context.variables.map(s=>s.identifier!==e?s:k(E({},s),{value:r}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:r})}updateOutcomeVariable(e,r){var n;let s=this.getOutcome(e);if(!s){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context=k(E({},this._context),{variables:this._context.variables.map(o=>o.identifier!==e?o:k(E({},o),{value:s.cardinality==="single"?r:[...o.value,r]}))}),this._feedbackElements.forEach(o=>o.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(n=this._context.variables.find(o=>o.identifier===e))==null?void 0:n.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,r=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:r}))}};c([d({type:String})],P.prototype,"title",2),c([d({type:String})],P.prototype,"identifier",2),c([d({type:String})],P.prototype,"adaptive",2),c([d({type:String})],P.prototype,"timeDependent",2),c([d({type:Boolean})],P.prototype,"disabled",2),c([w("disabled",{waitUntilFirstUpdate:!0})],P.prototype,"_handleDisabledChange",2),c([d({type:Boolean})],P.prototype,"readonly",2),c([w("readonly",{waitUntilFirstUpdate:!0})],P.prototype,"_handleReadonlyChange",2),c([Ut({context:Kr}),d({attribute:!1})],P.prototype,"_context",2),P=c([C("qti-assessment-item")],P);var It=class extends f{constructor(){super()}firstUpdated(e){super.firstUpdated(e);let r=this.closest("qti-assessment-item"),s=this.getAttribute("href");if(s!==null){let n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.media="screen",n.href=s,r.appendChild(n),this.styleLink=n}if(this.textContent!==null){let n=document.createElement("style");n.media="screen",n.textContent=this.textContent,r.appendChild(n),this.styleLink=n}}disconnectedCallback(){let e=this.closest("qti-assessment-item");if(this.styleLink&&this.styleLink.parentElement===this)try{e.removeChild(this.styleLink)}catch(r){console.log("could not remove stylesheet")}}};customElements.define("qti-stylesheet",It);var Jr=b`
|
|
1
|
+
var xr=Object.defineProperty,ys=Object.defineProperties,xs=Object.getOwnPropertyDescriptor,Es=Object.getOwnPropertyDescriptors;var vr=Object.getOwnPropertySymbols;var _s=Object.prototype.hasOwnProperty,Cs=Object.prototype.propertyIsEnumerable;var yr=(i,t,e)=>t in i?xr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,x=(i,t)=>{for(var e in t||(t={}))_s.call(t,e)&&yr(i,e,t[e]);if(vr)for(var e of vr(t))Cs.call(t,e)&&yr(i,e,t[e]);return i},R=(i,t)=>ys(i,Es(t));var c=(i,t,e,r)=>{for(var s=r>1?void 0:r?xs(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=(r?o(t,e,s):o(s))||s);return r&&s&&xr(t,e,s),s};var Z=class extends Event{constructor(t,e,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=e,this.subscribe=r!=null?r:!1}};var he=class{constructor(t,e,r,s){var n;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){let o=e;this.context=o.context,this.callback=o.callback,this.subscribe=(n=o.subscribe)!=null?n:!1}else this.context=e,this.callback=r,this.subscribe=s!=null?s:!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Z(this.context,this.t,this.subscribe))}};var We=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){let r=e||!Object.is(t,this.o);this.o=t,r&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:r}]of this.subscriptions)e(this.o,r)},t!==void 0&&(this.value=t)}addCallback(t,e,r){if(!r)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});let{disposer:s}=this.subscriptions.get(t);t(this.value,s)}clearCallbacks(){this.subscriptions.clear()}};var Pt=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},me=class extends We{constructor(t,e,r){super(e.context!==void 0?e.initialValue:r),this.onContextRequest=s=>{let n=s.composedPath()[0];s.context===this.context&&n!==this.host&&(s.stopPropagation(),this.addCallback(s.callback,n,s.subscribe))},this.onProviderRequest=s=>{let n=s.composedPath()[0];if(s.context!==this.context||n===this.host)return;let o=new Set;for(let[a,{consumerHost:l}]of this.subscriptions)o.has(a)||(o.add(a),l.dispatchEvent(new Z(this.context,a,!0)));s.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Pt(this.context))}};function Vt({context:i}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new me(this,{context:i}))}),{get(){return t.get.call(this)},set(s){var n;return(n=r.get(this))==null||n.setValue(s),t.set.call(this,s)},init(s){var n;return(n=r.get(this))==null||n.setValue(s),s}};{t.constructor.addInitializer(o=>{r.set(o,new me(o,{context:i}))});let s=Object.getOwnPropertyDescriptor(t,e),n;if(s===void 0){let o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){r.get(this).setValue(a),o.set(this,a)}}}else{let o=s==null?void 0:s.set;n=R(x({},s),{set:function(a){var l;(l=r.get(this))==null||l.setValue(a),o==null||o.call(this,a)}})}return void Object.defineProperty(t,e,n)}}}function se({context:i,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new he(this,{context:i,callback:s=>{this[r.name]=s},subscribe:t})}):e.constructor.addInitializer(s=>{new he(s,{context:i,callback:n=>{s[r]=n},subscribe:t})})}}var Er=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBraileLabel="",this.ariaBraileRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var _r=new WeakMap,we=i=>{let t=_r.get(i);return t===void 0&&_r.set(i,t=new Map),t},qs=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(we(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){we(this).set(t,String(e))}removeAttribute(t){we(this).delete(t)}hasAttribute(t){return we(this).has(t)}attachShadow(t){let e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let t=new Er(this);return this.__internals=t,t}getAttribute(t){let e=we(this).get(t);return e!=null?e:null}};var $s=class extends qs{},Cr=$s;var ws=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${t}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
|
|
2
|
+
Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);this.__definitions.set(t,{ctor:e,observedAttributes:(r=e.observedAttributes)!=null?r:[]})}get(t){let e=this.__definitions.get(t);return e==null?void 0:e.ctor}},Ss=ws;var Ar=new Ss;var Se=globalThis,Ke=Se.ShadowRoot&&(Se.ShadyCSS===void 0||Se.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ht=Symbol(),qr=new WeakMap,Re=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Ke&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=qr.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&qr.set(e,t))}return t}toString(){return this.cssText}},$r=i=>new Re(typeof i=="string"?i:i+"",void 0,Ht),b=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,s,n)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[n+1],i[0]);return new Re(e,i,Ht)},Nt=(i,t)=>{if(Ke)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=Se.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},Je=Ke||Se.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return $r(e)})(i):i;var{is:Rs,defineProperty:ks,getOwnPropertyDescriptor:Ts,getOwnPropertyNames:Ls,getOwnPropertySymbols:Ms,getPrototypeOf:Ps}=Object,D=globalThis,Rr;(Rr=D.customElements)!=null||(D.customElements=Ar);var wr=D.trustedTypes,Vs=wr?wr.emptyScript:"",Dt=D.reactiveElementPolyfillSupport,ke=(i,t)=>i,Te={toAttribute(i,t){switch(t){case Boolean:i=i?Vs:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch(r){e=null}}return e}},Ze=(i,t)=>!Rs(i,t),Sr={attribute:!0,type:String,converter:Te,reflect:!1,hasChanged:Ze},kr,Tr;(kr=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Tr=D.litPropertyMetadata)!=null||(D.litPropertyMetadata=new WeakMap);var Lr,X=class extends((Lr=globalThis.HTMLElement)!=null?Lr:Cr){static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Sr){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&ks(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){var o;let{get:s,set:n}=(o=Ts(this.prototype,t))!=null?o:{get(){return this[e]},set(a){this[e]=a}};return{get(){return s==null?void 0:s.call(this)},set(a){let l=s==null?void 0:s.call(this);n.call(this,a),this.requestUpdate(t,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:Sr}static _$Ei(){if(this.hasOwnProperty(ke("elementProperties")))return;let t=Ps(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ke("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ke("properties"))){let e=this.properties,r=[...Ls(e),...Ms(e)];for(let s of r)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let s of r)e.unshift(Je(s))}else t!==void 0&&e.push(Je(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,r;((e=this._$ES)!=null?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$ES)==null||e.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return Nt(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EO(t,e){var n;let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let o=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Te).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var n;let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let o=r.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:Te;this._$Em=s,this[s]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,r,s=!1,n){var o;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((o=r.hasChanged)!=null?o:Ze)(s?n:this[t],e))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(t,e,r){var s;this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&((s=this._$Ej)!=null?s:this._$Ej=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,o]of s)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.C(n,this[n],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(r=this._$ES)==null||r.forEach(s=>{var n;return(n=s.hostUpdate)==null?void 0:n.call(s)}),this.update(e)):this._$ET()}catch(s){throw t=!1,this._$ET(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)==null||e.forEach(r=>{var s;return(s=r.hostUpdated)==null?void 0:s.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}},Mr;X.elementStyles=[],X.shadowRootOptions={mode:"open"},X[ke("elementProperties")]=new Map,X[ke("finalized")]=new Map,Dt==null||Dt({ReactiveElement:X}),((Mr=D.reactiveElementVersions)!=null?Mr:D.reactiveElementVersions=[]).push("2.0.0");var fe=globalThis,Ge=fe.trustedTypes,Pr=Ge?Ge.createPolicy("lit-html",{createHTML:i=>i}):void 0,It="$lit$",Y=`lit$${(Math.random()+"").slice(9)}$`,Ft="?"+Y,Hs=`<${Ft}>`,ne=fe.document===void 0?{createTreeWalker:()=>({})}:document,Me=()=>ne.createComment(""),Pe=i=>i===null||typeof i!="object"&&typeof i!="function",Ir=Array.isArray,Fr=i=>Ir(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Ot=`[
|
|
3
|
+
\f\r]`,Le=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vr=/-->/g,Hr=/>/g,ie=RegExp(`>|${Ot}(?:([^\\s"'>=/]+)(${Ot}*=${Ot}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Nr=/'/g,Dr=/"/g,Br=/^(?:script|style|textarea|title)$/i,jr=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=jr(1),He=jr(2),M=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),Or=new WeakMap,oe=ne.createTreeWalker(ne,129);function zr(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Pr!==void 0?Pr.createHTML(t):t}var Xr=(i,t)=>{let e=i.length-1,r=[],s,n=t===2?"<svg>":"",o=Le;for(let a=0;a<e;a++){let l=i[a],u,h,m=-1,y=0;for(;y<l.length&&(o.lastIndex=y,h=o.exec(l),h!==null);)y=o.lastIndex,o===Le?h[1]==="!--"?o=Vr:h[1]!==void 0?o=Hr:h[2]!==void 0?(Br.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=ie):h[3]!==void 0&&(o=ie):o===ie?h[0]===">"?(o=s!=null?s:Le,m=-1):h[1]===void 0?m=-2:(m=o.lastIndex-h[2].length,u=h[1],o=h[3]===void 0?ie:h[3]==='"'?Dr:Nr):o===Dr||o===Nr?o=ie:o===Vr||o===Hr?o=Le:(o=ie,s=void 0);let g=o===ie&&i[a+1].startsWith("/>")?" ":"";n+=o===Le?l+Hs:m>=0?(r.push(u),l.slice(0,m)+It+l.slice(m)+Y+g):l+Y+(m===-2?a:g)}return[zr(i,n+(i[e]||"<?>")+(t===2?"</svg>":"")),r]},Ve=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let n=0,o=0,a=t.length-1,l=this.parts,[u,h]=Xr(t,e);if(this.el=i.createElement(u,r),oe.currentNode=this.el.content,e===2){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(s=oe.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let m of s.getAttributeNames())if(m.endsWith(It)){let y=h[o++],g=s.getAttribute(m).split(Y),q=/([.?@])?(.*)/.exec(y);l.push({type:1,index:n,name:q[2],strings:g,ctor:q[1]==="."?et:q[1]==="?"?tt:q[1]==="@"?rt:le}),s.removeAttribute(m)}else m.startsWith(Y)&&(l.push({type:6,index:n}),s.removeAttribute(m));if(Br.test(s.tagName)){let m=s.textContent.split(Y),y=m.length-1;if(y>0){s.textContent=Ge?Ge.emptyScript:"";for(let g=0;g<y;g++)s.append(m[g],Me()),oe.nextNode(),l.push({type:2,index:++n});s.append(m[y],Me())}}}else if(s.nodeType===8)if(s.data===Ft)l.push({type:2,index:n});else{let m=-1;for(;(m=s.data.indexOf(Y,m+1))!==-1;)l.push({type:7,index:n}),m+=Y.length-1}n++}}static createElement(t,e){let r=ne.createElement("template");return r.innerHTML=t,r}};function ae(i,t,e=i,r){var o,a,l;if(t===M)return t;let s=r!==void 0?(o=e._$Co)==null?void 0:o[r]:e._$Cl,n=Pe(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==n&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),n===void 0?s=void 0:(s=new n(i),s._$AT(i,e,r)),r!==void 0?((l=e._$Co)!=null?l:e._$Co=[])[r]=s:e._$Cl=s),s!==void 0&&(t=ae(i,s._$AS(i,t.values),s,r)),t}var Qe=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var u;let{el:{content:e},parts:r}=this._$AD,s=((u=t==null?void 0:t.creationScope)!=null?u:ne).importNode(e,!0);oe.currentNode=s;let n=oe.nextNode(),o=0,a=0,l=r[0];for(;l!==void 0;){if(o===l.index){let h;l.type===2?h=new be(n,n.nextSibling,this,t):l.type===1?h=new l.ctor(n,l.name,l.strings,this,t):l.type===6&&(h=new st(n,this,t)),this._$AV.push(h),l=r[++a]}o!==(l==null?void 0:l.index)&&(n=oe.nextNode(),o++)}return oe.currentNode=ne,s}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},be=class i{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,r,s){var n;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=(n=s==null?void 0:s.isConnected)!=null?n:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ae(this,t,e),Pe(t)?t===E||t==null||t===""?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==M&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Fr(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==E&&Pe(this._$AH)?this._$AA.nextSibling.data=t:this.$(ne.createTextNode(t)),this._$AH=t}g(t){var n;let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Ve.createElement(zr(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(e);else{let o=new Qe(s,this),a=o.u(this.options);o.p(e),this.$(a),this._$AH=o}}_$AC(t){let e=Or.get(t.strings);return e===void 0&&Or.set(t.strings,e=new Ve(t)),e}T(t){Ir(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let n of t)s===e.length?e.push(r=new i(this.k(Me()),this.k(Me()),this,this.options)):r=e[s],r._$AI(n),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},le=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,n){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=E}_$AI(t,e=this,r,s){let n=this.strings,o=!1;if(n===void 0)t=ae(this,t,e,0),o=!Pe(t)||t!==this._$AH&&t!==M,o&&(this._$AH=t);else{let a=t,l,u;for(t=n[0],l=0;l<n.length-1;l++)u=ae(this,a[r+l],e,l),u===M&&(u=this._$AH[l]),o||(o=!Pe(u)||u!==this._$AH[l]),u===E?t=E:t!==E&&(t+=(u!=null?u:"")+n[l+1]),this._$AH[l]=u}o&&!s&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},et=class extends le{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}},tt=class extends le{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}},rt=class extends le{constructor(t,e,r,s,n){super(t,e,r,s,n),this.type=5}_$AI(t,e=this){var o;if((t=(o=ae(this,t,e,0))!=null?o:E)===M)return;let r=this._$AH,s=t===E&&r!==E||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==E&&(r===E||s);s&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;typeof this._$AH=="function"?this._$AH.call((r=(e=this.options)==null?void 0:e.host)!=null?r:this.element,t):this._$AH.handleEvent(t)}},st=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){ae(this,t)}},Yr={S:It,A:Y,P:Ft,C:1,M:Xr,L:Qe,R:Fr,V:ae,D:be,I:le,H:tt,N:rt,U:et,B:st},Ut=fe.litHtmlPolyfillSupport,Ur;Ut==null||Ut(Ve,be),((Ur=fe.litHtmlVersions)!=null?Ur:fe.litHtmlVersions=[]).push("3.0.0");var Wr=(i,t,e)=>{var n,o;let r=(n=e==null?void 0:e.renderBefore)!=null?n:t,s=r._$litPart$;if(s===void 0){let a=(o=e==null?void 0:e.renderBefore)!=null?o:null;r._$litPart$=s=new be(t.insertBefore(Me(),a),a,void 0,e!=null?e:{})}return s._$AI(i),s};var f=class extends X{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let t=super.createRenderRoot();return(r=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Wr(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return M}},Kr;f._$litElement$=!0,f["finalized"]=!0,(Kr=globalThis.litElementHydrateSupport)==null||Kr.call(globalThis,{LitElement:f});var Bt=globalThis.litElementPolyfillSupport;Bt==null||Bt({LitElement:f});var Jr;((Jr=globalThis.litElementVersions)!=null?Jr:globalThis.litElementVersions=[]).push("4.0.0");var C=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var Ns={attribute:!0,type:String,converter:Te,reflect:!1,hasChanged:Ze},Ds=(i=Ns,t,e)=>{let{kind:r,metadata:s}=e,n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),n.set(e.name,i),r==="accessor"){let{name:o}=e;return{set(a){let l=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,l,i)},init(a){return a!==void 0&&this.C(o,void 0,i),a}}}if(r==="setter"){let{name:o}=e;return function(a){let l=this[o];t.call(this,a),this.requestUpdate(o,l,i)}}throw Error("Unsupported decorator location: "+r)};function p(i){return(t,e)=>typeof e=="object"?Ds(i,t,e):((r,s,n)=>{let o=s.hasOwnProperty(n);return s.constructor.createProperty(n,o?R(x({},r),{wrapped:!0}):r),o?Object.getOwnPropertyDescriptor(s,n):void 0})(i,t,e)}function A(i){return p(R(x({},i),{state:!0,attribute:!1}))}var G=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);function Ne(i,t){return(e,r,s)=>{let n=o=>{var a,l;return(l=(a=o.renderRoot)==null?void 0:a.querySelector(i))!=null?l:null};if(t){let{get:o,set:a}=typeof r=="object"?e:s!=null?s:(()=>{let l=Symbol();return{get(){return this[l]},set(u){this[l]=u}}})();return G(e,r,{get(){if(t){let l=o.call(this);return l===void 0&&(l=n(this),a.call(this,l)),l}return n(this)}})}return G(e,r,{get(){return n(this)}})}}function Zr(i){return(t,e)=>{let{slot:r,selector:s}=i!=null?i:{},n="slot"+(r?`[name=${r}]`:":not([name])");return G(t,e,{get(){var l,u;let o=(l=this.renderRoot)==null?void 0:l.querySelector(n),a=(u=o==null?void 0:o.assignedElements(i))!=null?u:[];return s===void 0?a:a.filter(h=>h.matches(s))}})}}function w(i,t){let e=x({waitUntilFirstUpdate:!1},t);return(r,s)=>{let{update:n}=r,o=Array.isArray(i)?i:[i];r.update=function(a){o.forEach(l=>{let u=l;if(a.has(u)){let h=a.get(u),m=this[u];h!==m&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[s](h,m)}}),n.call(this,a)}}}var Q="item";var P=class extends f{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent="false";this._handleDisabledChange=(e,r)=>{this._interactionElements.forEach(s=>s.disabled=r)};this._handleReadonlyChange=(e,r)=>this._interactionElements.forEach(s=>s.readonly=r);this._context={identifier:this.getAttribute("identifier"),variables:[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}]};this._initialContext=R(x({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",({detail:e})=>{this._context=R(x({},this._context),{variables:[...this._context.variables,e.variable]}),this._initialContext=this._context}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let r=e.detail;this._feedbackElements.push(r),r.checkShowFeedback(r.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:r,countAttempt:s}=e.detail;this.updateResponseVariable(r,"true"),this.processResponse(s)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:r,value:s}=e.detail;this.updateOutcomeVariable(r,s)}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(e=>({identifier:e.identifier,value:e.value,type:e.type}))}set variables(e){if(!Array.isArray(e)||e.some(r=>!("identifier"in r))){console.warn("variables property should be an array of VariableDeclaration");return}this._context=R(x({},this._context),{variables:this._context.variables.map(r=>{let s=e.find(n=>n.identifier===r.identifier);return s?x(x({},r),s):r})}),this._context.variables.forEach(r=>{if(r.type==="response"){let s=this._interactionElements.find(n=>n.responseIdentifier===r.identifier);s&&(s.response=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(s=>s.checkShowFeedback(r.identifier))})}firstUpdated(e){super.firstUpdated(e),this._emit("qti-item-first-updated",this)}disconnectedCallback(){super.disconnectedCallback(),this._emit("qti-item-disconnected")}set responses(e){if(e)for(let r of e){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let n=this._interactionElements.find(o=>o.getAttribute("response-identifier")===r.responseIdentifier);n&&(n.response=r.response)}}render(){return d`<slot></slot>`}showCorrectResponse(e){let s=this._context.variables.filter(n=>"correctResponse"in n&&n.correctResponse).map(n=>({responseIdentifier:n.identifier,response:n.correctResponse}));for(let n of s){let o=this._interactionElements.find(a=>a.getAttribute("response-identifier")===n.responseIdentifier);o&&(o.correctResponse=e?n.response:"")}}processResponse(e=!0){var s;let r=this.querySelector("qti-response-processing");return r?r.process?(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+((s=this._context.variables.find(n=>n.identifier==="numAttempts"))==null?void 0:s.value)+1).toString()),this._emit("qti-response-processed"),!0):(console.info("Client side response webcomponents not available"),!1):(console.info("Client side response processing template not available"),!1)}resetResponses(){this._context=this._initialContext}getResponse(e){return this.getVariable(e)}getOutcome(e){return this.getVariable(e)}getVariable(e){return this._context.variables.find(r=>r.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:r,response:s}=e.detail;this.updateResponseVariable(r,s)}updateResponseVariable(e,r){this._context=R(x({},this._context),{variables:this._context.variables.map(s=>s.identifier!==e?s:R(x({},s),{value:r}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:r})}updateOutcomeVariable(e,r){var n;let s=this.getOutcome(e);if(!s){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context=R(x({},this._context),{variables:this._context.variables.map(o=>o.identifier!==e?o:R(x({},o),{value:s.cardinality==="single"?r:[...o.value,r]}))}),this._feedbackElements.forEach(o=>o.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(n=this._context.variables.find(o=>o.identifier===e))==null?void 0:n.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,r=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:r}))}};c([p({type:String})],P.prototype,"title",2),c([p({type:String})],P.prototype,"identifier",2),c([p({type:String})],P.prototype,"adaptive",2),c([p({type:String})],P.prototype,"timeDependent",2),c([p({type:Boolean})],P.prototype,"disabled",2),c([w("disabled",{waitUntilFirstUpdate:!0})],P.prototype,"_handleDisabledChange",2),c([p({type:Boolean})],P.prototype,"readonly",2),c([w("readonly",{waitUntilFirstUpdate:!0})],P.prototype,"_handleReadonlyChange",2),c([Vt({context:Q}),p({attribute:!1})],P.prototype,"_context",2),P=c([C("qti-assessment-item")],P);var Os=Symbol.for(""),Us=i=>{if((i==null?void 0:i.r)===Os)return i==null?void 0:i._$litStatic$};var Gr=new Map,Qr=i=>(t,...e)=>{let r=e.length,s,n,o=[],a=[],l,u=0,h=!1;for(;u<r;){for(l=t[u];u<r&&(n=e[u],(s=Us(n))!==void 0);)l+=s+t[++u],h=!0;u!==r&&a.push(n),o.push(l),u++}if(u===r&&o.push(t[r]),h){let m=o.join("$$lit$$");(t=Gr.get(m))===void 0&&(o.raw=o,Gr.set(m,t=o)),e=a}return i(t,...e)},es=Qr(d),Yo=Qr(He);var Is={SPACE:32},T=class extends f{constructor(){super(...arguments);this.tabindex=0;this.disabled=!1;this.readonly=!1;this.checked=!1}handleDisabledChange(e,r){r?(this.tabindex=void 0,this.blur()):this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-register-choice",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-loose-choice",{bubbles:!0,cancelable:!1,composed:!0}))}reset(){this.checked=!1,this.disabled=!1}_onKeyUp(e){if(!e.altKey)switch(e.keyCode){case Is.SPACE:e.preventDefault(),this._toggleChecked();break;default:}}_onClick(){this._toggleChecked()}_toggleChecked(){this.disabled||this.readonly||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("qti-choice-element-selected",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier,checked:this.checked}})))}validateAllProps(){return!!this.getAttribute("identifier")}render(){return this.validateAllProps()||console.warn(`Invalid props for ${this.outerHTML}`,"missing identifier"),es` <slot></slot> `}};c([p({type:String})],T.prototype,"identifier",2),c([p({type:Number,reflect:!0})],T.prototype,"tabindex",2),c([p({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:i=>i}})],T.prototype,"disabled",2),c([p({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:i=>i}})],T.prototype,"readonly",2),c([p({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:i=>i}})],T.prototype,"checked",2),c([w("disabled",{waitUntilFirstUpdate:!0})],T.prototype,"handleDisabledChange",1);var ts=b`
|
|
5
5
|
:host {
|
|
6
6
|
display: block;
|
|
7
7
|
}
|
|
8
|
-
`;var
|
|
8
|
+
`;var ge=class extends f{render(){return d`<slot name="qti-rubric-block"></slot><slot></slot>`}};ge.styles=ts,ge=c([C("qti-item-body")],ge);var jt=class extends f{render(){return d`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};customElements.define("qti-prompt",jt);var zt=class extends f{constructor(){super()}firstUpdated(e){super.firstUpdated(e);let r=this.closest("qti-assessment-item"),s=this.getAttribute("href");if(s!==null){let n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.media="screen",n.href=s,r.appendChild(n),this.styleLink=n}if(this.textContent!==null){let n=document.createElement("style");n.media="screen",n.textContent=this.textContent,r.appendChild(n),this.styleLink=n}}disconnectedCallback(){let e=this.closest("qti-assessment-item");if(this.styleLink&&this.styleLink.parentElement===this)try{e.removeChild(this.styleLink)}catch(r){console.log("could not remove stylesheet")}}};customElements.define("qti-stylesheet",zt);var ce=class extends f{render(){return d`<slot></slot>`}defaultValues(t){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let r=e.map(s=>s.innerHTML);return r.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?r:r[0]}};customElements.define("qti-variabledeclaration",ce);var ee=class extends ce{render(){var r,s;let e=(s=(r=this.itemContext)==null?void 0:r.variables.find(n=>n.identifier===this.identifier))==null?void 0:s.value;return d`${JSON.stringify(e,null,2)}`}get interpolationTable(){let e=this.querySelector("qti-interpolation-table");if(e){let r=new Map;for(let s of e.querySelectorAll("qti-interpolation-table-entry")){!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let n=parseInt(s.getAttribute("source-value")),o=parseInt(s.getAttribute("target-value"));(isNaN(n)||isNaN(o))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),r.set(n,o)}return r}return null}connectedCallback(){super.connectedCallback();let e={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};ee.styles=[b`
|
|
9
|
+
:host {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
`],c([p({type:String,attribute:"base-type"})],ee.prototype,"baseType",2),c([p({type:String})],ee.prototype,"identifier",2),c([p({type:String})],ee.prototype,"cardinality",2),c([se({context:Q,subscribe:!0}),A()],ee.prototype,"itemContext",2);customElements.define("qti-outcome-declaration",ee);var te=class extends ce{render(){var r,s;let e=(s=(r=this.itemContext)==null?void 0:r.variables.find(n=>n.identifier===this.identifier))==null?void 0:s.value;return d`${JSON.stringify(e,null,2)}`}connectedCallback(){super.connectedCallback();let e={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}get correctResponse(){let e,r=this.querySelector("qti-correct-response");if(r){let s=r.querySelectorAll("qti-value");if(this.cardinality==="single"&&s.length>0)e=s[0].textContent,s[0].remove();else if(this.cardinality!=="single"){e=[];for(let n=0;n<s.length;n++)e.push(s[n].textContent),s[n].remove()}}return e}get mapping(){return this.querySelector("qti-mapping")}};te.styles=[b`
|
|
13
|
+
:host {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
`],c([p({type:String,attribute:"base-type"})],te.prototype,"baseType",2),c([p({type:String})],te.prototype,"identifier",2),c([p({type:String})],te.prototype,"cardinality",2),c([se({context:Q,subscribe:!0}),A()],te.prototype,"itemContext",2);customElements.define("qti-response-declaration",te);var it=class extends f{};it=c([C("qti-companion-materials-info")],it);var ot=class extends f{render(){return d`<slot></slot>`}};ot=c([C("qti-content-body")],ot);var I=class extends f{handleclassNamesChange(e,r){this.classNames.split(" ").forEach(n=>{switch(n){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return d`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};I.styles=b`
|
|
17
|
+
:host {
|
|
18
|
+
display: block;
|
|
19
|
+
}
|
|
20
|
+
`,c([p({type:String})],I.prototype,"id",2),c([p({type:String})],I.prototype,"use",2),c([p({type:String})],I.prototype,"view",2),c([p({type:String,attribute:"class"})],I.prototype,"classNames",2),c([w("classNames",{waitUntilFirstUpdate:!0})],I.prototype,"handleclassNamesChange",1),I=c([C("qti-rubric-block")],I);var Fs=()=>new Intl.NumberFormat().format(.1).replace(/\d/g,""),De=i=>{if(typeof i=="string")return i;let t=Fs();return t==="."?i.toLocaleString():i.toString().replace(".","").replace(t,".")};function Xt(i){return i==null}var V=class extends f{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(e){let r=this.closest("qti-assessment-item").getOutcome(e);if(this.outcomeIdentifier!==e||!r)return;let s=!1;Array.isArray(r.value)?s=r.value.includes(this.identifier):s=!Xt(this.identifier)&&!Xt(r==null?void 0:r.value)&&this.identifier===r.value||!1,this.showFeedback(s)}showFeedback(e){this.showStatus=e&&this.showHide==="show"||!e&&this.showHide==="hide"?"on":"off"}};c([p({type:String,attribute:"show-hide"})],V.prototype,"showHide",2),c([p({type:String,attribute:"outcome-identifier"})],V.prototype,"outcomeIdentifier",2),c([p({type:String})],V.prototype,"identifier",2),c([p({type:String,attribute:!1})],V.prototype,"showStatus",2);var nt=class extends V{render(){return d` <slot part="feedback" class="feedback ${this.showStatus}"></slot> `}firstUpdated(t){this.checkShowFeedback(this.outcomeIdentifier)}};nt.styles=b`
|
|
9
21
|
:host {
|
|
10
22
|
display: block;
|
|
11
23
|
}
|
|
12
|
-
`,c([d({type:String})],I.prototype,"id",2),c([d({type:String})],I.prototype,"use",2),c([d({type:String})],I.prototype,"view",2),c([d({type:String,attribute:"class"})],I.prototype,"classNames",2),c([w("classNames",{waitUntilFirstUpdate:!0})],I.prototype,"handleclassNamesChange",1),I=c([C("qti-rubric-block")],I);var rt=class extends f{render(){return p`<slot></slot>`}};rt=c([C("qti-content-body")],rt);var Is=()=>new Intl.NumberFormat().format(.1).replace(/\d/g,""),He=i=>{if(typeof i=="string")return i;let t=Is();return t==="."?i.toLocaleString():i.toString().replace(".","").replace(t,".")};function Bt(i){return i==null}var H=class extends f{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(e){let r=this.closest("qti-assessment-item").getOutcome(e);if(this.outcomeIdentifier!==e||!r)return;let s=!1;Array.isArray(r.value)?s=r.value.includes(this.identifier):s=!Bt(this.identifier)&&!Bt(r==null?void 0:r.value)&&this.identifier===r.value||!1,this.showFeedback(s)}showFeedback(e){this.showStatus=e&&this.showHide==="show"||!e&&this.showHide==="hide"?"on":"off"}};c([d({type:String,attribute:"show-hide"})],H.prototype,"showHide",2),c([d({type:String,attribute:"outcome-identifier"})],H.prototype,"outcomeIdentifier",2),c([d({type:String})],H.prototype,"identifier",2),c([d({type:String,attribute:!1})],H.prototype,"showStatus",2);var st=class extends H{constructor(){super(...arguments);this.render=()=>p` <slot part="feedback" class="${this.showStatus}"></slot> `}};st.styles=b`
|
|
13
24
|
.on {
|
|
14
|
-
display:
|
|
25
|
+
display: block;
|
|
15
26
|
}
|
|
16
27
|
.off {
|
|
17
28
|
display: none;
|
|
18
29
|
}
|
|
19
|
-
`;customElements.define("qti-feedback-
|
|
30
|
+
`;customElements.define("qti-feedback-block",nt);var at=class extends V{constructor(){super(...arguments);this.render=()=>d` <slot part="feedback" class="${this.showStatus}"></slot> `}};at.styles=b`
|
|
20
31
|
.on {
|
|
21
32
|
display: inline-block;
|
|
22
33
|
}
|
|
23
34
|
.off {
|
|
24
35
|
display: none;
|
|
25
36
|
}
|
|
26
|
-
`;customElements.define("qti-
|
|
27
|
-
:host {
|
|
28
|
-
display: block;
|
|
29
|
-
}
|
|
37
|
+
`;customElements.define("qti-feedback-inline",at);var lt=class extends V{constructor(){super(...arguments);this.render=()=>d` <slot part="feedback" class="${this.showStatus}"></slot> `}};lt.styles=b`
|
|
30
38
|
.on {
|
|
31
|
-
display: block;
|
|
39
|
+
display: inline-block;
|
|
32
40
|
}
|
|
33
41
|
.off {
|
|
34
42
|
display: none;
|
|
35
43
|
}
|
|
36
|
-
`;customElements.define("qti-feedback
|
|
37
|
-
:host {
|
|
38
|
-
display: inline-flex;
|
|
39
|
-
}
|
|
40
|
-
`]}render(){return p`
|
|
41
|
-
<input
|
|
42
|
-
part="input"
|
|
43
|
-
spellcheck="false"
|
|
44
|
-
autocomplete="off"
|
|
45
|
-
@keydown="${e=>e.stopImmediatePropagation()}"
|
|
46
|
-
@keyup="${this.textChanged}"
|
|
47
|
-
@change="${this.textChanged}"
|
|
48
|
-
type="${this.patternMask=="[0-9]*"?"number":"text"}"
|
|
49
|
-
placeholder="${F(this.placeholderText?this.placeholderText:void 0)}"
|
|
50
|
-
.value="${this._value}"
|
|
51
|
-
size="${this._size}"
|
|
52
|
-
pattern="${F(this.patternMask?this.patternMask:void 0)}"
|
|
53
|
-
?disabled="${this.disabled}"
|
|
54
|
-
?readonly="${this.readonly}"
|
|
55
|
-
/>
|
|
56
|
-
`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};c([d({type:Number,attribute:"expected-length"})],U.prototype,"expectedLength",2),c([d({type:String,attribute:"pattern-mask"})],U.prototype,"patternMask",2),c([d({type:String,attribute:"placeholder-text"})],U.prototype,"placeholderText",2),c([$()],U.prototype,"_value",2),c([$()],U.prototype,"_size",2),c([d({type:String,attribute:"class"})],U.prototype,"classNames",2),c([w("classNames")],U.prototype,"handleclassNamesChange",1),U=c([C("qti-text-entry-interaction")],U);var B=class extends q{constructor(){super(...arguments);this.textareaRef=ct();this._value=""}handleclassNamesChange(e,r){this.classNames.split(" ").forEach(n=>{if(n.startsWith("qti-height-lines")){let o=n.replace("qti-height-lines-","");this.textareaRef&&(this.textareaRef.value.rows=parseInt(o))}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
|
|
44
|
+
`;customElements.define("qti-modal-feedback",lt);var F=i=>i!=null?i:E;var $=class extends f{constructor(){super(...arguments);this.responseIdentifier="";this.disabled=!1;this.readonly=!1}set correctResponse(e){console.warn("correctResponse is not implemented")}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:e}}))}};c([p({attribute:"response-identifier"})],$.prototype,"responseIdentifier",2),c([p({reflect:!0,type:Boolean})],$.prototype,"disabled",2),c([p({reflect:!0,type:Boolean})],$.prototype,"readonly",2);var{D:Bs}=Yr;var ss=i=>i.strings===void 0,rs=()=>document.createComment(""),ve=(i,t,e)=>{var n;let r=i._$AA.parentNode,s=t===void 0?i._$AB:t._$AA;if(e===void 0){let o=r.insertBefore(rs(),s),a=r.insertBefore(rs(),s);e=new Bs(o,a,i,i.options)}else{let o=e._$AB.nextSibling,a=e._$AM,l=a!==i;if(l){let u;(n=e._$AQ)==null||n.call(e,i),e._$AM=i,e._$AP!==void 0&&(u=i._$AU)!==a._$AU&&e._$AP(u)}if(o!==s||l){let u=e._$AA;for(;u!==o;){let h=u.nextSibling;r.insertBefore(u,s),u=h}}}return e},re=(i,t,e=i)=>(i._$AI(t,e),i),js={},is=(i,t=js)=>i._$AH=t,os=i=>i._$AH,ct=i=>{var r;(r=i._$AP)==null||r.call(i,!1,!0);let t=i._$AA,e=i._$AB.nextSibling;for(;t!==e;){let s=t.nextSibling;t.remove(),t=s}};var W={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},K=i=>(...t)=>({_$litDirective$:i,values:t}),O=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var Oe=(i,t)=>{var r;let e=i._$AN;if(e===void 0)return!1;for(let s of e)(r=s._$AO)==null||r.call(s,t,!1),Oe(s,t);return!0},pt=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},ns=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),Ys(t)}};function zs(i){this._$AN!==void 0?(pt(this),this._$AM=i,ns(this)):this._$AM=i}function Xs(i,t=!1,e=0){let r=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(r))for(let n=e;n<r.length;n++)Oe(r[n],!1),pt(r[n]);else r!=null&&(Oe(r,!1),pt(r));else Oe(this,i)}var Ys=i=>{var t,e;i.type==W.CHILD&&((t=i._$AP)!=null||(i._$AP=Xs),(e=i._$AQ)!=null||(i._$AQ=zs))},dt=class extends O{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),ns(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,s;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(s=this.disconnected)==null||s.call(this)),e&&(Oe(this,t),pt(this))}setValue(t){if(ss(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var ut=()=>new Wt,Wt=class{},Yt=new WeakMap,as=K(class extends dt{render(i){return E}update(i,[t]){var r;let e=t!==this.G;return e&&this.G!==void 0&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=t,this.ct=(r=i.options)==null?void 0:r.host,this.ot(this.lt=i.element)),E}ot(i){var t;if(typeof this.G=="function"){let e=(t=this.ct)!=null?t:globalThis,r=Yt.get(e);r===void 0&&(r=new WeakMap,Yt.set(e,r)),r.get(this.G)!==void 0&&this.G.call(this.ct,void 0),r.set(this.G,i),i!==void 0&&this.G.call(this.ct,i)}else this.G.value=i}get rt(){var i,t,e;return typeof this.G=="function"?(t=Yt.get((i=this.ct)!=null?i:globalThis))==null?void 0:t.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var B=class extends ${constructor(){super(...arguments);this.textareaRef=ut();this._value=""}handleclassNamesChange(e,r){this.classNames.split(" ").forEach(n=>{if(n.startsWith("qti-height-lines")){let o=n.replace("qti-height-lines-","");this.textareaRef&&(this.textareaRef.value.rows=parseInt(o))}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
|
|
57
45
|
/* PK: display host as block, else design will be collapsed */
|
|
58
46
|
:host {
|
|
59
47
|
display: block;
|
|
@@ -64,9 +52,9 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
64
52
|
height: 100%;
|
|
65
53
|
border: 0;
|
|
66
54
|
}
|
|
67
|
-
`]}render(){return
|
|
55
|
+
`]}render(){return d`<textarea
|
|
68
56
|
part="textarea"
|
|
69
|
-
${
|
|
57
|
+
${as(this.textareaRef)}
|
|
70
58
|
spellcheck="false"
|
|
71
59
|
autocomplete="off"
|
|
72
60
|
@keydown="${e=>e.stopImmediatePropagation()}"
|
|
@@ -78,25 +66,45 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
78
66
|
?disabled="${this.disabled}"
|
|
79
67
|
?readonly="${this.readonly}"
|
|
80
68
|
.value=${this._value}
|
|
81
|
-
></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};c([
|
|
69
|
+
></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};c([p({type:Number,attribute:"expected-length"})],B.prototype,"expectedLength",2),c([p({type:String,attribute:"pattern-mask"})],B.prototype,"patternMask",2),c([p({type:String,attribute:"placeholder-text"})],B.prototype,"placeholderText",2),c([A()],B.prototype,"_value",2),c([p({type:String,attribute:"class"})],B.prototype,"classNames",2),c([w("classNames",{waitUntilFirstUpdate:!0})],B.prototype,"handleclassNamesChange",1),B=c([C("qti-extended-text-interaction")],B);function ls(i,t){let e,r=x({},t);return(s,n)=>{let{connectedCallback:o,disconnectedCallback:a}=s;s.connectedCallback=function(){var h;o.call(this);let l=m=>{let y=Array.from(this.querySelectorAll(i));for(let g of m){let q=Array.from(g.addedNodes).map(S=>S),_=Array.from(g.addedNodes).map(S=>S);g.type==="childList"&&q.find(S=>y.includes(S))&&this[n](q,_)}};e=new MutationObserver(l),e.observe(this,{childList:!0,subtree:!0});let u=(h=this.querySelectorAll(i))!=null?h:[];this[n](Array.from(u),[])},s.disconnectedCallback=function(){a.call(this),e.disconnect()}}}var U=class extends ${constructor(){super(...arguments);this._value="";this._size=5;this.inputRef=ut()}handleclassNamesChange(e,r){r.split(" ").forEach(n=>{if(n.startsWith("qti-input-width")){let o=n.replace("qti-input-width-","");this._size=parseInt(o)}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
|
|
70
|
+
:host {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
}
|
|
73
|
+
`]}render(){return d`
|
|
74
|
+
<input
|
|
75
|
+
part="input"
|
|
76
|
+
spellcheck="false"
|
|
77
|
+
autocomplete="off"
|
|
78
|
+
@keydown="${e=>e.stopImmediatePropagation()}"
|
|
79
|
+
@keyup="${this.textChanged}"
|
|
80
|
+
@change="${this.textChanged}"
|
|
81
|
+
type="${this.patternMask=="[0-9]*"?"number":"text"}"
|
|
82
|
+
placeholder="${F(this.placeholderText?this.placeholderText:void 0)}"
|
|
83
|
+
.value="${this._value}"
|
|
84
|
+
size="${this._size}"
|
|
85
|
+
pattern="${F(this.patternMask?this.patternMask:void 0)}"
|
|
86
|
+
?disabled="${this.disabled}"
|
|
87
|
+
?readonly="${this.readonly}"
|
|
88
|
+
/>
|
|
89
|
+
`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};c([p({type:Number,attribute:"expected-length"})],U.prototype,"expectedLength",2),c([p({type:String,attribute:"pattern-mask"})],U.prototype,"patternMask",2),c([p({type:String,attribute:"placeholder-text"})],U.prototype,"placeholderText",2),c([A()],U.prototype,"_value",2),c([A()],U.prototype,"_size",2),c([p({type:String,attribute:"class"})],U.prototype,"classNames",2),c([w("classNames")],U.prototype,"handleclassNamesChange",1),U=c([C("qti-text-entry-interaction")],U);var k=class extends ${constructor(){super();this._choiceElements=[];this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(e,r)=>this._choiceElements.forEach(s=>s.disabled=r);this._handleReadonlyChange=(e,r)=>this._choiceElements.forEach(s=>s.readonly=r);this._handleMaxChoicesChange=()=>this._determineInputType();this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-loose-choice",this._looseChoiceElement)}validate(){return this._choiceElements.reduce((r,s)=>r+(s.checked?1:0),0)>=this.minChoices}set response(e){let r=Array.isArray(e)?e:[e];this._choiceElements.forEach(s=>{s.checked=!!r.find(n=>n===s.identifier)})}set correctResponse(e){let r=Array.isArray(e)?e:[e];if(e==""){this._choiceElements.forEach(s=>{s.removeAttribute("data-correct-response")});return}this._choiceElements.forEach(s=>{s.setAttribute("data-correct-response",r.find(n=>n===s.identifier)?"true":"false")})}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.removeEventListener("qti-register-choice",this._registerChoiceElement)}_registerChoiceElement(e){e.stopPropagation();let r=e.target;this._choiceElements.push(r),this._setInputType(r)}_looseChoiceElement(e){e.stopPropagation();let r=e.target;this._choiceElements.push(r),this._choiceElements=this._choiceElements.filter(s=>s!==r)}_determineInputType(){this._choiceElements.forEach(e=>{this._setInputType(e)})}_setInputType(e){this.maxChoices===1?e.setAttribute("role","radio"):e.setAttribute("role","checkbox")}_choiceElementSelectedHandler(e){this.maxChoices===1&&this._choiceElements.filter(r=>r.identifier!==e.detail.identifier).forEach(r=>{r.checked=!1}),this._choiceElementSelected()}_choiceElementSelected(){let e=this._choiceElements.filter(s=>s.checked).map(s=>s.identifier);this.maxChoices>1&&(this.maxChoices===e.length?this._choiceElements.forEach(s=>s.disabled=!s.checked):this._choiceElements.forEach(s=>s.disabled=!1));let r;this.maxChoices===1?r=e.length>0?e[0]:void 0:r=e,this.saveResponse(r)}};c([p({type:Number,attribute:"min-choices"})],k.prototype,"minChoices",2),c([p({type:Number,attribute:"max-choices"})],k.prototype,"maxChoices",2),c([w("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"_handleDisabledChange",2),c([w("readonly",{waitUntilFirstUpdate:!0})],k.prototype,"_handleReadonlyChange",2),c([w("maxChoices",{waitUntilFirstUpdate:!0})],k.prototype,"_handleMaxChoicesChange",2);var Kt=class extends k{constructor(){super(...arguments);this.render=()=>d`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};customElements.define("qti-hottext-interaction",Kt);var Ue=class extends O{constructor(t){if(super(t),this.et=E,t.type!==W.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===E||t==null)return this.vt=void 0,this.et=t;if(t===M)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;let e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}};Ue.directiveName="unsafeHTML",Ue.resultType=1;var ye=K(Ue);var pe=class extends ${constructor(){super(...arguments);this.options=[];this.correctOption="";this.dataPrompt="select"}static get styles(){return[b`
|
|
82
90
|
:host {
|
|
83
91
|
display: inline-block;
|
|
84
92
|
}
|
|
85
|
-
`]}render(){return
|
|
93
|
+
`]}render(){return d`
|
|
86
94
|
<select part="select" @change="${this.choiceSelected}" ?disabled="${this.disabled}" ?readonly="${this.readonly}">
|
|
87
|
-
${this.options.map(e=>
|
|
88
|
-
<option value="${e.value}" ?selected="${e.selected}">${
|
|
95
|
+
${this.options.map(e=>d`
|
|
96
|
+
<option value="${e.value}" ?selected="${e.selected}">${ye(e.textContent)}</option>
|
|
89
97
|
`)}
|
|
90
98
|
</select>
|
|
91
99
|
|
|
92
|
-
${
|
|
93
|
-
`}firstUpdated(e){super.firstUpdated(e),this.addEventListener("on-dropdown-selected",this.choiceSelected);let r=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...r.map(s=>({textContent:s.innerHTML,value:s.getAttribute("identifier"),selected:!1}))]}validate(){let e=this.options.find(r=>r.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,r)=>
|
|
100
|
+
${ye(this.correctOption)}
|
|
101
|
+
`}firstUpdated(e){super.firstUpdated(e),this.addEventListener("on-dropdown-selected",this.choiceSelected);let r=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...r.map(s=>({textContent:s.innerHTML,value:s.getAttribute("identifier"),selected:!1}))]}validate(){let e=this.options.find(r=>r.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,r)=>R(x({},e),{selected:r===0}))}set response(e){this.options=this.options.map(r=>(e===r.value&&(r.selected=!0),r))}set correctResponse(e){if(e===""){this.correctOption="";return}console.log("correctResponse",e),this.correctOption=`<span part="correct-option">${this.options.find(r=>e===r.value).textContent}</span>`}choiceSelected(e){let r=e.target.value;this.options=this.options.map(s=>R(x({},s),{selected:s.value===r})),this.saveResponse(r)}};pe.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],c([A()],pe.prototype,"options",2),c([A()],pe.prototype,"correctOption",2),c([p({attribute:"data-prompt",type:String})],pe.prototype,"dataPrompt",2);customElements.define("qti-inline-choice-interaction",pe);var cs=b`
|
|
94
102
|
:host {
|
|
95
103
|
display: flex;
|
|
96
104
|
flex-direction: column;
|
|
97
105
|
// align-items: flex-start;
|
|
98
106
|
}
|
|
99
|
-
`;var
|
|
107
|
+
`;var xe=class extends k{render(){return d` <slot name="prompt"></slot><slot part="slot"></slot>`}};xe.styles=cs,c([p({type:String})],xe.prototype,"orientation",2),xe=c([C("qti-choice-interaction")],xe);var ps=`<qti-response-processing>
|
|
100
108
|
<qti-response-condition>
|
|
101
109
|
<qti-response-if>
|
|
102
110
|
<qti-match>
|
|
@@ -113,7 +121,7 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
113
121
|
</qti-set-outcome-value>
|
|
114
122
|
</qti-response-else>
|
|
115
123
|
</qti-response-condition>
|
|
116
|
-
</qti-response-processing>`,
|
|
124
|
+
</qti-response-processing>`,ds=`<qti-response-processing>
|
|
117
125
|
<qti-response-condition>
|
|
118
126
|
<qti-response-if>
|
|
119
127
|
<qti-is-null>
|
|
@@ -129,7 +137,7 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
129
137
|
</qti-set-outcome-value>
|
|
130
138
|
</qti-response-else>
|
|
131
139
|
</qti-response-condition>
|
|
132
|
-
</qti-response-processing>`,
|
|
140
|
+
</qti-response-processing>`,us=`<qti-response-processing>
|
|
133
141
|
<qti-response-condition>
|
|
134
142
|
<qti-response-if>
|
|
135
143
|
<qti-is-null>
|
|
@@ -145,29 +153,20 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
145
153
|
</qti-set-outcome-value>
|
|
146
154
|
</qti-response-else>
|
|
147
155
|
</qti-response-condition>
|
|
148
|
-
</qti-response-processing>`;var
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
display:
|
|
152
|
-
}
|
|
153
|
-
[role='alert'] {
|
|
154
|
-
border: 1px solid red;
|
|
155
|
-
background: pink;
|
|
156
|
-
color: red;
|
|
157
|
-
padding: 0.5rem 0.25rem;
|
|
158
|
-
font-size: small;
|
|
159
|
-
border-radius: 5px;
|
|
160
|
-
margin-bottom: 3px;
|
|
156
|
+
</qti-response-processing>`;var Ee=class extends f{render(){return d`<slot></slot>`}static get observedAttributes(){return["identifier"]}process(){let t=[...this.children];for(let e of t)e.process()}firstUpdated(t){if(this.getAttribute("template")){let e=this.getAttribute("template").split("/"),r=e[e.length-1].replace(".xml","");switch(this.innerHTML="",r){case"map_response":{this.appendChild(this.fragmentFromString(ds).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(us).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(ps).firstElementChild.firstElementChild);break}}}fragmentFromString(t){return document.createRange().createContextualFragment(t)}};Ee=c([C("qti-response-processing")],Ee);var j=class extends f{render(){return d`<slot></slot>`}process(){throw new Error("Not implemented")}};j=c([C("qti-rule")],j);var ht=class extends j{get childExpression(){return this.firstElementChild}process(){let e=this.getAttribute("identifier"),r=this.closest("qti-assessment-item").getVariable(e),s;return r.interpolationTable&&(s=r.interpolationTable.get(parseInt(this.childExpression.calculate()))),s?(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:De(s)}})),s):(console.warn("lookupOutcomeValue: value is null or undefined"),0)}};c([p({type:String})],ht.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",ht);var Jt=class extends j{render(){return d`<slot></slot>`}process(){let t=[...this.children];for(let e=0;e<t.length;e++){let r=t[e];if(r.calculate()){r.process();return}}}};customElements.define("qti-response-condition",Jt);var Zt=class extends j{process(){let t=this.getAttribute("identifier"),e=this.firstElementChild,r=e?e.calculate():null;if(r==null){console.warn("setOutcomeValue: value is null or undefined");return}this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(r)?r.map(s=>De(s)):De(r)}}))}};customElements.define("qti-set-outcome-value",Zt);var Ie=class extends f{render(){return d`<slot></slot>`}calculate(){return!0}getSubRules(){return[...this.children]}process(){let t=this.getSubRules();for(let e=0;e<t.length;e++)t[e].process()}};customElements.define("qti-response-else",Ie);var Fe=class extends Ie{calculate(){return this.firstElementChild.calculate()}getSubRules(){let t=[];for(let e=1;e<this.children.length;e++)t.push(this.children[e]);return t}};customElements.define("qti-response-if",Fe);var Gt=class extends Fe{render(){return d`${super.render()}`}};customElements.define("qti-response-else-if",Gt);var v=class extends f{constructor(){super(...arguments);this.getVariables=()=>Array.from(this.children).map(e=>{switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent,cardinality:"single"};case"qti-variable":{let r=e.getAttribute("identifier")||"";return this.assessmentItem.getVariable(r)}case"qti-multiple":{let s=e.getResult();return s.length>0?{identifier:"",baseType:s[0].baseType,value:s.map(n=>n.value),cardinality:"multiple",type:"response"}:null}case"qti-correct":{let r=e.getAttribute("identifier")||"",s=this.assessmentItem.getResponse(r);return{baseType:s.baseType,value:s.correctResponse,cardinality:s.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(r){console.warn("default not sufficient")}return null}}}).filter(e=>e!==null)}render(){return d`<pre>${JSON.stringify(this.result,null,2)}</pre>
|
|
157
|
+
<slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}get assessmentItem(){return this.closest("qti-assessment-item")}};v.styles=b`
|
|
158
|
+
slot {
|
|
159
|
+
display: none;
|
|
161
160
|
}
|
|
162
|
-
`,c([$()],v.prototype,"_result",2),c([$()],v.prototype,"error",1);var V=class extends v{calculate(){throw new Error("Not implemented")}};var dt=class extends Ys(V){calculate(){return this.calculateChildren(Array.from(this.children))}};function Ys(i){return class extends i{calculateChildren(e){return e.map(s=>{let n=s;if(!n.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let o=n.calculate();if(typeof o=="string")if(o==="true")o=!0;else if(o==="false")o=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return o}).every(s=>typeof s=="boolean"&&s)}}}customElements.define("qti-and",dt);var ut=class extends v{constructor(){super(...arguments);this.baseType="string"}calculate(){return this.textContent}};c([d({type:String,attribute:"base-type"})],ut.prototype,"baseType",2);customElements.define("qti-base-value",ut);var Jt=class extends V{calculate(){let t=this.getVariables();if(this.children.length===2){let e=t[0],r=t[1];if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="multiple"){let s=e.value,n=r.value;return s.filter(l=>n.includes(l)).length>0}else if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="single"){let s=e.value;return r.value.includes(s)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}};customElements.define("qti-contains",Jt);var Zt=class extends v{get interpretation(){return this.getAttribute("interpretation")||""}calculate(){let t=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(t);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",Zt);var ht=class extends v{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let r=parseInt(this.getAttribute("figures")||"0");return isNaN(r)?(console.error("figures attribute is not a number"),null):r<0?(console.error("figures attribute is negative"),null):r<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):r}calculate(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(this.roundingMode===null)return null;if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let n=parseFloat(r.value),o=parseFloat(s.value);if(!isNaN(n)&&!isNaN(o))return this.roundingMode==="significantFigures"?n.toPrecision(this.figures)===o.toPrecision(this.figures):Math.round(n*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${n}, ${o}`);break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}};c([d({type:String})],ht.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",ht);var N=class{static compareSingleValues(t,e,r){switch(r){case"identifier":case"string":return t===e;case"integer":{let s=parseInt(t,10),n=parseInt(e,10);if(!isNaN(s)&&!isNaN(n))return s===n;console.error(`Cannot convert ${t} and/or ${e} to int.`);break}case"float":{let s=parseFloat(t),n=parseFloat(e);if(!isNaN(s)&&!isNaN(n))return s===n;console.error(`couldn't convert ${t} and/or ${e} to float.`);break}case"pair":case"directedPair":{let s=t.split(" ").sort(),n=e.split(" ").sort();if(s.length===2&&n.length===2)return r==="pair"&&(s.sort(),n.sort()),s.join(" ")===n.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${t} 2: ${e}`);break}}return!1}};var mt=class extends v{constructor(){super(...arguments);this.toleranceMode="exact"}calculate(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value)?(console.error("unexpected cardinality in qti equal"),!1):N.compareSingleValues(r.value,s.value,r.baseType)}return console.error("unexpected number of children in qti-equal"),null}};c([d({type:String})],mt.prototype,"toleranceMode",2);customElements.define("qti-equal",mt);var Gt=class extends v{calculate(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+r.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",Gt);var Qt=class extends V{calculate(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+r.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}};customElements.define("qti-gte",Qt);var er=class extends v{calculate(){if(this.children.length===1){let t=this.getVariables();if(!t)return!0;let e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",er);var tr=class extends v{calculate(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+r.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",tr);var rr=class extends V{calculate(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+r.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}};customElements.define("qti-lte",rr);var ft=class extends v{calculate(){let e=this.assessmentItem.getResponse(this.identifier);if(!e)return console.warn(`Response ${this.identifier} can not be found`),null;let r=e.mapping,s=Array.isArray(e.value)?e.value:[e.value],n=0;for(let o of s){let a=r.mapEntries.find(l=>N.compareSingleValues(l.mapKey,o,e.baseType));a==null||a.mappedValue==null?n+=r.defaultValue:n+=a.mappedValue}return r.lowerBound!=null&&(n=Math.max(r.lowerBound,n)),r.upperBound!=null&&(n=Math.min(r.upperBound,n)),n}};c([d({type:String})],ft.prototype,"identifier",2);customElements.define("qti-map-response",ft);var ye=class extends f{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};c([d({attribute:"default-value",type:Number})],ye.prototype,"defaultValue",2),c([d({attribute:"lower-bound",type:Number})],ye.prototype,"lowerBound",2),c([d({attribute:"upper-bound",type:Number})],ye.prototype,"upperBound",2);customElements.define("qti-mapping",ye);var sr=class i extends v{calculate(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return this._result=i.match(e,r),this._result}return console.error("unexpected number of children in match"),null}static match(t,e){var r;if(e.cardinality==="single")return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):N.compareSingleValues((r=t.value)==null?void 0:r.toString(),e.value.toString(),e.baseType);{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;let s=0;for(let n of e.value){if(e.cardinality==="ordered"){let o=t[s];if(!N.compareSingleValues(n,o,e.baseType))return!1}else{let o=null;for(let a of t.value)if(N.compareSingleValues(n,a,e.baseType)){o=a;break}if(o!==null)t.value.splice(t.value.indexOf(o),1);else return!1}s++}return!0}}};customElements.define("qti-match",sr);var ir=class extends v{calculate(){let t=this.getVariables();this.children.length!==2&&(this.error="The member operator takes two sub-expressions");let[e,r]=t;if(e.baseType!==r.baseType&&(this.error="Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||(this.error="and the second must be a multiple or ordered container"),(e.baseType==="float"||r.baseType==="float")&&(this.error="The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||r.baseType==="duration")&&(this.error="It must not be used on sub-expressions with a base-type of duration"),e.value===null||r.value===null)return null;let s=e.value;return r.value.includes(s)}};customElements.define("qti-member",ir);var or=class extends v{calculate(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return t}};customElements.define("qti-multiple",or);var nr=class extends v{render(){return p`${super.render()}`}calculate(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",nr);var ar=class extends V{render(){return p``}calculate(){return Array.from(this.children).map(e=>{let r=e;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let s=r.calculate();if(typeof s=="string")if(s==="true")s=!0;else if(s==="false")s=!1;else return console.error("unexpected value in qti-or, expected boolean"),null;return s}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",ar);var lr=class extends v{calculate(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return t}};customElements.define("qti-ordered",lr);var Ue=class extends f{constructor(){super();this.value="";this.closest("qti-assessment-item").addEventListener("qti-response-processed",()=>{this.value=this.calculate()})}render(){return p`${Array.isArray(this.value)?this.value.map(e=>p`${e}`):this.value}`}calculate(){let e=this.closest("qti-assessment-item"),r=this.identifier;return e.getVariable(r).value}};c([d({type:String})],Ue.prototype,"identifier",2),c([$()],Ue.prototype,"value",2);customElements.define("qti-printed-variable",Ue);var cr=class extends v{calculate(){return this.getVariables().reduce((r,s)=>{if(s.baseType=="float"||s.baseType=="integer")try{return r*parseInt(s.value.toString())}catch(n){console.warn("can not convert to number")}else console.warn(`has another baseType ${s.baseType}`);return r},1)}};customElements.define("qti-product",cr);var bt=class extends v{constructor(){super(...arguments);this.caseSensitive="true"}calculate(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti string-match"),!1;let n=this.caseSensitive==="true"?r.value:r.value.toLowerCase(),o=this.caseSensitive==="true"?s.value:s.value.toLowerCase();return N.compareSingleValues(n,o,r.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};c([d({type:String,attribute:"case-sensitive"})],bt.prototype,"caseSensitive",2);customElements.define("qti-string-match",bt);var pr=class extends v{calculate(){return Array.from(this.children).map(e=>{let r=e;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let s=r.calculate();return Number.isNaN(s)?(console.error("unexpected value in qti-sum, expected number"),null):Number(s)}).reduce((e,r)=>e+r,0)}};customElements.define("qti-sum",pr);var dr=class extends v{calculate(){let t=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(t).value}};customElements.define("qti-variable",dr);var ur=class extends f{constructor(){super(...arguments);this._errorMessage=null}static get properties(){return{responseIdentifier:{type:String,attribute:"response-identifier"},module:{type:String,attribute:"module"},customInteractionTypeIdentifier:{type:String,attribute:"custom-interaction-type-identifier"},baseUrl:{type:String,attribute:"base-url"},_errorMessage:{type:String,state:!0}}}getTAOConfig(e){let r=e.querySelectorAll("properties"),s={},n=a=>{let l={},u=a.getAttribute("key");if(u){let h=Array.from(a.children),m=h.map(g=>g.getAttribute("key"));m.length>0&&!m.find(g=>!Number.isInteger(+g))?l[u]=h.map(g=>o(g)):l[u]=a.textContent}return l},o=a=>{if(a){let l={};for(let u of a.children)l=E(E({},l),n(u));return l}};for(let a of r)return a.getAttribute("key")||(s=E(E({},s),o(a))),s;console.log("Can not find qti-custom-interaction config")}register(e){let r=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",s=r=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");s.classList.add("qti-customInteraction"),r=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let n=r=="IMS"?{properties:this.dataset}:this.getTAOConfig(this);r=="IMS"?e.getInstance(s,n,void 0):e.initialize(this.customInteractionTypeIdentifier,s.firstElementChild,n),r=="TAO"&&Array.from(this.querySelectorAll("link")).map(a=>a.getAttribute("href")).forEach(a=>{let l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.media="screen",l.href=a,s.appendChild(l)})}connectedCallback(){super.connectedCallback();let e={context:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl,catchError:!0};if(window.requirePaths&&window.requireShim&&(e.paths=window.requirePaths,e.shim=window.requireShim),!globalThis.require){this._errorMessage="requirejs not found, load with cdn: https://cdnjs.com/libraries/require.js";return}requirejs.config(e)(["require"],s=>{!s.defined("qtiCustomInteractionContext")&&define("qtiCustomInteractionContext",()=>({register:o=>{this.register(o)},notifyReady:()=>{}}));let n=s.defined(this.module);s([this.module],o=>{n&&this.register(o)},o=>{this._errorMessage=o})},s=>{this._errorMessage=s})}render(){return p`<slot></slot>${this._errorMessage&&p`<div style="color:red">
|
|
161
|
+
`,c([A()],v.prototype,"result",2);var H=class extends v{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};var mt=class extends Ws(H){calculate(){return this.calculateChildren(Array.from(this.children))}};function Ws(i){return class extends i{calculateChildren(e){return e.map(s=>{let n=s;if(!n.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let o=n.calculate();if(typeof o=="string")if(o==="true")o=!0;else if(o==="false")o=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return o}).every(s=>typeof s=="boolean"&&s)}}}customElements.define("qti-and",mt);var ft=class extends v{constructor(){super(...arguments);this.baseType="string"}getResult(){return this.textContent}};c([p({type:String,attribute:"base-type"})],ft.prototype,"baseType",2);customElements.define("qti-base-value",ft);var Qt=class extends H{getResult(){let t=this.getVariables();if(this.children.length===2){let e=t[0],r=t[1];if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="multiple"){let s=e.value,n=r.value;return s.filter(l=>n.includes(l)).length>0}else if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="single"){let s=e.value;return r.value.includes(s)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}};customElements.define("qti-contains",Qt);var er=class extends v{get interpretation(){return this.getAttribute("interpretation")||""}getResult(){let t=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(t);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",er);var bt=class extends v{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let r=parseInt(this.getAttribute("figures")||"0");return isNaN(r)?(console.error("figures attribute is not a number"),null):r<0?(console.error("figures attribute is negative"),null):r<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):r}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(this.roundingMode===null)return null;if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let n=parseFloat(r.value),o=parseFloat(s.value);if(!isNaN(n)&&!isNaN(o))return this.roundingMode==="significantFigures"?n.toPrecision(this.figures)===o.toPrecision(this.figures):Math.round(n*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${n}, ${o}`);break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}};c([p({type:String})],bt.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",bt);var N=class{static compareSingleValues(t,e,r){switch(r){case"identifier":case"string":return t===e;case"integer":{let s=parseInt(t,10),n=parseInt(e,10);if(!isNaN(s)&&!isNaN(n))return s===n;console.error(`Cannot convert ${t} and/or ${e} to int.`);break}case"float":{let s=parseFloat(t),n=parseFloat(e);if(!isNaN(s)&&!isNaN(n))return s===n;console.error(`couldn't convert ${t} and/or ${e} to float.`);break}case"pair":case"directedPair":{let s=t.split(" ").sort(),n=e.split(" ").sort();if(s.length===2&&n.length===2)return r==="pair"&&(s.sort(),n.sort()),s.join(" ")===n.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${t} 2: ${e}`);break}}return!1}};var gt=class extends v{constructor(){super(...arguments);this.toleranceMode="exact"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value)?(console.error("unexpected cardinality in qti equal"),!1):N.compareSingleValues(r.value,s.value,r.baseType)}return console.error("unexpected number of children in qti-equal"),null}};c([p({type:String})],gt.prototype,"toleranceMode",2);customElements.define("qti-equal",gt);var tr=class extends v{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+r.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",tr);var rr=class extends H{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+r.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}};customElements.define("qti-gte",rr);var sr=class extends v{getResult(){if(this.children.length===1){let t=this.getVariables();if(!t)return!0;let e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",sr);var ir=class extends v{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+r.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",ir);var or=class extends H{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+r.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}};customElements.define("qti-lte",or);var vt=class extends v{getResult(){let e=this.assessmentItem.getResponse(this.identifier);if(!e)return console.warn(`Response ${this.identifier} can not be found`),null;let r=e.mapping,s=Array.isArray(e.value)?e.value:[e.value],n=0;for(let o of s){let a=r.mapEntries.find(l=>N.compareSingleValues(l.mapKey,o,e.baseType));a==null||a.mappedValue==null?n+=r.defaultValue:n+=a.mappedValue}return r.lowerBound!=null&&(n=Math.max(r.lowerBound,n)),r.upperBound!=null&&(n=Math.min(r.upperBound,n)),n}};c([p({type:String})],vt.prototype,"identifier",2);customElements.define("qti-map-response",vt);var _e=class extends f{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};c([p({attribute:"default-value",type:Number})],_e.prototype,"defaultValue",2),c([p({attribute:"lower-bound",type:Number})],_e.prototype,"lowerBound",2),c([p({attribute:"upper-bound",type:Number})],_e.prototype,"upperBound",2);customElements.define("qti-mapping",_e);var nr=class i extends v{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return i.match(e,r)}return console.error("unexpected number of children in match"),null}static match(t,e){var r;if(e.cardinality==="single")return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):N.compareSingleValues((r=t.value)==null?void 0:r.toString(),e.value.toString(),e.baseType);{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;let s=0;for(let n of e.value){if(e.cardinality==="ordered"){let o=t[s];if(!N.compareSingleValues(n,o,e.baseType))return!1}else{let o=null;for(let a of t.value)if(N.compareSingleValues(n,a,e.baseType)){o=a;break}if(o!==null)t.value.splice(t.value.indexOf(o),1);else return!1}s++}return!0}}};customElements.define("qti-match",nr);var ar=class extends v{getResult(){let t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");let[e,r]=t;if(e.baseType!==r.baseType&&console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(e.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),e.value===null||r.value===null)return null;let s=e.value;return r.value.includes(s)}};customElements.define("qti-member",ar);var lr=class extends v{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return t}};customElements.define("qti-multiple",lr);var cr=class extends v{render(){return d`${super.render()}`}getResult(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",cr);var pr=class extends H{getResult(){return Array.from(this.children).map(e=>{let r=e;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let s=r.calculate();if(typeof s=="string")if(s==="true")s=!0;else if(s==="false")s=!1;else return console.error("unexpected value in qti-or, expected boolean"),null;return s}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",pr);var dr=class extends v{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return t}};customElements.define("qti-ordered",dr);var Be=class extends f{render(){var r,s;let e=(s=(r=this.itemContext)==null?void 0:r.variables.find(n=>n.identifier===this.identifier))==null?void 0:s.value;return d`${JSON.stringify(e,null,2)}`}calculate(){let e=this.closest("qti-assessment-item"),r=this.identifier;return e.getVariable(r).value}};c([p({type:String})],Be.prototype,"identifier",2),c([se({context:Q,subscribe:!0}),A()],Be.prototype,"itemContext",2);customElements.define("qti-printed-variable",Be);var ur=class extends v{getResult(){return this.getVariables().reduce((r,s)=>{if(s.baseType=="float"||s.baseType=="integer")try{return r*parseInt(s.value.toString())}catch(n){console.warn("can not convert to number")}else console.warn(`has another baseType ${s.baseType}`);return r},1)}};customElements.define("qti-product",ur);var yt=class extends v{constructor(){super(...arguments);this.caseSensitive="true"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti string-match"),!1;let n=this.caseSensitive==="true"?r.value:r.value.toLowerCase(),o=this.caseSensitive==="true"?s.value:s.value.toLowerCase();return N.compareSingleValues(n,o,r.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};c([p({type:String,attribute:"case-sensitive"})],yt.prototype,"caseSensitive",2);customElements.define("qti-string-match",yt);var hr=class extends v{getResult(){return Array.from(this.children).map(e=>{let r=e;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let s=r.calculate();return Number.isNaN(s)?(console.error("unexpected value in qti-sum, expected number"),null):Number(s)}).reduce((e,r)=>e+r,0)}};customElements.define("qti-sum",hr);var mr=class extends v{getResult(){let t=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(t).value}};customElements.define("qti-variable",mr);var fr=class extends f{constructor(){super(...arguments);this._errorMessage=null}static get properties(){return{responseIdentifier:{type:String,attribute:"response-identifier"},module:{type:String,attribute:"module"},customInteractionTypeIdentifier:{type:String,attribute:"custom-interaction-type-identifier"},baseUrl:{type:String,attribute:"base-url"},_errorMessage:{type:String,state:!0}}}getTAOConfig(e){let r=e.querySelectorAll("properties"),s={},n=a=>{let l={},u=a.getAttribute("key");if(u){let h=Array.from(a.children),m=h.map(g=>g.getAttribute("key"));m.length>0&&!m.find(g=>!Number.isInteger(+g))?l[u]=h.map(g=>o(g)):l[u]=a.textContent}return l},o=a=>{if(a){let l={};for(let u of a.children)l=x(x({},l),n(u));return l}};for(let a of r)return a.getAttribute("key")||(s=x(x({},s),o(a))),s;console.log("Can not find qti-custom-interaction config")}register(e){let r=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",s=r=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");s.classList.add("qti-customInteraction"),r=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let n=r=="IMS"?{properties:this.dataset}:this.getTAOConfig(this);r=="IMS"?e.getInstance(s,n,void 0):e.initialize(this.customInteractionTypeIdentifier,s.firstElementChild,n),r=="TAO"&&Array.from(this.querySelectorAll("link")).map(a=>a.getAttribute("href")).forEach(a=>{let l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.media="screen",l.href=a,s.appendChild(l)})}connectedCallback(){super.connectedCallback();let e={context:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl,catchError:!0};if(window.requirePaths&&window.requireShim&&(e.paths=window.requirePaths,e.shim=window.requireShim),!globalThis.require){this._errorMessage="requirejs not found, load with cdn: https://cdnjs.com/libraries/require.js";return}requirejs.config(e)(["require"],s=>{!s.defined("qtiCustomInteractionContext")&&define("qtiCustomInteractionContext",()=>({register:o=>{this.register(o)},notifyReady:()=>{}}));let n=s.defined(this.module);s([this.module],o=>{n&&this.register(o)},o=>{this._errorMessage=o})},s=>{this._errorMessage=s})}render(){return d`<slot></slot>${this._errorMessage&&d`<div style="color:red">
|
|
163
162
|
<h1>Error</h1>
|
|
164
163
|
${this._errorMessage}
|
|
165
|
-
</div>`}`}};customElements.define("qti-portable-custom-interaction",ur);var gt=class i{constructor(){this._touchBegin=0;this._touchDown=null;this._lastClick=0;this._canDrag=!1;this._dragSrc=null;this._dragCopy=null;this._touchEndCalled=!1;this._dragRunning=!1;this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"};this._copyOffset={x:0,y:0};this._lastTarget=null;this._currentDropContainer=null;this._handleClick=!0;this._DBLCLICKDELAY=500;this._CONTEXTMENUDELAY=1e3;this._DRAGDELTA=5;this._COPYOPACITY=.7;this.copyStylesDragClone=!0;this.dragOnClick=!1;this._createDragCopy=(t,e)=>{if(this._dragCopy===null&&this._dragRunning){this._dragSrc.style.opacity=this._COPYOPACITY,this._dragCopy=this._dragSrc.cloneNode(!0);let r=window.getComputedStyle(this._dragSrc);if(this._dragCopy.style="",this._dragCopy.setAttribute("dragclone",""),this.copyStylesDragClone)for(let s of r)this._dragCopy.style[s]=r.getPropertyValue(s);this._calculateDragCopyPosition(e),this._dragCopy.style.top=e.clientY-this._copyOffset.y+"px",this._dragCopy.style.left=e.clientX-this._copyOffset.x+"px",this._dragCopy.style.position="fixed",this._dragCopy.style.pointerEvents="none",this._dragCopy.style.zIndex="999999",this._dragCopy=document.body.appendChild(this._dragCopy),this._dispatchEvent(this._dragSrc,"dragstart")}if(this._dragRunning){let r=this;requestAnimationFrame(function(){r._touchEndCalled||r._dragCopy===null||(r._dragCopy.style.top=e.clientY-r._copyOffset.y+"px",r._dragCopy.style.left=e.clientX-r._copyOffset.x+"px")});let s=this._findDroppable(t);s!=this._lastTarget&&(this._dispatchEvent(s,"dragenter"),this._dispatchEvent(this._lastTarget,"dragleave"),this._lastTarget=s),this._currentDropContainer=s,this._currentDropContainer&&this._dispatchEvent(s,"dragover")}};return i._instance?i._instance:(i._instance=this,document.addEventListener("touchmove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("mousemove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("mouseup",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchcancel",this._touchCancel.bind(this),{passive:!1,capture:!1}),this)}addDraggables(t){t.forEach(e=>{e.addEventListener("touchstart",this._touchStart.bind(this),{passive:!1,capture:!1}),e.addEventListener("mousedown",this._touchStart.bind(this),{passive:!1,capture:!1})})}_touchStart(t){this._touchBegin=Date.now();let{x:e,y:r}=this._getPoint(t);if(this._touchDown={x:e,y:r},this._dragSrc=t.currentTarget,this._canDrag=!0,this.dragOnClick){let s={clientX:e,clientY:r};this._dragRunning=!0,this._createDragCopy(t,s)}t.preventDefault()}_touchMove(t){if(this._canDrag&&this._dragSrc){let{x:e,y:r}=this._getPoint(t),s={clientX:e,clientY:r};this._getDelta(s)>=this._DRAGDELTA&&(this._dragRunning=!0),this._createDragCopy(t,s),t.preventDefault()}}_touchEnd(t){var e;if(this._touchEndCalled=!0,this._canDrag=!1,this._currentDropContainer)this._dispatchEvent(this._currentDropContainer,"drop"),this._dispatchEvent(this._dragSrc,"dragend");else if(this._dragRunning){let r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},(e=this._dragSrc)==null||e.dispatchEvent(r)}this._reset()}_touchCancel(t){this._reset()}_findDroppable(t){let e=this._getPoint(t);return this.elementFromPoint(e.x,e.y)}elementFromPoint(t,e){let r=document.elementFromPoint(t,e);if(r){for(;r.shadowRoot;){let s=r.shadowRoot.elementFromPoint(t,e);if(s===null||s===r)break;r=s}return r}return null}_getPoint(t,e){return t&&t.touches&&(t=t.touches[0]),{x:e?t.pageX:t.clientX,y:e?t.pageY:t.clientY}}_calculateDragCopyPosition(t){let e=this._dragSrc.getBoundingClientRect();this._copyOffset.x=t.clientX-e.left,this._copyOffset.y=t.clientY-e.top}_getDelta(t){let e=Math.abs(t.clientX-this._touchDown.x),r=Math.abs(t.clientY-this._touchDown.y);return e+r}_dispatchEvent(t,e,r=!0){if(!t)return!1;let s=new CustomEvent(e,{bubbles:r,cancelable:!0});return s.dataTransfer=this._dataTransfer,t.dispatchEvent(s),s.defaultPrevented}_reset(){this._dragRunning&&(this._dragSrc.style.opacity="1.0",this._dragCopy.parentElement.removeChild(this._dragCopy)),this._dragRunning=!1,this._dragSrc=null,this._dragCopy=null,this._canDrag=!1,this._touchBegin=0,this._touchDown=null,this._lastClick=0,this._touchEndCalled=!1,this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"},this._copyOffset={x:0,y:0},this._lastTarget=null,this._currentDropContainer=null,this._handleClick=!0}};var ds=(i,t,e)=>{class r extends i{constructor(){super(...arguments);this.disabled=!1}firstUpdated(o){if(this.classList.contains("qti-match-tabular"))return;super.firstUpdated(o);let a=Array.from(t?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e));this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this),a.forEach(l=>{l.setAttribute("dropzone","move"),l.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(l)});for(let l of a)this.observer=new MutationObserver(u=>{u.forEach(h=>{if(h.type==="attributes")switch(h.attributeName){case"disabled":{l.hasAttribute("disabled")?this.removeHandler(l):this.attachHandler(l);break}}})}),this.observer.observe(l,{attributes:!0})}attachHandler(o){o.addEventListener("dragover",this.dragoverHandler),o.addEventListener("dragenter",this.dragenterHandler),o.addEventListener("drop",this.dropHandler)}removeHandler(o){o.removeEventListener("dragover",this.dragoverHandler),o.removeEventListener("dragenter",this.dragenterHandler),o.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var o;this.classList.contains("qti-match-tabular")||(super.disconnectedCallback(),(o=this.observer)==null||o.disconnect())}dragenterHandler(o){o.preventDefault()}dragoverHandler(o){return o.preventDefault(),o.currentTarget.setAttribute("active",""),o.dataTransfer.dropEffect="move",!1}dropHandler(o){o.preventDefault();let a=o.currentTarget,l=this.querySelector(`[identifier=${o.dataTransfer.getData("text")}`),u=l||this.shadowRoot.querySelector(`[identifier=${o.dataTransfer.getData("text")}`);return a?u.parentElement.getAttribute("identifier")!==a.getAttribute("identifier")&&a.appendChild(u):console.error(`cannot find droppable, target: ${o.target?JSON.stringify(o.target):"null"}`),a.removeAttribute("active"),!1}dragleaveHandler(o){return o.preventDefault(),o.currentTarget.removeAttribute("active"),o.dataTransfer.dropEffect="none",!1}}return c([d({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var us=(i,t,e)=>{class r extends i{}return r};var z=(i,t,e,r)=>{class s extends us(ds(i,e,r),r,t){constructor(){super(...arguments);this.draggables=new Map;this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1}reInitDragAndDrop(a,l){if(this.classList.contains("qti-match-tabular"))return;a.filter(h=>!this.draggables||!this.draggables.get(h)).length>0&&(this.dragDropApi.addDraggables(a),a.forEach(h=>{this.draggables.set(h,{parent:h.parentElement,index:Array.from(h.parentNode.children).indexOf(h)}),h.setAttribute("qti-draggable","true"),h.addEventListener("dragstart",m=>{m.dataTransfer.setData("text",m.currentTarget.getAttribute("identifier")),h.setAttribute("dragging","")}),h.addEventListener("dragend",m=>{if(m.preventDefault(),h.removeAttribute("over"),h.removeAttribute("dragging"),(m.dataTransfer.dropEffect==="none"||m.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack){let y=m.currentTarget,g=this.draggables.get(y),A=g.index<g.parent.children.length?g.index:g.parent.children.length-1,_=g.parent,S=g.parent.children[A];_.insertBefore(y,S),this.saveResponse(),this.checkMaxMatchAssociations()}m.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())})}))}handleDragOptionsChanged(a,l){this.dragDropApi.copyStylesDragClone=l.copyStylesDragClone,this.dragDropApi.dragOnClick=l.dragOnClick}handleDisabledChange(a,l){this.draggables.forEach((u,h)=>{l?h.setAttribute("disabled",""):h.removeAttribute("disabled"),l?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}handleReadonlyChange(a,l){this.draggables.forEach((u,h)=>{l?h.setAttribute("readonly",""):h.removeAttribute("readonly"),l?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}firstUpdated(a){super.firstUpdated(a),this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(r):this.querySelectorAll(r))}connectedCallback(){super.connectedCallback(),this.dragDropApi=new gt,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}reset(a=!0){this.draggables.forEach((l,u)=>{let h=l.parent.children,m=l.index<h.length?l.index:h.length;l.parent.insertBefore(u,h[m])}),a&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(a=>{let u=+(a.getAttribute("match-max")||1)<=(a.children.length||0);u?a.setAttribute("disabled",""):a.removeAttribute("disabled"),u?a.removeAttribute("dropzone"):a.setAttribute("dropzone","move")})}set response(a){this.classList.contains("qti-match-tabular")||(this.reset(!1),a!==null&&Array.isArray(a)&&a.forEach(l=>{let[u,...h]=l.split(" ").reverse();if(u){let m=this.droppables.find(y=>y.getAttribute("identifier")===u);h.forEach(y=>{let g=this.querySelector(`[identifier=${y}]`);m?g?(m.appendChild(g),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${y}`):console.error(`cannot find droppable with identifier: ${u}`)})}}))}validate(){let l=(e?Array.from(this.shadowRoot.querySelectorAll(r)):Array.from(this.querySelectorAll(r))).filter(u=>u.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=l}saveResponse(){let a=this.droppables.map(l=>{var h;let u="";return((h=l.children)==null?void 0:h.length)>0&&(u+=Array.from(l.children).map(m=>m.getAttribute("identifier")).join(" ")+" "),u+=l.getAttribute("identifier"),u});this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}}return c([es(t)],s.prototype,"reInitDragAndDrop",1),c([d({type:String,attribute:"response-identifier"})],s.prototype,"responseIdentifier",2),c([d({attribute:!1,type:Object})],s.prototype,"configuration",2),c([w("configuration")],s.prototype,"handleDragOptionsChanged",1),c([d({type:Boolean,reflect:!0})],s.prototype,"disabled",2),c([w("disabled",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),c([d({type:Boolean,reflect:!0})],s.prototype,"readonly",2),c([w("readonly",{waitUntilFirstUpdate:!0})],s.prototype,"handleReadonlyChange",1),c([d({type:Number,reflect:!0,attribute:"min-associations"})],s.prototype,"minAssociations",2),c([d({type:Number,reflect:!0,attribute:"max-associations"})],s.prototype,"maxAssociations",2),s};var Ie=class extends z(f,"qti-simple-associable-choice",!0,".dl"){render(){return p` <slot name="prompt"></slot>
|
|
164
|
+
</div>`}`}};customElements.define("qti-portable-custom-interaction",fr);var xt=class i{constructor(){this._touchBegin=0;this._touchDown=null;this._lastClick=0;this._canDrag=!1;this._dragSrc=null;this._dragCopy=null;this._touchEndCalled=!1;this._dragRunning=!1;this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"};this._copyOffset={x:0,y:0};this._lastTarget=null;this._currentDropContainer=null;this._handleClick=!0;this._DBLCLICKDELAY=500;this._CONTEXTMENUDELAY=1e3;this._DRAGDELTA=5;this._COPYOPACITY=.7;this.copyStylesDragClone=!0;this.dragOnClick=!1;this._createDragCopy=(t,e)=>{if(this._dragCopy===null&&this._dragRunning){this._dragSrc.style.opacity=this._COPYOPACITY,this._dragCopy=this._dragSrc.cloneNode(!0);let r=window.getComputedStyle(this._dragSrc);if(this._dragCopy.style="",this._dragCopy.setAttribute("dragclone",""),this.copyStylesDragClone)for(let s of r)this._dragCopy.style[s]=r.getPropertyValue(s);this._calculateDragCopyPosition(e),this._dragCopy.style.top=e.clientY-this._copyOffset.y+"px",this._dragCopy.style.left=e.clientX-this._copyOffset.x+"px",this._dragCopy.style.position="fixed",this._dragCopy.style.pointerEvents="none",this._dragCopy.style.zIndex="999999",this._dragCopy=document.body.appendChild(this._dragCopy),this._dispatchEvent(this._dragSrc,"dragstart")}if(this._dragRunning){let r=this;requestAnimationFrame(function(){r._touchEndCalled||r._dragCopy===null||(r._dragCopy.style.top=e.clientY-r._copyOffset.y+"px",r._dragCopy.style.left=e.clientX-r._copyOffset.x+"px")});let s=this._findDroppable(t);s!=this._lastTarget&&(this._dispatchEvent(s,"dragenter"),this._dispatchEvent(this._lastTarget,"dragleave"),this._lastTarget=s),this._currentDropContainer=s,this._currentDropContainer&&this._dispatchEvent(s,"dragover")}};return i._instance?i._instance:(i._instance=this,document.addEventListener("touchmove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("mousemove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("mouseup",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchcancel",this._touchCancel.bind(this),{passive:!1,capture:!1}),this)}addDraggables(t){t.forEach(e=>{e.addEventListener("touchstart",this._touchStart.bind(this),{passive:!1,capture:!1}),e.addEventListener("mousedown",this._touchStart.bind(this),{passive:!1,capture:!1})})}_touchStart(t){this._touchBegin=Date.now();let{x:e,y:r}=this._getPoint(t);if(this._touchDown={x:e,y:r},this._dragSrc=t.currentTarget,this._canDrag=!0,this.dragOnClick){let s={clientX:e,clientY:r};this._dragRunning=!0,this._createDragCopy(t,s)}t.preventDefault()}_touchMove(t){if(this._canDrag&&this._dragSrc){let{x:e,y:r}=this._getPoint(t),s={clientX:e,clientY:r};this._getDelta(s)>=this._DRAGDELTA&&(this._dragRunning=!0),this._createDragCopy(t,s),t.preventDefault()}}_touchEnd(t){var e;if(this._touchEndCalled=!0,this._canDrag=!1,this._currentDropContainer)this._dispatchEvent(this._currentDropContainer,"drop"),this._dispatchEvent(this._dragSrc,"dragend");else if(this._dragRunning){let r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},(e=this._dragSrc)==null||e.dispatchEvent(r)}this._reset()}_touchCancel(t){this._reset()}_findDroppable(t){let e=this._getPoint(t);return this.elementFromPoint(e.x,e.y)}elementFromPoint(t,e){let r=document.elementFromPoint(t,e);if(r){for(;r.shadowRoot;){let s=r.shadowRoot.elementFromPoint(t,e);if(s===null||s===r)break;r=s}return r}return null}_getPoint(t,e){return t&&t.touches&&(t=t.touches[0]),{x:e?t.pageX:t.clientX,y:e?t.pageY:t.clientY}}_calculateDragCopyPosition(t){let e=this._dragSrc.getBoundingClientRect();this._copyOffset.x=t.clientX-e.left,this._copyOffset.y=t.clientY-e.top}_getDelta(t){let e=Math.abs(t.clientX-this._touchDown.x),r=Math.abs(t.clientY-this._touchDown.y);return e+r}_dispatchEvent(t,e,r=!0){if(!t)return!1;let s=new CustomEvent(e,{bubbles:r,cancelable:!0});return s.dataTransfer=this._dataTransfer,t.dispatchEvent(s),s.defaultPrevented}_reset(){this._dragRunning&&(this._dragSrc.style.opacity="1.0",this._dragCopy.parentElement.removeChild(this._dragCopy)),this._dragRunning=!1,this._dragSrc=null,this._dragCopy=null,this._canDrag=!1,this._touchBegin=0,this._touchDown=null,this._lastClick=0,this._touchEndCalled=!1,this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"},this._copyOffset={x:0,y:0},this._lastTarget=null,this._currentDropContainer=null,this._handleClick=!0}};var hs=(i,t,e)=>{class r extends i{constructor(){super(...arguments);this.disabled=!1}firstUpdated(o){if(this.classList.contains("qti-match-tabular"))return;super.firstUpdated(o);let a=Array.from(t?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e));this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this),a.forEach(l=>{l.setAttribute("dropzone","move"),l.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(l)});for(let l of a)this.observer=new MutationObserver(u=>{u.forEach(h=>{if(h.type==="attributes")switch(h.attributeName){case"disabled":{l.hasAttribute("disabled")?this.removeHandler(l):this.attachHandler(l);break}}})}),this.observer.observe(l,{attributes:!0})}attachHandler(o){o.addEventListener("dragover",this.dragoverHandler),o.addEventListener("dragenter",this.dragenterHandler),o.addEventListener("drop",this.dropHandler)}removeHandler(o){o.removeEventListener("dragover",this.dragoverHandler),o.removeEventListener("dragenter",this.dragenterHandler),o.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var o;this.classList.contains("qti-match-tabular")||(super.disconnectedCallback(),(o=this.observer)==null||o.disconnect())}dragenterHandler(o){o.preventDefault()}dragoverHandler(o){return o.preventDefault(),o.currentTarget.setAttribute("active",""),o.dataTransfer.dropEffect="move",!1}dropHandler(o){o.preventDefault();let a=o.currentTarget,l=this.querySelector(`[identifier=${o.dataTransfer.getData("text")}`),u=l||this.shadowRoot.querySelector(`[identifier=${o.dataTransfer.getData("text")}`);return a?u.parentElement.getAttribute("identifier")!==a.getAttribute("identifier")&&a.appendChild(u):console.error(`cannot find droppable, target: ${o.target?JSON.stringify(o.target):"null"}`),a.removeAttribute("active"),!1}dragleaveHandler(o){return o.preventDefault(),o.currentTarget.removeAttribute("active"),o.dataTransfer.dropEffect="none",!1}}return c([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var ms=(i,t,e)=>{class r extends i{}return r};var z=(i,t,e,r)=>{class s extends ms(hs(i,e,r),r,t){constructor(){super(...arguments);this.draggables=new Map;this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1}reInitDragAndDrop(a,l){if(this.classList.contains("qti-match-tabular"))return;a.filter(h=>!this.draggables||!this.draggables.get(h)).length>0&&(this.dragDropApi.addDraggables(a),a.forEach(h=>{this.draggables.set(h,{parent:h.parentElement,index:Array.from(h.parentNode.children).indexOf(h)}),h.setAttribute("qti-draggable","true"),h.addEventListener("dragstart",m=>{m.dataTransfer.setData("text",m.currentTarget.getAttribute("identifier")),h.setAttribute("dragging","")}),h.addEventListener("dragend",m=>{if(m.preventDefault(),h.removeAttribute("over"),h.removeAttribute("dragging"),(m.dataTransfer.dropEffect==="none"||m.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack){let y=m.currentTarget,g=this.draggables.get(y),q=g.index<g.parent.children.length?g.index:g.parent.children.length-1,_=g.parent,S=g.parent.children[q];_.insertBefore(y,S),this.saveResponse(),this.checkMaxMatchAssociations()}m.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())})}))}handleDragOptionsChanged(a,l){this.dragDropApi.copyStylesDragClone=l.copyStylesDragClone,this.dragDropApi.dragOnClick=l.dragOnClick}handleDisabledChange(a,l){this.draggables.forEach((u,h)=>{l?h.setAttribute("disabled",""):h.removeAttribute("disabled"),l?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}handleReadonlyChange(a,l){this.draggables.forEach((u,h)=>{l?h.setAttribute("readonly",""):h.removeAttribute("readonly"),l?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}firstUpdated(a){super.firstUpdated(a),this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(r):this.querySelectorAll(r))}connectedCallback(){super.connectedCallback(),this.dragDropApi=new xt,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}reset(a=!0){this.draggables.forEach((l,u)=>{let h=l.parent.children,m=l.index<h.length?l.index:h.length;l.parent.insertBefore(u,h[m])}),a&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(a=>{let u=+(a.getAttribute("match-max")||1)<=(a.children.length||0);u?a.setAttribute("disabled",""):a.removeAttribute("disabled"),u?a.removeAttribute("dropzone"):a.setAttribute("dropzone","move")})}set response(a){this.classList.contains("qti-match-tabular")||(this.reset(!1),a!==null&&Array.isArray(a)&&a.forEach(l=>{let[u,...h]=l.split(" ").reverse();if(u){let m=this.droppables.find(y=>y.getAttribute("identifier")===u);h.forEach(y=>{let g=this.querySelector(`[identifier=${y}]`);m?g?(m.appendChild(g),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${y}`):console.error(`cannot find droppable with identifier: ${u}`)})}}))}validate(){let l=(e?Array.from(this.shadowRoot.querySelectorAll(r)):Array.from(this.querySelectorAll(r))).filter(u=>u.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=l}saveResponse(){let a=this.droppables.map(l=>{var h;let u="";return((h=l.children)==null?void 0:h.length)>0&&(u+=Array.from(l.children).map(m=>m.getAttribute("identifier")).join(" ")+" "),u+=l.getAttribute("identifier"),u});this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}}return c([ls(t)],s.prototype,"reInitDragAndDrop",1),c([p({type:String,attribute:"response-identifier"})],s.prototype,"responseIdentifier",2),c([p({attribute:!1,type:Object})],s.prototype,"configuration",2),c([w("configuration")],s.prototype,"handleDragOptionsChanged",1),c([p({type:Boolean,reflect:!0})],s.prototype,"disabled",2),c([w("disabled",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),c([p({type:Boolean,reflect:!0})],s.prototype,"readonly",2),c([w("readonly",{waitUntilFirstUpdate:!0})],s.prototype,"handleReadonlyChange",1),c([p({type:Number,reflect:!0,attribute:"min-associations"})],s.prototype,"minAssociations",2),c([p({type:Number,reflect:!0,attribute:"max-associations"})],s.prototype,"maxAssociations",2),s};var je=class extends z(f,"qti-simple-associable-choice",!0,".dl"){render(){return d` <slot name="prompt"></slot>
|
|
166
165
|
<slot name="qti-simple-associable-choice"></slot>
|
|
167
|
-
${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((e,r)=>
|
|
166
|
+
${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((e,r)=>d`<div part="associables-container">
|
|
168
167
|
<div name="left${r}" part="drop-list" class="dl" identifier="droplist${r}_left"></div>
|
|
169
168
|
<div name="right${r}" part="drop-list" class="dl" identifier="droplist${r}_right"></div>
|
|
170
|
-
</div>`)}`}connectedCallback(){super.connectedCallback(),this._childrenMap=Array.from(this.querySelectorAll("qti-simple-associable-choice"))}};
|
|
169
|
+
</div>`)}`}connectedCallback(){super.connectedCallback(),this._childrenMap=Array.from(this.querySelectorAll("qti-simple-associable-choice"))}};je.styles=b`
|
|
171
170
|
:host {
|
|
172
171
|
display: block; /* necessary to calculate scaling position */
|
|
173
172
|
}
|
|
@@ -176,8 +175,8 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
176
175
|
flex-wrap: wrap;
|
|
177
176
|
gap: 0.5rem;
|
|
178
177
|
}
|
|
179
|
-
`,c([
|
|
180
|
-
<slot part="drops"></slot>`}};
|
|
178
|
+
`,c([A()],je.prototype,"_childrenMap",2);customElements.define("qti-associate-interaction",je);var Et=class extends z(f,"qti-gap-text",!1,"qti-gap"){render(){return d` <slot part="drags" name="qti-gap-text"></slot>
|
|
179
|
+
<slot part="drops"></slot>`}};Et.styles=[b`
|
|
181
180
|
:host {
|
|
182
181
|
display: flex;
|
|
183
182
|
align-items: flex-start;
|
|
@@ -200,14 +199,14 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
200
199
|
align-items: flex-start;
|
|
201
200
|
flex: 1;
|
|
202
201
|
}
|
|
203
|
-
`];customElements.define("qti-gap-match-interaction",
|
|
202
|
+
`];customElements.define("qti-gap-match-interaction",Et);function Ce(i,t,e,r){switch(i){case"circle":{let[s,n,o]=t,a=s/e.width*100,l=n/e.height*100,u=o/e.width*100;r.style.left=a-u+"%",r.style.top=l-u+"%",r.style.width=r.style.height=4*u+"px",r.style.borderRadius="9999px"}break;case"rect":{let[s,n,o,a]=t,l=s/e.width*100,u=n/e.height*100,h=o/e.width*100,m=a/e.height*100;r.style.left=l+"%",r.style.top=u+"%",r.style.width=h-l+"%",r.style.height=m-u+"%"}break;case"poly":{let s=t.reduce((_,S,ue,Ye)=>{if(ue%2===1){let vs=_.pop();_[_.length]={x:vs,y:Ye[ue]}}else _.push(S);return _},[]),n=Math.min(...s.map(_=>_.x)),o=Math.max(...s.map(_=>_.x)),a=Math.min(...s.map(_=>_.y)),l=Math.max(...s.map(_=>_.y)),u=n/e.width*100,h=a/e.height*100,m=o/e.width*100,y=l/e.height*100;r.style.left=n/e.width*100+"%",r.style.top=a/e.height*100+"%",r.style.width=m-u+"%",r.style.height=y-h+"%";let q=s.map(_=>({x:(_.x-n)/(o-n)*100,y:(_.y-a)/(l-a)*100})).map(_=>Math.round(_.x)+"% "+Math.round(_.y)+"%").join(",");r.style.clipPath=`polygon(${q})`}break;default:break}}var fs=(i,t,e)=>{let r=new Map;for(let s=t;s<=e;s++)r.set(i[s],s);return r},_t=K(class extends O{constructor(i){if(super(i),i.type!==W.CHILD)throw Error("repeat() can only be used in text expressions")}ht(i,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);let s=[],n=[],o=0;for(let a of i)s[o]=r?r(a,o):o,n[o]=e(a,o),o++;return{values:n,keys:s}}render(i,t,e){return this.ht(i,t,e).values}update(i,[t,e,r]){var _;let s=os(i),{values:n,keys:o}=this.ht(t,e,r);if(!Array.isArray(s))return this.dt=o,n;let a=(_=this.dt)!=null?_:this.dt=[],l=[],u,h,m=0,y=s.length-1,g=0,q=n.length-1;for(;m<=y&&g<=q;)if(s[m]===null)m++;else if(s[y]===null)y--;else if(a[m]===o[g])l[g]=re(s[m],n[g]),m++,g++;else if(a[y]===o[q])l[q]=re(s[y],n[q]),y--,q--;else if(a[m]===o[q])l[q]=re(s[m],n[q]),ve(i,l[q+1],s[m]),m++,q--;else if(a[y]===o[g])l[g]=re(s[y],n[g]),ve(i,s[m],s[y]),y--,g++;else if(u===void 0&&(u=fs(o,g,q),h=fs(a,m,y)),u.has(a[m]))if(u.has(a[y])){let S=h.get(o[g]),ue=S!==void 0?s[S]:null;if(ue===null){let Ye=ve(i,s[m]);re(Ye,n[g]),l[g]=Ye}else l[g]=re(ue,n[g]),ve(i,s[m],ue),s[S]=null;g++}else ct(s[y]),y--;else ct(s[m]),m++;for(;g<=q;){let S=ve(i,l[q+1]);re(S,n[g]),l[g++]=S}for(;m<=y;){let S=s[m++];S!==null&&ct(S)}return this.dt=o,is(i,l),M}});var J=class extends ${constructor(){super();this.startPoint=null;this.endPoint=null;this._lines=[];this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}reset(){this._lines=[]}validate(){return this._lines.length>0}set response(e){Array.isArray(e)&&(this._lines=e)}render(){var e,r,s,n;return d`<slot name="prompt"></slot>
|
|
204
203
|
<line-container>
|
|
205
204
|
<svg
|
|
206
205
|
width=${F((e=this.grImage[0])==null?void 0:e.width)}
|
|
207
206
|
height=${F((r=this.grImage[0])==null?void 0:r.height)}
|
|
208
207
|
viewbox="0 0 ${(s=this.grImage[0])==null?void 0:s.width} ${(n=this.grImage[0])==null?void 0:n.height}"
|
|
209
208
|
>
|
|
210
|
-
${
|
|
209
|
+
${_t(this._lines,o=>o,(o,a)=>He`
|
|
211
210
|
<line
|
|
212
211
|
part="line"
|
|
213
212
|
x1=${parseInt(this.querySelector("[identifier="+o.split(" ")[0]+"]").style.left)}
|
|
@@ -219,7 +218,7 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
219
218
|
@click=${l=>{l.stopPropagation(),this._lines=this._lines.filter((u,h)=>h!==a),this.saveResponse(this._lines)}}
|
|
220
219
|
/>
|
|
221
220
|
`)}
|
|
222
|
-
${this.startPoint&&
|
|
221
|
+
${this.startPoint&&He`<line
|
|
223
222
|
part="point"
|
|
224
223
|
x1=${this.startCoord.x}
|
|
225
224
|
y1=${this.startCoord.y}
|
|
@@ -230,7 +229,7 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
230
229
|
/>`}
|
|
231
230
|
</svg>
|
|
232
231
|
<slot></slot>
|
|
233
|
-
</line-container>`}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,n=s.getAttribute("coords"),o=s.getAttribute("shape"),a=n.split(",").map(l=>parseInt(l));
|
|
232
|
+
</line-container>`}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,n=s.getAttribute("coords"),o=s.getAttribute("shape"),a=n.split(",").map(l=>parseInt(l));Ce(o,a,r,s)}firstUpdated(e){super.firstUpdated(e),this.hotspots=document.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",r=>{this.mouseCoord={x:r.clientX-this.grImage[0].getBoundingClientRect().left,y:r.clientY-this.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(r=>{r.style.left=r.getAttribute("coords").split(",")[0]+"px",r.style.top=r.getAttribute("coords").split(",")[1]+"px",r.addEventListener("click",s=>{this.startPoint?this.endPoint||(this.endPoint=s.target,this._lines=[...this._lines,this.startPoint.getAttribute("identifier")+" "+this.endPoint.getAttribute("identifier")],this.saveResponse(this._lines),this.startPoint=null,this.endPoint=null):(this.startPoint=s.target,this.startCoord={x:this.startPoint.getAttribute("coords").split(",")[0],y:this.startPoint.getAttribute("coords").split(",")[1]})})})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};J.styles=[b`
|
|
234
233
|
slot:not([name='prompt']) {
|
|
235
234
|
// position: relative; /* qti-hotspot-choice relative to the slot */
|
|
236
235
|
display: block;
|
|
@@ -253,8 +252,8 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
253
252
|
top: 0px;
|
|
254
253
|
left: 0px;
|
|
255
254
|
}
|
|
256
|
-
`],c([
|
|
257
|
-
<slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),n=r.getAttribute("shape"),o=s.split(",").map(a=>parseInt(a));switch(n){case"circle":{let[a,l,u]=o;r.style.left=a-u+"px",r.style.top=l-u+"px",r.style.width=r.style.height=2*u+"px"}break;case"rect":{let[a,l,u,h]=o;r.style.left=a+"px",r.style.top=l+"px",r.style.width=u-a+"px",r.style.height=h-l+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};
|
|
255
|
+
`],c([A()],J.prototype,"_lines",2),c([A()],J.prototype,"startCoord",2),c([A()],J.prototype,"mouseCoord",2),c([Ne("svg")],J.prototype,"svgContainer",2),c([Zr({selector:"img"})],J.prototype,"grImage",2);customElements.define("qti-graphic-associate-interaction",J);var Ct=class extends z(f,"qti-gap-img",!1,"qti-associable-hotspot"){render(){return d` <slot></slot>
|
|
256
|
+
<slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),n=r.getAttribute("shape"),o=s.split(",").map(a=>parseInt(a));switch(n){case"circle":{let[a,l,u]=o;r.style.left=a-u+"px",r.style.top=l-u+"px",r.style.width=r.style.height=2*u+"px"}break;case"rect":{let[a,l,u,h]=o;r.style.left=a+"px",r.style.top=l+"px",r.style.width=u-a+"px",r.style.height=h-l+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};Ct.styles=b`
|
|
258
257
|
:host {
|
|
259
258
|
display: inline-block;
|
|
260
259
|
position: relative;
|
|
@@ -263,12 +262,12 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
263
262
|
display: flex;
|
|
264
263
|
gap: 1rem;
|
|
265
264
|
}
|
|
266
|
-
`;customElements.define("qti-graphic-gap-match-interaction",
|
|
265
|
+
`;customElements.define("qti-graphic-gap-match-interaction",Ct);var At=class extends k{render(){return d`
|
|
267
266
|
<slot name="prompt"></slot>
|
|
268
267
|
<!-- slot for the prompt -->
|
|
269
268
|
<slot></slot>
|
|
270
269
|
<!-- slot for the image and hotspots -->
|
|
271
|
-
`}setHotspotOrder(e){let{identifier:r}=e.detail,s=this._choiceElements.find(o=>o.getAttribute("identifier")===r),n=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,s.order==null){if(this._choiceElements.filter(o=>o.order>0).length>=n){this.choiceOrdering=!1;return}s.order=this._choiceElements.filter(o=>!!o.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(o=>(o.order>o.order&&o.order--,o)),s.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,n=s.getAttribute("coords"),o=s.getAttribute("shape"),a=n.split(",").map(l=>parseInt(l));
|
|
270
|
+
`}setHotspotOrder(e){let{identifier:r}=e.detail,s=this._choiceElements.find(o=>o.getAttribute("identifier")===r),n=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,s.order==null){if(this._choiceElements.filter(o=>o.order>0).length>=n){this.choiceOrdering=!1;return}s.order=this._choiceElements.filter(o=>!!o.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(o=>(o.order>o.order&&o.order--,o)),s.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,n=s.getAttribute("coords"),o=s.getAttribute("shape"),a=n.split(",").map(l=>parseInt(l));Ce(o,a,r,s)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this.setHotspotOrder),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this.setHotspotOrder),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};At.styles=[b`
|
|
272
271
|
slot:not([name='prompt']) {
|
|
273
272
|
position: relative; /* qti-hotspot-choice relative to the slot */
|
|
274
273
|
display: block;
|
|
@@ -279,12 +278,12 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
279
278
|
pointer-events: none;
|
|
280
279
|
user-select: none;
|
|
281
280
|
}
|
|
282
|
-
`];customElements.define("qti-graphic-order-interaction",
|
|
281
|
+
`];customElements.define("qti-graphic-order-interaction",At);var qt=class extends k{render(){return d`
|
|
283
282
|
<slot name="prompt"></slot>
|
|
284
283
|
<!-- slot for the prompt -->
|
|
285
284
|
<slot></slot>
|
|
286
285
|
<!-- slot for the image and hotspots -->
|
|
287
|
-
`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),n=r.getAttribute("shape"),o=s.split(",").map(a=>parseInt(a));
|
|
286
|
+
`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),n=r.getAttribute("shape"),o=s.split(",").map(a=>parseInt(a));Ce(n,o,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};qt.styles=[b`
|
|
288
287
|
slot:not([name='prompt']) {
|
|
289
288
|
position: relative; /* qti-hotspot-choice relative to the slot */
|
|
290
289
|
display: block;
|
|
@@ -296,19 +295,19 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
296
295
|
user-select: none;
|
|
297
296
|
/* width:100%; */
|
|
298
297
|
}
|
|
299
|
-
`];customElements.define("qti-hotspot-interaction",
|
|
298
|
+
`];customElements.define("qti-hotspot-interaction",qt);var br=class extends f{connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}render(){return d`
|
|
300
299
|
<slot></slot>
|
|
301
300
|
<slot name="qti-simple-associable-choice"></slot>
|
|
302
|
-
`}};customElements.define("qti-simple-associable-choice",
|
|
301
|
+
`}};customElements.define("qti-simple-associable-choice",br);var Ae=class extends z(f,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"){constructor(){super(...arguments);this.response=[];this.responseIdentifier=""}connectedCallback(){super.connectedCallback(),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[]}render(){return this.classList.contains("qti-match-tabular")?d`
|
|
303
302
|
<slot name="prompt"></slot>
|
|
304
303
|
<table>
|
|
305
304
|
<tr>
|
|
306
305
|
<td></td>
|
|
307
|
-
${this.cols.map((e,r)=>
|
|
306
|
+
${this.cols.map((e,r)=>d`<th part="r-header">${ye(e.innerHTML)}</th>`)}
|
|
308
307
|
</tr>
|
|
309
|
-
${this.rows.map((e,r)=>
|
|
310
|
-
<td part="c-header">${
|
|
311
|
-
${this.cols.map((s,n)=>{let o=`${e.getAttribute("identifier")} ${s.getAttribute("identifier")}`;return
|
|
308
|
+
${this.rows.map((e,r)=>d`<tr>
|
|
309
|
+
<td part="c-header">${ye(e.innerHTML)}</td>
|
|
310
|
+
${this.cols.map((s,n)=>{let o=`${e.getAttribute("identifier")} ${s.getAttribute("identifier")}`;return d`<td>
|
|
312
311
|
<input
|
|
313
312
|
type="checkbox"
|
|
314
313
|
value=${s.getAttribute("identifier")}
|
|
@@ -318,14 +317,14 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
318
317
|
</td>`})}
|
|
319
318
|
</tr>`)}
|
|
320
319
|
</table>
|
|
321
|
-
`:
|
|
322
|
-
<slot></slot>`}connectedCallback(){super.connectedCallback();let e=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");e&&e.addEventListener("ended",()=>{this.value++,this.saveResponse(this.value.toString())})}}
|
|
320
|
+
`:d`<slot name="prompt"></slot> <slot></slot>`}};Ae.styles=[],c([A()],Ae.prototype,"response",2),c([p({type:String,attribute:"response-identifier"})],Ae.prototype,"responseIdentifier",2);customElements.define("qti-match-interaction",Ae);var $t=class extends ${constructor(){super();this.value=0}reset(){}validate(){return!0}set response(e){}static get properties(){return R(x({},$.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return d` <slot name="prompt"></slot>
|
|
321
|
+
<slot></slot>`}connectedCallback(){super.connectedCallback();let e=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");e&&e.addEventListener("ended",()=>{this.value++,this.saveResponse(this.value.toString())})}};$t.styles=[b``];customElements.define("qti-media-interaction",$t);var qe=class extends z(f,"qti-simple-choice",!0,"drop-list"){render(){return d` <slot name="prompt"> </slot>
|
|
323
322
|
<div part="container">
|
|
324
323
|
<slot part="drags"> </slot>
|
|
325
324
|
<div part="drops">
|
|
326
|
-
${Array.from(this.querySelectorAll("qti-simple-choice")).map((e,r)=>
|
|
325
|
+
${Array.from(this.querySelectorAll("qti-simple-choice")).map((e,r)=>d`<drop-list part="drop-list" identifier="droplist${r}"></drop-list>`)}
|
|
327
326
|
</div>
|
|
328
|
-
</div>`}connectedCallback(){super.connectedCallback(),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(e=>e.setAttribute("part","qti-simple-choice"))}};
|
|
327
|
+
</div>`}connectedCallback(){super.connectedCallback(),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(e=>e.setAttribute("part","qti-simple-choice"))}};qe.layoutClass=["qti-choices-top","qti-choices-bottom","qti-choices-left","qti-choices-right"],qe.styles=[b`
|
|
329
328
|
[part='drags'] {
|
|
330
329
|
display: flex;
|
|
331
330
|
align-items: flex-start;
|
|
@@ -373,7 +372,7 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
373
372
|
:host(.qti-choices-right) [part='container'] {
|
|
374
373
|
flex-direction: row-reverse;
|
|
375
374
|
}
|
|
376
|
-
`],c([
|
|
375
|
+
`],c([p({type:String})],qe.prototype,"orientation",2);customElements.define("qti-order-interaction",qe);var wt=class extends f{render(){return d`<slot></slot>`}};wt.styles=[b`
|
|
377
376
|
:host {
|
|
378
377
|
display: block;
|
|
379
378
|
}
|
|
@@ -384,23 +383,23 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
384
383
|
left: 50%;
|
|
385
384
|
transform: translateX(-50%);
|
|
386
385
|
}
|
|
387
|
-
`];customElements.define("qti-position-object-interaction",
|
|
386
|
+
`];customElements.define("qti-position-object-interaction",wt);var St=class extends f{constructor(){super();this.removeMoveListener=this.removeMoveListener.bind(this),this.dragElementHandler=this.dragElementHandler.bind(this)}render(){return d`<slot></slot>`}dragElementHandler(e){e.preventDefault();let r=e.clientX-this.startX,s=e.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+r+"px",this.dragElement.style.top=this.dragElement.offsetTop+s+"px",this.startX=e.clientX,this.startY=e.clientY}firstUpdated(e){super.firstUpdated(e),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",r=>{this.startX=r.clientX,this.startY=r.clientY,document.addEventListener("mousemove",this.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}removeMoveListener(e){document.removeEventListener("mousemove",this.dragElementHandler,!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}};St.styles=[b`
|
|
388
387
|
:host {
|
|
389
388
|
display: inline-block;
|
|
390
389
|
position: relative;
|
|
391
390
|
}
|
|
392
|
-
`];customElements.define("qti-position-object-stage",
|
|
391
|
+
`];customElements.define("qti-position-object-stage",St);var bs="important",Ks=" !"+bs,gs=K(class extends O{constructor(i){var t;if(super(i),i.type!==W.ATTRIBUTE||i.name!=="style"||((t=i.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((t,e)=>{let r=i[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(i,[t]){let{style:e}=i.element;if(this.ut===void 0)return this.ut=new Set(Object.keys(t)),this.render(t);for(let r of this.ut)t[r]==null&&(this.ut.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(let r in t){let s=t[r];if(s!=null){this.ut.add(r);let n=typeof s=="string"&&s.endsWith(Ks);r.includes("-")||n?e.setProperty(r,n?s.slice(0,-11):s,n?bs:""):e[r]=s}}return M}});var de=class extends ${constructor(){super(...arguments);this.maxChoices=0;this.minChoices=0;this._points=[]}render(){return d` <slot name="prompt"></slot>
|
|
393
392
|
<point-container>
|
|
394
|
-
${
|
|
393
|
+
${_t(this._points,e=>e,(e,r)=>d`
|
|
395
394
|
<button
|
|
396
395
|
part="point"
|
|
397
|
-
style=${
|
|
396
|
+
style=${gs({position:"absolute",transform:"translate(-50%, -50%)",left:`${e.split(" ")[0]}px`,top:`${e.split(" ")[1]}px`})}
|
|
398
397
|
aria-label="Remove point at ${e}"
|
|
399
398
|
@click=${s=>{s.stopPropagation(),this._points=this._points.filter((n,o)=>o!==r),this.saveResponse(this._points)}}
|
|
400
399
|
></button>
|
|
401
400
|
`)}
|
|
402
401
|
<slot></slot>
|
|
403
|
-
</point-container>`}reset(){this._points=[]}validate(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}set response(e){this._points=Array.isArray(e)?e:[e]}connectedCallback(){super.connectedCallback(),this.querySelector("img").addEventListener("click",r=>{let s=r.offsetX,n=r.offsetY;this._points=[...this._points,s+" "+n],this.saveResponse(this._points)})}disconnectedCallback(){super.disconnectedCallback()}};
|
|
402
|
+
</point-container>`}reset(){this._points=[]}validate(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}set response(e){this._points=Array.isArray(e)?e:[e]}connectedCallback(){super.connectedCallback(),this.querySelector("img").addEventListener("click",r=>{let s=r.offsetX,n=r.offsetY;this._points=[...this._points,s+" "+n],this.saveResponse(this._points)})}disconnectedCallback(){super.disconnectedCallback()}};de.styles=[b`
|
|
404
403
|
:host {
|
|
405
404
|
display: block;
|
|
406
405
|
}
|
|
@@ -408,29 +407,29 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
408
407
|
display: block;
|
|
409
408
|
position: relative;
|
|
410
409
|
}
|
|
411
|
-
`],c([
|
|
410
|
+
`],c([p({type:Number,attribute:"max-choices"})],de.prototype,"maxChoices",2),c([p({type:Number,attribute:"min-choices"})],de.prototype,"minChoices",2),c([A()],de.prototype,"_points",2);customElements.define("qti-select-point-interaction",de);var L=class extends ${constructor(){super();this.stepLabel=!1;this.reverse=!1;this._handleDisabledChange=(e,r)=>{};this._handleReadonlyChange=(e,r)=>{};this.csLive=getComputedStyle(this)}set min(e){this._min=e,this.value=e,this.style.setProperty("--min",`${this._min}`)}get min(){return this._min}set max(e){this._max=e,this.style.setProperty("--max",`${this._max}`)}get max(){return this._max}set step(e){this._step=e,this.style.setProperty("--step",`${this._step}`)}get step(){return this._step}reset(){}validate(){return!0}set response(e){if(Array.isArray(e)){console.error("QtiSliderInteraction: response is an array, but should be a single value");return}let r=parseInt(e);if(Number.isNaN(r)){console.error("QtiSliderInteraction: response is not a number");return}this.value=r}render(){this.value<this.min&&(this.value=this.min),this.value>this.max&&(this.value=this.max);let e=(this.value-this.min)/(this.max-this.min)*100;return this.style.setProperty("--value-percentage",`${e}%`),this.setAttribute("aria-valuenow",this.value.toString()),d`<slot name="prompt"></slot>
|
|
412
411
|
<div id="slider" part="slider">
|
|
413
|
-
${this.csLive.getPropertyValue("--show-bounds")=="true"?
|
|
412
|
+
${this.csLive.getPropertyValue("--show-bounds")=="true"?d`<div id="bounds" part="bounds">
|
|
414
413
|
<div>${this._min}</div>
|
|
415
414
|
<div>${this._max}</div>
|
|
416
|
-
</div>`:
|
|
417
|
-
${this.csLive.getPropertyValue("--show-ticks")=="true"?
|
|
415
|
+
</div>`:E}
|
|
416
|
+
${this.csLive.getPropertyValue("--show-ticks")=="true"?d`<div id="ticks" part="ticks"></div>`:E}
|
|
418
417
|
<div id="rail" part="rail" @mousedown=${this._onMouseDown} @touchstart=${this._onTouchMove}>
|
|
419
418
|
<div id="knob" part="knob">
|
|
420
|
-
${this.csLive.getPropertyValue("--show-value")=="true"?
|
|
419
|
+
${this.csLive.getPropertyValue("--show-value")=="true"?d`<div id="value" part="value">${this.value}</div>`:E}
|
|
421
420
|
</div>
|
|
422
421
|
</div>
|
|
423
|
-
</div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(e){let r=a=>{let{x:l}=this.getPositionFromEvent(a),u=l-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(u),a.stopPropagation()},s=()=>{document.removeEventListener("touchmove",r),document.removeEventListener("touchend",s),this.saveResponse(this.value.toString())};document.addEventListener("touchmove",r),document.addEventListener("touchend",s);let{x:n}=this.getPositionFromEvent(e),o=n-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(o),e.stopPropagation()}_onMouseDown(e){let r=o=>{let a=o.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),o.preventDefault(),o.stopPropagation()},s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s),this.saveResponse(this.value.toString())};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s);let n=e.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(n),e.preventDefault(),e.stopPropagation()}calculateValue(e){let r=this.min+(this.max-this.min)*e/this._rail.getBoundingClientRect().width,s=this.min+Math.round((r-this.min)/this._step)*this._step;this.value=s}getPositionFromEvent(e){let r;if(e.type=="touchstart"||e.type=="touchmove"||e.type=="touchend"||e.type=="touchcancel"){let s=typeof e.originalEvent=="undefined"?e:e.originalEvent,n=s.touches[0]||s.changedTouches[0];r={x:n.pageX,y:n.pageY}}else(e.type=="mousedown"||e.type=="mouseup"||e.type=="mousemove"||e.type=="mouseover"||e.type=="mouseout"||e.type=="mouseenter"||e.type=="mouseleave")&&(r={x:e.clientX,y:e.clientY});return r}};L.styles=[b``],c([
|
|
422
|
+
</div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(e){let r=a=>{let{x:l}=this.getPositionFromEvent(a),u=l-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(u),a.stopPropagation()},s=()=>{document.removeEventListener("touchmove",r),document.removeEventListener("touchend",s),this.saveResponse(this.value.toString())};document.addEventListener("touchmove",r),document.addEventListener("touchend",s);let{x:n}=this.getPositionFromEvent(e),o=n-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(o),e.stopPropagation()}_onMouseDown(e){let r=o=>{let a=o.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),o.preventDefault(),o.stopPropagation()},s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s),this.saveResponse(this.value.toString())};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s);let n=e.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(n),e.preventDefault(),e.stopPropagation()}calculateValue(e){let r=this.min+(this.max-this.min)*e/this._rail.getBoundingClientRect().width,s=this.min+Math.round((r-this.min)/this._step)*this._step;this.value=s}getPositionFromEvent(e){let r;if(e.type=="touchstart"||e.type=="touchmove"||e.type=="touchend"||e.type=="touchcancel"){let s=typeof e.originalEvent=="undefined"?e:e.originalEvent,n=s.touches[0]||s.changedTouches[0];r={x:n.pageX,y:n.pageY}}else(e.type=="mousedown"||e.type=="mouseup"||e.type=="mousemove"||e.type=="mouseover"||e.type=="mouseout"||e.type=="mouseenter"||e.type=="mouseleave")&&(r={x:e.clientX,y:e.clientY});return r}};L.styles=[b``],c([Ne("#knob")],L.prototype,"_knob",2),c([Ne("#rail")],L.prototype,"_rail",2),c([p({type:Number})],L.prototype,"value",2),c([p({type:Boolean,attribute:"step-label"})],L.prototype,"stepLabel",2),c([p({type:Boolean})],L.prototype,"reverse",2),c([p({type:Number,attribute:"lower-bound"})],L.prototype,"min",1),c([p({type:Number,attribute:"upper-bound"})],L.prototype,"max",1),c([p({type:Number,attribute:"step"})],L.prototype,"step",1),c([w("disabled",{waitUntilFirstUpdate:!0})],L.prototype,"_handleDisabledChange",2),c([w("readonly",{waitUntilFirstUpdate:!0})],L.prototype,"_handleReadonlyChange",2);customElements.define("qti-slider-interaction",L);var $e=class extends ${constructor(){super(...arguments);this.countAttempt="true"}validate(){return!0}set response(e){}render(){return d`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`}endAttempt(e){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}};c([p({type:String,attribute:"count-attempt"})],$e.prototype,"countAttempt",2),c([p({type:String})],$e.prototype,"title",2),$e=c([C("qti-end-attempt-interaction")],$e);var Rt=class extends f{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,cancelable:!1,composed:!0}))}render(){return d` <slot name="qti-gap-img"></slot> `}};Rt.styles=b`
|
|
424
423
|
:host {
|
|
425
424
|
position: absolute;
|
|
426
425
|
}
|
|
427
|
-
`;customElements.define("qti-associable-hotspot"
|
|
426
|
+
`;customElements.define("qti-associable-hotspot",Rt);var kt=class extends f{constructor(){super(...arguments);this.tabindex=0}render(){return d` <slot name="qti-gap-text"></slot>`}};c([p({type:Number,reflect:!0})],kt.prototype,"tabindex",2);customElements.define("qti-gap",kt);var Tt=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","qti-gap-img")}};c([p({type:Number,reflect:!0})],Tt.prototype,"tabindex",2);customElements.define("qti-gap-img",Tt);var Lt=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-gap-text")}render(){return d`<slot></slot>`}};c([p({type:Number,reflect:!0})],Lt.prototype,"tabindex",2);customElements.define("qti-gap-text",Lt);var ze=class extends T{};ze.styles=b`
|
|
428
427
|
:host {
|
|
429
428
|
position: absolute;
|
|
430
429
|
}
|
|
431
|
-
`,c([
|
|
432
|
-
<slot></slot> `}};
|
|
433
|
-
<slot part="slot"></slot> `}};
|
|
430
|
+
`,c([p({attribute:"aria-ordervalue",type:Number,reflect:!0})],ze.prototype,"order",2);customElements.define("qti-hotspot-choice",ze);var Mt=class extends T{render(){return d`<div part="ch"><div part="cha"></div></div>
|
|
431
|
+
<slot></slot> `}};Mt=c([C("qti-hottext")],Mt);var gr=class extends f{};customElements.define("qti-inline-choice",gr);var Xe=class extends T{render(){return d`<div part="ch"><div part="cha"></div></div>
|
|
432
|
+
<slot part="slot"></slot> `}};Xe.styles=b`
|
|
434
433
|
:host {
|
|
435
434
|
display: flex;
|
|
436
435
|
}
|
|
@@ -438,174 +437,174 @@ Make sure to test your application with a production build as repeat registratio
|
|
|
438
437
|
width: 100%;
|
|
439
438
|
display: block;
|
|
440
439
|
}
|
|
441
|
-
`,
|
|
440
|
+
`,Xe=c([C("qti-simple-choice")],Xe);export{$ as Interaction,Be as QtPrintedVariable,mt as QtiAnd,P as QtiAssessmentItem,Rt as QtiAssociableHotspot,je as QtiAssociateInteraction,ft as QtiBaseValue,T as QtiChoice,xe as QtiChoiceInteraction,it as QtiCompanionMaterialsInfo,H as QtiConditionExpression,Qt as QtiContains,er as QtiCorrect,$e as QtiEndAttemptInteraction,gt as QtiEqual,bt as QtiEqualRounded,v as QtiExpression,B as QtiExtendedTextInteraction,nt as QtiFeedbackBlock,at as QtiFeedbackInline,kt as QtiGap,Tt as QtiGapImg,Et as QtiGapMatchInteraction,Lt as QtiGapText,J as QtiGraphicAssociateInteraction,Ct as QtiGraphicGapMatchInteraction,At as QtiGraphicOrderInteraction,tr as QtiGt,rr as QtiGte,ze as QtiHotspotChoice,qt as QtiHotspotInteraction,Mt as QtiHottext,Kt as QtiHottextInteraction,gr as QtiInlineChoice,pe as QtiInlineChoiceInteraction,sr as QtiIsNull,ht as QtiLookupOutcomeValue,ir as QtiLt,or as QtiLte,vt as QtiMapResponse,_e as QtiMapping,nr as QtiMatch,Ae as QtiMatchInteraction,$t as QtiMediaInteraction,ar as QtiMember,lt as QtiModalFeedback,lr as QtiMultiple,cr as QtiNot,pr as QtiOr,qe as QtiOrderInteraction,dr as QtiOrdered,ee as QtiOutcomeDeclaration,fr as QtiPortableCustomInteraction,St as QtiPositionObjectStage,ur as QtiProduct,jt as QtiPrompt,Jt as QtiResponseCondition,te as QtiResponseDeclaration,Ie as QtiResponseElse,Gt as QtiResponseElseIf,Fe as QtiResponseIf,Ee as QtiResponseProcessing,j as QtiRule,wt as QtiSPositionObjectInteraction,de as QtiSelectPointInteraction,Zt as QtiSetOutcomeValue,br as QtiSimpleAssociableChoice,Xe as QtiSimpleChoice,L as QtiSliderInteraction,yt as QtiStringMatch,zt as QtiStylesheet,hr as QtiSum,U as QtiTextEntryInteraction,mr as QtiVariable,Q as itemContext,Ws as qtiAndMixin,ot as qtiContentBody,I as qtiRubricBlock};
|
|
442
441
|
/*! Bundled license information:
|
|
443
442
|
|
|
444
|
-
@lit/
|
|
443
|
+
@lit/context/lib/context-request-event.js:
|
|
445
444
|
(**
|
|
446
445
|
* @license
|
|
447
|
-
* Copyright
|
|
446
|
+
* Copyright 2021 Google LLC
|
|
448
447
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
449
448
|
*)
|
|
450
449
|
|
|
451
|
-
@lit
|
|
450
|
+
@lit/context/lib/create-context.js:
|
|
452
451
|
(**
|
|
453
452
|
* @license
|
|
454
|
-
* Copyright
|
|
453
|
+
* Copyright 2021 Google LLC
|
|
455
454
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
456
455
|
*)
|
|
457
456
|
|
|
458
|
-
@lit
|
|
457
|
+
@lit/context/lib/controllers/context-consumer.js:
|
|
459
458
|
(**
|
|
460
459
|
* @license
|
|
461
|
-
* Copyright
|
|
460
|
+
* Copyright 2021 Google LLC
|
|
462
461
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
463
462
|
*)
|
|
464
463
|
|
|
465
|
-
@lit/
|
|
464
|
+
@lit/context/lib/value-notifier.js:
|
|
466
465
|
(**
|
|
467
466
|
* @license
|
|
468
|
-
* Copyright
|
|
467
|
+
* Copyright 2021 Google LLC
|
|
469
468
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
470
469
|
*)
|
|
471
470
|
|
|
472
|
-
@lit/
|
|
471
|
+
@lit/context/lib/controllers/context-provider.js:
|
|
473
472
|
(**
|
|
474
473
|
* @license
|
|
475
|
-
* Copyright
|
|
474
|
+
* Copyright 2021 Google LLC
|
|
476
475
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
477
476
|
*)
|
|
478
477
|
|
|
479
|
-
@lit/
|
|
478
|
+
@lit/context/lib/context-root.js:
|
|
480
479
|
(**
|
|
481
480
|
* @license
|
|
482
|
-
* Copyright
|
|
481
|
+
* Copyright 2021 Google LLC
|
|
483
482
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
484
483
|
*)
|
|
485
484
|
|
|
486
|
-
@lit/
|
|
485
|
+
@lit/context/lib/decorators/provide.js:
|
|
487
486
|
(**
|
|
488
487
|
* @license
|
|
489
488
|
* Copyright 2017 Google LLC
|
|
490
489
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
491
490
|
*)
|
|
492
491
|
|
|
493
|
-
@lit/
|
|
492
|
+
@lit/context/lib/decorators/consume.js:
|
|
494
493
|
(**
|
|
495
494
|
* @license
|
|
496
|
-
* Copyright
|
|
495
|
+
* Copyright 2022 Google LLC
|
|
497
496
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
498
497
|
*)
|
|
499
498
|
|
|
500
|
-
@lit/
|
|
499
|
+
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|
|
501
500
|
(**
|
|
502
501
|
* @license
|
|
503
|
-
* Copyright
|
|
502
|
+
* Copyright 2023 Google LLC
|
|
504
503
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
505
504
|
*)
|
|
506
505
|
|
|
507
|
-
@lit/
|
|
506
|
+
@lit-labs/ssr-dom-shim/index.js:
|
|
508
507
|
(**
|
|
509
508
|
* @license
|
|
510
|
-
* Copyright
|
|
509
|
+
* Copyright 2019 Google LLC
|
|
511
510
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
512
511
|
*)
|
|
513
512
|
|
|
514
|
-
@lit/reactive-element/node/
|
|
513
|
+
@lit/reactive-element/node/css-tag.js:
|
|
515
514
|
(**
|
|
516
515
|
* @license
|
|
517
|
-
* Copyright
|
|
516
|
+
* Copyright 2019 Google LLC
|
|
518
517
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
519
518
|
*)
|
|
520
519
|
|
|
521
|
-
|
|
520
|
+
lit-html/node/lit-html.js:
|
|
522
521
|
(**
|
|
523
522
|
* @license
|
|
524
|
-
* Copyright
|
|
523
|
+
* Copyright 2017 Google LLC
|
|
525
524
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
526
525
|
*)
|
|
527
526
|
|
|
528
|
-
|
|
527
|
+
lit-element/lit-element.js:
|
|
529
528
|
(**
|
|
530
529
|
* @license
|
|
531
530
|
* Copyright 2017 Google LLC
|
|
532
531
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
533
532
|
*)
|
|
534
533
|
|
|
535
|
-
lit-html/node/
|
|
534
|
+
lit-html/node/is-server.js:
|
|
536
535
|
(**
|
|
537
536
|
* @license
|
|
538
|
-
* Copyright
|
|
537
|
+
* Copyright 2022 Google LLC
|
|
539
538
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
540
539
|
*)
|
|
541
540
|
|
|
542
|
-
lit-element/
|
|
541
|
+
@lit/reactive-element/node/decorators/custom-element.js:
|
|
543
542
|
(**
|
|
544
543
|
* @license
|
|
545
544
|
* Copyright 2017 Google LLC
|
|
546
545
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
547
546
|
*)
|
|
548
547
|
|
|
549
|
-
lit-
|
|
548
|
+
@lit/reactive-element/node/decorators/property.js:
|
|
550
549
|
(**
|
|
551
550
|
* @license
|
|
552
|
-
* Copyright
|
|
551
|
+
* Copyright 2017 Google LLC
|
|
553
552
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
554
553
|
*)
|
|
555
554
|
|
|
556
|
-
@lit/
|
|
555
|
+
@lit/reactive-element/node/decorators/state.js:
|
|
557
556
|
(**
|
|
558
557
|
* @license
|
|
559
|
-
* Copyright
|
|
558
|
+
* Copyright 2017 Google LLC
|
|
560
559
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
561
560
|
*)
|
|
562
561
|
|
|
563
|
-
@lit/
|
|
562
|
+
@lit/reactive-element/node/decorators/event-options.js:
|
|
564
563
|
(**
|
|
565
564
|
* @license
|
|
566
|
-
* Copyright
|
|
565
|
+
* Copyright 2017 Google LLC
|
|
567
566
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
568
567
|
*)
|
|
569
568
|
|
|
570
|
-
@lit/
|
|
569
|
+
@lit/reactive-element/node/decorators/base.js:
|
|
571
570
|
(**
|
|
572
571
|
* @license
|
|
573
|
-
* Copyright
|
|
572
|
+
* Copyright 2017 Google LLC
|
|
574
573
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
575
574
|
*)
|
|
576
575
|
|
|
577
|
-
@lit/
|
|
576
|
+
@lit/reactive-element/node/decorators/query.js:
|
|
578
577
|
(**
|
|
579
578
|
* @license
|
|
580
|
-
* Copyright
|
|
579
|
+
* Copyright 2017 Google LLC
|
|
581
580
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
582
581
|
*)
|
|
583
582
|
|
|
584
|
-
@lit/
|
|
583
|
+
@lit/reactive-element/node/decorators/query-all.js:
|
|
585
584
|
(**
|
|
586
585
|
* @license
|
|
587
|
-
* Copyright
|
|
586
|
+
* Copyright 2017 Google LLC
|
|
588
587
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
589
588
|
*)
|
|
590
589
|
|
|
591
|
-
@lit/
|
|
590
|
+
@lit/reactive-element/node/decorators/query-async.js:
|
|
592
591
|
(**
|
|
593
592
|
* @license
|
|
594
|
-
* Copyright
|
|
593
|
+
* Copyright 2017 Google LLC
|
|
595
594
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
596
595
|
*)
|
|
597
596
|
|
|
598
|
-
@lit/
|
|
597
|
+
@lit/reactive-element/node/decorators/query-assigned-elements.js:
|
|
599
598
|
(**
|
|
600
599
|
* @license
|
|
601
|
-
* Copyright
|
|
600
|
+
* Copyright 2021 Google LLC
|
|
602
601
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
603
602
|
*)
|
|
604
603
|
|
|
605
|
-
@lit/
|
|
604
|
+
@lit/reactive-element/node/decorators/query-assigned-nodes.js:
|
|
606
605
|
(**
|
|
607
606
|
* @license
|
|
608
|
-
* Copyright
|
|
607
|
+
* Copyright 2017 Google LLC
|
|
609
608
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
610
609
|
*)
|
|
611
610
|
|