jclic 2.1.13 → 2.1.15
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/CHANGELOG.md +10 -0
- package/build-locales.js +2 -2
- package/dist/jclic-node.js +14 -14
- package/dist/jclic-node.js.map +1 -1
- package/dist/jclic.components.LICENSE +2 -2
- package/dist/jclic.min.js +2 -2
- package/dist/jclic.min.js.map +1 -1
- package/package.json +11 -11
- package/src/GlobalData.js +1 -1
- package/src/JClicPlayer.js +1 -1
- package/src/Utils.js +2 -2
- package/src/activities/text/FillInBlanks.js +3 -3
- package/src/boxes/ActiveBoxContent.js +1 -1
- package/src/boxes/BoxBase.js +3 -3
- package/src/skins/Counter.js +1 -1
- package/src/skins/Skin.js +2 -2
package/dist/jclic.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
JClic.js version 2.1.
|
|
2
|
+
JClic.js version 2.1.15 (2023-10-20)
|
|
3
3
|
HTML5 player for JClic activities
|
|
4
4
|
https://projectestac.github.io/jclic.js
|
|
5
5
|
|
|
@@ -23,5 +23,5 @@ For full license information of included components please see: jclic.components
|
|
|
23
23
|
WARNING: This is a compressed version of JClic.js. Full source code is freely available at:
|
|
24
24
|
https://projectestac.github.io/jclic.js
|
|
25
25
|
*/
|
|
26
|
-
!function(){var t={390:function(t){t.exports=function(){function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};e[s][0].call(u.exports,(function(t){return r(e[s][1][t]||t)}),u,u.exports,t,e,n,i)}return n[s].exports}for(var o=void 0,s=0;s<i.length;s++)r(i[s]);return r}return t}()({1:[function(t,e,n){function i(t){const e=t.createGain(),n=e._voltage=s(t),i=a(n),o=a(n),c=a(n);return e._startAmount=a(o),e._endAmount=a(c),e._multiplier=a(i),e._multiplier.connect(e),e._startAmount.connect(e),e._endAmount.connect(e),e.value=i.gain,e.startValue=o.gain,e.endValue=c.gain,e.startValue.value=0,e.endValue.value=0,Object.defineProperties(e,r),e}const r={attack:{value:0,writable:!0},decay:{value:0,writable:!0},sustain:{value:1,writable:!0},release:{value:0,writable:!0},getReleaseDuration:{value:function(){return this.release}},start:{value:function(t){const e=this._multiplier.gain,n=this._startAmount.gain,i=this._endAmount.gain;this._voltage.start(t),this._decayFrom=this._decayFrom=t+this.attack,this._startedAt=t;const r=this.sustain;e.cancelScheduledValues(t),n.cancelScheduledValues(t),i.cancelScheduledValues(t),i.setValueAtTime(0,t),this.attack?(e.setValueAtTime(0,t),e.linearRampToValueAtTime(1,t+this.attack),n.setValueAtTime(1,t),n.linearRampToValueAtTime(0,t+this.attack)):(e.setValueAtTime(1,t),n.setValueAtTime(0,t)),this.decay&&e.setTargetAtTime(r,this._decayFrom,c(this.decay))}},stop:{value:function(t,e){e&&(t-=this.release);const n=t+this.release;if(this.release){const e=this._multiplier.gain,n=this._startAmount.gain,i=this._endAmount.gain;e.cancelScheduledValues(t),n.cancelScheduledValues(t),i.cancelScheduledValues(t);const r=c(this.release);if(this.attack&&t<this._decayFrom){const i=u(0,1,this._startedAt,this._decayFrom,t);e.linearRampToValueAtTime(i,t),n.linearRampToValueAtTime(1-i,t),n.setTargetAtTime(0,t,r)}i.setTargetAtTime(1,t,r),e.setTargetAtTime(0,t,r)}return this._voltage.stop(n),n}},onended:{get:function(){return this._voltage.onended},set:function(t){this._voltage.onended=t}}},o=new Float32Array([1,1]);function s(t){const e=t.createBufferSource(),n=t.createBuffer(1,2,t.sampleRate);return n.getChannelData(0).set(o),e.buffer=n,e.loop=!0,e}function a(t){const e=t.context.createGain();return t.connect(e),e}function c(t){return Math.log(t+1)/Math.log(100)}function u(t,e,n,i,r){let o=t+(r-n)/(i-n)*(e-t);return o<=t&&(o=t),o>=e&&(o=e),o}e.exports=i},{}],2:[function(t,e,n){"use strict";function i(t){return t>64&&t<91?t-65:t>96&&t<123?t-71:t>47&&t<58?t+4:43===t?62:47===t?63:0}function r(t,e){const n=t.replace(/[^A-Za-z0-9\+\/]/g,""),r=n.length,o=e?Math.ceil((3*r+1>>2)/e)*e:3*r+1>>2,s=new Uint8Array(o);for(let t,e,a=0,c=0,u=0;u<r;u++)if(e=3&u,a|=i(n.charCodeAt(u))<<18-6*e,3===e||r-u==1){for(t=0;t<3&&c<o;t++,c++)s[c]=a>>>(16>>>t&24)&255;a=0}return s}e.exports={decode:r}},{}],3:[function(t,e,n){"use strict";e.exports=function(t,e){return new Promise((function(n,i){const r=new XMLHttpRequest;e&&(r.responseType=e),r.open("GET",t),r.onload=function(){200===r.status&&n(r.response),i(Error(r.statusText))},r.onerror=()=>i(Error("Network Error")),r.send()}))}},{}],4:[function(t,e,n){"use strict";const i=t("./base64"),r=t("./fetch");function o(t){return function(e){return"string"==typeof e&&t.test(e)}}function s(t,e){return"string"==typeof t?t+e:"function"==typeof t?t(e):e}function a(t,e,n,i){const r=c(e)?u:l(e)?h:f(e)?p:d(e)?v:y(e)?m:g(e)?b:w(e)?k:A(e)?S:null;return r?r(t,e,n||{}):i?Promise.resolve(i):Promise.reject(`Source not valid (${e})`)}function c(t){return t instanceof ArrayBuffer}function u(t,e,n){return new Promise((function(n,i){t.decodeAudioData(e,(function(t){n(t)}),(function(){i(`Can't decode audio data (${e.slice(0,30)}...)`)}))}))}a.fetch=r;const l=o(/\.(mp3|wav|ogg)(\?.*)?$/i);function h(t,e,n){const i=s(n.from,e);return a(t,a.fetch(i,"arraybuffer"),n)}function f(t){return t&&"function"==typeof t.then}function p(t,e,n){return e.then((function(e){return a(t,e,n)}))}const d=Array.isArray;function v(t,e,n){return Promise.all(e.map((e=>a(t,e,n,e))))}function y(t){return t&&"object"==typeof t}function m(t,e,n){const i={},r=Object.keys(e).map((function(r){if(n.only&&-1===n.only.indexOf(r))return null;const o=e[r];return a(t,o,n,o).then((t=>{i[r]=t}))}));return Promise.all(r).then((()=>i))}const g=o(/\.json(\?.*)?$/i);function b(t,e,n){const i=s(n.from,e);return a(t,a.fetch(i,"text").then(JSON.parse),n)}const w=o(/^data:audio/);function k(t,e,n){const r=e.indexOf(",");return a(t,i.decode(e.slice(r+1)).buffer,n)}const A=o(/\.js(\?.*)?$/i);function S(t,e,n){const i=s(n.from,e);return a(t,a.fetch(i,"text").then(x),n)}function x(t){let e=t.indexOf("MIDI.Soundfont.");if(e<0)throw Error("Invalid MIDI.js Soundfont format");e=t.indexOf("=",e)+2;const n=t.lastIndexOf(",");return JSON.parse(t.slice(e,n)+"}")}e.exports={load:a}},{"./base64":2,"./fetch":3}],5:[function(t,e,n){const i={VERSION:"2.0.4",NOTES:[],CIRCLE_OF_FOURTHS:["C","F","Bb","Eb","Ab","Db","Gb","Cb","Fb","Bbb","Ebb","Abb"],CIRCLE_OF_FIFTHS:["C","G","D","A","E","B","F#","C#","G#","D#","A#","E#"]},r=[["C"],["C#","Db"],["D"],["D#","Eb"],["E"],["F"],["F#","Gb"],["G"],["G#","Ab"],["A"],["A#","Bb"],["B"]];let o=0;for(let t=-1;t<=9;t++)r.forEach((e=>{e.forEach((e=>i.NOTES[o]=e+t)),o++}));e.exports.Constants=i},{}],6:[function(t,e,n){const i=t("./player"),r=t("./soundfont-player/index");e.exports={Player:i.Player,Soundfont:r.Soundfont}},{"./player":8,"./soundfont-player/index":14}],7:[function(t,e,n){"use strict";const i=(t,e)=>Array(e+1).join(t),r=t=>"number"==typeof t,o=t=>"string"==typeof t,s=t=>void 0!==t,a=(t,e)=>Math.pow(2,(t-69)/12)*(e||440),c=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function u(){return c}const l=[0,2,4,5,7,9,11];function h(t,e,n){if("string"!=typeof t)return null;const i=c.exec(t);if(!i||!e&&i[4])return null;const r={letter:i[1].toUpperCase(),acc:i[2].replace(/x/g,"##")};r.pc=r.letter+r.acc,r.step=(r.letter.charCodeAt(0)+3)%7,r.alt="b"===r.acc[0]?-r.acc.length:r.acc.length;const o=l[r.step]+r.alt;return r.chroma=o<0?12+o:o%12,i[3]&&(r.oct=+i[3],r.midi=o+12*(r.oct+1),r.freq=a(r.midi,n)),e&&(r.tonicOf=i[4]),r}const f="CDEFGAB",p=t=>r(t)?t<0?i("b",-t):i("#",t):"",d=t=>r(t)?""+t:"";function v(t,e,n){return null==t?null:t.step?v(t.step,t.alt,t.oct):t<0||t>6?null:f.charAt(t)+p(e)+d(n)}function y(t){if((r(t)||o(t))&&t>=0&&t<128)return+t;const e=h(t);return e&&s(e.midi)?e.midi:null}function m(t,e){const n=y(t);return null===n?null:a(n,e)}const g=t=>(h(t)||{}).letter,b=t=>(h(t)||{}).acc,w=t=>(h(t)||{}).pc,k=t=>(h(t)||{}).step,A=t=>(h(t)||{}).alt,S=t=>(h(t)||{}).chroma,x=t=>(h(t)||{}).oct;e.exports={regex:u,parse:h,build:v,midi:y,freq:m,letter:g,acc:b,pc:w,step:k,alt:A,chroma:S,oct:x}},{}],8:[function(t,e,n){const i=t("./utils").Utils,r=t("./track").Track;Uint8Array.prototype.forEach||Object.defineProperty(Uint8Array.prototype,"forEach",{value:Array.prototype.forEach});class o{constructor(t,e){this.sampleRate=5,this.startTime=0,this.buffer=e||null,this.division,this.format,this.setIntervalId=!1,this.tracks=[],this.instruments=[],this.defaultTempo=120,this.tempo=null,this.startTick=0,this.tick=0,this.lastTick=null,this.inLoop=!1,this.totalTicks=0,this.events=[],this.totalEvents=0,this.eventListeners={},"function"==typeof t&&this.on("midiEvent",t)}loadFile(e){const n=t("fs");return this.buffer=n.readFileSync(e),this.fileLoaded()}loadArrayBuffer(t){return this.buffer=new Uint8Array(t),this.fileLoaded()}loadDataUri(t){const e=window.atob(t.split(",")[1]),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return this.buffer=n,this.fileLoaded()}getFilesize(){return this.buffer?this.buffer.length:0}fileLoaded(){if(!this.validate())throw"Invalid MIDI file; should start with MThd";return this.setTempo(this.defaultTempo).getDivision().getFormat().getTracks().dryRun()}validate(){return"MThd"===i.bytesToLetters(this.buffer.subarray(0,4))}getFormat(){return this.format=i.bytesToNumber(this.buffer.subarray(8,10)),this}getTracks(){this.tracks=[];let t=0;for(;t<this.buffer.length;){if("MTrk"==i.bytesToLetters(this.buffer.subarray(t,t+4))){let e=i.bytesToNumber(this.buffer.subarray(t+4,t+8));this.tracks.push(new r(this.tracks.length,this.buffer.subarray(t+8,t+8+e)))}t+=i.bytesToNumber(this.buffer.subarray(t+4,t+8))+8}return this}enableTrack(t){return this.tracks[t-1].enable(),this}disableTrack(t){return this.tracks[t-1].disable(),this}getDivision(){return this.division=i.bytesToNumber(this.buffer.subarray(12,14)),this}playLoop(t){this.inLoop||(this.inLoop=!0,this.tick=this.getCurrentTick(),this.tracks.forEach((function(e){if(!t&&this.endOfFile())this.triggerPlayerEvent("endOfFile"),this.stop();else{let n=e.handleEvent(this.tick,t);t&&n?(n.hasOwnProperty("name")&&"Set Tempo"===n.name&&this.setTempo(n.data),n.hasOwnProperty("name")&&"Program Change"===n.name&&(this.instruments.includes(n.value)||this.instruments.push(n.value))):n&&this.emitEvent(n)}}),this),t||this.triggerPlayerEvent("playing",{tick:this.tick}),this.inLoop=!1)}setTempo(t){return this.tempo=t,this}setStartTime(t){this.startTime=t}play(){if(this.isPlaying())throw"Already playing...";return this.startTime||(this.startTime=(new Date).getTime()),this.setIntervalId=window.setInterval(this.playLoop.bind(this),this.sampleRate),this}pause(){return clearInterval(this.setIntervalId),this.setIntervalId=!1,this.startTick=this.tick,this.startTime=0,this}stop(){return clearInterval(this.setIntervalId),this.setIntervalId=!1,this.startTick=0,this.startTime=0,this.resetTracks(),this}skipToTick(t){return this.stop(),this.startTick=t,this.tracks.forEach((function(e){e.setEventIndexByTick(t)})),this}skipToPercent(t){if(t<0||t>100)throw"Percent must be number between 1 and 100.";return this.skipToTick(Math.round(t/100*this.totalTicks)),this}skipToSeconds(t){const e=this.getSongTime();if(t<0||t>e)throw`${t} seconds not within song time of ${e}`;return this.skipToPercent(t/e*100),this}isPlaying(){return this.setIntervalId>0||"object"==typeof this.setIntervalId}dryRun(){for(this.resetTracks();!this.endOfFile();)this.playLoop(!0);return this.events=this.getEvents(),this.totalEvents=this.getTotalEvents(),this.totalTicks=this.getTotalTicks(),this.startTick=0,this.startTime=0,this.resetTracks(),this.triggerPlayerEvent("fileLoaded",this),this}resetTracks(){return this.tracks.forEach((t=>t.reset())),this}getEvents(){return this.tracks.map((t=>t.events))}getTotalTicks(){return Math.max.apply(null,this.tracks.map((t=>t.delta)))}getTotalEvents(){return this.tracks.reduce(((t,e)=>({events:{length:t.events.length+e.events.length}})),{events:{length:0}}).events.length}getSongTime(){return this.totalTicks/this.division/this.tempo*60}getSongTimeRemaining(){return Math.round((this.totalTicks-this.tick)/this.division/this.tempo*60)}getSongPercentRemaining(){return Math.round(this.getSongTimeRemaining()/this.getSongTime()*100)}bytesProcessed(){return 14+8*this.tracks.length+this.tracks.reduce(((t,e)=>({pointer:t.pointer+e.pointer})),{pointer:0}).pointer}eventsPlayed(){return this.tracks.reduce(((t,e)=>({eventIndex:t.eventIndex+e.eventIndex})),{eventIndex:0}).eventIndex}endOfFile(){return this.isPlaying()?this.eventsPlayed()==this.totalEvents:this.bytesProcessed()==this.buffer.length}getCurrentTick(){return Math.round(((new Date).getTime()-this.startTime)/1e3*(this.division*(this.tempo/60)))+this.startTick}emitEvent(t){return this.triggerPlayerEvent("midiEvent",t),this}on(t,e){return this.eventListeners.hasOwnProperty(t)||(this.eventListeners[t]=[]),this.eventListeners[t].push(e),this}triggerPlayerEvent(t,e){return this.eventListeners.hasOwnProperty(t)&&this.eventListeners[t].forEach((t=>t(e||{}))),this}}e.exports={Player:o}},{"./track":15,"./utils":16,fs:void 0}],9:[function(t,e,n){function i(t,e){return function(n,i,r,o){t(n,i,r,o),e(n,i,r,o)}}e.exports=function(t){return t.on=function(e,n){if(1===arguments.length&&"function"==typeof e)return t.on("event",e);var r="on"+e,o=t[r];return t[r]=o?i(o,n):n,t},t}},{}],10:[function(t,e,n){"use strict";const i=t("./player"),r=t("./events"),o=t("./notes"),s=t("./scheduler");function a(t,e,n){return s(o(r(i(t,e,n))))}e.exports={SamplePlayer:a}},{"./events":9,"./notes":11,"./player":12,"./scheduler":13}],11:[function(t,e,n){"use strict";var i=t("../note-parser/index"),r=function(t){return null!==t&&t!==[]&&t>=0&&t<129},o=function(t){return r(t)?+t:i.midi(t)};function s(t,e){return Object.keys(t).reduce((function(n,i){return n[e(i)]=t[i],n}),{})}e.exports=function(t){if(t.buffers){var e=t.opts.map,n="function"==typeof e?e:o,i=function(t){return t?n(t)||t:null};t.buffers=s(t.buffers,i);var r=t.start;t.start=function(t,e,n){var o=i(t),s=o%1;return s&&(o=Math.floor(o),n=Object.assign(n||{},{cents:Math.floor(100*s)})),r(o,e,n)}}return t}},{"../note-parser/index":7}],12:[function(t,e,n){"use strict";const i=t("../adsr/index"),r={},o={gain:1,attack:.01,decay:.1,sustain:.9,release:.3,loop:!1,cents:0,loopStart:0,loopEnd:0};function s(t,e,n){let i=!1,s=0,a={};const c=t.createGain();c.gain.value=1;const h=Object.assign({},o,n),f={context:t,out:c,opts:h};return e instanceof AudioBuffer?f.buffer=e:f.buffers=e,f.start=function(e,n,o){if(f.buffer&&null!==e)return f.start(null,e,n);var s=e?f.buffers[e]:f.buffer;if(!s)return void console.warn(`Buffer ${e} not found.`);if(!i)return void console.warn("SamplePlayer not connected to any node.");const a=o||r;n=Math.max(t.currentTime,n||0),f.emit("start",n,e,a);var c=d(e,s,a);return c.id=p(e,c),c.env.start(n),c.source.start(n),f.emit("started",n,c.id,c),a.duration&&c.stop(n+a.duration),c},f.play=function(t,e,n){return f.start(t,e,n)},f.stop=function(t,e){return(e=e||Object.keys(a)).map((function(e){const n=a[e];return n?(n.stop(t),n.id):null}))},f.connect=function(t){return i=!0,c.connect(t),f},f.emit=function(t,e,n,i){f.onevent&&f.onevent(t,e,n,i);const r=f["on"+t];r&&r(e,n,i)},f;function p(e,n){return n.id=s++,a[n.id]=n,n.source.onended=function(){const e=t.currentTime;n.source.disconnect(),n.env.disconnect(),n.disconnect(),f.emit("ended",e,n.id,n)},n.id}function d(e,n,i){const r=t.createGain();return r.gain.value=0,r.connect(c),r.env=u(t,i,h),r.env.connect(r.gain),r.source=t.createBufferSource(),r.source.buffer=n,r.source.connect(r),r.source.loop=i.loop||h.loop,r.source.playbackRate.value=l(i.cents||h.cents),r.source.loopStart=i.loopStart||h.loopStart,r.source.loopEnd=i.loopEnd||h.loopEnd,r.stop=function(n){const i=n||t.currentTime;f.emit("stop",i,e);const o=r.env.stop(i);r.source.stop(o)},r}}function a(t){return"number"==typeof t}const c=["attack","decay","sustain","release"];function u(t,e,n){const r=i(t),o=e.adsr||n.adsr;return c.forEach((function(t,i){r[t]=o?o[i]:e[t]||n[t]})),r.value.value=a(e.gain)?e.gain:a(n.gain)?n.gain:1,r}function l(t){return t?Math.pow(2,t/1200):1}e.exports=s},{"../adsr/index":1}],13:[function(t,e,n){"use strict";var i=Array.isArray,r=function(t){return t&&"object"==typeof t},o={};e.exports=function(t){return t.schedule=function(e,n){var s,a,c,u,l=t.context.currentTime,h=e<l?l:e;return t.emit("schedule",h,n),n.map((function(e){return e?(i(e)?(s=e[0],a=e[1]):(s=e.time,a=e),r(a)?(c=a.name||a.key||a.note||a.midi||null,u=a):(c=a,u=o),t.start(c,h+(s||0),u)):null}))},t}},{}],14:[function(t,e,n){"use strict";const i=t("../audio-loader/index").load,r=t("../sample-player/index").SamplePlayer;function o(t,e,n={}){if(1===arguments.length)return function(e,n){return o(t,e,n)};let c="",u="";if("string"==typeof e){c=e;const t=n.isSoundfontURL||s,i=n.nameToUrl||a;u=t(e)?e:i(e,n.soundfont,n.format),e=u}return i(t,e,{only:n.only||n.notes}).then((e=>{const i=r(t,e,n).connect(n.destination?n.destination:t.destination);return i.url=u,i.name=c,i}))}function s(t){return/\.js(\?.*)?$/i.test(t)}function a(t,e,n){return"https://gleitz.github.io/midi-js-soundfonts/"+(e="FluidR3_GM"===e?e:"MusyngKite")+"/"+t+"-"+(n="ogg"===n?n:"mp3")+".js"}const c={instrument:o,nameToUrl:a};e.exports={Soundfont:c}},{"../audio-loader/index":4,"../sample-player/index":10}],15:[function(t,e,n){const i=t("./constants").Constants,r=t("./utils").Utils;class o{constructor(t,e){this.enabled=!0,this.eventIndex=0,this.pointer=0,this.lastTick=0,this.lastStatus=null,this.index=t,this.data=e,this.delta=0,this.runningDelta=0,this.events=[]}reset(){return this.enabled=!0,this.eventIndex=0,this.pointer=0,this.lastTick=0,this.lastStatus=null,this.delta=0,this.runningDelta=0,this}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}setEventIndexByTick(t){t=t||0;for(let e in this.events)if(this.events[e].tick>=t)return this.eventIndex=e,this}getCurrentByte(){return this.data[this.pointer]}getDeltaByteCount(){let t=this.getCurrentByte(),e=1;for(;t>=128;)t=this.data[this.pointer+e],e++;return e}getDelta(){return r.readVarInt(this.data.subarray(this.pointer,this.pointer+this.getDeltaByteCount()))}handleEvent(t,e){if(e=e||!1){const n=t-this.lastTick>=this.getDelta();if(this.pointer<this.data.length&&(e||n)){const t=this.parseEvent();if(this.enabled)return t}}else if(this.events[this.eventIndex]&&this.events[this.eventIndex].tick<=t&&(this.eventIndex++,this.enabled))return this.events[this.eventIndex-1];return null}getStringData(t){const e=1,n=r.readVarInt(this.data.subarray(t+2,t+2+e));return r.bytesToLetters(this.data.subarray(t+e+2,t+e+n+2))}parseEvent(){const t=this.pointer+this.getDeltaByteCount(),e={},n=this.getDeltaByteCount();if(e.track=this.index+1,e.delta=this.getDelta(),this.lastTick=this.lastTick+e.delta,this.runningDelta+=e.delta,e.tick=this.runningDelta,e.byteIndex=this.pointer,255==this.data[t]){switch(this.data[t+1]){case 0:e.name="Sequence Number";break;case 1:e.name="Text Event",e.string=this.getStringData(t);break;case 2:e.name="Copyright Notice";break;case 3:e.name="Sequence/Track Name",e.string=this.getStringData(t);break;case 4:e.name="Instrument Name",e.string=this.getStringData(t);break;case 5:e.name="Lyric",e.string=this.getStringData(t);break;case 6:e.name="Marker";break;case 7:e.name="Cue Point",e.string=this.getStringData(t);break;case 9:e.name="Device Name",e.string=this.getStringData(t);break;case 32:e.name="MIDI Channel Prefix";break;case 33:e.name="MIDI Port",e.data=r.bytesToNumber([this.data[t+3]]);break;case 47:e.name="End of Track";break;case 81:e.name="Set Tempo",e.data=Math.round(6e7/r.bytesToNumber(this.data.subarray(t+3,t+6))),this.tempo=e.data;break;case 84:e.name="SMTPE Offset";break;case 88:e.name="Time Signature",e.data=this.data.subarray(t+3,t+7),e.timeSignature=e.data[0]+"/"+Math.pow(2,e.data[1]);break;case 89:e.name="Key Signature",e.data=this.data.subarray(t+3,t+5),e.data[0]>=0?e.keySignature=i.CIRCLE_OF_FIFTHS[e.data[0]]:e.data[0]<0&&(e.keySignature=i.CIRCLE_OF_FOURTHS[Math.abs(e.data[0])]),0==e.data[1]?e.keySignature+=" Major":1==e.data[1]&&(e.keySignature+=" Minor");break;case 127:e.name="Sequencer-Specific Meta-event";break;default:e.name=`Unknown: ${this.data[t+1].toString(16)}`}const o=this.data[this.pointer+n+2];this.pointer+=n+3+o}else if(240==this.data[t]){e.name="Sysex";const t=this.data[this.pointer+n+1];this.pointer+=n+2+t}else this.data[t]<128?(e.running=!0,e.noteNumber=this.data[t],e.noteName=i.NOTES[this.data[t]],e.velocity=this.data[t+1],this.lastStatus<=143?(e.name="Note off",e.channel=this.lastStatus-128+1):this.lastStatus<=159&&(e.name="Note on",e.channel=this.lastStatus-144+1),this.pointer+=n+2):(this.lastStatus=this.data[t],this.data[t]<=143?(e.name="Note off",e.channel=this.lastStatus-128+1,e.noteNumber=this.data[t+1],e.noteName=i.NOTES[this.data[t+1]],e.velocity=Math.round(this.data[t+2]/127*100),this.pointer+=n+3):this.data[t]<=159?(e.name="Note on",e.channel=this.lastStatus-144+1,e.noteNumber=this.data[t+1],e.noteName=i.NOTES[this.data[t+1]],e.velocity=Math.round(this.data[t+2]/127*100),this.pointer+=n+3):this.data[t]<=175?(e.name="Polyphonic Key Pressure",e.channel=this.lastStatus-160+1,e.note=i.NOTES[this.data[t+1]],e.pressure=event[2],this.pointer+=n+3):this.data[t]<=191?(e.name="Controller Change",e.channel=this.lastStatus-176+1,e.number=this.data[t+1],e.value=this.data[t+2],this.pointer+=n+3):this.data[t]<=207?(e.name="Program Change",e.channel=this.lastStatus-192+1,e.value=this.data[t+1],this.pointer+=n+2):this.data[t]<=223?(e.name="Channel Key Pressure",e.channel=this.lastStatus-208+1,this.pointer+=n+2):this.data[t]<=239?(e.name="Pitch Bend",e.channel=this.lastStatus-224+1,this.pointer+=n+3):e.name=`Unknown. Pointer: ${this.pointer.toString()} ${t.toString()} ${this.data.length}`);return this.delta+=e.delta,this.events.push(e),e}endOfTrack(){return 255==this.data[this.pointer+1]&&47==this.data[this.pointer+2]&&0==this.data[this.pointer+3]}}e.exports={Track:o}},{"./constants":5,"./utils":16}],16:[function(t,e,n){class i{static byteToHex(t){return`0${t.toString(16)}`.slice(-2)}static bytesToHex(t){const e=[];return t.forEach((t=>e.push(i.byteToHex(t)))),e.join("")}static hexToNumber(t){return parseInt(t,16)}static bytesToNumber(t){return i.hexToNumber(i.bytesToHex(t))}static bytesToLetters(t){const e=[];return t.forEach((t=>e.push(String.fromCharCode(t)))),e.join("")}static decToBinary(t){return(t>>>0).toString(2)}static readVarInt(t){let e=0;return t.forEach((t=>{128&t?(e+=127&t,e<<=7):e+=t})),e}}e.exports={Utils:i}},{}]},{},[6])(6)},755:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(i,r){"use strict";var o=[],s=Object.getPrototypeOf,a=o.slice,c=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},u=o.push,l=o.indexOf,h={},f=h.toString,p=h.hasOwnProperty,d=p.toString,v=d.call(Object),y={},m=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},g=function(t){return null!=t&&t===t.window},b=i.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function k(t,e,n){var i,r,o=(n=n||b).createElement("script");if(o.text=t,e)for(i in w)(r=e[i]||e.getAttribute&&e.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function A(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?h[f.call(t)]||"object":typeof t}var S="3.7.0",x=/HTML$/i,C=function(t,e){return new C.fn.init(t,e)};function O(t){var e=!!t&&"length"in t&&t.length,n=A(t);return!m(t)&&!g(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function P(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}C.fn=C.prototype={jquery:S,constructor:C,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=C.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return C.each(this,t)},map:function(t){return this.pushStack(C.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(C.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(C.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:o.sort,splice:o.splice},C.extend=C.fn.extend=function(){var t,e,n,i,r,o,s=arguments[0]||{},a=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||m(s)||(s={}),a===c&&(s=this,a--);a<c;a++)if(null!=(t=arguments[a]))for(e in t)i=t[e],"__proto__"!==e&&s!==i&&(u&&i&&(C.isPlainObject(i)||(r=Array.isArray(i)))?(n=s[e],o=r&&!Array.isArray(n)?[]:r||C.isPlainObject(n)?n:{},r=!1,s[e]=C.extend(u,o,i)):void 0!==i&&(s[e]=i));return s},C.extend({expando:"jQuery"+(S+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==f.call(t))&&(!(e=s(t))||"function"==typeof(n=p.call(e,"constructor")&&e.constructor)&&d.call(n)===v)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){k(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,i=0;if(O(t))for(n=t.length;i<n&&!1!==e.call(t[i],i,t[i]);i++);else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},text:function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r)return t.textContent;if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=C.text(e);return n},makeArray:function(t,e){var n=e||[];return null!=t&&(O(Object(t))?C.merge(n,"string"==typeof t?[t]:t):u.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:l.call(e,t,n)},isXMLDoc:function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!x.test(e||n&&n.nodeName||"HTML")},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;i<n;i++)t[r++]=e[i];return t.length=r,t},grep:function(t,e,n){for(var i=[],r=0,o=t.length,s=!n;r<o;r++)!e(t[r],r)!==s&&i.push(t[r]);return i},map:function(t,e,n){var i,r,o=0,s=[];if(O(t))for(i=t.length;o<i;o++)null!=(r=e(t[o],o,n))&&s.push(r);else for(o in t)null!=(r=e(t[o],o,n))&&s.push(r);return c(s)},guid:1,support:y}),"function"==typeof Symbol&&(C.fn[Symbol.iterator]=o[Symbol.iterator]),C.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){h["[object "+e+"]"]=e.toLowerCase()}));var E=o.pop,T=o.sort,j=o.splice,_="[\\x20\\t\\r\\n\\f]",B=new RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g");C.contains=function(t,e){var n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(t.contains?t.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))};var R=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function I(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}C.escapeSelector=function(t){return(t+"").replace(R,I)};var D=b,N=u;!function(){var t,e,n,r,s,c,u,h,f,d,v=N,m=C.expando,g=0,b=0,w=tt(),k=tt(),A=tt(),S=tt(),x=function(t,e){return t===e&&(s=!0),0},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="(?:\\\\[\\da-fA-F]{1,6}"+_+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",I="\\["+_+"*("+R+")(?:"+_+"*([*^$|!~]?=)"+_+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+_+"*\\]",M=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",V=new RegExp(_+"+","g"),q=new RegExp("^"+_+"*,"+_+"*"),L=new RegExp("^"+_+"*([>+~]|"+_+")"+_+"*"),F=new RegExp(_+"|>"),z=new RegExp(M),U=new RegExp("^"+R+"$"),$={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+M),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,K=new RegExp("\\\\[\\da-fA-F]{1,6}"+_+"?|\\\\([^\\r\\n\\f])","g"),Z=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},Y=function(){ct()},Q=ft((function(t){return!0===t.disabled&&P(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{v.apply(o=a.call(D.childNodes),D.childNodes),o[D.childNodes.length].nodeType}catch(t){v={apply:function(t,e){N.apply(t,a.call(e))},call:function(t){N.apply(t,a.call(arguments,1))}}}function X(t,e,n,i){var r,o,s,a,u,l,p,d=e&&e.ownerDocument,g=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==g&&9!==g&&11!==g)return n;if(!i&&(ct(e),e=e||c,h)){if(11!==g&&(u=G.exec(t)))if(r=u[1]){if(9===g){if(!(s=e.getElementById(r)))return n;if(s.id===r)return v.call(n,s),n}else if(d&&(s=d.getElementById(r))&&X.contains(e,s)&&s.id===r)return v.call(n,s),n}else{if(u[2])return v.apply(n,e.getElementsByTagName(t)),n;if((r=u[3])&&e.getElementsByClassName)return v.apply(n,e.getElementsByClassName(r)),n}if(!(S[t+" "]||f&&f.test(t))){if(p=t,d=e,1===g&&(F.test(t)||L.test(t))){for((d=J.test(t)&&at(e.parentNode)||e)==e&&y.scope||((a=e.getAttribute("id"))?a=C.escapeSelector(a):e.setAttribute("id",a=m)),o=(l=lt(t)).length;o--;)l[o]=(a?"#"+a:":scope")+" "+ht(l[o]);p=l.join(",")}try{return v.apply(n,d.querySelectorAll(p)),n}catch(e){S(t,!0)}finally{a===m&&e.removeAttribute("id")}}}return gt(t.replace(B,"$1"),e,n,i)}function tt(){var t=[];return function n(i,r){return t.push(i+" ")>e.cacheLength&&delete n[t.shift()],n[i+" "]=r}}function et(t){return t[m]=!0,t}function nt(t){var e=c.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function it(t){return function(e){return P(e,"input")&&e.type===t}}function rt(t){return function(e){return(P(e,"input")||P(e,"button"))&&e.type===t}}function ot(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Q(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function st(t){return et((function(e){return e=+e,et((function(n,i){for(var r,o=t([],n.length,e),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))}))}))}function at(t){return t&&void 0!==t.getElementsByTagName&&t}function ct(t){var n,i=t?t.ownerDocument||t:D;return i!=c&&9===i.nodeType&&i.documentElement?(u=(c=i).documentElement,h=!C.isXMLDoc(c),d=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,D!=c&&(n=c.defaultView)&&n.top!==n&&n.addEventListener("unload",Y),y.getById=nt((function(t){return u.appendChild(t).id=C.expando,!c.getElementsByName||!c.getElementsByName(C.expando).length})),y.disconnectedMatch=nt((function(t){return d.call(t,"*")})),y.scope=nt((function(){return c.querySelectorAll(":scope")})),y.cssHas=nt((function(){try{return c.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),y.getById?(e.filter.ID=function(t){var e=t.replace(K,Z);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&h){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace(K,Z);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&h){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&h)return e.getElementsByClassName(t)},f=[],nt((function(t){var e;u.appendChild(t).innerHTML="<a id='"+m+"' href='' disabled='disabled'></a><select id='"+m+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||f.push("\\["+_+"*(?:value|"+O+")"),t.querySelectorAll("[id~="+m+"-]").length||f.push("~="),t.querySelectorAll("a#"+m+"+*").length||f.push(".#.+[+~]"),t.querySelectorAll(":checked").length||f.push(":checked"),(e=c.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),u.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&f.push(":enabled",":disabled"),(e=c.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||f.push("\\["+_+"*name"+_+"*="+_+"*(?:''|\"\")")})),y.cssHas||f.push(":has"),f=f.length&&new RegExp(f.join("|")),x=function(t,e){if(t===e)return s=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!y.sortDetached&&e.compareDocumentPosition(t)===n?t===c||t.ownerDocument==D&&X.contains(D,t)?-1:e===c||e.ownerDocument==D&&X.contains(D,e)?1:r?l.call(r,t)-l.call(r,e):0:4&n?-1:1)},c):c}for(t in X.matches=function(t,e){return X(t,null,null,e)},X.matchesSelector=function(t,e){if(ct(t),h&&!S[e+" "]&&(!f||!f.test(e)))try{var n=d.call(t,e);if(n||y.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){S(e,!0)}return X(e,c,null,[t]).length>0},X.contains=function(t,e){return(t.ownerDocument||t)!=c&&ct(t),C.contains(t,e)},X.attr=function(t,n){(t.ownerDocument||t)!=c&&ct(t);var i=e.attrHandle[n.toLowerCase()],r=i&&p.call(e.attrHandle,n.toLowerCase())?i(t,n,!h):void 0;return void 0!==r?r:t.getAttribute(n)},X.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},C.uniqueSort=function(t){var e,n=[],i=0,o=0;if(s=!y.sortStable,r=!y.sortStable&&a.call(t,0),T.call(t,x),s){for(;e=t[o++];)e===t[o]&&(i=n.push(o));for(;i--;)j.call(t,n[i],1)}return r=null,t},C.fn.uniqueSort=function(){return this.pushStack(C.uniqueSort(a.apply(this)))},e=C.expr={cacheLength:50,createPseudo:et,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(K,Z),t[3]=(t[3]||t[4]||t[5]||"").replace(K,Z),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||X.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&X.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return $.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&z.test(n)&&(e=lt(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(K,Z).toLowerCase();return"*"===t?function(){return!0}:function(t){return P(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+_+")"+t+"("+_+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var r=X.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(V," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,c){var u,l,h,f,p,d=o!==s?"nextSibling":"previousSibling",v=e.parentNode,y=a&&e.nodeName.toLowerCase(),b=!c&&!a,w=!1;if(v){if(o){for(;d;){for(h=e;h=h[d];)if(a?P(h,y):1===h.nodeType)return!1;p=d="only"===t&&!p&&"nextSibling"}return!0}if(p=[s?v.firstChild:v.lastChild],s&&b){for(w=(f=(u=(l=v[m]||(v[m]={}))[t]||[])[0]===g&&u[1])&&u[2],h=f&&v.childNodes[f];h=++f&&h&&h[d]||(w=f=0)||p.pop();)if(1===h.nodeType&&++w&&h===e){l[t]=[g,f,w];break}}else if(b&&(w=f=(u=(l=e[m]||(e[m]={}))[t]||[])[0]===g&&u[1]),!1===w)for(;(h=++f&&h&&h[d]||(w=f=0)||p.pop())&&(!(a?P(h,y):1===h.nodeType)||!++w||(b&&((l=h[m]||(h[m]={}))[t]=[g,w]),h!==e)););return(w-=r)===i||w%i==0&&w/i>=0}}},PSEUDO:function(t,n){var i,r=e.pseudos[t]||e.setFilters[t.toLowerCase()]||X.error("unsupported pseudo: "+t);return r[m]?r(n):r.length>1?(i=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var i,o=r(t,n),s=o.length;s--;)t[i=l.call(t,o[s])]=!(e[i]=o[s])})):function(t){return r(t,0,i)}):r}},pseudos:{not:et((function(t){var e=[],n=[],i=mt(t.replace(B,"$1"));return i[m]?et((function(t,e,n,r){for(var o,s=i(t,null,r,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))})):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}})),has:et((function(t){return function(e){return X(t,e).length>0}})),contains:et((function(t){return t=t.replace(K,Z),function(e){return(e.textContent||C.text(e)).indexOf(t)>-1}})),lang:et((function(t){return U.test(t||"")||X.error("unsupported lang: "+t),t=t.replace(K,Z).toLowerCase(),function(e){var n;do{if(n=h?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=i.location&&i.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===u},focus:function(t){return t===function(){try{return c.activeElement}catch(t){}}()&&c.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:ot(!1),disabled:ot(!0),checked:function(t){return P(t,"input")&&!!t.checked||P(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return W.test(t.nodeName)},input:function(t){return H.test(t.nodeName)},button:function(t){return P(t,"input")&&"button"===t.type||P(t,"button")},text:function(t){var e;return P(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:st((function(){return[0]})),last:st((function(t,e){return[e-1]})),eq:st((function(t,e,n){return[n<0?n+e:n]})),even:st((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:st((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:st((function(t,e,n){var i;for(i=n<0?n+e:n>e?e:n;--i>=0;)t.push(i);return t})),gt:st((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}},e.pseudos.nth=e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[t]=it(t);for(t in{submit:!0,reset:!0})e.pseudos[t]=rt(t);function ut(){}function lt(t,n){var i,r,o,s,a,c,u,l=k[t+" "];if(l)return n?0:l.slice(0);for(a=t,c=[],u=e.preFilter;a;){for(s in i&&!(r=q.exec(a))||(r&&(a=a.slice(r[0].length)||a),c.push(o=[])),i=!1,(r=L.exec(a))&&(i=r.shift(),o.push({value:i,type:r[0].replace(B," ")}),a=a.slice(i.length)),e.filter)!(r=$[s].exec(a))||u[s]&&!(r=u[s](r))||(i=r.shift(),o.push({value:i,type:s,matches:r}),a=a.slice(i.length));if(!i)break}return n?a.length:a?X.error(t):k(t,c).slice(0)}function ht(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function ft(t,e,n){var i=e.dir,r=e.next,o=r||i,s=n&&"parentNode"===o,a=b++;return e.first?function(e,n,r){for(;e=e[i];)if(1===e.nodeType||s)return t(e,n,r);return!1}:function(e,n,c){var u,l,h=[g,a];if(c){for(;e=e[i];)if((1===e.nodeType||s)&&t(e,n,c))return!0}else for(;e=e[i];)if(1===e.nodeType||s)if(l=e[m]||(e[m]={}),r&&P(e,r))e=e[i]||e;else{if((u=l[o])&&u[0]===g&&u[1]===a)return h[2]=u[2];if(l[o]=h,h[2]=t(e,n,c))return!0}return!1}}function pt(t){return t.length>1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function dt(t,e,n,i,r){for(var o,s=[],a=0,c=t.length,u=null!=e;a<c;a++)(o=t[a])&&(n&&!n(o,i,r)||(s.push(o),u&&e.push(a)));return s}function vt(t,e,n,i,r,o){return i&&!i[m]&&(i=vt(i)),r&&!r[m]&&(r=vt(r,o)),et((function(o,s,a,c){var u,h,f,p,d=[],y=[],m=s.length,g=o||function(t,e,n){for(var i=0,r=e.length;i<r;i++)X(t,e[i],n);return n}(e||"*",a.nodeType?[a]:a,[]),b=!t||!o&&e?g:dt(g,d,t,a,c);if(n?n(b,p=r||(o?t:m||i)?[]:s,a,c):p=b,i)for(u=dt(p,y),i(u,[],a,c),h=u.length;h--;)(f=u[h])&&(p[y[h]]=!(b[y[h]]=f));if(o){if(r||t){if(r){for(u=[],h=p.length;h--;)(f=p[h])&&u.push(b[h]=f);r(null,p=[],u,c)}for(h=p.length;h--;)(f=p[h])&&(u=r?l.call(o,f):d[h])>-1&&(o[u]=!(s[u]=f))}}else p=dt(p===s?p.splice(m,p.length):p),r?r(null,s,p,c):v.apply(s,p)}))}function yt(t){for(var i,r,o,s=t.length,a=e.relative[t[0].type],c=a||e.relative[" "],u=a?1:0,h=ft((function(t){return t===i}),c,!0),f=ft((function(t){return l.call(i,t)>-1}),c,!0),p=[function(t,e,r){var o=!a&&(r||e!=n)||((i=e).nodeType?h(t,e,r):f(t,e,r));return i=null,o}];u<s;u++)if(r=e.relative[t[u].type])p=[ft(pt(p),r)];else{if((r=e.filter[t[u].type].apply(null,t[u].matches))[m]){for(o=++u;o<s&&!e.relative[t[o].type];o++);return vt(u>1&&pt(p),u>1&&ht(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(B,"$1"),r,u<o&&yt(t.slice(u,o)),o<s&&yt(t=t.slice(o)),o<s&&ht(t))}p.push(r)}return pt(p)}function mt(t,i){var r,o=[],s=[],a=A[t+" "];if(!a){for(i||(i=lt(t)),r=i.length;r--;)(a=yt(i[r]))[m]?o.push(a):s.push(a);a=A(t,function(t,i){var r=i.length>0,o=t.length>0,s=function(s,a,u,l,f){var p,d,y,m=0,b="0",w=s&&[],k=[],A=n,S=s||o&&e.find.TAG("*",f),x=g+=null==A?1:Math.random()||.1,O=S.length;for(f&&(n=a==c||a||f);b!==O&&null!=(p=S[b]);b++){if(o&&p){for(d=0,a||p.ownerDocument==c||(ct(p),u=!h);y=t[d++];)if(y(p,a||c,u)){v.call(l,p);break}f&&(g=x)}r&&((p=!y&&p)&&m--,s&&w.push(p))}if(m+=b,r&&b!==m){for(d=0;y=i[d++];)y(w,k,a,u);if(s){if(m>0)for(;b--;)w[b]||k[b]||(k[b]=E.call(l));k=dt(k)}v.apply(l,k),f&&!s&&k.length>0&&m+i.length>1&&C.uniqueSort(l)}return f&&(g=x,n=A),w};return r?et(s):s}(s,o)),a.selector=t}return a}function gt(t,n,i,r){var o,s,a,c,u,l="function"==typeof t&&t,f=!r&<(t=l.selector||t);if(i=i||[],1===f.length){if((s=f[0]=f[0].slice(0)).length>2&&"ID"===(a=s[0]).type&&9===n.nodeType&&h&&e.relative[s[1].type]){if(!(n=(e.find.ID(a.matches[0].replace(K,Z),n)||[])[0]))return i;l&&(n=n.parentNode),t=t.slice(s.shift().value.length)}for(o=$.needsContext.test(t)?0:s.length;o--&&(a=s[o],!e.relative[c=a.type]);)if((u=e.find[c])&&(r=u(a.matches[0].replace(K,Z),J.test(s[0].type)&&at(n.parentNode)||n))){if(s.splice(o,1),!(t=r.length&&ht(s)))return v.apply(i,r),i;break}}return(l||mt(t,f))(r,n,!h,i,!n||J.test(t)&&at(n.parentNode)||n),i}ut.prototype=e.filters=e.pseudos,e.setFilters=new ut,y.sortStable=m.split("").sort(x).join("")===m,ct(),y.sortDetached=nt((function(t){return 1&t.compareDocumentPosition(c.createElement("fieldset"))})),C.find=X,C.expr[":"]=C.expr.pseudos,C.unique=C.uniqueSort,X.compile=mt,X.select=gt,X.setDocument=ct,X.escape=C.escapeSelector,X.getText=C.text,X.isXML=C.isXMLDoc,X.selectors=C.expr,X.support=C.support,X.uniqueSort=C.uniqueSort}();var M=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&C(t).is(n))break;i.push(t)}return i},V=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},q=C.expr.match.needsContext,L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function F(t,e,n){return m(e)?C.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?C.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?C.grep(t,(function(t){return l.call(e,t)>-1!==n})):C.filter(e,t,n)}C.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?C.find.matchesSelector(i,t)?[i]:[]:C.find.matches(t,C.grep(e,(function(t){return 1===t.nodeType})))},C.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(C(t).filter((function(){for(e=0;e<i;e++)if(C.contains(r[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)C.find(t,r[e],n);return i>1?C.uniqueSort(n):n},filter:function(t){return this.pushStack(F(this,t||[],!1))},not:function(t){return this.pushStack(F(this,t||[],!0))},is:function(t){return!!F(this,"string"==typeof t&&q.test(t)?C(t):t||[],!1).length}});var z,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||z,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:U.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof C?e[0]:e,C.merge(this,C.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),L.test(i[1])&&C.isPlainObject(e))for(i in e)m(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=b.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):m(t)?void 0!==n.ready?n.ready(t):t(C):C.makeArray(t,this)}).prototype=C.fn,z=C(b);var $=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}C.fn.extend({has:function(t){var e=C(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(C.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,r=this.length,o=[],s="string"!=typeof t&&C(t);if(!q.test(t))for(;i<r;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&C.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?C.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?l.call(C(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(C.uniqueSort(C.merge(this.get(),C(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),C.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return M(t,"parentNode")},parentsUntil:function(t,e,n){return M(t,"parentNode",n)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return M(t,"nextSibling")},prevAll:function(t){return M(t,"previousSibling")},nextUntil:function(t,e,n){return M(t,"nextSibling",n)},prevUntil:function(t,e,n){return M(t,"previousSibling",n)},siblings:function(t){return V((t.parentNode||{}).firstChild,t)},children:function(t){return V(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(P(t,"template")&&(t=t.content||t),C.merge([],t.childNodes))}},(function(t,e){C.fn[t]=function(n,i){var r=C.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=C.filter(i,r)),this.length>1&&(H[t]||C.uniqueSort(r),$.test(t)&&r.reverse()),this.pushStack(r)}}));var G=/[^\x20\t\r\n\f]+/g;function J(t){return t}function K(t){throw t}function Z(t,e,n,i){var r;try{t&&m(r=t.promise)?r.call(t).done(e).fail(n):t&&m(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}C.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return C.each(t.match(G)||[],(function(t,n){e[n]=!0})),e}(t):C.extend({},t);var e,n,i,r,o=[],s=[],a=-1,c=function(){for(r=r||t.once,i=e=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=o.length,n=!1);t.memory||(n=!1),e=!1,r&&(o=n?[]:"")},u={add:function(){return o&&(n&&!e&&(a=o.length-1,s.push(n)),function e(n){C.each(n,(function(n,i){m(i)?t.unique&&u.has(i)||o.push(i):i&&i.length&&"string"!==A(i)&&e(i)}))}(arguments),n&&!e&&c()),this},remove:function(){return C.each(arguments,(function(t,e){for(var n;(n=C.inArray(e,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(t){return t?C.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},C.extend({Deferred:function(t){var e=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return C.Deferred((function(n){C.each(e,(function(e,i){var r=m(t[i[4]])&&t[i[4]];o[i[1]]((function(){var t=r&&r.apply(this,arguments);t&&m(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,r){var o=0;function s(t,e,n,r){return function(){var a=this,c=arguments,u=function(){var i,u;if(!(t<o)){if((i=n.apply(a,c))===e.promise())throw new TypeError("Thenable self-resolution");u=i&&("object"==typeof i||"function"==typeof i)&&i.then,m(u)?r?u.call(i,s(o,e,J,r),s(o,e,K,r)):(o++,u.call(i,s(o,e,J,r),s(o,e,K,r),s(o,e,J,e.notifyWith))):(n!==J&&(a=void 0,c=[i]),(r||e.resolveWith)(a,c))}},l=r?u:function(){try{u()}catch(i){C.Deferred.exceptionHook&&C.Deferred.exceptionHook(i,l.error),t+1>=o&&(n!==K&&(a=void 0,c=[i]),e.rejectWith(a,c))}};t?l():(C.Deferred.getErrorHook?l.error=C.Deferred.getErrorHook():C.Deferred.getStackHook&&(l.error=C.Deferred.getStackHook()),i.setTimeout(l))}}return C.Deferred((function(i){e[0][3].add(s(0,i,m(r)?r:J,i.notifyWith)),e[1][3].add(s(0,i,m(t)?t:J)),e[2][3].add(s(0,i,m(n)?n:K))})).promise()},promise:function(t){return null!=t?C.extend(t,r):r}},o={};return C.each(e,(function(t,i){var s=i[2],a=i[5];r[i[1]]=s.add,a&&s.add((function(){n=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(i[3].fire),o[i[0]]=function(){return o[i[0]+"With"](this===o?void 0:this,arguments),this},o[i[0]+"With"]=s.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=a.call(arguments),o=C.Deferred(),s=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?a.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(Z(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||m(r[n]&&r[n].then)))return o.then();for(;n--;)Z(r[n],s(n),o.reject);return o.promise()}});var Y=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(t,e){i.console&&i.console.warn&&t&&Y.test(t.name)&&i.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},C.readyException=function(t){i.setTimeout((function(){throw t}))};var Q=C.Deferred();function X(){b.removeEventListener("DOMContentLoaded",X),i.removeEventListener("load",X),C.ready()}C.fn.ready=function(t){return Q.then(t).catch((function(t){C.readyException(t)})),this},C.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--C.readyWait:C.isReady)||(C.isReady=!0,!0!==t&&--C.readyWait>0||Q.resolveWith(b,[C]))}}),C.ready.then=Q.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?i.setTimeout(C.ready):(b.addEventListener("DOMContentLoaded",X),i.addEventListener("load",X));var tt=function(t,e,n,i,r,o,s){var a=0,c=t.length,u=null==n;if("object"===A(n))for(a in r=!0,n)tt(t,e,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,m(i)||(s=!0),u&&(s?(e.call(t,i),e=null):(u=e,e=function(t,e,n){return u.call(C(t),n)})),e))for(;a<c;a++)e(t[a],n,s?i:i.call(t[a],a,e(t[a],n)));return r?t:u?e.call(t):c?e(t[0],n):o},et=/^-ms-/,nt=/-([a-z])/g;function it(t,e){return e.toUpperCase()}function rt(t){return t.replace(et,"ms-").replace(nt,it)}var ot=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function st(){this.expando=C.expando+st.uid++}st.uid=1,st.prototype={cache:function(t){var e=t[this.expando];return e||(e={},ot(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,r=this.cache(t);if("string"==typeof e)r[rt(e)]=n;else for(i in e)r[rt(i)]=e[i];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][rt(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,i=t[this.expando];if(void 0!==i){if(void 0!==e){n=(e=Array.isArray(e)?e.map(rt):(e=rt(e))in i?[e]:e.match(G)||[]).length;for(;n--;)delete i[e[n]]}(void 0===e||C.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!C.isEmptyObject(e)}};var at=new st,ct=new st,ut=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,lt=/[A-Z]/g;function ht(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(lt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:ut.test(t)?JSON.parse(t):t)}(n)}catch(t){}ct.set(t,e,n)}else n=void 0;return n}C.extend({hasData:function(t){return ct.hasData(t)||at.hasData(t)},data:function(t,e,n){return ct.access(t,e,n)},removeData:function(t,e){ct.remove(t,e)},_data:function(t,e,n){return at.access(t,e,n)},_removeData:function(t,e){at.remove(t,e)}}),C.fn.extend({data:function(t,e){var n,i,r,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(r=ct.get(o),1===o.nodeType&&!at.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(i=s[n].name).indexOf("data-")&&(i=rt(i.slice(5)),ht(o,i,r[i]));at.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each((function(){ct.set(this,t)})):tt(this,(function(e){var n;if(o&&void 0===e)return void 0!==(n=ct.get(o,t))||void 0!==(n=ht(o,t))?n:void 0;this.each((function(){ct.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){ct.remove(this,t)}))}}),C.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=at.get(t,e),n&&(!i||Array.isArray(n)?i=at.access(t,e,C.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=C.queue(t,e),i=n.length,r=n.shift(),o=C._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,(function(){C.dequeue(t,e)}),o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return at.get(t,n)||at.access(t,n,{empty:C.Callbacks("once memory").add((function(){at.remove(t,[e+"queue",n])}))})}}),C.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?C.queue(this[0],t):void 0===e?this:this.each((function(){var n=C.queue(this,t,e);C._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&C.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){C.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=C.Deferred(),o=this,s=this.length,a=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=at.get(o[s],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(e)}});var ft=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,pt=new RegExp("^(?:([+-])=|)("+ft+")([a-z%]*)$","i"),dt=["Top","Right","Bottom","Left"],vt=b.documentElement,yt=function(t){return C.contains(t.ownerDocument,t)},mt={composed:!0};vt.getRootNode&&(yt=function(t){return C.contains(t.ownerDocument,t)||t.getRootNode(mt)===t.ownerDocument});var gt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&yt(t)&&"none"===C.css(t,"display")};function bt(t,e,n,i){var r,o,s=20,a=i?function(){return i.cur()}:function(){return C.css(t,e,"")},c=a(),u=n&&n[3]||(C.cssNumber[e]?"":"px"),l=t.nodeType&&(C.cssNumber[e]||"px"!==u&&+c)&&pt.exec(C.css(t,e));if(l&&l[3]!==u){for(c/=2,u=u||l[3],l=+c||1;s--;)C.style(t,e,l+u),(1-o)*(1-(o=a()/c||.5))<=0&&(s=0),l/=o;l*=2,C.style(t,e,l+u),n=n||[]}return n&&(l=+l||+c||0,r=n[1]?l+(n[1]+1)*n[2]:+n[2],i&&(i.unit=u,i.start=l,i.end=r)),r}var wt={};function kt(t){var e,n=t.ownerDocument,i=t.nodeName,r=wt[i];return r||(e=n.body.appendChild(n.createElement(i)),r=C.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),wt[i]=r,r)}function At(t,e){for(var n,i,r=[],o=0,s=t.length;o<s;o++)(i=t[o]).style&&(n=i.style.display,e?("none"===n&&(r[o]=at.get(i,"display")||null,r[o]||(i.style.display="")),""===i.style.display&>(i)&&(r[o]=kt(i))):"none"!==n&&(r[o]="none",at.set(i,"display",n)));for(o=0;o<s;o++)null!=r[o]&&(t[o].style.display=r[o]);return t}C.fn.extend({show:function(){return At(this,!0)},hide:function(){return At(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){gt(this)?C(this).show():C(this).hide()}))}});var St,xt,Ct=/^(?:checkbox|radio)$/i,Ot=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Pt=/^$|^module$|\/(?:java|ecma)script/i;St=b.createDocumentFragment().appendChild(b.createElement("div")),(xt=b.createElement("input")).setAttribute("type","radio"),xt.setAttribute("checked","checked"),xt.setAttribute("name","t"),St.appendChild(xt),y.checkClone=St.cloneNode(!0).cloneNode(!0).lastChild.checked,St.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!St.cloneNode(!0).lastChild.defaultValue,St.innerHTML="<option></option>",y.option=!!St.lastChild;var Et={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Tt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&P(t,e)?C.merge([t],n):n}function jt(t,e){for(var n=0,i=t.length;n<i;n++)at.set(t[n],"globalEval",!e||at.get(e[n],"globalEval"))}Et.tbody=Et.tfoot=Et.colgroup=Et.caption=Et.thead,Et.th=Et.td,y.option||(Et.optgroup=Et.option=[1,"<select multiple='multiple'>","</select>"]);var _t=/<|&#?\w+;/;function Bt(t,e,n,i,r){for(var o,s,a,c,u,l,h=e.createDocumentFragment(),f=[],p=0,d=t.length;p<d;p++)if((o=t[p])||0===o)if("object"===A(o))C.merge(f,o.nodeType?[o]:o);else if(_t.test(o)){for(s=s||h.appendChild(e.createElement("div")),a=(Ot.exec(o)||["",""])[1].toLowerCase(),c=Et[a]||Et._default,s.innerHTML=c[1]+C.htmlPrefilter(o)+c[2],l=c[0];l--;)s=s.lastChild;C.merge(f,s.childNodes),(s=h.firstChild).textContent=""}else f.push(e.createTextNode(o));for(h.textContent="",p=0;o=f[p++];)if(i&&C.inArray(o,i)>-1)r&&r.push(o);else if(u=yt(o),s=Tt(h.appendChild(o),"script"),u&&jt(s),n)for(l=0;o=s[l++];)Pt.test(o.type||"")&&n.push(o);return h}var Rt=/^([^.]*)(?:\.(.+)|)/;function It(){return!0}function Dt(){return!1}function Nt(t,e,n,i,r,o){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)Nt(t,a,n,i,e[a],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Dt;else if(!r)return t;return 1===o&&(s=r,r=function(t){return C().off(t),s.apply(this,arguments)},r.guid=s.guid||(s.guid=C.guid++)),t.each((function(){C.event.add(this,e,r,i,n)}))}function Mt(t,e,n){n?(at.set(t,e,!1),C.event.add(t,e,{namespace:!1,handler:function(t){var n,i=at.get(this,e);if(1&t.isTrigger&&this[e]){if(i)(C.event.special[e]||{}).delegateType&&t.stopPropagation();else if(i=a.call(arguments),at.set(this,e,i),this[e](),n=at.get(this,e),at.set(this,e,!1),i!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else i&&(at.set(this,e,C.event.trigger(i[0],i.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=It)}})):void 0===at.get(t,e)&&C.event.add(t,e,It)}C.event={global:{},add:function(t,e,n,i,r){var o,s,a,c,u,l,h,f,p,d,v,y=at.get(t);if(ot(t))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&C.find.matchesSelector(vt,r),n.guid||(n.guid=C.guid++),(c=y.events)||(c=y.events=Object.create(null)),(s=y.handle)||(s=y.handle=function(e){return void 0!==C&&C.event.triggered!==e.type?C.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(G)||[""]).length;u--;)p=v=(a=Rt.exec(e[u])||[])[1],d=(a[2]||"").split(".").sort(),p&&(h=C.event.special[p]||{},p=(r?h.delegateType:h.bindType)||p,h=C.event.special[p]||{},l=C.extend({type:p,origType:v,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&C.expr.match.needsContext.test(r),namespace:d.join(".")},o),(f=c[p])||((f=c[p]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,i,d,s)||t.addEventListener&&t.addEventListener(p,s)),h.add&&(h.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,l):f.push(l),C.event.global[p]=!0)},remove:function(t,e,n,i,r){var o,s,a,c,u,l,h,f,p,d,v,y=at.hasData(t)&&at.get(t);if(y&&(c=y.events)){for(u=(e=(e||"").match(G)||[""]).length;u--;)if(p=v=(a=Rt.exec(e[u])||[])[1],d=(a[2]||"").split(".").sort(),p){for(h=C.event.special[p]||{},f=c[p=(i?h.delegateType:h.bindType)||p]||[],a=a[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;o--;)l=f[o],!r&&v!==l.origType||n&&n.guid!==l.guid||a&&!a.test(l.namespace)||i&&i!==l.selector&&("**"!==i||!l.selector)||(f.splice(o,1),l.selector&&f.delegateCount--,h.remove&&h.remove.call(t,l));s&&!f.length&&(h.teardown&&!1!==h.teardown.call(t,d,y.handle)||C.removeEvent(t,p,y.handle),delete c[p])}else for(p in c)C.event.remove(t,p+e[u],n,i,!0);C.isEmptyObject(c)&&at.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,s,a=new Array(arguments.length),c=C.event.fix(t),u=(at.get(this,"events")||Object.create(null))[c.type]||[],l=C.event.special[c.type]||{};for(a[0]=c,e=1;e<arguments.length;e++)a[e]=arguments[e];if(c.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,c)){for(s=C.event.handlers.call(this,c,u),e=0;(r=s[e++])&&!c.isPropagationStopped();)for(c.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!c.isImmediatePropagationStopped();)c.rnamespace&&!1!==o.namespace&&!c.rnamespace.test(o.namespace)||(c.handleObj=o,c.data=o.data,void 0!==(i=((C.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,a))&&!1===(c.result=i)&&(c.preventDefault(),c.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,c),c.result}},handlers:function(t,e){var n,i,r,o,s,a=[],c=e.delegateCount,u=t.target;if(c&&u.nodeType&&!("click"===t.type&&t.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],s={},n=0;n<c;n++)void 0===s[r=(i=e[n]).selector+" "]&&(s[r]=i.needsContext?C(r,this).index(u)>-1:C.find(r,this,null,[u]).length),s[r]&&o.push(i);o.length&&a.push({elem:u,handlers:o})}return u=this,c<e.length&&a.push({elem:u,handlers:e.slice(c)}),a},addProp:function(t,e){Object.defineProperty(C.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[C.expando]?t:new C.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return Ct.test(e.type)&&e.click&&P(e,"input")&&Mt(e,"click",!0),!1},trigger:function(t){var e=this||t;return Ct.test(e.type)&&e.click&&P(e,"input")&&Mt(e,"click"),!0},_default:function(t){var e=t.target;return Ct.test(e.type)&&e.click&&P(e,"input")&&at.get(e,"click")||P(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},C.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},C.Event=function(t,e){if(!(this instanceof C.Event))return new C.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?It:Dt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&C.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[C.expando]=!0},C.Event.prototype={constructor:C.Event,isDefaultPrevented:Dt,isPropagationStopped:Dt,isImmediatePropagationStopped:Dt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=It,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=It,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=It,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},C.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},C.event.addProp),C.each({focus:"focusin",blur:"focusout"},(function(t,e){function n(t){if(b.documentMode){var n=at.get(this,"handle"),i=C.event.fix(t);i.type="focusin"===t.type?"focus":"blur",i.isSimulated=!0,n(t),i.target===i.currentTarget&&n(i)}else C.event.simulate(e,t.target,C.event.fix(t))}C.event.special[t]={setup:function(){var i;if(Mt(this,t,!0),!b.documentMode)return!1;(i=at.get(this,e))||this.addEventListener(e,n),at.set(this,e,(i||0)+1)},trigger:function(){return Mt(this,t),!0},teardown:function(){var t;if(!b.documentMode)return!1;(t=at.get(this,e)-1)?at.set(this,e,t):(this.removeEventListener(e,n),at.remove(this,e))},_default:function(e){return at.get(e.target,t)},delegateType:e},C.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,r=b.documentMode?this:i,o=at.get(r,e);o||(b.documentMode?this.addEventListener(e,n):i.addEventListener(t,n,!0)),at.set(r,e,(o||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=b.documentMode?this:i,o=at.get(r,e)-1;o?at.set(r,e,o):(b.documentMode?this.removeEventListener(e,n):i.removeEventListener(t,n,!0),at.remove(r,e))}}})),C.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){C.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=t.relatedTarget,r=t.handleObj;return i&&(i===this||C.contains(this,i))||(t.type=r.origType,n=r.handler.apply(this,arguments),t.type=e),n}}})),C.fn.extend({on:function(t,e,n,i){return Nt(this,t,e,n,i)},one:function(t,e,n,i){return Nt(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,C(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Dt),this.each((function(){C.event.remove(this,t,n,e)}))}});var Vt=/<script|<style|<link/i,qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Lt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Ft(t,e){return P(t,"table")&&P(11!==e.nodeType?e:e.firstChild,"tr")&&C(t).children("tbody")[0]||t}function zt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ut(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function $t(t,e){var n,i,r,o,s,a;if(1===e.nodeType){if(at.hasData(t)&&(a=at.get(t).events))for(r in at.remove(e,"handle events"),a)for(n=0,i=a[r].length;n<i;n++)C.event.add(e,r,a[r][n]);ct.hasData(t)&&(o=ct.access(t),s=C.extend({},o),ct.set(e,s))}}function Ht(t,e){var n=e.nodeName.toLowerCase();"input"===n&&Ct.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Wt(t,e,n,i){e=c(e);var r,o,s,a,u,l,h=0,f=t.length,p=f-1,d=e[0],v=m(d);if(v||f>1&&"string"==typeof d&&!y.checkClone&&qt.test(d))return t.each((function(r){var o=t.eq(r);v&&(e[0]=d.call(this,r,o.html())),Wt(o,e,n,i)}));if(f&&(o=(r=Bt(e,t[0].ownerDocument,!1,t,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(a=(s=C.map(Tt(r,"script"),zt)).length;h<f;h++)u=r,h!==p&&(u=C.clone(u,!0,!0),a&&C.merge(s,Tt(u,"script"))),n.call(t[h],u,h);if(a)for(l=s[s.length-1].ownerDocument,C.map(s,Ut),h=0;h<a;h++)u=s[h],Pt.test(u.type||"")&&!at.access(u,"globalEval")&&C.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?C._evalUrl&&!u.noModule&&C._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):k(u.textContent.replace(Lt,""),u,l))}return t}function Gt(t,e,n){for(var i,r=e?C.filter(e,t):t,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||C.cleanData(Tt(i)),i.parentNode&&(n&&yt(i)&&jt(Tt(i,"script")),i.parentNode.removeChild(i));return t}C.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var i,r,o,s,a=t.cloneNode(!0),c=yt(t);if(!(y.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||C.isXMLDoc(t)))for(s=Tt(a),i=0,r=(o=Tt(t)).length;i<r;i++)Ht(o[i],s[i]);if(e)if(n)for(o=o||Tt(t),s=s||Tt(a),i=0,r=o.length;i<r;i++)$t(o[i],s[i]);else $t(t,a);return(s=Tt(a,"script")).length>0&&jt(s,!c&&Tt(t,"script")),a},cleanData:function(t){for(var e,n,i,r=C.event.special,o=0;void 0!==(n=t[o]);o++)if(ot(n)){if(e=n[at.expando]){if(e.events)for(i in e.events)r[i]?C.event.remove(n,i):C.removeEvent(n,i,e.handle);n[at.expando]=void 0}n[ct.expando]&&(n[ct.expando]=void 0)}}}),C.fn.extend({detach:function(t){return Gt(this,t,!0)},remove:function(t){return Gt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?C.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ft(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ft(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(C.cleanData(Tt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return C.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Vt.test(t)&&!Et[(Ot.exec(t)||["",""])[1].toLowerCase()]){t=C.htmlPrefilter(t);try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&(C.cleanData(Tt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Wt(this,arguments,(function(e){var n=this.parentNode;C.inArray(this,t)<0&&(C.cleanData(Tt(this)),n&&n.replaceChild(e,this))}),t)}}),C.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){C.fn[t]=function(t){for(var n,i=[],r=C(t),o=r.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),C(r[s])[e](n),u.apply(i,n.get());return this.pushStack(i)}}));var Jt=new RegExp("^("+ft+")(?!px)[a-z%]+$","i"),Kt=/^--/,Zt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=i),e.getComputedStyle(t)},Yt=function(t,e,n){var i,r,o={};for(r in e)o[r]=t.style[r],t.style[r]=e[r];for(r in i=n.call(t),e)t.style[r]=o[r];return i},Qt=new RegExp(dt.join("|"),"i");function Xt(t,e,n){var i,r,o,s,a=Kt.test(e),c=t.style;return(n=n||Zt(t))&&(s=n.getPropertyValue(e)||n[e],a&&s&&(s=s.replace(B,"$1")||void 0),""!==s||yt(t)||(s=C.style(t,e)),!y.pixelBoxStyles()&&Jt.test(s)&&Qt.test(e)&&(i=c.width,r=c.minWidth,o=c.maxWidth,c.minWidth=c.maxWidth=c.width=s,s=n.width,c.width=i,c.minWidth=r,c.maxWidth=o)),void 0!==s?s+"":s}function te(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",vt.appendChild(u).appendChild(l);var t=i.getComputedStyle(l);n="1%"!==t.top,c=12===e(t.marginLeft),l.style.right="60%",s=36===e(t.right),r=36===e(t.width),l.style.position="absolute",o=12===e(l.offsetWidth/3),vt.removeChild(u),l=null}}function e(t){return Math.round(parseFloat(t))}var n,r,o,s,a,c,u=b.createElement("div"),l=b.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,C.extend(y,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),c},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,e,n,r;return null==a&&(t=b.createElement("table"),e=b.createElement("tr"),n=b.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",n.style.height="9px",n.style.display="block",vt.appendChild(t).appendChild(e).appendChild(n),r=i.getComputedStyle(e),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===e.offsetHeight,vt.removeChild(t)),a}}))}();var ee=["Webkit","Moz","ms"],ne=b.createElement("div").style,ie={};function re(t){var e=C.cssProps[t]||ie[t];return e||(t in ne?t:ie[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=ee.length;n--;)if((t=ee[n]+e)in ne)return t}(t)||t)}var oe=/^(none|table(?!-c[ea]).+)/,se={position:"absolute",visibility:"hidden",display:"block"},ae={letterSpacing:"0",fontWeight:"400"};function ce(t,e,n){var i=pt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function ue(t,e,n,i,r,o){var s="width"===e?1:0,a=0,c=0,u=0;if(n===(i?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(u+=C.css(t,n+dt[s],!0,r)),i?("content"===n&&(c-=C.css(t,"padding"+dt[s],!0,r)),"margin"!==n&&(c-=C.css(t,"border"+dt[s]+"Width",!0,r))):(c+=C.css(t,"padding"+dt[s],!0,r),"padding"!==n?c+=C.css(t,"border"+dt[s]+"Width",!0,r):a+=C.css(t,"border"+dt[s]+"Width",!0,r));return!i&&o>=0&&(c+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-c-a-.5))||0),c+u}function le(t,e,n){var i=Zt(t),r=(!y.boxSizingReliable()||n)&&"border-box"===C.css(t,"boxSizing",!1,i),o=r,s=Xt(t,e,i),a="offset"+e[0].toUpperCase()+e.slice(1);if(Jt.test(s)){if(!n)return s;s="auto"}return(!y.boxSizingReliable()&&r||!y.reliableTrDimensions()&&P(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===C.css(t,"display",!1,i))&&t.getClientRects().length&&(r="border-box"===C.css(t,"boxSizing",!1,i),(o=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+ue(t,e,n||(r?"border":"content"),o,i,s)+"px"}function he(t,e,n,i,r){return new he.prototype.init(t,e,n,i,r)}C.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Xt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=rt(e),c=Kt.test(e),u=t.style;if(c||(e=re(a)),s=C.cssHooks[e]||C.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(t,!1,i))?r:u[e];"string"===(o=typeof n)&&(r=pt.exec(n))&&r[1]&&(n=bt(t,e,r),o="number"),null!=n&&n==n&&("number"!==o||c||(n+=r&&r[3]||(C.cssNumber[a]?"":"px")),y.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,i))||(c?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,i){var r,o,s,a=rt(e);return Kt.test(e)||(e=re(a)),(s=C.cssHooks[e]||C.cssHooks[a])&&"get"in s&&(r=s.get(t,!0,n)),void 0===r&&(r=Xt(t,e,i)),"normal"===r&&e in ae&&(r=ae[e]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),C.each(["height","width"],(function(t,e){C.cssHooks[e]={get:function(t,n,i){if(n)return!oe.test(C.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?le(t,e,i):Yt(t,se,(function(){return le(t,e,i)}))},set:function(t,n,i){var r,o=Zt(t),s=!y.scrollboxSize()&&"absolute"===o.position,a=(s||i)&&"border-box"===C.css(t,"boxSizing",!1,o),c=i?ue(t,e,i,a,o):0;return a&&s&&(c-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-ue(t,e,"border",!1,o)-.5)),c&&(r=pt.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=C.css(t,e)),ce(0,n,c)}}})),C.cssHooks.marginLeft=te(y.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Xt(t,"marginLeft"))||t.getBoundingClientRect().left-Yt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),C.each({margin:"",padding:"",border:"Width"},(function(t,e){C.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+dt[i]+e]=o[i]||o[i-2]||o[0];return r}},"margin"!==t&&(C.cssHooks[t+e].set=ce)})),C.fn.extend({css:function(t,e){return tt(this,(function(t,e,n){var i,r,o={},s=0;if(Array.isArray(e)){for(i=Zt(t),r=e.length;s<r;s++)o[e[s]]=C.css(t,e[s],!1,i);return o}return void 0!==n?C.style(t,e,n):C.css(t,e)}),t,e,arguments.length>1)}}),C.Tween=he,he.prototype={constructor:he,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||C.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(C.cssNumber[n]?"":"px")},cur:function(){var t=he.propHooks[this.prop];return t&&t.get?t.get(this):he.propHooks._default.get(this)},run:function(t){var e,n=he.propHooks[this.prop];return this.options.duration?this.pos=e=C.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):he.propHooks._default.set(this),this}},he.prototype.init.prototype=he.prototype,he.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=C.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){C.fx.step[t.prop]?C.fx.step[t.prop](t):1!==t.elem.nodeType||!C.cssHooks[t.prop]&&null==t.elem.style[re(t.prop)]?t.elem[t.prop]=t.now:C.style(t.elem,t.prop,t.now+t.unit)}}},he.propHooks.scrollTop=he.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},C.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},C.fx=he.prototype.init,C.fx.step={};var fe,pe,de=/^(?:toggle|show|hide)$/,ve=/queueHooks$/;function ye(){pe&&(!1===b.hidden&&i.requestAnimationFrame?i.requestAnimationFrame(ye):i.setTimeout(ye,C.fx.interval),C.fx.tick())}function me(){return i.setTimeout((function(){fe=void 0})),fe=Date.now()}function ge(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=dt[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function be(t,e,n){for(var i,r=(we.tweeners[e]||[]).concat(we.tweeners["*"]),o=0,s=r.length;o<s;o++)if(i=r[o].call(n,e,t))return i}function we(t,e,n){var i,r,o=0,s=we.prefilters.length,a=C.Deferred().always((function(){delete c.elem})),c=function(){if(r)return!1;for(var e=fe||me(),n=Math.max(0,u.startTime+u.duration-e),i=1-(n/u.duration||0),o=0,s=u.tweens.length;o<s;o++)u.tweens[o].run(i);return a.notifyWith(t,[u,i,n]),i<1&&s?n:(s||a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u]),!1)},u=a.promise({elem:t,props:C.extend({},e),opts:C.extend(!0,{specialEasing:{},easing:C.easing._default},n),originalProperties:e,originalOptions:n,startTime:fe||me(),duration:n.duration,tweens:[],createTween:function(e,n){var i=C.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(i),i},stop:function(e){var n=0,i=e?u.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)u.tweens[n].run(1);return e?(a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u,e])):a.rejectWith(t,[u,e]),this}}),l=u.props;for(!function(t,e){var n,i,r,o,s;for(n in t)if(r=e[i=rt(n)],o=t[n],Array.isArray(o)&&(r=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),(s=C.cssHooks[i])&&"expand"in s)for(n in o=s.expand(o),delete t[i],o)n in t||(t[n]=o[n],e[n]=r);else e[i]=r}(l,u.opts.specialEasing);o<s;o++)if(i=we.prefilters[o].call(u,t,l,u.opts))return m(i.stop)&&(C._queueHooks(u.elem,u.opts.queue).stop=i.stop.bind(i)),i;return C.map(l,be,u),m(u.opts.start)&&u.opts.start.call(t,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),C.fx.timer(C.extend(c,{elem:t,anim:u,queue:u.opts.queue})),u}C.Animation=C.extend(we,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return bt(n.elem,t,pt.exec(e),n),n}]},tweener:function(t,e){m(t)?(e=t,t=["*"]):t=t.match(G);for(var n,i=0,r=t.length;i<r;i++)n=t[i],we.tweeners[n]=we.tweeners[n]||[],we.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var i,r,o,s,a,c,u,l,h="width"in e||"height"in e,f=this,p={},d=t.style,v=t.nodeType&>(t),y=at.get(t,"fxshow");for(i in n.queue||(null==(s=C._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,f.always((function(){f.always((function(){s.unqueued--,C.queue(t,"fx").length||s.empty.fire()}))}))),e)if(r=e[i],de.test(r)){if(delete e[i],o=o||"toggle"===r,r===(v?"hide":"show")){if("show"!==r||!y||void 0===y[i])continue;v=!0}p[i]=y&&y[i]||C.style(t,i)}if((c=!C.isEmptyObject(e))||!C.isEmptyObject(p))for(i in h&&1===t.nodeType&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],null==(u=y&&y.display)&&(u=at.get(t,"display")),"none"===(l=C.css(t,"display"))&&(u?l=u:(At([t],!0),u=t.style.display||u,l=C.css(t,"display"),At([t]))),("inline"===l||"inline-block"===l&&null!=u)&&"none"===C.css(t,"float")&&(c||(f.done((function(){d.display=u})),null==u&&(l=d.display,u="none"===l?"":l)),d.display="inline-block")),n.overflow&&(d.overflow="hidden",f.always((function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}))),c=!1,p)c||(y?"hidden"in y&&(v=y.hidden):y=at.access(t,"fxshow",{display:u}),o&&(y.hidden=!v),v&&At([t],!0),f.done((function(){for(i in v||At([t]),at.remove(t,"fxshow"),p)C.style(t,i,p[i])}))),c=be(v?y[i]:0,i,f),i in y||(y[i]=c.start,v&&(c.end=c.start,c.start=0))}],prefilter:function(t,e){e?we.prefilters.unshift(t):we.prefilters.push(t)}}),C.speed=function(t,e,n){var i=t&&"object"==typeof t?C.extend({},t):{complete:n||!n&&e||m(t)&&t,duration:t,easing:n&&e||e&&!m(e)&&e};return C.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in C.fx.speeds?i.duration=C.fx.speeds[i.duration]:i.duration=C.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){m(i.old)&&i.old.call(this),i.queue&&C.dequeue(this,i.queue)},i},C.fn.extend({fadeTo:function(t,e,n,i){return this.filter(gt).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=C.isEmptyObject(t),o=C.speed(e,n,i),s=function(){var e=we(this,C.extend({},t),o);(r||at.get(this,"finish"))&&e.stop(!0)};return s.finish=s,r||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,r=null!=t&&t+"queueHooks",o=C.timers,s=at.get(this);if(r)s[r]&&s[r].stop&&i(s[r]);else for(r in s)s[r]&&s[r].stop&&ve.test(r)&&i(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=t&&o[r].queue!==t||(o[r].anim.stop(n),e=!1,o.splice(r,1));!e&&n||C.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=at.get(this),i=n[t+"queue"],r=n[t+"queueHooks"],o=C.timers,s=i?i.length:0;for(n.finish=!0,C.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<s;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),C.each(["toggle","show","hide"],(function(t,e){var n=C.fn[e];C.fn[e]=function(t,i,r){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(ge(e,!0),t,i,r)}})),C.each({slideDown:ge("show"),slideUp:ge("hide"),slideToggle:ge("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){C.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),C.timers=[],C.fx.tick=function(){var t,e=0,n=C.timers;for(fe=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||C.fx.stop(),fe=void 0},C.fx.timer=function(t){C.timers.push(t),C.fx.start()},C.fx.interval=13,C.fx.start=function(){pe||(pe=!0,ye())},C.fx.stop=function(){pe=null},C.fx.speeds={slow:600,fast:200,_default:400},C.fn.delay=function(t,e){return t=C.fx&&C.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,n){var r=i.setTimeout(e,t);n.stop=function(){i.clearTimeout(r)}}))},function(){var t=b.createElement("input"),e=b.createElement("select").appendChild(b.createElement("option"));t.type="checkbox",y.checkOn=""!==t.value,y.optSelected=e.selected,(t=b.createElement("input")).value="t",t.type="radio",y.radioValue="t"===t.value}();var ke,Ae=C.expr.attrHandle;C.fn.extend({attr:function(t,e){return tt(this,C.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){C.removeAttr(this,t)}))}}),C.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?C.prop(t,e,n):(1===o&&C.isXMLDoc(t)||(r=C.attrHooks[e.toLowerCase()]||(C.expr.match.bool.test(e)?ke:void 0)),void 0!==n?null===n?void C.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=C.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!y.radioValue&&"radio"===e&&P(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(G);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),ke={set:function(t,e,n){return!1===e?C.removeAttr(t,n):t.setAttribute(n,n),n}},C.each(C.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=Ae[e]||C.find.attr;Ae[e]=function(t,e,i){var r,o,s=e.toLowerCase();return i||(o=Ae[s],Ae[s]=r,r=null!=n(t,e,i)?s:null,Ae[s]=o),r}}));var Se=/^(?:input|select|textarea|button)$/i,xe=/^(?:a|area)$/i;function Ce(t){return(t.match(G)||[]).join(" ")}function Oe(t){return t.getAttribute&&t.getAttribute("class")||""}function Pe(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(G)||[]}C.fn.extend({prop:function(t,e){return tt(this,C.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[C.propFix[t]||t]}))}}),C.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&C.isXMLDoc(t)||(e=C.propFix[e]||e,r=C.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=C.find.attr(t,"tabindex");return e?parseInt(e,10):Se.test(t.nodeName)||xe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(C.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),C.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){C.propFix[this.toLowerCase()]=this})),C.fn.extend({addClass:function(t){var e,n,i,r,o,s;return m(t)?this.each((function(e){C(this).addClass(t.call(this,e,Oe(this)))})):(e=Pe(t)).length?this.each((function(){if(i=Oe(this),n=1===this.nodeType&&" "+Ce(i)+" "){for(o=0;o<e.length;o++)r=e[o],n.indexOf(" "+r+" ")<0&&(n+=r+" ");s=Ce(n),i!==s&&this.setAttribute("class",s)}})):this},removeClass:function(t){var e,n,i,r,o,s;return m(t)?this.each((function(e){C(this).removeClass(t.call(this,e,Oe(this)))})):arguments.length?(e=Pe(t)).length?this.each((function(){if(i=Oe(this),n=1===this.nodeType&&" "+Ce(i)+" "){for(o=0;o<e.length;o++)for(r=e[o];n.indexOf(" "+r+" ")>-1;)n=n.replace(" "+r+" "," ");s=Ce(n),i!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(t,e){var n,i,r,o,s=typeof t,a="string"===s||Array.isArray(t);return m(t)?this.each((function(n){C(this).toggleClass(t.call(this,n,Oe(this),e),e)})):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(n=Pe(t),this.each((function(){if(a)for(o=C(this),r=0;r<n.length;r++)i=n[r],o.hasClass(i)?o.removeClass(i):o.addClass(i);else void 0!==t&&"boolean"!==s||((i=Oe(this))&&at.set(this,"__className__",i),this.setAttribute&&this.setAttribute("class",i||!1===t?"":at.get(this,"__className__")||""))})))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+Ce(Oe(n))+" ").indexOf(e)>-1)return!0;return!1}});var Ee=/\r/g;C.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=m(t),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,C(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=C.map(r,(function(t){return null==t?"":t+""}))),(e=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=C.valHooks[r.type]||C.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(Ee,""):null==n?"":n:void 0}}),C.extend({valHooks:{option:{get:function(t){var e=C.find.attr(t,"value");return null!=e?e:Ce(C.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,s="select-one"===t.type,a=s?null:[],c=s?o+1:r.length;for(i=o<0?c:s?o:0;i<c;i++)if(((n=r[i]).selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!P(n.parentNode,"optgroup"))){if(e=C(n).val(),s)return e;a.push(e)}return a},set:function(t,e){for(var n,i,r=t.options,o=C.makeArray(e),s=r.length;s--;)((i=r[s]).selected=C.inArray(C.valHooks.option.get(i),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),C.each(["radio","checkbox"],(function(){C.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=C.inArray(C(t).val(),e)>-1}},y.checkOn||(C.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Te=i.location,je={guid:Date.now()},_e=/\?/;C.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new i.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||C.error("Invalid XML: "+(n?C.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Be=/^(?:focusinfocus|focusoutblur)$/,Re=function(t){t.stopPropagation()};C.extend(C.event,{trigger:function(t,e,n,r){var o,s,a,c,u,l,h,f,d=[n||b],v=p.call(t,"type")?t.type:t,y=p.call(t,"namespace")?t.namespace.split("."):[];if(s=f=a=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!Be.test(v+C.event.triggered)&&(v.indexOf(".")>-1&&(y=v.split("."),v=y.shift(),y.sort()),u=v.indexOf(":")<0&&"on"+v,(t=t[C.expando]?t:new C.Event(v,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=y.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:C.makeArray(e,[t]),h=C.event.special[v]||{},r||!h.trigger||!1!==h.trigger.apply(n,e))){if(!r&&!h.noBubble&&!g(n)){for(c=h.delegateType||v,Be.test(c+v)||(s=s.parentNode);s;s=s.parentNode)d.push(s),a=s;a===(n.ownerDocument||b)&&d.push(a.defaultView||a.parentWindow||i)}for(o=0;(s=d[o++])&&!t.isPropagationStopped();)f=s,t.type=o>1?c:h.bindType||v,(l=(at.get(s,"events")||Object.create(null))[t.type]&&at.get(s,"handle"))&&l.apply(s,e),(l=u&&s[u])&&l.apply&&ot(s)&&(t.result=l.apply(s,e),!1===t.result&&t.preventDefault());return t.type=v,r||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(d.pop(),e)||!ot(n)||u&&m(n[v])&&!g(n)&&((a=n[u])&&(n[u]=null),C.event.triggered=v,t.isPropagationStopped()&&f.addEventListener(v,Re),n[v](),t.isPropagationStopped()&&f.removeEventListener(v,Re),C.event.triggered=void 0,a&&(n[u]=a)),t.result}},simulate:function(t,e,n){var i=C.extend(new C.Event,n,{type:t,isSimulated:!0});C.event.trigger(i,null,e)}}),C.fn.extend({trigger:function(t,e){return this.each((function(){C.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return C.event.trigger(t,e,n,!0)}});var Ie=/\[\]$/,De=/\r?\n/g,Ne=/^(?:submit|button|image|reset|file)$/i,Me=/^(?:input|select|textarea|keygen)/i;function Ve(t,e,n,i){var r;if(Array.isArray(e))C.each(e,(function(e,r){n||Ie.test(t)?i(t,r):Ve(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)}));else if(n||"object"!==A(e))i(t,e);else for(r in e)Ve(t+"["+r+"]",e[r],n,i)}C.param=function(t,e){var n,i=[],r=function(t,e){var n=m(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!C.isPlainObject(t))C.each(t,(function(){r(this.name,this.value)}));else for(n in t)Ve(n,t[n],e,r);return i.join("&")},C.fn.extend({serialize:function(){return C.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=C.prop(this,"elements");return t?C.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!C(this).is(":disabled")&&Me.test(this.nodeName)&&!Ne.test(t)&&(this.checked||!Ct.test(t))})).map((function(t,e){var n=C(this).val();return null==n?null:Array.isArray(n)?C.map(n,(function(t){return{name:e.name,value:t.replace(De,"\r\n")}})):{name:e.name,value:n.replace(De,"\r\n")}})).get()}});var qe=/%20/g,Le=/#.*$/,Fe=/([?&])_=[^&]*/,ze=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:GET|HEAD)$/,$e=/^\/\//,He={},We={},Ge="*/".concat("*"),Je=b.createElement("a");function Ke(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(G)||[];if(m(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Ze(t,e,n,i){var r={},o=t===We;function s(a){var c;return r[a]=!0,C.each(t[a]||[],(function(t,a){var u=a(e,n,i);return"string"!=typeof u||o||r[u]?o?!(c=u):void 0:(e.dataTypes.unshift(u),s(u),!1)})),c}return s(e.dataTypes[0])||!r["*"]&&s("*")}function Ye(t,e){var n,i,r=C.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&C.extend(!0,t,i),t}Je.href=Te.href,C.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Te.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Te.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ge,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":C.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ye(Ye(t,C.ajaxSettings),e):Ye(C.ajaxSettings,t)},ajaxPrefilter:Ke(He),ajaxTransport:Ke(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,r,o,s,a,c,u,l,h,f,p=C.ajaxSetup({},e),d=p.context||p,v=p.context&&(d.nodeType||d.jquery)?C(d):C.event,y=C.Deferred(),m=C.Callbacks("once memory"),g=p.statusCode||{},w={},k={},A="canceled",S={readyState:0,getResponseHeader:function(t){var e;if(u){if(!s)for(s={};e=ze.exec(o);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=k[t.toLowerCase()]=k[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==u&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)S.always(t[S.status]);else for(e in t)g[e]=[g[e],t[e]];return this},abort:function(t){var e=t||A;return n&&n.abort(e),x(0,e),this}};if(y.promise(S),p.url=((t||p.url||Te.href)+"").replace($e,Te.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(G)||[""],null==p.crossDomain){c=b.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=Je.protocol+"//"+Je.host!=c.protocol+"//"+c.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=C.param(p.data,p.traditional)),Ze(He,p,e,S),u)return S;for(h in(l=C.event&&p.global)&&0==C.active++&&C.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ue.test(p.type),r=p.url.replace(Le,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(qe,"+")):(f=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=(_e.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(Fe,"$1"),f=(_e.test(r)?"&":"?")+"_="+je.guid+++f),p.url=r+f),p.ifModified&&(C.lastModified[r]&&S.setRequestHeader("If-Modified-Since",C.lastModified[r]),C.etag[r]&&S.setRequestHeader("If-None-Match",C.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&S.setRequestHeader("Content-Type",p.contentType),S.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ge+"; q=0.01":""):p.accepts["*"]),p.headers)S.setRequestHeader(h,p.headers[h]);if(p.beforeSend&&(!1===p.beforeSend.call(d,S,p)||u))return S.abort();if(A="abort",m.add(p.complete),S.done(p.success),S.fail(p.error),n=Ze(We,p,e,S)){if(S.readyState=1,l&&v.trigger("ajaxSend",[S,p]),u)return S;p.async&&p.timeout>0&&(a=i.setTimeout((function(){S.abort("timeout")}),p.timeout));try{u=!1,n.send(w,x)}catch(t){if(u)throw t;x(-1,t)}}else x(-1,"No Transport");function x(t,e,s,c){var h,f,b,w,k,A=e;u||(u=!0,a&&i.clearTimeout(a),n=void 0,o=c||"",S.readyState=t>0?4:0,h=t>=200&&t<300||304===t,s&&(w=function(t,e,n){for(var i,r,o,s,a=t.contents,c=t.dataTypes;"*"===c[0];)c.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){c.unshift(r);break}if(c[0]in n)o=c[0];else{for(r in n){if(!c[0]||t.converters[r+" "+c[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==c[0]&&c.unshift(o),n[o]}(p,S,s)),!h&&C.inArray("script",p.dataTypes)>-1&&C.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(t,e,n,i){var r,o,s,a,c,u={},l=t.dataTypes.slice();if(l[1])for(s in t.converters)u[s.toLowerCase()]=t.converters[s];for(o=l.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!c&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),c=o,o=l.shift())if("*"===o)o=c;else if("*"!==c&&c!==o){if(!(s=u[c+" "+o]||u["* "+o]))for(r in u)if((a=r.split(" "))[1]===o&&(s=u[c+" "+a[0]]||u["* "+a[0]])){!0===s?s=u[r]:!0!==u[r]&&(o=a[0],l.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+c+" to "+o}}}return{state:"success",data:e}}(p,w,S,h),h?(p.ifModified&&((k=S.getResponseHeader("Last-Modified"))&&(C.lastModified[r]=k),(k=S.getResponseHeader("etag"))&&(C.etag[r]=k)),204===t||"HEAD"===p.type?A="nocontent":304===t?A="notmodified":(A=w.state,f=w.data,h=!(b=w.error))):(b=A,!t&&A||(A="error",t<0&&(t=0))),S.status=t,S.statusText=(e||A)+"",h?y.resolveWith(d,[f,A,S]):y.rejectWith(d,[S,A,b]),S.statusCode(g),g=void 0,l&&v.trigger(h?"ajaxSuccess":"ajaxError",[S,p,h?f:b]),m.fireWith(d,[S,A]),l&&(v.trigger("ajaxComplete",[S,p]),--C.active||C.event.trigger("ajaxStop")))}return S},getJSON:function(t,e,n){return C.get(t,e,n,"json")},getScript:function(t,e){return C.get(t,void 0,e,"script")}}),C.each(["get","post"],(function(t,e){C[e]=function(t,n,i,r){return m(n)&&(r=r||i,i=n,n=void 0),C.ajax(C.extend({url:t,type:e,dataType:r,data:n,success:i},C.isPlainObject(t)&&t))}})),C.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),C._evalUrl=function(t,e,n){return C.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){C.globalEval(t,e,n)}})},C.fn.extend({wrapAll:function(t){var e;return this[0]&&(m(t)&&(t=t.call(this[0])),e=C(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return m(t)?this.each((function(e){C(this).wrapInner(t.call(this,e))})):this.each((function(){var e=C(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=m(t);return this.each((function(n){C(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){C(this).replaceWith(this.childNodes)})),this}}),C.expr.pseudos.hidden=function(t){return!C.expr.pseudos.visible(t)},C.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},C.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(t){}};var Qe={0:200,1223:204},Xe=C.ajaxSettings.xhr();y.cors=!!Xe&&"withCredentials"in Xe,y.ajax=Xe=!!Xe,C.ajaxTransport((function(t){var e,n;if(y.cors||Xe&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Qe[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&i.setTimeout((function(){e&&n()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),C.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),C.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return C.globalEval(t),t}}}),C.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),C.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=C("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&r("error"===t.type?404:200,t.type)}),b.head.appendChild(e[0])},abort:function(){n&&n()}}}));var tn,en=[],nn=/(=)\?(?=&|$)|\?\?/;C.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=en.pop()||C.expando+"_"+je.guid++;return this[t]=!0,t}}),C.ajaxPrefilter("json jsonp",(function(t,e,n){var r,o,s,a=!1!==t.jsonp&&(nn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(nn,"$1"+r):!1!==t.jsonp&&(t.url+=(_e.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return s||C.error(r+" was not called"),s[0]},t.dataTypes[0]="json",o=i[r],i[r]=function(){s=arguments},n.always((function(){void 0===o?C(i).removeProp(r):i[r]=o,t[r]&&(t.jsonpCallback=e.jsonpCallback,en.push(r)),s&&m(o)&&o(s[0]),s=o=void 0})),"script"})),y.createHTMLDocument=((tn=b.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===tn.childNodes.length),C.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(y.createHTMLDocument?((i=(e=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,e.head.appendChild(i)):e=b),o=!n&&[],(r=L.exec(t))?[e.createElement(r[1])]:(r=Bt([t],e,o),o&&o.length&&C(o).remove(),C.merge([],r.childNodes)));var i,r,o},C.fn.load=function(t,e,n){var i,r,o,s=this,a=t.indexOf(" ");return a>-1&&(i=Ce(t.slice(a)),t=t.slice(0,a)),m(e)?(n=e,e=void 0):e&&"object"==typeof e&&(r="POST"),s.length>0&&C.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done((function(t){o=arguments,s.html(i?C("<div>").append(C.parseHTML(t)).find(i):t)})).always(n&&function(t,e){s.each((function(){n.apply(this,o||[t.responseText,e,t])}))}),this},C.expr.pseudos.animated=function(t){return C.grep(C.timers,(function(e){return t===e.elem})).length},C.offset={setOffset:function(t,e,n){var i,r,o,s,a,c,u=C.css(t,"position"),l=C(t),h={};"static"===u&&(t.style.position="relative"),a=l.offset(),o=C.css(t,"top"),c=C.css(t,"left"),("absolute"===u||"fixed"===u)&&(o+c).indexOf("auto")>-1?(s=(i=l.position()).top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(c)||0),m(e)&&(e=e.call(t,n,C.extend({},a))),null!=e.top&&(h.top=e.top-a.top+s),null!=e.left&&(h.left=e.left-a.left+r),"using"in e?e.using.call(t,h):l.css(h)}},C.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){C.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],r={top:0,left:0};if("fixed"===C.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===C.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((r=C(t).offset()).top+=C.css(t,"borderTopWidth",!0),r.left+=C.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-C.css(i,"marginTop",!0),left:e.left-r.left-C.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===C.css(t,"position");)t=t.offsetParent;return t||vt}))}}),C.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;C.fn[t]=function(i){return tt(this,(function(t,i,r){var o;if(g(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===r)return o?o[e]:t[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):t[i]=r}),t,i,arguments.length)}})),C.each(["top","left"],(function(t,e){C.cssHooks[e]=te(y.pixelPosition,(function(t,n){if(n)return n=Xt(t,e),Jt.test(n)?C(t).position()[e]+"px":n}))})),C.each({Height:"height",Width:"width"},(function(t,e){C.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){C.fn[i]=function(r,o){var s=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===o?"margin":"border");return tt(this,(function(e,n,r){var o;return g(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===r?C.css(e,n,a):C.style(e,n,r,a)}),e,s?r:void 0,s)}}))})),C.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){C.fn[e]=function(t){return this.on(e,t)}})),C.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),C.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){C.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var rn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;C.proxy=function(t,e){var n,i,r;if("string"==typeof e&&(n=t[e],e=t,t=n),m(t))return i=a.call(arguments,2),r=function(){return t.apply(e||this,i.concat(a.call(arguments)))},r.guid=t.guid=t.guid||C.guid++,r},C.holdReady=function(t){t?C.readyWait++:C.ready(!0)},C.isArray=Array.isArray,C.parseJSON=JSON.parse,C.nodeName=P,C.isFunction=m,C.isWindow=g,C.camelCase=rt,C.type=A,C.now=Date.now,C.isNumeric=function(t){var e=C.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},C.trim=function(t){return null==t?"":(t+"").replace(rn,"$1")},void 0===(n=function(){return C}.apply(e,[]))||(t.exports=n);var on=i.jQuery,sn=i.$;return C.noConflict=function(t){return i.$===C&&(i.$=sn),t&&i.jQuery===C&&(i.jQuery=on),C},void 0===r&&(i.jQuery=i.$=C),C}))},925:function(t){"use strict";var e={};function n(){try{return new window.XMLHttpRequest}catch(t){}}e._getBinaryFromXHR=function(t){return t.response||t.responseText};var i="undefined"!=typeof window&&window.ActiveXObject?function(){return n()||function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:n;e.getBinaryContent=function(t,n){var r,o,s,a;n||(n={}),"function"==typeof n?(a=n,n={}):"function"==typeof n.callback&&(a=n.callback),a||"undefined"==typeof Promise?(o=function(t){a(null,t)},s=function(t){a(t,null)}):r=new Promise((function(t,e){o=t,s=e}));try{var c=i();c.open("GET",t,!0),"responseType"in c&&(c.responseType="arraybuffer"),c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),c.onreadystatechange=function(n){if(4===c.readyState)if(200===c.status||0===c.status)try{o(e._getBinaryFromXHR(c))}catch(t){s(new Error(t))}else s(new Error("Ajax error for "+t+" : "+this.status+" "+this.statusText))},n.progress&&(c.onprogress=function(e){n.progress({path:t,originalEvent:e,percent:e.loaded/e.total*100,loaded:e.loaded,total:e.total})}),c.send()}catch(t){s(new Error(t),null)}return r},t.exports=e},733:function(t,e,n){t.exports=function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};e[s][0].call(u.exports,(function(t){return r(e[s][1][t]||t)}),u,u.exports,t,e,n,i)}return n[s].exports}for(var o=void 0,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(t,e,n){"use strict";var i=t("./utils"),r=t("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(t){for(var e,n,r,s,a,c,u,l=[],h=0,f=t.length,p=f,d="string"!==i.getTypeOf(t);h<t.length;)p=f-h,r=d?(e=t[h++],n=h<f?t[h++]:0,h<f?t[h++]:0):(e=t.charCodeAt(h++),n=h<f?t.charCodeAt(h++):0,h<f?t.charCodeAt(h++):0),s=e>>2,a=(3&e)<<4|n>>4,c=1<p?(15&n)<<2|r>>6:64,u=2<p?63&r:64,l.push(o.charAt(s)+o.charAt(a)+o.charAt(c)+o.charAt(u));return l.join("")},n.decode=function(t){var e,n,i,s,a,c,u=0,l=0,h="data:";if(t.substr(0,h.length)===h)throw new Error("Invalid base64 input, it looks like a data url.");var f,p=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&p--,t.charAt(t.length-2)===o.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=r.uint8array?new Uint8Array(0|p):new Array(0|p);u<t.length;)e=o.indexOf(t.charAt(u++))<<2|(s=o.indexOf(t.charAt(u++)))>>4,n=(15&s)<<4|(a=o.indexOf(t.charAt(u++)))>>2,i=(3&a)<<6|(c=o.indexOf(t.charAt(u++))),f[l++]=e,64!==a&&(f[l++]=n),64!==c&&(f[l++]=i);return f}},{"./support":30,"./utils":32}],2:[function(t,e,n){"use strict";var i=t("./external"),r=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),s=t("./stream/DataLengthProbe");function a(t,e,n,i,r){this.compressedSize=t,this.uncompressedSize=e,this.crc32=n,this.compression=i,this.compressedContent=r}a.prototype={getContentWorker:function(){var t=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,n){return t.pipe(new o).pipe(new s("uncompressedSize")).pipe(e.compressWorker(n)).pipe(new s("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,n){"use strict";var i=t("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,n){"use strict";var i=t("./utils"),r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,n,i){var o=r,s=i+n;t^=-1;for(var a=i;a<s;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}(0|e,t,t.length,0):function(t,e,n,i){var o=r,s=i+n;t^=-1;for(var a=i;a<s;a++)t=t>>>8^o[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length,0):0}},{"./utils":32}],5:[function(t,e,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(t,e,n){"use strict";var i=null;i="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=t("pako"),o=t("./utils"),s=t("./stream/GenericWorker"),a=i?"uint8array":"array";function c(t,e){s.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}n.magic="\b\0",o.inherits(c,s),c.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(a,t.data),!1)},c.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},n.compressWorker=function(t){return new c("Deflate",t)},n.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,n){"use strict";function i(t,e){var n,i="";for(n=0;n<e;n++)i+=String.fromCharCode(255&t),t>>>=8;return i}function r(t,e,n,r,s,l){var h,f,p=t.file,d=t.compression,v=l!==a.utf8encode,y=o.transformTo("string",l(p.name)),m=o.transformTo("string",a.utf8encode(p.name)),g=p.comment,b=o.transformTo("string",l(g)),w=o.transformTo("string",a.utf8encode(g)),k=m.length!==p.name.length,A=w.length!==g.length,S="",x="",C="",O=p.dir,P=p.date,E={crc32:0,compressedSize:0,uncompressedSize:0};e&&!n||(E.crc32=t.crc32,E.compressedSize=t.compressedSize,E.uncompressedSize=t.uncompressedSize);var T=0;e&&(T|=8),v||!k&&!A||(T|=2048);var j=0,_=0;O&&(j|=16),"UNIX"===s?(_=798,j|=function(t,e){var n=t;return t||(n=e?16893:33204),(65535&n)<<16}(p.unixPermissions,O)):(_=20,j|=function(t){return 63&(t||0)}(p.dosPermissions)),h=P.getUTCHours(),h<<=6,h|=P.getUTCMinutes(),h<<=5,h|=P.getUTCSeconds()/2,f=P.getUTCFullYear()-1980,f<<=4,f|=P.getUTCMonth()+1,f<<=5,f|=P.getUTCDate(),k&&(x=i(1,1)+i(c(y),4)+m,S+="up"+i(x.length,2)+x),A&&(C=i(1,1)+i(c(b),4)+w,S+="uc"+i(C.length,2)+C);var B="";return B+="\n\0",B+=i(T,2),B+=d.magic,B+=i(h,2),B+=i(f,2),B+=i(E.crc32,4),B+=i(E.compressedSize,4),B+=i(E.uncompressedSize,4),B+=i(y.length,2),B+=i(S.length,2),{fileRecord:u.LOCAL_FILE_HEADER+B+y+S,dirRecord:u.CENTRAL_FILE_HEADER+i(_,2)+B+i(b.length,2)+"\0\0\0\0"+i(j,4)+i(r,4)+y+S+b}}var o=t("../utils"),s=t("../stream/GenericWorker"),a=t("../utf8"),c=t("../crc32"),u=t("../signature");function l(t,e,n,i){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(l,s),l.prototype.push=function(t){var e=t.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,s.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:n?(e+100*(n-i-1))/n:100}}))},l.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var n=r(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,n=r(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),e)this.push({data:function(t){return u.DATA_DESCRIPTOR+i(t.crc32,4)+i(t.compressedSize,4)+i(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var n=this.bytesWritten-t,r=function(t,e,n,r,s){var a=o.transformTo("string",s(r));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(t,2)+i(t,2)+i(e,4)+i(n,4)+i(a.length,2)+a}(this.dirRecords.length,n,t,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},l.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(t){var e=this._sources;if(!s.prototype.error.call(this,t))return!1;for(var n=0;n<e.length;n++)try{e[n].error(t)}catch(t){}return!0},l.prototype.lock=function(){s.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,n){"use strict";var i=t("../compressions"),r=t("./ZipFileWorker");n.generateWorker=function(t,e,n){var o=new r(e.streamFiles,n,e.platform,e.encodeFileName),s=0;try{t.forEach((function(t,n){s++;var r=function(t,e){var n=t||e,r=i[n];if(!r)throw new Error(n+" is not a valid compression method !");return r}(n.options.compression,e.compression),a=n.options.compressionOptions||e.compressionOptions||{},c=n.dir,u=n.date;n._compressWorker(r,a).withStreamInfo("file",{name:t,dir:c,date:u,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)})),o.entriesCount=s}catch(t){o.error(t)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,n){"use strict";function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new i;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(i.prototype=t("./object")).loadAsync=t("./load"),i.support=t("./support"),i.defaults=t("./defaults"),i.version="3.10.1",i.loadAsync=function(t,e){return(new i).loadAsync(t,e)},i.external=t("./external"),e.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,n){"use strict";var i=t("./utils"),r=t("./external"),o=t("./utf8"),s=t("./zipEntries"),a=t("./stream/Crc32Probe"),c=t("./nodejsUtils");function u(t){return new r.Promise((function(e,n){var i=t.decompressed.getContentWorker().pipe(new a);i.on("error",(function(t){n(t)})).on("end",(function(){i.streamInfo.crc32!==t.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}e.exports=function(t,e){var n=this;return e=i.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),c.isNode&&c.isStream(t)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var n=new s(e);return n.load(t),n})).then((function(t){var n=[r.Promise.resolve(t)],i=t.files;if(e.checkCRC32)for(var o=0;o<i.length;o++)n.push(u(i[o]));return r.Promise.all(n)})).then((function(t){for(var r=t.shift(),o=r.files,s=0;s<o.length;s++){var a=o[s],c=a.fileNameStr,u=i.resolve(a.fileNameStr);n.file(u,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:e.createFolders}),a.dir||(n.file(u).unsafeOriginalName=c)}return r.zipComment.length&&(n.comment=r.zipComment),n}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,n){"use strict";var i=t("../utils"),r=t("../stream/GenericWorker");function o(t,e){r.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}i.inherits(o,r),o.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},o.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,n){"use strict";var i=t("readable-stream").Readable;function r(t,e,n){i.call(this,e),this._helper=t;var r=this;t.on("data",(function(t,e){r.push(t)||r._helper.pause(),n&&n(e)})).on("error",(function(t){r.emit("error",t)})).on("end",(function(){r.push(null)}))}t("../utils").inherits(r,i),r.prototype._read=function(){this._helper.resume()},e.exports=r},{"../utils":32,"readable-stream":16}],14:[function(t,e,n){"use strict";e.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,n){"use strict";function i(t,e,n){var i,r=o.getTypeOf(e),a=o.extend(n||{},c);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(t=v(t)),a.createFolders&&(i=d(t))&&y.call(this,i,!0);var h="string"===r&&!1===a.binary&&!1===a.base64;n&&void 0!==n.binary||(a.binary=!h),(e instanceof u&&0===e.uncompressedSize||a.dir||!e||0===e.length)&&(a.base64=!1,a.binary=!0,e="",a.compression="STORE",r="string");var m=null;m=e instanceof u||e instanceof s?e:f.isNode&&f.isStream(e)?new p(t,e):o.prepareContent(t,e,a.binary,a.optimizedBinaryString,a.base64);var g=new l(t,m,a);this.files[t]=g}var r=t("./utf8"),o=t("./utils"),s=t("./stream/GenericWorker"),a=t("./stream/StreamHelper"),c=t("./defaults"),u=t("./compressedObject"),l=t("./zipObject"),h=t("./generate"),f=t("./nodejsUtils"),p=t("./nodejs/NodejsStreamInputAdapter"),d=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},v=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},y=function(t,e){return e=void 0!==e?e:c.createFolders,t=v(t),this.files[t]||i.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function m(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var g={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,n,i;for(e in this.files)i=this.files[e],(n=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(n,i)},filter:function(t){var e=[];return this.forEach((function(n,i){t(n,i)&&e.push(i)})),e},file:function(t,e,n){if(1!==arguments.length)return t=this.root+t,i.call(this,t,e,n),this;if(m(t)){var r=t;return this.filter((function(t,e){return!e.dir&&r.test(t)}))}var o=this.files[this.root+t];return o&&!o.dir?o:null},folder:function(t){if(!t)return this;if(m(t))return this.filter((function(e,n){return n.dir&&t.test(e)}));var e=this.root+t,n=y.call(this,e),i=this.clone();return i.root=n.name,i},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var n=this.filter((function(e,n){return n.name.slice(0,t.length)===t})),i=0;i<n.length;i++)delete this.files[n[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,n={};try{if((n=o.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:r.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");o.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var i=n.comment||this.comment||"";e=h.generateWorker(this,n,i)}catch(t){(e=new s("error")).error(t)}return new a(e,n.type||"string",n.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=g},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,n){"use strict";e.exports=t("stream")},{stream:void 0}],17:[function(t,e,n){"use strict";var i=t("./DataReader");function r(t){i.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(r,i),r.prototype.byteAt=function(t){return this.data[this.zero+t]},r.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===i&&this.data[o+3]===r)return o-this.zero;return-1},r.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&n===o[1]&&i===o[2]&&r===o[3]},r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./DataReader":18}],18:[function(t,e,n){"use strict";var i=t("../utils");function r(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,n=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=r},{"../utils":32}],19:[function(t,e,n){"use strict";var i=t("./Uint8ArrayReader");function r(t){i.call(this,t)}t("../utils").inherits(r,i),r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,n){"use strict";var i=t("./DataReader");function r(t){i.call(this,t)}t("../utils").inherits(r,i),r.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},r.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},r.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./DataReader":18}],21:[function(t,e,n){"use strict";var i=t("./ArrayReader");function r(t){i.call(this,t)}t("../utils").inherits(r,i),r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,n){"use strict";var i=t("../utils"),r=t("../support"),o=t("./ArrayReader"),s=t("./StringReader"),a=t("./NodeBufferReader"),c=t("./Uint8ArrayReader");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||r.uint8array?"nodebuffer"===e?new a(t):r.uint8array?new c(i.transformTo("uint8array",t)):new o(i.transformTo("array",t)):new s(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,n){"use strict";var i=t("./GenericWorker"),r=t("../utils");function o(t){i.call(this,"ConvertWorker to "+t),this.destType=t}r.inherits(o,i),o.prototype.processChunk=function(t){this.push({data:r.transformTo(this.destType,t.data),meta:t.meta})},e.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,n){"use strict";var i=t("./GenericWorker"),r=t("../crc32");function o(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,i),o.prototype.processChunk=function(t){this.streamInfo.crc32=r(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,n){"use strict";var i=t("../utils"),r=t("./GenericWorker");function o(t){r.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(o,r),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}r.prototype.processChunk.call(this,t)},e.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,n){"use strict";var i=t("../utils"),r=t("./GenericWorker");function o(t){r.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}i.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,n){"use strict";function i(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var n=0;n<this._listeners[t].length;n++)this._listeners[t][n].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=i},{}],29:[function(t,e,n){"use strict";var i=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),s=t("../base64"),a=t("../support"),c=t("../external"),u=null;if(a.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function l(t,e){return new c.Promise((function(n,r){var o=[],a=t._internalType,c=t._outputType,u=t._mimeType;t.on("data",(function(t,n){o.push(t),e&&e(n)})).on("error",(function(t){o=[],r(t)})).on("end",(function(){try{var t=function(t,e,n){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),n);case"base64":return s.encode(e);default:return i.transformTo(t,e)}}(c,function(t,e){var n,i=0,r=null,o=0;for(n=0;n<e.length;n++)o+=e[n].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(r=new Uint8Array(o),n=0;n<e.length;n++)r.set(e[n],i),i+=e[n].length;return r;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(a,o),u);n(t)}catch(t){r(t)}o=[]})).resume()}))}function h(t,e,n){var s=e;switch(e){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=e,this._mimeType=n,i.checkSupport(s),this._worker=t.pipe(new r(s)),t.lock()}catch(t){this._worker=new o("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return l(this,t)},on:function(t,e){var n=this;return"data"===t?this._worker.on(t,(function(t){e.call(n,t.data,t.meta)})):this._worker.on(t,(function(){i.delay(e,arguments,n)})),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer="undefined"!=typeof Buffer,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var i=new ArrayBuffer(0);try{n.blob=0===new Blob([i],{type:"application/zip"}).size}catch(t){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(i),n.blob=0===r.getBlob("application/zip").size}catch(t){n.blob=!1}}}try{n.nodestream=!!t("readable-stream").Readable}catch(t){n.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,n){"use strict";for(var i=t("./utils"),r=t("./support"),o=t("./nodejsUtils"),s=t("./stream/GenericWorker"),a=new Array(256),c=0;c<256;c++)a[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(){s.call(this,"utf-8 decode"),this.leftOver=null}function l(){s.call(this,"utf-8 encode")}a[254]=a[254]=1,n.utf8encode=function(t){return r.nodebuffer?o.newBufferFrom(t,"utf-8"):function(t){var e,n,i,o,s,a=t.length,c=0;for(o=0;o<a;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),c+=n<128?1:n<2048?2:n<65536?3:4;for(e=r.uint8array?new Uint8Array(c):new Array(c),o=s=0;s<c;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?e[s++]=n:(n<2048?e[s++]=192|n>>>6:(n<65536?e[s++]=224|n>>>12:(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63),e[s++]=128|n>>>6&63),e[s++]=128|63&n);return e}(t)},n.utf8decode=function(t){return r.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,n,r,o,s=t.length,c=new Array(2*s);for(e=n=0;e<s;)if((r=t[e++])<128)c[n++]=r;else if(4<(o=a[r]))c[n++]=65533,e+=o-1;else{for(r&=2===o?31:3===o?15:7;1<o&&e<s;)r=r<<6|63&t[e++],o--;1<o?c[n++]=65533:r<65536?c[n++]=r:(r-=65536,c[n++]=55296|r>>10&1023,c[n++]=56320|1023&r)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),i.applyFromCharCode(c)}(t=i.transformTo(r.uint8array?"uint8array":"array",t))},i.inherits(u,s),u.prototype.processChunk=function(t){var e=i.transformTo(r.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var o=e;(e=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),e.set(o,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var s=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return n<0||0===n?e:n+a[t[n]]>e?n:e}(e),c=e;s!==e.length&&(r.uint8array?(c=e.subarray(0,s),this.leftOver=e.subarray(s,e.length)):(c=e.slice(0,s),this.leftOver=e.slice(s,e.length))),this.push({data:n.utf8decode(c),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=u,i.inherits(l,s),l.prototype.processChunk=function(t){this.push({data:n.utf8encode(t.data),meta:t.meta})},n.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,n){"use strict";var i=t("./support"),r=t("./base64"),o=t("./nodejsUtils"),s=t("./external");function a(t){return t}function c(t,e){for(var n=0;n<t.length;++n)e[n]=255&t.charCodeAt(n);return e}t("setimmediate"),n.newBlob=function(t,e){n.checkSupport("blob");try{return new Blob([t],{type:e})}catch(n){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return i.append(t),i.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(t,e,n){var i=[],r=0,o=t.length;if(o<=n)return String.fromCharCode.apply(null,t);for(;r<o;)"array"===e||"nodebuffer"===e?i.push(String.fromCharCode.apply(null,t.slice(r,Math.min(r+n,o)))):i.push(String.fromCharCode.apply(null,t.subarray(r,Math.min(r+n,o)))),r+=n;return i.join("")},stringifyByChar:function(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},applyCanBeUsed:{uint8array:function(){try{return i.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return i.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(t){return!1}}()}};function l(t){var e=65536,i=n.getTypeOf(t),r=!0;if("uint8array"===i?r=u.applyCanBeUsed.uint8array:"nodebuffer"===i&&(r=u.applyCanBeUsed.nodebuffer),r)for(;1<e;)try{return u.stringifyByChunk(t,i,e)}catch(t){e=Math.floor(e/2)}return u.stringifyByChar(t)}function h(t,e){for(var n=0;n<t.length;n++)e[n]=t[n];return e}n.applyFromCharCode=l;var f={};f.string={string:a,array:function(t){return c(t,new Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return c(t,new Uint8Array(t.length))},nodebuffer:function(t){return c(t,o.allocBuffer(t.length))}},f.array={string:l,array:a,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return o.newBufferFrom(t)}},f.arraybuffer={string:function(t){return l(new Uint8Array(t))},array:function(t){return h(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:a,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return o.newBufferFrom(new Uint8Array(t))}},f.uint8array={string:l,array:function(t){return h(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:a,nodebuffer:function(t){return o.newBufferFrom(t)}},f.nodebuffer={string:l,array:function(t){return h(t,new Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return h(t,new Uint8Array(t.length))},nodebuffer:a},n.transformTo=function(t,e){if(e=e||"",!t)return e;n.checkSupport(t);var i=n.getTypeOf(e);return f[i][t](e)},n.resolve=function(t){for(var e=t.split("/"),n=[],i=0;i<e.length;i++){var r=e[i];"."===r||""===r&&0!==i&&i!==e.length-1||(".."===r?n.pop():n.push(r))}return n.join("/")},n.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":i.nodebuffer&&o.isBuffer(t)?"nodebuffer":i.uint8array&&t instanceof Uint8Array?"uint8array":i.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(t){if(!i[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(t){var e,n,i="";for(n=0;n<(t||"").length;n++)i+="\\x"+((e=t.charCodeAt(n))<16?"0":"")+e.toString(16).toUpperCase();return i},n.delay=function(t,e,n){setImmediate((function(){t.apply(n||null,e||[])}))},n.inherits=function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n},n.extend=function(){var t,e,n={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===n[e]&&(n[e]=arguments[t][e]);return n},n.prepareContent=function(t,e,o,a,u){return s.Promise.resolve(e).then((function(t){return i.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new s.Promise((function(e,n){var i=new FileReader;i.onload=function(t){e(t.target.result)},i.onerror=function(t){n(t.target.error)},i.readAsArrayBuffer(t)})):t})).then((function(e){var l=n.getTypeOf(e);return l?("arraybuffer"===l?e=n.transformTo("uint8array",e):"string"===l&&(u?e=r.decode(e):o&&!0!==a&&(e=function(t){return c(t,i.uint8array?new Uint8Array(t.length):new Array(t.length))}(e))),e):s.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,n){"use strict";var i=t("./reader/readerFor"),r=t("./utils"),o=t("./signature"),s=t("./zipEntry"),a=t("./support");function c(t){this.files=[],this.loadOptions=t}c.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+r.pretty(e)+", expected "+r.pretty(t)+")")}},isSignature:function(t,e){var n=this.reader.index;this.reader.setIndex(t);var i=this.reader.readString(4)===e;return this.reader.setIndex(n),i},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=a.uint8array?"uint8array":"array",n=r.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,n,i=this.zip64EndOfCentralSize-44;0<i;)t=this.reader.readInt(2),e=this.reader.readInt(4),n=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(t=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===r.MAX_VALUE_16BITS||this.diskWithCentralDirStart===r.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===r.MAX_VALUE_16BITS||this.centralDirRecords===r.MAX_VALUE_16BITS||this.centralDirSize===r.MAX_VALUE_32BITS||this.centralDirOffset===r.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var i=e-n;if(0<i)this.isSignature(e,o.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(t){this.reader=i(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,n){"use strict";var i=t("./reader/readerFor"),r=t("./utils"),o=t("./compressedObject"),s=t("./crc32"),a=t("./utf8"),c=t("./compressions"),u=t("./support");function l(t,e){this.options=t,this.loadOptions=e}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in c)if(Object.prototype.hasOwnProperty.call(c,e)&&c[e].magic===t)return c[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,n,i,r=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<r;)e=t.readInt(2),n=t.readInt(2),i=t.readData(n),this.extraFields[e]={id:e,length:n,value:i};t.setIndex(r)},handleUTF8:function(){var t=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var n=r.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var i=this.findExtraFieldUnicodeComment();if(null!==i)this.fileCommentStr=i;else{var o=r.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=i(t.value);return 1!==e.readInt(1)||s(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=i(t.value);return 1!==e.readInt(1)||s(this.fileComment)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null}},e.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,n){"use strict";function i(t,e,n){this.name=t,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=e,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var r=t("./stream/StreamHelper"),o=t("./stream/DataWorker"),s=t("./utf8"),a=t("./compressedObject"),c=t("./stream/GenericWorker");i.prototype={internalStream:function(t){var e=null,n="string";try{if(!t)throw new Error("No output type specified.");var i="string"===(n=t.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),e=this._decompressWorker();var o=!this._dataBinary;o&&!i&&(e=e.pipe(new s.Utf8EncodeWorker)),!o&&i&&(e=e.pipe(new s.Utf8DecodeWorker))}catch(t){(e=new c("error")).error(t)}return new r(e,n,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new s.Utf8EncodeWorker)),a.createWorkerFrom(n,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof c?this._data:new o(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<u.length;h++)i.prototype[u[h]]=l;e.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,i){(function(t){"use strict";var n,i,r=t.MutationObserver||t.WebKitMutationObserver;if(r){var o=0,s=new r(l),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),n=function(){a.data=o=++o%2}}else if(t.setImmediate||void 0===t.MessageChannel)n="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var c=new t.MessageChannel;c.port1.onmessage=l,n=function(){c.port2.postMessage(0)}}var u=[];function l(){var t,e;i=!0;for(var n=u.length;n;){for(e=u,u=[],t=-1;++t<n;)e[t]();n=u.length}i=!1}e.exports=function(t){1!==u.push(t)||i||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,n){"use strict";var i=t("immediate");function r(){}var o={},s=["REJECTED"],a=["FULFILLED"],c=["PENDING"];function u(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,t!==r&&p(this,t)}function l(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function h(t,e,n){i((function(){var i;try{i=e(n)}catch(i){return o.reject(t,i)}i===t?o.reject(t,new TypeError("Cannot resolve promise with itself")):o.resolve(t,i)}))}function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var n=!1;function i(e){n||(n=!0,o.reject(t,e))}function r(e){n||(n=!0,o.resolve(t,e))}var s=d((function(){e(r,i)}));"error"===s.status&&i(s.value)}function d(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}(e.exports=u).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){throw n}))}))},u.prototype.catch=function(t){return this.then(null,t)},u.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var n=new this.constructor(r);return this.state!==c?h(n,this.state===a?t:e,this.outcome):this.queue.push(new l(n,t,e)),n},l.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){h(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){o.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){h(this.promise,this.onRejected,t)},o.resolve=function(t,e){var n=d(f,e);if("error"===n.status)return o.reject(t,n.value);var i=n.value;if(i)p(t,i);else{t.state=a,t.outcome=e;for(var r=-1,s=t.queue.length;++r<s;)t.queue[r].callFulfilled(e)}return t},o.reject=function(t,e){t.state=s,t.outcome=e;for(var n=-1,i=t.queue.length;++n<i;)t.queue[n].callRejected(e);return t},u.resolve=function(t){return t instanceof this?t:o.resolve(new this(r),t)},u.reject=function(t){var e=new this(r);return o.reject(e,t)},u.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);for(var s=new Array(n),a=0,c=-1,u=new this(r);++c<n;)l(t[c],c);return u;function l(t,r){e.resolve(t).then((function(t){s[r]=t,++a!==n||i||(i=!0,o.resolve(u,s))}),(function(t){i||(i=!0,o.reject(u,t))}))}},u.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);for(var s,a=-1,c=new this(r);++a<n;)s=t[a],e.resolve(s).then((function(t){i||(i=!0,o.resolve(c,t))}),(function(t){i||(i=!0,o.reject(c,t))}));return c}},{immediate:36}],38:[function(t,e,n){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,n){"use strict";var i=t("./zlib/deflate"),r=t("./utils/common"),o=t("./utils/strings"),s=t("./zlib/messages"),a=t("./zlib/zstream"),c=Object.prototype.toString,u=0,l=-1,h=0,f=8;function p(t){if(!(this instanceof p))return new p(t);this.options=r.assign({level:l,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==u)throw new Error(s[n]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var d;if(d="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(n=i.deflateSetDictionary(this.strm,d))!==u)throw new Error(s[n]);this._dict_set=!0}}function d(t,e){var n=new p(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}p.prototype.push=function(t,e){var n,s,a=this.strm,l=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=o.string2buf(t):"[object ArrayBuffer]"===c.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(l),a.next_out=0,a.avail_out=l),1!==(n=i.deflate(a,s))&&n!==u)return this.onEnd(n),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||0===a.avail_out)&&1!==n);return 4===s?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u):2!==s||(this.onEnd(u),!(a.avail_out=0))},p.prototype.onData=function(t){this.chunks.push(t)},p.prototype.onEnd=function(t){t===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=p,n.deflate=d,n.deflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},n.gzip=function(t,e){return(e=e||{}).gzip=!0,d(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,n){"use strict";var i=t("./zlib/inflate"),r=t("./utils/common"),o=t("./utils/strings"),s=t("./zlib/constants"),a=t("./zlib/messages"),c=t("./zlib/zstream"),u=t("./zlib/gzheader"),l=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,e.windowBits);if(n!==s.Z_OK)throw new Error(a[n]);this.header=new u,i.inflateGetHeader(this.strm,this.header)}function f(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}h.prototype.push=function(t,e){var n,a,c,u,h,f,p=this.strm,d=this.options.chunkSize,v=this.options.dictionary,y=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?p.input=o.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new r.Buf8(d),p.next_out=0,p.avail_out=d),(n=i.inflate(p,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&v&&(f="string"==typeof v?o.string2buf(v):"[object ArrayBuffer]"===l.call(v)?new Uint8Array(v):v,n=i.inflateSetDictionary(this.strm,f)),n===s.Z_BUF_ERROR&&!0===y&&(n=s.Z_OK,y=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),!(this.ended=!0);p.next_out&&(0!==p.avail_out&&n!==s.Z_STREAM_END&&(0!==p.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(c=o.utf8border(p.output,p.next_out),u=p.next_out-c,h=o.buf2string(p.output,c),p.next_out=u,p.avail_out=d-u,u&&r.arraySet(p.output,p.output,c,u,0),this.onData(h)):this.onData(r.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(y=!0)}while((0<p.avail_in||0===p.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),!(p.avail_out=0))},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=h,n.inflate=f,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},n.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,n,i,r){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),r);else for(var o=0;o<i;o++)t[r+o]=e[n+o]},flattenChunks:function(t){var e,n,i,r,o,s;for(e=i=0,n=t.length;e<n;e++)i+=t[e].length;for(s=new Uint8Array(i),e=r=0,n=t.length;e<n;e++)o=t[e],s.set(o,r),r+=o.length;return s}},o={arraySet:function(t,e,n,i,r){for(var o=0;o<i;o++)t[r+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,r)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(i)},{}],42:[function(t,e,n){"use strict";var i=t("./common"),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new i.Buf8(256),a=0;a<256;a++)s[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function c(t,e){if(e<65537&&(t.subarray&&o||!t.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",s=0;s<e;s++)n+=String.fromCharCode(t[s]);return n}s[254]=s[254]=1,n.string2buf=function(t){var e,n,r,o,s,a=t.length,c=0;for(o=0;o<a;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),c+=n<128?1:n<2048?2:n<65536?3:4;for(e=new i.Buf8(c),o=s=0;s<c;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?e[s++]=n:(n<2048?e[s++]=192|n>>>6:(n<65536?e[s++]=224|n>>>12:(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63),e[s++]=128|n>>>6&63),e[s++]=128|63&n);return e},n.buf2binstring=function(t){return c(t,t.length)},n.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,i,r,o,a=e||t.length,u=new Array(2*a);for(n=i=0;n<a;)if((r=t[n++])<128)u[i++]=r;else if(4<(o=s[r]))u[i++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;1<o&&n<a;)r=r<<6|63&t[n++],o--;1<o?u[i++]=65533:r<65536?u[i++]=r:(r-=65536,u[i++]=55296|r>>10&1023,u[i++]=56320|1023&r)}return c(u,i)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return n<0||0===n?e:n+s[t[n]]>e?n:e}},{"./common":41}],43:[function(t,e,n){"use strict";e.exports=function(t,e,n,i){for(var r=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){for(n-=s=2e3<n?2e3:n;o=o+(r=r+e[i++]|0)|0,--s;);r%=65521,o%=65521}return r|o<<16|0}},{}],44:[function(t,e,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,n){"use strict";var i=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,r){var o=i,s=r+n;t^=-1;for(var a=r;a<s;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,n){"use strict";var i,r=t("../utils/common"),o=t("./trees"),s=t("./adler32"),a=t("./crc32"),c=t("./messages"),u=0,l=4,h=0,f=-2,p=-1,d=4,v=2,y=8,m=9,g=286,b=30,w=19,k=2*g+1,A=15,S=3,x=258,C=x+S+1,O=42,P=113,E=1,T=2,j=3,_=4;function B(t,e){return t.msg=c[e],e}function R(t){return(t<<1)-(4<t?9:0)}function I(t){for(var e=t.length;0<=--e;)t[e]=0}function D(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(r.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function N(t,e){o._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,D(t.strm)}function M(t,e){t.pending_buf[t.pending++]=e}function V(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function q(t,e){var n,i,r=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,c=t.strstart>t.w_size-C?t.strstart-(t.w_size-C):0,u=t.window,l=t.w_mask,h=t.prev,f=t.strstart+x,p=u[o+s-1],d=u[o+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(n=e)+s]===d&&u[n+s-1]===p&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<f);if(i=x-(f-o),o=f-x,s<i){if(t.match_start=e,a<=(s=i))break;p=u[o+s-1],d=u[o+s]}}}while((e=h[e&l])>c&&0!=--r);return s<=t.lookahead?s:t.lookahead}function L(t){var e,n,i,o,c,u,l,h,f,p,d=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-C)){for(r.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=n=t.hash_size;i=t.head[--e],t.head[e]=d<=i?i-d:0,--n;);for(e=n=d;i=t.prev[--e],t.prev[e]=d<=i?i-d:0,--n;);o+=d}if(0===t.strm.avail_in)break;if(u=t.strm,l=t.window,h=t.strstart+t.lookahead,p=void 0,(f=o)<(p=u.avail_in)&&(p=f),n=0===p?0:(u.avail_in-=p,r.arraySet(l,u.input,u.next_in,p,h),1===u.state.wrap?u.adler=s(u.adler,l,p,h):2===u.state.wrap&&(u.adler=a(u.adler,l,p,h)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=n,t.lookahead+t.insert>=S)for(c=t.strstart-t.insert,t.ins_h=t.window[c],t.ins_h=(t.ins_h<<t.hash_shift^t.window[c+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[c+S-1])&t.hash_mask,t.prev[c&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=c,c++,t.insert--,!(t.lookahead+t.insert<S)););}while(t.lookahead<C&&0!==t.strm.avail_in)}function F(t,e){for(var n,i;;){if(t.lookahead<C){if(L(t),t.lookahead<C&&e===u)return E;if(0===t.lookahead)break}if(n=0,t.lookahead>=S&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+S-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-C&&(t.match_length=q(t,n)),t.match_length>=S)if(i=o._tr_tally(t,t.strstart-t.match_start,t.match_length-S),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=S){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+S-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(N(t,!1),0===t.strm.avail_out))return E}return t.insert=t.strstart<S-1?t.strstart:S-1,e===l?(N(t,!0),0===t.strm.avail_out?j:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?E:T}function z(t,e){for(var n,i,r;;){if(t.lookahead<C){if(L(t),t.lookahead<C&&e===u)return E;if(0===t.lookahead)break}if(n=0,t.lookahead>=S&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+S-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=S-1,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-C&&(t.match_length=q(t,n),t.match_length<=5&&(1===t.strategy||t.match_length===S&&4096<t.strstart-t.match_start)&&(t.match_length=S-1)),t.prev_length>=S&&t.match_length<=t.prev_length){for(r=t.strstart+t.lookahead-S,i=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-S),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+S-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=S-1,t.strstart++,i&&(N(t,!1),0===t.strm.avail_out))return E}else if(t.match_available){if((i=o._tr_tally(t,0,t.window[t.strstart-1]))&&N(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return E}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<S-1?t.strstart:S-1,e===l?(N(t,!0),0===t.strm.avail_out?j:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?E:T}function U(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}function $(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=y,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(2*k),this.dyn_dtree=new r.Buf16(2*(2*b+1)),this.bl_tree=new r.Buf16(2*(2*w+1)),I(this.dyn_ltree),I(this.dyn_dtree),I(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(A+1),this.heap=new r.Buf16(2*g+1),I(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*g+1),I(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function H(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=v,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?O:P,t.adler=2===e.wrap?0:1,e.last_flush=u,o._tr_init(e),h):B(t,f)}function W(t){var e=H(t);return e===h&&function(t){t.window_size=2*t.w_size,I(t.head),t.max_lazy_match=i[t.level].max_lazy,t.good_match=i[t.level].good_length,t.nice_match=i[t.level].nice_length,t.max_chain_length=i[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=S-1,t.match_available=0,t.ins_h=0}(t.state),e}function G(t,e,n,i,o,s){if(!t)return f;var a=1;if(e===p&&(e=6),i<0?(a=0,i=-i):15<i&&(a=2,i-=16),o<1||m<o||n!==y||i<8||15<i||e<0||9<e||s<0||d<s)return B(t,f);8===i&&(i=9);var c=new $;return(t.state=c).strm=t,c.wrap=a,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=o+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+S-1)/S),c.window=new r.Buf8(2*c.w_size),c.head=new r.Buf16(c.hash_size),c.prev=new r.Buf16(c.w_size),c.lit_bufsize=1<<o+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new r.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=e,c.strategy=s,c.method=n,W(t)}i=[new U(0,0,0,0,(function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(L(t),0===t.lookahead&&e===u)return E;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,N(t,!1),0===t.strm.avail_out))return E;if(t.strstart-t.block_start>=t.w_size-C&&(N(t,!1),0===t.strm.avail_out))return E}return t.insert=0,e===l?(N(t,!0),0===t.strm.avail_out?j:_):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),E)})),new U(4,4,8,4,F),new U(4,5,16,8,F),new U(4,6,32,32,F),new U(4,4,16,16,z),new U(8,16,32,32,z),new U(8,16,128,128,z),new U(8,32,128,256,z),new U(32,128,258,1024,z),new U(32,258,258,4096,z)],n.deflateInit=function(t,e){return G(t,e,y,15,8,0)},n.deflateInit2=G,n.deflateReset=W,n.deflateResetKeep=H,n.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?f:(t.state.gzhead=e,h):f},n.deflate=function(t,e){var n,r,s,c;if(!t||!t.state||5<e||e<0)return t?B(t,f):f;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&e!==l)return B(t,0===t.avail_out?-5:f);if(r.strm=t,n=r.last_flush,r.last_flush=e,r.status===O)if(2===r.wrap)t.adler=0,M(r,31),M(r,139),M(r,8),r.gzhead?(M(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),M(r,255&r.gzhead.time),M(r,r.gzhead.time>>8&255),M(r,r.gzhead.time>>16&255),M(r,r.gzhead.time>>24&255),M(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),M(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(M(r,255&r.gzhead.extra.length),M(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=a(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(M(r,0),M(r,0),M(r,0),M(r,0),M(r,0),M(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),M(r,3),r.status=P);else{var p=y+(r.w_bits-8<<4)<<8;p|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(p|=32),p+=31-p%31,r.status=P,V(r,p),0!==r.strstart&&(V(r,t.adler>>>16),V(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),D(t),s=r.pending,r.pending!==r.pending_buf_size));)M(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),D(t),s=r.pending,r.pending===r.pending_buf_size)){c=1;break}c=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,M(r,c)}while(0!==c);r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===c&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),D(t),s=r.pending,r.pending===r.pending_buf_size)){c=1;break}c=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,M(r,c)}while(0!==c);r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===c&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&D(t),r.pending+2<=r.pending_buf_size&&(M(r,255&t.adler),M(r,t.adler>>8&255),t.adler=0,r.status=P)):r.status=P),0!==r.pending){if(D(t),0===t.avail_out)return r.last_flush=-1,h}else if(0===t.avail_in&&R(e)<=R(n)&&e!==l)return B(t,-5);if(666===r.status&&0!==t.avail_in)return B(t,-5);if(0!==t.avail_in||0!==r.lookahead||e!==u&&666!==r.status){var d=2===r.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(L(t),0===t.lookahead)){if(e===u)return E;break}if(t.match_length=0,n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(N(t,!1),0===t.strm.avail_out))return E}return t.insert=0,e===l?(N(t,!0),0===t.strm.avail_out?j:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?E:T}(r,e):3===r.strategy?function(t,e){for(var n,i,r,s,a=t.window;;){if(t.lookahead<=x){if(L(t),t.lookahead<=x&&e===u)return E;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=S&&0<t.strstart&&(i=a[r=t.strstart-1])===a[++r]&&i===a[++r]&&i===a[++r]){s=t.strstart+x;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<s);t.match_length=x-(s-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=S?(n=o._tr_tally(t,1,t.match_length-S),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(N(t,!1),0===t.strm.avail_out))return E}return t.insert=0,e===l?(N(t,!0),0===t.strm.avail_out?j:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?E:T}(r,e):i[r.level].func(r,e);if(d!==j&&d!==_||(r.status=666),d===E||d===j)return 0===t.avail_out&&(r.last_flush=-1),h;if(d===T&&(1===e?o._tr_align(r):5!==e&&(o._tr_stored_block(r,0,0,!1),3===e&&(I(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),D(t),0===t.avail_out))return r.last_flush=-1,h}return e!==l?h:r.wrap<=0?1:(2===r.wrap?(M(r,255&t.adler),M(r,t.adler>>8&255),M(r,t.adler>>16&255),M(r,t.adler>>24&255),M(r,255&t.total_in),M(r,t.total_in>>8&255),M(r,t.total_in>>16&255),M(r,t.total_in>>24&255)):(V(r,t.adler>>>16),V(r,65535&t.adler)),D(t),0<r.wrap&&(r.wrap=-r.wrap),0!==r.pending?h:1)},n.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==O&&69!==e&&73!==e&&91!==e&&103!==e&&e!==P&&666!==e?B(t,f):(t.state=null,e===P?B(t,-3):h):f},n.deflateSetDictionary=function(t,e){var n,i,o,a,c,u,l,p,d=e.length;if(!t||!t.state)return f;if(2===(a=(n=t.state).wrap)||1===a&&n.status!==O||n.lookahead)return f;for(1===a&&(t.adler=s(t.adler,e,d,0)),n.wrap=0,d>=n.w_size&&(0===a&&(I(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new r.Buf8(n.w_size),r.arraySet(p,e,d-n.w_size,n.w_size,0),e=p,d=n.w_size),c=t.avail_in,u=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,L(n);n.lookahead>=S;){for(i=n.strstart,o=n.lookahead-(S-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+S-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++,--o;);n.strstart=i,n.lookahead=S-1,L(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=S-1,n.match_available=0,t.next_in=u,t.input=l,t.avail_in=c,n.wrap=a,h},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,n){"use strict";e.exports=function(t,e){var n,i,r,o,s,a,c,u,l,h,f,p,d,v,y,m,g,b,w,k,A,S,x,C,O;n=t.state,i=t.next_in,C=t.input,r=i+(t.avail_in-5),o=t.next_out,O=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),c=n.dmax,u=n.wsize,l=n.whave,h=n.wnext,f=n.window,p=n.hold,d=n.bits,v=n.lencode,y=n.distcode,m=(1<<n.lenbits)-1,g=(1<<n.distbits)-1;t:do{d<15&&(p+=C[i++]<<d,d+=8,p+=C[i++]<<d,d+=8),b=v[p&m];e:for(;;){if(p>>>=w=b>>>24,d-=w,0==(w=b>>>16&255))O[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=v[(65535&b)+(p&(1<<w)-1)];continue e}if(32&w){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}k=65535&b,(w&=15)&&(d<w&&(p+=C[i++]<<d,d+=8),k+=p&(1<<w)-1,p>>>=w,d-=w),d<15&&(p+=C[i++]<<d,d+=8,p+=C[i++]<<d,d+=8),b=y[p&g];n:for(;;){if(p>>>=w=b>>>24,d-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=y[(65535&b)+(p&(1<<w)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(A=65535&b,d<(w&=15)&&(p+=C[i++]<<d,(d+=8)<w&&(p+=C[i++]<<d,d+=8)),c<(A+=p&(1<<w)-1)){t.msg="invalid distance too far back",n.mode=30;break t}if(p>>>=w,d-=w,(w=o-s)<A){if(l<(w=A-w)&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(x=f,(S=0)===h){if(S+=u-w,w<k){for(k-=w;O[o++]=f[S++],--w;);S=o-A,x=O}}else if(h<w){if(S+=u+h-w,(w-=h)<k){for(k-=w;O[o++]=f[S++],--w;);if(S=0,h<k){for(k-=w=h;O[o++]=f[S++],--w;);S=o-A,x=O}}}else if(S+=h-w,w<k){for(k-=w;O[o++]=f[S++],--w;);S=o-A,x=O}for(;2<k;)O[o++]=x[S++],O[o++]=x[S++],O[o++]=x[S++],k-=3;k&&(O[o++]=x[S++],1<k&&(O[o++]=x[S++]))}else{for(S=o-A;O[o++]=O[S++],O[o++]=O[S++],O[o++]=O[S++],2<(k-=3););k&&(O[o++]=O[S++],1<k&&(O[o++]=O[S++]))}break}}break}}while(i<r&&o<a);i-=k=d>>3,p&=(1<<(d-=k<<3))-1,t.next_in=i,t.next_out=o,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=o<a?a-o+257:257-(o-a),n.hold=p,n.bits=d}},{}],49:[function(t,e,n){"use strict";var i=t("../utils/common"),r=t("./adler32"),o=t("./crc32"),s=t("./inffast"),a=t("./inftrees"),c=1,u=2,l=0,h=-2,f=1,p=852,d=592;function v(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=f,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(p),e.distcode=e.distdyn=new i.Buf32(d),e.sane=1,e.back=-1,l):h}function g(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,m(t)):h}function b(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?h:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,g(t))):h}function w(t,e){var n,i;return t?(i=new y,(t.state=i).window=null,(n=b(t,e))!==l&&(t.state=null),n):h}var k,A,S=!0;function x(t){if(S){var e;for(k=new i.Buf32(512),A=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(c,t.lens,0,288,k,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(u,t.lens,0,32,A,0,t.work,{bits:5}),S=!1}t.lencode=k,t.lenbits=9,t.distcode=A,t.distbits=5}function C(t,e,n,r){var o,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new i.Buf8(s.wsize)),r>=s.wsize?(i.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(r<(o=s.wsize-s.wnext)&&(o=r),i.arraySet(s.window,e,n-r,o,s.wnext),(r-=o)?(i.arraySet(s.window,e,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}n.inflateReset=g,n.inflateReset2=b,n.inflateResetKeep=m,n.inflateInit=function(t){return w(t,15)},n.inflateInit2=w,n.inflate=function(t,e){var n,p,d,y,m,g,b,w,k,A,S,O,P,E,T,j,_,B,R,I,D,N,M,V,q=0,L=new i.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return h;12===(n=t.state).mode&&(n.mode=13),m=t.next_out,d=t.output,b=t.avail_out,y=t.next_in,p=t.input,g=t.avail_in,w=n.hold,k=n.bits,A=g,S=b,N=l;t:for(;;)switch(n.mode){case f:if(0===n.wrap){n.mode=13;break}for(;k<16;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if(2&n.wrap&&35615===w){L[n.check=0]=255&w,L[1]=w>>>8&255,n.check=o(n.check,L,2,0),k=w=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&w)<<8)+(w>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&w)){t.msg="unknown compression method",n.mode=30;break}if(k-=4,D=8+(15&(w>>>=4)),0===n.wbits)n.wbits=D;else if(D>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<D,t.adler=n.check=1,n.mode=512&w?10:12,k=w=0;break;case 2:for(;k<16;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if(n.flags=w,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=w>>8&1),512&n.flags&&(L[0]=255&w,L[1]=w>>>8&255,n.check=o(n.check,L,2,0)),k=w=0,n.mode=3;case 3:for(;k<32;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}n.head&&(n.head.time=w),512&n.flags&&(L[0]=255&w,L[1]=w>>>8&255,L[2]=w>>>16&255,L[3]=w>>>24&255,n.check=o(n.check,L,4,0)),k=w=0,n.mode=4;case 4:for(;k<16;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}n.head&&(n.head.xflags=255&w,n.head.os=w>>8),512&n.flags&&(L[0]=255&w,L[1]=w>>>8&255,n.check=o(n.check,L,2,0)),k=w=0,n.mode=5;case 5:if(1024&n.flags){for(;k<16;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}n.length=w,n.head&&(n.head.extra_len=w),512&n.flags&&(L[0]=255&w,L[1]=w>>>8&255,n.check=o(n.check,L,2,0)),k=w=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(g<(O=n.length)&&(O=g),O&&(n.head&&(D=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,p,y,O,D)),512&n.flags&&(n.check=o(n.check,p,O,y)),g-=O,y+=O,n.length-=O),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===g)break t;for(O=0;D=p[y+O++],n.head&&D&&n.length<65536&&(n.head.name+=String.fromCharCode(D)),D&&O<g;);if(512&n.flags&&(n.check=o(n.check,p,O,y)),g-=O,y+=O,D)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===g)break t;for(O=0;D=p[y+O++],n.head&&D&&n.length<65536&&(n.head.comment+=String.fromCharCode(D)),D&&O<g;);if(512&n.flags&&(n.check=o(n.check,p,O,y)),g-=O,y+=O,D)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;k<16;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if(w!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}k=w=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;k<32;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}t.adler=n.check=v(w),k=w=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=m,t.avail_out=b,t.next_in=y,t.avail_in=g,n.hold=w,n.bits=k,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){w>>>=7&k,k-=7&k,n.mode=27;break}for(;k<3;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}switch(n.last=1&w,k-=1,3&(w>>>=1)){case 0:n.mode=14;break;case 1:if(x(n),n.mode=20,6!==e)break;w>>>=2,k-=2;break t;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}w>>>=2,k-=2;break;case 14:for(w>>>=7&k,k-=7&k;k<32;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if((65535&w)!=(w>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&w,k=w=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(O=n.length){if(g<O&&(O=g),b<O&&(O=b),0===O)break t;i.arraySet(d,p,y,O,m),g-=O,y+=O,b-=O,m+=O,n.length-=O;break}n.mode=12;break;case 17:for(;k<14;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if(n.nlen=257+(31&w),w>>>=5,k-=5,n.ndist=1+(31&w),w>>>=5,k-=5,n.ncode=4+(15&w),w>>>=4,k-=4,286<n.nlen||30<n.ndist){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;k<3;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}n.lens[F[n.have++]]=7&w,w>>>=3,k-=3}for(;n.have<19;)n.lens[F[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,M={bits:n.lenbits},N=a(0,n.lens,0,19,n.lencode,0,n.work,M),n.lenbits=M.bits,N){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;j=(q=n.lencode[w&(1<<n.lenbits)-1])>>>16&255,_=65535&q,!((T=q>>>24)<=k);){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if(_<16)w>>>=T,k-=T,n.lens[n.have++]=_;else{if(16===_){for(V=T+2;k<V;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if(w>>>=T,k-=T,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}D=n.lens[n.have-1],O=3+(3&w),w>>>=2,k-=2}else if(17===_){for(V=T+3;k<V;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}k-=T,D=0,O=3+(7&(w>>>=T)),w>>>=3,k-=3}else{for(V=T+7;k<V;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}k-=T,D=0,O=11+(127&(w>>>=T)),w>>>=7,k-=7}if(n.have+O>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;O--;)n.lens[n.have++]=D}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,M={bits:n.lenbits},N=a(c,n.lens,0,n.nlen,n.lencode,0,n.work,M),n.lenbits=M.bits,N){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,M={bits:n.distbits},N=a(u,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,M),n.distbits=M.bits,N){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(6<=g&&258<=b){t.next_out=m,t.avail_out=b,t.next_in=y,t.avail_in=g,n.hold=w,n.bits=k,s(t,S),m=t.next_out,d=t.output,b=t.avail_out,y=t.next_in,p=t.input,g=t.avail_in,w=n.hold,k=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;j=(q=n.lencode[w&(1<<n.lenbits)-1])>>>16&255,_=65535&q,!((T=q>>>24)<=k);){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if(j&&0==(240&j)){for(B=T,R=j,I=_;j=(q=n.lencode[I+((w&(1<<B+R)-1)>>B)])>>>16&255,_=65535&q,!(B+(T=q>>>24)<=k);){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}w>>>=B,k-=B,n.back+=B}if(w>>>=T,k-=T,n.back+=T,n.length=_,0===j){n.mode=26;break}if(32&j){n.back=-1,n.mode=12;break}if(64&j){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&j,n.mode=22;case 22:if(n.extra){for(V=n.extra;k<V;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}n.length+=w&(1<<n.extra)-1,w>>>=n.extra,k-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;j=(q=n.distcode[w&(1<<n.distbits)-1])>>>16&255,_=65535&q,!((T=q>>>24)<=k);){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if(0==(240&j)){for(B=T,R=j,I=_;j=(q=n.distcode[I+((w&(1<<B+R)-1)>>B)])>>>16&255,_=65535&q,!(B+(T=q>>>24)<=k);){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}w>>>=B,k-=B,n.back+=B}if(w>>>=T,k-=T,n.back+=T,64&j){t.msg="invalid distance code",n.mode=30;break}n.offset=_,n.extra=15&j,n.mode=24;case 24:if(n.extra){for(V=n.extra;k<V;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}n.offset+=w&(1<<n.extra)-1,w>>>=n.extra,k-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===b)break t;if(O=S-b,n.offset>O){if((O=n.offset-O)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}P=O>n.wnext?(O-=n.wnext,n.wsize-O):n.wnext-O,O>n.length&&(O=n.length),E=n.window}else E=d,P=m-n.offset,O=n.length;for(b<O&&(O=b),b-=O,n.length-=O;d[m++]=E[P++],--O;);0===n.length&&(n.mode=21);break;case 26:if(0===b)break t;d[m++]=n.length,b--,n.mode=21;break;case 27:if(n.wrap){for(;k<32;){if(0===g)break t;g--,w|=p[y++]<<k,k+=8}if(S-=b,t.total_out+=S,n.total+=S,S&&(t.adler=n.check=n.flags?o(n.check,d,S,m-S):r(n.check,d,S,m-S)),S=b,(n.flags?w:v(w))!==n.check){t.msg="incorrect data check",n.mode=30;break}k=w=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;k<32;){if(0===g)break t;g--,w+=p[y++]<<k,k+=8}if(w!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}k=w=0}n.mode=29;case 29:N=1;break t;case 30:N=-3;break t;case 31:return-4;default:return h}return t.next_out=m,t.avail_out=b,t.next_in=y,t.avail_in=g,n.hold=w,n.bits=k,(n.wsize||S!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&C(t,t.output,t.next_out,S-t.avail_out)?(n.mode=31,-4):(A-=t.avail_in,S-=t.avail_out,t.total_in+=A,t.total_out+=S,n.total+=S,n.wrap&&S&&(t.adler=n.check=n.flags?o(n.check,d,S,t.next_out-S):r(n.check,d,S,t.next_out-S)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==A&&0===S||4===e)&&N===l&&(N=-5),N)},n.inflateEnd=function(t){if(!t||!t.state)return h;var e=t.state;return e.window&&(e.window=null),t.state=null,l},n.inflateGetHeader=function(t,e){var n;return t&&t.state?0==(2&(n=t.state).wrap)?h:((n.head=e).done=!1,l):h},n.inflateSetDictionary=function(t,e){var n,i=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?h:11===n.mode&&r(1,e,i,0)!==n.check?-3:C(t,e,i,i)?(n.mode=31,-4):(n.havedict=1,l):h},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,n){"use strict";var i=t("../utils/common"),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,n,c,u,l,h,f){var p,d,v,y,m,g,b,w,k,A=f.bits,S=0,x=0,C=0,O=0,P=0,E=0,T=0,j=0,_=0,B=0,R=null,I=0,D=new i.Buf16(16),N=new i.Buf16(16),M=null,V=0;for(S=0;S<=15;S++)D[S]=0;for(x=0;x<c;x++)D[e[n+x]]++;for(P=A,O=15;1<=O&&0===D[O];O--);if(O<P&&(P=O),0===O)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(C=1;C<O&&0===D[C];C++);for(P<C&&(P=C),S=j=1;S<=15;S++)if(j<<=1,(j-=D[S])<0)return-1;if(0<j&&(0===t||1!==O))return-1;for(N[1]=0,S=1;S<15;S++)N[S+1]=N[S]+D[S];for(x=0;x<c;x++)0!==e[n+x]&&(h[N[e[n+x]]++]=x);if(g=0===t?(R=M=h,19):1===t?(R=r,I-=257,M=o,V-=257,256):(R=s,M=a,-1),S=C,m=l,T=x=B=0,v=-1,y=(_=1<<(E=P))-1,1===t&&852<_||2===t&&592<_)return 1;for(;;){for(b=S-T,k=h[x]<g?(w=0,h[x]):h[x]>g?(w=M[V+h[x]],R[I+h[x]]):(w=96,0),p=1<<S-T,C=d=1<<E;u[m+(B>>T)+(d-=p)]=b<<24|w<<16|k|0,0!==d;);for(p=1<<S-1;B&p;)p>>=1;if(0!==p?(B&=p-1,B+=p):B=0,x++,0==--D[S]){if(S===O)break;S=e[n+h[x]]}if(P<S&&(B&y)!==v){for(0===T&&(T=P),m+=C,j=1<<(E=S-T);E+T<O&&!((j-=D[E+T])<=0);)E++,j<<=1;if(_+=1<<E,1===t&&852<_||2===t&&592<_)return 1;u[v=B&y]=P<<24|E<<16|m-l|0}}return 0!==B&&(u[m+B]=S-T<<24|64<<16|0),f.bits=P,0}},{"../utils/common":41}],51:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,n){"use strict";var i=t("../utils/common"),r=0,o=1;function s(t){for(var e=t.length;0<=--e;)t[e]=0}var a=0,c=29,u=256,l=u+1+c,h=30,f=19,p=2*l+1,d=15,v=16,y=7,m=256,g=16,b=17,w=18,k=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],x=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=new Array(2*(l+2));s(C);var O=new Array(2*h);s(O);var P=new Array(512);s(P);var E=new Array(256);s(E);var T=new Array(c);s(T);var j,_,B,R=new Array(h);function I(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function D(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function N(t){return t<256?P[t]:P[256+(t>>>7)]}function M(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function V(t,e,n){t.bi_valid>v-n?(t.bi_buf|=e<<t.bi_valid&65535,M(t,t.bi_buf),t.bi_buf=e>>v-t.bi_valid,t.bi_valid+=n-v):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function q(t,e,n){V(t,n[2*e],n[2*e+1])}function L(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}function F(t,e,n){var i,r,o=new Array(d+1),s=0;for(i=1;i<=d;i++)o[i]=s=s+n[i-1]<<1;for(r=0;r<=e;r++){var a=t[2*r+1];0!==a&&(t[2*r]=L(o[a]++,a))}}function z(t){var e;for(e=0;e<l;e++)t.dyn_ltree[2*e]=0;for(e=0;e<h;e++)t.dyn_dtree[2*e]=0;for(e=0;e<f;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*m]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function U(t){8<t.bi_valid?M(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function $(t,e,n,i){var r=2*e,o=2*n;return t[r]<t[o]||t[r]===t[o]&&i[e]<=i[n]}function H(t,e,n){for(var i=t.heap[n],r=n<<1;r<=t.heap_len&&(r<t.heap_len&&$(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!$(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i}function W(t,e,n){var i,r,o,s,a=0;if(0!==t.last_lit)for(;i=t.pending_buf[t.d_buf+2*a]<<8|t.pending_buf[t.d_buf+2*a+1],r=t.pending_buf[t.l_buf+a],a++,0===i?q(t,r,e):(q(t,(o=E[r])+u+1,e),0!==(s=k[o])&&V(t,r-=T[o],s),q(t,o=N(--i),n),0!==(s=A[o])&&V(t,i-=R[o],s)),a<t.last_lit;);q(t,m,e)}function G(t,e){var n,i,r,o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.has_stree,c=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=p,n=0;n<c;n++)0!==o[2*n]?(t.heap[++t.heap_len]=u=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(r=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[r]=0,t.opt_len--,a&&(t.static_len-=s[2*r+1]);for(e.max_code=u,n=t.heap_len>>1;1<=n;n--)H(t,o,n);for(r=c;n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],H(t,o,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,o[2*r]=o[2*n]+o[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,o[2*n+1]=o[2*i+1]=r,t.heap[1]=r++,H(t,o,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,o,s,a,c=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,h=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,v=e.stat_desc.extra_base,y=e.stat_desc.max_length,m=0;for(o=0;o<=d;o++)t.bl_count[o]=0;for(c[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<p;n++)y<(o=c[2*c[2*(i=t.heap[n])+1]+1]+1)&&(o=y,m++),c[2*i+1]=o,u<i||(t.bl_count[o]++,s=0,v<=i&&(s=f[i-v]),a=c[2*i],t.opt_len+=a*(o+s),h&&(t.static_len+=a*(l[2*i+1]+s)));if(0!==m){do{for(o=y-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[y]--,m-=2}while(0<m);for(o=y;0!==o;o--)for(i=t.bl_count[o];0!==i;)u<(r=t.heap[--n])||(c[2*r+1]!==o&&(t.opt_len+=(o-c[2*r+1])*c[2*r],c[2*r+1]=o),i--)}}(t,e),F(o,u,t.bl_count)}function J(t,e,n){var i,r,o=-1,s=e[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=e[2*(i+1)+1],++a<c&&r===s||(a<u?t.bl_tree[2*r]+=a:0!==r?(r!==o&&t.bl_tree[2*r]++,t.bl_tree[2*g]++):a<=10?t.bl_tree[2*b]++:t.bl_tree[2*w]++,o=r,u=(a=0)===s?(c=138,3):r===s?(c=6,3):(c=7,4))}function K(t,e,n){var i,r,o=-1,s=e[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),i=0;i<=n;i++)if(r=s,s=e[2*(i+1)+1],!(++a<c&&r===s)){if(a<u)for(;q(t,r,t.bl_tree),0!=--a;);else 0!==r?(r!==o&&(q(t,r,t.bl_tree),a--),q(t,g,t.bl_tree),V(t,a-3,2)):a<=10?(q(t,b,t.bl_tree),V(t,a-3,3)):(q(t,w,t.bl_tree),V(t,a-11,7));o=r,u=(a=0)===s?(c=138,3):r===s?(c=6,3):(c=7,4)}}s(R);var Z=!1;function Y(t,e,n,r){V(t,(a<<1)+(r?1:0),3),function(t,e,n,r){U(t),r&&(M(t,n),M(t,~n)),i.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n,!0)}n._tr_init=function(t){Z||(function(){var t,e,n,i,r,o=new Array(d+1);for(i=n=0;i<c-1;i++)for(T[i]=n,t=0;t<1<<k[i];t++)E[n++]=i;for(E[n-1]=i,i=r=0;i<16;i++)for(R[i]=r,t=0;t<1<<A[i];t++)P[r++]=i;for(r>>=7;i<h;i++)for(R[i]=r<<7,t=0;t<1<<A[i]-7;t++)P[256+r++]=i;for(e=0;e<=d;e++)o[e]=0;for(t=0;t<=143;)C[2*t+1]=8,t++,o[8]++;for(;t<=255;)C[2*t+1]=9,t++,o[9]++;for(;t<=279;)C[2*t+1]=7,t++,o[7]++;for(;t<=287;)C[2*t+1]=8,t++,o[8]++;for(F(C,l+1,o),t=0;t<h;t++)O[2*t+1]=5,O[2*t]=L(t,5);j=new I(C,k,u+1,l,d),_=new I(O,A,0,h,d),B=new I(new Array(0),S,0,f,y)}(),Z=!0),t.l_desc=new D(t.dyn_ltree,j),t.d_desc=new D(t.dyn_dtree,_),t.bl_desc=new D(t.bl_tree,B),t.bi_buf=0,t.bi_valid=0,z(t)},n._tr_stored_block=Y,n._tr_flush_block=function(t,e,n,i){var s,a,c=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return r;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return o;for(e=32;e<u;e++)if(0!==t.dyn_ltree[2*e])return o;return r}(t)),G(t,t.l_desc),G(t,t.d_desc),c=function(t){var e;for(J(t,t.dyn_ltree,t.l_desc.max_code),J(t,t.dyn_dtree,t.d_desc.max_code),G(t,t.bl_desc),e=f-1;3<=e&&0===t.bl_tree[2*x[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),s=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=s&&(s=a)):s=a=n+5,n+4<=s&&-1!==e?Y(t,e,n,i):4===t.strategy||a===s?(V(t,2+(i?1:0),3),W(t,C,O)):(V(t,4+(i?1:0),3),function(t,e,n,i){var r;for(V(t,e-257,5),V(t,n-1,5),V(t,i-4,4),r=0;r<i;r++)V(t,t.bl_tree[2*x[r]+1],3);K(t,t.dyn_ltree,e-1),K(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,c+1),W(t,t.dyn_ltree,t.dyn_dtree)),z(t),i&&U(t)},n._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(E[n]+u+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},n._tr_align=function(t){V(t,2,3),q(t,m,C),function(t){16===t.bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var n,i,r,o,s=1,a={},c=!1,u=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,n="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){f(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(o="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(o+e,"*")}):t.MessageChannel?((r=new MessageChannel).port1.onmessage=function(t){f(t.data)},function(t){r.port2.postMessage(t)}):u&&"onreadystatechange"in u.createElement("script")?(i=u.documentElement,function(t){var e=u.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):function(t){setTimeout(f,0,t)},l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i<e.length;i++)e[i]=arguments[i+1];var r={callback:t,args:e};return a[s]=r,n(s),s++},l.clearImmediate=h}function h(t){delete a[t]}function f(t){if(c)setTimeout(f,0,t);else{var n=a[t];if(n){c=!0;try{!function(t){var n=t.callback,i=t.args;switch(i.length){case 0:n();break;case 1:n(i[0]);break;case 2:n(i[0],i[1]);break;case 3:n(i[0],i[1],i[2]);break;default:n.apply(e,i)}}(n)}finally{h(t),c=!1}}}}function p(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&f(+e.data.slice(o.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},933:function(t,e,n){var i;!function(){function r(t,e,n){return t.call.apply(t.bind,arguments)}function o(t,e,n){if(!t)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,i),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function s(t,e,n){return(s=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?r:o).apply(null,arguments)}var a=Date.now||function(){return+new Date};function c(t,e){this.a=t,this.o=e||t,this.c=this.o.document}var u=!!window.FontFace;function l(t,e,n,i){if(e=t.c.createElement(e),n)for(var r in n)n.hasOwnProperty(r)&&("style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i&&e.appendChild(t.c.createTextNode(i)),e}function h(t,e,n){(t=t.c.getElementsByTagName(e)[0])||(t=document.documentElement),t.insertBefore(n,t.lastChild)}function f(t){t.parentNode&&t.parentNode.removeChild(t)}function p(t,e,n){e=e||[],n=n||[];for(var i=t.className.split(/\s+/),r=0;r<e.length;r+=1){for(var o=!1,s=0;s<i.length;s+=1)if(e[r]===i[s]){o=!0;break}o||i.push(e[r])}for(e=[],r=0;r<i.length;r+=1){for(o=!1,s=0;s<n.length;s+=1)if(i[r]===n[s]){o=!0;break}o||e.push(i[r])}t.className=e.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function d(t,e){for(var n=t.className.split(/\s+/),i=0,r=n.length;i<r;i++)if(n[i]==e)return!0;return!1}function v(t,e,n){function i(){a&&r&&o&&(a(s),a=null)}e=l(t,"link",{rel:"stylesheet",href:e,media:"all"});var r=!1,o=!0,s=null,a=n||null;u?(e.onload=function(){r=!0,i()},e.onerror=function(){r=!0,s=Error("Stylesheet failed to load"),i()}):setTimeout((function(){r=!0,i()}),0),h(t,"head",e)}function y(t,e,n,i){var r=t.c.getElementsByTagName("head")[0];if(r){var o=l(t,"script",{src:e}),s=!1;return o.onload=o.onreadystatechange=function(){s||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(s=!0,n&&n(null),o.onload=o.onreadystatechange=null,"HEAD"==o.parentNode.tagName&&r.removeChild(o))},r.appendChild(o),setTimeout((function(){s||(s=!0,n&&n(Error("Script load timeout")))}),i||5e3),o}return null}function m(){this.a=0,this.c=null}function g(t){return t.a++,function(){t.a--,w(t)}}function b(t,e){t.c=e,w(t)}function w(t){0==t.a&&t.c&&(t.c(),t.c=null)}function k(t){this.a=t||"-"}function A(t,e){this.c=t,this.f=4,this.a="n";var n=(e||"n4").match(/^([nio])([1-9])$/i);n&&(this.a=n[1],this.f=parseInt(n[2],10))}function S(t){var e=[];t=t.split(/,\s*/);for(var n=0;n<t.length;n++){var i=t[n].replace(/['"]/g,"");-1!=i.indexOf(" ")||/^\d/.test(i)?e.push("'"+i+"'"):e.push(i)}return e.join(",")}function x(t){return t.a+t.f}function C(t){var e="normal";return"o"===t.a?e="oblique":"i"===t.a&&(e="italic"),e}function O(t){var e=4,n="n",i=null;return t&&((i=t.match(/(normal|oblique|italic)/i))&&i[1]&&(n=i[1].substr(0,1).toLowerCase()),(i=t.match(/([1-9]00|normal|bold)/i))&&i[1]&&(/bold/i.test(i[1])?e=7:/[1-9]00/.test(i[1])&&(e=parseInt(i[1].substr(0,1),10)))),n+e}function P(t,e){this.c=t,this.f=t.o.document.documentElement,this.h=e,this.a=new k("-"),this.j=!1!==e.events,this.g=!1!==e.classes}function E(t){if(t.g){var e=d(t.f,t.a.c("wf","active")),n=[],i=[t.a.c("wf","loading")];e||n.push(t.a.c("wf","inactive")),p(t.f,n,i)}T(t,"inactive")}function T(t,e,n){t.j&&t.h[e]&&(n?t.h[e](n.c,x(n)):t.h[e]())}function j(){this.c={}}function _(t,e){this.c=t,this.f=e,this.a=l(this.c,"span",{"aria-hidden":"true"},this.f)}function B(t){h(t.c,"body",t.a)}function R(t){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+S(t.c)+";font-style:"+C(t)+";font-weight:"+t.f+"00;"}function I(t,e,n,i,r,o){this.g=t,this.j=e,this.a=i,this.c=n,this.f=r||3e3,this.h=o||void 0}function D(t,e,n,i,r,o,s){this.v=t,this.B=e,this.c=n,this.a=i,this.s=s||"BESbswy",this.f={},this.w=r||3e3,this.u=o||null,this.m=this.j=this.h=this.g=null,this.g=new _(this.c,this.s),this.h=new _(this.c,this.s),this.j=new _(this.c,this.s),this.m=new _(this.c,this.s),t=R(t=new A(this.a.c+",serif",x(this.a))),this.g.a.style.cssText=t,t=R(t=new A(this.a.c+",sans-serif",x(this.a))),this.h.a.style.cssText=t,t=R(t=new A("serif",x(this.a))),this.j.a.style.cssText=t,t=R(t=new A("sans-serif",x(this.a))),this.m.a.style.cssText=t,B(this.g),B(this.h),B(this.j),B(this.m)}k.prototype.c=function(t){for(var e=[],n=0;n<arguments.length;n++)e.push(arguments[n].replace(/[\W_]+/g,"").toLowerCase());return e.join(this.a)},I.prototype.start=function(){var t=this.c.o.document,e=this,n=a(),i=new Promise((function(i,r){!function o(){a()-n>=e.f?r():t.fonts.load(function(t){return C(t)+" "+t.f+"00 300px "+S(t.c)}(e.a),e.h).then((function(t){1<=t.length?i():setTimeout(o,25)}),(function(){r()}))}()})),r=null,o=new Promise((function(t,n){r=setTimeout(n,e.f)}));Promise.race([o,i]).then((function(){r&&(clearTimeout(r),r=null),e.g(e.a)}),(function(){e.j(e.a)}))};var N={D:"serif",C:"sans-serif"},M=null;function V(){if(null===M){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);M=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return M}function q(t,e,n){for(var i in N)if(N.hasOwnProperty(i)&&e===t.f[N[i]]&&n===t.f[N[i]])return!0;return!1}function L(t){var e,n=t.g.a.offsetWidth,i=t.h.a.offsetWidth;(e=n===t.f.serif&&i===t.f["sans-serif"])||(e=V()&&q(t,n,i)),e?a()-t.A>=t.w?V()&&q(t,n,i)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?F(t,t.v):F(t,t.B):function(t){setTimeout(s((function(){L(this)}),t),50)}(t):F(t,t.v)}function F(t,e){setTimeout(s((function(){f(this.g.a),f(this.h.a),f(this.j.a),f(this.m.a),e(this.a)}),t),0)}function z(t,e,n){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=n}D.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=a(),L(this)};var U=null;function $(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&p(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),T(t,"active")):E(t.a))}function H(t){this.j=t,this.a=new j,this.h=0,this.f=this.g=!0}function W(t,e,n,i,r){var o=0==--t.h;(t.f||t.g)&&setTimeout((function(){var t=r||null,a=i||{};if(0===n.length&&o)E(e.a);else{e.f+=n.length,o&&(e.j=o);var c,u=[];for(c=0;c<n.length;c++){var l=n[c],h=a[l.c],f=e.a,d=l;if(f.g&&p(f.f,[f.a.c("wf",d.c,x(d).toString(),"loading")]),T(f,"fontloading",d),f=null,null===U)if(window.FontFace){d=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var v=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);U=d?42<parseInt(d[1],10):!v}else U=!1;f=U?new I(s(e.g,e),s(e.h,e),e.c,l,e.s,h):new D(s(e.g,e),s(e.h,e),e.c,l,e.s,t,h),u.push(f)}for(c=0;c<u.length;c++)u[c].start()}}),0)}function G(t,e){this.c=t,this.a=e}function J(t,e){this.c=t,this.a=e}function K(t,e){this.c=t||Z,this.a=[],this.f=[],this.g=e||""}z.prototype.g=function(t){var e=this.a;e.g&&p(e.f,[e.a.c("wf",t.c,x(t).toString(),"active")],[e.a.c("wf",t.c,x(t).toString(),"loading"),e.a.c("wf",t.c,x(t).toString(),"inactive")]),T(e,"fontactive",t),this.m=!0,$(this)},z.prototype.h=function(t){var e=this.a;if(e.g){var n=d(e.f,e.a.c("wf",t.c,x(t).toString(),"active")),i=[],r=[e.a.c("wf",t.c,x(t).toString(),"loading")];n||i.push(e.a.c("wf",t.c,x(t).toString(),"inactive")),p(e.f,i,r)}T(e,"fontinactive",t),$(this)},H.prototype.load=function(t){this.c=new c(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes,function(t,e,n){var i=[],r=n.timeout;!function(t){t.g&&p(t.f,[t.a.c("wf","loading")]),T(t,"loading")}(e);i=function(t,e,n){var i,r=[];for(i in e)if(e.hasOwnProperty(i)){var o=t.c[i];o&&r.push(o(e[i],n))}return r}(t.a,n,t.c);var o=new z(t.c,e,r);for(t.h=i.length,e=0,n=i.length;e<n;e++)i[e].load((function(e,n,i){W(t,o,e,n,i)}))}(this,new P(this.c,t),t)},G.prototype.load=function(t){function e(){if(o["__mti_fntLst"+i]){var n,r=o["__mti_fntLst"+i](),s=[];if(r)for(var a=0;a<r.length;a++){var c=r[a].fontfamily;null!=r[a].fontStyle&&null!=r[a].fontWeight?(n=r[a].fontStyle+r[a].fontWeight,s.push(new A(c,n))):s.push(new A(c))}t(s)}else setTimeout((function(){e()}),50)}var n=this,i=n.a.projectId,r=n.a.version;if(i){var o=n.c.o;y(this.c,(n.a.api||"https://fast.fonts.net/jsapi")+"/"+i+".js"+(r?"?v="+r:""),(function(r){r?t([]):(o["__MonotypeConfiguration__"+i]=function(){return n.a},e())})).id="__MonotypeAPIScript__"+i}else t([])},J.prototype.load=function(t){var e,n,i=this.a.urls||[],r=this.a.families||[],o=this.a.testStrings||{},s=new m;for(e=0,n=i.length;e<n;e++)v(this.c,i[e],g(s));var a=[];for(e=0,n=r.length;e<n;e++)if((i=r[e].split(":"))[1])for(var c=i[1].split(","),u=0;u<c.length;u+=1)a.push(new A(i[0],c[u]));else a.push(new A(i[0]));b(s,(function(){t(a,o)}))};var Z="https://fonts.googleapis.com/css";function Y(t){this.f=t,this.a=[],this.c={}}var Q={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},X={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},tt={i:"i",italic:"i",n:"n",normal:"n"},et=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function nt(t,e){this.c=t,this.a=e}var it={Arimo:!0,Cousine:!0,Tinos:!0};function rt(t,e){this.c=t,this.a=e}function ot(t,e){this.c=t,this.f=e,this.a=[]}nt.prototype.load=function(t){var e=new m,n=this.c,i=new K(this.a.api,this.a.text),r=this.a.families;!function(t,e){for(var n=e.length,i=0;i<n;i++){var r=e[i].split(":");3==r.length&&t.f.push(r.pop());var o="";2==r.length&&""!=r[1]&&(o=":"),t.a.push(r.join(o))}}(i,r);var o=new Y(r);!function(t){for(var e=t.f.length,n=0;n<e;n++){var i=t.f[n].split(":"),r=i[0].replace(/\+/g," "),o=["n4"];if(2<=i.length){var s;if(s=[],a=i[1])for(var a,c=(a=a.split(",")).length,u=0;u<c;u++){var l;if((l=a[u]).match(/^[\w-]+$/))if(null==(h=et.exec(l.toLowerCase())))l="";else{if(l=null==(l=h[2])||""==l?"n":tt[l],null==(h=h[1])||""==h)h="4";else var h=X[h]||(isNaN(h)?"4":h.substr(0,1));l=[l,h].join("")}else l="";l&&s.push(l)}0<s.length&&(o=s),3==i.length&&(s=[],0<(i=(i=i[2])?i.split(","):s).length&&(i=Q[i[0]])&&(t.c[r]=i))}for(t.c[r]||(i=Q[r])&&(t.c[r]=i),i=0;i<o.length;i+=1)t.a.push(new A(r,o[i]))}}(o),v(n,function(t){if(0==t.a.length)throw Error("No fonts to load!");if(-1!=t.c.indexOf("kit="))return t.c;for(var e=t.a.length,n=[],i=0;i<e;i++)n.push(t.a[i].replace(/ /g,"+"));return e=t.c+"?family="+n.join("%7C"),0<t.f.length&&(e+="&subset="+t.f.join(",")),0<t.g.length&&(e+="&text="+encodeURIComponent(t.g)),e}(i),g(e)),b(e,(function(){t(o.a,o.c,it)}))},rt.prototype.load=function(t){var e=this.a.id,n=this.c.o;e?y(this.c,(this.a.api||"https://use.typekit.net")+"/"+e+".js",(function(e){if(e)t([]);else if(n.Typekit&&n.Typekit.config&&n.Typekit.config.fn){e=n.Typekit.config.fn;for(var i=[],r=0;r<e.length;r+=2)for(var o=e[r],s=e[r+1],a=0;a<s.length;a++)i.push(new A(o,s[a]));try{n.Typekit.load({events:!1,classes:!1,async:!0})}catch(t){}t(i)}}),2e3):t([])},ot.prototype.load=function(t){var e=this.f.id,n=this.c.o,i=this;e?(n.__webfontfontdeckmodule__||(n.__webfontfontdeckmodule__={}),n.__webfontfontdeckmodule__[e]=function(e,n){for(var r=0,o=n.fonts.length;r<o;++r){var s=n.fonts[r];i.a.push(new A(s.name,O("font-weight:"+s.weight+";font-style:"+s.style)))}t(i.a)},y(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(t){return t.o.location.hostname||t.a.location.hostname}(this.c)+"/"+e+".js",(function(e){e&&t([])}))):t([])};var st=new H(window);st.a.c.custom=function(t,e){return new J(e,t)},st.a.c.fontdeck=function(t,e){return new ot(e,t)},st.a.c.monotype=function(t,e){return new G(e,t)},st.a.c.typekit=function(t,e){return new rt(e,t)},st.a.c.google=function(t,e){return new nt(e,t)};var at={load:s(st.load,st)};void 0===(i=function(){return at}.call(e,n,e,t))||(t.exports=i)}()}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){"use strict";var t={};n.r(t),n.d(t,{ClipboardItem:function(){return Y},read:function(){return it},readText:function(){return K},setDebugLog:function(){return f},suppressWarnings:function(){return d},write:function(){return nt},writeText:function(){return G}});var e=n(755),i=n.n(e),r=n(733),o=n.n(r),s=n(925),a=n.n(s),c="text/plain",u="text/html",l=t=>{};function h(t){l(t)}function f(t){l=t}var p=!0;function d(){p=!1}(function(){(console.warn||console.log).apply(console,arguments)}).bind("[clipboard-polyfill]");var v,y,m,g="undefined"==typeof window?void 0:window,b="undefined"==typeof globalThis?void 0:globalThis,w=null!=(m=null==(v=g)?void 0:v.Promise)?m:null==(y=b)?void 0:y.Promise;var k,A,S,x,C,O="undefined"==typeof navigator?void 0:navigator,P=null==O?void 0:O.clipboard,E=null==(k=null==P?void 0:P.read)?void 0:k.bind(P),T=null==(A=null==P?void 0:P.readText)?void 0:A.bind(P),j=null==(S=null==P?void 0:P.write)?void 0:S.bind(P),_=null==(x=null==P?void 0:P.writeText)?void 0:x.bind(P),B=null==(C=g)?void 0:C.ClipboardItem,R=function(){if(!w)throw new Error("No `Promise` implementation available for `clipboard-polyfill`. Consider using: https://github.com/lgarron/clipboard-polyfill#flat-file-version-with-promise-included");return w}(),I=g;function D(){return"undefined"==typeof ClipboardEvent&&void 0!==(null==I?void 0:I.clipboardData)&&void 0!==(null==I?void 0:I.clipboardData.setData)}function N(t,e,n){for(var i in h("listener called"),t.success=!0,e){var r=e[i],o=n.clipboardData;o.setData(i,r),i===c&&o.getData(i)!==r&&(h("setting text/plain failed"),t.success=!1)}n.preventDefault()}function M(t){var e={success:!1},n=N.bind(this,e,t);document.addEventListener("copy",n);try{document.execCommand("copy")}finally{document.removeEventListener("copy",n)}return e.success}function V(t,e){q(t);var n=M(e);return L(),n}function q(t){var e=document.getSelection();if(e){var n=document.createRange();n.selectNodeContents(t),e.removeAllRanges(),e.addRange(n)}}function L(){var t=document.getSelection();t&&t.removeAllRanges()}function F(t){var e,n,i=c in t;if(D()){if(!i)throw new Error("No `text/plain` value was specified.");if(e=t[c],(n=I.clipboardData.setData("Text",e))&&h("writeTextIE worked"),n)return!0;throw new Error("Copying failed, possibly because the user rejected it.")}return M(t)?(h("regular execCopy worked"),!0):navigator.userAgent.indexOf("Edge")>-1?(h('UA "Edge" => assuming success'),!0):V(document.body,t)?(h("copyUsingTempSelection worked"),!0):function(t){var e=document.createElement("div");e.setAttribute("style","-webkit-user-select: text !important"),e.textContent="temporary element",document.body.appendChild(e);var n=V(e,t);return document.body.removeChild(e),n}(t)?(h("copyUsingTempElem worked"),!0):!!function(t){h("copyTextUsingDOM");var e=document.createElement("div");e.setAttribute("style","-webkit-user-select: text !important");var n=e;e.attachShadow&&(h("Using shadow DOM."),n=e.attachShadow({mode:"open"}));var i=document.createElement("span");i.innerText=t,n.appendChild(i),document.body.appendChild(e),q(i);var r=document.execCommand("copy");return L(),document.body.removeChild(e),r}(t[c])&&(h("copyTextUsingDOM worked"),!0)}function z(t,e){var n=[];for(var i in t){var r=t[i];n.push(e(r))}return R.all(n).then((e=>{for(var n={},i=0;i<t.length;i++)n[t[i]]=e[i];return n}))}var U=R.resolve(),$=()=>R.resolve(!0),H=R.resolve(!1);function W(t){return new R(((e,n)=>{try{e(t())}catch(t){n(t)}}))}function G(t){return W((()=>_?(h("Using `navigator.clipboard.writeText()`."),_(t).catch(J)):R.resolve(J(t))))}function J(t){if(!F(function(t){var e={};return e[c]=t,e}(t)))throw new Error("writeText() failed")}function K(){return W((()=>{if(T)return h("Using `navigator.clipboard.readText()`."),T();if(D()){var t=function(){var t=I.clipboardData.getData("Text");if(""===t)throw new Error("Empty clipboard or could not read plain text from clipboard");return t}();return R.resolve(t)}throw new Error("Read is not supported in your browser.")}))}function Z(t,e){for(var n in t){if(-1!==t[n].types.indexOf(e))return!0}return!1}var Y=function(t,e){var n,i=Object.keys(t),r={};for(var o in t){var s=t[o];r[o]="string"==typeof s?Q(o,s):s}return{types:i,presentationStyle:null!=(n=null==e?void 0:e.presentationStyle)?n:"unspecified",getType:function(t){return R.resolve(r[t])}}};function Q(t,e){return new Blob([e],{type:t})}function X(t){return z(t.types,(function(e){return t.getType(e)})).then((e=>{var n={};return t.presentationStyle&&(n.presentationStyle=t.presentationStyle),new B(e,n)}))}function tt(t){var e={};return e[c]=Q(t,c),new Y(e)}function et(t,e){return t.getType(e).then((t=>{return e=t,new R(((t,n)=>{var i=new FileReader;i.addEventListener("load",(()=>{var e=i.result;"string"==typeof e?t(e):n("could not convert blob to string")})),i.readAsText(e)}));var e}))}function nt(t){return W((()=>{if(j&&B){var e=j;return h("Using `navigator.clipboard.write()`."),R.all(t.map(X)).then((n=>e(n).then($).catch((e=>{if(!Z(t,c)&&!Z(t,u))throw e;return H}))))}return H})).then((e=>{if(e)return U;var n=Z(t,c);return p&&!n&&h("clipboard.write() was called without a `text/plain` data type. On some platforms, this may result in an empty clipboard. Call suppressWarnings() to suppress this warning."),function(t){return z(t.types,(function(e){return et(t,e)}))}(t[0]).then((t=>{if(!F(t))throw new Error("write() failed")}))}))}function it(){return W((()=>E?(h("Using `navigator.clipboard.read()`."),E()):K().then((t=>[tt(t)]))))}var rt=n(933),ot=n.n(rt),st={version:"2.1.13 (2023-07-11)",languages:["en","ar","ast","bs","ca","ca_ES@valencia","cs","da","de","el","es","eu","fr","gl","he","it","ja","nl","pl","pt","pt_BR","ro","ru","tr","vec","zh_TW"],messages:{ar:{Version:"الإصدار",time:"الوقت",actions:"المحاولات",score:"النتيجة","Next activity":"النشاط التالي","Previous activity":"النشاط السابق","Restart activity":"استئنف النشاط",Information:"المعلومة","Current results":"تقارير المستخدم","User:":"المستخدم:","Projects:":"المشاريع:",Project:"المشروع:",sequence:"التسلسل",activity:"النشاط",OK:"موافق","Total:":"المجموع:"},ast:{Version:"Versión",time:"tiempu",actions:"intentos",score:"marcador","Next activity":"Xera siguiente","Previous activity":"Xera anterior","Restart activity":"Reaniciar xera",Information:"Información","Results are not currently being saved":"L'informe nun ta rexistráu en nenguna base de datos","Current results":"Informes d'usuariu","Session started:":"Entamu de sesión:","Reports system:":"Sistema d'informes:","User:":"Usuariu:","Projects:":"Proyeutos:","Sequences:":"Secuencies:","Activities done:":"Xeres feches:","Activities solved:":"Xeres correctes:","Global score:":"Puntuación global:","Total time in activities:":"Tiempu total en xeres:","Actions done:":"Aiciones feches:","No activities done!":"¡Nenguna información sobre xeres!",Project:"Proyeutu:",sequence:"Secuencia",activity:"Xera",OK:"OK",YES:"SI",NO:"NON","Total:":"Total:"},bs:{Version:"Verzija",time:"vrijeme",actions:"pokušaji",score:"rezultat","Next activity":"Sljedeća aktivnost","Previous activity":"Prethodna aktivnost","Restart activity":"Ponovno pokreni aktivnost",Information:"Informacije","Current results":"Izvješća korisnika","Session started:":"Sesija započeta:","User:":"Korisnik:","Projects:":"Projekti:","Activities done:":"Urađene aktivnosti:","Activities solved:":"Aktivnosti ok:","Global score:":"Ukupan rezultat:","Total time in activities:":"Ukupno vrijeme aktivnosti:","Actions done:":"Urađene aktivnosti:",Project:"Projekt:",sequence:"Sekvenca",activity:"Aktivnost",OK:"Uredu",YES:"DA",NO:"NE","Total:":"Ukupno:"},ca:{Version:"Versió",time:"temps",actions:"accions",score:"encerts","Next activity":"Activitat següent","Previous activity":"Activitat anterior","Restart activity":"Reinicia l'activitat",Information:"Informació","Results are not currently being saved":"Els resultats no s'estan desant","Current results":"Resultats actuals","Session started:":"Inici de sessió:","Reports system:":"Sistema d'informes:","User:":"Usuari/ària:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","(out of all project activities)":"(sobre totes les activitats del projecte)","Total time in activities:":"Temps total en les activitats:","Actions done:":"Accions fetes:","No activities done!":"No heu fet cap activitat!",Project:"Projecte",sequence:"seqüència",activity:"activitat",OK:"OK",YES:"SÍ",NO:"NO","Total:":"Totals:","Select group:":"Seleccioneu el grup:","Select user:":"Seleccioneu l'usuari:",Cancel:"Cancel·la",Close:"Tanca","Copy data to clipboard":"Copia les dades al porta-retalls","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les dades s'han copiat en format HTML. Enganxeu-les a un full de càlcul o a un editor de text enriquit.","The data has been copied to clipboard":"Les dades s'han copiat al porta-retalls","not connected":"no connectat","Please wait until the results of your activities are sent to the reports system":"Si us plau, espereu a que els resultats de les vostres activitats s'enviïn al servidor d'informes","Password:":"Contrasenya:","Incorrect password":"Contrasenya incorrecta","Invalid user":"Usuari/ària incorrecte","Partial score:":"Puntuació parcial:","(out of played activities)":"(sobre les activitats fetes)","Activities played at least once:":"Activitats fetes almenys una vegada:",Reports:"Informes","Toggle full screen":"Commuta pantalla completa","JClic logo":"Logotip del JClic",message:"missatge","Activity panel":"Tauler d'activitats",cell:"cel·la",image:"imatge",source:"origen",target:"destí","image fragment":"fragment d'imatge"},"ca_ES@valencia":{Version:"Versió",time:"temps",actions:"accions",score:"encerts","Next activity":"Activitat següent","Previous activity":"Activitat anterior","Restart activity":"Reinicia l'activitat",Information:"Informació","Results are not currently being saved":"Els resultats no s'estan alçant","Current results":"Resultats actuals","Session started:":"Inici de sessió:","Reports system:":"Sistema d'informes:","User:":"Usuari/ària:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","Total time in activities:":"Temps total en les activitats:","Actions done:":"Accions fetes:","No activities done!":"No heu fet cap activitat!",Project:"Projecte",sequence:"seqüència",activity:"activitat",OK:"OK",YES:"SÍ",NO:"NO","Total:":"Totals:"},cs:{Version:"Verze",time:"čas",actions:"pokusů",score:"skóre","Next activity":"Další aktivita","Previous activity":"Předchozí aktivita","Restart activity":"Restartovat aktivitu",Information:"Informace","Results are not currently being saved":"Zpráva není zaregistrována v žádné DB","Current results":"Uživatelská sestava","Session started:":"Sezení spuštěno:","Reports system:":"Systém zprávy:","User:":"Uživatel:","Projects:":"Projekty:","Sequences:":"Sekvence:","Activities done:":"Dokončené aktivity:","Activities solved:":"Aktivity ok:","Global score:":"Celkové skóre:","Total time in activities:":"Celkový čas aktivit:","Actions done:":"Provedené akce:","No activities done!":"Nebyly nahlášeny žádné aktivity!",Project:"Projekt",sequence:"Sekvence",activity:"Aktivita",OK:"Ok",YES:"ANO",NO:"NE","Total:":"Celkem:"},da:{Version:"Version",time:"tid",actions:"forsøg",score:"score","Next activity":"Næste aktivitet","Previous activity":"Forrige aktivitet","Restart activity":"Genstart aktivitet",Information:"Information","Current results":"Bruger rapport","User:":"Bruger:","Projects:":"Projekter:","Sequences:":"Sekvenser:","Activities done:":"Aktiviteter udført:","Activities solved:":"Aktiviteter OK:","Global score:":"Global score:","No activities done!":"Ingen aktiviteter rapporteret!",Project:"Projekt",sequence:"Sequence",activity:"Aktivitet",OK:"Ok",YES:"JA",NO:"IKKE","Total:":"Total:"},de:{Version:"Version",time:"Zeit",actions:"Versuche",score:"Ergebnis","Next activity":"Nächste Übung","Previous activity":"Vorherige Übung","Restart activity":"Übung neu starten",Information:"Information","Results are not currently being saved":"Bericht in keiner Datenbank eingetragen","Current results":"Benutzerberichte","Session started:":"Sitzung gestartet:","Reports system:":"Report system:","User:":"User:","Projects:":"Projekte:","Sequences:":"Sequenzen:","Activities done:":"Beendete Übungen:","Activities solved:":"Korrekte Übungen:","Global score:":"Gesamtpunktezahl:","Total time in activities:":"Übungs-Gesamtzeit:","Actions done:":"Durchgeführte Aktionen:","No activities done!":"Keine Übungsberichte vorhanden!",Project:"Projekt",sequence:"Sequenz",activity:"Übung",OK:"OK",YES:"JA",NO:"NEIN","Total:":"Gesamt:"},el:{Version:"Έκδοση",time:"χρόνος",actions:"προσπάθειες",score:"βαθμολογία","Next activity":"Επόμενη δραστηριότητα","Previous activity":"Προηγούμενη δραστηριότητα","Restart activity":"Επανεκκίνηση δραστηριότητας",Information:"Πληροφορίες","Results are not currently being saved":"Η αναφορά δεν εγγράφηκε στις βάσεις δεδομένων","Current results":"Αναφορές χρήστη","Session started:":"Έναρξη συνεδρίας:","Reports system:":"Σύστημα αναφορών:","User:":"Χρήστης:","Projects:":"Έργα:","Sequences:":"Αλληλουχίες:","Activities done:":"Ολοκληρωμένες δραστηριότητες:","Activities solved:":"Δραστηριότητες, εντάξει:","Global score:":"Συνολική βαθμολογία:","Total time in activities:":"Συνολικός χρόνος δραστηριοτήτων:","Actions done:":"Οι ενέργειες ολοκληρώθηκαν:","No activities done!":"Για καμμία δραστηριότητα δεν έχει υποβληθεί αναφορά!",Project:"Έργο",sequence:"Αλληλουχία",activity:"Δραστηριότητα",OK:"Εντάξει",YES:"Ναί",NO:"όχι","Total:":"Σύνολο:"},es:{Version:"Versión",time:"tiempo",actions:"acciones",score:"aciertos","Next activity":"Actividad siguiente","Previous activity":"Actividad anterior","Restart activity":"Reiniciar actividad",Information:"Información","Results are not currently being saved":"Los resultados no se están guardando","Current results":"Resultados actuales","Session started:":"Inicio de sesión:","Reports system:":"Sistema de informes:","User:":"Usuario/aria:","Projects:":"Proyectos:","Sequences:":"Secuencias:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades resueltas:","Global score:":"Puntuación global:","(out of all project activities)":"(sobre todas las actividades del proyecto)","Total time in activities:":"Tiempo total en las actividades:","Actions done:":"Acciones realizadas:","No activities done!":"¡No se ha realizado ninguna actividad!",Project:"Proyecto",sequence:"secuencia",activity:"actividad",OK:"OK",YES:"SI",NO:"NO","Total:":"Totales:","Select group:":"Seleccionar grupo:","Select user:":"Seleccionar usuario:",Cancel:"Cancelar",Close:"Cerrar","Copy data to clipboard":"Copiar datos al portapapeles","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Los datos se han copiado en formato HTML. Puedes pegarlos en una hoja de cálculo o en un editor de texto rico.","The data has been copied to clipboard":"Los datos se han copiado al portapapeles","not connected":"no conectado","Please wait until the results of your activities are sent to the reports system":"Por favor, espera mientras los resultados de las actividades se envian al servidor de informes","Password:":"Contraseña:","Incorrect password":"Contraseña incorrecta","Invalid user":"Usuario incorrecto","Partial score:":"Puntuación parcial:","(out of played activities)":"(sobre las actividades realizadas)","Activities played at least once:":"Actividades realizadas al menos una vez:",Reports:"Informes","Toggle full screen":"Conmutar pantalla completa","JClic logo":"Logotipo de JClic",message:"mensaje","Activity panel":"Panel de actividad",cell:"celda",image:"imagen",source:"origen",target:"destino","image fragment":"fragmento de imagen"},eu:{Version:"Bertsioa",time:"denbora",actions:"saiakerak",score:"puntuazioa","Next activity":"Hurrengo jarduera","Previous activity":"Aurreko jarduera","Restart activity":"Jarduera berriro hasi",Information:"Informazioa","Results are not currently being saved":"Txostena ez dago ezein datu-basetan","Current results":"Erabiltzailearen txostenak","Session started:":"Saio-hasiera:","Reports system:":"Txosten-sistema:","User:":"Erabiltzailea:","Projects:":"Proiektuak:","Sequences:":"Sekuentziak:","Activities done:":"Burututako ekinzak:","Activities solved:":"Jarduera zuzenak:","Global score:":"Jarduera zuzenak:","Total time in activities:":"Jardueretan emandako denbora guztira:","Actions done:":"Burututako ekintzak:","No activities done!":"Ez da jardueren txostenik!",Project:"Proiektua",sequence:"Sekuentzia",activity:"Jarduera",OK:"Ados",YES:"BAI",NO:"EZ","Total:":"Guztira:"},fr:{Version:"Version",time:"temps",actions:"essais",score:"résultat","Next activity":"Activité suivante","Previous activity":"Activité précédente","Restart activity":"Recommencer l'activité",Information:"Information","Results are not currently being saved":"Le rapport n'est enregistré dans aucune base de données","Current results":"Rapports utilisateur","Session started:":"Session démarrée:","Reports system:":"Report système:","User:":"Utilisateur:","Projects:":"Projets:","Sequences:":"Séquences:","Activities done:":"Activités faites:","Activities solved:":"Activités ok:","Global score:":"Score global:","(out of all project activities)":"(Hors de toutes les activités du projet)","Total time in activities:":"Temps total sur les activités:","Actions done:":"Actions faites:","No activities done!":"Pas d'activités rapportées!",Project:"Projet",sequence:"séquence",activity:"activité",OK:"Ok",YES:"OUI",NO:"NON","Total:":"Total:","Select group:":"Sélectionner un groupe:","Select user:":"Sélectionner l'utilisateur:",Cancel:"Annuler",Close:"Fermer","Copy data to clipboard":"Copier les données dans le presse-papier","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les données ont été copiées au format HTML. Veuillez les coller dans une feuille de calcul ou dans un éditeur de texte","The data has been copied to clipboard":"Les données sont copier dans le presse-papier","not connected":"Non connecté ","Please wait until the results of your activities are sent to the reports system":"Veuillez patienter durant l'envoi de votre activité au rapport système","Password:":"Mot de passe: ","Incorrect password":"Mot de passe incorrect","Invalid user":"Utilisateur invalide","Partial score:":"Score partiel:","(out of played activities)":"(Hors activités jouées)","Activities played at least once:":"Les activités joué au moins une fois:",Reports:"Rapport","Toggle full screen":"Basculer en plein écran","JClic logo":"JClic logo",message:"message","Activity panel":"Groupe d'activités",cell:"cellule",image:"image",source:"source",target:"cible","image fragment":"fragment d'image"},gl:{Version:"Versión",time:"tempo",actions:"intentos",score:"acertos","Next activity":"Seguinte actividade","Previous activity":"Anterior actividade","Restart activity":"Reiniciar a actividade",Information:"Información","Results are not currently being saved":"O informe non está rexistrado en ningunha base de datos","Current results":"Informes de usuario","Session started:":"Inicio de sesión:","Reports system:":"Sistema de informes:","User:":"Usuario:","Projects:":"Proxectos:","Sequences:":"Secuencias:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades correctas:","Global score:":"Puntuación global:","Total time in activities:":"Tempo total nas actividades:","Actions done:":"Accións efectuadas:","No activities done!":"Non hai informada ningunha actividade!",Project:"Proxecto",sequence:"secuencia",activity:"actividade",OK:"Correcta",YES:"SI",NO:"NON","Total:":"Total:"},he:{Version:"גירסה",time:"זמן",actions:"נסיונות",score:"ניקוד","Next activity":"הפעילות הבאה","Previous activity":"הפעילות הקודמת","Restart activity":"התחל פעילות מחדש",Information:"מידע","Results are not currently being saved":"הדיווח אינו רשום במסד נתונים כלשהו","Current results":"דוחות משתמש","Session started:":"הפעלה החלה:","Reports system:":"מערכת דוחות:","User:":"משתמש:","Projects:":"פרוייקטים:","Sequences:":"רצפים:","Activities done:":"פעילויות שהושלמו:","Activities solved:":"פעילויות מאושרות:","Global score:":"ניקוד כללי:","Total time in activities:":"משך הפעילויות המצטבר:","Actions done:":"פעולות שבוצעו:","No activities done!":"לא דווחו פעילויות!",Project:"פרוייקט",sequence:"רצף",activity:"פעילות",OK:"אישור",YES:"כן",NO:"לא","Total:":"סך הכל:"},it:{Version:"Versione",time:"tempo",actions:"tentativi",score:"punteggio","Next activity":"Attività successiva","Previous activity":"Attività precedente","Restart activity":"Riavvia l'attività",Information:"Informazioni","Results are not currently being saved":"Rapporto non registrato in alcun database","Current results":"Rapporti utente","Session started:":"Sessione avviata:","Reports system:":"Sistema dei rapporti:","User:":"Utente:","Projects:":"Progetti:","Sequences:":"Sequenze:","Activities done:":"Attività eseguite:","Activities solved:":"Attività ok:","Global score:":"Punteggio globale:","Total time in activities:":"Tempo totale nelle attività:","Actions done:":"Azioni compiute:","No activities done!":"Nessuna attività a rapporto!",Project:"Progetto",sequence:"sequenza",activity:"attività",OK:"Ok",YES:"SI",NO:"NO","Total:":"Totale:"},ja:{Version:"バージョン",time:"時間",actions:"アクション",score:"スコア","Next activity":"次のアクティビティ","Previous activity":"前のアクティビティ","Restart activity":"アクティビティを再起動",Information:"情報","Results are not currently being saved":"結果は、現在保存されていません","Current results":"現在の結果","Session started:":"セッションが開始しました:","Reports system:":"レポート システム:","User:":"ユーザー:","Projects:":"プロジェクト:","Sequences:":"シーケンス:","Activities done:":"完了したアクティビティ:","Activities solved:":"解決したアクティビティ:","Global score:":"グローバル スコア:","(out of all project activities)":"(すべてのプロジェクト アクティビティの結果)","Total time in activities:":"アクティビティ時間の合計:","Actions done:":"完了したアクション:","No activities done!":"アクティビティは行われていません!",Project:"プロジェクト",sequence:"シーケンス",activity:"アクティビティ",OK:"OK",YES:"はい",NO:"いいえ","Total:":"合計:","Select group:":"グループを選択:","Select user:":"ユーザーを選択:",Cancel:"キャンセル",Close:"閉じる","Copy data to clipboard":"データをクリップボードにコピー","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"データは HTML 形式でコピーされます。リッチ テキスト エディターやスプレッドシートに貼り付けてください","The data has been copied to clipboard":"クリップボードにデータがコピーされました","not connected":"接続されていません","Please wait until the results of your activities are sent to the reports system":"アクティビティの結果がレポート システムに送信されるまでお待ちください","Password:":"パスワード:","Incorrect password":"パスワードが正しくありません","Invalid user":"無効なユーザー","Partial score:":"部分スコア:","(out of played activities)":"(プレイしたアクティビティの結果)","Activities played at least once:":"少なくとも一度プレイしたアクティビティ:",Reports:"レポート","Toggle full screen":"全画面の切り替え","JClic logo":"JClic ロゴ",message:"メッセージ","Activity panel":"アクティビティ パネル",cell:"セル",image:"画像",source:"ソース",target:"ターゲット","image fragment":"画像フラグメント"},nl:{Version:"Versie",time:"tijd",actions:"pogingen",score:"punten","Next activity":"Volgende activiteit","Previous activity":"Vorige activiteit","Restart activity":"Herstart activiteit",Information:"Informatie","Results are not currently being saved":"Rapport niet geregistreerd in een DB","Current results":"Gebruikers rapport","Session started:":"Reeks gestart:","Reports system:":"Rapporteer systeem:","User:":"Gebruiker:","Projects:":"Projecten:","Sequences:":"Reeksen:","Activities done:":"Activiteiten klaar:","Activities solved:":"Activiteiten ok:","Global score:":"Puntentotaal:","Total time in activities:":"Totale tijd activiteiten:","Actions done:":"Einde activiteiten:","No activities done!":"Geen activiteiten gerapporteerd!",Project:"Project",sequence:"Volgorde",activity:"Activiteit",OK:"Ok",YES:"JA",NO:"NEE","Total:":"Totaal:"},pl:{Version:"Wersja",time:"czas",actions:"działania",score:"wynik","Next activity":"Następne działanie","Previous activity":"Poprzednia aktywność","Restart activity":"Restartuj aktywność",Information:"Informacje","Results are not currently being saved":"Wyniki nie są obecnie zapisywane","Current results":"Aktualne wyniki","Session started:":"Sesja rozpoczęła się:","Reports system:":"System raportów:","User:":"Użytkownik:","Projects:":"Projekty:","Sequences:":"Sekwencje:","Activities done:":"Działania wykonane:","Activities solved:":"Działania rozwiązane:","Global score:":"Globalny wynik:","(out of all project activities)":"(poza wszystkimi działaniami projektu)","Total time in activities:":"Całkowity czas aktywności:","Actions done:":"Wykonane czynności:","No activities done!":"Nie wykonano żadnych czynności!",Project:"Projekt",sequence:"kolejność",activity:"aktywność",OK:"OK",YES:"Tak",NO:"Nie","Total:":"Całkowity:","Select group:":"Wybierz grupę:","Select user:":"Wybierz użytkownika:",Cancel:"Anuluj",Close:"Zamknij","Copy data to clipboard":"Skopiuj dane do schowka","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Dane zostały skopiowane w formacie HTML. Wklej je do arkusza kalkulacyjnego lub edytora tekstu","The data has been copied to clipboard":"Dane zostały skopiowane do schowka","not connected":"nie połączony","Please wait until the results of your activities are sent to the reports system":"Poczekaj, aż wyniki Twoich działań zostaną przesłane do systemu raportów","Password:":"Hasło:","Incorrect password":"Niepoprawne hasło","Invalid user":"Nieprawidłowy użytkownik","Partial score:":"Wynik częściowy:","(out of played activities)":"(z granych działań)","Activities played at least once:":"Działania grane co najmniej raz:",Reports:"Raporty","Toggle full screen":"Przełącz tryb pełnoekranowy","JClic logo":"Logo JClic",message:"komunikat","Activity panel":"Panel aktywności",cell:"komórka",image:"obraz",source:"źródło",target:"miejsce docelowe","image fragment":"fragment obrazu"},pt:{Version:"Versão",time:"tempo",actions:"tentativas",score:"acertos","Next activity":"Actividade seguinte","Previous activity":"Actividade anterior","Restart activity":"Reiniciar a actividade",Information:"Informação","Results are not currently being saved":"O relatório não está registado em nenhuma base de dados","Current results":"Relatórios do utilizador","Session started:":"Início da sessão:","Reports system:":"Sistema de relatórios:","User:":"Utilizador:","Projects:":"Projectos:","Sequences:":"Sequências:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades correctas:","Global score:":"Pontuação global:","Total time in activities:":"Tempo total das actividades:","Actions done:":"Acções efectuadas:","No activities done!":"Nenhuma actividade registada!",Project:"Projecto",sequence:"sequência",activity:"Actividade",OK:"Correcta",YES:"sim",NO:"não","Total:":"Total:"},pt_BR:{Version:"Versão",time:"tempo",actions:"tentativas",score:"acertos","Next activity":"atividade seguinte","Previous activity":"atividade anterior","Restart activity":"Reiniciar a atividade",Information:"Informação","Results are not currently being saved":"O relatório não está registrando em nenhuma base de dados","Current results":"relatórios de usuário","Session started:":"Início da sessão:","Reports system:":"Sistema de relatórios:","User:":"Usuário:","Projects:":"Projetos:","Sequences:":"Sequências:","Activities done:":"Atividades realizadas:","Activities solved:":"Atividades corretas:","Global score:":"Pontuação geral:","Total time in activities:":"Tempo total das atividades:","Actions done:":"Ações efetuadas:","No activities done!":"Nenhuma atividade registrada!",Project:"Projeto",sequence:"sequência",activity:"atividade",OK:"Correta",YES:"sim",NO:"não","Total:":"Total:"},ro:{Version:"Versiune",time:"timp",actions:"acțiuni",score:"rezultat","Next activity":"Activitatea următoare","Previous activity":"Activitatea anterioară","Restart activity":"Restartează activitatea",Information:"Informații","Results are not currently being saved":"Rezultatul nu pare a fi salvat","Current results":"Rezultatul curent","Session started:":"Sesiune pornită la:","Reports system:":"Sistem raportare:","User:":"Utilizator","Projects:":"Proiecte:","Sequences:":"Secvențe:","Activities done:":"Activități realizate: ","Activities solved:":"Activități rezolvate: ","Global score:":"Rezultat global:","(out of all project activities)":"(în afara activităților din proiect)","Total time in activities:":"Timp total în activitate:","Actions done:":"Activități realizate: ","No activities done!":"Activități nerealizate: ",Project:"Proiect",sequence:"secvență",activity:"activitate",OK:"OK",YES:"DA",NO:"NU","Total:":"Total:","Select group:":"Alege grup:","Select user:":"Alege utilizator:",Cancel:"Anuleaza",Close:"Închide","Copy data to clipboard":"Copiază datele in clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Datele au fost copiate în format HTML. Vă rog lipiți-le într-o foaie de calcul sau într-un editor compatibil rich text","The data has been copied to clipboard":"Datele au fost copiate în clipboard","not connected":"neconectat","Please wait until the results of your activities are sent to the reports system":"Vă rugăm să așteptați până ce rezultatele activităților sunt trimise către sistemul de raportare","Password:":"Parolă:","Incorrect password":"Parolă incorectă","Invalid user":"Utilizator incorect","Partial score:":"Rezultat parțial:","(out of played activities)":"(în afara activități jucate) ","Activities played at least once:":"Activități jucate cel puțin o dată: ",Reports:"Rapoarte","Toggle full screen":"Comută în ecran plin","JClic logo":"Jclic logo",message:"mesaj","Activity panel":"Panou activități",cell:"celulă",image:"imagine",source:"sursă",target:"țintă","image fragment":"fragment de imagine "},ru:{Version:"Версия",time:"время",actions:"попытки",score:"счёт","Next activity":"Следующее действие","Previous activity":"Предыдущее действие","Restart activity":"Перезапуск действия",Information:"Информация","Results are not currently being saved":"Отчёт не зарегистрирован в БД","Current results":"Отчёты пользователя","Session started:":"Сессия начата:","Reports system:":"Система отчётов:","User:":"Пользователь:","Projects:":"Проекты:","Sequences:":"Последовательности:","Activities done:":"Совершенные действия:","Activities solved:":"Действия в порядке:","Global score:":"Общий счёт:","Total time in activities:":"Общее время активности:","Actions done:":"Завершено действий:","No activities done!":"Нет сообщенных действий!",Project:"Проект",sequence:"Последовательность",activity:"Активность",OK:"ОК",YES:"да",NO:"нет","Total:":"Итого:"},tr:{Version:"Sürüm",time:"zaman",actions:"Denemeler",score:"sonuç","Next activity":"Bir sonraki etkinlik","Previous activity":"Bir önceki etkinlik","Restart activity":"Etkinliği tekrar başlat",Information:"Bilgi","Results are not currently being saved":"Rapor herhangi bir veritabanında kaydedilmedi","Current results":"Kullanıcı raporları","Session started:":"Oturum başlatıldı","Reports system:":"Sistem raporu:","User:":"Kullanıcı:","Projects:":"Projeler:","Sequences:":"Etkinlik dizisi","Activities done:":"Etkinlikler başlatılıyor:","Activities solved:":"Etkinlikler tamam:","Global score:":"Genel sonuç:","Total time in activities:":"Etkinlikde geçirilen toplam zaman:","Actions done:":"Eylem gerçekleştiriliyor:","No activities done!":"Etkinlik raporu yok!",Project:"Proje",sequence:"Etkinlik dizisi",activity:"Etkinlik",OK:"Tamam",YES:"Evet",NO:"hiçbir","Total:":"Toplam:"},vec:{Version:"Version",time:"tenpo",actions:"tentadivi",score:"pontexio","Next activity":"Pròsima atività","Previous activity":"Atività presedente","Restart activity":"Invìa atività da novo",Information:"Informasion","Results are not currently being saved":"Report no registrà inte nisun database","Current results":"Reports utenti","Session started:":"Sesion inviada:","Reports system:":"Sistèma de report","User:":"Utente:","Projects:":"Proxèti:","Sequences:":"Secuense:","Activities done:":"Atività fate:","Activities solved:":"Atività ok:","Global score:":"Pontexio global","Total time in activities:":"Tenpo total so ƚe atività","Actions done:":"Asion exeguìe","No activities done!":"No xé stà reportà atività!",Project:"Proxèto:",sequence:"secuensa",activity:"Atività",OK:"Ok",YES:"SI",NO:"NO","Total:":"Total:"},zh_TW:{Version:"版本",time:"時間",actions:"嘗試次數",score:"分數","Next activity":"下一個活動","Previous activity":"上一個活動","Restart activity":"重設活動",Information:"相關資訊","Results are not currently being saved":"回報在DB中無註冊","Current results":"使用者報告","Session started:":"工作開始:","Reports system:":"報告系統:","User:":"使用者:","Projects:":"專案:","Sequences:":"順序:","Activities done:":"活動結束:","Activities solved:":"活動完成:","Global score:":"總成績:","Total time in activities:":"活動總時間:","Actions done:":"活動完成:","No activities done!":"沒有活動報告",Project:"專案:",sequence:"順序",activity:"活動",OK:"確定",YES:"是",NO:"否","Total:":"總計:"}}};function at(t){return function(t){if(Array.isArray(t))return ht(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||lt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ct(t){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(t)}function ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);c=!0);}catch(t){u=!0,r=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(t,e)||lt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(t,e){if(t){if("string"==typeof t)return ht(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ht(t,e):void 0}}function ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var ft={clipboard:t,$:i(),JSZip:o(),JSZipUtils:a(),WebFont:ot()},pt=["none","error","warn","info","debug","trace","all"],dt=[" ","ERROR","WARN ","INFO ","DEBUG","TRACE","ALL "],vt={level:2,prefix:"JClic",timestamp:!0,popupOnErrors:!1,chainTo:null,pipeTo:null},yt={};function mt(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t=Ft(t),e&&(void 0!==t.logLevel&&bt(t.logLevel),"function"==typeof t.chainLogTo&&(vt.chainTo=t.chainLogTo),"function"==typeof t.pipeLogTo&&(vt.pipeTo=t.pipeLogTo)),n){var i=t.lang,r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=-1,r=[];if(n){var o=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=ut(/^([a-zA-Z]{2,3})[_-]?([a-zA-Z]{2})?@?([a-zA-Z0-9]*)?$/.exec(t.trim())||[],4),n=e[1],i=void 0===n?null:n,r=e[2],o=void 0===r?null:r,s=e[3],a=void 0===s?null:s;return i?"".concat(i.toLowerCase()).concat(o?"_".concat(o.toUpperCase()):"").concat(a?"@".concat(a.toLowerCase()):""):""}(n);o&&r.push(o)}window.navigator.languages&&(r=r.concat(window.navigator.languages));window.navigator.language&&r.push(window.navigator.language);r.push(e);for(var s=0;s<r.length;s++){var a=-1;for(var c in t)if(0===r[s].indexOf(t[c])&&(a=c,r[s]===t[c])){i=c;break}if(i>=0||(i=a)>=0)break}return t[i>=0?i:0]}(st.languages,"en",i);wt("debug","Language ".concat(i?'requested: "'.concat(i,'" '):"",' used: "').concat(r,'"')),yt="en"===r?{}:st.messages[r]}return t}function gt(t){return yt[t]||t}function bt(t){var e=pt.indexOf(t);e>=0&&(vt.level=e)}function wt(t,e){var n=pt.indexOf(t),i=Array.prototype.slice.call(arguments);if(n<0||n<=vt.level)if(vt.pipeTo)vt.pipeTo.apply(null,i);else{var r="".concat(vt.prefix||""," ").concat(dt[n]," ").concat(vt.timestamp?Pt():""," ").concat(e);console[1===n?"error":2===n?"warn":"log"].apply(console,[r].concat(i.slice(2))),vt.chainTo&&vt.chainTo.apply(null,i)}}function kt(t){return"true"===t||"false"!==t&&(arguments.length>1&&void 0!==arguments[1]&&arguments[1])}function At(t){return""===t||null==t?arguments.length>1&&void 0!==arguments[1]?arguments[1]:null:t}function St(t,e){return Number(At(t,e))}function xt(t){return"".concat(Math.round(100*t),"%")}function Ct(t){return"0".concat(t).slice(-2)}function Ot(t){var e=new Date(t),n=e.getUTCHours(),i=e.getUTCMinutes(),r=e.getUTCSeconds();return"".concat(n?n+"h ":"").concat(n||i?Ct(i)+"'":"").concat(Ct(r),'"')}function Pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return"".concat(t.getFullYear(),"/").concat(Ct(t.getMonth()+1),"/").concat(Ct(t.getDate())," ").concat(Ct(t.getHours()),":").concat(Ct(t.getMinutes()),":").concat(Ct(t.getSeconds()))}function Et(t){var e=null;if(t){var n=t.trim().split("/");if(3===n.length){var i=parseInt(n[0])||0,r=parseInt(n[1])||0,o=parseInt(n[2])||0;if(i>12&&r<=12){var s=i;i=r,r=s}o<1980&&(o+=o<90?2e3:1900),r&&i&&o&&(e=new Date(Date.parse("".concat(i,"/").concat(r,"/").concat(o))))}}return e||new Date}function Tt(t){if(t){if(!t.match(/^[a-z][a-z][a-z]?$/)){var e=t.match(/\(([a-z][a-z][a-z]?)\)/);t=e&&2===e.length?e[1]:"--"}}else t="--";return t}function jt(t){return"true"===t?1:"false"===t?0:arguments.length>1&&void 0!==arguments[1]?arguments[1]:2}function _t(t){return Array(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0).fill(t).join("")}function Bt(t){return null==t}function Rt(t,e){return null==t&&null==e||t===e}function It(t){var e="";return i()(t).children("p").each((function(t,n){e+="<p>".concat(n.textContent,"</p>")})),e}function Dt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={};t.attributes&&de(t.attributes,(function(t,e){return n[t]=/^-?\d*$/.test(e)?Number(e):e}));var i=[],r=Array.from(t.children||t.childNodes||[]),o=r.filter((function(t){return"p"===t.nodeName}));if(o.length>0&&o.length===r.filter((function(t){return"#text"!==t.nodeName})).length){var s=o.map((function(t){return t.textContent})).join("\n");return t.attributes?(n.text=s,n):s}return r.forEach((function(t){if("#text"!==t.nodeName||e){var r=Dt(t,e);if(n[t.nodeName]||(n[t.nodeName]={},i.push(t.nodeName)),r.id)n[t.nodeName][r.id]=r;else{var o=Object.keys(n[t.nodeName]).length;n[t.nodeName][o]=r}}})),i.forEach((function(t){var e=Object.keys(n[t]);if(!e.find((function(t){return isNaN(t)})))if(1===e.length)n[t]=n[t][0];else{var i=[];e.forEach((function(e){return i.push(n[t][e])})),n[t]=i}})),0===r.length&&t.textContent&&(n.textContent=t.textContent),n}function Nt(t){var e=Dt(t);return"string"==typeof e?e:e.hasOwnProperty("text")?e.text:e.hasOwnProperty("textContent")?e.textContent:e}function Mt(t){t&&Object.keys(t).forEach((function(e){var n=t[e];if("object"===ct(n)){var i=Object.keys(n);1===i.length&&"text"===i[0]?t[e]=n.text:t[e]=Mt(n)}}));return t}function Vt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:be.BoxBase.BACK_COLOR;if(null==t&&(t=e),"#"===(t=t.replace("0x","#")).charAt(0)&&t.length>7){var n=Yt(parseInt(t.substring(1,3),16)/255,2);t="rgba(".concat(parseInt(t.substring(3,5),16),",").concat(parseInt(t.substring(5,7),16),",").concat(parseInt(t.substring(7,9),16),",").concat(n,")")}return t}function qt(t){if(te(t,"rgba(")){var e=parseInt(t.substr(t.lastIndexOf(",")));return"number"==typeof e&&e<1}return!1}function Lt(t){return i().extend(!0,Object.create(Object.getPrototypeOf(t)),t)}function Ft(t){var e={};return t&&i().each(t,(function(t,n){var i;"string"==typeof n&&""!==(i=n.trim().toLowerCase())&&(n="true"===i||"false"!==i&&(isNaN(i)?n:Number(i))),e[t]=n})),e}function zt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n={};return(e=e||Object.keys(t)).forEach((function(e){var i=ut(e.split("|"),2),r=i[0],o=i[1];if(t.hasOwnProperty(r)&&void 0!==t[r]&&null!==t[r]&&t[r].toString()!==o){var s=Ut(t[r]);$t(s)||(n[r]=s)}})),1===(e=Object.keys(n)).length&&"text"===e[0]&&(n=n.text),n}function Ut(t){return t.getAttributes?t.getAttributes():t instanceof Array?t.map((function(t){return Ut(t)})):t instanceof Date?t.toISOString():t instanceof Object?zt(t):t}function $t(t){var e=null==t;if(!e)switch(ct(t)){case"object":e=0===Object.keys(t).length;break;case"string":e=0===t.length}return e}function Ht(t,e,n){return n.forEach((function(n){if(n.key){var i=n.key,r=n.fn,o=n.group,s=n.init,a=n.params;if(!$t(e[i])){var c=e[i];t[i]="object"===o?Object.keys(c).reduce((function(t,e){return t[e]=Wt(r,c[e],"key"===s?e:s,a),t}),{}):"array"===o?c.map((function(t,e){return Wt(r,t,"key"===s?e:s,a)})):Wt(r,c,s,a)}}else $t(e[n])||(t[n]=e[n])})),t}function Wt(t,e,n){var i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return t.factory?t.factory(e,n,r):(i=new t(n)).setAttributes.apply(i,[e].concat(at(r)))}function Gt(t){return be.SEPARATORS.includes(t)}function Jt(t){return be.WORD_DELIMITERS.includes(t)}function Kt(t){for(var e=[],n={text:"",sep:""},i=!0,r=0;r<t.length;r++){var o=t.charAt(r),s=Jt(o);i?s?(i=!1,n.sep=o):n.text+=o:s?n.sep+=o:(e.push(n),n={text:o,sep:""},i=!0)}return e.push(n),e}function Zt(t,e){return Math.round(t/e)*e}function Yt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return t.toFixed?Number(t.toFixed(e)):t}function Qt(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(null===t||0===t.length||null===e||0===e.length)return!1;n||i||(t=t.toUpperCase()),t=t.trim(),i=i&&/\d/.test(t);var r,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=lt(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}(e.split("|"));try{for(o.s();!(r=o.n()).done;){var s=r.value;if(i){if(Number.parseFloat(t.replace(/,/,"."))===Number.parseFloat(s.replace(/,/,".")))return!0}else if(t===(n?s:s.toUpperCase()).trim())return!0}}catch(t){o.e(t)}finally{o.f()}return!1}function Xt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return"string"==typeof t&&((arguments.length>2?arguments[2]:void 0)?t.trim():t).endsWith(e)}function te(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return"string"==typeof t&&0===((arguments.length>2?arguments[2]:void 0)?t.trim():t).indexOf(e)}function ee(t){return t?t.replace(/\\/g,"/"):t}function ne(t){return/^(filesystem:)?(https?|file|data|ftps?):/i.test(t)}function ie(t){var e=t.lastIndexOf("/");return e>=0?t.substring(0,e+1):""}function re(t,e){return e&&""!==e&&0===t.indexOf(e)?t.substr(e.length):t}function oe(t,e){return ne(e)?e:t+e}function se(t,e,n){if(n){var i=re(t+e,n.zipBasePath);if(n.files[i])return new Promise((function(t,r){n.file(i).async("base64").then((function(n){var i=e.toLowerCase().split(".").pop(),r=be.MIME_TYPES[i]||"application/octet-stream";t("data:".concat(r,";base64,").concat(n))})).catch(r)}))}return Promise.resolve(oe(t,e))}var ae={doubleCell:function(t,e){return i()("<tr/>").append(i()("<td/>").html(t)).append(i()("<td/>").html(e))},p:function(t){return i()("<p/>").html(t)},td:function(t,e){return i()("<td/>",e?{class:e}:null).html(t)},th:function(t,e){return i()("<th/>",e?{class:e}:null).html(t)}};function ce(t,e,n,i){return e&&(t=t.replace(/width=\"\d*\"/,'width="'.concat(e,'"'))),n&&(t=t.replace(/height=\"\d*\"/,'height="'.concat(n,'"'))),i&&(t=t.replace(/fill=\"[#A-Za-z0-9]*\"/,'fill="'.concat(i,'"'))),t}function ue(t,e,n,i){return"data:image/svg+xml;base64,"+window.btoa(ce(t,e,n,i))}function le(t,e,n,i){var r=null==t?null:isNaN(t)?t:t<0?"".concat(Math.abs(t),"%"):"".concat(t,"px");return e&&n&&(r||i)&&(e[n]=null!==r?r:i),r}function he(t,e){var n=document.createElement("canvas");n.width=e.dim.width,n.height=e.dim.height;var i=n.getContext("2d"),r="";try{i.drawImage(t,e.pos.x,e.pos.y,e.dim.width,e.dim.height,0,0,e.dim.width,e.dim.height),r=n.toDataURL()}catch(t){wt("error",t)}return r}function fe(t){if(t){for(;t.parentElement;)t=t.parentElement;t instanceof HTMLElement&&(t=t.parentNode||t),t=t.head||t}return t||document.head}function pe(t,e){var n=fe(e&&e.$topDiv?e.$topDiv[0]:null),i=document.createElement("style");return i.type="text/css",i.appendChild(document.createTextNode(t)),n.appendChild(i)}function de(t,e){for(var n=0;n<t.length;n++)e(t[n].name,t[n].value)}function ve(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t[e]?n.push(t):Object.values(t).forEach((function(t){"object"===ct(t)&&ve(t,e,n)})),n}function ye(t){var e,n=0,i=t.ownerDocument||t.document,r=i.defaultView||i.parentWindow;if(void 0!==r.getSelection){if((e=r.getSelection()).rangeCount>0){var o=r.getSelection().getRangeAt(0),s=o.cloneRange();s.selectNodeContents(t),s.setEnd(o.endContainer,o.endOffset),n=s.toString().length}}else if((e=i.selection)&&"Control"!==e.type){var a=e.createRange(),c=i.body.createTextRange();c.moveToElementText(t),c.setEndPoint("EndToEnd",a),n=c.text.length}return n}function me(t){var e=[];if(3===t.nodeType)e.push(t);else for(var n=t.childNodes,i=0,r=n.length;i<r;++i)e.push.apply(e,me(n[i]));return e}function ge(t,e,n){if(Bt(n)&&(n=e),document.createRange&&window.getSelection){var i=document.createRange();i.selectNodeContents(t);for(var r,o,s=me(t),a=!1,c=0,u=0;u<s.length;u++){if(r=c+(o=s[u]).length,!a&&e>=c&&(e<r||e===r&&u+1<=s.length)&&(i.setStart(o,e-c),a=!0),a&&n<=r){i.setEnd(o,n-c);break}c=r}var l=window.getSelection();l.removeAllRanges(),l.addRange(i)}else if(document.selection&&document.body.createTextRange){var h=document.body.createTextRange();h.moveToElementText(t),h.collapse(!0),h.moveEnd("character",n),h.moveStart("character",e),h.select()}}var be={VERSION:st.version,NODEJS:"nodejs"===window.name,AB:0,BA:1,AUB:2,BUA:3,LAYOUT_NAMES:["AB","BA","AUB","BUA"],DEFAULT_WIDTH:400,DEFAULT_HEIGHT:300,MINIMUM_WIDTH:40,MINIMUM_HEIGHT:40,DEFAULT_NAME:"---",DEFAULT_MARGIN:8,DEFAULT_SHUFFLES:31,DEFAULT_GRID_ELEMENT_SIZE:20,MIN_CELL_SIZE:10,DEFAULT_BG_COLOR:"#C0C0C0",ACTIONS:{ACTION_MATCH:"MATCH",ACTION_PLACE:"PLACE",ACTION_WRITE:"WRITE",ACTION_SELECT:"SELECT",ACTION_HELP:"HELP"},PREVIOUS:0,MAIN:1,END:2,END_ERROR:3,NUM_MSG:4,MSG_TYPE:["previous","initial","final","finalError"],RANDOM_CHARS:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",NUM_COUNTERS:3,MAX_RECORD_LENGTH:180,BoxBase:{REDUCE_FONT_STEP:1,MIN_FONT_SIZE:8,STROKE:1,AC_MARGIN:6,BACK_COLOR:"#C0C0C0",TEXT_COLOR:"black",SHADOW_COLOR:"gray",INACTIVE_COLOR:"gray",ALTERNATIVE_COLOR:"gray",BORDER_COLOR:"black",BORDER_STROKE_WIDTH:.75,MARKER_STROKE_WIDTH:2.75},FILE_TYPES:{image:"gif,jpg,png,jpeg,bmp,ico,svg",audio:"wav,mp3,ogg,oga,au,aiff,flac",video:"avi,mov,mpeg,mp4,ogv,m4v,webm",font:"ttf,otf,eot,woff,woff2",midi:"mid,midi",anim:"swf",xml:"xml"},MIME_TYPES:{xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",wav:"audio/wav",mp3:"audio/mpeg",mp4:"video/mp4",m4v:"video/mp4",ogg:"audio/ogg",oga:"audio/ogg",ogv:"video/ogg",webm:"video/webm",au:"audio/basic",aiff:"audio/x-aiff",flac:"audio/flac",avi:"video/avi",mov:"video/quicktime",mpeg:"video/mpeg",ttf:"application/font-sfnt",otf:"application/font-sfnt",eot:" application/vnd.ms-fontobject",woff:"application/font-woff",woff2:"application/font-woff2",swf:"application/x-shockwave-flash",mid:"audio/midi",midi:"audio/midi"},COMPRESS_IMAGES:!0,VK:{LEFT:37,UP:38,RIGHT:39,DOWN:40},TOUCH_DEVICE:!1,LOAD_TIMEOUT:1e4,BEZIER_POINTS:4,CANVAS_DRAW_FOCUS:void 0!==window.CanvasRenderingContext2D&&"function"==typeof window.CanvasRenderingContext2D.prototype.drawFocusIfNeeded,WHITESPACES:" \f\n\r\t\v \u2028\u2029 \ufeff"};be.SEPARATORS="".concat(be.WHITESPACES,".,;-|"),be.WORD_DELIMITERS="".concat(be.SEPARATORS,"…_<>\"“”«»'´`‘’•~+–—―=%¿?¡!:/\\()[]{}$£€");var we={pkg:ft,settings:be,getMsg:gt,LOG_LEVELS:pt,LOG_PRINT_LABELS:dt,LOG_OPTIONS:vt,init:mt,setLogLevel:bt,log:wt,getBoolean:kt,getVal:At,getNumber:St,getPercent:xt,zp:Ct,getHMStime:Ot,getDateTime:Pt,parseOldDate:Et,cleanOldLanguageTag:Tt,FALSE:0,TRUE:1,DEFAULT:2,getTriState:jt,fillString:_t,isNullOrUndef:Bt,isEquivalent:Rt,getXmlText:It,parseXmlNode:Dt,getXmlNodeText:Nt,reduceTextsToStrings:Mt,cssToString:function(t){return Object.keys(t).reduce((function(e,n){return"".concat(e).concat(n,":").concat(t[n],";")}),"")},checkColor:Vt,colorHasTransparency:qt,cloneObject:Lt,normalizeObject:Ft,getAttr:zt,getValue:Ut,isEmpty:$t,setAttr:Ht,buildObj:Wt,isSeparator:Gt,isWordDelimiter:Jt,stringToWords:Kt,roundTo:Zt,fx:Yt,compareMultipleOptions:Qt,endsWith:Xt,startsWith:te,nSlash:ee,isURL:ne,getBasePath:ie,getRelativePath:re,getPath:oe,getPathPromise:se,$HTML:ae,getSvg:ce,svgToURI:ue,toCssSize:le,getImgClipUrl:he,getRootHead:fe,appendStyleAtHead:pe,attrForEach:de,findParentsWithChild:ve,getCaretCharacterOffsetWithin:ye,getTextNodesIn:me,setSelectionRange:ge},ke=we;function Ae(t){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ae(t)}function Se(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);c=!0);}catch(t){u=!0,r=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return xe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xe(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Ce(){return Ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Te(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Ce.apply(this,arguments)}function Oe(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pe(t,e)}function Pe(t,e){return Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pe(t,e)}function Ee(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Te(t);if(e){var r=Te(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Ae(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Te(t){return Te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Te(t)}function je(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Re(i.key),i)}}function Be(t,e,n){return e&&_e(t.prototype,e),n&&_e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Re(t){var e=function(t,e){if("object"!==Ae(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ae(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ae(e)?e:String(e)}var Ie=function(){function t(e,n,i,r,o){je(this,t),e&&(this.family=e),"number"==typeof n&&(this.size=n),i&&(this.bold=i),r&&(this.italic=r),o&&(this.variant=o),this._metrics={ascent:-1,descent:-1,height:-1}}return Be(t,[{key:"setProperties",value:function(t){return t.attr("family")&&(this.family=t.attr("family")),t.attr("size")&&(this.size=Number(t.attr("size"))),t.attr("bold")&&(this.bold=kt(t.attr("bold"))),t.attr("italic")&&(this.italic=kt(t.attr("italic"))),t.attr("variant")&&(this.variant=t.attr("variant")),this}},{key:"getAttributes",value:function(){return zt(this,["family|Arial","size|17","bold|0","italic|0","variant"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["family","size","bold","italic","variant"])}},{key:"setSize",value:function(t){var e=this.size;return this.size=t,e!==t&&(this._metrics.height=-1),this}},{key:"zoom",value:function(t){return this.setSize(this.size+t)}},{key:"getMetrics",value:function(){var e=this;if(this._metrics.height<0){var n=t.ALREADY_CALCULATED_FONTS.find((function(t){return t.equals(e)}));n&&Object.assign(this._metrics,n._metrics),this._metrics.height<0&&(this._calcHeight(),this._metrics.height>0&&t.ALREADY_CALCULATED_FONTS.push(this))}return this._metrics}},{key:"getHeight",value:function(){return this.getMetrics().height}},{key:"toCss",value:function(t){return t||(t={}),t["font-family"]=this.family,t["font-size"]="".concat(this.size,"px"),this.hasOwnProperty("bold")&&(t["font-weight"]=this.bold?"bold":"normal"),this.hasOwnProperty("italic")&&(t["font-style"]=this.italic?"italic":"normal"),this.hasOwnProperty("variant")&&(t["font-variant"]=this.variant),t}},{key:"cssFont",value:function(){return"".concat(this.italic?"italic ":"normal"," ").concat(""===this.variant?"normal":this.variant," ").concat(this.bold?"bold ":"normal"," ").concat(this.size,"px ").concat(this.family)}},{key:"_calcHeight",value:function(){var t=i()("<span/>").html("Hg").css(this.toCss()),e=i()("<div/>").css({display:"inline-block",width:"1px",height:"0px"}),n=i()("<div/>").append(t,e);i()("body").append(n);try{e.css({verticalAlign:"baseline"}),this._metrics.ascent=e.offset().top-t.offset().top,e.css({verticalAlign:"bottom"}),this._metrics.height=e.offset().top-t.offset().top,this._metrics.descent=this._metrics.height-this._metrics.ascent}finally{n.remove()}return this}},{key:"equals",value:function(t){return this.family===t.family&&this.size===t.size&&this.bold===t.bold&&this.italic===t.italic&&this.variant===t.variant}}],[{key:"checkTree",value:function(e,n){var r=t.SUBSTITUTIONS;n&&n.ownFonts&&n.ownFonts.forEach((function(e){t.ALREADY_LOADED_FONTS.indexOf(e)<0&&ot()&&ot().load&&(ot().load({custom:{families:[e]}}),t.ALREADY_LOADED_FONTS.push(e),delete r[e.trim().toLowerCase()])})),n&&n.fontSubstitutions&&(r=i().extend(Object.create(r),n.fontSubstitutions)),e.jquery?e.find("style[family],font[family]").each((function(e,n){var o=i()(n),s=o.attr("family").trim().toLowerCase();if(s in r){var a=r[s];""!==a&&(t.loadGoogleFont(a),o.attr("family",a))}})):ve(e,"family").forEach((function(e){if("string"==typeof e.family){var n=e.family;if(t.GOOGLEFONTS.includes(n))t.loadGoogleFont(n);else{var i=r[n.trim().toLowerCase()];i&&(t.loadGoogleFont(i),e.family=i)}}}))}},{key:"loadGoogleFont",value:function(e){e&&!t.ALREADY_LOADED_FONTS.includes(e)&&ot()&&ot().load&&(ot().load({google:{families:[e]}}),t.ALREADY_LOADED_FONTS.push(e))}},{key:"loadGoogleFonts",value:function(e){e&&e.forEach&&e.forEach((function(e){return t.loadGoogleFont(e)}))}}]),t}();Ie.ALREADY_CALCULATED_FONTS=[],Ie.ALREADY_LOADED_FONTS=["serif","sans-serif","monospace","cursive","fantasy"],Ie.SUBSTITUTIONS={dialog:"sans-serif",dialoginput:"sans-serif",monospaced:"monospace",sansserif:"sans-serif",abc:"Kalam","a.c.m.e. secret agent":"Permanent Marker","comic sans ms":"Patrick Hand",impact:"Oswald",massallera:"Vibur",memima:"Vibur",memima_n1:"Vibur",memima_n2:"Vibur","memimas-regularalternate":"Vibur",palmemim:"Vibur",zurichcalligraphic:"Felipa"},Ie.GOOGLEFONTS=["Kalam","Permanent Marker","Patrick Hand","Oswald","Vibur","Felipa"],Object.assign(Ie.prototype,{family:"Arial",size:17,bold:0,italic:0,variant:"",_metrics:{ascent:-1,descent:-1,height:-1}});var De=function(){function t(e,n,i,r){je(this,t),e&&(this.c1=e),n&&(this.c2=n),"number"==typeof i&&(this.angle=i%360),"number"==typeof r&&(this.cycles=r)}return Be(t,[{key:"setProperties",value:function(t){return this.c1=Vt(t.attr("source"),"black"),this.c2=Vt(t.attr("dest"),"white"),this.angle=Number(t.attr("angle")||0)%360,this.cycles=Number(t.attr("cycles")||1),this}},{key:"getAttributes",value:function(){return zt(this,["c1","c2","angle|0","cycles|1"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["c1","c2","angle","cycles"])}},{key:"getGradient",value:function(t,e){for(var n=e.getOppositeVertex(),i=t.createLinearGradient(e.pos.x,e.pos.y,n.x,n.y),r=1/Math.max(this.cycles,1),o=0;o<=this.cycles;o++)i.addColorStop(o*r,o%2?this.c1:this.c2);return i}},{key:"getCss",value:function(){for(var t="linear-gradient(".concat(this.angle+90,"deg, ").concat(this.c1,", ").concat(this.c2),e=1;e<this.cycles;e++)t="".concat(t,", ").concat(e%2>0?this.c1:this.c2);return"".concat(t,")")}},{key:"hasTransparency",value:function(){return qt(this.c1)||qt(this.c2)}}]),t}();Object.assign(De.prototype,{c1:"white",c2:"black",angle:0,cycles:1});var Ne=function(){function t(e,n,i,r){je(this,t),"number"==typeof e&&(this.lineWidth=e),n&&(this.lineCap=n),i&&(this.lineJoin=i),"number"==typeof r&&(this.miterLimit=r)}return Be(t,[{key:"getAttributes",value:function(){return zt(this,["lineWidth|1","lineCap|butt","lineJoin|miter","miterLimit|10"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["lineWidth","lineCap","lineJoin","miterLimit"])}},{key:"setStroke",value:function(t){return t.lineWidth=this.lineWidth,t.lineCap=this.lineCap,t.lineJoin=this.lineJoin,t.miterLimit=this.miterLimit,t}}]),t}();Object.assign(Ne.prototype,{lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10});var Me=function(){function t(e,n){je(this,t),e instanceof t?(this.x=e.x,this.y=e.y):(this.x=e||0,this.y=n||0)}return Be(t,[{key:"setProperties",value:function(t){return this.x=Number(t.attr("x")),this.y=Number(t.attr("y")),this}},{key:"getAttributes",value:function(){return zt(this,["x","y"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["x","y"])}},{key:"moveBy",value:function(t){return this.x+=t.x||t.width||0,this.y+=t.y||t.height||0,this}},{key:"moveTo",value:function(t,e){return"number"==typeof t?(this.x=t,this.y=e):(this.x=t.x,this.y=t.y),this}},{key:"multBy",value:function(t){return this.x*=t.x||t.width||0,this.y*=t.y||t.height||0,this}},{key:"equals",value:function(t){return this.x===t.x&&this.y===t.y}},{key:"distanceTo",value:function(t){return Math.sqrt(Math.pow(this.x-t.x,2),Math.pow(this.y-t.y,2))}},{key:"clone",value:function(){return new t(this)}}]),t}();Object.assign(Me.prototype,{x:0,y:0});var Ve=function(){function t(e,n){je(this,t),e instanceof Me&&n instanceof Me?(this.width=n.x-e.x,this.height=n.y-e.y):(this.width=e||0,this.height=n||0)}return Be(t,[{key:"setProperties",value:function(t){return this.width=Number(t.attr("width")),this.height=Number(t.attr("height")),this}},{key:"getAttributes",value:function(){return zt(this,["width","height"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["width","height"])}},{key:"equals",value:function(t){return this.width===t.width&&this.height===t.height}},{key:"multBy",value:function(t){return this.width*=t.x||t.width||0,this.height*=t.y||t.height||0,this}},{key:"setDimension",value:function(e,n){return e instanceof t&&(n=e.height,e=e.width),this.width=e,this.height=n,this}},{key:"getSurface",value:function(){return this.width*this.height}}]),t}();Object.assign(Ve.prototype,{width:0,height:0});var qe,Le,Fe,ze=function(){function t(e){je(this,t),this.pos=e||new Me}return Be(t,[{key:"moveBy",value:function(t){return this.pos.moveBy(t),this}},{key:"moveTo",value:function(t){return this.pos.moveTo(t),this}},{key:"getBounds",value:function(){return new Ue(this.pos)}},{key:"equals",value:function(t){return this.pos.equals(t.pos)}},{key:"scaleBy",value:function(t){return this}},{key:"getShape",value:function(t){return this.clone().scaleBy(t.dim).moveBy(t.pos)}},{key:"contains",value:function(t){return!1}},{key:"intersects",value:function(t){return!1}},{key:"fill",value:function(t,e){return t.save(),e&&e.getSurface()>0&&(t.beginPath(),t.rect(e.pos.x,e.pos.y,e.dim.width,e.dim.height),t.clip()),this.preparePath(t),t.fill(),t.restore(),t}},{key:"stroke",value:function(t){return this.preparePath(t),t.stroke(),t}},{key:"preparePath",value:function(t){return t}},{key:"clip",value:function(t,e){return this.preparePath(t),t.clip(e||"nonzero"),t}},{key:"isRect",value:function(){return!1}},{key:"toString",value:function(){return"Shape enclosed in ".concat(this.getBounds().getCoords())}},{key:"setAttributes",value:function(e){return t.buildShape(e)}}],[{key:"buildShape",value:function(t){var e="rect"===t.type&&Ue||"ellipse"===t.type&&$e||"path"===t.type&&He||null;if(e)return(new e).setAttributes(t);console.log("unknown shape:",t)}}]),t}();Object.assign(ze.prototype,(qe={type:"shape",pos:new Me},Fe="shape",(Le=Re(Le="type"))in qe?Object.defineProperty(qe,Le,{value:Fe,enumerable:!0,configurable:!0,writable:!0}):qe[Le]=Fe,qe));var Ue=function(t){Oe(n,t);var e=Ee(n);function n(t,i,r,o){var s;je(this,n);var a=t,c=i;return t instanceof n?(c=new Ve(t.dim.width,t.dim.height),a=new Me(t.pos.x,t.pos.y)):t instanceof Me?(a=new Me(t.x,t.y),i instanceof Ve&&(c=new Ve(i.width,i.height))):t instanceof Array?(a=new Me(t[0],t[1]),c=new Ve(t[2]-t[0],t[3]-t[1])):"number"==typeof r&&"number"==typeof o&&(a=new Me(t,i),c=new Ve(r,o)),(s=e.call(this,a)).dim=c instanceof Ve?c:c instanceof Me?new Ve(c.x-s.pos.x,c.y-s.pos.y):new Ve,s.type="rect",s}return Be(n,[{key:"getBounds",value:function(){return this}},{key:"setBounds",value:function(t){return t||(t=new n),this.pos.x=t.pos.x,this.pos.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height,this}},{key:"equals",value:function(t){return t instanceof n&&this.pos.equals(t.pos)&&this.dim.equals(t.dim)}},{key:"clone",value:function(){return new n(this)}},{key:"scaleBy",value:function(t){return this.pos.multBy(t),this.dim.multBy(t),this}},{key:"grow",value:function(t,e){return this.pos.x-=t,this.pos.y-=e,this.dim.width+=2*t,this.dim.height+=2*e,this}},{key:"getOppositeVertex",value:function(){return new Me(this.pos.x+this.dim.width,this.pos.y+this.dim.height)}},{key:"add",value:function(t){var e=this.getOppositeVertex(),n=t.getBounds().getOppositeVertex();return this.pos.moveTo(Math.min(this.pos.x,t.getBounds().pos.x),Math.min(this.pos.y,t.getBounds().pos.y)),this.dim.setDimension(Math.max(e.x,n.x)-this.pos.x,Math.max(e.y,n.y)-this.pos.y),this}},{key:"contains",value:function(t){var e=this.getOppositeVertex();return t.x>=this.pos.x&&t.x<=e.x&&t.y>=this.pos.y&&t.y<=e.y}},{key:"intersects",value:function(t){var e=this.pos,n=this.getOppositeVertex(),i=t.pos,r=t.getOppositeVertex();return r.x>=e.x&&i.x<=n.x&&r.y>=e.y&&i.y<=n.y}},{key:"preparePath",value:function(t){return t.beginPath(),t.rect(this.pos.x,this.pos.y,this.dim.width,this.dim.height),t}},{key:"getSurface",value:function(){return this.dim.getSurface()}},{key:"isEmpty",value:function(){return 0===this.getSurface()}},{key:"isRect",value:function(){return!0}},{key:"toString",value:function(){return"Rectangle ".concat(this.getCoords())}},{key:"getCoords",value:function(){return"[".concat(Math.round(this.pos.x),",").concat(Math.round(this.pos.y),",").concat(Math.round(this.pos.x+this.dim.width),",").concat(Math.round(this.pos.y+this.dim.height),"]")}},{key:"getAttributes",value:function(){return zt(this,["type","pos","dim"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["type",{key:"pos",fn:Me},{key:"dim",fn:Ve}])}}]),n}(ze);Object.assign(Ue.prototype,{type:"rect",dim:new Ve});var $e=function(t){Oe(n,t);var e=Ee(n);function n(t,i,r,o){return je(this,n),e.call(this,t,i,r,o)}return Be(n,[{key:"preparePath",value:function(t){var e=.5522848,n=e*this.dim.width/2,i=e*this.dim.height/2,r=this.pos.x+this.dim.width,o=this.pos.y+this.dim.height,s=this.pos.x+this.dim.width/2,a=this.pos.y+this.dim.height/2;return t.beginPath(),t.moveTo(this.pos.x,a),t.bezierCurveTo(this.pos.x,a-i,s-n,this.pos.y,s,this.pos.y),t.bezierCurveTo(s+n,this.pos.y,r,a-i,r,a),t.bezierCurveTo(r,a+i,s+n,o,s,o),t.bezierCurveTo(s-n,o,this.pos.x,a+i,this.pos.x,a),t.closePath(),t}},{key:"contains",value:function(t){var e=Ce(Te(n.prototype),"contains",this).call(this,t);if(e){var i=this.dim.width/2,r=this.dim.height/2,o=this.pos.x+i,s=this.pos.y+r;e=Math.pow(t.x-o,2)/Math.pow(i,2)+Math.pow(t.y-s,2)/Math.pow(r,2)<=1}return e}},{key:"getSurface",value:function(){return Math.PI*this.dim.width/2*this.dim.height/2}},{key:"equals",value:function(t){return t instanceof n&&Ce(Te(n.prototype),"equals",this).call(this,t)}},{key:"clone",value:function(){return new n(this.pos,this.dim)}},{key:"isRect",value:function(){return!1}},{key:"toString",value:function(){return"Ellipse enclosed in ".concat(this.getCoords())}}]),n}(Ue);Object.assign($e.prototype,{type:"ellipse"});var He=function(t){Oe(n,t);var e=Ee(n);function n(t){var i;return je(this,n),i=e.call(this),t&&i.setStrokes(t),i}return Be(n,[{key:"setStrokes",value:function(t){var e=this;return this.strokes=[],t.forEach((function(t){return e.strokes.push(new We(t.type||t.action,t.points||t.data))})),this.enclosing=new Ue,this.enclosingPoints=[],this.calcEnclosingRect(),this.pos=this.enclosing.pos,this}},{key:"clone",value:function(){return new n(this.strokes.map((function(t){return t.clone()})))}},{key:"addStroke",value:function(t){return this.strokes.push(t),this}},{key:"calcEnclosingRect",value:function(){var t=this;this.enclosingPoints=[];var e=new Me;this.strokes.forEach((function(n){n.getEnclosingPoints(e).forEach((function(n){e=new Me(n),t.enclosingPoints.push(e)}))}));var n=this.enclosingPoints.length;n>1&&this.enclosingPoints[0].equals(this.enclosingPoints[n-1])&&(this.enclosingPoints.pop(),n--);for(var i=new Me(this.enclosingPoints[0]),r=new Me(this.enclosingPoints[0]),o=1;o<n;o++){var s=this.enclosingPoints[o];i.x=Math.min(s.x,i.x),i.y=Math.min(s.y,i.y),r.x=Math.max(s.x,r.x),r.y=Math.max(s.y,r.y)}return this.enclosing.setBounds(new Ue(i,new Ve(i,r))),this.enclosing}},{key:"getBounds",value:function(){return this.enclosing}},{key:"moveBy",value:function(t){return this.strokes.forEach((function(e){return e.moveBy(t)})),this.enclosingPoints.forEach((function(e){return e.moveBy(t)})),this.enclosing.moveBy(t),this}},{key:"moveTo",value:function(t){return this.moveBy(new Ve(t.x-this.pos.x,t.y-this.pos.y))}},{key:"equals",value:function(t){return!1}},{key:"scaleBy",value:function(t){return this.strokes.forEach((function(e){return e.multBy(t)})),this.enclosingPoints.forEach((function(e){return e.multBy(t)})),this.enclosing.scaleBy(t),this}},{key:"contains",value:function(t){var e=this.enclosing.contains(t);if(e){for(var n=this.enclosingPoints.length,i=0,r=0,o=this.enclosingPoints[0],s=1;s<=n;s++){var a=this.enclosingPoints[s%n];t.y>Math.min(o.y,a.y)&&t.y<=Math.max(o.y,a.y)&&t.x<=Math.max(o.x,a.x)&&o.y!==a.y&&(i=(t.y-o.y)*(a.x-o.x)/(a.y-o.y)+o.x,(o.x===a.x||t.x<=i)&&r++),o=a}r%2==0&&(e=!1)}return e}},{key:"intersects",value:function(t){return this.enclosing.intersects(t)}},{key:"preparePath",value:function(t){return t.beginPath(),this.strokes.forEach((function(e){return e.stroke(t)})),t}},{key:"getAttributes",value:function(){return{type:this.type,strokes:this.strokes.map((function(t){return t.getAttributes()})).join("|")}}},{key:"setAttributes",value:function(t){var e=t.strokes.split("|").map((function(t){var e=Se(t.split(":"),2),n=e[0],i=e[1];return new We(n,i?i.split(","):[])}));return this.setStrokes(e)}}]),n}(ze);Object.assign(He.prototype,{type:"path",strokes:[],enclosing:new Ue,enclosingPoints:[]});var We=function(){function t(e,n){if(je(this,t),this.type=e,n&&n.length>0)if(n[0]instanceof Me)this.points=n.map((function(t){return new Me(t)}));else{this.points=[];for(var i=0;i<n.length;i+=2)this.points.push(new Me(n[i],n[i+1]))}}return Be(t,[{key:"clone",value:function(){return new t(this.type,this.points)}},{key:"moveBy",value:function(t){return this.points&&this.points.forEach((function(e){return e.moveBy(t)})),this}},{key:"multBy",value:function(t){return this.points&&this.points.forEach((function(e){return e.multBy(t)})),this}},{key:"stroke",value:function(t){switch(this.type){case"M":t.moveTo(this.points[0].x,this.points[0].y);break;case"L":t.lineTo(this.points[0].x,this.points[0].y);break;case"Q":t.quadraticCurveTo(this.points[0].x,this.points[0].y,this.points[1].x,this.points[1].y);break;case"B":t.bezierCurveTo(this.points[0].x,this.points[0].y,this.points[1].x,this.points[1].y,this.points[2].x,this.points[2].y);break;case"X":t.closePath()}return t}},{key:"getEnclosingPoints",value:function(e){var n=[];switch(this.type){case"M":case"L":n.push(this.points[0]);break;case"Q":(n=t.getQuadraticPoints(e,this.points[0],this.points[1])).push(this.points[1]);break;case"B":(n=t.getCubicPoints(e,this.points[0],this.points[1],this.points[2])).push(this.points[2])}return n}},{key:"getAttributes",value:function(){return"".concat(this.type,":").concat(this.points?this.points.map((function(t){return"".concat(Yt(t.x),",").concat(Yt(t.y))})).join(","):"")}}],[{key:"getQuadraticPoints",value:function(t,e,n,i){i||(i=be.BEZIER_POINTS);for(var r=[],o=new Me,s=new Me,a=0;a<i;a++){var c=(a+1)/(i+1);o.x=t.x+(e.x-t.x)*c,o.y=t.y-(t.y-e.y)*c,s.x=e.x+(n.x-e.x)*c,s.y=e.y+(n.y-e.y)*c,r.push(new Me(o.x+(s.x-o.x)*c,o.y-(o.y-s.y)*c))}return r}},{key:"getCubicPoints",value:function(e,n,i,r,o){var s=[];o||(o=be.BEZIER_POINTS);for(var a=t.getQuadraticPoints(e,n,i,o),c=t.getQuadraticPoints(n,i,r,o),u=0;u<o;u++){var l=(u+1)/(o+1);s.push(new Me(a[u].x+(c[u].x-a[u].x)*l,a[u].y-(a[0].y-c[0].y)*l))}return s}}]),t}();Object.assign(We.prototype,{type:"X",points:null});var Ge=function(){function t(e,n){je(this,t),this.name=e,this.actionPerformed=n,this._statusListeners=[]}return Be(t,[{key:"actionPerformed",value:function(t,e){return this}},{key:"processEvent",value:function(t){return this.actionPerformed(this,t)}},{key:"addStatusListener",value:function(t){this._statusListeners.push(t)}},{key:"removeStatusListener",value:function(t){this._statusListeners=this._statusListeners.map((function(e){return e!==t}))}},{key:"setEnabled",value:function(t){var e=this;return this.enabled=t,this._statusListeners.forEach((function(t){return t.call(e,e)})),this}}]),t}();Object.assign(Ge.prototype,{name:null,description:null,enabled:!1,_statusListeners:null});var Je=function(){function t(e,n,i){je(this,t),this.actionPerformed=e,this.interval=n,this.setEnabled(!0===i)}return Be(t,[{key:"actionPerformed",value:function(t){return this}},{key:"processTimer",value:function(t){return this.ticks++,this.repeats||this.stop(),this.actionPerformed.call(this)}},{key:"setEnabled",value:function(t,e){var n=this;if(e||(this.ticks=0),!t||null===this.timer)return t?this.timer=window.setInterval((function(){return n.processTimer(null)}),this.interval):null!==this.timer&&(window.clearInterval(this.timer),this.timer=null),this}},{key:"isRunning",value:function(){return null!==this.timer}},{key:"start",value:function(t){return this.setEnabled(!0,t)}},{key:"stop",value:function(t){return this.setEnabled(!1,t)}}]),t}();Object.assign(Je.prototype,{interval:0,ticks:0,timer:null,repeats:!0});var Ke=function(t){Oe(n,t);var e=Ee(n);function n(t,i,r,o){return je(this,n),e.call(this,t,i,r,o)}return Be(n,[{key:"invalidate",value:function(t){return t?null===this.invalidatedRect?this.invalidatedRect=t.clone():this.invalidatedRect.add(t):this.invalidatedRect=null,this}},{key:"update",value:function(){return this.updateContent(this.invalidatedRect),this.invalidatedRect=null,this}},{key:"updateContent",value:function(t){return this}}]),n}(Ue);Object.assign(Ke.prototype,{invalidatedRect:null});var Ze={Font:Ie,Gradient:De,Stroke:Ne,Point:Me,Dimension:Ve,Shape:ze,Rectangle:Ue,Ellipse:$e,Path:He,PathStroke:We,Action:Ge,Timer:Je,Container:Ke};function Ye(t){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ye(t)}function Qe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xe(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,en(i.key),i)}}function tn(t,e,n){return e&&Xe(t.prototype,e),n&&Xe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function en(t){var e=function(t,e){if("object"!==Ye(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ye(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ye(e)?e:String(e)}var nn=function(){function t(e){var n=this;Qe(this,t),this.player=e,this.sequenceStack=[],window&&window.history&&e.options.browserHistory&&(this.browserHistory=!0,i()(window).on("popstate",(function(t){var e=t.originalEvent.state;e&&n.processPopStateEvent(e)})))}return tn(t,[{key:"processPopStateEvent",value:function(t){wt("info","Processing History popstate event with state:",t),this.processingPop=!0,t.projectPath===this.player.project.path&&Rt(t.fullZipPath,this.player.zip?this.player.zip.fullZipPath:null)?this.player.load(null,t.activity,null):this.player.load(t.fullZipPath||t.projectPath,t.activity,null)}},{key:"pushBrowserHistory",value:function(){if(this.browserHistory){if(this.processingPop)return void(this.processingPop=!1);var t=this.player.project.activitySequence,e=t.currentAct,n=this.player.actPanel.act.name||"No name",i=new this.HistoryElement(this.player.project.path,t.getSequenceForElement(e),e,this.player.zip?this.player.zip.fullZipPath:null);window.history.state?window.history.pushState(i,n):window.history.replaceState(i,n)}}},{key:"storedElementsCount",value:function(){return this.sequenceStack.length}},{key:"clearHistory",value:function(){this.sequenceStack=[0]}},{key:"push",value:function(){if(null!==this.player.project&&null!==this.player.project.path){var t=this.player.project.activitySequence,e=t.currentAct;if(e>=0){if(this.sequenceStack.length>0){var n=this.sequenceStack[this.sequenceStack.length-1];if(n.projectPath===this.player.project.path&&n.activity===e)return}this.sequenceStack.push(new this.HistoryElement(this.player.project.path,t.getSequenceForElement(e),e,this.player.zip?this.player.zip.fullZipPath:null))}}}},{key:"pop",value:function(){if(this.sequenceStack.length>0){var t=this.sequenceStack.pop();t.projectPath===this.player.project.path&&Rt(t.fullZipPath,this.player.zip?this.player.zip.fullZipPath:null)?this.player.load(null,t.activity,null):this.testMode&&null!==t.projectPath&&t.projectPath.length>0?wt("info",'At this point, a jump to "'.concat(t.projectPath,'" should be performed.')):this.player.load(t.fullZipPath||t.projectPath,t.activity,null)}return!0}},{key:"processJump",value:function(t,e){var n=!1;if(null!==t&&null!==this.player.project)switch(t.action){case"STOP":break;case"RETURN":if(this.sequenceStack.length>0||!this.player.options.returnAsExit){n=this.pop();break}case"EXIT":this.testMode?wt("info","At this point, the program should exit."):this.player.exit(t.sequence);break;case"JUMP":if(t.sequence||t.projectPath)this.testMode&&null!==t.projectPath&&t.projectPath.length>0?wt("info",'At this point, a jump to "'.concat(t.projectPath,'" should be performed.')):n=this.jumpToSequence(t.sequence,t.projectPath?oe(this.player.project.basePath,t.projectPath):null,e);else{var i=this.player.project.activitySequence.getElement(t.actNum,!0);null!==i&&(e&&this.push(),this.player.load(null,null,i.activity),n=!0)}}return n}},{key:"jumpToSequence",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Bt(t)&&Bt(e))return!1;if(Bt(e)&&(e=this.player.project.path),this.sequenceStack.length>0){var i=this.sequenceStack[this.sequenceStack.length-1];if(!Bt(t)&&e===i.projectPath){var r=t===i.sequence;if(e===this.player.project.path){var o=this.player.project.activitySequence.getElement(i.activity,!1);r=null!==o&&t===o.tag}if(r)return this.pop()}}return n&&this.push(),e===this.player.project.path?this.player.load(null,t,null):this.player.load(e,t,null),!0}}]),t}();Object.assign(nn.prototype,{player:null,sequenceStack:[],testMode:!1,browserHistory:!1,processingPop:!1,HistoryElement:tn((function t(e,n,i,r){Qe(this,t),this.projectPath=e,this.sequence=n,this.activity=i,this.fullZipPath=r}))});var rn=nn;function on(t){return on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},on(t)}function sn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,an(i.key),i)}}function an(t){var e=function(t,e){if("object"!==on(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==on(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===on(e)?e:String(e)}var cn=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&(this.enabled=!0),e&&(this.seconds=e),this.chunks=[]}var e,n,i;return e=t,(n=[{key:"play",value:function(){this.stop(),this.mediaPlayer?(this.mediaPlayer.currentTime=0,this.mediaPlayer.play()):this.playWhenFinished=!0}},{key:"stop",value:function(){this.mediaRecorder&&"recording"===this.mediaRecorder.state?this.mediaRecorder.stop():this.mediaPlayer&&!this.mediaPlayer.paused&&this.mediaPlayer.pause()}},{key:"record",value:function(t){var e=this;this.mediaRecorder&&"recording"===this.mediaRecorder.state?this.mediaRecorder.stop():this.enabled&&(this.stop(),this.mediaPlayer=null,navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(n){e.mediaRecorder=new MediaRecorder(n),e.mediaRecorder.ondataavailable=function(t){return e.chunks.push(t.data)},e.mediaRecorder.onerror=function(t){wt("error","Error recording audio: ".concat(t)),e.mediaRecorder=null},e.mediaRecorder.onstart=function(){wt("debug","Recording audio started"),e.visualFeedbak(!0,t)},e.mediaRecorder.onstop=function(){wt("debug","Recording audio finished"),e.visualFeedbak(!1,t),e.timeoutID&&(window.clearTimeout(e.timeoutID),e.timeoutID=null);var n={};e.chunks.length>0&&e.chunks[0].type&&(n.type=e.chunks[0].type);var i=new Blob(e.chunks,n);e.chunks=[],e.mediaPlayer=document.createElement("audio"),e.mediaPlayer.src=URL.createObjectURL(i),e.mediaPlayer.pause(),e.mediaRecorder=null,e.playWhenFinished&&(e.playWhenFinished=!1,e.mediaPlayer.play())},e.mediaRecorder.onwarning=function(t){return wt("warn","Warning recording audio: ".concat(t))},e.playWhenFinished=!1,e.mediaRecorder.start(),e.timeoutID=window.setTimeout((function(){e.mediaRecorder,e.mediaRecorder.stop()}),1e3*e.seconds)})).catch((function(n){wt("error",n.toString()),e.visualFeedbak(!1,t)})))}},{key:"visualFeedbak",value:function(t,e){e&&e.css("cursor",t?"progress":"inherit")}},{key:"clear",value:function(){this.stop(),this.mediaPlayer=null}}])&&sn(e.prototype,n),i&&sn(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(cn.prototype,{enabled:!1,seconds:20,mediaRecorder:null,chunks:null,mediaPlayer:null,timeoutID:null,playWhenFinished:!1}),cn.MAX_RECORD_LENGTH=180;var un=cn;function ln(t){return ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ln(t)}function hn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,fn(i.key),i)}}function fn(t){var e=function(t,e){if("object"!==ln(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ln(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ln(e)?e:String(e)}var pn=function(){function t(e,n,i){switch(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.mc=e,this.ps=i,e.type){case"RECORD_AUDIO":t.AUDIO_BUFFERS&&(this.clearAudioBuffer(e.recBuffer),t.AUDIO_BUFFERS[e.recBuffer]=new un(e.length));case"PLAY_RECORDED_AUDIO":this.useAudioBuffer=!0;break;case"PLAY_AUDIO":case"PLAY_VIDEO":case"PLAY_MIDI":this.mbe=n.getElement(e.file,!0)}}var e,n,r;return e=t,(n=[{key:"realize",value:function(){var t=this;this.mbe&&this.mbe.build((function(e){e.data&&e.data.pause&&!e.data.paused&&!e.data.ended&&e.data.currentTime&&e.data.pause(),"video"!==e.type&&"anim"!==e.type||!e.data||(t.$visualComponent=i()(e.data),t.$visualComponent.css("z-index",20))}),this.ps,!1,this.mc.level)}},{key:"playNow",value:function(e){var n=this;if(this.useAudioBuffer){if(t.AUDIO_BUFFERS){var r=this.ps&&this.ps.$div,o=t.AUDIO_BUFFERS[this.mc.recBuffer];o&&("RECORD_AUDIO"===this.mc.type?o.record(r):o.play())}}else this.mbe&&this.mbe.build((function(){if(n.mbe.data){if("midi"===n.mbe.type)n.mbe.data.playTo=n.mc.to||0;else{var t=!1,e=i()(n.mbe.data);e.off(),n.mc.to>0&&e.on("timeupdate",(function(){t&&n.mbe.data.currentTime>=n.mc.to/1e3&&(e.off("timeupdate"),n.mbe.data.pause())})),t=!0}n.mbe.data.paused||n.mbe.data.ended||!n.mbe.data.currentTime||n.mbe.data.pause(),n.mbe.data.currentTime=n.mc.from>0?n.mc.from/1e3:0,n.mbe.data.play()}}),this.ps,!0,this.mc.level)}},{key:"play",value:function(t){this.stopAllAudioBuffers(),this.playNow(t)}},{key:"stop",value:function(){this.useAudioBuffer?this.stopAudioBuffer(this.mc.recBuffer):this.mbe&&this.mbe.data&&this.mbe.data.pause&&!this.mbe.data.paused&&!this.mbe.data.ended&&this.mbe.data.currentTime&&this.mbe.data.pause()}},{key:"clear",value:function(){this.stop(),this.useAudioBuffer&&this.clearAudioBuffer(this.mc.recBuffer)}},{key:"clearAudioBuffer",value:function(e){t.AUDIO_BUFFERS&&e>=0&&e<t.AUDIO_BUFFERS.length&&t.AUDIO_BUFFERS[e]&&(t.AUDIO_BUFFERS[e].clear(),t.AUDIO_BUFFERS[e]=null)}},{key:"clearAllAudioBuffers",value:function(){var e=this;t.AUDIO_BUFFERS&&t.AUDIO_BUFFERS.forEach((function(t,n){return e.clearAudioBuffer(n)}))}},{key:"countActiveBuffers",value:function(){return t.AUDIO_BUFFERS?t.AUDIO_BUFFERS.reduce((function(t,e){return t+e?1:0}),0):0}},{key:"stopAllAudioBuffers",value:function(){t.AUDIO_BUFFERS&&t.AUDIO_BUFFERS.forEach((function(t){return t?t.stop():null}))}},{key:"stopAudioBuffer",value:function(e){t.AUDIO_BUFFERS&&e>=0&&e<t.AUDIO_BUFFERS.length&&t.AUDIO_BUFFERS[e]&&t.AUDIO_BUFFERS[e].stop()}},{key:"checkVisualComponentBounds",value:function(t){}},{key:"setVisualComponentVisible",value:function(t){}},{key:"linkTo",value:function(t){this.bx=t,this.bx&&this.$visualComponent&&this.bx.setHostedComponent(this.$visualComponent)}}])&&hn(e.prototype,n),r&&hn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(pn.prototype,{mc:null,ps:null,bx:null,$visualComponent:null,useAudioBuffer:!1,mbe:null}),pn.REC_ENABLED="undefined"!=typeof MediaRecorder&&"undefined"!=typeof navigator,pn.REC_ENABLED&&(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia),pn.AUDIO_BUFFERS=pn.REC_ENABLED?[]:null;var dn=pn;function vn(t){return vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vn(t)}function yn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,mn(i.key),i)}}function mn(t){var e=function(t,e){if("object"!==vn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==vn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===vn(e)?e:String(e)}var gn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.players=[]}var e,n,i;return e=t,(n=[{key:"createActiveMediaPlayer",value:function(t,e,n){var i=null;switch(t.type){case"RECORD_AUDIO":if(t.length<=0||t.length>=be.MAX_RECORD_LENGTH)break;case"PLAY_RECORDED_AUDIO":if(t.recBuffer<0||t.recBuffer>=10)break;case"PLAY_AUDIO":case"PLAY_MIDI":case"PLAY_VIDEO":i=new dn(t,e,n)}return null!==i&&this.players.push(i),i}},{key:"getActiveMediaPlayer",value:function(t,e,n){return this.players.find((function(e){return e.mc===t||e.mc.isEquivalent(t)}))||this.createActiveMediaPlayer(t,e,n)}},{key:"removeActiveMediaPlayer",value:function(t){var e=this.players.findIndex((function(e){return e.mc===t}));e>=0&&(this.players[e].clear(),this.players.splice(e,1))}},{key:"realizeAll",value:function(){this.players.forEach((function(t){return t.realize()}))}},{key:"stopAll",value:function(t){void 0===t&&(t=-1),this.players.forEach((function(e){(-1===t||null!==e.mc&&e.mc.level<=t)&&e.stop()}))}},{key:"removeAll",value:function(){this.players.forEach((function(t){return t.clear()})),this.players.length=0,dn.prototype.clearAllAudioBuffers()}}])&&yn(e.prototype,n),i&&yn(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(gn.prototype,{players:[]});var bn=gn;function wn(t){return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(t)}function kn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,An(i.key),i)}}function An(t){var e=function(t,e){if("object"!==wn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==wn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===wn(e)?e:String(e)}function Sn(){return Sn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pn(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Sn.apply(this,arguments)}function xn(t,e){return xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xn(t,e)}function Cn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Pn(t);if(e){var r=Pn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===wn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return On(t)}(this,n)}}function On(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pn(t){return Pn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pn(t)}var En=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xn(t,e)}(s,t);var e,n,r,o=Cn(s);function s(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=o.call(this)).ps=t,null!==n&&(e.name=n),e.options=r,e.options.skinId&&(e.skinId=e.options.skinId),!s.registerStyleSheet(e.skinId,t)){var a=e._getStyleSheets("default"),c=e._getStyleSheets("twoThirds");c.length>0&&(a+=" @media (max-width:".concat(e.twoThirdsMedia.width,"px),(max-height:").concat(e.twoThirdsMedia.height,"px){").concat(c,"}"));var u=e._getStyleSheets("half");u.length>0&&(a+=" @media (max-width:".concat(e.halfMedia.width,"px),(max-height:").concat(e.halfMedia.height,"px){").concat(u,"}")),pe(a.replace(/\.ID/g,".".concat(e.skinId)),t)}var l="";e.$div=i()("<div/>",{class:e.skinId}),e.$playerCnt=i()("<div/>",{class:"JClicPlayerCnt"}),e.$progress=i()("<progress/>",{class:"progressBar"}).css({display:"none"}),e.$waitPanel=i()("<div/>").css({display:"none","background-color":"rgba(255, 255, 255, .60)","z-index":99}).append(i()("<div/>",{class:"waitPanel"}).css({display:"flex","flex-direction":"column"}).append(i()("<div/>",{class:"animImgBox"}).append(i()(e.waitImgBig),i()(e.waitImgSmall))).append(e.$progress)),e.$playerCnt.append(e.$waitPanel),e.buttons=Lt(s.prototype.buttons),e.counters=Lt(s.prototype.counters),e.msgArea=Lt(s.prototype.msgArea),e.$dlgOverlay=i()("<div/>",{class:"dlgOverlay"}).css({"z-index":98,position:"fixed",left:0,top:0,width:"100%",height:"100%",display:"none","background-color":"rgba(30,30,30,0.7)"}).on("click",(function(){return e._isModalDlg||e._closeDlg(!0),!1}));var h=i()("<div/>",{class:"dlgDiv",role:"dialog","aria-labelledby":t.getUniqueId("ReportsLb"),"aria-describedby":t.getUniqueId("ReportsCnt")}).css({display:"inline-block",position:"relative",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}).on("click",(function(){return!1}));return e.$dlgMainPanel=i()("<div/>",{class:"dlgMainPanel",id:t.getUniqueId("ReportsCnt")}),e.$dlgBottomPanel=i()("<div/>",{class:"dlgBottomPanel",role:"navigation"}),e.$div.append(e.$playerCnt,e.$dlgOverlay.append(h.append(e.$dlgMainPanel,e.$dlgBottomPanel))),l=gt("JClic logo"),e.$infoHead=i()("<div/>",{class:"infoHead"}).append(i()("<div/>",{class:"headTitle unselectableText"}).append(i()(e.appLogo,{"aria-label":l}).css({width:"1.5em",height:"1.5em","vertical-align":"bottom"}).on("dblclick",(function(){bt("all"),wt("trace",'Log level set to "trace"')}))).append(i()("<span/>").html("JClic.js"))).append(i()("<p/>").css({"margin-top":0,"margin-left":"3.5em"}).append(i()("<a/>",{href:"http://clic.xtec.cat/repo/index.html?page=info"}).html("http://clic.xtec.cat")).append(i()("<br>")).append(i()("<span/>").html("".concat(gt("Version")," ").concat(be.VERSION)))),e.$reportsPanel=i()("<div/>",{class:"reportsPanel",role:"document"}),l=gt("Copy data to clipboard"),e.$copyBtn=i()("<button/>",{title:l,"aria-label":l}).append(i()(e.copyIcon).css({width:"26px",height:"26px"})).on("click",(function(){nt([new Y({"text/plain":"===> ".concat(gt("The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor")," <==="),"text/html":e.$reportsPanel.html()})]).then((function(){return e.$copyBtn.parent().append(i()("<div/>",{class:"smallPopup"}).html(gt("The data has been copied to clipboard")).fadeIn().delay(3e3).fadeOut((function(){i()(this).remove()})))})).catch((function(t){return e.$copyBtn.parent().append(i()("<div/>",{class:"smallPopup"}).html("ERROR: Unable to write data into the clipboard: ".concat(t)).fadeIn().delay(3e3).fadeOut((function(){i()(this).remove()})))}))})),l=gt("Close"),e.$closeDlgBtn=i()("<button/>",{title:l,"aria-label":l}).append(i()(e.closeDialogIcon).css({width:"26px",height:"26px"})).on("click",(function(){return e._closeDlg(!0)})),l=gt("OK"),e.$okDlgBtn=i()("<button/>",{title:l,"aria-label":l}).append(i()(e.okDialogIcon).css({width:"26px",height:"26px"})).on("click",(function(){return e._closeDlg(!0)})),l=gt("Cancel"),e.$cancelDlgBtn=i()("<button/>",{title:l,"aria-label":l}).append(i()(e.closeDialogIcon).css({width:"26px",height:"26px"})).on("click",(function(){return e._closeDlg(!1)})),s.skinStack.push(On(e)),e}return e=s,n=[{key:"_getStyleSheets",value:function(){return"default"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default")?this.basicCSS+this.waitAnimCSS+this.reportsCSS:""}},{key:"attach",value:function(t){this.detach(),null!==t&&null!==t.skin&&t.skin.detach(),this.player=t,this.$playerCnt.prepend(t.$div),this.setSkinSizes(),t.$mainContainer.append(this.$div)}},{key:"setSkinSizes",value:function(t){var e,n={},i=(null===(e=this.player)||void 0===e?void 0:e.$topDiv.height())||0,r=this.player.fullScreenChecked?"inherit":null;void 0===t&&(t=!(!document||!document.fullscreenElement)),le(t?"100vw":this.ps.options.minWidth,n,"min-width",r),le(t?"100vh":this.ps.options.minHeight,n,"min-height",r),le(t?"100vw":this.ps.options.maxWidth,n,"max-width",r),le(t?"100vh":this.ps.options.maxHeight,n,"max-height",r),le(t?"100vw":this.ps.options.width,n,"width","100%"),le(t?"100vh":this.ps.options.height,n,"height",i>0?"100%":"100vh"),this.$div.css(n)}},{key:"detach",value:function(){null!==this.player&&(this.player.$div.remove(),this.$div.detach(),this.player=null)}},{key:"updateContent",value:function(t){if(this.$msgBoxDivCanvas){var e=this.$msgBoxDivCanvas.get(-1).getContext("2d");e.clearRect(0,0,e.canvas.clientWidth,e.canvas.clientHeight),this.msgBox.update(e,t)}return Sn(Pn(s.prototype),"updateContent",this).call(this)}},{key:"resetAllCounters",value:function(t){i().each(this.counters,(function(e,n){null!==n&&(n.value=0,n.countDown=0,n.enabled=t,n.refreshDisplay())}))}},{key:"setWaitCursor",value:function(t){if(void 0===t)this.$waitPanel&&this.$waitPanel.css({display:this.waitCursorCount>0?"initial":"none"});else{switch(t){case!0:this.waitCursorCount++;break;case!1:--this.waitCursorCount<0&&(this.waitCursorCount=0);break;case"reset":this.waitCursorCount=0}this.setWaitCursor()}}},{key:"setProgress",value:function(t,e){this.$progress&&(this.currentProgress=t,t<0?this.$progress.css({display:"none"}):(e&&(this.maxProgress=e,this.$progress.attr("max",e).css({display:"initial"})),this.$progress.attr("value",t)),wt("trace","Progress: ".concat(this.currentProgress,"/").concat(this.maxProgress)))}},{key:"incProgress",value:function(t){this.currentProgress>=0&&this.setProgress(this.currentProgress+(t||1))}},{key:"showHelp",value:function(t){}},{key:"showDlg",value:function(t,e){var n=this;return new Promise((function(i,r){n._dlgOkValue="ok",n._dlgCancelValue="cancelled",n._isModalDlg=t,n.$dlgMainPanel.children().detach(),n.$dlgBottomPanel.children().detach(),e.main&&n.$dlgMainPanel.append(e.main),e.bottom&&n.$dlgBottomPanel.append(e.bottom),n._closeDlg=function(t){t&&i?i(n._dlgOkValue):!t&&r&&r(n._dlgCancelValue),n.$dlgOverlay.css({display:"none"}),n.enableMainButtons(!0),n._closeDlg=s.prototype._closeDlg},n.enableMainButtons(!1),n.$dlgOverlay.css({display:"initial"})}))}},{key:"enableMainButtons",value:function(t){this.$playerCnt.find("button").attr("tabindex",t?"0":"-1")}},{key:"_closeDlg",value:function(){}},{key:"showReports",value:function(t){return this.$reportsPanel.html(this.$printReport(t)),this.showDlg(!1,{main:[this.$infoHead,this.$reportsPanel],bottom:[this.$copyBtn,this.$closeDlgBtn]})}},{key:"$printReport",value:function(t){var e=[];if(t){var n=t.getData(),r=new Date(n.started);e.push(i()("<div/>",{class:"subTitle",id:this.ps.getUniqueId("ReportsLb")}).html(gt("Current results")));var o=i()("<table/>",{class:"JCGlobalResults"});o.append(ae.doubleCell(gt("Session started:"),"".concat(r.toLocaleDateString()," ").concat(r.toLocaleTimeString())),ae.doubleCell(gt("Reports system:"),"".concat(gt(n.descriptionKey)," ").concat(n.descriptionDetail))),n.userId?o.append(ae.doubleCell(gt("User:"),n.userId)):n.user&&o.append(ae.doubleCell(gt("User:"),n.user)),n.sequences>0?(n.sessions.length>1&&o.append(ae.doubleCell(gt("Projects:"),n.sessions.length)),o.append(ae.doubleCell(gt("Sequences:"),n.sequences),ae.doubleCell(gt("Activities done:"),n.activitiesDone),ae.doubleCell(gt("Activities played at least once:"),"".concat(n.playedOnce,"/").concat(n.reportable," (").concat(xt(n.ratioPlayed/100),")"))),n.activitiesDone>0&&(o.append(ae.doubleCell(gt("Activities solved:"),"".concat(n.activitiesSolved," (").concat(xt(n.ratioSolved/100),")"))),n.actScore>0&&o.append(ae.doubleCell(gt("Partial score:"),"".concat(xt(n.partialScore/100)," ").concat(gt("(out of played activities)"))),ae.doubleCell(gt("Global score:"),"".concat(xt(n.globalScore/100)," ").concat(gt("(out of all project activities)")))),o.append(ae.doubleCell(gt("Total time in activities:"),Ot(1e3*n.time)),ae.doubleCell(gt("Actions done:"),n.actions))),e.push(o),n.sessions.forEach((function(t){if(t.sequences.length>0){var r=i()("<table/>",{class:"JCDetailed"});e.push(i()("<p/>").html(n.sessions.length>1?"".concat(gt("Project")," ").concat(t.projectName):"")),r.append(i()("<thead/>").append(i()("<tr/>").append(ae.th(gt("sequence")),ae.th(gt("activity")),ae.th(gt("OK")),ae.th(gt("actions")),ae.th(gt("score")),ae.th(gt("time"))))),t.sequences.forEach((function(t){var e=i()("<tr/>").append(i()("<td/>",{rowspan:t.activities.length}).html(t.sequence));t.activities.forEach((function(t){if(t.closed)e.append(ae.td(t.name)),e.append(t.solved?ae.td(gt("YES"),"ok"):ae.td(gt("NO"),"no")),e.append(ae.td(t.actions)),e.append(ae.td(xt(t.precision/100))),e.append(ae.td(Ot(1e3*t.time)));else{e.append(ae.td(t.name,"incomplete"));for(var n=0;n<4;n++)e.append(ae.td("-","incomplete"))}r.append(e),e=i()("<tr/>")}))})),r.append(i()("<tr/>").append(ae.td(gt("Total:")),ae.td("".concat(t.played," (").concat(xt(t.ratioPlayed/100),")")),ae.td("".concat(t.solved," (").concat(xt(t.ratioSolved/100),")")),ae.td(t.actions),ae.td(xt(t.score/100)),ae.td(Ot(1e3*t.time)))),e.push(r)}}),this)):e.push(i()("<p/>").html(gt("No activities done!")))}return e}},{key:"enableCounter",value:function(t,e){this.counters[t]&&this.counters[t].setEnabled(e)}},{key:"doLayout",value:function(){var t=this;this.player.doLayout(),this.$msgBoxDiv&&window.setTimeout((function(){t.$msgBoxDivCanvas&&t.$msgBoxDivCanvas.remove();var e=t.$msgBoxDiv.outerWidth(),n=t.$msgBoxDiv.outerHeight();null!==t.$msgBoxDivCanvas&&t.msgBox.dim.widht===e&&t.msgBox.dim.height===n||(t.$msgBoxDivCanvas=i()('<canvas width="'.concat(e,'" height="').concat(n,'"/>')),t.msgBox.setBounds(new Ue(0,0,e+1,n)),t.msgBox.buildAccessibleElement(t.$msgBoxDivCanvas,t.$msgBoxDiv)),t.$msgBoxDiv.append(t.$msgBoxDivCanvas),t.updateContent()}),0)}},{key:"fit",value:function(){return this.doLayout(),new Ve(this.$div.width(),this.$div.height())}},{key:"setScreenFull",value:function(t){if(document&&document.fullscreenEnabled&&(!0===t&&!document.fullscreenElement||!1===t&&!document.fullscreenElement||!0!==t&&!1!==t)){var e=!!document.fullscreenElement;if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen();else{var n=this.player.$mainContainer.get(-1);n&&n.requestFullscreen&&n.requestFullscreen()}this.player.fullScreenChecked=!0,this.setSkinSizes(!e)}}},{key:"actionStatusChanged",value:function(t){t.name&&this.buttons[t.name]&&this.setEnabled(this.buttons[t.name],t.enabled)}},{key:"setEnabled",value:function(t,e){t&&e?t.removeAttr("disabled"):t&&t.attr("disabled",!0)}},{key:"equals",value:function(t){return t&&this.name===t.name&&this.ps===t.ps}},{key:"getMsgBox",value:function(){return this.msgBox}}],r=[{key:"registerClass",value:function(t,e){return s.CLASSES[t]=e,e}},{key:"registerStyleSheet",value:function(t,e){var n=!1,i=fe(e);i.__JClicID||(i.__JClicID="SK".concat(s.lastId++));var r=s.rootStyles[i.__JClicID];return r||(r=[],s.rootStyles[i.__JClicID]=r),r.indexOf(t)<0?(wt("trace",'Stylesheet "'.concat(t,'" has been registered for root node labeled as "').concat(i.__JClicID,'"')),r.push(t)):n=!0,n}},{key:"getSkin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("@"===(t=t||"default").charAt(0,1)&&".xml"===t.substr(-4)&&(t=t.substr(1,t.length-5)),t&&e){var i=s.skinStack.find((function(n){return n.name===t&&n.ps===e}));if(i)return i}var r=s.CLASSES[t];if(!r){var o=e.project.mediaBag.getElement(t,!1);o&&o.data&&((n=Object.assign({},n,o.data)).skinId="JClic-".concat(t.replace(".xml",""))),!e.zip&&"edu.xtec.jclic.skins.BasicSkin"===n.class&&n.image&&e.project.mediaBag.getElement(n.image,!1)&&e.project.mediaBag.getElement(n.image,!1).data?r=s.CLASSES.custom:(wt("warn","Unknown skin class: ".concat(t)),r=s.CLASSES.default)}return new r(e,t,n)}}],n&&kn(e.prototype,n),r&&kn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(Ke);En.skinStack=[],En.rootStyles={},En.lastId=1,En.CLASSES={},Object.assign(En.prototype,{skinId:"JClicBasicSkin",$div:null,$playerCnt:null,name:"default",options:{},$waitPanel:null,$progress:null,currentProgress:-1,maxProgress:0,msgBox:null,$msgBoxDiv:null,$msgBoxDivCanvas:null,$dlgOverlay:null,$dlgMainPanel:null,$dlgBottomPanel:null,$infoHead:null,$copyBtn:null,$closeDlgBtn:null,$okDlgBtn:null,$cancelDlgBtn:null,_dlgOkValue:null,_dlgCancelValue:null,_isModalDlg:!1,$reportsPanel:null,buttons:{prev:null,next:null,return:null,reset:null,info:null,help:null,audio:null,about:null,fullscreen:null,close:null},counters:{actions:null,score:null,time:null},msgArea:{main:null,aux:null,mem:null},player:null,ps:null,waitCursorCount:0,basicCSS:".ID {\n width: 100%;\n background-color: #3F51B5;\n display: -webkit-flex;\n display: flex;\n -webkit-flex-direction: column;\n flex-direction: column;\n}\n\n.ID .JClicPlayerCnt {\n background-color: lightblue;\n margin: 18px;\n -webkit-flex-grow: 1;\n flex-grow: 1;\n position: relative;\n}\n\n.ID .JClicPlayerCnt>div {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.ID button:not(.StockBtn) {\n background: transparent;\n padding: 0;\n border: none;\n box-shadow: none;\n text-shadow: none;\n}\n\n.ID .unselectableText {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ID .progressBar {\n width: 250px\n}\n",waitAnimCSS:".ID .waitPanel {\n display: -webkit-flex;\n display: flex;\n width: 100%;\n height: 100%;\n -webkit-justify-content: center;\n justify-content: center;\n -webkit-align-items: center;\n align-items: center;\n}\n\n.ID .animImgBox {\n position: relative;\n width: 300px;\n height: 300px;\n max-width: 80%;\n max-height: 80%;\n}\n\n.ID .animImgBox svg {\n position: absolute;\n width: 100%;\n height: 100%;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n}\n\n.ID #waitImgBig {\n animation-duration: 0.8s;\n animation-name: rotate-right;\n}\n\n@keyframes rotate-right {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(1turn);\n }\n}\n\n.ID #waitImgSmall {\n animation-duration: 0.6s;\n animation-name: rotate-left;\n}\n\n@keyframes rotate-left {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(-1turn);\n }\n}\n",waitImgBig:'<svg id="waitImgBig" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg">\n <path fill="#3F51B5" d="m 65.99,40.19 c -0.42,5.33 7.80,4.94 8.11,0.20 C 74.50,34.37 66.35,8.59 42.92,7.98 15.90,7.29 9.96,29.50 9.94,39.41 15.33,-1.66 68.61,7.048 65.99,40.19 Z" />\n</svg>\n',waitImgSmall:'<svg id="waitImgSmall" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg">\n <path fill="#3F51B5" d="m 57.00,39.43 c -0.28,-3.53 5.16,-3.27 5.37,-0.13 0.26,3.99 -5.13,21.04 -20.63,21.44 C 23.85,61.19 19.93,46.50 19.92,39.94 23.48,67.11 58.73,61.35 57.00,39.43 Z" />\n</svg>\n',reportsCSS:".ID .dlgDiv {\n background-color: #efefef;\n color: #757575;\n font-family: Roboto, sans-serif;\n font-size: 10pt;\n line-height: normal;\n}\n\n.ID .dlgDiv a, a:visited, a:active, a:hover {\n text-decoration: none;\n color: inherit;\n}\n\n.ID .dlgMainPanel {\n padding: 1em 2em;\n max-height: calc(100vh - 8em);\n max-width: calc(100vw - 2em);\n min-width: 20em;\n overflow: auto;\n}\n\n.ID .dlgMainPanel .headTitle {\n font-size: 2.5em;\n font-weight: bold;\n margin: auto;\n}\n\n.ID .dlgMainPanel .subTitle {\n font-size: 1.4em;\n font-weight: bold;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel p {\n font-size: 1.1em;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel table {\n table-layout: fixed;\n width: 40em;\n margin: 0.5em 0 1.7em 0;\n border-collapse: collapse;\n}\n\n.ID .dlgMainPanel select {\n min-width: 20em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n color: #757575;\n}\n\n.ID .dlgMainPanel input {\n margin-left: 1em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n border-color: lightgray;\n}\n\n.ID .infoHead {\n padding: 1em 0em 0.5em;\n}\n\n.ID .JCGlobalResults td {\n padding: 0.4em;\n border-bottom: 1px solid #b6b6b6;\n}\n\n.ID .JCGlobalResults td:first-child {\n font-weight: 600;\n width: 14em;\n}\n\n.ID .JCDetailed td, th {\n border-bottom: 1px solid #b6b6b6;\n padding: 0.3em 0.4em;\n vertical-align: top;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ID .JCDetailed thead {\n font-weight: 600;\n}\n\n.ID .JCDetailed th:first-child {\n width: 7em;\n}\n\n.ID .JCDetailed th:nth-last-child(4) {\n width: 4em;\n}\n\n.ID .JCDetailed th:nth-last-child(-n+3) {\n width: 4.1em;\n text-align: right;\n}\n\n.ID .JCDetailed td:nth-last-child(-n+3) {\n text-align: right;\n}\n\n.ID .JCDetailed .ok {\n color: #4bae4f;\n font-weight: 600;\n}\n\n.ID .JCDetailed .no {\n color: #f34235;\n font-weight: 600;\n}\n\n.ID .JCDetailed tr:last-child {\n font-weight: bold;\n}\n\n.ID .JCDetailed .incomplete {\n font-style: italic;\n}\n\n.ID .dlgBottomPanel {\n height: 3.5em;\n background-color: white;\n padding: 0.5em;\n font-weight: bold;\n text-align: right;\n border-top: 1px solid #eee;\n position: relative;\n}\n\n.ID .dlgBottomPanel .smallPopup {\n background-color: #222;\n color: #ddd;\n padding: 0.5em;\n font-size: 0.9em;\n position: absolute;\n right: 6em;\n top: 1em;\n}\n\n.ID .dlgBottomPanel button {\n display: inline-block;\n padding: 10px;\n cursor: pointer;\n line-height: 0;\n}\n\n.ID .dlgBottomPanel button:hover {\n background-color: #eee;\n border-radius: 80px;\n}\n\n.ID .dlgBottomPanel button:active {\n background-color: #b3e5fc;\n}\n",closeDialogIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />\n</svg>\n',okDialogIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />\n</svg>\n',copyIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" />\n</svg>\n',appLogo:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">\n <g transform="matrix(.02081 0 0-.02081 5 62.33)">\n <path d="m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1999 519 3 11 999-266 999-266z" fill="none" stroke="#9d6329" stroke-linejoin="round" stroke-linecap="round" stroke-width="180" stroke-miterlimit="3.864" />\n <path d="m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1998 519 3 11 999-266 999-266" fill="#f89c0e" />\n <path d="m357 2850l1000-268-267-992-1000 266 267 994z" fill="none" stroke="#86882b" stroke-linejoin="round" stroke-linecap="round" stroke-width="180" stroke-miterlimit="3.864" />\n <path d="m357 2850l1000-268-267-992-1000 266 267 994" fill="#d9e70c" />\n </g>\n</svg>\n',halfMedia:{width:376,height:282},twoThirdsMedia:{width:420,height:315}});var Tn=En;function jn(t){return jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jn(t)}function _n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Bn(i.key),i)}}function Bn(t){var e=function(t,e){if("object"!==jn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==jn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===jn(e)?e:String(e)}var Rn=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,n&&(this.file=n)}var e,n,i;return e=t,(n=[{key:"setProperties",value:function(t){var e=this;return de(t.get(0).attributes,(function(t,n){switch(t){case"type":e.type=n;break;case"file":e.file=ee(n);break;case"params":e.externalParam=ee(n);break;case"pFrom":e.absLocationFrom=n;break;case"buffer":e.recBuffer=Number(n);break;case"level":case"from":case"to":case"length":e[t]=Number(n);break;case"px":case"py":null===e.absLocation&&(e.absLocation=new Me(0,0)),"px"===t?e.absLocation.x=Number(n):e.absLocation.y=Number(n);break;case"stretch":case"free":case"catchMouseEvents":case"loop":case"autostart":e[t]=kt(n)}})),this}},{key:"getAttributes",value:function(){return zt(this,["type","file","externalParam","absLocation","absLocationFrom","recBuffer","level|1","from","to","length","stretch","free","catchMouseEvents","loop","autostart"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["type","file","externalParam",{key:"absLocation",fn:Me},"absLocationFrom","recBuffer","level","from","to","length","stretch","free","catchMouseEvents","loop","autostart"])}},{key:"isEquivalent",value:function(t){return this.type===t.type&&(this.file===t.file||null!==this.file&&null!==t.file&&this.file.toLocaleLowerCase()===t.file.toLocaleLowerCase())&&this.from===t.from&&this.to===t.to&&this.recBuffer===t.recBuffer}},{key:"getDescription",value:function(){var t="".concat(this.type);return this.file?t="".concat(t," ").concat(this.file).concat(this.from>=0?" from:".concat(this.from):"").concat(this.to>=0?" to:".concat(this.to):""):this.externalParam&&(t="".concat(t," ").concat(this.externalParam)),t}},{key:"toString",value:function(){return"".concat(this.type).concat(this.file?" ".concat(this.file):"")}},{key:"getIcon",value:function(){var e=null;switch(this.type){case"PLAY_AUDIO":case"PLAY_RECORDED_AUDIO":e="audio";break;case"RECORD_AUDIO":e="mic";break;case"PLAY_VIDEO":e="movie";break;case"PLAY_MIDI":e="music";break;case"URL":e="url";break;default:e="generic"}return e?t.ICONS[e]:null}}])&&_n(e.prototype,n),i&&_n(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(Rn.prototype,{type:"UNKNOWN",level:1,file:null,externalParam:null,from:-1,to:-1,length:3,recBuffer:0,stretch:!1,free:!1,absLocation:null,absLocationFrom:null,catchMouseEvents:!1,loop:!1,autoStart:!1});var In={generic:'<svg height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M28.8 12L28 8H10v34h4V28h11.2l.8 4h14V12z" />\n</svg>\n',audio:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" />\n</svg>\n',movie:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z" />\n</svg>\n',mic:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z" />\n</svg>\n',music:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" />\n</svg>\n',url:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z" />\n</svg>\n'};Rn.ICONS={},i().each(In,(function(t,e){var n=new Image;n.src=ue(e),Rn.ICONS[t]=n}));var Dn=Rn;function Nn(t){return Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nn(t)}function Mn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Vn(i.key),i)}}function Vn(t){var e=function(t,e){if("object"!==Nn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Nn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Nn(e)?e:String(e)}var qn=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e,n&&(te(n,"data:")?this.audio=new Audio(n):this.file=n)}var e,n,i;return e=t,(n=[{key:"setProperties",value:function(t){return this.file=t.attr("file"),this.enabled=jt(t.attr("enabled")),this}},{key:"getAttributes",value:function(){return zt(this,["enabled|".concat(2),"file"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["enabled","file"])}},{key:"realize",value:function(t,e){this.audio||null!==this.player||null===this.file||(this.player=new dn(new Dn("PLAY_AUDIO",this.file),e,t),this.player.realize())}},{key:"play",value:function(){this.enabled&&(this.audio?(this.audio.currentTime=0,this.audio.play()):this.player&&this.player.play())}},{key:"stop",value:function(){this.enabled&&(this.audio?this.audio.pause():this.player&&this.player.stop())}}])&&Mn(e.prototype,n),i&&Mn(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(qn.prototype,{file:null,enabled:2,player:null,audio:null});var Ln=qn;function Fn(t){return Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(t)}function zn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Un(i.key),i)}}function Un(t){var e=function(t,e){if("object"!==Fn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Fn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Fn(e)?e:String(e)}var $n=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e&&(this.elements=Object.assign({},this.elements,e.elements),this.enabled=e.enabled)}var e,n,r;return e=t,n=[{key:"setProperties",value:function(t){var e=this;return this.enabled=jt(t.attr("enabled"),this.enabled),t.children().each((function(t,n){var r=n.getAttribute("id");e.elements[r]=new Ln(r),e.elements[r].setProperties(i()(n))})),this}},{key:"getAttributes",value:function(){return zt(this,["enabled|".concat(2),"elements"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["enabled",{key:"elements",fn:Ln,group:"object"}])}},{key:"realize",value:function(t,e){i().each(this.elements,(function(n,i){return i.realize(t,e)}))}},{key:"play",value:function(t){if(this.globalEnabled&&this.enabled){var e=this.elements[t];e&&e.enabled&&e.play()}}}],n&&zn(e.prototype,n),r&&zn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();$n.MEDIA={start:"data:audio/mpeg;base64,//NAxAARGk5RdUEQANIEZEBAPGPyIAAYAKMY/6EaQn8hP+c/yEb//kITU7oc9Cf6nPnPoT/8nQhCKEEEnDizkAwM8ThYH1Bj/EAYEhyUGghyivv7fn0vtsLdYI0CiTQE+aaqfH3BW37/80LEFhl6nvZfj1ACplLtsfx19gOQfBp7iHeEWRj8WxiLLI6khikjEI9IvsePycfERCSpPJ9s95IbO1O/tRX70XQiOGX+n+hmeb+aMirKxN/IibInf//G3K9PVym7NoL/W2usCkcMT5T/80DEDBcivuJd0lADkXMLoGxcA7ENhPlAY8LMK280iLkhQq80ojkRQCwz/rEsTjjTlMPMu3RWZ2c3dmONON0NVDzDzDzP79Y9PFg9v//oqi4hHyp+7HGl2b///I8VcYAAls9qrCT1Mv/zQsQKFsrCvlzLRNa/FN/jd/HUrGLUa8tKonzDK8+t55alG5sbKYilBExD8Id1ugmp+eKIdSplGpaoxNZiznEU/J9KJmUsqBzPVjJ/+Aif//71QCdv+gE7f//6gICqPAAci1sbgH8/G//zQMQKFfF2qb9ZaAKU9PlY3uHFsAqAXfgZvyyhtTM2fC1zH/8+tFlslODFHjTHsClFqSTfprRCxdzMcppQ8yHsbbEkzpoLvZFBnWt1GBa/+8se/+SPdQe//FIIsAAAba7YbC65AQAf//NCxA0XMh6xv5OIAEIz0mVENAJ0DbwIQjpGYFNAvTSI1ePBuh+MwYk+xib0DA/K5YQadIk+o0Z0UyLmiv+h5bMD1Ro3/3/TSUggmu/+v/7KNL03CcLAh//5dpCqkltAAAqFFpldqAHI//NAxAwXGl7aXYxoABm/nTyF8EwhIPY/DSOKUIQ2WXUzAlFDQXzyRCXBUNUk33XoqQNhyeltWFUL6CKTImv7/vSZNZw0MP6v/v2oFQ5EUR7/1SVyb//E7FkIn9f9NXWQAg47vXRBbzv/80LEChbaYs5f2IAC9rPHK1z/yygqmvwSoaAGvNLr9jCagdVUGyxOpVqpp79lJPf9ZNEttWXTUvf/9azMUgOcZrZPMThF00d7//v///9SnpUlpJJJJJFeLhp3///yKi4QAHWdrdQE07P/80DEChTJvrI+Ro6Oalhjl3DYQyyMpMHHcIbTFNlqYvp6GKBJBYZ89G+PKyt/Q4oCbx9z9b//80CTA+F3zTlSqOz6G0PoVCIItC3/CnwN/xZAvcr/99VSIAEKz7+UABhWz01LyctXJv/zQsQRE5nOvl4WFHISWA9Ybn87+VaIKzA0kk7n33/KHo6qv1QKoNjMTHtX//ocaRCuGg2MP8jbueS9WIWU3NPcenOEv/CbcsVAKiIkATNv/9QAb60qFitrzbcZQ+ixX7169gCfAOpwHf/zQMQeE+Fasl4T0HJRrdobjyh8XBKr80WAqJQaiQPhY7vmJ4///ppkOhOaLMDbgVOwVdYt0SgqM/4hBQO+qglKQAFQM0aPnrrVvpRJLyCYt2amWVGBpcJrSl6ypI4hgoMQk5Di+Yv3//NCxCkP+IpANGYehC+92dkrPJ/1a+z+3/r/sL/6f+6G7BotKqkVeDWsJLMDPP8pf2a4///Jf+VgHuRkfn85h7MIeAY9RE3ZM3IRTyUaGvCJpep52lDPb0nCY5xRqRkEWzDKgw+8Ftdp//NAxEUS42YhgAhHHAG9ZCQjo0VONppYbQStB6qWUv5f591O8bze0/3y//62eUqnWzSn9vNsnOBzK8TN6urr6bcxGukbeqNZjuyIMO5FREnqzI6SVZVcahzgpCwMa561B4M8zjedy6v/80LEVBI7ViYoCEsdN5b7kv/+Rsub5P/X6yz0/JdhcZdZl+/hII/xFYdTSmc0ck3O0055fkc2R+ZgsyZsEagnMwRqkK1xle//6iZh/ITJmiF/yEKT4QyEKEP8hMQl/mNYxv+hn/lKZyn/80DEZxEbPiWICEc9StmmMZW0r1KXR/qYxnX0UpWMZAxQFqoapnCiQwqxihWDAQEBAQEKE6mZGZGTTMiMjTWZHa/aZkZlTRGXojIzL///////8yP85/5k1lspGrWRyNWCggYME4kGJf/zQsR9EkNiDAAARN1MNUkqTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/zQMSQDcslQAoAR1mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",click:"data:audio/mpeg;base64,//NAxAASsyJgIUEQAY///gX8///yfyHO/8hCEafoRp3nPQgAAEUAABBCEIT//QhCKQhNGyEIQhCNITU5//OQhCN7f/yEZQAAIynOc5CEIhGnABGY/4gAIQZ4h4h4d3Z2Z9Jba5XWhWP/80LEEBhJOxcfiUAC9BEda+oiKFQsViiMpvHFC98pLjySjUNeKoYxMpwIT21HmHlEhx83A9K5vDAuZUQxzq7nJPgEVWKQZ1Iu5oJH3UpGObWV/MfAgLC4Z/yhP/ULKnqHd/syOQenhOL/80DEChZpZs7rzBgAT3bBWub0T/xNtn9nY5bvQdCA0TvnpXNC7EJ3iRPtebJ//7xK4IAqIii2AKbfkBAJxATDLN7wiUGv6VANBNjqQwGCayGoaBAJaNC79/z5wP2IuJbfZsNFgBVo7P/zQsQLF0lGxvRJhlQVDyEmYldHXJGadquTRs6aYmq9VY1hqqt6xmqts2zGTvGNrl+u1IMBHREJREbkpaFQkFRoa2FYSDvBp6DwSf1lgFqfkQ0JcRCYlKxKg0eEw8sKqgaEogGBH3EZpv/zQMQJEyEudaoIBoAf+HV2UBjoOsP2/IwrkezQ1Y4e2wVxgxlVAqDQUSRUBRU6LrBY1lvxEdUBWBIOnZWOCrvlVnTsltWNOqPP4seUBcKgKpW44m3GkHLjaBS4ohHZdTGi6FXXVo6+//NCxBcNYAYyWAhEAJ3U+j3uXdl1z1Du30fCySCGablvUTrhwggLTomAAmrWsmWY9ym89ZcvlwX/zf+a95ZLwXOar/LNrJ60LUl25Hs58yKRWIjSbt9DCIs0UtF/TOlm2cyNTpKysuCB//NAxD0Rw1YliAhHPdmd9nYYQOsGCgAfmqIAXlnhbNZeUBQvyL/y6NlP/r1LLlEiSPL/7lE9SirM5zxZEwCseMDL330yrtl8/8jJs6mt5dTloYsvNSGbmTkYQhpVpRpCG1yr9YSfr1b/80LEURFLZiWQCEc8v/rLXPzys+Z9z8v+H9qyCMpGLn3bla9qtcxYZXk9cbOUjb8t0q2ytz79ImM1R0ht3QdWK11myihIpt8SZBRAlbWq3CDpDKWUte/VHgJDH6k+lsqSPbRj+pHWWrL/80DEZxKjYh2ICIfhxIKhMBeLPjgKlFRIKjCxIKjCukkFAKCSCxFtgTAQFIkisqIg2EngUVFg8FQCQUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQsR3EnAF9kgARgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",actionOk:"data:audio/mpeg;base64,//NAxAAT+gKmPUFoAI81KAANYQZECuQAASjAD820006kC+buYDgGEGEKIcsCYAUQYA6JeI2JmS5wcY5yXL6b1IJpp6kG////9X+h/oaaaadAvpvBA5/9QIDQQOQ+cbQllsQQAKTggvn/80LECxdCcupdjFACwA8cFoNFZuosRJUe3E48kEhWIRueePjSdR4T9XMQ4SwB/BZ1GQNAtHHOPzOFryImV2zlb//rZV/6MYp56IY00sPgvi5vp1NN///3Q4ZlSUVV6wAAHLn//b/+Bv3/80DEChbo7s5fmGgA8cDgPEdPslrmVdkwdsV66+p2vZktFECYbF0sxMc6XTyGfU7omIDWqTLdIdocopcSHkqkN/1OLnGEiTI5lQIHz6F//h8+Aw////SWn6Ai////RQCALJttttthGP/zQsQJFgLXBl+PUAJpUBpuDr/a/Bn7vbuBpTSaJu9C26HLGnV05pymMa+52rjwoQl9HX5xkseQEWn/zR+C+CGcTN1IQsr/O/6N///////zyotv//Ulb+WNu/4a/G/DAGASAsBQ86QpAv/zQMQNFyqWqFWaUACorGJ3w70JwQXdB1Iw8FBR6w8BkLlXmCwSQKbRFEDGyFEFw/LiWNeT8eOSG/++3///5oEpv5wrF/RmoYsz////+yuLZ55GT//yosfyqj5gugANMBv///+Bt0Bw//NCxAsWul7hv49QAIAcsuZ3XnIKHgXVwYS+wjbgGuEvA8WjfAsaQmNk2QkZh5517ceH7uZegsm5y///0VTDzzDz09dev/6IIMKcL8i/5CSjE3/oqRMBZpmk7R/RgAAbjwkkcZrZNKRG//NAxAwW4j6pudpoAwwbDspelxARGBQ5l21KTHGz7RkyVSuLZ5l3/S9SQ1CutfuvPzIvF4HUFzRXNkiXJVH+pv//mvMTVRJGyT6S29LRao2Wqj///UbLJxLHVPBVD9SWyADnc5p6REf/80LECxb6Uoxe3A7SY0MyGLYtINLEx4dXVEEvywRGZ7pcZEtrkjRpam6yOArCCRZNX/W3WOoGKq04z/0I/nt/UCYZf6GfovMahvTn21oZ7KnY4oNhuRFQuLsBID8cKC5qSQAC9j29EzH/80DECxNZYoT+xuAyRLbuBA8WRBNAN0Eq+mboAV7G62xjgCvi7cM0Ov1kOELDyoy/75RGdB8iaMZJ//S9SaPWe8oonsV4o5NO40K5FG2xNQZo78WcFOwcZjQQYvlIW6mGkh0f0ZiOBv/zQsQYE8jiVBDfVogDF7hUFzGQhTgpeTFkKEeXlL8syjVHZ03ZCDR2nSxR7Pq7np3LRaHB9adBZ07r018kdy3tjTX1KiSqekjtoMGlaAKNEYCZkOHzpZziA0FmwmEDZhMwfvxGWFAY3P/zQMQkE5DaRAjW1ohECprRK1TRrKRtJsNpyJrNfLvndF7g+gSnAyt351B5obyX8r/u//////rqgBmlYGs01hNdBQpEQyNoHhEMuUtgytPS01oLy0hu6NVNabzryYxwzfIqvKPaRFls//NCxDAQ+FYw8gjSKH7tHbMxfJlUtVpIB16SI0SEXBsf68/+/L//zfLll/nmj7F/1pcpZ/+Z3Ur5Eq5WpbM9MfPljxeb9Lamv/nXIuOSkVXJVRmzRxLpVUlMiBhOahamKCgmCgSwVXHX//NAxEgRU1YcAABGvSNI0Nzzp5SNpUj5aE3ZUqAvIkhEnnq1D3/yxFqrceAgEVIho8WKlhKVGBUJHjzvOh0JndVbtdYykkFQmdDoaDqCIaLKTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqr/80LEXRFYBf5ICEYAqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=",actionError:"data:audio/mpeg;base64,//M4xAAUuVJUAUgYARcXFz4DgFAeKHAeChiIie7u+iaIibgYuAYGcTz3OIhf/Xd38v+J6J7u+gGBiw8P8PDw8PDHRw8/+O6GADo/h78BEQz8HAHh5+v+A4A6H/8AAEfIiZmZBXlicwVCsWj1//M4xAwYWvL/H4goAHY5EADTzSBEDUpfz/OhTMPGC+NAMWAgfAcAgHFSjhZD1PCRAUQFBjMUxMhGGuOVyndnXzvlH2dGLp+jbHsUykMTTFkX/+ror2841v+k//+MIOdv/GUVmvrpkGSqAYta//M4xAkXMsLmN89oAg/iwxc/bCcqY374+ZYv8ms1WUWQHQlTUFCJgbIjvMcd6K1m71G+ttB9Pt32bR6OptTZxtV0l/ov20P3b9/1/1f0dSCkh7FjKTdSRbQKiRLyBKFroXi7uP0CAvGOAWNk//M4xAsXwr7a/mPUwS+O1HXtgEWD0qvqiuk8xOG4QoqkAU5eFUIMYl8WHoK3Hcq2dx5p5fTjLvlFtLucF2SuaciHhslc4JhNnm5XU2pCS6c3n6+3/9GyFsk+xwWUQmSTumm7e5ggAEWsUBor//M4xAsXCrLXHntO7NUoPTkrtfAzt+Vmc1QDhdvOk4mMiMaxzG9AERpgbNKfJVp0/lfOvjfl9SWj5XpoXfIYVep7R0WTaUAGDj1IkMHy1Oyrfnfq2e37/22fJduLdKpFmVawABglJaFVG03L//M4xA0XurK+5HnLTJeQXpCP4L6DAO1L6jOnPOCx/wVBu4nAIHEgOCbXJbP5R/74hGiwND1iw7BYtTsqM6viJ1aoa14o/kdXwsdo2K6nxravl7al1/t+rUDz4J+IDtW7bbVAX+3gDwiUL8lI//M4xA0Xgq7qVnoO+zaBvGmHeGt1WGsEPh7RWPKQT82FEhiWLGeUlRHjRERFE6UUhhATy9J5Lcv+PM+axpVIkaHDqqvi+yUHdjW3sp2vTv+rav9F/Kt+Lm9QJFdnwrvt7SXHLLMAFKoGoNaO//M4xA4UurLyXkDFT5XYo5iQ9ckoWFh61037WowPpb5NVRWlrUmVVqxmNV/b6q+xuJVfY1VVXfDHvnL7TGOFMb6ifdZf0etaP//lZH6FbyuK5MUAYWLKUvoamjS5tZpdNnrWz2ASUXdsckcS//M4xBoUcVJ4IisMydfHkiAUZzmoyajzSOzOf1T9qlFq+ORkFFeC//HxXOxf/PKPG/CNxYO4+WKbl+Lv4VBQU6KKhP/K/+vK3+WXVv/9SobSZ1b/lb9SshjN9S/Upahjf/LMahjv6qx/DpAR//M4xCcS40IEABDN5DMaqqrVVVjWLGPjH7GpWZ/7dqr47Eq/7HQds4duAxGfzkjUTpoLSIv///qn///YxTAwQIGhyP/u7O/3P2eqNZ2k4so4sp2NFAYhnZ2couBNTEFNRTMuOTkuNVVVVVVV//M4xDoKqz1wDACNy1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",finishedOk:"data:audio/mpeg;base64,//NAxAAQiXIEAUIQAPnfO/OdyAYGehP/U5Gqd+c/8785zoBi3QhCMpCVP+SpwM6AYGODH/8TvB+sPiMP5cMCcPygIAg7/lAff4IAgcBCD6ofD4diQbC0WaISi0SB3EAzA8WZgeALXg3/80LEGBoDGyZfglACgsRODRuWFcnMLm+eQEhRVQz5IePy5Icm/2Yn5GLY58hG3/J0JyAkq54WhVHosmkTmr//OYkIx+aejta5yObVf////fbcgJP/8oP//L/+w6tzSgKyRVuaO6jleQb/80DEDBdLJs4/2FABfMefV3NU1/Pu+MiMj5TGccdZM7mtR9poqDaj269WQ7clU5//OzTSgSRYFoL8eoeaaxhw+u9lq/9jn/NY7/3VPohqW+///////5ELQ+cqSm8F1QfSAHmkZP3Rz//zQsQJFgHCul9ZUACtuzlS2auXefrUxQUkTU+etjYpBz++SrehymLQlDIbPScu+uppsoFMTf/5uSiO7kpKKo1ONQ6/NbKkDv8iJj3OE/xEHRQl1Hv//4UPLBeWtoFTaaAttttstQEAgP/zQMQNF1PXDl+BUAJQhUAPuz0DJsKELcVBuf+NDz79ceCoSE/meeYSBfk6fQt91kZOYYxE3/+2YwtnyQxn////0JHMY+w/H5OSN/////zDGf5+p7///////kjSQxXTFGTyENw7gapG//NCxAoVUeLUAYKYABCegFrFga4BpxsoJJHKbdSSNc9rTRNTiRTtofSWUkUt1o19fWkoiIJAGaRYixFlM4yQ2FK7pDOlX6q0Ty0TFQNc910f521f//sEw5VqWAAa0xN/4IJysXXPUXWj//NAxBAYQc7CX9RQAD7L1moNjonkAxWFww4nWd9JCeciFDR6QsKgKiayKccZU7pWdi9jnzTd7C9HzWNZFE6VNY70udouzEPUInt/WdLG0YKntR5SDn/rBWjQpBIJjCnEADG403RAjmT/80LEChYx1rpfU2gCXkzXRRXSZBTHSfAUM4JVGmSJvr92ZalqJzOtY1C+n3qXd7ojHpJVph9KfTv2QF00S62UsnjyUkk+pbH0Uf+akuloBUN9eziVT/Kbf//1pSuJ/YIvIGDjaERizGT/80DEDRciBtzLgWgAnyaG0C1lwTMAJBpi0QiX27oskt/p2pJGx1aanoWQ9R1FMw1JVmtN1vSNE2ZKcL4kwhTIv+7hPkVpum9/54qQNoCB5od9Wc/WVZltv//9olVqRkBpkMgFbWp6pf/zQsQLFGGq0jfYOAJYZ33eO8O4ay/WUDUrPXKa0BSIWhEPEua1Jvfvd1CxL/0T7nGsppoSEjjaf6tN1ZTTR0SRqRO/+K/Ou/9CwVOnmrcSdMqBpY56yFdrrd+BUSsXF/De07+HriXkC//zQMQVEyIO7l9IOAINDw83zXmx47coMuc54Km6W6HL5VI1dHUoFS9CrJ/FZBL1apo8Bec67a3b/1JDQt4iEv/niXtWlQKNhcSXFrNXq9RoxmJPGjO8N0UWAZDR6hQZVGYs4HkcGtuz//NCxCMcqvMKX4VQAp6GEjERDVO0nICRTDDitdHYkPnkRhZTDzS5o/yvFTPc9GLCuTkX7OXt7fseehISK578TUFArC8lNQ06n//2Gg/Jy48bb9TWcmmH//93/Fyy29rQUkjgEwC74QXH//NAxAwTWb76X8xoAtGYil8Sf13FyrazOOzs66VgJUPYvJbKXWr+myS2SrPPf1KWiiiyOpLSWjRTZFlalf//omqn///Bl/gqd4NSP1sCtUboQAq2KfAZcuompqTyWlosplpidkw4Y4D/80LEGRRiJrZdUqAAgAJMBywG+KiSmxrWtlKfMj6SV386x0gTt/1OtvvS0CizI+umWkl/XUbP1ESayKkktX93dfzztT61SAEkgBQEjccjkciAYAa39zxcaPCYCFY9Q550fgIUwErGSDn/80DEIxwS+tZfhWgDSkw83gvvZTK1Iko2tI9rLpf1mZ+b1tMy4Nm06mXyUQY9ZLXyQUJTs9RmYhzjd0y+bppJEj+8v/+81fqQYzTN1ppIW/////+pA0UgaXaVuC5FVLzhMlMyKAyi3P/zQsQNF/I62AGBiABLhOwsg1FMBUmAa4LK0kU0GslRZGmpJb+3on0EzNJjN/Rt+6CJfdTUtj6KkvV+iRcjyBCdC2XzhNFUvstzFYtImJ1Ff9ZRIj59h0HQICe1It//pYprEApJJFaBDP/zQMQJFHJu5l/GaALvVEYd0Zlq2t/CXLznyPVFYKIeRsUnRSrZNn/r6CnqdQ5i8i3q1bKfpGtS0UV2JMeKP6knf2Nf0VaLGLbf//rR0WRKyF4MhrBplw9IE232uwC4QyFzCiYsW86d//NCxBIT0nLqXgpUxo9sRW7llTyJzaqvmIaPi3VgsG/mt9ykwfCQIU3OOY04ehw7/ppOC+OfQ45TbwRmsdOf9V//3NEgtEX//4aVAAFRFv32vuC0ePWVlkuksMhlhMTeSZcTTa6TL1tX//NAxB4T0m7aXgNUnlF5nDuaJdERvfmX6mCXNcKxO/V1USAU/9yGy3Aqp/1gZFJn/1f/82RAAwvUf/9n/4aVAAEIF91+vwCeBTp6TCmP9INghMQii720i+pAnlzzrUX1IHQtju2swb//80LEKRQCbtJeAJqGnOo/ai6SKYMAWbN+pyk9BZgJk//uSoi1brV+z//mZmmHNKZ13/4fAAEADstllgF/v972towZ0QXK8AA+PC5cN0PRTdbHW9k5M9zgqso/zibfk+1ZC/skJF/61jz/80DENROyfrpeA9qODemqMKr/rUHwRS1Nq9SKD//rZIcRZmT//kUEALSZ3D//6vAmzqOlAm8FwxbwFiX8VRMT/DEsPCqRbOw8Q1mIxxtBkkSi3qAOVm6F2/FRWYSyB/bF4bP/YoK6TP/zQsRBE7JuiRpulMRYCzO1V/Bgm+3///oVNQABURf9/bgBP/8U9MW42GQb/AyP4bURvzzGIYvAhJL0x3ooCTlFLZYWlmfqPt+PdVErEQz3RZKDyTFf60vWSP/2GMeX/qsr/+oxmB0RAP/zQMROEzJqxl4CWpcBmBvv9vwBTX/L98zdfopM4GlbpJtgUn1eHHhe8yxjmqcdp+upQEuTdtU3X9x6VTAMv2qIoiG/VYg/GN7/nhJgfH2Qf0qSKab/9STkueh1IDkmklAH5fflAZLq//NCxFwT8m7CXgPall7BM4igvw7JyAbmlbrY2Zmc95UkokD/dw4U/VNjZq2TcStZukKgZTDVrng8v/mRTZa8Yre35WIl+v9boo3/1pprJU2wFQAyBI5tJABr9/77Z/CdRCLoRWqEYrN6//NAxGgUEnKcfgPaq4nSU+eNbpg1JSTemhOK12Eir1L/WdGRPphACdmzWMj7GIgg/nV/2MkNzYiH1f+MUXviFwhf5ESNESoACMgKy22UAf/oZWmPclPEoiClH5cGwN0IZce9FABAWFr/80LEchQJ8p2+BhqSJMm0Y97b+IcHG7exHP1o1ozptGFJY96zeDFv2jvm5WapBNLZ6npCx39f9//xJxaUAGauYYNH0NxP49ytAzAugiwASDuCaDUpRXKKAro0F7oKjNigqK2bCimismz/80DEfRPCbrJeUYsW2bJs07zhUJE83J52vOGiuPNiokv/+//8tONhddJC82Fk8VX//+//+L/+X8vgX38/zyBLzXnwocMyMyN5mLPJsiIzhs/AZfSMyzTJX/zT7ykZlXbe+/dxn2i68f/zQsSJFBiqZBYAXknZ3GPTCDzzqqXjKRMJwaRC8G6IQU2nG4n4GGmXKsyZrv9S/Pz0LNbNUKz3/+L//YfmT5sn3CfNUKp/vzCv+a/PzXF+sMhBLEGQyJlrOq0Ao4kKJILAayo7MqEZp//zQMSUEvNmFAAIzcjp0sip/9jKz0mW6zFUj/RP6r+xkUjlR2Mj/dbbIrGRyodjWKh2MrGEVYys5TKUSGhweBQ8NIQysZWMrlRxEYLh0SRVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//NCxKMQi2IeUAhHXVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//NAxLwR22HQAAgKnVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",finishedError:"data:audio/mpeg;base64,/+MgxAAT5BX8AUEoAP///mNkc/////1Oc/6noc/9f///85/0O///r/kI2jf+pCf/Of/6HP/znOc7znPkIQgfFzvIRjhwOChCEIQOB8Ph853yHOc/zvEA4AAAAABF/UgSPmQKhhYBw4f/4yLECxVpXpgBmYgAKgCEXoz6Bj24G4gxlPDKhgAUoFxwtiGufjWFsGbKgF+Fh4noT/8i5uaFcZgLm1i2k0Mbam8ZAiwbYX0nExHIEEx2FBBP9J3S5vA6wAAltAA+pUwHS9e7B4EtiwD/4yDEERexdr1fz2ABlQrFTFPgXqqjQRzMFqGEeDUkEbrrMjtB+lU/tcuj+umyBDN1q/2GlFesgKLdHTqWo7RktruiRwdRlfa8J/BPRN+XHtgb0Y/AzC/2cZdiQgBuTa69W4S8bMAAXP/jIsQNF0k6wVZ5xSYzp4BvjV+T2Udd8R2+On01SiRpX5PGv6QjYpD1nBt8VZ0skMc9QHq1CpqJlnhoqVPKPHZYGqnIypEyWPAo8SPz0OhX//QJmyvHu/o8qM/6CtXSAhKu34FZMGcPy//jIMQLFcmeyX5pRy5R0BZEoNVh/FruKTVBRcR5rUTQpGyFqJx7CzcOcPjqoGcWJjOrcdzfsGXZAsFs2WdUKwcLiEIhWFB7w0GpuTa0XaMGgcqzrQsz/+kNKkIAFLvgP/OonDe+4DCL/+MixA4XgpK9XsKG9sYelKU8J/UGwRrm0l9/tjMjWMAOthrqK45iONNBfxi+hbllz+raE/If6Y91Y8jnb49Kxn0WeTT6ihhKnGOj8LGIiWQHuOogUc/66H/hHf+ZgAISpdgBncq6Fj3n/+MgxAwWYfa9fnqHEiCLPLVweu/9CIz6wGZbXVpry1Kg57ZhtwxXKh82K2giB2guGug/OyF9W1JuQftstdzJ1LPcEKLR5hTreUz/iBxskEVBY+CqAyCgQoz+yuNqlTn/4AmceACjmEH/4yLEDROBjtGfTFACEdnXxxr0lwp2+ghopgB4IjWCiAiL1Fns+pLqPWoKx2ncfG0InzW1JerftHxMpxQ801HHziUMvQeK6+SzxEliW+qFqaEByyhgQELpGQIgqtQ3JzIWch4kp17kEgX/4yDEGxrBdpwBmcgA2HbmH2R4LIKeMtsKwjCc/PT00y9l+qMGDIckAycFqvMfuJz7iPxLEzFQo5sngfD9d/3Lh+njFJYublz8Q5Rf////T2+4Yc+Lz9NurVqf9g+AKTd3AE4qU1E2vP/jIsQLFHFG1N/MMAKBuH8oS/ikp9KqlSqkwegTJgTLjeYlyndKcQSsCSPJJQRk9HC1Mj+l42THqWrK1khp0NFfwKks86SKw6IipGbLX60JBY92Jgpy/gAfjbqATePy62LBPlndI3QLQ//jIMQVEzHK0D5ITaKR7RryvYmOsx1fbM6V2JJnbpavk1iJiS8JPqV6qgWaY6uxhvzoBzN51ktGpofVlW2syZxMO0b3qgp3fgAeIb4DIseOluSeSAlQn7hrzAjZSZuJ1hX4vsT7jPQ//+MixCMTSZ7MPlmQ9/X6VzdY3edjF975aHZclh+kp0dpLevY334aVbI8HpNcncwNu/n4iv+WjdUp78AD9ctNSZuODC31N8HTqGeWmtBbEAMsHqNC8I2hSomoRqXy9S0ceUx3G2Xy1HlX/+MgxDETia7EHnnS35XKZuzIM1elCplWUbSZUyasFtQGBXZtvjOkd7fyKgXdgAP2BBZD9S9RP5NG79jO2pTIwZr7J8G1gzEtzOp2ieBOgOaBuVOqMyrSjT9MjQyjbxO0deP52eZM5EX/4yLEPRPR9rgeeccSHPRatU3MJQt+RHNLSiTFR+5aqgXbiAQBNtgMw1oA6FmGT6BBFIiJwdNzPHg4GwWjwaEZMdZCYHjSgwh4y0x3apZUmcmPvrb6vn+zvD/t5itoX1ejvi2HXytG9Pf/4yDESRRRirQZT1gDn6MGwmcJJfWqPBUiBf4SQhy0VHhgDRhoxv1ZsAhtWpzFYcHZOFihgb4zFC60dOmrlmXJiSomyBZ2YpiZigYKoIYAIGkiMAiwM8MMgCyIACjNhTPqzAnwKNMoKP/jIsRSJSlqhAma0AChCECX2WopEOPhhoiCKtdUFCCgKJA0W01lY2TxupC5HD8td2jhciVYlirC37fwM/kcmq9jHKMSipK977GKSz039KNFCnN8BxNkyKQ7PaifSU06ZWbLXIRrxeNesv/jIMQZFAk6zD/MMAKWQS5DeCUx/Y3lI4WvyH8L5+c/sB9iWul3X4R9zz7SwOgUyMBtTkhABBIUn1CLs///////9YC1KgVL/IbU4pxAdm9RCY22Fl3QDjRdhcbGgh/GwR2i7lo1CmY0/+MixCMT0ZasGMPKX2VNy3/JfvZB7an/a3fEB8Ky4hh6gJUlR8Y0bs8ZsysdHzOS5lQSpSjDL8SjagVdQAPkgaNhAzDy0U7Ny7ewjcdcD9uihn7LI+uRtxwzNFzBvzo+Dh1KUoG4nLxM/+MgxC8TQaK0HnnHLvdpTPyNVqWq8ps87Xc4tp+84odaBg0EhAGhAEm9SAVb+0XZfMCMzNKdBLCfWT9Cl5ZjyQd6VlAraiTVvTti91RulyZBkwXuoV3YXmOkKVn5U0rzPNMp1ltR6t7/4yLEPRQ5lqwYw1ETceczuhocBflPuWRyT5NPfTibxXsKc3HAHohRMAuHFwWYsiboQoSDQaBHij2BTtI1iU2jto6ycFqsuHDPAswsJlcSaDHBypOCRwT6zM81yPX/lTY4KIGgWSGQ4+n/4yDESBLppsg+SYaW///sUgodAxFs3LEahGcMIGORNKMFqJMRseA8gjpVF3QapN5RoQOoQ0DWBwiRkkW4R+n8dpREBICTA00IFzMpEJUo25plEqklOrq6VWSDH6/u3crqCEL0P4bJIP/jIsRXE9ECWADD0lknZeEGlVUAgUCFiDzDzCj4WjRpT2WWWUGKhkz4qKC1QsK/ioqLN9ISFhURmfWKi3//////////QDIVFBIHgZFaTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqqqqqqqqv/jIMRjEaCVZAp5hlCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"},Object.assign($n.prototype,{elements:{start:new Ln("start",$n.MEDIA.start),click:new Ln("click",$n.MEDIA.click),actionOk:new Ln("actionOk",$n.MEDIA.actionOk),actionError:new Ln("actionError",$n.MEDIA.actionError),finishedOk:new Ln("finishedOk",$n.MEDIA.finishedOk),finishedError:new Ln("finishedError",$n.MEDIA.finishedError)},enabled:2,globalEnabled:!0});var Hn=$n;function Wn(t){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(t)}function Gn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Jn(i.key),i)}}function Jn(t){var e=function(t,e){if("object"!==Wn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Wn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Wn(e)?e:String(e)}var Kn=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.project=e,this.authors=[],this.organizations=[],this.revisions=[],this.languages=[],this.locales=[],this.description={},this.tags={}}var e,n,r;return e=t,(n=[{key:"setProperties",value:function(t){var e=this,n=null,r=[];return t.children().each((function(t,o){switch(o.nodeName){case"title":e.title=o.textContent;break;case"description":n=Nt(o);break;case"descriptions":i()(o).children().each((function(t,e){return r.push(Dt(e))}));break;case"author":e.authors.push(Mt(Dt(o)));break;case"organization":e.organizations.push(Mt(Dt(o)));break;case"revision":var s=Mt(Dt(o));s.date&&(s.date=Et(s.date)),e.revisions.push(s);break;case"language":e.languages.push(Tt(o.textContent));break;case"eventSounds":e.eventSounds=new Hn,e.eventSounds.setProperties(i()(o));break;case"skin":e.skinFileName=i()(o).attr("file");break;case"descriptors":e.tags=Dt(o,!0),e.tags["#text"]&&(e.tags.other=e.tags["#text"].textContent,delete e.tags["#text"]);break;case"license":e.license=Nt(o);break;case"cover":case"thumb":var a=Nt(o);a.file&&(e[o.nodeName]=a.file)}})),this.buildLocales(),r.forEach((function(t){t.language&&t.text&&(e.description[t.language]=t.text)})),n&&this.languages.length>0&&!this.description[this.languages[0]]&&(this.description[this.languages[0]]=n),this}},{key:"buildLocales",value:function(){var t=this;return this.languages.length>0&&window.Intl&&window.Intl.getCanonicalLocales&&(this.locales=[],this.languages.forEach((function(e){var n=/\(([a-z,A-Z,-]+)\)/.exec(e);if(n&&n.length>1)try{var i=window.Intl.getCanonicalLocales(n[1]);i&&(t.locales=t.locales.concat(i))}catch(t){wt("error","Invalid language: ".concat(e))}}))),this}},{key:"getAttributes",value:function(){return zt(this,["title","description","tags","languages","license","authors","organizations","revisions","cover","thumb","skinFileName","eventSounds"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["title","description","tags","languages","license","authors","organizations","revisions","cover","thumb","skinFileName","eventSounds"]),this.revisions&&this.revisions.forEach((function(t){t.date&&(t.date=new Date(t.date))})),this.buildLocales()}}])&&Gn(e.prototype,n),r&&Gn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(Kn.prototype,{project:null,title:"Untitled",authors:null,organizations:null,revisions:null,description:null,languages:null,tags:null,cover:null,thumb:null,license:{type:"by-nc-sa",url:"https://creativecommons.org/licenses/by-nc-sa/4.0"},locales:null,skinFileName:null,eventSounds:new Hn});var Zn=Kn;function Yn(t){return Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(t)}function Qn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Xn(i.key),i)}}function Xn(t){var e=function(t,e){if("object"!==Yn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Yn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Yn(e)?e:String(e)}var ti=function(){function t(e,n){switch(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.action=e,Yn(n)){case"string":this.sequence=n;break;case"number":this.actNum=n}}var e,n,i;return e=t,(n=[{key:"setProperties",value:function(t){return this.id=t.attr("id"),this.action=t.attr("action")||"JUMP",t.attr("tag")&&(this.sequence=ee(t.attr("tag"))),t.attr("project")&&(this.projectPath=ee(t.attr("project"))),this}},{key:"getAttributes",value:function(){return zt(this,["id","action","actNum","sequence","projectPath"])}},{key:"setAttributes",value:function(t){var e=this;return["id","action","actNum","sequence","projectPath"].forEach((function(n){$t(t[n])||(e[n]=t[n])})),this}}])&&Qn(e.prototype,n),i&&Qn(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(ti.prototype,{id:null,action:null,actNum:-1,sequence:null,projectPath:null});var ei=ti;function ni(t){return ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ni(t)}function ii(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ri(i.key),i)}}function ri(t){var e=function(t,e){if("object"!==ni(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ni(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ni(e)?e:String(e)}function oi(){return oi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ci(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},oi.apply(this,arguments)}function si(t,e){return si=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},si(t,e)}function ai(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=ci(t);if(e){var r=ci(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===ni(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function ci(t){return ci=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ci(t)}var ui=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&si(t,e)}(o,t);var e,n,i,r=ai(o);function o(t,e,n,i){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(s=r.call(this,t,e)).threshold="number"==typeof n?n:-1,s.time="number"==typeof n?i:-1,s}return e=o,(n=[{key:"setProperties",value:function(t){return oi(ci(o.prototype),"setProperties",this).call(this,t),void 0!==t.attr("threshold")&&(this.threshold=t.attr("threshold")),void 0!==t.attr("time")&&(this.time=t.attr("time")),this}},{key:"getAttributes",value:function(){return Object.assign(oi(ci(o.prototype),"getAttributes",this).call(this),zt(this,["threshold","time"]))}},{key:"setAttributes",value:function(t){var e=this;return oi(ci(o.prototype),"setAttributes",this).call(this,t),["threshold","time"].forEach((function(n){$t(t[n])||(e[n]=t[n])})),this}}])&&ii(e.prototype,n),i&&ii(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(ei);Object.assign(ui.prototype,{threshold:-1,time:-1});var li=ui;function hi(t){return hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hi(t)}function fi(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,pi(i.key),i)}}function pi(t){var e=function(t,e){if("object"!==hi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==hi(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===hi(e)?e:String(e)}function di(){return di="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mi(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},di.apply(this,arguments)}function vi(t,e){return vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vi(t,e)}function yi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=mi(t);if(e){var r=mi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===hi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function mi(t){return mi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mi(t)}var gi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vi(t,e)}(s,t);var e,n,r,o=yi(s);function s(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),o.call(this,t,e)}return e=s,(n=[{key:"setProperties",value:function(t){var e=this;return di(mi(s.prototype),"setProperties",this).call(this,t),t.children("jump").each((function(t,n){var r=(new li).setProperties(i()(n));"upper"===r.id?e.upperJump=r:"lower"===r.id&&(e.lowerJump=r)})),this}},{key:"getAttributes",value:function(){return Object.assign(di(mi(s.prototype),"getAttributes",this).call(this),zt(this,["upperJump","lowerJump"]))}},{key:"setAttributes",value:function(t){var e=this;return di(mi(s.prototype),"setAttributes",this).call(this,t),["upperJump","lowerJump"].forEach((function(n){t[n]&&(e[n]=(new li).setAttributes(t[n]))})),this}},{key:"resolveJump",value:function(t,e){var n=this;return t>=0&&e>=0&&(null!==this.upperJump&&t>this.upperJump.threshold&&(this.upperJump.time<=0||e<this.upperJump.time)?n=this.upperJump:null!==this.lowerJump&&(t<this.lowerJump.threshold||this.lowerJump.time>0&&e>this.lowerJump.time)&&(n=this.lowerJump)),n}}])&&fi(e.prototype,n),r&&fi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(ei);Object.assign(gi.prototype,{upperJump:null,lowerJump:null});var bi=gi;function wi(t){return wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wi(t)}function ki(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ai(i.key),i)}}function Ai(t){var e=function(t,e){if("object"!==wi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==wi(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===wi(e)?e:String(e)}var Si=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,(n=[{key:"setProperties",value:function(t){var e=this;return de(t.get(0).attributes,(function(t,n){switch(t){case"id":e.tag=ee(n);break;case"name":e.activity=n;break;case"description":case"navButtons":e[t]=n;break;case"delay":e[t]=Number(n)}})),t.children("jump").each((function(t,n){var r=(new bi).setProperties(i()(n));"forward"===r.id?e.fwdJump=r:"back"===r.id&&(e.backJump=r)})),this}},{key:"getAttributes",value:function(){return zt(this,["tag","description","activity","fwdJump","backJump","navButtons","delay"])}},{key:"setAttributes",value:function(t){var e=this;return["tag","description","activity","navButtons","delay"].forEach((function(n){$t(t[n])||(e[n]=t[n])})),["fwdJump","backJump"].forEach((function(n){t[n]&&(e[n]=(new bi).setAttributes(t[n]))})),this}}])&&ki(e.prototype,n),r&&ki(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(Si.prototype,{tag:null,description:null,activity:"",fwdJump:null,backJump:null,navButtons:"both",delay:0});var xi=Si;function Ci(t){return Ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ci(t)}function Oi(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Pi(i.key),i)}}function Pi(t){var e=function(t,e){if("object"!==Ci(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ci(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ci(e)?e:String(e)}var Ei=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.project=e,this.elements=[]}var e,n,r;return e=t,(n=[{key:"setProperties",value:function(t){var e=this;return t.children("item").each((function(t,n){return e.elements.push((new xi).setProperties(i()(n)))})),this}},{key:"getAttributes",value:function(){return this.elements.map((function(t){return t.getAttributes()}))}},{key:"setAttributes",value:function(t){var e=this;return t.forEach((function(t){return e.elements.push((new xi).setAttributes(t))})),this}},{key:"getElementIndex",value:function(t){return null===t?-1:this.elements.indexOf(t)}},{key:"getElement",value:function(t,e){var n=null;return t>=0&&t<this.elements.length&&(n=this.elements[t],e&&(this.currentAct=t)),n}},{key:"getElementByTag",value:function(t,e){var n=null,i=-1;return t&&(t=ee(t),this.elements.some((function(e,r){return e.tag===t&&(n=e,i=r),-1!==i})),-1!==i&&e&&(this.currentAct=i)),n}},{key:"getCurrentAct",value:function(){return this.getElement(this.currentAct,!1)}},{key:"hasNextAct",value:function(t){var e=!1,n=this.getCurrentAct();if(n)if(null===n.fwdJump)e=!0;else switch(n.fwdJump.action){case"STOP":break;case"RETURN":e=t;break;default:e=!0}return e}},{key:"hasPrevAct",value:function(t){var e=!1,n=this.getCurrentAct();if(n)if(null===n.backJump)e=!0;else switch(n.backJump.action){case"STOP":break;case"RETURN":e=t;break;default:e=!0}return e}},{key:"getNavButtonsFlag",value:function(){var t="none",e=this.getCurrentAct();return e&&(t=e.navButtons),t}},{key:"getJump",value:function(t,e){var n=this.getCurrentAct(),i=null;if(n){var r=t?n.backJump:n.fwdJump;if(null===r){var o=this.currentAct+(t?-1:1);(o>=this.elements.length||o<0)&&(o=0),i=new ei("JUMP",o)}else{var s=-1,a=-1;if(null!==e){var c=e.getCurrentSequenceInfo();null!==c&&(s=Math.round(c.tScore),a=Math.round(c.tTime/1e3))}i=r.resolveJump(s,a)}}return i}},{key:"getSequenceForElement",value:function(t){var e=null;if(t>=0&&t<this.elements.length)for(var n=t;null===e&&n>=0;n--)e=this.getElement(n,!1).tag;return e}},{key:"getElementByActivityName",value:function(t){var e=null;if(null!==t)for(var n=0;null===e&&n<this.elements.length;n++){var i=this.getElement(n,!1);i.activity.toLowerCase()===t.toLowerCase()&&(e=i)}return e}},{key:"checkCurrentActivity",value:function(t){var e=this.getCurrentAct();if(null===e||e.activity.toUpperCase()!==t.toUpperCase()){for(var n=0;n<this.elements.length;n++)if(this.getElement(n,!1).activity.toUpperCase()===t.toUpperCase())return this.currentAct=n,!1;return(e=new xi).activity=t,e.fwdJump=new bi("STOP"),e.backJump=new bi("STOP"),this.elements.push(e),this.currentAct=this.elements.length-1,!1}return!0}}])&&Oi(e.prototype,n),r&&Oi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(Ei.prototype,{elements:null,project:null,currentAct:-1});var Ti=Ei,ji=n(390),_i=n.n(ji);function Bi(t){return Bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bi(t)}function Ri(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ii(i.key),i)}}function Ii(t){var e=function(t,e){if("object"!==Bi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Bi(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Bi(e)?e:String(e)}var Di=function(){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=window&&(window.AudioContext||window.webkitAudioContext);r&&(t.prepareInstrument(i,new r),this.data=e,this.player=new(_i().Player)((function(t){return n.playEvent(t)})),this.player&&this.player.loadArrayBuffer(e))}var e,n,i;return e=t,i=[{key:"prepareInstrument",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;!1===t.loadingInstrument&&(t.loadingInstrument=!0,t.audioContext=n,_i().Soundfont.instrument(t.audioContext,e.MIDISoundFontObject||t.MIDISoundFontObject||"".concat(e.MIDISoundFontBase||t.MIDISoundFontBase,"/").concat(e.MIDISoundFontName||t.MIDISoundFontName).concat(e.MIDISoundFontExtension||t.MIDISoundFontExtension)).then((function(e){wt("info","MIDI soundfont instrument loaded"),t.instrument=e})).catch((function(t){wt("error","Error loading soundfont base instrument: ".concat(t))})))}}],(n=[{key:"pause",value:function(){this.player&&(this.player.pause(),this.startedNotes=[])}},{key:"play",value:function(){this.player&&(this.startedNotes=[],this.player.play())}},{key:"paused",get:function(){return this.player&&!this.player.isPlaying()}},{key:"ended",get:function(){return this.player&&this.player.getSongTimeRemaining()<=0}},{key:"currentTime",get:function(){return this.player&&1e3*this.player.getSongTime()||0},set:function(t){this.player&&this.player.skipToSeconds(t/1e3)}},{key:"playEvent",value:function(e){this.player&&t.instrument&&(this.playTo>0&&this.currentTime>=this.playTo?this.pause():"Controller Change"===e.name&&7===e.number?this.mainVolume=e.value/127:"Note on"===e.name&&e.velocity>0?this.startedNotes[e.noteNumber]=t.instrument.play(e.noteName,t.audioContext.currentTime,{gain:this.mainVolume*e.velocity/100*2}):"Note off"===e.name&&e.noteNumber&&this.startedNotes[e.noteNumber]&&(this.startedNotes[e.noteNumber].stop(),delete this.startedNotes[e.noteNumber]))}}])&&Ri(e.prototype,n),i&&Ri(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(Di.prototype,{data:null,player:null,playTo:0,mainVolume:1,startedNotes:[]}),Di.audioContext=null,Di.instrument=null,Di.loadingInstrument=!1,Di.MIDISoundFontObject=null,Di.MIDISoundFontBase="https://clic.xtec.cat/dist/jclic.js/soundfonts/MusyngKite",Di.MIDISoundFontName="acoustic_grand_piano",Di.MIDISoundFontExtension="-mp3.js";var Ni=Di;function Mi(t){return Mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mi(t)}function Vi(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Li(i.key),i)}}function qi(t,e,n){return(e=Li(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Li(t){var e=function(t,e){if("object"!==Mi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Mi(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Mi(e)?e:String(e)}var Fi=function(){function t(e,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e&&(this.basePath=e),n&&(this.file=ee(n),this.name=ee(n),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext&&this.checkAnimatedGif()),i&&(this.zip=i),this.timeout=Date.now()+be.LOAD_TIMEOUT}var e,n,r;return e=t,n=[{key:"setProperties",value:function(t){if(this.name=ee(t.attr("name")),this.file=ee(t.attr("file")),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext){var e=t.attr("animated");void 0===e?this.checkAnimatedGif():this.animated="true"===e}return"font"===this.type&&(this.fontName=this.name===this.file&&this.name.lastIndexOf(".")>0?this.name.substring(0,this.name.lastIndexOf(".")):this.name),this}},{key:"getAttributes",value:function(){return zt(this,["name","file","animated"])}},{key:"setAttributes",value:function(t){var e=this;return["name","file","animated"].forEach((function(n){$t(t[n])||(e[n]=t[n])})),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext&&"undefined"===this.animated&&this.checkAnimatedGif(),"font"===this.type&&(this.fontName=this.name===this.file&&this.name.lastIndexOf(".")>0?this.name.substring(0,this.name.lastIndexOf(".")):this.name),this}},{key:"checkAnimatedGif",value:function(){var t=this,e=new XMLHttpRequest;e.addEventListener("load",(function(){var n=new Uint8Array(e.response),i=n.length;if(71===n[0]&&73===n[1]&&70===n[2]&&56===n[3]){for(var r=0,o=i-3,s=0;r<o&&s<2;++r)if(0===n[r]&&33===n[r+1]&&249===n[r+2]){var a=r+4+n[r+3];if(a+1<i&&0===n[a]&&(44===n[a+1]||33===n[a+1])&&++s>1){t.animated=!0,wt("debug","Animated GIF detected: ".concat(t.file));break}}}else t.animated=!1})),this.getFullPathPromise().then((function(t){e.open("GET",t,!0),e.responseType="arraybuffer",e.send()}))}},{key:"isEmpty",value:function(){return null===this.data}},{key:"getFileType",value:function(t){var e=null;for(var n in be.FILE_TYPES)if(be.FILE_TYPES[n].indexOf(t)>=0){e=n;break}return e}},{key:"build",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return be.NODEJS&&(this.data=[],this.ready=!0),e&&(this._whenReady||(this._whenReady=[]),this._whenReady.push(e)),this.data?this.ready&&this._onReady():this.getFullPathPromise().then((function(e){switch(n.type){case"font":var a="ttf"===n.ext?"truetype":"otf"===n.ext?"embedded-opentype":n.ext;pe('@font-face{font-family:"'.concat(n.fontName,'";src:url(').concat(e,') format("').concat(a,'");}'),r),n.data=new Ie(n.name),n.ready=!0;break;case"image":n.data=new Image,n.data.addEventListener("load",(function(){n._onReady.call(n)}),{once:!0}),n.data.src=e;break;case"video":n.data=document.createElement(n.type),n.data.addEventListener("canplay",(function(){n._onReady.call(n)}),{once:!0}),n.data.src=e,n.data.load(),n.data.pause();break;case"audio":if(o){var c=t._currentAudioElements[s];c&&c!==n&&(c.data=null,c.ready=!1),t._currentAudioElements[s]=n;var u=t.getAudioPlayer(s);u.src!==e?(wt("trace","Loading static player #".concat(s," with new audio: ").concat(e)),n.data=u,n.ready=!1,u.addEventListener("canplay",(function(){n._onReady.call(n)}),{once:!0}),u.src=e,u.load(),u.pause()):wt("trace","Reusing existing audio in player #".concat(s,": ").concat(e))}else n.ready=!0;break;case"anim":n.data=i()('<object type"application/x-shockwave-flash" width="300" height="200" data="'.concat(e,'"/>')).get(-1),n.ready=!0;break;case"xml":i().get(e,null,null,"xml").done((function(t){var e=t?t.children||t.childNodes:null;n.data=e&&e.length>0?Dt(e[0]):null,n._onReady()})).fail((function(t){wt("error","Error loading ".concat(n.name,": ").concat(t)),n._onReady()}));break;case"midi":var l=new XMLHttpRequest;l.onreadystatechange=function(){4===l.readyState&&(200===l.status?n.data=new Ni(l.response,r&&r.options):wt("error","Error loading ".concat(n.name,": ").concat(l.statusText)),n._onReady())},l.open("GET",e,!0),l.responseType="arraybuffer",l.send();break;default:wt("trace","Media currently not supported: ".concat(n.name)),n.ready=!0}n.ready&&n._onReady()})),this}},{key:"checkReady",value:function(){if(this.data&&!this.ready)switch(this.type){case"image":this.ready=!0===this.data.complete;break;case"audio":case"video":case"anim":this.ready=this.data.readyState>=1;break;default:this.ready=!0}return this.ready}},{key:"checkTimeout",value:function(){var t=Date.now()>this.timeout;return t&&wt("warn","Timeout while loading: ".concat(this.name)),t}},{key:"_onReady",value:function(){var t=this;this.ready=!0,this._whenReady&&(this._whenReady.forEach((function(e){return e.call(t,t)})),this._whenReady=null)}},{key:"getFullPath",value:function(){return this._fullPath}},{key:"getFullPathPromise",value:function(){var t=this;return se(this.basePath,this.file,this.zip).then((function(e){return t._fullPath=be.NODEJS?e:new URL(e,document.location.href).toString(),t._fullPath}))}}],r=[{key:"getAudioPlayer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return t._audioPlayers[e]||(t._audioPlayers[e]=document.createElement("audio")),t._audioPlayers[e]}},{key:"resetAudioElements",value:function(){t._audioPlayers.fill(null),t._currentAudioElements.fill(null)}}],n&&Vi(e.prototype,n),r&&Vi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();qi(Fi,"_audioPlayers",[]),qi(Fi,"_currentAudioElements",[]),Object.assign(Fi.prototype,{name:"",file:"",fontName:"",basePath:"",zip:null,data:null,ready:!1,_whenReady:null,ext:"",type:null,timeout:0,animated:!1,_fullPath:null});var zi=Fi;function Ui(t){return Ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ui(t)}function $i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Hi(i.key),i)}}function Hi(t){var e=function(t,e){if("object"!==Ui(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ui(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ui(e)?e:String(e)}var Wi=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.project=e,this.elements={}}var e,n,r;return e=t,(n=[{key:"setProperties",value:function(t){var e=this;return t.children("media").each((function(t,n){var r=new zi(e.project.basePath,null,e.project.zip);r.setProperties(i()(n)),e.elements[r.name]=r})),this}},{key:"getAttributes",value:function(){var t=this;return Object.keys(this.elements).map((function(e){return t.elements[e].getAttributes()}))}},{key:"setAttributes",value:function(t){var e=this;return t.forEach((function(t){var n=new zi(e.project.basePath,null,e.project.zip);n.setAttributes(t),e.elements[n.name]=n})),this}},{key:"getElement",value:function(t,e){t=ee(t);var n=this.elements[t];return e&&!n&&(n=this.getElementByFileName(t,e)),n}},{key:"getElementByFileName",value:function(t,e){var n=null;if(t){for(var i in t=ee(t),this.elements)if(this.elements[i].file===t){n=this.elements[i];break}!n&&e&&((n=new zi(this.project.basePath,null,this.project.zip)).name=t,n.file=t,n.ext=t.toLowerCase().split("#")[0].split(".").pop(),n.type=n.getFileType(n.ext),this.elements[n.name]=n)}return n}},{key:"getElementsOfType",value:function(t){var e=[];return i().each(this.elements,(function(n,i){i.type===t&&e.push("font"===t?i.fontName:n)})),e}},{key:"buildAll",value:function(t,e,n){var r=0;return i().each(this.elements,(function(i,o){t&&o.type!==t||(o.build(e,n,!1),r++)})),r}},{key:"countWaitingElements",value:function(){var t=0,e=!0;return i().each(this.elements,(function(n,i){!i.data||i.ready||i.checkReady()||i.checkTimeout()?t++:(wt("debug","... waiting for: %s",n),e=!1)})),e?-1:t}},{key:"getSkinElement",value:function(t,e){return Tn.getSkin(t,e)}}])&&$i(e.prototype,n),r&&$i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(Wi.prototype,{elements:null,project:null});var Gi=Wi;function Ji(t){return Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ji(t)}function Ki(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Zi(i.key),i)}}function Zi(t){var e=function(t,e){if("object"!==Ji(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ji(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ji(e)?e:String(e)}var Yi=be.BoxBase,Qi=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.parent=e||null}var e,n,r;return e=t,n=[{key:"setProperties",value:function(t){var e=this;return de(t.get(0).attributes,(function(t,n){switch(t){case"shadow":case"transparent":e[t]=kt(n,!1);break;case"margin":e[t]=Number(n);break;case"borderStroke":e.borderStroke=new Ne(Number(n));break;case"markerStroke":e.markerStroke=new Ne(Number(n))}})),t.children().each((function(t,n){var r=i()(n);switch(n.nodeName){case"font":e.font=(new Ie).setProperties(r);break;case"gradient":e.bgGradient=(new De).setProperties(r);break;case"color":e.textColor=Vt(r.attr("foreground"),e.textColor),e.backColor=Vt(r.attr("background"),e.backColor),e.shadowColor=Vt(r.attr("shadow"),e.shadowColor),e.inactiveColor=Vt(r.attr("inactive"),e.inactiveColor),e.alternativeColor=Vt(r.attr("alternative"),e.alternativeColor),e.borderColor=Vt(r.attr("border"),e.borderColor)}})),this}},{key:"getAttributes",value:function(){return zt(this,["shadow","transparent","margin","borderStroke","markerStroke","font","bgGradient","textColor|".concat(t.prototype.textColor),"backColor|".concat(t.prototype.backColor),"shadowColor|".concat(t.prototype.shadowColor),"inactiveColor|".concat(t.prototype.inactiveColor),"alternativeColor|".concat(t.prototype.alternativeColor),"borderColor|".concat(t.prototype.borderColor)])}},{key:"setAttributes",value:function(t){return Ht(this,t,["shadow","transparent","margin",{key:"borderStroke",fn:Ne},{key:"markerStroke",fn:Ne},{key:"font",fn:Ie},{key:"bgGradient",fn:De},"textColor","backColor","shadowColor","inactiveColor","alternativeColor","borderColor"])}},{key:"get",value:function(t){return this.hasOwnProperty(t)||null===this.parent?this[t]:this.parent.get(t)}},{key:"set",value:function(t,e){return this[t]=e,this}},{key:"getOwn",value:function(e){return this.hasOwnProperty(e)?this[e]:null!==this.parent?this.parent.getOwn(e):("object"===Ji(this[e])?this[e]=Lt(t.prototype[e]):this[e]=t.prototype[e],this[e])}},{key:"getCSS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.get("font");(t=r.toCss(t)).color=n?this.get("backColor"):i?this.get("alternativeColor"):this.get("textColor");var o=this.get("transparent");t["background-color"]=o?"transparent":e?this.get("inactiveColor"):n?this.get("textColor"):this.get("backColor");var s=this.get("bgGradient");if(s&&!o&&(t["background-image"]=s.getCss()),1===this.shadow){var a=Math.max(1,Math.round(r.size/10)),c=this.get("shadowColor");t["text-shadow"]="".concat(a,"px ").concat(a,"px 3px ").concat(c)}return t}},{key:"prepareText",value:function(t,e,n,i){var r=[],o=this.get("font"),s=o.getHeight(),a=0,c=e.trim().split("\n");t.font=o.cssFont();for(var u=0;u<c.length;u++){var l=c[u].trim(),h=t.measureText(l).width;if(h>n){for(var f=0,p=0,d=0;d<l.length;d++)if(Gt(l[d])){var v=t.measureText(l.substr(0,d).trim()).width;if(v>n)break;f=d,p=v}if(f>0)c.splice(u+1,0,l.substr(f+1).trim()),l=c[u]=l.substr(0,f).trim(),h=p;else if(o.size>Yi.MIN_FONT_SIZE)return this.getOwn("font").zoom(-1),this.prepareText(t,e,n,i)}if(r.push({text:l,size:new Ve(h,s)}),(a+=s)>i&&o.size>Yi.MIN_FONT_SIZE)return this.getOwn("font").zoom(-1),this.prepareText(t,e,n,i)}return r}}],n&&Ki(e.prototype,n),r&&Ki(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(Qi.prototype,{parent:null,default:Yi,font:new Ie,dynFontSize:0,resetFontCounter:0,backColor:Yi.BACK_COLOR,bgGradient:null,textColor:Yi.TEXT_COLOR,shadowColor:Yi.SHADOW_COLOR,borderColor:Yi.BORDER_COLOR,inactiveColor:Yi.INACTIVE_COLOR,alternativeColor:Yi.ALTERNATIVE_COLOR,shadow:!1,transparent:!1,dontFill:!1,textMargin:Yi.AC_MARGIN,borderStroke:new Ne(Yi.BORDER_STROKE_WIDTH),markerStroke:new Ne(Yi.MARKER_STROKE_WIDTH)}),Qi.DEFAULT_BOX_BASE=new Qi;var Xi=Qi;function tr(t){return tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tr(t)}function er(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nr(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,rr(i.key),i)}}function ir(t,e,n){return e&&nr(t.prototype,e),n&&nr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function rr(t){var e=function(t,e){if("object"!==tr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==tr(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===tr(e)?e:String(e)}var or=function(){function t(e,n){er(this,t),e&&(this.h=e),n&&(this.v=n)}return ir(t,[{key:"getAttributes",value:function(){return zt(this,["h|center","v|center"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["h","v"])}}]),t}();Object.assign(or.prototype,{h:"center",v:"center"});var sr=function(){function t(e){er(this,t),void 0!==e&&(this.id=e),this.imgAlign=new or,this.txtAlign=new or}return ir(t,[{key:"setProperties",value:function(t,e){var n=this;return de(t.get(0).attributes,(function(t,e){switch(t){case"id":case"item":n[t]=Number(e);break;case"width":case"height":null===n.dimension&&(n.dimension=new Ve(0,0)),n.dimension[t]=Number(e);break;case"txtAlign":case"imgAlign":n[t]=n.readAlign(e);break;case"hAlign":n.txtAlign=n.readAlign(e+",center"),n.imgAlign=n.readAlign(e+",center");break;case"border":case"avoidOverlapping":n[t]=kt(e);break;case"image":n.image=ee(e)}})),t.children().each((function(t,e){var r=i()(e);switch(e.nodeName){case"style":n.style=new Xi(null).setProperties(r);break;case"media":n.mediaContent=(new Dn).setProperties(r);break;case"p":null===n.text?n.text="":n.text+="\n",n.text+=e.textContent}})),e&&this.realizeContent(e),this}},{key:"getAttributes",value:function(){return zt(this,["id","item","dimension","border","avoidOverlapping","image","text","objectType","txtAlign","imgAlign","style","mediaContent"])}},{key:"setAttributes",value:function(t,e){return"string"==typeof t?this.text=t:Ht(this,t,["id","item","border","avoidOverlapping","image","text","objectType",{key:"dimension",fn:Ve},{key:"txtAlign",fn:or},{key:"imgAlign",fn:or},{key:"style",fn:Xi},{key:"mediaContent",fn:Dn}]),e&&this.realizeContent(e),this}},{key:"readAlign",value:function(t){var e=new or;if(t){var n=t.split(",");e.h=n[0].replace("middle","center"),e.v=n[1].replace("middle","center")}return e}},{key:"isEmpty",value:function(){return null===this.text&&null===this.img}},{key:"isEquivalent",value:function(t,e){if(t===this)return!0;var n=!1;return null!==t&&(n=this.isEmpty()&&t.isEmpty()?this.id===t.id:(null===this.text?null===t.text:e?this.text===t.text:this.text.toLocaleLowerCase()===t.text.toLocaleLowerCase())&&(null===this.mediaContent?null===t.mediaContent:this.mediaContent.isEquivalent(t.mediaContent))&&this.img===t.img&&(null===this.imgClip?null===t.imgClip:this.imgClip.equals(t.imgClip))),n}},{key:"setTextContent",value:function(t){null!==t?(this.text=t,this.checkHtmlText()):(this.text=null,this.innerHtmlText=null)}},{key:"checkHtmlText",value:function(){if(this.innerHtmlText=null,te(this.text,"<html>",!0)){var t=this.text.trim(),e=t.toLocaleLowerCase();if(-1===e.indexOf("<body")){var n=e.indexOf("</html>");n>=0&&(this.innerHtmlText=t.substr(6,n))}}}},{key:"setImgContent",value:function(t,e,n){this.img=t,this.image=null,this.imgClip=e,n&&(this.animatedGifFile=n)}},{key:"prepareMedia",value:function(t){!this.amp&&this.mediaContent&&"PLAY_VIDEO"===this.mediaContent.type&&(this.amp=t.getActiveMediaPlayer(this.mediaContent),this.amp.realize())}},{key:"realizeContent",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;null!==this.image&&this.image.length>0&&(this.mbe=t.getElement(this.image,!0),this.mbe&&this.mbe.build((function(){e.img=e.mbe.data,e.animatedGifFile=e.mbe.animated?e.mbe.getFullPath():null}),n,!0)),null!==this.mediaContent&&(null!==this.image||null!==this.text&&0!==this.text.length||(this.img=this.mediaContent.getIcon(),this.animatedGifFile=null)),this.checkHtmlText(t)}},{key:"getDescription",value:function(){var t=[];return this.text&&this.text.length&&t.push(this.text),this.image&&t.push("".concat(gt("image")," ").concat(this.image)),this.imgClip&&t.push(this.imgClip.toString()),this.mediaContent&&t.push(this.mediaContent.getDescription()),t.join(" ")}},{key:"toString",value:function(){var t=[];return this.text&&this.text.length&&t.push(this.text),this.image&&t.push("".concat(gt("image")," ").concat(this.image)),this.imgClip&&t.push("".concat(gt("image fragment")," ").concat((this.id>=0?this.id:this.item)+1)),t.join(" ")||gt("cell")}}]),t}();Object.assign(sr.prototype,{style:null,dimension:null,border:null,text:null,image:null,imgClip:null,mediaContent:null,imgAlign:null,txtAlign:null,avoidOverlapping:!1,id:-1,item:-1,img:null,animatedGifFile:null,innerHtmlText:null,amp:null,mbe:null}),sr.EMPTY_CONTENT=new sr;var ar=sr;function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function ur(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,lr(i.key),i)}}function lr(t){var e=function(t,e){if("object"!==cr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==cr(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===cr(e)?e:String(e)}var hr=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.reset(e,n)}var e,n,r;return e=t,n=[{key:"reset",value:function(t,e){this.nCols=t,this.nRows=e,this.nCells=e*t,this.initiated=!1,this.shapeData=[];for(var n=0;n<this.nCells;n++)this.shapeData[n]=new ze}},{key:"setProperties",value:function(e){var n=this;return de(e.get(0).attributes,(function(t,e){switch(t){case"class":n.className=e;break;case"cols":n.nCols=Number(e);break;case"rows":n.nRows=Number(e);break;case"baseWidthFactor":case"toothHeightFactor":case"scaleX":case"scaleY":n[t]=Number(e);break;case"randomLines":case"showEnclosure":n[t]=kt(e,!0)}})),e.children("enclosing:first").each((function(e,r){i()(r).children("shape:first").each((function(e,i){var r=t.readShapeData(i,n.scaleX,n.scaleY);n.enclosing=r,n.showEnclosure=!0,n.hasRemainder=!0}))})),e.children("shape").each((function(e,i){n.shapeData[e]=t.readShapeData(i,n.scaleX,n.scaleY)})),this.shapeData.length>0&&(this.nCells=this.shapeData.length),this}},{key:"getAttributes",value:function(){var t=["className","nCols","nRows","baseWidthFactor","toothHeightFactor","scaleX","scaleY","randomLines"];return this.customShapes&&["showEnclosure","hasRemainder","enclosing","shapeData"].forEach((function(e){return t.push(e)})),zt(this,t)}},{key:"buildShapes",value:function(){}},{key:"getShape",value:function(t,e){return this.initiated||this.buildShapes(),t>=this.nCells||null===this.shapeData[t]?null:this.shapeData[t].getShape(e)}},{key:"getShapeData",value:function(t){return t>=0&&t<this.shapeData.length?this.shapeData[t]:null}},{key:"getEnclosingShapeData",value:function(){return new Ue(0,0,1,1)}},{key:"getRemainderShape",value:function(t){if(!this.hasRemainder)return null;this.initiated||this.buildShapes();for(var e=this.getEnclosingShapeData(),n=e?e.getShape(t):new Ue,i=0;i<this.nCells;i++)this.shapeData[i]&&n.add(this.shapeData[i].getShape(t),!1);return n}}],r=[{key:"registerClass",value:function(e,n){return t.CLASSES[e]=n,n}},{key:"getShaper",value:function(e,n,i){var r=t.CLASSES[(e||"").replace(/^edu\.xtec\.jclic\.shapers\./,"@")];return r||wt("error","Unknown shaper: ".concat(e)),r?new r(n,i):null}},{key:"readShapeData",value:function(t,e,n){var r=[],o=null;return i().each(t.textContent.split("|"),(function(t,i){var s=i.split(":"),a=s.length>1?s[1].split(","):null;switch(a&&(a=a.map((function(t,i){return t/(i%2?n:e)}))),s[0]){case"rectangle":o=new Ue(a[0],a[1],a[2],a[3]);break;case"ellipse":o=new $e(a[0],a[1],a[2],a[3]);break;default:r.push(new We(s[0],a))}})),!o&&r.length>0?new He(r):o}},{key:"factory",value:function(e){var n=t.getShaper(e.className,e.nCols,e.nRows);return Ht(n,e,["className","nCols","nRows","baseWidthFactor","toothHeightFactor","scaleX","scaleY","randomLines","showEnclosure","hasRemainder",{key:"enclosing",fn:ze},{key:"shapeData",fn:ze,group:"array"}]),n.nCells=n.shapeData.length||n.nCols*n.nRows,n}}],n&&ur(e.prototype,n),r&&ur(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(hr.prototype,{className:"Shaper",nCols:0,nRows:0,nCells:0,shapeData:null,initiated:!1,baseWidthFactor:1/3,toothHeightFactor:1/6,randomLines:!1,scaleX:1,scaleY:1,enclosing:null,showEnclosure:!1,rectangularShapes:!1,hasRemainder:!1,customShapes:!1}),hr.CLASSES={};var fr=hr;function pr(t){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pr(t)}function dr(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,vr(i.key),i)}}function vr(t){var e=function(t,e){if("object"!==pr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==pr(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===pr(e)?e:String(e)}var yr=function(){function t(e,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e&&(this.id=e),this.cells=[],this.ncw=Math.max(1,n),this.nch=Math.max(1,i)}var e,n,r;return e=t,n=[{key:"setProperties",value:function(t,e){var n=this,r=!1;if(de(t.get(0).attributes,(function(t,e){switch(t){case"id":n.id=e;break;case"image":n.image=ee(e);break;case"rows":n.nch=Number(e);break;case"columns":r=!0;case"cols":n.ncw=Number(e);break;case"cellWidth":n.w=Number(e);break;case"cellHeight":n.h=Number(e);break;case"border":n.border=kt(e)}})),r){var o=this.ncw;this.ncw=this.nch,this.nch=o}t.children().each((function(t,r){var o=i()(r);switch(r.nodeName){case"style":n.style=new Xi(null).setProperties(o);break;case"shaper":var s=o.attr("class"),a=Math.max(1,o.attr("cols")),c=Math.max(1,o.attr("rows"));n.shaper=fr.getShaper(s,a,c),n.shaper.setProperties(o);break;case"ids":n.ids=r.textContent,n.ids.split(" ").forEach((function(t,e){n.cells[e]=new ar(Number(t))}));break;case"cell":n.cells.push((new ar).setProperties(o,e))}}));var s=this.cells.length;if(0===s&&this.shaper&&this.shaper.nCells>0&&(this.initiallyEmptyCells=!0,s=this.shaper.nCells,this.getActiveBoxContent(s-1)),s>0){for(var a=!0,c=0;c<s;c++){var u=this.getActiveBoxContent(c);if(-1!==u.id||-1!==u.item||!u.isEmpty()){a=!1;break}}if(a)for(var l=0;l<s;l++)this.getActiveBoxContent(l).id=l}return this.style&&this.cells.forEach((function(t){t.style&&(t.style.parent=n.style)})),this}},{key:"getAttributes",value:function(){var t=["id","image","ncw","nch","w","h","border","style","shaper"];return this.initiallyEmptyCells||t.push(this.ids?"ids":"cells"),zt(this,t)}},{key:"setAttributes",value:function(t,e){var n=this;Ht(this,t,["id","image","ncw","nch","w","h","border",{key:"style",fn:Xi},{key:"shaper",fn:fr},"ids",{key:"cells",fn:ar,group:"array",params:[e]}]);var i=this.cells.length;if(0===i&&this.shaper&&this.shaper.nCells>0&&(this.initiallyEmptyCells=!0,i=this.shaper.nCells,this.getActiveBoxContent(i-1),this.ids&&this.ids.split(" ").forEach((function(t,e){n.getActiveBoxContent(e).id=Number(t)}))),i>0){for(var r=!0,o=0;o<i;o++){var s=this.getActiveBoxContent(o);if(-1!==s.id||-1!==s.item||!s.isEmpty()){r=!1;break}}if(r)for(var a=0;a<i;a++)this.getActiveBoxContent(a).id=a}return this.style&&this.cells.forEach((function(t){t.style&&(t.style.parent=n.style)})),e&&this.cells.forEach((function(t){return t.realizeContent(e)})),this}},{key:"prepareMedia",value:function(t){this.cells.forEach((function(e){return e.prepareMedia(t)}))}},{key:"getTotalWidth",value:function(){return this.w*this.ncw}},{key:"getTotalHeight",value:function(){return this.h*this.nch}},{key:"getNumCells",value:function(){return this.cells.length}},{key:"isEmpty",value:function(){return 0===this.cells.length}},{key:"getShaper",value:function(){return null===this.shaper&&(this.shaper=fr.getShaper("@Rectangular",this.ncw,this.nch)),this.shaper}},{key:"getBoxBase",value:function(){return null===this.style&&(this.style=new Xi),this.style}},{key:"addActiveBoxContent",value:function(t){this.cells.push(t),0!==this.ncw&&0!==this.nch||(this.ncw=this.nch=1)}},{key:"getActiveBoxContent",value:function(t){if(t>=this.cells.length)for(var e=this.cells.length;e<=t;e++)this.cells.push(new ar);return this.cells[t]}},{key:"getActiveBoxContentWith",value:function(t,e){return this.cells.find((function(n){return n.id===t&&n.item===e}))}},{key:"setImgContent",value:function(t,e,n){e&&this.setShaper(e),"@Holes"===this.shaper.className&&(this.shaper.hasRemainder=!0),this.ncw=this.shaper.nCols,this.nch=this.shaper.nRows;var i=t.elements[this.image];t&&this.image&&i&&i.ready?(this.img=i.data,i.animated&&(this.animatedGifFile=i.getFullPath()),this.w=this.img.width/this.ncw,this.h=this.img.height/this.nch,n&&(this.w=Math.round(this.w),this.h=Math.round(this.h))):(this.img=null,this.w=Math.max(this.w,10),this.h=Math.max(this.h,10));for(var r=new Ue(0,0,this.w*this.ncw,this.h*this.nch),o=0;o<this.shaper.nCells;o++)this.getActiveBoxContent(o).setImgContent(this.img,this.shaper.getShape(o,r),this.animatedGifFile);this.shaper.hasRemainder&&(this.backgroundContent=new ar,this.backgroundContent.setImgContent(this.img,this.shaper.getRemainderShape(r)))}},{key:"setTextContent",value:function(t,e,n){this.ncw=Math.max(1,e),this.nch=Math.max(1,n);for(var i=this.ncw*this.nch,r=0;r<i;r++)this.getActiveBoxContent(r).setTextContent(r>=t.length||null===t[r]?"":t[r])}},{key:"setIds",value:function(t){for(var e=0;e<t.length&&e<this.cells.length;e++)this.getActiveBoxContent(e).id=t[e]}},{key:"setCellsAttribute",value:function(t,e){this.cells.forEach((function(n){return n[t]=e}))}},{key:"avoidAllIdsNull",value:function(t){this.cells.every((function(t){return-1===t.id}))&&(t=Math.max(1,t),this.cells.forEach((function(e,n){e.id=n%t})))}}],n&&dr(e.prototype,n),r&&dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(yr.prototype,{id:"primary",image:null,img:null,animatedGifFile:null,ncw:1,nch:1,w:be.DEFAULT_GRID_ELEMENT_SIZE,h:be.DEFAULT_GRID_ELEMENT_SIZE,border:!0,style:null,shaper:null,backgroundContent:null,cells:null,defaultIdValue:-1,ids:null});var mr=yr;function gr(t){return gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gr(t)}function br(t){return function(t){if(Array.isArray(t))return wr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return wr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function kr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ar(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,xr(i.key),i)}}function Sr(t,e,n){return e&&Ar(t.prototype,e),n&&Ar(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function xr(t){var e=function(t,e){if("object"!==gr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==gr(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===gr(e)?e:String(e)}var Cr=function(){function t(){kr(this,t)}return Sr(t,[{key:"setProperties",value:function(t){return this.className=(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),this}},{key:"getAttributes",value:function(){return zt(this,["className"])}},{key:"init",value:function(){}},{key:"generateContent",value:function(e,n,i,r){return this.process(new t.ActiveBagContentKit(e,n,i,r))}},{key:"process",value:function(t){return!1}}],[{key:"getProvider",value:function(e){var n=null;if(e){var i=(e.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),r=t.CLASSES[i];r?(n=new r).setProperties(e):wt("error","Unknown AutoContentProvider class: ".concat(i))}return n}},{key:"factory",value:function(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(n=new(0,t.CLASSES[e.className])).setAttributes.apply(n,[e].concat(br(i)))}},{key:"registerClass",value:function(e,n){return t.CLASSES[e]=n,n}}]),t}();Object.assign(Cr.prototype,{numericContent:!1}),Cr.ActiveBagContentKit=function(){return Sr((function t(e,n,i,r){kr(this,t),this.nRows=e,this.nCols=n,this.content=i,this.useIds=r}))}(),Cr.CLASSES={"@tagreplace.TagReplace":Cr},Cr.registerClass("@tagreplace.TagReplace",Cr);var Or=Cr;function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}function Er(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Tr(i.key),i)}}function Tr(t){var e=function(t,e){if("object"!==Pr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Pr(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Pr(e)?e:String(e)}var jr=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.style=new Xi(null),this.text=[]}var e,n,r;return e=t,(n=[{key:"setProperties",value:function(t){var e=this;de(t.get(0).attributes,(function(t,n){switch(t){case"rows":e.ncw=Number(n);break;case"columns":e.nch=Number(n);break;case"cellWidth":e.w=Number(n);break;case"cellHeight":e.h=Number(n);break;case"border":e.border=kt(n);break;case"wild":case"randomChars":e[t]=n}})),t.children("style:first").each((function(t,n){e.style=(new Xi).setProperties(i()(n))})),t.find("text:first > row").each((function(t,n){return e.text.push(n.textContent)}));for(var n=this.text.length;n<this.nch;n++)this.text[n]="";return this}},{key:"getAttributes",value:function(){return zt(this,["ncw","nch","w","h","text","style","border","wild|*","randomChars|".concat(be.RANDOM_CHARS)])}},{key:"setAttributes",value:function(t){return Ht(this,t,["ncw","nch","w","h","text",{key:"style",fn:Xi},"border","wild","randomChars"])}},{key:"countWildChars",value:function(){var t=0;if(this.text)for(var e=0;e<this.nch;e++)for(var n=0;n<this.ncw;n++)this.text[e].charAt(n)===this.wild&&t++;return t}},{key:"getNumChars",value:function(){return this.ncw*this.nch}},{key:"setCharAt",value:function(t,e,n){t>=0&&t<this.ncw&&e>=0&&e<this.nch&&(this.text[e]=this.text[e].substring(0,t)+n+this.text[e].substring(t+1))}}])&&Er(e.prototype,n),r&&Er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(jr.prototype,{ncw:1,nch:1,w:20,h:20,border:!1,style:null,text:null,wild:"*",randomChars:be.RANDOM_CHARS});var _r=jr;function Br(t){return Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(t)}function Rr(){return Rr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mr(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Rr.apply(this,arguments)}function Ir(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dr(t,e)}function Dr(t,e){return Dr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dr(t,e)}function Nr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Mr(t);if(e){var r=Mr(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Br(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Mr(t){return Mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mr(t)}function Vr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qr(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Fr(i.key),i)}}function Lr(t,e,n){return e&&qr(t.prototype,e),n&&qr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Fr(t){var e=function(t,e){if("object"!==Br(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Br(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Br(e)?e:String(e)}var zr=function(){function t(e){var n=this;Vr(this,t),this.className=e,this.collator=window.Intl&&window.Intl.Collator?new window.Intl.Collator:{compare:function(t,e){return n.checkCase?t===e:t.toUpperCase()===e.toUpperCase()}}}return Lr(t,[{key:"setProperties",value:function(t){var e=this;return de(t.get(0).attributes,(function(t,n){switch(t){case"class":e.className=n;break;case"checkCase":case"checkAccents":case"checkPunctuation":case"checkDoubleSpaces":case"detail":e[t]=kt(n);break;case"checkSteps":case"checkScope":e[t]=Number(n)}})),this}},{key:"getAttributes",value:function(){return zt(this,["className","checkCase","checkAccents","checkPunctuation","checkDoubleSpaces","detail","checkSteps","checkScope"])}},{key:"init",value:function(t){this.initiated=!0}},{key:"checkText",value:function(t,e){var n=this;return e instanceof Array?e.some((function(e){return n._checkText(t,e)})):!!e&&this._checkText(t,e)}},{key:"_checkText",value:function(t,e){return!1}},{key:"evalText",value:function(t,e){return e instanceof Array||(e=[e]),this._evalText(t,e)}},{key:"_evalText",value:function(t,e){return[]}},{key:"isOk",value:function(t){return t&&t.length>0&&!t.some((function(t){return 0!==t}))}}],[{key:"getEvaluator",value:function(e){var n=null;if(e){var i=e.attr("class"),r=t.CLASSES[i];r?(n=new r(i)).setProperties(e):wt("error",'Unknown evaluator class: "'.concat(i,'"'))}return n}},{key:"factory",value:function(e){var n=t.CLASSES[e.className];return n?Ht(new n(e.className),e,["className","checkCase","checkAccents","checkPunctuation","checkDoubleSpaces","detail","checkSteps","checkScope"]):null}}]),t}();Object.assign(zr.prototype,{className:null,initiated:!1,collator:null,checkCase:!1});var Ur=function(t){Ir(n,t);var e=Nr(n);function n(t){return Vr(this,n),e.call(this,t)}return Lr(n,[{key:"init",value:function(t){Rr(Mr(n.prototype),"init",this).call(this,[t]),window.Intl&&window.Intl.Collator&&(this.collator=new window.Intl.Collator(t,{sensitivity:this.checkAccents?this.checkCase?"case":"accent":"base",ignorePunctuation:!this.checkPunctuation}))}},{key:"_checkText",value:function(t,e){return 0===this.collator.compare(this.getClearedText(t),this.getClearedText(e))}},{key:"_evalText",value:function(t,e){return Array(t.length).fill(this._checkText(t,e[0])?0:1)}},{key:"getClearedText",value:function(t,e){if(this.checkPunctuation&&this.checkDoubleSpaces)return t;e||(e=Array(t.length).fill(!1));for(var n="",i=0,r=!1;i<t.length;i++){var o=t.charAt(i);this.PUNCTUATION.indexOf(o)>=0&&!this.checkPunctuation?(r?e[i]=!0:n+=" ",r=!0):" "===o?(this.checkDoubleSpaces||!r?n+=o:e[i]=!0,r=!0):(r=!1,n+=o)}return n}}]),n}(zr);Object.assign(Ur.prototype,{checkAccents:!0,checkPunctuation:!0,checkDoubleSpaces:!1,PUNCTUATION:".,;:"});var $r=function(t){Ir(n,t);var e=Nr(n);function n(t){return Vr(this,n),e.call(this,t)}return Lr(n,[{key:"_evalText",value:function(t,e){if(!this.detail)return Rr(Mr(n.prototype),"_evalText",this).call(this,t,e);for(var i=Array(t.length).fill(!1),r=this.getClearedText(t,i),o=Array(e.length),s=Array(e.length),a=Array(t.length),c=-1,u=-1,l=0;l<e.length;l++){s[l]=Array(t.length).fill(0);var h=this.compareSegment(r,r.length,e[l],e[l].length,s[l],!1);o[l]=this.countFlagsOk(s[l]),h&&(u=l,c=o[l])}if(-1===u)for(var f=0;f<e.length;f++)o[f]>c&&(c=o[f],u=f);for(var p=0,d=0;p<t.length;p++)a[p]=i[p]?0:s[u][d++];return a}},{key:"countFlagsOk",value:function(t){return t.reduce((function(t,e){return 0==e?++t:t}),0)}},{key:"compareSegment",value:function(t,e,n,i,r,o){var s=0,a=0,c=0,u=!0,l=!0,h="",f="";if(0===e||0===i||null===t||null===n)return!1;for(;s<e;s++,a++)if(h=t.charAt(s),c=s,f=a>=0&&a<i?n.charAt(a):0,0===this.collator.compare(h,f))r[s]=0,u=!0;else if(l=!1,r[s]=1,!o&&u&&0!==f&&this.checkSteps>0&&this.checkScope>0){for(var p=2*this.checkSteps+1,d=[],v=0,y=0;y<p;y++)if(d[y]=0,!((v=a+Math.floor((y+1)/2)*(0!=(1&y)?1:-1))>=i)){var m=v<0?s-v:s;if(!(m>=e)){var g=Math.min(e-m,this.checkScope),b=v<0?0:v,w=Math.min(i-b,this.checkScope),k=Array(t.length-m).fill(0),A=this.compareSegment(t.substring(m),g,n.substring(b),w,k,!0);if(d[y]=this.countFlagsOk(k),A)break}}if(y===p){var S=this.checkSteps;for(y=0;y<p;y++)d[y]>d[S]&&(S=y);v=a+Math.floor((S+1)/2)*(0!=(1&S)?1:-1)}a=v,u=!1}return a!==i&&(l=!1,r[c]=1),l}}]),n}(Ur);Object.assign($r.prototype,{detail:!0,checkSteps:3,checkScope:6}),zr.CLASSES={"@BasicEvaluator":Ur,"@ComplexEvaluator":$r};var Hr=zr;function Wr(t){return Wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wr(t)}function Gr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Jr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Gr(Object(n),!0).forEach((function(e){Kr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kr(t,e,n){return(e=Xr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yr(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Xr(i.key),i)}}function Qr(t,e,n){return e&&Yr(t.prototype,e),n&&Yr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xr(t){var e=function(t,e){if("object"!==Wr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Wr(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Wr(e)?e:String(e)}var to=function(){function t(){Zr(this,t),this.style={default:Jr({},t.DEFAULT_DOC_STYLE)},this.p=[]}return Qr(t,[{key:"setProperties",value:function(t,e){var n=this;return t.children("style").toArray().sort((function(t,e){var n=t.getAttribute("name"),i=t.getAttribute("base")||null,r=e.getAttribute("name"),o=e.getAttribute("base")||null;return"default"===n?-1:"default"===r||i===r?1:o===n?-1:i?o?0:1:-1})).forEach((function(t){var e=n.readDocAttributes(i()(t));n.style[e.name]="default"===e.name?i().extend(!0,n.style.default,e):e})),t.find("section > p").each((function(t,r){var o={elements:[]};de(r.attributes,(function(t,e){switch(t){case"style":o[t]=e;break;case"bidiLevel":case"Alignment":o[t]=Number(e)}})),i()(r).children().each((function(t,r){var s,a=i()(r);switch(r.nodeName){case"cell":s=(new ar).setProperties(a,e);break;case"text":s={text:r.textContent.replace(/\t/g,"	")};var c=n.readDocAttributes(a);i().isEmptyObject(c)||(s.attr=c);break;case"target":(s=new eo(n,r.textContent.replace(/\t/g,"	"))).setProperties(a,e),n.numTargets++;break;default:wt("error",'Unknown object in activity document: "'.concat(r.nodeName,'"'))}s&&(s.objectType=r.nodeName,o.elements.push(s))})),n.p.push(o)})),this}},{key:"readDocAttributes",value:function(t){var e=this,n={},r={};return de(t.get(0).attributes,(function(t,o){switch(t){case"background":o=Vt(o,"white"),n[t]=o,r["background-color"]=o;break;case"foreground":o=Vt(o,"black"),n[t]=o,r.color=o;break;case"family":r["font-family"]=o;case"name":case"style":n[t]=o;break;case"base":n[t]=o,e.style[o]&&(n=i().extend(!0,{},e.style[o],n),e.style[o].css&&(r=i().extend({},e.style[o].css,r)));break;case"bold":o=kt(o),n[t]=o,r["font-weight"]=o?"bold":"normal";break;case"italic":o=kt(o),n[t]=o,r["font-style"]=o?"italic":"normal";break;case"target":n[t]=kt(o);break;case"size":n[t]=Number(o),r["font-size"]="".concat(o,"px");break;case"tabWidth":e.tabSpc=o,r["tab-size"]=e.tabSpc,r["white-space"]="pre-wrap";break;default:wt("warn",'Unknown text attribute: "'.concat(t,'" = "').concat(o,'"')),n[t]=o}})),i().isEmptyObject(r)||(n.css=r),n}},{key:"getAttributes",value:function(){return zt(this,["style","tabSpc","targetType","p"])}},{key:"setAttributes",value:function(t,e){var n=this;return Ht(this,t,["style","tabSpc","targetType","p"]),this.p.forEach((function(t){t.elements?t.elements=t.elements.map((function(t){return"cell"===t.objectType?(new ar).setAttributes(t,e):"target"===t.objectType?new eo(n).setAttributes(t,e):t})):t.elements=[]})),this}},{key:"getRawText",value:function(){var t=i()("<div/>");return this.p.forEach((function(e){var n=i()("<p/>"),r=!0;e.elements.forEach((function(t){switch(t.objectType){case"text":case"target":n.append(t.text)}r=!1})),r&&n.html(" "),t.append(n)})),t.text().trim()}},{key:"getFullStyle",value:function(t){var e=i().extend(!0,{},this.style.default);return i().extend(!0,e,this.style[t]?this.style[t]:{})}}]),t}();to.DEFAULT_DOC_STYLE={background:"0xFFFFFF",foreground:"0x000000",family:"Arial",bold:!1,italic:!1,size:17,css:{"background-color":"#FFFFFF",color:"#000000","font-family":"Arial","font-weight":"normal","font-style":"normal","font-size":"17px"}},Object.assign(to.prototype,{tabSpc:12,lastBoxId:0,tmb:null,numTargets:0,targetType:"TT_FREE",style:null,p:null});var eo=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Zr(this,t),this.doc=e,this.text=n,this.numIniChars=n.length,this.answers=[n],this.maxLenResp=this.numIniChars}return Qr(t,[{key:"reset",value:function(t){this.targetStatus=t||"NOT_EDITED",this.flagModified=!1}},{key:"setProperties",value:function(t,e){var n=this,r=!0;t.children().each((function(t,o){var s=i()(o);switch(o.nodeName){case"answer":r&&(r=!1,n.answers=[]),null===n.answers&&(n.answers=[]),n.answers.push(o.textContent);break;case"optionList":s.children("option").each((function(t,e){n.isList=!0,null===n.options&&(n.options=[]),n.options.push(e.textContent)}));break;case"response":n.iniChar=At(s.attr("fill"),n.iniChar).charAt(0),be.WHITESPACES.indexOf(n.iniChar)>=0&&(n.iniChar="_"),n.numIniChars=St(s.attr("length"),n.numIniChars),n.maxLenResp=St(s.attr("maxLength"),n.maxLenResp),n.iniText=At(s.attr("show"),n.iniText);break;case"info":n.infoMode=At(s.attr("mode"),"always"),n.popupDelay=St(s.attr("delay"),n.popupDelay),n.popupMaxTime=St(s.attr("maxTime"),n.popupMaxTime),s.children("media").each((function(t,e){n.onlyPlay=!0,n.popupContent=new ar,n.popupContent.mediaContent=(new Dn).setProperties(i()(e))})),n.popupContent||s.children("cell").each((function(t,r){n.popupContent=(new ar).setProperties(i()(r),e)}));break;case"text":n.text=o.textContent.replace(/\t/g,"	");var a=n.doc.readDocAttributes(i()(o));i().isEmptyObject(a)||(n.attr=a)}}))}},{key:"getAttributes",value:function(){return zt(this,["objectType","text","attr","isList","answers","options","iniChar","numIniChars","maxLenResp","iniText","infoMode","popupDelay","popupKey","popupMaxTime","onlyPlay","popupContent"])}},{key:"setAttributes",value:function(t,e){return Ht(this,t,["objectType","text","attr","isList","answers","options","iniChar","numIniChars","maxLenResp","iniText","infoMode","popupDelay","popupKey","popupMaxTime","onlyPlay",{key:"popupContent",fn:ar,params:[e]}])}},{key:"getAnswers",value:function(){return this.answers?this.answers.join("|"):""}},{key:"checkColors",value:function(){var t=this.$comboList||this.$span;if(t){var e=this.doc.style["WITH_ERROR"===this.targetStatus?"targetError":"HIDDEN"===this.targetStatus?"default":"target"];e&&e.css&&t.css(e.css)}}},{key:"readCurrentText",value:function(){return this.$span?this.currentText=this.$span.text():this.$comboList&&(this.currentText=this.$comboList.val()),this.currentText}}]),t}();Object.assign(eo.prototype,{doc:null,text:null,attr:null,isList:!1,numIniChars:1,iniChar:"_",maxLenResp:0,answers:null,options:null,iniText:null,infoMode:"no_info",popupKey:"F1",popupContent:null,popupDelay:0,popupMaxTime:0,onlyPlay:!1,$comboList:null,$span:null,$p:null,$popup:null,currentText:"",num:0,pos:0,targetStatus:"NOT_EDITED",flagModified:!1,parentPane:null}),to.TextTarget=eo;var no=to;function io(t){return io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},io(t)}function ro(){return ro="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ao(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},ro.apply(this,arguments)}function oo(t,e){return oo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oo(t,e)}function so(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=ao(t);if(e){var r=ao(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===io(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function ao(t){return ao=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ao(t)}function co(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uo(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ho(i.key),i)}}function lo(t,e,n){return e&&uo(t.prototype,e),n&&uo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ho(t){var e=function(t,e){if("object"!==io(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==io(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===io(e)?e:String(e)}var fo="touchstart",po=function(){function t(e){co(this,t),this.project=e,this.eventSounds=new Hn(this.project.settings.eventSounds),this.messages={},this.abc={}}return lo(t,[{key:"setProperties",value:function(t){var e=this;return de(t.get(0).attributes,(function(t,n){switch(t){case"name":n=ee(n);case"code":case"type":case"description":e[t]=n;break;case"class":e.className=n.replace(/^edu\.xtec\.jclic\.activities\./,"@");break;case"inverse":e.invAss=kt(n,!1);break;case"autoJump":case"forceOkToAdvance":case"amongParagraphs":e[t]=kt(n,!1)}})),t.children().each((function(t,n){var r=i()(n);switch(n.nodeName){case"settings":de(r.get(0).attributes,(function(t,n){switch(t){case"infoUrl":case"infoCmd":e[t]=n;break;case"margin":case"maxTime":case"maxActions":e[t]=Number(n);break;case"report":e.includeInReports=kt(n,!1);break;case"countDownTime":case"countDownActions":case"reportActions":case"useOrder":case"dragCells":e[t]=kt(n,!1)}})),r.children().each((function(t,n){var r=i()(n);switch(n.nodeName){case"skin":e.skinFileName=r.attr("file");break;case"helpWindow":e.helpMsg=It(e),e.showSolution=kt(r.attr("showSolution"),!1),e.helpWindow=null!==e.helpMsg||e.showSolution;break;case"container":e.bgColor=Vt(r.attr("bgColor"),be.BoxBase.BACK_COLOR),r.children().each((function(t,n){var r=i()(n);switch(n.nodeName){case"image":e.bgImageFile=r.attr("name"),e.tiledBgImg=kt(r.attr("tiled"),!1);break;case"counters":e.bTimeCounter=kt(r.attr("time"),!0),e.bActionsCounter=kt(r.attr("actions"),!0),e.bScoreCounter=kt(r.attr("score"),!0);break;case"gradient":e.bgGradient=(new De).setProperties(r)}}));break;case"window":e.activityBgColor=Vt(r.attr("bgColor"),be.DEFAULT_BG_COLOR),e.transparentBg=kt(r.attr("transparent"),!1),e.border=kt(r.attr("border"),!1),r.children().each((function(t,n){var r=i()(n);switch(n.nodeName){case"gradient":e.activityBgGradient=(new De).setProperties(r);break;case"position":e.absolutePosition=(new Me).setProperties(r),e.absolutePositioned=!0;break;case"size":e.windowSize=(new Ve).setProperties(r)}}));break;case"eventSounds":e.eventSounds.setProperties(r)}}));break;case"messages":r.children("cell").each((function(t,n){var r=e.readMessage(i()(n));e.messages[r.type]=r}));break;case"automation":e.acp=Or.getProvider(r,e.project),e.acp&&(e.numericContent=e.acp.numericContent);break;case"cells":var o=(new mr).setProperties(r,e.project.mediaBag);e.abc[o.id]=o;break;case"scramble":e.shuffles=Number(r.attr("times")),e.shuffleA=kt(r.attr("primary")),e.shuffleB=kt(r.attr("secondary"));break;case"layout":de(r.get(0).attributes,(function(t,n){switch(t){case"position":e.boxGridPos=n;break;case"wildTransparent":case"upperCase":case"checkCase":e[t]=kt(n)}}));break;case"menuElement":e.menuElements.push({caption:r.attr("caption")||"",icon:r.attr("icon")||null,projectPath:r.attr("path")||null,sequence:r.attr("sequence")||null,description:r.attr("description")||""});break;case"textGrid":e.tgc=(new _r).setProperties(r);break;case"clues":e.clues=[],e.clueItems=[],r.children("clue").each((function(t,n){e.clueItems[t]=Number(i()(n).attr("id")),e.clues[t]=n.textContent}));break;case"checkButton":e.checkButtonText=n.textContent||"check";break;case"prevScreen":e.prevScreen=!0,e.prevScreenMaxTime=r.attr("maxTime")||-1,r.children().each((function(t,n){switch(n.nodeName){case"style":e.prevScreenStyle=(new Xi).setProperties(i()(n));break;case"p":null===e.prevScreenText&&(e.prevScreenText=""),e.prevScreenText+="<p>".concat(n.textContent,"</p>")}}));break;case"evaluator":e.ev=Hr.getEvaluator(r);break;case"document":e.document=(new no).setProperties(r,e.project.mediaBag)}})),this}},{key:"readMessage",value:function(t){var e=(new ar).setProperties(t,this.project.mediaBag);return e.type=t.attr("type"),Bt(e.style)&&(e.style=new Xi(null)),e}},{key:"getAttributes",value:function(){return zt(this,["name","className","code","type","description","invAss","numericContent","autoJump","forceOkToAdvance","amongParagraphs","infoUrl","infoCmd","margin|".concat(be.DEFAULT_MARGIN),"maxTime","maxActions","includeInReports|true","reportActions|false","countDownTime","countDownActions","useOrder","dragCells","skinFileName","showSolution|false","helpMsg","bgColor|".concat(be.DEFAULT_BG_COLOR),"bgImageFile","tiledBgImg","bTimeCounter|true","bActionsCounter|true","bScoreCounter|true","activityBgColor|".concat(be.DEFAULT_BG_COLOR),"transparentBg|false","border|true","shuffleA","shuffleB","shuffles","boxGridPos","wildTransparent","upperCase","checkCase","checkButtonText","prevScreen","prevScreenMaxTime","prevScreenText","bgGradient","activityBgGradient","absolutePosition","windowSize","eventSounds","messages","acp","abc","menuElements","tgc","clues","clueItems","prevScreenStyle","ev","document"])}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.project.mediaBag;return Ht(this,t,["name","className","code","type","description","invAss","numericContent","autoJump","forceOkToAdvance","amongParagraphs","infoUrl","infoCmd","margin","maxTime","maxActions","includeInReports","reportActions","countDownTime","countDownActions","useOrder","dragCells","skinFileName","showSolution","helpMsg","bgColor","bgImageFile","tiledBgImg","bTimeCounter","bActionsCounter","bScoreCounter","activityBgColor","transparentBg","border","shuffleA","shuffleB","shuffles","boxGridPos","wildTransparent","upperCase","checkCase","checkButtonText","prevScreen","prevScreenMaxTime","prevScreenText",{key:"bgGradient",fn:De},{key:"activityBgGradient",fn:De},{key:"absolutePosition",fn:Me},{key:"windowSize",fn:Ve},{key:"messages",fn:ar,group:"object",init:"key",params:[e]},{key:"abc",fn:mr,group:"object",init:"key",params:[e]},{key:"acp",fn:Or,params:[e]},"menuElements",{key:"tgc",fn:_r},"clues","clueItems",{key:"prevScreenStyle",fn:Xi},{key:"ev",fn:Hr},{key:"document",fn:no,params:[e]}]),t.eventSounds&&this.eventSounds.setAttributes(t.eventSounds),this.absolutePosition&&(this.absolutePositioned=!0),this}},{key:"initAutoContentProvider",value:function(){null!==this.acp&&this.acp.init()}},{key:"prepareMedia",value:function(t){return this.eventSounds.realize(t,this.project.mediaBag),i().each(this.messages,(function(e,n){null!==n&&n.prepareMedia(t)})),i().each(this.abc,(function(e,n){null!==n&&n.prepareMedia(t)})),!0}},{key:"helpSolutionAllowed",value:function(){return!1}},{key:"helpWindowAllowed",value:function(){return this.helpWindow&&(this.helpSolutionAllowed()&&this.showSolution||null!==this.helpMsg)}},{key:"getMinNumActions",value:function(){return 0}},{key:"mustPauseSequence",value:function(){return 0!==this.getMinNumActions()}},{key:"canReinit",value:function(){return!0}},{key:"hasInfo",value:function(){return null!==this.infoUrl&&this.infoUrl.length>0||null!==this.infoCmd&&this.infoCmd.length>0}},{key:"hasRandom",value:function(){return!1}},{key:"shuffleAlways",value:function(){return!1}},{key:"needsKeyboard",value:function(){return!1}},{key:"end",value:function(){this.eventSounds.close(),this.clear()}},{key:"clear",value:function(){}},{key:"getWindowSize",value:function(){return new Ve(this.windowSize)}},{key:"setWindowSize",value:function(t){this.windowSize=new Ve(t)}},{key:"getActivityPanel",value:function(t){return new this.constructor.Panel(this,t)}}],[{key:"registerClass",value:function(e,n){return t.CLASSES[e]=n,n}},{key:"getActivity",value:function(e,n){var i=null,r=e.jquery&&!0;if(e&&n){var o=r?(e.attr("class")||"").replace(/^edu\.xtec\.jclic\.activities\./,"@"):e.className,s=t.CLASSES[o];s?(i=new s(n),r?i.setProperties(e):i.setAttributes(e)):wt("error","Unknown activity class: ".concat(o))}return i}}]),t}();po.CLASSES={"@panels.Menu":po},Object.assign(po.prototype,{project:null,name:be.DEFAULT_NAME,className:null,code:null,type:null,description:null,margin:be.DEFAULT_MARGIN,bgColor:be.DEFAULT_BG_COLOR,bgGradient:null,tiledBgImg:!1,bgImageFile:null,border:!0,absolutePositioned:!1,absolutePosition:null,includeInReports:!0,reportActions:!1,helpWindow:!1,showSolution:!1,helpMsg:"",eventSounds:null,useOrder:!1,dragCells:!1,skinFileName:null,maxTime:0,countDownTime:!1,maxActions:0,countDownActions:!1,infoUrl:null,infoCmd:null,messages:null,windowSize:new Ve(be.DEFAULT_WIDTH,be.DEFAULT_HEIGHT),transparentBg:!1,activityBgColor:be.DEFAULT_BG_COLOR,activityBgGradient:null,bTimeCounter:!0,bScoreCounter:!0,bActionsCounter:!0,acp:null,abc:null,tgc:null,document:null,boxGridPos:"AB",shuffles:be.DEFAULT_SHUFFLES,shuffleA:!0,shuffleB:!0,invAss:!1,menuElements:null,numericContent:!1});var vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oo(t,e)}(n,t);var e=so(n);function n(t,r,o){var s;return co(this,n),(s=e.call(this)).act=t,s.ps=r,s.minimumSize=new Ve(100,100),s.preferredSize=new Ve(500,400),s.$div=o||i()("<div/>",{class:"JClicActivity","aria-label":gt("Activity panel")}),s.act.initAutoContentProvider(),s}return lo(n,[{key:"setBounds",value:function(t){this.pos.x=t.pos.x,this.pos.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height,this.invalidate(t),this.$div.css({position:"relative",left:t.pos.x,top:t.pos.y,width:t.dim.width,height:t.dim.height})}},{key:"buildVisualComponents",value:function(){if(this.playing=!1,this.skin=null,this.act.skinFileName&&this.act.skinFileName.length>0&&this.act.skinFileName!==this.act.project.settings.skinFileName&&(this.skin=this.act.project.mediaBag.getSkinElement(this.act.skinFileName,this.ps)),this.bgImage=null,this.act.bgImageFile&&this.act.bgImageFile.length>0){var t=this.act.project.mediaBag.getElement(this.act.bgImageFile,!0);t&&(this.bgImage=t.data)}this.backgroundColor=this.act.activityBgColor,this.act.transparentBg&&(this.backgroundTransparent=!0),this.act.border&&(this.border=!0);var e={display:"block","background-color":this.backgroundTransparent?"transparent":this.backgroundColor};this.border&&(e["box-shadow"]="0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)",e["border-radius"]="2px",e.color="#272727"),this.act.activityBgGradient&&(e["background-image"]=this.act.activityBgGradient.getCss()),this.$div.css(e)}},{key:"updateContent",value:function(t){return ro(ao(n.prototype),"updateContent",this).call(this,t)}},{key:"playEvent",value:function(t){this.act.eventSounds.play(t)}},{key:"initActivity",value:function(){this.playing&&(this.playing=!1,this.ps.reportEndActivity(this.act,this.solved)),this.solved=!1,this.ps.reportNewActivity(this.act,0),this.attachEvents(),this.enableCounters()}},{key:"startActivity",value:function(){this.playing=!0}},{key:"activityReady",value:function(){}},{key:"showHelp",value:function(){}},{key:"setDimension",value:function(t){return new Ve(Math.min(t.width,this.act.windowSize.width),Math.min(t.height,this.act.windowSize.height))}},{key:"attachEvents",value:function(){var t=this;this.events.forEach((function(e){return t.attachEvent(t.$div,e)})),be.TOUCH_DEVICE||-1!==i().inArray(fo,this.events)||this.attachEvent(this.$div,fo)}},{key:"attachEvent",value:function(t,e){var n=this;t.on(e,this,(function(e){if(e.type!==fo||(be.TOUCH_DEVICE||(be.TOUCH_DEVICE=!0),-1!==i().inArray(fo,n.events)))return e.data.processEvent.call(e.data,e);t.off(fo)}))}},{key:"processEvent",value:function(t){return!1}},{key:"fitTo",value:function(t,e){var n=this,i=new Me;this.act.absolutePositioned&&null!==this.act.absolutePosition&&(i.x=Math.max(0,this.act.absolutePosition.x+t.pos.x),i.y=Math.max(0,this.act.absolutePosition.y+t.pos.y),t.dim.width-=this.act.absolutePosition.x,t.dim.height-=this.act.absolutePosition.y);var r=this.setDimension(new Ve(Math.max(2*this.act.margin+be.MINIMUM_WIDTH,t.dim.width),Math.max(2*this.act.margin+be.MINIMUM_HEIGHT,t.dim.height)));this.act.absolutePositioned||i.moveTo(Math.max(0,t.pos.x+(t.dim.width-r.width)/2),Math.max(0,t.pos.y+(t.dim.height-r.height)/2)),i.x+r.width>e.dim.width&&(i.x=Math.max(0,e.dim.width-r.width)),i.y+r.height>e.dim.height&&(i.y=Math.max(0,e.dim.height-r.height)),this.setBounds(new Ue(i.x,i.y,r.width,r.height)),window.setTimeout((function(){return n.buildAccessibleComponents()}),0)}},{key:"buildAccessibleComponents",value:function(){this.accessibleCanvas&&this.$canvas&&this.$canvas.children().length>0&&this.$canvas.empty()}},{key:"forceFinishActivity",value:function(){}},{key:"finishActivity",value:function(t){this.playing=!1,this.solved=t,null!==this.bc&&this.bc.end(),t?this.setAndPlayMsg("final","finishedOk"):this.setAndPlayMsg("finalError","finishedError"),this.ps.activityFinished(this.solved),this.ps.reportEndActivity(this.act,this.solved)}},{key:"setAndPlayMsg",value:function(t,e){var n=this.act.messages[t]||null;this.ps.setMsg(n),null!==n&&null!==n.mediaContent||this.playEvent(e)}},{key:"end",value:function(){this.forceFinishActivity(),this.playing&&(null!==this.bc&&this.bc.end(),this.ps.reportEndActivity(this.act,this.solved),this.playing=!1,this.solved=!1),this.clear()}},{key:"clear",value:function(){}},{key:"enableCounters",value:function(t,e,n){void 0===t&&(t=this.act.bTimeCounter),void 0===e&&(e=this.act.bScoreCounter),void 0===n&&(n=this.act.bActionsCounter),this.ps.setCounterEnabled("time",t),this.act.countDownTime&&this.ps.setCountDown("time",this.act.maxTime),this.ps.setCounterEnabled("score",e),this.ps.setCounterEnabled("actions",n),this.act.countDownActions&&this.ps.setCountDown("actions",this.act.maxActions)}},{key:"shuffle",value:function(t,e,n){for(var i=this.act.shuffles,r=i,o=function(){var e=r>i?i:r;t.forEach((function(t){t&&t.shuffleCells(e,n)})),r-=i};r>0;)o()}}]),n}(Ke);Object.assign(vo.prototype,{act:null,$div:null,$canvas:null,accessibleCanvas:!0,skin:null,$animatedBg:null,$animatedBgB:null,solved:!1,bgImage:null,playing:!1,firstRun:!0,currentItem:0,bc:null,ps:null,minimumSize:null,preferredSize:null,events:["click"],backgroundColor:null,backgroundTransparent:!1,border:null}),po.Panel=vo;var yo=po;function mo(t){return mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mo(t)}function go(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,bo(i.key),i)}}function bo(t){var e=function(t,e){if("object"!==mo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==mo(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===mo(e)?e:String(e)}var wo=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.settings=new Zn(this),this.activitySequence=new Ti(this),this._activities={},this.mediaBag=new Gi(this)}var e,n,r;return e=t,n=[{key:"setProperties",value:function(t,e,n,r){var o=this;e&&(this.path=e,e.file?this.basePath=e:this.basePath=ie(e)),this.zip=n,this.name=t.attr("name"),this.version=t.attr("version"),void 0!==t.attr("type")&&""!==t.attr("type")&&(this.type=t.attr("type")),void 0!==t.attr("code")&&""!==t.attr("code")&&(this.code=t.attr("code")),this.settings.setProperties(t.children("settings")),this.activitySequence.setProperties(t.children("sequence")),this.mediaBag.setProperties(t.children("mediaBag")),this.reportableActs=0,this._activities={};var s=t.children("activities").children("activity"),a=this.mediaBag.getElementsOfType("font");return a.length>0&&(r.ownFonts=(r.ownFonts||[]).concat(a)),Ie.checkTree(s,r),s.each((function(t,e){var n=i()(e);o._activities[ee(n.attr("name"))]=n,"true"===n.children("settings").attr("report")&&o.reportableActs++})),this}},{key:"getAttributes",value:function(){var t=this,e=Object.keys(this._activities);return this.activities={},e.forEach((function(e){var n=t._activities[e];t.activities[e]=n.jquery?yo.getActivity(n,t):n})),zt(this,["name","version","type","code","settings","activitySequence","activities","mediaBag"])}},{key:"getJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return JSON.stringify(this.getAttributes(),(function(t,e){return e.toFixed?Number(e.toFixed(4)):e}),t)}},{key:"setAttributes",value:function(t,e,n,i){var r=this;e&&(this.path=e,e.file?this.basePath=e:this.basePath=ie(e)),this.zip=n,this.name=t.name,this.version=t.version,t.type&&(this.type=t.type),t.code&&(this.code=t.code),this.settings.setAttributes(t.settings),this.activitySequence.setAttributes(t.activitySequence),this.mediaBag.setAttributes(t.mediaBag),this.reportableActs=0,this._activities=t.activities;var o=this.mediaBag.getElementsOfType("font");return o.length>0&&(i.ownFonts=(i.ownFonts||[]).concat(o)),Ie.checkTree(this._activities,i),this.reportableActs=Object.keys(this._activities).filter((function(t){return r._activities[t].includeInReports})).length,this}},{key:"getActivity",value:function(t){return yo.getActivity(this._activities[ee(t)],this)}},{key:"realize",value:function(t){null===this.skin&&null!==this.settings.skinFileName&&this.settings.skinFileName.length>0&&(this.skin=this.mediaBag.getSkinElement(this.settings.skinFileName,t)),this.settings.eventSounds.realize(t,this.mediaBag),this.mediaBag.buildAll("font",null,t)}},{key:"end",value:function(){}}],n&&go(e.prototype,n),r&&go(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(wo.prototype,{name:"unknown",version:"0.1.3",type:null,code:null,settings:null,activitySequence:null,_activities:null,reportableActs:0,mediaBag:null,skin:null,basePath:"",path:null,zip:null});var ko=wo;function Ao(t){return Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(t)}function So(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,xo(i.key),i)}}function xo(t){var e=function(t,e){if("object"!==Ao(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ao(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ao(e)?e:String(e)}var Co=function(){function t(e,n,i,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.source=n||null,this.dest=i||null,this.ok=r||!1,this.time=(new Date).valueOf()}var e,n,r;return e=t,n=[{key:"$getXML",value:function(){var t={ok:this.ok,time:this.time};return this.type&&(t.type=this.type),this.source&&(t.source=this.source),this.dest&&(t.dest=this.dest),i()("<action/>",t)}},{key:"setProperties",value:function(t){var e=this;de(t.get(0).attributes,(function(t,n){switch(t){case"type":case"source":case"dest":e[t]=n;break;case"time":e[t]=Number(n);break;case"ok":e[t]=kt(n,!1)}}))}}],n&&So(e.prototype,n),r&&So(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(Co.prototype,{type:"unknown",source:null,dest:null,time:0,isOk:!1});var Oo=Co;function Po(t){return Po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Po(t)}function Eo(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,To(i.key),i)}}function To(t){var e=function(t,e){if("object"!==Po(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Po(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Po(e)?e:String(e)}var jo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e.name,this.code=e.code,this.actions=[],this.startTime=(new Date).valueOf(),this.minActions=e.getMinNumActions(),this.reportActions=e.reportActions}var e,n,r;return e=t,n=[{key:"$getXML",value:function(){var t={start:this.startTime,time:this.totalTime,solved:this.solved,score:this.score,minActions:this.minActions,actions:this.numActions};this.name&&(t.name=this.name),this.code&&(t.code=this.code),this.closed||(t.closed=!1),this.reportActions&&(t.reportActions=!0);var e=i()("<activity/>",t);return this.actions.forEach((function(t){e.append(t.$getXML())})),e}},{key:"getData",value:function(){var t={name:this.name,time:Math.round(this.totalTime/10)/100,solved:this.solved,score:this.score,minActions:this.minActions,actions:this.numActions,precision:this.getPrecision(),closed:this.closed};return this.code&&(t.code=this.code),t}},{key:"setProperties",value:function(t){var e=this;de(t.get(0).attributes,(function(t,n){switch(t){case"name":case"code":e[t]=n;break;case"start":case"time":case"score":case"minActions":case"actions":e[t]=Number(n);break;case"solved":case"closed":case"reportActions":e[t]=kt(n,!1)}})),t.children("action").each((function(t,n){var r=new Oo;r.setProperties(i()(n)),e.actions.push(r)}))}},{key:"newAction",value:function(t,e,n,i){this.closed||(this.lastAction=new Oo(t,e,n,i),this.actions.push(this.lastAction))}},{key:"getActionReg",value:function(t){return t>=this.actions.length?null:this.actions[t]}},{key:"closeActivity",value:function(){this.closed||(this.lastAction?this.totalTime=this.lastAction.time-this.startTime:this.totalTime=(new Date).valueOf()-this.startTime,this.closed=!0)}},{key:"getPrecision",value:function(){var t=0;return this.closed&&this.minActions>0&&this.numActions>0&&(t=this.solved?this.numActions<this.minActions?100:Math.round(100*this.minActions/this.numActions):Math.round(this.score*this.score*100/(this.minActions*this.numActions))),t}},{key:"endActivity",value:function(t,e,n){this.closed||(this.solved=n,this.numActions=e,this.score=t,this.closeActivity())}}],n&&Eo(e.prototype,n),r&&Eo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(jo.prototype,{name:"",code:"",startTime:0,totalTime:0,actions:[],solved:!1,lastAction:null,score:0,minActions:0,closed:!1,reportActions:!1,numActions:0});var _o=jo;function Bo(t){return Bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bo(t)}function Ro(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Io(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,No(i.key),i)}}function Do(t,e,n){return e&&Io(t.prototype,e),n&&Io(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function No(t){var e=function(t,e){if("object"!==Bo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Bo(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Bo(e)?e:String(e)}var Mo=function(){function t(e){Ro(this,t),this.name=e.tag,this.description=e.description,this.activities=[],this.currentActivity=null,this.totalTime=0,this.closed=!1,this.info=new Vo(this)}return Do(t,[{key:"getData",value:function(){var t={sequence:this.name,activities:[]};return this.activities.forEach((function(e){return t.activities.push(e.getData())})),t}},{key:"getInfo",value:function(){return this.info.recalc()}},{key:"endSequence",value:function(){this.currentActivity&&this.activities.length>0&&(this.currentActivity.closed||this.currentActivity.closeActivity(),this.totalTime=this.currentActivity.startTime+this.currentActivity.totalTime-this.activities[0].startTime,this.info.valid=!1)}},{key:"newActivity",value:function(t){this.closed||(this.currentActivity=new _o(t),this.activities.push(this.currentActivity),this.info.valid=!1)}},{key:"endActivity",value:function(t,e,n){this.currentActivity&&(this.currentActivity.endActivity(t,e,n),this.info.valid=!1)}},{key:"newAction",value:function(t,e,n,i){this.currentActivity&&(this.currentActivity.newAction(t,e,n,i),this.info.valid=!1)}}]),t}();Object.assign(Mo.prototype,{name:"",description:"",activities:[],currentActivity:null,totalTime:0,closed:!1,info:null});var Vo=function(){function t(e){Ro(this,t),this.sqReg=e}return Do(t,[{key:"clear",value:function(){this.nActivities=this.nActClosed=this.nActSolved=this.nActScore=0,this.ratioSolved=this.nActions=this.tScore=this.tTime=0,this.valid=!1}},{key:"recalc",value:function(){var t=this;return this.valid||(this.clear(),this.nActivities=this.sqReg.activities.length,this.nActivities>0&&(this.sqReg.activities.forEach((function(e){if(e.closed){t.nActClosed++,t.tTime+=e.totalTime,t.nActions+=e.numActions,e.solved&&t.nActSolved++;var n=e.getPrecision();n>=0&&(t.tScore+=n,t.nActScore++)}})),this.nActClosed>0&&(this.ratioSolved=this.nActSolved/this.nActClosed),this.nActScore>0&&(this.tScore=Math.round(this.tScore/this.nActScore))),this.valid=!0),this}}]),t}();Object.assign(Vo.prototype,{sqReg:null,valid:!1,nActivities:0,nActClosed:0,nActSolved:0,nActScore:0,ratioSolved:0,nActions:0,tScore:0,tTime:0}),Mo.Info=Vo;var qo=Mo;function Lo(t){return Lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lo(t)}function Fo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zo(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,$o(i.key),i)}}function Uo(t,e,n){return e&&zo(t.prototype,e),n&&zo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function $o(t){var e=function(t,e){if("object"!==Lo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Lo(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Lo(e)?e:String(e)}var Ho=function(){function t(e,n){Fo(this,t),this.projectName=e.name,this.code=n||e.code,this.sequences=[],this.actNames=[],this.started=new Date,this.info=new Wo(this),this.reportableActs=e.reportableActs}return Uo(t,[{key:"getData",value:function(t,e){t&&this.info.recalc();var n={projectName:this.projectName,played:this.info.nActivities,ratioPlayed:Math.round(100*this.info.ratioPlayed),solved:this.info.nActSolved,ratioSolved:Math.round(100*this.info.ratioSolved),actions:this.info.nActions,score:this.info.tScore,time:Math.round(this.info.tTime/10)/100,sequences:[]};return this.sequences.forEach((function(t){var i=t.getData();(e||i.activities.length>0)&&n.sequences.push(i)})),n}},{key:"getInfo",value:function(){return this.info.recalc()}},{key:"end",value:function(){this.endSequence()}},{key:"endSequence",value:function(){this.currentSequence&&0===this.currentSequence.totalTime&&this.currentSequence.endSequence(),this.currentSequence=null,this.info.valid=!1}},{key:"newSequence",value:function(t){this.endSequence(),this.currentSequence=new qo(t),this.sequences.push(this.currentSequence),this.info.valid=!1}},{key:"newActivity",value:function(t){this.currentSequence&&(-1===this.actNames.indexOf(t.name)&&this.actNames.push(t.name),this.currentSequence.newActivity(t),this.info.valid=!1)}},{key:"endActivity",value:function(t,e,n){this.currentSequence&&(this.currentSequence.endActivity(t,e,n),this.info.valid=!1)}},{key:"newAction",value:function(t,e,n,i){this.currentSequence&&(this.currentSequence.newAction(t,e,n,i),this.info.valid=!1)}},{key:"getCurrentSequenceTag",value:function(){return this.currentSequence?this.currentSequence.name:null}},{key:"getCurrentSequenceInfo",value:function(){return this.currentSequence?this.currentSequence.getInfo():null}}]),t}();Object.assign(Ho.prototype,{reportableActs:0,actNames:null,sequences:null,currentSequence:null,started:null,projectName:"",info:null,code:null});var Wo=function(){function t(e){Fo(this,t),this.sReg=e}return Uo(t,[{key:"clear",value:function(){this.numSequences=this.nActivities=this.nActSolved=this.nActScore=0,this.ratioSolved=this.ratioPlayed=this.nActions=this.tScore=this.tTime=0,this.valid=!1}},{key:"recalc",value:function(){var t=this;return this.valid||(this.clear(),this.sReg.sequences.forEach((function(e){var n=e.getInfo();n.nActivities>0&&(t.numSequences++,n.nActClosed>0&&(t.nActivities+=n.nActClosed,t.nActions+=n.nActions,n.nActScore>0&&(t.nActScore+=n.nActScore,t.tScore+=n.tScore*n.nActScore),t.tTime+=n.tTime,t.nActSolved+=n.nActSolved))})),this.nActScore>0&&(this.tScore=Math.round(this.tScore/this.nActScore)),this.nActivities>0&&(this.ratioSolved=this.nActSolved/this.nActivities,this.sReg.reportableActs>0&&(this.ratioPlayed=this.sReg.actNames.length/this.sReg.reportableActs)),this.valid=!0),this}}]),t}();Object.assign(Wo.prototype,{sReg:null,valid:!1,numSequences:0,nActivities:0,nActSolved:0,nActScore:0,ratioSolved:0,ratioPlayed:0,nActions:0,tScore:0,tTime:0}),Ho.Info=Wo;var Go=Ho;function Jo(t){return Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(t)}function Ko(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Zo(i.key),i)}}function Zo(t){var e=function(t,e){if("object"!==Jo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Jo(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Jo(e)?e:String(e)}var Yo=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,i;return e=t,i=[{key:"Decrypt",value:function(e){if(null===e||0===e.length)return null;var n=t.decodify(e);return n===t.BLANK?"":n}},{key:"hexCharArrayToChar",value:function(t,e){for(var n=0,i=0;i<=3;i++){var r=Number.parseInt(t[e+i],16);if(isNaN(r))throw"Invalid expression!";n=16*n+r}return String.fromCharCode(n)}},{key:"hexCharArrayToInt",value:function(t,e){for(var n=0,i=0;i<=1;i++){var r=Number.parseInt(t[e+i],16);if(isNaN(r))throw"Invalid expression!";n=16*n+r}return n}},{key:"decodifyZerosField",value:function(t){var e="",n=Number.parseInt(t[0],32),i=0,r=0;for(r=0;0!==n;r++){for(;n>0;)e=e+t[3*r+1]+t[3*r+2],n--,i++;n=t.length>3*r+3?Number.parseInt(t[3*r+3],32):0}for(var o=3*r+1;o<t.length;o++)e+=t[o];return Number.parseInt(i,32)+e}},{key:"decompressZeros",value:function(e){e=t.decodifyZerosField(e);for(var n=Number.parseInt(e[0],32),i=2*n+1,r=!1,o="",s=0;s<n&&!r;s++){for(var a=t.hexCharArrayToInt(e,1+2*s).toString(2);a.length<8;)a="0"+a;for(var c=0;c<=7&&!r;c++)"1"===a[c]?o+="0":i<e.length?o+=e[i++]:r=!0}return o}},{key:"decodifyFromHex",value:function(e){for(var n="",i=0,r=0;i<e.length;r++)n+=t.hexCharArrayToChar(e,i),i+=4;return n}},{key:"unchangeOrder",value:function(t){for(var e=0,n=t.length-1,i=[],r=0;r<t.length;r++)i[r]="";for(var o=0;o<t.length;o++)i[o]=o%2==0?t[e++]:t[n--];return i.join("")}},{key:"codify",value:function(e){if(e.length>24)throw"Password is too large!";return t.changeOrder(t.compressZeros(t.codifyToHexWord(e)))}},{key:"decodify",value:function(e){try{return t.decodifyFromHex(t.decompressZeros(t.unchangeOrder(e)))}catch(t){return""}}}],(n=null)&&Ko(e.prototype,n),i&&Ko(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Yo.BLANK="___blank___##";var Qo=Yo;function Xo(t){return Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xo(t)}function ts(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,es(i.key),i)}}function es(t){var e=function(t,e){if("object"!==Xo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Xo(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Xo(e)?e:String(e)}var ns=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.API=e,"function"==typeof e.Initialize?this.is2004=!0:(this.prefix="LMS",this.core="cmi.core."),this.reporter=n}var e,n,r;return e=t,n=[{key:"initialize",value:function(){var t=this,e=!1;try{(e=this.API[this.prefix+"Initialize"](""))&&(this.studentId=this.getValue(this.core+(this.is2004?"learner_id":"student_id")),this.studentName=this.getValue(this.core+(this.is2004?"learner_name":"student_name")),this.setValue(this.core+"score.min",0),this.setValue(this.core+"score.max",100),i()(window).on("unload",(function(){t.commitInfo(),t.terminate(),t.API=null}))),wt("debug","SCORM initialized")}catch(t){wt("error","Error initializing SCORM API: ".concat(t.message))}return e}},{key:"terminate",value:function(){var t=!1;try{t=this.API[this.is2004?"Terminate":"LMSFinish"]("")}catch(t){wt("error","Error terminating SCORM API: ".concat(t.message))}return t}},{key:"commitInfo",value:function(){var t=this.reporter.getInfo(),e=Math.round(100*t.globalScore),n=this.getTimeExpression(t.tTime);this.setValue(this.core+"score.raw",e),this.setValue(this.core+"session_time",n),this.commit(),wt("debug","SCORM results reported: ".concat(e," (").concat(n,")"))}},{key:"commit",value:function(){var t=!1;try{t=this.API[this.prefix+"Commit"]("")}catch(t){wt("error","Error commiting data to the SCORM API: ${ex.message}")}return t}},{key:"setValue",value:function(t,e){var n=!1;try{n=this.API[this.prefix+"SetValue"](t,e)}catch(n){wt("error",'Error setting value "'.concat(e,'" to "').concat(t,'" in SCORM API: ').concat(n.message))}return n}},{key:"getValue",value:function(t){var e=!1;try{e=this.API[this.prefix+"GetValue"](t)}catch(e){wt("error",'Error retrieving "'.concat(t,'" from SCORM API: ').concat(e.message))}return e}},{key:"getTimeExpression",value:function(t){var e=new Date(t),n=e.getUTCHours(),i=e.getUTCMinutes(),r=e.getUTCSeconds();return this.is2004?"PT".concat(n,"H").concat(i,"M").concat(r,"S"):"".concat(("0000"+n).slice(-4),":").concat(("00"+i).slice(-2),":").concat(("00"+r).slice(-2))}},{key:"getScormType",value:function(){return"SCORM ".concat(this.is2004?"2004":"1.2")}}],r=[{key:"scanForAPI",value:function(e,n){return e.API_1484_11&&e.API_1184_11.Initialize&&e.API_1184_11.SetValue&&e.API_1184_11.Commit?e.API_1184_11:e.API&&e.API.LMSInitialize&&e.API.LMSSetValue&&e.API.LMSCommit?e.API:e.parent&&e.parent!==e&&n++<t.DISCOVER_MAX_TRIES?t.scanForAPI(e.parent,n):null}},{key:"getSCORM",value:function(e){var n=null;try{var i=t.scanForAPI(window,0);null===i&&window.opener&&(i=t.scanForAPI(window.opener,0)),i&&((n=new t(i,e)).initialize()||(n=null))}catch(t){n=null,wt("warn","Unable to use SCORM: %s",t.toString())}return n}}],n&&ts(e.prototype,n),r&&ts(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(ns.prototype,{is2004:!1,reporter:null,prefix:"",core:"cmi.",API:null,studentId:"",studentName:""}),ns.DISCOVER_MAX_TRIES=50;var is=ns;function rs(t){return rs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(t)}function os(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ss(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,cs(i.key),i)}}function as(t,e,n){return e&&ss(t.prototype,e),n&&ss(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function cs(t){var e=function(t,e){if("object"!==rs(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==rs(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===rs(e)?e:String(e)}var us=function(){function t(e){os(this,t),this.ps=e,this.sessions=[],this.started=new Date,this.initiated=!1,this.info=new ls(this)}return as(t,[{key:"getInfo",value:function(){return this.info.recalc()}},{key:"getProperty",value:function(t,e){return e}},{key:"getBooleanProperty",value:function(t,e){var n=this.getProperty(t,!0===e?"true":"false");return null===t?e:"true"===n}},{key:"getGroups",value:function(){return Promise.reject("No groups defined!")}},{key:"getUsers",value:function(t){return Promise.reject("No users defined in "+t)}},{key:"getUserData",value:function(t){return Promise.reject("Unknown user!")}},{key:"getGroupData",value:function(t){return Promise.reject("Unknown group!")}},{key:"userBased",value:function(){return null===this.bUserBased&&(this.bUserBased=this.getBooleanProperty("USER_TABLES",!1)),this.bUserBased}},{key:"promptForNewGroup",value:function(){return Promise.reject("Remote creation of groups not yet implemented!")}},{key:"promptForNewUser",value:function(){return Promise.reject("Remote creation of users not yet implemented!")}},{key:"promptGroupId",value:function(){var t=this;return new Promise((function(e,n){t.userBased()?t.getGroups().then((function(r){if(!r||r.length<1)n("No groups defined!");else{var o=0,s=i()("<select/>").attr({size:Math.max(3,Math.min(15,r.length))});r.forEach((function(t){return s.append(i()("<option/>").attr({value:t.id}).text(t.name))})),s.change((function(t){o=t.target.selectedIndex})),t.ps.skin.showDlg(!0,{main:[i()("<h2/>",{class:"subtitle"}).html(gt("Select group:")),s],bottom:[t.ps.skin.$okDlgBtn,t.ps.skin.$cancelDlgBtn]}).then((function(){e(r[o].id)})).catch(n)}})).catch(n):n("This system does not manage users!")}))}},{key:"promptUserId",value:function(t){var e=this;return new Promise((function(n,r){if(null===e.userId||t)if(e.userBased()){var o=i()("<input/>",{type:"password",size:8,maxlength:64});if(e.getBooleanProperty("SHOW_USER_LIST",!0))e.promptGroupId().then((function(t){e.getUsers(t).then((function(s){if(!s||s.length<1)r("Group "+t+" has no users!");else{var a=-1,c=i()("<select/>").attr({size:Math.max(3,Math.min(15,s.length))});s.forEach((function(t){return c.append(i()("<option/>").attr({value:t.id}).text(t.name))})),c.change((function(t){a=t.target.selectedIndex})),e.ps.skin.showDlg(!0,{main:[i()("<h2/>",{class:"subtitle"}).html(gt("Select user:")),c,i()("<h2/>",{class:"subtitle"}).html(gt("Password:")).append(o)],bottom:[e.ps.skin.$okDlgBtn,e.ps.skin.$cancelDlgBtn]}).then((function(){a>=0?s[a].pwd&&Qo.Decrypt(s[a].pwd)!==o.val()?(window.alert(gt("Incorrect password")),r("Incorrect password")):(e.userId=s[a].id,n(e.userId)):r("No user has been selected")})).catch(r)}})).catch(r)})).catch(r);else{var s=i()("<input/>",{type:"text",size:8,maxlength:64});e.ps.skin.showDlg(!0,{main:[i()("<div/>").css({"text-align":"right"}).append(i()("<h2/>",{class:"subtitle"}).html(gt("User:")).append(s)).append(i()("<h2/>",{class:"subtitle"}).html(gt("Password:")).append(o))],bottom:[e.ps.skin.$okDlgBtn,e.ps.skin.$cancelDlgBtn]}).then((function(){e.getUserData(s.val()).then((function(t){t.pwd&&Qo.Decrypt(t.pwd)!==o.val()?(window.alert(gt("Incorrect password")),r("Incorrect password")):(e.userId=t.id,n(e.userId))})).catch(r)})).catch(r)}}else r("This system does not manage users!");else n(e.userId)}))}},{key:"getData",value:function(){this.info.recalc();var t={started:this.started.toISOString(),descriptionKey:this.descriptionKey,descriptionDetail:this.descriptionDetail,projects:this.info.numSessions,sequences:this.info.numSequences,activitiesDone:this.info.nActivities,playedOnce:this.info.nActPlayed,reportable:this.info.reportableActs,ratioPlayed:Math.round(100*this.info.ratioPlayed),activitiesSolved:this.info.nActSolved,ratioSolved:Math.round(100*this.info.ratioSolved),actScore:this.info.nActScore,partialScore:Math.round(100*this.info.partialScore),globalScore:Math.round(100*this.info.globalScore),time:Math.round(this.info.tTime/10)/100,actions:this.info.nActions,sessions:[]};return this.userId?t.userId=this.userId:this.SCORM&&(t.user=this.SCORM.studentName+(""===this.SCORM.studentId?"":" (".concat(this.SCORM.studentId,")"))),this.sessions.forEach((function(e){e.getInfo().numSequences>0&&t.sessions.push(e.getData(!1,!1))})),t}},{key:"init",value:function(e){return e||(e=this.ps.options),this.userId=At(e.user),this.sessionKey=At(e.key),this.sessionContext=At(e.context),this.groupCodeFilter=At(e.groupCodeFilter),this.userCodeFilter=At(e.userCodeFilter),!1!==e.SCORM&&(this.SCORM=is.getSCORM(this),null!==this.SCORM&&this.descriptionKey===t.prototype.descriptionKey&&(this.descriptionKey=this.SCORM.getScormType())),this.initiated=!0,wt("debug","Basic Reporter initialized"),Promise.resolve(!0)}},{key:"end",value:function(){return wt("debug","Basic Reporter ending"),this.endSession(),Promise.resolve(!0)}},{key:"endSequence",value:function(){this.currentSession&&(this.currentSession.endSequence(),this.info.valid=!1)}},{key:"endSession",value:function(){this.endSequence(),this.currentSession=null}},{key:"newGroup",value:function(t){throw"No database!"}},{key:"newUser",value:function(t){throw"No database!"}},{key:"newSession",value:function(t){this.endSession(),this.currentSession=new Go(t),this.sessions.push(this.currentSession),this.info.valid=!1}},{key:"newSequence",value:function(t){this.currentSession&&(this.currentSession.newSequence(t),this.info.valid=!1,this.SCORM&&this.SCORM.commitInfo())}},{key:"newActivity",value:function(t){this.currentSession&&(this.currentSession.newActivity(t),this.info.valid=!1)}},{key:"endActivity",value:function(t,e,n){this.currentSession&&(this.currentSession.endActivity(t,e,n),this.info.valid=!1)}},{key:"newAction",value:function(t,e,n,i){this.currentSession&&(this.currentSession.newAction(t,e,n,i),this.info.valid=!1)}},{key:"getCurrentSequenceInfo",value:function(){return null===this.currentSession?null:this.currentSession.getCurrentSequenceInfo()}},{key:"getCurrentSequenceTag",value:function(){return null===this.currentSession?null:this.currentSession.getCurrentSequenceTag()}}],[{key:"registerClass",value:function(e,n){return t.CLASSES[e]=n,n}},{key:"getReporter",value:function(e,n){var i=null;return null===e&&(e="Reporter",n.options.hasOwnProperty("reporter")&&(e=n.options.reporter)),t.CLASSES.hasOwnProperty(e)?i=new t.CLASSES[e](n):wt("error","Unknown reporter class: %s",e),i}}]),t}();Object.assign(us.prototype,{info:null,ps:null,SCORM:null,userId:null,sessionKey:null,sessionContext:null,groupCodeFilter:null,userCodeFilter:null,descriptionKey:"Results are not currently being saved",descriptionDetail:"",started:null,sessions:[],currentSession:null,initiated:!1,bUserBased:null,MAX_USERID_PROMPT_ATTEMPTS:3});var ls=function(){function t(e){os(this,t),this.rep=e}return as(t,[{key:"clear",value:function(){this.numSessions=this.numSequences=this.nActivities=this.reportableActs=this.nActSolved=this.nActPlayed=this.nActScore=this.nActions=this.ratioSolved=this.ratioPlayed=this.tScore=this.tTime=this.partialScore=this.globalScore=0,this.valid=!1}},{key:"recalc",value:function(){var t=this;return this.valid||(this.clear(),this.rep.sessions.forEach((function(e){var n=e.getInfo();t.reportableActs+=n.sReg.reportableActs,n.numSequences>0&&(t.numSessions++,t.numSequences+=n.numSequences,n.nActivities>0&&(t.nActivities+=n.nActivities,t.nActPlayed+=n.sReg.actNames.length,t.nActSolved+=n.nActSolved,t.nActions+=n.nActions,n.nActScore>0&&(t.tScore+=n.tScore*n.nActScore,t.nActScore+=n.nActScore),t.tTime+=n.tTime))})),this.nActivities>0&&(this.ratioSolved=this.nActSolved/this.nActivities,this.reportableActs>0&&(this.ratioPlayed=this.nActPlayed/this.reportableActs),this.partialScore=this.tScore/(100*this.nActScore),this.globalScore=this.partialScore*this.ratioPlayed),this.valid=!0),this}}]),t}();Object.assign(ls.prototype,{rep:null,valid:!1,numSessions:0,numSequences:0,nActivities:0,reportableActs:0,nActSolved:0,nActPlayed:0,nActScore:0,nActions:0,ratioSolved:0,ratioPlayed:0,tScore:0,partialScore:0,tTime:0,globalScore:0}),us.Info=ls,us.CLASSES={Reporter:us};var hs=us;function fs(t){return fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fs(t)}function ps(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ds(i.key),i)}}function ds(t){var e=function(t,e){if("object"!==fs(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==fs(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===fs(e)?e:String(e)}function vs(t,e){return vs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vs(t,e)}function ys(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=gs(t);if(e){var r=gs(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===fs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ms(t)}(this,n)}}function ms(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gs(t){return gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gs(t)}var bs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vs(t,e)}(c,t);var e,n,r,s=ys(c);function c(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),n=s.call(this),e=mt(e),n.options=i().extend(Object.create(n.options),e),n.id="JC".concat((65536+Math.round(65535*Math.random())).toString(16).toUpperCase().substr(1)),n.$topDiv=t||i()("<div/>"),n.$topDiv.css({"text-align":"initial"}),n.$topDiv.parent().is("td")&&n.$topDiv.css({width:le(n.options.width,null,null,"100%"),height:le(n.options.height,null,null,"100%")}),n.$mainContainer=i()("<div/>",{class:"JClicContainer",id:n.id}).css({width:"100%",height:"100%"}).appendTo(n.$topDiv),n.localFS=location&&"file:"===location.protocol,n.$div=i()("<div/>",{class:"JClicPlayer"}),n.project=new ko,n.activeMediaBag=new bn,n.counterVal={score:0,actions:0,time:0},n.bgImageOrigin=new Me,n.buildActions(),n.history=new rn(ms(n)),n.audioEnabled=n.options.audioEnabled,n.navButtonsAlways=n.options.navButtonsAlways,n.defaultSkin=Tn.getSkin(n.options.skin,ms(n)),n.setSkin(Tn.getSkin("@empty.xml",ms(n))),n.initTimers(),n.listenTouchEvents(),wt("info","JClicPlayer ready"),n}return e=c,n=[{key:"listenTouchEvents",value:function(){var t=this,e=null,n=0,i=this.$div[0],r=this.options,o=r.minSwipeX,s=r.maxSwipeY,a=r.rightToLeft,c=function(r){if(r.target===i&&r.changedTouches&&1===r.changedTouches.length){var c=r.changedTouches[0],u=e?c.clientX-e.clientX:0,l=e?c.clientY-e.clientY:0,h=Math.sqrt(u*u+l*l);switch(r.type){case"touchstart":var f=new Date;document&&document.fullscreenEnabled&&e&&n&&f-n<800&&h<o?(r.preventDefault(),wt("info","Toggle full screen mode from double touch"),t.skin.setScreenFull(),e=null):(e=c,n=f);break;case"touchend":if(e&&Math.abs(u)>o&&Math.abs(l)<s){var p=u<0&&!a?"next":"prev",d=t.actions[p];d&&d.enabled&&(r.preventDefault(),wt("info",'Performing action "'.concat(p,'" from touch gesture')),d.actionPerformed(r)),e=null}else h>o&&(e=null);break;case"touchcancel":e=null}}else e=null};i.addEventListener("touchstart",c),i.addEventListener("touchend",c),i.addEventListener("touchcancel",c)}},{key:"getUniqueId",value:function(t){return"".concat(this.id,"-").concat(t)}},{key:"buildActions",value:function(){var t=this;this.actions={next:new Ge("next",(function(){return t.history.processJump(t.project.activitySequence.getJump(!1,t.reporter),!1)})),prev:new Ge("prev",(function(){return t.history.processJump(t.project.activitySequence.getJump(!0,t.reporter),!1)})),return:new Ge("return",(function(){return t.history.pop()})),reset:new Ge("reset",(function(){t.actPanel&&t.actPanel.act.canReinit()&&t.initActivity()})),help:new Ge("help",(function(){t.actPanel&&t.actPanel.showHelp()})),info:new Ge("info",(function(){t.actPanel&&t.actPanel.act.hasInfo()&&(t.actPanel.act.infoUrl?t.displayURL(t.act.infoUrl,!0):t.actPanel.act.infoCmd&&t.runCmd(t.actPanel.act.infoCmd))})),reports:new Ge("reports",(function(){return t.showReports()})),audio:new Ge("audio",(function(){t.audioEnabled=!t.audioEnabled,t.audioEnabled||t.stopMedia(),Hn.prototype.globalEnabled=t.audioEnabled}))},i().each(this.actions,(function(e,n){n.addStatusListener((function(e){t.skin&&t.skin.actionStatusChanged(e)}))}))}},{key:"reset",value:function(){wt("info","Restoring player"),this.removeActivity(),this.end(),this.activeMediaBag=new bn,this.history.clearHistory(),this.setSkin(null),this.setMsg(null),this.setCounterValue("score",0),this.setCounterValue("actions",0),this.setCounterValue("time",0),this.skin&&this.skin.setWaitCursor("reset")}},{key:"stop",value:function(){this.stopMedia(-1)}},{key:"end",value:function(){var t=null;return this.stopMedia(),this.closeHelpWindow(),this.reporter&&(t=this.reporter.end(),this.reporter=null),this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null),this.project&&(this.project.end(),this.project=null),this.activeMediaBag&&this.activeMediaBag.removeAll(),t||Promise.resolve(!0)}},{key:"initReporter",value:function(){return this.reporter&&(this.reporter.end(),this.reporter=null),this.reporter=hs.getReporter(null,this),this.reporter.init()}},{key:"initTimers",value:function(){var t=this;this.timer&&this.timer.stop(),this.timer=new Je((function(){t.incCounterValue("time"),t.actPanel&&t.actPanel.act.maxTime>0&&t.actPanel.playing&&t.counterVal.time>=t.actPanel.act.maxTime&&t.actPanel.finishActivity(!1)}),1e3,!1),this.delayedTimer&&this.delayedTimer.stop(),this.delayedTimer=new Je((function(){t.delayedAction&&t.delayedAction.processEvent(t.delayedAction,null)}),1e3,!1),this.delayedTimer.repeats=!1}},{key:"showReports",value:function(){this.skin&&this.skin.showReports(this.reporter)}},{key:"closeHelpWindow",value:function(){this.skin&&this.skin._closeDlg(!1)}},{key:"setSkin",value:function(t){!(t=t||(this.project&&this.project.skin?this.project.skin:this.defaultSkin))||null!==this.skin&&t.name===this.skin.name||(t.attach(this),this.skin=t,this.skin.doLayout())}},{key:"setProject",value:function(t){this.project&&(this.project!==t&&this.project.end(),this.removeActivity()),this.project=t||new ko,this.project.realize(this)}},{key:"load",value:function(t,e,n){var r=this;this.forceFinishActivity(),this.setWaitCursor(!0);var s=null;if(t){if("string"==typeof t){var c=oe(this.basePath,t);if(c.endsWith("project.json"))return wt("info","Loading JSON info from: ".concat(c)),void i().getJSON(c).done((function(t){var i=t.mainFile;i&&Xt(i,".jclic")||Xt(i,".jclic.json")?r.load(oe(ie(c),i),e,n):wt("error",'Invalid or null "mainFile" specified in '.concat(c,' - "project.json".'))})).fail((function(e,n,i){var r="".concat(n," (").concat(i,") while loading ").concat(t);wt(r),window.alert("Error!\n".concat(r))})).always((function(){return r.setWaitCursor(!1)}));if(c.endsWith(".zip"))return this.zip=null,wt("info","Loading ZIP file: ".concat(c)),void a().getBinaryContent(c,(function(t,i){if(t)return r.setWaitCursor(!1),void wt("error","Error loading ZIP file: ".concat(t.toString()));(new(o())).loadAsync(i).then((function(t){r.zip=t,r.zip.fullZipPath=c,r.zip.zipBasePath=ie(c);var i=null;r.zip.files["project.json"]?r.zip.files["project.json"].async("string").then((function(t){try{var i=JSON.parse(t);Xt(i.mainFile,".jclic")?r.load(oe(r.zip.zipBasePath,i.mainFile),e,n):wt("error",'Invalid or null "mainFile" specified in '.concat(c,' - "project.json".'))}catch(t){wt("error",'Error reading "project.json" in '.concat(c,": ").concat(t?t.toString():"unknown error"))}})).catch((function(t){wt("error","Error reading ZIP file: ".concat(t?t.toString():"unknown reason"))})):(i=Object.keys(r.zip.files).find((function(t){return t.endsWith(".jclic")}))||null)?r.load(oe(r.zip.zipBasePath,i),e,n):wt("error","This ZIP file does not contain any JClic project!"),r.setWaitCursor(!1)})).catch((function(t){wt("error","Error reading ZIP file: ".concat(t?t.toString():"unknown reason")),r.setWaitCursor(!1)}))}));if(this.localFS&&window.JClicObject&&!window.JClicObject.projectFiles[c]){var u=document.createElement("script");return u.src="".concat(c,".js"),u.onload=function(){var i,o;window.JClicObject.projectFiles[c]&&(window.JClicObject.projectFiles[c]=(i=[[/
/g,"\r"],[/
/g,"\n"],[/	/g,"\t"]],o=window.JClicObject.projectFiles[c],i.reduce((function(t,e){var n=ut(e,2),i=n[0],r=n[1];return t.replace(i,r)}),o)),r.load(t,e,n))},document.head.appendChild(u),void this.setWaitCursor(!1)}var l=function(o){var s=0===o.indexOf("data:text/xml;")||o.endsWith(".jclic");(s?i().get(o,null,null,"xml"):i().getJSON(o)).done((function(o){if(null!==o&&"object"===fs(o)){var a=new ko;s?a.setProperties(i()(o).find("JClicProject"),c,r.zip,r.options):a.setAttributes(o,c,r.zip,r.options),wt("info","Project file loaded and parsed: ".concat(t));var u=a.mediaBag.buildAll(null,(function(t){wt("trace",'"'.concat(t.name,'" ready.')),r.incProgress(1)}),r);wt("info","Media elements to be loaded: ".concat(u)),r.setProgress(0,u);var l=0;r.setWaitCursor(!0);var h=window.setInterval((function(){++l>r.options.maxWaitTime/500&&(window.clearInterval(h),r.setProgress(-1),r.setWaitCursor(!1),wt("error","Error loading media")),-1===a.mediaBag.countWaitingElements()&&(window.clearInterval(h),r.setProgress(-1),r.setWaitCursor(!1),r.load(a,e,n))}),500)}else wt("error","Bad data. Project not loaded: ".concat(t))})).fail((function(e,n,i){var r="".concat(n," (").concat(i,") while loading ").concat(t);wt(r),window.alert("Error!\n".concat(r))})).always((function(){return r.setWaitCursor(!1)}))};wt("info","Loading project: ".concat(t));var h=c;if(this.zip){var f=re(h,this.zip.zipBasePath);if(this.zip.files[f])return void this.zip.file(f).async("string").then((function(t){l("data:".concat(f.endsWith(".jclic")?"text/xml":"application/json",";charset=UTF-8,").concat(t))})).catch((function(t){wt("error",'Unable to extract "'.concat(f,'" from ZIP file because of: ').concat(t?t.toString():"unknown reason")),r.setWaitCursor(!1)}))}else if(this.localFS){if(!window.JClicObject||!window.JClicObject.projectFiles[c])return wt("error","Unable to load: ".concat(c,".js")),void this.setWaitCursor(!1);h="data:".concat(c.endsWith(".jclic")?"text/xml":"application/json",";charset=UTF-8,").concat(window.JClicObject.projectFiles[c])}return void l(h)}this.setProject(t),e||n||(e="0"),this.reporter&&this.reporter.newSession(t)}if(!Bt(e)){wt("info","Loading sequence: ".concat(e)),this.navButtonsDisabled=!1;var p=null;if("string"==typeof e&&(p=this.project.activitySequence.getElementByTag(e,!0)),null===p){var d=parseInt(e,10);"number"==typeof d&&(p=this.project.activitySequence.getElement(d,!0))}null!==p&&(this.reporter&&this.reporter.newSequence(p),n=p.activity)}if(n){var v=this.project.getActivity(n);v?(wt("info","Loading activity: ".concat(n)),zi.resetAudioElements(),v.prepareMedia(this),this.project.activitySequence.checkCurrentActivity(v.name),(s=v.getActivityPanel(this)).buildVisualComponents()):wt("error","Missing activity: ".concat(n))}if(null!==this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null,this.setCounterValue("time",0)),s){if(this.actPanel=s,this.options.fade>0&&this.actPanel.$div.css("display","none"),this.$div.prepend(this.actPanel.$div),this.skin&&this.skin.resetAllCounters(!1),this.actPanel.skin?this.setSkin(this.actPanel.skin):this.project.skin?(this.setSkin(this.project.skin),this.lastProjectSkin=this.project.skin):this.lastProjectSkin?this.setSkin(this.lastProjectSkin):this.setSkin(null),this.skin){var y=this.history.storedElementsCount()>0||this.options.returnAsExit,m=this.navButtonsAlways?"both":this.navButtonsDisabled?"none":this.project.activitySequence.getNavButtonsFlag();this.actions.next.setEnabled(("fwd"===m||"both"===m)&&this.project.activitySequence.hasNextAct(y)),this.actions.prev.setEnabled(("back"===m||"both"===m)&&this.project.activitySequence.hasPrevAct(y)),this.actions.return.setEnabled(y),this.actions.help.setEnabled(this.actPanel.act.helpWindowAllowed()),this.actions.reset.setEnabled(this.actPanel.act.canReinit()),this.actions.info.setEnabled(this.actPanel.act.hasInfo())}this.doLayout(),this.initActivity(),this.history.pushBrowserHistory(),this.actPanel.$div.fadeIn(this.options.fade,(function(){return r.activityReady()}))}this.setWaitCursor(!1)}},{key:"forceFinishActivity",value:function(){this.timer.stop(),this.delayedTimer.stop(),this.actPanel&&(this.closeHelpWindow(),this.actPanel.forceFinishActivity(),this.stopMedia(),this.activeMediaBag.removeAll())}},{key:"removeActivity",value:function(){this.forceFinishActivity(),this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null,this.setMsg(null),this.doLayout())}},{key:"initActivity",value:function(){this.setWaitCursor(!0),this.timer.stop(),this.delayedTimer.stop(),this.setCounterValue("time",0),this.stopMedia(),this.actPanel&&(this.actPanel.initActivity(),this.timer.start(),this.actPanel.act.mustPauseSequence()||this.startAutoPassTimer(),wt("info",'Activity "'.concat(this.actPanel.act.name,'" running'))),this.setWaitCursor(!1)}},{key:"activityReady",value:function(){this.actPanel&&(this.actPanel.activityReady(),wt("info","Activity ready"))}},{key:"startActivity",value:function(){this.setWaitCursor(!0),this.actPanel&&this.actPanel.startActivity(),this.setWaitCursor(!1)}},{key:"doLayout",value:function(){var t=this,e=this.dim.width=this.$div.width(),n=this.dim.height=this.$div.height(),i={"background-color":this.actPanel?this.actPanel.act.bgColor:"azure","background-image":""};if(this.actPanel){var r=this.actPanel.act;r.bgGradient&&(i["background-image"]=r.bgGradient.getCss()),r.bgImageFile&&r.bgImageFile.length>0&&this.project.mediaBag.getElement(r.bgImageFile,!0).getFullPathPromise().then((function(e){t.$div.css({"background-image":"url('"+e+"')","background-repeat":r.tiledBgImg?"repeat":"no-repeat","background-position":r.tiledBgImg?"":"center center"})}));var o=be.BoxBase.AC_MARGIN,s=new Ue(o,o,e-2*o,n-2*o);this.actPanel.bgImage&&!r.tiledBgImg&&r.absolutePositioned&&(this.bgImageOrigin.x=(e-this.actPanel.bgImage.width)/2,this.bgImageOrigin.y=(n-this.actPanel.bgImage.height)/2,s.pos.moveTo(this.bgImageOrigin),s.dim.width-=this.bgImageOrigin.x-o,s.dim.height-=this.bgImageOrigin.y-o,s.dim.width=Math.min(s.dim.width,e),s.dim.height=Math.min(s.dim.height,n)),this.actPanel.fitTo(s,this)}this.$div.css(i)}},{key:"playMedia",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=null,o=t.file,s=null;switch(t.type){case"PLAY_AUDIO":case"PLAY_VIDEO":case"PLAY_MIDI":case"RECORD_AUDIO":case"PLAY_RECORDED_AUDIO":if(this.audioEnabled){var a=this.activeMediaBag.getActiveMediaPlayer(t,this.project.mediaBag,this);a&&(s=function(){return a.play(n)})}break;case"RUN_CLIC_PACKAGE":r=new ei("JUMP",o),t.externalParam&&(r.projectPath=t.externalParam),s=function(){return e.history.processJump(r,!0)};break;case"RUN_CLIC_ACTIVITY":this.history.push(),s=function(){return e.load(null,null,o)};break;case"RETURN":if(this.history.storedElementsCount()>0||!this.options.returnAsExit){s=function(){return e.history.pop()};break}case"EXIT":r=new ei("EXIT",o),s=function(){return e.history.processJump(r,!1)};break;case"RUN_EXTERNAL":s=function(){return e.runCmd(o)};break;case"URL":o&&(s=function(){return e.displayURL(o,t.level>1)});break;default:wt("error","Unknown media type: ".concat(t.type))}i&&s?i.push(s):s&&s()}},{key:"stopMedia",value:function(t){"number"!=typeof t&&(t=-1),this.activeMediaBag.stopAll(t)}},{key:"runCmd",value:function(t){wt("warn",'Unsupported call to external command: "'.concat(t,'"'))}},{key:"activityFinished",value:function(t){this.closeHelpWindow(),wt("info","Activity finished"),this.timer.stop(),this.startAutoPassTimer()}},{key:"startAutoPassTimer",value:function(){var t=this.project.activitySequence.getCurrentAct();null!==t&&t.delay>0&&!this.delayedTimer.isRunning()&&!this.navButtonsDisabled&&(this.delayedAction=this.actions.next,this.delayedTimer.interval=1e3*t.delay,this.delayedTimer.start())}},{key:"setMsg",value:function(t){var e=this.skin?this.skin.getMsgBox():null;e&&(e.clear(),this.skin.invalidate(e).update(),e.setContent(t||ar.EMPTY_CONTENT),this.skin.invalidate(e).update(),e.playMedia(this))}},{key:"playMsg",value:function(){this.skin&&this.skin.getMsgBox()&&this.skin.getMsgBox().playMedia(this)}},{key:"setCounterValue",value:function(t,e){this.counterVal[t]=e,this.skin&&this.skin.counters[t]&&this.skin.counters[t].setValue(e)}},{key:"getCounterValue",value:function(t){return this.counterVal[t]}},{key:"setCounterEnabled",value:function(t,e){this.skin&&(this.skin.enableCounter(t,e),this.setCountDown(t,0))}},{key:"incCounterValue",value:function(t){this.counterVal[t]++;var e=this.actPanel,n=this.skin?this.skin.counters[t]:null;n&&n.setValue(this.counterVal[t]),"actions"===t&&null!==e&&e.act.maxActions>0&&e.playing&&this.counterVal.actions>=e.act.maxActions&&window.setTimeout((function(){e.finishActivity(e.solved)}),0)}},{key:"setCountDown",value:function(t,e){this.skin&&this.skin.counters[t]&&this.skin.counters[t].setCountDown(e)}},{key:"setWaitCursor",value:function(t){this.skin&&this.skin.setWaitCursor(t)}},{key:"setProgress",value:function(t,e){this.skin&&this.skin.setProgress(t,e)}},{key:"incProgress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.skin&&this.skin.incProgress(t)}},{key:"getActiveMediaPlayer",value:function(t){return this.activeMediaBag&&t?this.activeMediaBag.getActiveMediaPlayer(t,this.project.mediaBag,this):null}},{key:"reportNewActivity",value:function(t){var e=this.project.activitySequence.getCurrentAct();this.reporter&&(e.tag===this.reporter.getCurrentSequenceTag()&&this.reporter.newSequence(e),t.includeInReports&&this.reporter.newActivity(t)),this.setCounterValue("actions",0),this.setCounterValue("score",0)}},{key:"reportNewAction",value:function(t,e,n,i,r,o){this.reporter&&t.includeInReports&&t.reportActions&&this.reporter.newAction(e,n,i,r),o>=0&&(this.incCounterValue("actions"),this.setCounterValue("score",o))}},{key:"reportEndActivity",value:function(t,e){this.reporter&&t.includeInReports&&this.reporter.endActivity(this.counterVal.score,this.counterVal.actions,e)}},{key:"showHelp",value:function(t){return!!this.skin&&this.skin.showHelp(t)}},{key:"displayURL",value:function(t,e){t&&(e?window.open(t,this.options.infoUrlFrame):this.end().then((function(){window.location.href=t})))}},{key:"exit",value:function(t){this.displayURL(t||this.options.exitUrl,!1)}},{key:"setWindowTitle",value:function(t){wt("info","running ".concat(t))}}],n&&ps(e.prototype,n),r&&ps(e,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(Ke);Object.assign(bs.prototype,{options:{maxWaitTime:12e4,infoUrlFrame:"_blank",exitUrl:null,returnAsExit:!1,audioEnabled:!0,navButtonsAlways:!1,fade:300,minSwipeX:40,maxSwipeY:100,rightToLeft:!1},id:"JC0000",$div:null,$topDiv:null,$mainContainer:null,fullScreenChecked:!1,project:null,basePath:"",zip:null,localFS:!1,actPanel:null,history:null,skin:null,defaultSkin:null,lastProjectSkin:null,activeMediaBag:null,reporter:null,actions:{},timer:null,delayedTimer:null,delayedAction:null,counterVal:{score:0,actions:0,time:0},bgImageOrigin:null,audioEnabled:!0,navButtonsDisabled:!1,navButtonsAlways:!1});var ws=bs;function ks(t){return ks="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ks(t)}function As(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ss(i.key),i)}}function Ss(t){var e=function(t,e){if("object"!==ks(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ks(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ks(e)?e:String(e)}function xs(){return xs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Es(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},xs.apply(this,arguments)}function Cs(t,e){return Cs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cs(t,e)}function Os(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Es(t);if(e){var r=Es(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===ks(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ps(t)}(this,n)}}function Ps(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Es(t){return Es=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Es(t)}var Ts=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cs(t,e)}(o,t);var e,n,i,r=Os(o);function o(t,e,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(i=r.call(this)).container=e,i.parent=t,i.boxBase=n,i.shape=Ps(i),i.specialShape=!1,i.visible=!0,i}return e=o,n=[{key:"setParent",value:function(t){this.parent=t}},{key:"getParent",value:function(){return this.parent}},{key:"end",value:function(){}},{key:"setContainer",value:function(t){this.container=t,this.$hostedComponent&&this.container&&this.container.$div&&(this.$hostedComponent.detach(),this.container.$div.append(this.$hostedComponent))}},{key:"getContainerX",value:function(){return this.container}},{key:"getContainerResolve",value:function(){for(var t=this;null===t.container&&null!==t.parent;)t=t.parent;return t.container}},{key:"invalidate",value:function(t){var e=this.getContainerResolve();e&&e.invalidate(t)}},{key:"setBoxBase",value:function(t){this.boxBase=t,this.invalidate()}},{key:"getBoxBaseResolve",value:function(){for(var t=this;!t.boxBase&&t.parent;)t=t.parent;return t.boxBase||Xi.DEFAULT_BOX_BASE}},{key:"setShape",value:function(t){this.shape=t,this.specialShape=!0,this.invalidate(),xs(Es(o.prototype),"setBounds",this).call(this,t.getBounds()),this.invalidate()}},{key:"getShape",value:function(){return this.shape}},{key:"contains",value:function(t){return this.shape===this?xs(Es(o.prototype),"contains",this).call(this,t):this.shape.contains(t)}},{key:"setBounds",value:function(t,e,n,i){if("number"==typeof t&&(t=new Ue(t,e,n,i)),!this.equals(t)){var r=!this.dim.equals(t.dim);return this.specialShape?(r&&(this.shape.scaleBy(new Ve(t.dim.width/this.dim.width,t.dim.height/this.dim.height)),this.setShape(this.shape)),this.pos.equals(t.pos)||this.shape.moveTo(t.pos),this.setShape(this.shape)):xs(Es(o.prototype),"setBounds",this).call(this,t),this.$hostedComponent&&this.setHostedComponentBounds(r),this}}},{key:"moveTo",value:function(t,e){"number"==typeof t&&(t=new Me(t,e)),this.setBounds(new Ue(this).moveTo(t))}},{key:"moveBy",value:function(t,e){this.setBounds(new Ue(this).moveBy(t,e))}},{key:"setSize",value:function(t,e){this.setBounds(new Ue(this.pos,new Ve(t,e)))}},{key:"hasBorder",value:function(){return this.border}},{key:"setBorder",value:function(t){t||this.invalidate(),this.border=t,t&&this.invalidate()}},{key:"isVisible",value:function(){return this.visible}},{key:"setVisible",value:function(t){this.visible=t,this.setHostedComponentVisible(),this.invalidate()}},{key:"setHostedComponentVisible",value:function(){this.$hostedComponent&&this.$hostedComponent.css("visibility",this.visible?"visible":"hidden")}},{key:"isTemporaryHidden",value:function(){return this.temporaryHidden}},{key:"setTemporaryHidden",value:function(t){this.temporaryHidden=t}},{key:"isInactive",value:function(){return this.inactive}},{key:"setInactive",value:function(t){if(this.inactive=t,this.$hostedComponent)this.setHostedComponentColors(),this.setHostedComponentVisible();else{if(this.$accessibleElement){var e=this.isInactive()&&!this.accessibleAlwaysActive;this.$accessibleElement.prop({disabled:e,tabindex:e?-1:0})}this.invalidate()}}},{key:"isInverted",value:function(){return this.inverted}},{key:"setInverted",value:function(t){this.inverted=t,this.$hostedComponent?this.setHostedComponentColors():this.invalidate()}},{key:"isMarked",value:function(){return this.marked}},{key:"setMarked",value:function(t){t||this.invalidate(),this.marked=t,this.$hostedComponent?(this.setHostedComponentColors(),this.setHostedComponentBorder()):t&&this.invalidate()}},{key:"isFocused",value:function(){return this.focused}},{key:"setFocused",value:function(t){t||this.invalidate(),this.focused=t,t&&this.invalidate(),this.$hostedComponent&&this.$hostedComponent.css("z-index",this.focused?20:2)}},{key:"isAlternative",value:function(){return this.alternative}},{key:"setAlternative",value:function(t){this.alternative=t,this.invalidate()}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty()||!this.isVisible()||this.isTemporaryHidden())return!1;if(e&&!this.shape.intersects(e))return!1;var n=this.getBoxBaseResolve();return n.transparent||n.dontFill||this.tmpTrans||(n.bgGradient&&!n.bgGradient.hasTransparency()||(t.fillStyle=this.inactive?n.inactiveColor:this.inverted?n.textColor:n.backColor,this.shape.fill(t,e)),n.bgGradient&&(t.fillStyle=n.bgGradient.getGradient(t,this.shape.getBounds()),this.shape.fill(t,e)),t.fillStyle="black"),this.$hostedComponent||this.updateContent(t,e),this.drawBorder(t),!0}},{key:"updateContent",value:function(t,e){}},{key:"drawBorder",value:function(t){if(this.border||this.marked){var e=this.getBoxBaseResolve();t.strokeStyle=e.borderColor,e[this.marked?"markerStroke":"borderStroke"].setStroke(t),this.marked&&(t.globalCompositeOperation="xor"),this.shape.stroke(t),this.marked&&(t.globalCompositeOperation="source-over"),t.strokeStyle="black",Ne.prototype.setStroke(t)}}},{key:"getBorderBounds",value:function(){var t=new Ue(this.getBounds());if(this.border||this.marked){var e=this.getBoxBaseResolve()[this.marked?"markerStroke":"borderStroke"].lineWidth;t.moveBy(-e/2,-e/2),t.dim.width+=e,t.dim.height+=e}return t}},{key:"setHostedComponent",value:function(t){this.$hostedComponent&&this.$hostedComponent.detach(),this.$hostedComponent=t,this.$hostedComponent&&(this.setContainer(this.container),this.setHostedComponentColors(),this.setHostedComponentBorder(),this.setHostedComponentBounds(!0),this.setHostedComponentVisible(),this.setFocused(this.focused))}},{key:"getHostedComponent",value:function(){return this.$hostedComponent}},{key:"setHostedComponentColors",value:function(){if(this.$hostedComponent){var t=this.getBoxBaseResolve().getCSS(null,this.inactive,this.inverted,this.alternative);this.$hostedComponent.data("background-image")&&t["background-image"]&&(t["background-image"]="".concat(this.$hostedComponent.data("background-image"),",").concat(t["background-image"])),this.$hostedComponent.css(t)}}},{key:"setHostedComponentBorder",value:function(){if(this.$hostedComponent&&(this.border||this.marked)){var t=this.getBoxBaseResolve();this.$hostedComponent.css({"border-width":"".concat(t.get(this.marked?"markerStroke":"borderStroke").lineWidth,"px"),"border-style":"solid","border-color":t.get("borderColor")})}}},{key:"setHostedComponentBounds",value:function(t){if(this.$hostedComponent){var e=this.getBounds(),n=this.border||this.marked?this.getBoxBaseResolve().get(this.marked?"markerStroke":"borderStroke").lineWidth:0;this.$hostedComponent.css({position:"absolute",width:e.dim.width-2*n+"px",height:e.dim.height-2*n+"px",top:e.pos.y+"px",left:e.pos.x+"px"})}}}],n&&As(e.prototype,n),i&&As(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(Ue);Object.assign(Ts.prototype,{parent:null,container:null,boxBase:null,border:!1,shape:null,specialShape:!1,visible:!0,temporaryHidden:!1,tmpTrans:!1,inactive:!1,inverted:!1,alternative:!1,marked:!1,focused:!1,accessibleText:"",role:"cell",$accessibleElement:null,accessibleAlwaysActive:!1,$hostedComponent:null});var js=Ts;function _s(t){return _s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s(t)}function Bs(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Rs(i.key),i)}}function Rs(t){var e=function(t,e){if("object"!==_s(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==_s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===_s(e)?e:String(e)}function Is(){return Is="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ms(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Is.apply(this,arguments)}function Ds(t,e){return Ds=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ds(t,e)}function Ns(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Ms(t);if(e){var r=Ms(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===_s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Ms(t){return Ms=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ms(t)}var Vs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ds(t,e)}(s,t);var e,n,r,o=Ns(s);function s(t,e,n,i,r){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(a=o.call(this,t,e,n)).clear(),"number"==typeof i&&(a.idLoc=i,a.idAss=0,a.idOrder=0),r&&a.setBounds(r),a}return e=s,n=[{key:"getCurrentContent",value:function(){return this.isAlternative()?this.altContent:this.content}},{key:"getContent",value:function(){return this.content||this.setContent(new ar),this.content}},{key:"clear",value:function(){this.content=null,this.altContent=null,this.idOrder=-1,this.setInactive(!0),this.hasHostedComponent||this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.$accessibleElement&&this.$accessibleElement.html(""),this.tmpTrans&&(this.tmpTrans=!1),this.invalidate()}},{key:"isEquivalent",value:function(t,e){return null!==t&&null!==this.content&&this.content.isEquivalent(t.content,e)}},{key:"isCurrentContentEquivalent",value:function(t,e){return null!==t&&null!==this.getCurrentContent()&&this.getCurrentContent().isEquivalent(t.getCurrentContent(),e)}},{key:"exchangeLocation",value:function(t){var e=new Me(this.pos),n=this.idLoc;this.moveTo(t.pos),t.moveTo(e),this.idLoc=t.idLoc,t.idLoc=n}},{key:"copyContent",value:function(t){this.idOrder=t.idOrder,this.idAss=t.idAss,this.content=t.content,this.altContent=t.altContent,this.content&&(this.content.style&&this.setBoxBase(this.content.style),null!==this.content.border&&t.hasBorder()!==this.content.border&&this.setBorder(this.content.border)),this.setInactive(t.isInactive()),this.setInverted(t.isInverted()),this.setAlternative(t.isAlternative()),this.setHostedComponent(t.getHostedComponent()),this.hasHostedComponent=t.hasHostedComponent,this.setHostedMediaPlayer(t.hostedMediaPlayer),this.hostedMediaPlayer&&this.hostedMediaPlayer.setVisualComponentVisible(!this.isInactive()&&this.isVisible()),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}},{key:"exchangeContent",value:function(t){var e=new s(this.getParent(),this.getContainerX(),this.boxBase);e.copyContent(this),this.copyContent(t),t.copyContent(e)}},{key:"setTextContent",value:function(t){t||(t=""),this.content||(this.content=new ar),this.content.text=t,this.content.mediaContent=null,this.content.img=null,this.setHostedComponent(null),this.setInactive(!1),this.checkHostedComponent(),this.setHostedMediaPlayer(null),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}},{key:"setDefaultIdAss",value:function(){this.idAss=null===this.content?-1:this.content.id}},{key:"isAtPlace",value:function(){return this.idOrder===this.idLoc}},{key:"setContent",value:function(t,e){if(t instanceof mr){if(e<0&&(e=this.idOrder),e>=t.getNumCells())return;t.style!==this.boxBase&&this.setBoxBase(t.style),t=t.getActiveBoxContent(e)}if(this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.content=t,t){if(t.animatedGifFile&&!this.specialShape){var n="url(".concat(t.animatedGifFile,")"),r=i()("<span/>").css({"background-image":n,"background-position":"center","background-repeat":"no-repeat"});r.data("background-image",n),null!==t.imgClip&&r.css({"background-origin":"border-box","background-position":"".concat(-t.imgClip.pos.x,"px ").concat(-t.imgClip.pos.y,"px")}),this.setHostedComponent(r)}t.style!==this.boxBase&&this.setBoxBase(t.style),t.innerHtmlText&&this.setHostedComponent(i()("<div/>").html(t.innerHtmlText)),t.hasOwnProperty("border")&&this.hasBorder()!==t.border&&this.setBorder(t.border),this.setInactive(!1),t.amp&&this.setHostedMediaPlayer(t.amp),this.checkHostedComponent(),this.checkAutoStartMedia()}else this.clear();this.invalidate(),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}},{key:"setAltContent",value:function(t,e){t instanceof mr&&(e<0&&(e=this.idOrder),t=t.getActiveBoxContent(e)),this.altContent=t,this.checkHostedComponent(),this.isAlternative()&&this.hostedMediaPlayer&&this.setHostedMediaPlayer(null),this.$accessibleElement&&(this.$accessibleElement.html(this.toString()),this.$accessibleElement.prop("disabled",!0))}},{key:"setCurrentContent",value:function(t){this.isAlternative()?this.setAltContent(t):this.setContent(t),this.invalidate()}},{key:"switchToAlt",value:function(){return!(this.isAlternative()||!this.altContent||this.altContent.isEmpty()||(this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.setAlternative(!0),this.tmpTrans=!1,this.checkHostedComponent(),this.checkAutoStartMedia(),this.$accessibleElement&&this.$accessibleElement.html(this.toString()),0))}},{key:"checkHostedComponent",value:function(){if(!this.hasHostedComponent){var t=this.getCurrentContent(),e=this.getBoxBaseResolve();!this.isInactive()&&t&&t.innerHtmlText&&(e.getCSS()["text-align"]=t.txtAlign.h.replace("middle","center"))}}},{key:"checkAutoStartMedia",value:function(){var t=this.getContent();t&&t.mediaContent&&t.mediaContent.autoStart&&t.amp&&t.amp.playNow(this)}},{key:"updateContent",value:function(t,e){var n=this.getCurrentContent(),i=this.getBoxBaseResolve();if(this.isInactive()||!n||this.dim.width<2||this.dim.height<2)return this._focusAccessibleElement(t),!0;if(e&&!this.intersects(e))return!1;var r=null;if(n.img&&!this.tmpTrans)try{if(n.imgClip){var o=n.imgClip.getBounds(),s=n.img;if(!n.imgClip.isRect()){var a=document.createElement("canvas");a.width=o.pos.x+o.dim.width,a.height=o.pos.y+o.dim.height;var c=a.getContext("2d");n.imgClip.clip(c),c.drawImage(n.img,0,0),s=a}t.drawImage(s,Math.max(0,o.pos.x),Math.max(0,o.pos.y),Math.min(s.width,o.dim.width),Math.min(s.height,o.dim.height),this.pos.x,this.pos.y,this.dim.width,this.dim.height)}else{var u=n.img.naturalWidth||this.dim.width,l=n.img.naturalHeight||this.dim.height,h=!1,f=1;be.COMPRESS_IMAGES&&this.dim.width>0&&this.dim.height>0&&(u>this.dim.width||l>this.dim.height)&&(u*=f=Math.min(this.dim.width/u,this.dim.height/l),l*=f,h=!0);var p="left"===n.imgAlign.h?0:"right"===n.imgAlign.h?this.dim.width-u:(this.dim.width-u)/2,d="top"===n.imgAlign.v?0:"bottom"===n.imgAlign.v?this.dim.height-l:(this.dim.height-l)/2;h?t.drawImage(n.img,this.pos.x+p,this.pos.y+d,u,l):t.drawImage(n.img,this.pos.x+p,this.pos.y+d),n.avoidOverlapping&&n.text&&(r=new Ue(Math.max(0,p),Math.max(0,d),Math.min(this.dim.width,u),Math.min(this.dim.height,l)))}}catch(t){wt("warn",'Unable to draw image "'.concat(n.image,'": ').concat(t.message))}if(n.text&&n.text.length>0){var v=this.pos.x,y=this.pos.y,m=this.dim.width,g=this.dim.height;if(r){for(var b=[0,r.pos.x,r.pos.x+r.dim.width,m],w=[0,r.pos.y,r.pos.y+r.dim.height,g],k=[new Ue(b[0],w[0],b[3],w[1]),new Ue(b[0],w[2],b[3],w[3]-w[2]),new Ue(b[0],w[0],b[1],w[3]),new Ue(b[2],w[0],b[3]-b[2],w[3])],A=k[0],S=A.dim.width*A.dim.height,x=1;x<k.length;x++){var C=k[x].dim.width*k[x].dim.height;if(C>S-1){if(Math.abs(C-S)<=1){var O=!1;switch(x){case 1:O="bottom"===n.txtAlign.v;break;case 2:O="left"===n.txtAlign.h;break;case 3:O="right"===n.txtAlign.h}if(!O)continue}S=C,A=k[x]}}v+=A.pos.x,y+=A.pos.y,m=A.dim.width,g=A.dim.height}var P=Math.max(5,m-2*i.textMargin),E=Math.max(5,g-2*i.textMargin),T=i.prepareText(t,n.text,P,E);t.font=i.font.cssFont(),t.textBaseline="alphabetic";for(var j=i.font.getHeight(),_=j*T.length,B=y+i.textMargin+("top"===n.txtAlign.v?0:"bottom"===n.txtAlign.v?E-_:(E-_)/2)+i.font.getMetrics().ascent,R=0;R<T.length;R++,B+=j){var I=v+i.textMargin+("left"===n.txtAlign.h?0:"right"===n.txtAlign.h?P-T[R].size.width:(P-T[R].size.width)/2);if(i.shadow){var D=Math.max(1,i.font.size/10);t.fillStyle=i.shadowColor,t.fillText(T[R].text,I+D,B+D)}t.fillStyle=this.isInverted()?i.backColor:this.isAlternative()?i.alternativeColor:i.textColor,t.fillText(T[R].text,I,B)}this._focusAccessibleElement(t)}return!0}},{key:"_focusAccessibleElement",value:function(t){be.CANVAS_DRAW_FOCUS&&this.$accessibleElement&&(this.shape.preparePath(t),t.drawFocusIfNeeded(this.$accessibleElement.get(-1)))}},{key:"getDescription",value:function(){return this.content?this.content.getDescription():""}},{key:"toString",value:function(){return("cell"!==this.role?gt(this.role):"")+(this.getCurrentContent()||"-").toString()}},{key:"playMedia",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getCurrentContent();return!(!n||!n.mediaContent||(wt("debug","Playing: ".concat(n.mediaContent.toString())),t.playMedia(n.mediaContent,this,e),0))}},{key:"setHostedMediaPlayer",value:function(t){var e=this.hostedMediaPlayer;this.hostedMediaPlayer=t,e&&e!==t&&e.linkTo(null),t&&t.linkTo(this)}},{key:"setBounds",value:function(t,e,n,i){"number"==typeof t&&(t=new Ue(t,e,n,i)),this.equals(t)||(Is(Ms(s.prototype),"setBounds",this).call(this,t),this.hostedMediaPlayer&&this.hostedMediaPlayer.checkVisualComponentBounds(this))}},{key:"setHostedComponentBounds",value:function(t){if(this.$hostedComponent){Is(Ms(s.prototype),"setHostedComponentBounds",this).call(this,t);var e=this.getCurrentContent();if(t&&e&&e.animatedGifFile&&e.img){var n=e.img,i=Math.max(n.naturalWidth,this.dim.width),r=Math.max(n.naturalHeight,this.dim.height),o=1,a="";if(e.imgClip){var c=e.imgClip.getBounds();(this.dim.width<c.dim.width||this.dim.height<c.dim.height)&&(o=Math.min(this.dim.width/c.dim.width,this.dim.height/c.dim.height),a="".concat(i*o,"px ").concat(r*o,"px")),this.$hostedComponent.css({"background-position":"".concat(-e.imgClip.pos.x*o,"px ").concat(-e.imgClip.pos.y*o,"px"),"background-size":a})}else(this.dim.width<i||this.dim.height<r)&&(o=Math.min(this.dim.width/i,this.dim.height/r),a="".concat(i*o,"px ").concat(r*o,"px")),this.$hostedComponent.css({"background-size":a})}}}},{key:"buildAccessibleElement",value:function(t,e,n,r){var o=this;this.$accessibleElement&&this.$accessibleElement.remove();var s=t.get(-1);if(s.width>0&&s.height>0){var a=Math.round(1e5*Math.random()),c=this.isInactive()&&!this.accessibleAlwaysActive;this.$accessibleElement=i()("<button/>",{tabindex:c?-1:0,id:"AE".concat(a),disabled:c}).html(this.toString()).on("click",(function(n){if(n.originalEvent&&(0!==n.originalEvent.pageX||0!==n.originalEvent.pageY))return!0;wt("debug","Click on accessible element: ".concat(o.toString()));var s=i().Event(r||"click"),a=o.getBounds(),c=t.offset();return s.pageX=c.left+a.pos.x+a.dim.width/2,s.pageY=c.top+a.pos.y+a.dim.height/2,e.trigger(s),!1})),(n||t).append(this.$accessibleElement),be.CANVAS_DRAW_FOCUS&&this.$accessibleElement.on("focus blur",(function(t){wt("debug","".concat(t.type," accessible element: ").concat(o.toString())),o.container&&o.container.update(),o.updateContent(s.getContext("2d"),null)}))}return this.$accessibleElement}}],r=[{key:"createCell",value:function(t,e){if(e&&e.dimension){var n=new s,r=i()('<canvas width="'+e.dimension.width+'" height="'+e.dimension.height+'"/>'),o=new Ue(0,0,e.dimension.width,e.dimension.height);return n.container=new Ke,n.container.$div=t,n.setContent(e),n.setBounds(o),t.append(r),e.mediaContent&&n.buildAccessibleElement(r,t),n.update(r.get(-1).getContext("2d"),o),n}}}],n&&Bs(e.prototype,n),r&&Bs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(js);Object.assign(Vs.prototype,{idOrder:-1,idLoc:-1,idAss:-1,pos0:null,content:null,altContent:null,hasHostedComponent:!1,hostedMediaPlayer:null,isBackground:!1});var qs=Vs;function Ls(t){return Ls="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ls(t)}function Fs(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,zs(i.key),i)}}function zs(t){var e=function(t,e){if("object"!==Ls(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ls(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ls(e)?e:String(e)}var Us=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e&&(this.id=e),n&&(this.$div=n)}var e,n,i;return e=t,n=[{key:"getDisplayValue",value:function(){var t=this.countDown>0?this.countDown-this.value:this.value;return this.displayDiffFrom&&(t-=this.displayDiffFrom.value),Math.max(0,Math.min(this.MAX_DISPLAY_VALUE,t))}},{key:"refreshDisplay",value:function(){this.$div&&this.$div.html(this.enabled?(this.getDisplayValue()+1e3).toString().substr(1):"000")}},{key:"setEnabled",value:function(t){this.enabled!==t&&(this.enabled=t,this.$div&&(this.refreshDisplay(),this.$div.css("opacity",this.enabled?1:.3)))}},{key:"setCountDown",value:function(t){this.countDown!==(this.countDown=t)&&this.refreshDisplay()}},{key:"incValue",value:function(){this.value++,this.enabled&&this.refreshDisplay()}},{key:"setValue",value:function(t){this.enabled&&this.value!==(this.value=t)&&this.refreshDisplay()}}],n&&Fs(e.prototype,n),i&&Fs(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign(Us.prototype,{id:"",$div:null,value:0,countDown:0,enabled:!0,MAX_DISPLAY_VALUE:999,displayDiffFrom:null});var $s=Us;function Hs(t){return Hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hs(t)}function Ws(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Gs(i.key),i)}}function Gs(t){var e=function(t,e){if("object"!==Hs(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Hs(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Hs(e)?e:String(e)}function Js(){return Js="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ys(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Js.apply(this,arguments)}function Ks(t,e){return Ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ks(t,e)}function Zs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Ys(t);if(e){var r=Ys(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Hs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Ys(t){return Ys=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ys(t)}var Qs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ks(t,e)}(s,t);var e,n,r,o=Zs(s);function s(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),e=o.call(this,t,n,r);var a="";if(Ie.loadGoogleFonts(e.cssFonts),e.$ctrlCnt=i()("<div/>",{class:"JClicCtrlCnt unselectableText",role:"navigation"}),e.$div.append(e.$ctrlCnt),a=gt("Previous activity"),e.buttons.prev=i()("<button/>",{class:"JClicBtn",title:a,"aria-label":a}).append(i()(ce(e.prevIcon,e.iconWidth,e.iconHeight,e.iconFill))).on("click",(function(t){e.ps&&e.ps.actions.prev.processEvent(t)})),e.$ctrlCnt.append(e.buttons.prev),e.msgBox=new qs,e.msgBox.role="message",e.$msgBoxDiv=i()("<div/>",{class:"JClicMsgBox"}).on("click",(function(){return e.msgBox.playMedia(t),!1})),e.$ctrlCnt.append(e.$msgBoxDiv),a=gt("Next activity"),e.buttons.next=i()("<button/>",{class:"JClicBtn",title:a,"aria-label":a}).append(i()(ce(e.nextIcon,e.iconWidth,e.iconHeight,e.iconFill))).on("click",(function(t){e.ps&&e.ps.actions.next.processEvent(t)})),e.$ctrlCnt.append(e.buttons.next),!1!==e.ps.options.counters&&!1!==r.counters){a=gt("Reports");var c=i()("<button/>",{class:"JClicCountCnt","aria-label":a}).on("click",(function(t){e.ps&&e.ps.actions.reports.processEvent(t)}));i().each(Tn.prototype.counters,(function(t,n){a=gt(t),e.counters[t]=new $s(t,i()("<div/>",{class:"JClicCounter",title:a,"aria-label":a}).css({"background-image":"url(".concat(ue(e[t+"Icon"],e.counterIconWidth,e.counterIconHeight,e.counterIconFill),")"),color:e.counterIconFill}).html("000").appendTo(c))})),e.$ctrlCnt.append(c)}if(!0!==e.ps.options.info&&!0!==r.info||(a=gt("Information"),e.buttons.info=i()("<button/>",{class:"JClicBtn",title:a,"aria-label":a}).append(i()(ce(e.infoIcon,e.iconWidth,e.iconHeight,e.iconFill))).on("click",(function(t){e.ps&&e.ps.actions.info.processEvent(t)})),e.$ctrlCnt.append(e.buttons.info)),!0!==e.ps.options.reportsBtn&&!0!==r.reportsBtn||(a=gt("Reports"),e.buttons.about=i()("<button/>",{class:"JClicBtn",title:a,"aria-label":a}).append(i()(ce(e.reportsIcon,e.iconWidth,e.iconHeight,e.iconFill))).on("click",(function(t){e.ps&&e.ps.actions.reports.processEvent(t)})),e.$ctrlCnt.append(e.buttons.about)),document&&document.fullscreenEnabled&&(a=gt("Toggle full screen"),e.buttons.fullscreen=i()("<button/>",{class:"JClicBtn",title:a,"aria-label":a}).append(i()("<img/>",{src:ue(e.fullScreenIcon,e.iconWidth,e.iconHeight,e.iconFill)})).on("click",(function(){e.setScreenFull(null)})),e.$ctrlCnt.append(e.buttons.fullscreen)),"function"==typeof e.ps.options.closeFn){a=gt("Close");var u=e.ps.options.closeFn;e.buttons.close=i()("<button/>",{class:"JClicBtn",title:a,"aria-label":a}).append(i()(ce(e.closeIcon,e.iconWidth,e.iconHeight,e.iconFill))).on("click",(function(){wt("info","Closing the player"),u()})),e.$ctrlCnt.append(e.buttons.close)}var l=null;return i().each(e.buttons,(function(t,e){!e||"function"==typeof e[0].focus&&"function"==typeof e[0].blur||(null===l&&(l=function(){return wt("error",'"blur" and "focus" not defined for SVG objects in Explorer/Edge')}),e[0].focus=e[0].blur=l)})),e}return e=s,n=[{key:"_getStyleSheets",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return"".concat(Js(Ys(s.prototype),"_getStyleSheets",this).call(this,t)).concat("default"===t?this.mainCSS:"half"===t?this.mainCSSHalf:"twoThirds"===t?this.mainCSSTwoThirds:"")}},{key:"doLayout",value:function(){Js(Ys(s.prototype),"doLayout",this).call(this),this.buttons.fullscreen&&(this.buttons.fullscreen.find("img").get(-1).src=ue(this[document&&document.fullscreenElement?"fullScreenExitIcon":"fullScreenIcon"],this.iconWidth,this.iconHeight,this.iconFill))}},{key:"enableMainButtons",value:function(t){this.$ctrlCnt.find(".JClicBtn,.JClicCountCnt").attr("tabindex",t?"0":"-1")}}],n&&Ws(e.prototype,n),r&&Ws(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(Tn);Object.assign(Qs.prototype,{skinId:"JClicDefaultSkin",$ctrlCnt:null,margin:18,msgBoxHeight:60,countersWidth:60,countersHeight:20,mainCSS:".ID .JClicCtrlCnt {\n margin: 0 9px 18px 9px;\n display: -webkit-flex;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.ID .JClicCountCnt {\n display: -webkit-flex;\n display: flex;\n flex-direction: column;\n}\n\n.ID .JClicMsgBox {\n height: 60px;\n flex-grow: 1;\n background-color: lightblue;\n}\n\n.ID .JClicBtn {\n cursor: pointer;\n line-height: 0;\n}\n\n.ID .JClicBtn:disabled {\n cursor: inherit;\n opacity: 0.3;\n}\n\n.ID .JClicCounter {\n width: 40px;\n height: 20px;\n padding-left: 20px;\n color: white;\n cursor: pointer;\n font-family: Roboto, Sans-serif;\n font-size: 18px;\n text-align: center;\n background-repeat: no-repeat;\n background-position: left;\n box-sizing: content-box;\n}\n",mainCSSHalf:".ID .JClicPlayerCnt {\n margin: 9px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 4px 9px 4px;\n}\n\n.ID .JClicCtrlCnt button svg, img {\n width: 18px;\n height: 18px;\n}\n\n.ID .JClicMsgBox {\n height: 30px;\n}\n\n.ID .JClicCounter {\n width: 20px;\n height: 10px;\n margin-left: -15px;\n transform: scale(0.5);\n}\n",mainCSSTwoThirds:".ID .JClicPlayerCnt {\n margin: 12px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 6px 12px 6px;\n}\n\n.ID .JClicCtrlCnt button svg, img {\n width: 24px;\n height: 24px;\n}\n\n.ID .JClicMsgBox {\n height: 40px;\n}\n\n.ID .JClicCounter {\n width: 27px;\n height: 13px;\n margin-left: -10px;\n transform: scale(0.666);\n}\n",cssFonts:["Roboto"],iconWidth:36,iconHeight:36,iconFill:"#FFFFFF",prevIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" />\n</svg>\n',nextIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" />\n</svg>\n',fullScreenIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" />\n</svg>\n',fullScreenExitIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" />\n</svg>\n',closeIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />\n</svg>\n',infoIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z" />\n</svg>\n',reportsIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z" />\n</svg>\n',counterIconWidth:18,counterIconHeight:18,counterIconFill:"#FFFFFF",timeIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />\n <path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" />\n</svg>\n',scoreIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />\n</svg>\n',actionsIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.49 5.48c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-3.6 13.9l1-4.4 2.1 2v6h2v-7.5l-2.1-2 .6-3c1.3 1.5 3.3 2.5 5.5 2.5v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1l-5.2 2.2v4.7h2v-3.4l1.8-.7-1.6 8.1-4.9-1-.4 2 7 1.4z" />\n</svg>\n'});var Xs=Tn.registerClass("default",Qs);function ta(t){return ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ta(t)}function ea(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,na(i.key),i)}}function na(t){var e=function(t,e){if("object"!==ta(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ta(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ta(e)?e:String(e)}function ia(){return ia="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sa(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},ia.apply(this,arguments)}function ra(t,e){return ra=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ra(t,e)}function oa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=sa(t);if(e){var r=sa(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===ta(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function sa(t){return sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sa(t)}var aa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ra(t,e)}(o,t);var e,n,i,r=oa(o);function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,t,e,n)}return e=o,n=[{key:"_getStyleSheets",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return ia(sa(o.prototype),"_getStyleSheets",this).call(this,t)+("default"===t?this.skinCSS:"")}}],n&&ea(e.prototype,n),i&&ea(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(Xs);Object.assign(aa.prototype,{skinId:"JClicOrangeSkin",skinCSS:".ID {background-color:#FF8B19;}"});var ca=Tn.registerClass("orange",aa);function ua(t){return ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ua(t)}function la(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ha(i.key),i)}}function ha(t){var e=function(t,e){if("object"!==ua(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ua(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ua(e)?e:String(e)}function fa(){return fa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=va(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},fa.apply(this,arguments)}function pa(t,e){return pa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pa(t,e)}function da(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=va(t);if(e){var r=va(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===ua(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function va(t){return va=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},va(t)}var ya=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pa(t,e)}(o,t);var e,n,i,r=da(o);function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,t,e,n)}return e=o,n=[{key:"_getStyleSheets",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return fa(va(o.prototype),"_getStyleSheets",this).call(this,t)+("default"===t?this.skinCSS:"")}}],n&&la(e.prototype,n),i&&la(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(Xs);Object.assign(ya.prototype,{skinId:"JClicGreenSkin",iconFill:"#20640E",counterIconFill:"#20640E",skinCSS:".ID {background-color:#4AFF19;}"});var ma=Tn.registerClass("green",ya);function ga(t){return ga="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ga(t)}function ba(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,wa(i.key),i)}}function wa(t){var e=function(t,e){if("object"!==ga(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ga(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ga(e)?e:String(e)}function ka(){return ka="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xa(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},ka.apply(this,arguments)}function Aa(t,e){return Aa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Aa(t,e)}function Sa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=xa(t);if(e){var r=xa(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===ga(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function xa(t){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xa(t)}var Ca=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Aa(t,e)}(o,t);var e,n,i,r=Sa(o);function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,t,e,n)}return e=o,n=[{key:"_getStyleSheets",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return ka(xa(o.prototype),"_getStyleSheets",this).call(this,t)+("default"===t?this.skinCSS:"")}}],n&&ba(e.prototype,n),i&&ba(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(Xs);Object.assign(Ca.prototype,{skinId:"JClicBlueSkin",skinCSS:".ID {background-color:#1990FF;}"});var Oa=Tn.registerClass("blue",Ca);function Pa(t){return Pa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pa(t)}function Ea(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ta(i.key),i)}}function Ta(t){var e=function(t,e){if("object"!==Pa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Pa(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Pa(e)?e:String(e)}function ja(){return ja="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ra(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},ja.apply(this,arguments)}function _a(t,e){return _a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_a(t,e)}function Ba(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Ra(t);if(e){var r=Ra(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Pa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Ra(t){return Ra=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ra(t)}var Ia=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_a(t,e)}(s,t);var e,n,r,o=Ba(s);function s(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=o.call(this,t,n,Object.assign({},r,{counters:!1,reportsBtn:!0}))).$ctrlCnt.detach().prependTo(e.$div),e.$msgBoxDiv.detach().appendTo(e.$div),i()("<div/>").css({"flex-grow":1}).insertAfter(e.$ctrlCnt.children(":nth-child(2)")),e}return e=s,n=[{key:"_getStyleSheets",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return"".concat(ja(Ra(s.prototype),"_getStyleSheets",this).call(this,t)).concat("default"===t?this.skinCSS:"half"===t?this.skinCSSHalf:"twoThirds"===t?this.skinCSSTwoThirds:"")}}],n&&Ea(e.prototype,n),r&&Ea(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(Xs);Object.assign(Ia.prototype,{skinId:"JClicSimpleSkin",skinCSS:".ID {\n background-color: #888888;\n}\n\n.ID .JClicCtrlCnt {\n margin: 9px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 18px 18px;\n}\n\n.ID .JClicMsgBox {\n flex-grow: 0;\n margin: 0 18px 18px 18px;\n}\n",skinCSSHalf:".ID .JClicCtrlCnt {\n margin: 4px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 9px 9px;\n}\n\n.ID .JClicMsgBox {\n margin: 0 9px 9px 9px;\n}\n",skinCSSTwoThirds:".ID .JClicCtrlCnt {\n margin: 6px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 12px 12px;\n}\n\n.ID .JClicMsgBox {\n margin: 0 12px 12px 12px;\n}\n"});var Da=Tn.registerClass("simple",Ia);function Na(t){return Na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Na(t)}function Ma(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Va(i.key),i)}}function Va(t){var e=function(t,e){if("object"!==Na(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Na(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Na(e)?e:String(e)}function qa(){return qa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=za(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},qa.apply(this,arguments)}function La(t,e){return La=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},La(t,e)}function Fa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=za(t);if(e){var r=za(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Na(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function za(t){return za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},za(t)}var Ua=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&La(t,e)}(o,t);var e,n,i,r=Fa(o);function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,t,e,Object.assign({},n,{counters:!1,reportsBtn:!0}))}return e=o,n=[{key:"_getStyleSheets",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return qa(za(o.prototype),"_getStyleSheets",this).call(this,t)+("default"===t?this.skinCSS:"")}}],n&&Ma(e.prototype,n),i&&Ma(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(Xs);Object.assign(Ua.prototype,{skinId:"JClicMiniSkin",iconWidth:18,iconHeight:18,iconFill:"#080808",counterIconFill:"#080808",margin:8,skinCSS:".ID {\n background-color: #F4F4F4;\n}\n\n.ID .JClicPlayerCnt {\n margin: 4px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 2px 4px 2px;\n}\n\n.ID .JClicMsgBox {\n height: 25px;\n}\n",mainCSSHalf:"",mainCSSTwoThirds:""});var $a=Tn.registerClass("mini",Ua);function Ha(t){return Ha="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ha(t)}function Wa(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ga(i.key),i)}}function Ga(t){var e=function(t,e){if("object"!==Ha(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ha(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ha(e)?e:String(e)}function Ja(){return Ja="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ya(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Ja.apply(this,arguments)}function Ka(t,e){return Ka=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ka(t,e)}function Za(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Ya(t);if(e){var r=Ya(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Ha(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Ya(t){return Ya=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ya(t)}var Qa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ka(t,e)}(o,t);var e,n,i,r=Za(o);function o(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,t,n,i)).msgBox=new qs,e.msgBox.role="message",e}return e=o,n=[{key:"_getStyleSheets",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Ja(Ya(o.prototype),"_getStyleSheets",this).call(this,t)+("default"===t?this.mainCSS:"")}}],n&&Wa(e.prototype,n),i&&Wa(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(Tn);Object.assign(Qa.prototype,{skinId:"JClicEmptySkin",mainCSS:".ID .JClicPlayerCnt {margin:0;}"});var Xa=Tn.registerClass("empty",Qa);function tc(t){return tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(t)}function ec(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,nc(i.key),i)}}function nc(t){var e=function(t,e){if("object"!==tc(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==tc(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===tc(e)?e:String(e)}function ic(){return ic="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sc(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},ic.apply(this,arguments)}function rc(t,e){return rc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},rc(t,e)}function oc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=sc(t);if(e){var r=sc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===tc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function sc(t){return sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sc(t)}var ac=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rc(t,e)}(s,t);var e,n,r,o=oc(s);function s(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=o.call(this,t,n,r)).$mainPanel=i()("<div/>",{class:"JClicCustomMainPanel"}),e.$gridPanel=i()("<div/>",{class:"JClicGridPanel"});for(var a=0;a<9;a++)e.$gridPanel.append(i()("<div/>",{class:"JClicCell JClicCell".concat(a+1)}));return e.$mainPanel.append(e.$gridPanel),e.$playerCnt.detach().addClass("JClicPlayerCell").appendTo(e.$mainPanel),e.$div.prepend(e.$mainPanel),r.buttons&&Object.keys(r.buttons.button).forEach((function(n){var r="about"===n?"reports":n,o=gt(e.msgKeys[r]||r);e.buttons[r]=i()("<button/>",{class:"JClicBtn JClicTransform Btn-".concat(r),title:o,"aria-label":o,disabled:void 0===e.msgKeys[r]}).on("click",(function(e){t.actions[r]&&t.actions[r].processEvent(e)})),e.$mainPanel.append(e.buttons[r])})),r.rectangle.messages&&(e.msgBox=new qs,e.msgBox.role="message",e.$msgBoxDiv=i()("<div/>",{class:"JClicMsgBox"}).on("click",(function(){return e.msgBox.playMedia(t),!1})),e.$mainPanel.append(e.$msgBoxDiv)),!1!==e.ps.options.counters&&r.counters&&r.counters.counter&&i().each(Tn.prototype.counters,(function(t,n){if(r.counters.counter[t]){var o=gt(t);e.counters[t]=new $s(t,i()("<div/>",{class:"JClicCounter JClicTransform Counter-".concat(t),title:o,"aria-label":o}).html("000").appendTo(e.$mainPanel))}})),r.progressAnimation&&(e.$progressAnimation=i()("<div/>",{class:"JClicProgressAnimation JClicTransform"}),e.$mainPanel.append(e.$progressAnimation)),e}return e=s,n=[{key:"enableMainButtons",value:function(t){this.$mainPanel.find(".JClicBtn").attr("tabindex",t?"0":"-1")}},{key:"_computeStyleSheets",value:function(){var t=this.options.dimension.preferredSize.width,e=this.options.dimension.preferredSize.height;this.twoThirdsMedia={width:t,height:e},this.halfMedia={width:Math.round(2*t/3),height:Math.round(2*e/3)};var n=this.options.rectangle.frame.left,i=n+this.options.rectangle.player.left,r=n+this.options.slicer.left,o=n+this.options.slicer.right,s=i+this.options.rectangle.player.width,a=n+this.options.rectangle.frame.width,c=this.options.rectangle.frame.top,u=c+this.options.rectangle.player.top,l=c+this.options.slicer.top,h=c+this.options.slicer.bottom,f=u+this.options.rectangle.player.height,p=c+this.options.rectangle.frame.height,d=this.ps.project.mediaBag.getElement(this.options.image,!0),v=d.data&&d.data.src?d.data.src:"",y=d.data?he(d.data,new Ue(n,c,r-n,l-c)):"",m=d.data?he(d.data,new Ue(r-n,c,o-r,l-c)):"",g=d.data?he(d.data,new Ue(o,c,a-o,l-c)):"",b=d.data?he(d.data,new Ue(n,l-c,r-n,h-l)):"",w=d.data?he(d.data,new Ue(o-n,l-c,a-o,h-l)):"",k=d.data?he(d.data,new Ue(n,h-c,r-n,p-h)):"",A=d.data?he(d.data,new Ue(r-n,h-c,o-r,p-h)):"",S=d.data?he(d.data,new Ue(o,h-c,a-o,p-h)):"",x="\n.ID .JClicCustomMainPanel {flex-grow:1;position:relative;background-color: ".concat(Vt(this.options.color.fill.value),";}\n.ID .JClicGridPanel {position:absolute;width:100%;height:100%;display:grid;grid-template-columns:").concat(r-n,"px 1fr ").concat(a-o,"px;grid-template-rows:").concat(l-c,"px 1fr ").concat(p-h,"px;}\n.ID .JClicCell {background-repeat:no-repeat;background-size:contain;}\n.ID .JClicPlayerCell {position:absolute;top:").concat(u-c,"px;right:").concat(a-s,"px;bottom:").concat(p-f,"px;left:").concat(i-n,"px;}\n.ID .JClicCell1 {background-image:url(").concat(y,");}\n.ID .JClicCell2 {background-image:url(").concat(m,");background-repeat:repeat-x;}\n.ID .JClicCell3 {background-image:url(").concat(g,");}\n.ID .JClicCell4 {background-image:url(").concat(b,");background-repeat:repeat-y;}\n.ID .JClicCell5 {}\n.ID .JClicCell6 {background-image:url(").concat(w,");background-repeat:repeat-y;}\n.ID .JClicCell7 {background-image:url(").concat(k,");}\n.ID .JClicCell8 {background-image:url(").concat(A,");background-repeat:repeat-x;}\n.ID .JClicCell9 {background-image:url(").concat(S,");}"),C="\n.ID .JClicGridPanel {grid-template-columns:".concat(Math.round((r-n)/2),"px 1fr ").concat(Math.round((a-o)/2),"px;grid-template-rows:").concat(Math.round((l-c)/2),"px 1fr ").concat(Math.round((p-h)/2),"px;}\n.ID .JClicPlayerCell {top:").concat(Math.round((u-c)/2),"px;right:").concat(Math.round((a-s)/2),"px;bottom:").concat(Math.round((p-f)/2),"px;left:").concat(Math.round((i-n)/2),"px;}\n.ID .JClicTransform {transform: scale(0.5);}"),O="\n.ID .JClicGridPanel {grid-template-columns:".concat(Math.round(2*(r-n)/3),"px 1fr ").concat(Math.round(2*(a-o)/3),"px;grid-template-rows:").concat(Math.round(2*(l-c)/3),"px 1fr ").concat(Math.round(2*(p-h)/3),"px;}\n.ID .JClicPlayerCell {top:").concat(Math.round(2*(u-c)/3),"px;right:").concat(Math.round(2*(a-s)/3),"px;bottom:").concat(Math.round(2*(p-f)/3),"px;left:").concat(Math.round(2*(i-n)/3),"px;}\n.ID .JClicTransform {transform: scale(0.666);}");if(this.options.buttons){var P=this.options.buttons,E=30,T=30,j={};P.settings&&(P.settings.dimension&&(E=P.settings.dimension.width||E,T=P.settings.dimension.height||T),P.settings.offset&&Object.assign(j,P.settings.offset)),Object.keys(this.options.buttons.button).forEach((function(t){var e=P.button[t],n="about"===t?"reports":t,i=E,o=T,s=j;e.settings&&(e.settings.dimension&&(i=e.settings.dimension.width||i,o=e.settings.dimension.height||o),e.settings.offset&&(s=Object.assign({},j,e.settings.offset)));var c=e.point.pos.left,u=c<r?"left:".concat(c):"right:".concat(a-c-i),h=c<r?"left:".concat(Math.round(c/2-i/4)):"right:".concat(Math.round((a-c-i)/2-i/4)),f=c<r?"left:".concat(Math.round(2*c/3-i/6)):"right:".concat(Math.round(2*(a-c-i)/3-i/6)),d=e.point.pos.top,y=d<l?"top:".concat(d):"bottom:".concat(p-d-o),m=d<l?"top:".concat(Math.round(d/2-o/4)):"bottom:".concat(Math.round((p-d-o)/2-o/4)),g=d<l?"top:".concat(Math.round(2*d/3-o/6)):"bottom:".concat(Math.round(2*(p-d-o)/3-o/6)),b=e.point.source.left,w=e.point.source.top;x+=".ID .Btn-".concat(n," {position:absolute;").concat(u,"px;").concat(y,"px;width:").concat(i,"px;height:").concat(o,"px;background:url(").concat(v,") !important;background-position:-").concat(b,"px -").concat(w,"px !important;}\n"),C+=".ID .Btn-".concat(n," {").concat(h,"px;").concat(m,"px;}\n"),O+=".ID .Btn-".concat(n," {").concat(f,"px;").concat(g,"px;}\n"),s.active&&(x+=".ID .Btn-".concat(n,":active {background-position:-").concat(b+s.active.right,"px -").concat(w+s.active.down,"px !important;}\n")),s.over&&(x+=".ID .Btn-".concat(n,":hover {background-position:-").concat(b+s.over.right,"px -").concat(w+s.over.down,"px !important;}\n")),s.disabled&&(x+=".ID .Btn-".concat(n,":disabled {background-position:-").concat(b+s.disabled.right,"px -").concat(w+s.disabled.down,"px !important;}\n"))}))}if(this.options.counters&&this.options.counters.settings){var _=this.options.counters,B=35,R=20;_.settings.dimension&&_.settings.dimension.counter&&(B=_.settings.dimension.counter.width||B,R=_.settings.dimension.counter.height||R);var I=37,D=14;_.settings.dimension&&_.settings.dimension.label&&(I=_.settings.dimension.label.width||I,D=_.settings.dimension.label.height||D);var N="black";_.style&&_.style.color&&_.style.color.foreground&&(N=Vt(_.style.color.foreground.value||N));var M=D-4,V="Roboto";_.style&&_.style.font&&_.style.font.label&&(M=Math.max(8,_.style.font.label.size||M),V="".concat(_.style.font.label.family||"Roboto",",Roboto,sans-serif")),x+=".ID .JClicCounter {font-size:".concat(R-2,"px;color:").concat(N,"}\n"),Object.keys(this.options.counters.counter).forEach((function(t){var e=_.counter[t],n=B,i=R,o=e.point.counter.left,s=e.point.label.left||o-Math.round((I-B)/2),c=o<r?"left:".concat(o):"right:".concat(a-o-n),u=o<r?"left:".concat(Math.round(o/2-n/4)):"right:".concat(Math.round((a-o-n)/2-n/4)),h=o<r?"left:".concat(Math.round(2*o/3-n/6)):"right:".concat(Math.round(2*(a-o-n)/3-n/6)),f=e.point.counter.top,d=e.point.label.top||f-D,v=f<l?"top:".concat(f):"bottom:".concat(p-f-i),y=f<l?"top:".concat(Math.round(f/2-i/4)):"bottom:".concat(Math.round((p-f-i)/2-i/4)),m=f<l?"top:".concat(Math.round(2*f/3-i/6)):"bottom:".concat(Math.round(2*(p-f-i)/3-i/6));x+=".ID .Counter-".concat(t," {position:absolute;").concat(c,"px;").concat(v,"px;width:").concat(n,"px;height:").concat(i,"px;line-height:").concat(i,"px;}\n"),x+=".ID .Counter-".concat(t,':before {content:"').concat(gt(t),'";font-size:').concat(M,"px;font-family:").concat(V,";width:").concat(I,"px;height:").concat(D,"px;line-height:").concat(D,"px;position:absolute;top:").concat(d-f,"px;left:").concat(s-o,"px;}"),C+=".ID .Counter-".concat(t," {").concat(u,"px;").concat(y,"px;}\n"),O+=".ID .Counter-".concat(t," {").concat(h,"px;").concat(m,"px;}\n")}))}if(this.options.progressAnimation){var q=this.options.progressAnimation,L=30,F=30;q.dimension&&(L=q.dimension.width||L,F=q.dimension.height||F);var z=q.point.pos.left,U=z<r?"left:".concat(z):"right:".concat(a-z-L),$=z<r?"left:".concat(Math.round(z/2-L/4)):"right:".concat(Math.round((a-z-L)/2-L/4)),H=z<r?"left:".concat(Math.round(2*z/3-L/6)):"right:".concat(Math.round(2*(a-z-L)/3-L/6)),W=q.point.pos.top,G=W<l?"top:".concat(W):"bottom:".concat(p-W-F),J=W<l?"top:".concat(Math.round(W/2-F/4)):"bottom:".concat(Math.round((p-W-F)/2-F/4)),K=W<l?"top:".concat(Math.round(2*W/3-F/6)):"bottom:".concat(Math.round(2*(p-W-F)/3-F/6)),Z=q.point.source.left,Y=q.point.source.top;if(x+=".ID .JClicProgressAnimation {position:absolute;".concat(U,"px;").concat(G,"px;width:").concat(L,"px;height:").concat(F,"px;background:url(").concat(v,");background-position:-").concat(Z,"px -").concat(Y,"px;}\n"),C+=".ID .JClicProgressAnimation {".concat($,"px;").concat(J,"px;}\n"),O+=".ID .JClicProgressAnimation {".concat(H,"px;").concat(K,"px;}\n"),q.frames&&q.direction){var Q=(q.step||L)*("right"===q.direction?1:"left"===q.direction?-1:0),X=(q.step||F)*("down"===q.direction?1:"up"===q.direction?-1:0);x+="\n@keyframes anim {100% {background-position:".concat(-1*(Z+Q*q.frames),"px ").concat(-1*(Y+X*q.frames),"px;}}\n.ID .JClicProgressAnimation {animation: anim ").concat(q.frames*q.delay,"ms steps(").concat(q.frames,") infinite;}")}}if(this.options.rectangle.messages){var tt=this.options.rectangle.messages,et=n+tt.left,nt=a-tt.width-tt.left-n,it=tt.top<l?"top:".concat(tt.top):"bottom:".concat(p-tt.height-tt.top),rt=tt.top<l?"top:".concat(Math.round(tt.top/2)):"bottom:".concat(Math.round((p-tt.height-tt.top)/2)),ot=tt.top<l?"top:".concat(Math.round(2*tt.top/3)):"bottom:".concat(Math.round(2*(p-tt.height-tt.top)/3));x+=".ID .JClicMsgBox {position:absolute;left:".concat(et,"px;right:").concat(nt,"px;height:").concat(tt.height,"px;").concat(it,"px;}"),C+=".ID .JClicMsgBox {left:".concat(Math.round(et/2),"px;right:").concat(Math.round(nt/2),"px;height:").concat(Math.round(tt.height/2),"px;").concat(rt,"px;}"),O+=".ID .JClicMsgBox {left:".concat(Math.round(2*et/3),"px;right:").concat(Math.round(2*nt/3),"px;height:").concat(Math.round(2*tt.height/3),"px;").concat(ot,"px;}")}this.cssVariants={default:this.mainCSS+x,half:C,twoThirds:O}}},{key:"_getStyleSheets",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return this.cssVariants||this._computeStyleSheets(),"".concat(ic(sc(s.prototype),"_getStyleSheets",this).call(this,t)).concat(this.cssVariants[t]||"")}},{key:"setWaitCursor",value:function(t){ic(sc(s.prototype),"setWaitCursor",this).call(this,t),this.$progressAnimation&&this.$progressAnimation.css("animation-play-state",this.waitCursorCount>0?"running":"paused")}}],n&&ec(e.prototype,n),r&&ec(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(Tn);Object.assign(ac.prototype,{skinId:"JClicCustomSkin",image:null,mainCSS:".ID .JClicPlayerCnt {margin:0;}.ID .JClicBtn:focus {outline:0;}.ID .JClicCounter {font-family:Roboto,sans-serif;text-align:center;}",cssVariants:null,msgKeys:{next:"Next activity",prev:"Previous activity",info:"Information",help:"Help",reports:"Reports",audio:"Audio on/off",reset:"Reset activity"},$progressAnimation:null});var cc=Tn.registerClass("custom",ac);function uc(t){return uc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(t)}function lc(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,hc(i.key),i)}}function hc(t){var e=function(t,e){if("object"!==uc(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==uc(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===uc(e)?e:String(e)}function fc(t,e){return fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fc(t,e)}function pc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=dc(t);if(e){var r=dc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===uc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function dc(t){return dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dc(t)}var vc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fc(t,e)}(o,t);var e,n,i,r=pc(o);function o(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,t,e)}return e=o,(n=[{key:"buildShapes",value:function(){for(var t=1/this.nCols,e=1/this.nRows,n=0;n<this.nRows;n++)for(var i=0;i<this.nCols;i++)this.shapeData[n*this.nCols+i]=new Ue(new Me(i*t,n*e),new Ve(t,e));this.initiated=!0}}])&&lc(e.prototype,n),i&&lc(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(fr);Object.assign(vc.prototype,{rectangularShapes:!0});var yc=fr.registerClass("@Rectangular",vc);function mc(t){return mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(t)}function gc(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,bc(i.key),i)}}function bc(t){var e=function(t,e){if("object"!==mc(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==mc(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===mc(e)?e:String(e)}function wc(){return wc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Sc(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},wc.apply(this,arguments)}function kc(t,e){return kc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kc(t,e)}function Ac(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Sc(t);if(e){var r=Sc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===mc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Sc(t){return Sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sc(t)}var xc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kc(t,e)}(o,t);var e,n,i,r=Ac(o);function o(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,1,1)).customShapes=!0,n.nCols=t,n.nRows=e,n.showEnclosure=!0,n}return e=o,(n=[{key:"buildShapes",value:function(){this.nCells>0&&(this.initiated=!0)}},{key:"getEnclosingShapeData",value:function(){return this.showEnclosure?this.enclosing||wc(Sc(o.prototype),"getEnclosingShapeData",this).call(this):null}}])&&gc(e.prototype,n),i&&gc(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(fr),Cc=fr.registerClass("@Holes",xc);function Oc(t){return Oc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oc(t)}function Pc(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ec(i.key),i)}}function Ec(t){var e=function(t,e){if("object"!==Oc(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Oc(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Oc(e)?e:String(e)}function Tc(t,e){return Tc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tc(t,e)}function jc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=_c(t);if(e){var r=_c(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Oc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function _c(t){return _c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_c(t)}var Bc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tc(t,e)}(o,t);var e,n,i,r=jc(o);function o(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,t,e)}return e=o,(n=[{key:"buildShapes",value:function(){for(var t=[],e=[],n=0;n<=this.nRows;n++)t[n]=[],e[n]=[];for(var i=0;i<this.nRows;i++)for(var r=0;r<this.nCols;r++)t[i][r]=0===i?0:1+(this.randomLines?Math.round(9*Math.random()):i+r)%2,e[i][r]=0===r?0:1+(this.randomLines?Math.round(9*Math.random()):r+i+1)%2,r===this.nCols-1&&(e[i][r+1]=0),i===this.nRows-1&&(t[i+1][r]=0);for(var o=1/this.nCols,s=1/this.nRows,a=0;a<this.nRows;a++)for(var c=0;c<this.nCols;c++){var u=o*c,l=s*a,h=new He([new We("M",[u,l])]);this.hLine(h,t[a][c],u+0,l+0,o,s,!1),this.vLine(h,e[a][c+1],u+o,l+0,o,s,!1),this.hLine(h,t[a+1][c],u+o,l+s,o,s,!0),this.vLine(h,e[a][c],u+0,l+s,o,s,!0),h.addStroke(new We("X")),h.calcEnclosingRect(),this.shapeData[a*this.nCols+c]=h}this.initiated=!0}},{key:"hLine",value:function(t,e,n,i,r,o,s){var a=s?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new We("L",[n+r*a,i]));else{var u=n+(r-r*this.baseWidthFactor)/2*a,l=r*this.baseWidthFactor*a;t.addStroke(new We("L",[u,i]));var h=o*this.toothHeightFactor*c;t.addStroke(new We("L",[u,i+h])),t.addStroke(new We("L",[u+l,i+h])),t.addStroke(new We("L",[u+l,i])),t.addStroke(new We("L",[n+r*a,i]))}}},{key:"vLine",value:function(t,e,n,i,r,o,s){var a=s?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new We("L",[n,i+o*a]));else{var u=i+(o-o*this.baseWidthFactor)/2*a,l=o*this.baseWidthFactor*a;t.addStroke(new We("L",[n,u]));var h=r*this.toothHeightFactor*c;t.addStroke(new We("L",[n+h,u])),t.addStroke(new We("L",[n+h,u+l])),t.addStroke(new We("L",[n,u+l])),t.addStroke(new We("L",[n,i+o*a]))}}}])&&Pc(e.prototype,n),i&&Pc(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(fr),Rc=fr.registerClass("@JigSaw",Bc);function Ic(t){return Ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic(t)}function Dc(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Nc(i.key),i)}}function Nc(t){var e=function(t,e){if("object"!==Ic(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ic(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ic(e)?e:String(e)}function Mc(t,e){return Mc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mc(t,e)}function Vc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=qc(t);if(e){var r=qc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Ic(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function qc(t){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qc(t)}var Lc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mc(t,e)}(o,t);var e,n,i,r=Vc(o);function o(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,t,e)}return e=o,(n=[{key:"hLine",value:function(t,e,n,i,r,o,s){var a=s?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new We("L",[n+r*a,i]));else{var u=n+(r-r*this.baseWidthFactor)/2*a,l=r*this.baseWidthFactor*a;t.addStroke(new We("L",[u,i]));var h=o*this.toothHeightFactor*c;t.addStroke(new We("L",[u+l/2,i+h])),t.addStroke(new We("L",[u+l,i])),t.addStroke(new We("L",[n+r*a,i]))}}},{key:"vLine",value:function(t,e,n,i,r,o,s){var a=s?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new We("L",[n,i+o*a]));else{var u=i+(o-o*this.baseWidthFactor)/2*a,l=o*this.baseWidthFactor*a;t.addStroke(new We("L",[n,u]));var h=r*this.toothHeightFactor*c;t.addStroke(new We("L",[n+h,u+l/2])),t.addStroke(new We("L",[n,u+l])),t.addStroke(new We("L",[n,i+o*a]))}}}])&&Dc(e.prototype,n),i&&Dc(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(Rc),Fc=fr.registerClass("@TriangularJigSaw",Lc);function zc(t){return zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(t)}function Uc(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,$c(i.key),i)}}function $c(t){var e=function(t,e){if("object"!==zc(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==zc(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===zc(e)?e:String(e)}function Hc(t,e){return Hc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hc(t,e)}function Wc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Gc(t);if(e){var r=Gc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===zc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Gc(t){return Gc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gc(t)}var Jc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Hc(t,e)}(o,t);var e,n,i,r=Wc(o);function o(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,t,e)}return e=o,(n=[{key:"hLine",value:function(t,e,n,i,r,o,s){var a=s?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new We("L",[n+r*a,i]));else{var u=n+(r-r*this.baseWidthFactor)/2*a,l=r*(this.baseWidthFactor/12)*a;t.addStroke(new We("L",[u,i]));var h=o*this.toothHeightFactor*c/8;t.addStroke(new We("B",[u+4*l,i,u+6*l,i-h,u+4*l,i-3*h])),t.addStroke(new We("B",[u+2*l,i-5*h,u+10*l,i-5*h,u+8*l,i-3*h])),t.addStroke(new We("B",[u+6*l,i-1*h,u+8*l,i,u+12*l,i])),t.addStroke(new We("L",[n+r*a,i]))}}},{key:"vLine",value:function(t,e,n,i,r,o,s){var a=s?-1:1,c=1===e?1:-1;if(0===e)t.addStroke(new We("L",[n,i+o*a]));else{var u=i+(o-o*this.baseWidthFactor)/2*a,l=o*this.baseWidthFactor/12*a;t.addStroke(new We("L",[n,u]));var h=r*this.toothHeightFactor*c/8;t.addStroke(new We("B",[n,u+4*l,n-h,u+6*l,n-3*h,u+4*l])),t.addStroke(new We("B",[n-5*h,u+2*l,n-5*h,u+10*l,n-3*h,u+8*l])),t.addStroke(new We("B",[n-1*h,u+6*l,n,u+8*l,n,u+12*l])),t.addStroke(new We("L",[n,i+o*a]))}}}])&&Uc(e.prototype,n),i&&Uc(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(Rc);Object.assign(Jc.prototype,{baseWidthFactor:3/4,toothHeightFactor:.6});var Kc=fr.registerClass("@ClassicJigSaw",Jc);function Zc(t){return Zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zc(t)}function Yc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qc(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,tu(i.key),i)}}function Xc(t,e,n){return e&&Qc(t.prototype,e),n&&Qc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function tu(t){var e=function(t,e){if("object"!==Zc(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Zc(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Zc(e)?e:String(e)}function eu(t,e){return eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},eu(t,e)}function nu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=iu(t);if(e){var r=iu(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Zc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function iu(t){return iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},iu(t)}var ru=["+","-",String.fromCharCode(215),":"],ou=-12345,su=Intl&&Intl.NumberFormat().format(1.1).indexOf(",")>0,au=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eu(t,e)}(n,t);var e=nu(n);function n(){var t;return Yc(this,n),(t=e.call(this)).className="@arith.Arith",t.numericContent=!0,t.opA=new n.Operator,t.opB=new n.Operator,t}return Xc(n,[{key:"setProperties",value:function(t){var e=this;return t.children().each((function(t,n){var r=i()(n),o="";switch(n.nodeName){case"operand":switch(r.attr("id")){case"A":e.opA.setProperties(r);break;case"B":e.opB.setProperties(r)}break;case"operations":e.use_add=kt(r.attr("plus")),e.use_subst=kt(r.attr("minus")),e.use_mult=kt(r.attr("multiply")),e.use_div=kt(r.attr("divide"));break;case"unknown":e.exp_abx=kt(r.attr("result")),e.exp_xbc=kt(r.attr("first")),e.exp_axc=kt(r.attr("last")),e.exp_axbc=kt(r.attr("operand")),e.exp_caxb=kt(r.attr("inverse"));break;case"result":o=r.attr("from"),e.resultLimInf=St("x"===o?0:o,e.resultLimInf),o=r.attr("to"),e.resultLimSup=St("x"===o?0:o,e.resultLimSup),e.resultCarry=kt(r.attr("notCarry"),e.resultCarry),e.resultNoDup=!kt(r.attr("duplicates"),!e.resultNoDup);var s=r.attr("order");e.resultOrder="ascending"===s?"SORTASC":"descending"===s?"SORTDESC":"NOSORT",s=r.attr("condition"),e.opCond="firstBig"===s?"AGB":"lastBig"===s?"BGA":"INDIF"}})),this}},{key:"getAttributes",value:function(){return zt(this,["className","opA","opB","use_add","use_subst","use_mult","use_div","exp_abx|true","exp_axc|false","exp_xbc|false","exp_axbc|false","exp_caxb|false","resultLimInf|0","resultLimSup|9999","resultCarry|false","resultNoDup|false","resultOrder|NOSORT","opCond|INDIF"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["className",{key:"opA",fn:n.Operator},{key:"opB",fn:n.Operator},"use_add","use_subst","use_mult","use_div","exp_abx","exp_axc","exp_xbc","exp_axbc","exp_caxb","resultLimInf","resultLimSup","resultCarry","resultNoDup","resultOrder","opCond"])}},{key:"genNum",value:function(t,e,n,i){var r=!1;t.c=e.numDec;var o=0===t.c?1:1===t.c?10:100,s=e.limSup;i!==ou&&i<s&&(s=i);var a=e.limInf;if(n!==ou&&n>a&&(a=n),e.fromList>0&&(t.vf=e.lst[Math.floor(Math.random()*e.fromList)],r=!0),!r){var c=Math.floor(100*Math.random());e.wZero&&c<=10?(t.vf=0,r=!0):e.wOne&&c>10&&c<=20?(t.vf=1,r=!0):e.wMinusOne&&c>20&&c<=30&&(t.vf=-1,r=!0)}if(!r){if(a>s){var u=a;a=s,s=u}var l=Math.floor(s-a+1);l<0&&(l=1);var h=(Math.floor(Math.random()*l)+a)*o;o>1&&(h+=Math.floor(Math.random()*o)),t.vf=h/o}return!0}},{key:"genOp",value:function(t){var e,i,r,o,s,a,c,u,l=[],h=this.resultLimInf,f=this.resultLimSup,p=0;switch(this.use_add&&(l[p++]="SUM"),this.use_subst&&(l[p++]="REST"),this.use_mult&&(l[p++]="MULT"),this.use_div&&(l[p++]="DIV"),l[Math.floor(Math.random()*p)]){case"SUM":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,f),i=t.numA.vf<h?h-Math.floor(t.numA.vf):this.RES,r=f-Math.floor(t.numA.vf),this.opCond){case"AGB":(r===this.RES||r>t.numA.vf)&&(r=Math.floor(t.numA.vf));break;case"BGA":(i===this.RES||i<t.numA.vf)&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,r),t.numR.vf=t.numA.vf+t.numB.vf,t.numR.vf>=h&&t.numR.vf<=f)break}if(t.numR.c=t.numA.c>t.numB.c?t.numA.c:t.numB.c,t.op=0,this.resultCarry&&t.numA.vf>0&&t.numB.vf>0){for(o=2===t.numR.c?100:1===t.numR.c?10:1,c=n.DecFormat(Math.floor(t.numA.vf*o+.5),0,10).split(""),u=n.DecFormat(Math.floor(t.numB.vf*o+.5),0,10).split(""),e=0;e<10&&("0"===c[e]&&"0"===u[e]);e++);for(;e<10;e++)if(!((s=parseInt(c[e]))+(a=parseInt(u[e]))<10)){for(;s+a>9;)s>a?s=s>0?Math.floor(Math.random()*s):0:a=a>0?Math.floor(Math.random()*a):0;c[e]=s.toFixed(0),u[e]=a.toFixed(0)}t.numA.vf=parseInt(c.join(""))/o,t.numB.vf=parseInt(u.join(""))/o,t.numR.vf=Math.floor(t.numA.vf*o+t.numB.vf*o+.5)/o}break;case"REST":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,h,this.RES),i=t.numA.vf>f?Math.floor(t.numA.vf-f):this.RES,r=Math.floor(t.numA.vf-h),this.opCond){case"AGB":(r===this.RES||r>t.numA.vf)&&(r=Math.floor(t.numA.vf));break;case"BGA":(i===this.RES||i<t.numA.vf)&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,r),t.numR.vf=t.numA.vf-t.numB.vf,t.numR.vf>=h&&t.numR.vf<=f)break}if(t.numR.c=t.numA.c>t.numB.c?t.numA.c:t.numB.c,t.op=1,this.resultCarry&&t.numA.vf>0&&t.numB.vf>0&&t.numA.vf>=t.numB.vf){for(o=2===t.numR.c?100:1===t.numR.c?10:1,c=n.DecFormat(Math.floor(t.numA.vf*o+.5),0,10).split(""),u=n.DecFormat(Math.floor(t.numB.vf*o+.5),0,10).split(""),e=0;e<10&&"0"===u[e];e++);for(;e<10;e++)(s=parseInt(c[e]))>=(a=parseInt(u[e]))||(a=s>0?Math.floor(Math.random()*s):0,u[e]=a.toFixed(0));t.numA.vf=parseInt(c.join(""))/o,t.numB.vf=parseInt(u.join(""))/o,t.numR.vf=Math.floor(t.numA.vf*o-t.numB.vf*o+.5)/o}break;case"MULT":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,this.RES),i=this.opB.limInf,r=this.opB.limSup,this.opCond){case"AGB":r>t.numA.vf&&(r=Math.floor(t.numA.vf));break;case"BGA":i<t.numA.vf&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,r),t.numR.vf=t.numA.vf*t.numB.vf,t.numR.vf>=h&&t.numR.vf<=f)break}t.numR.c=t.numA.c+t.numB.c,t.op=2;break;case"DIV":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,this.RES),i=this.opB.limInf,r=this.opB.limSup,this.opCond){case"AGB":r>t.numA.vf&&(r=Math.floor(t.numA.vf));break;case"BGA":i<t.numA.vf&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,r),0!==t.numB.vf&&Math.abs(t.numA.vf)>=Math.abs(t.numB.vf)&&(t.numR.vf=t.numA.vf/t.numB.vf)>=h&&t.numR.vf<=f)break}0===t.numB.vf&&(t.numB.vf=1),t.numR.vf=t.numA.vf/t.numB.vf,e=t.numA.c-t.numB.c,o=Math.pow(10,e),t.numA.vf*=o,t.numR.vf*=o,t.numR.vf=Math.floor(t.numR.vf),t.numA.vf=t.numR.vf*t.numB.vf,t.numA.vf/=o,t.numR.vf/=o,t.numR.c=e>0?e:0,t.op=3;break;default:return!1}return!0}},{key:"process",value:function(t){var e,i,r,o,s,a,c=t.nRows,u=t.nCols,l=t.content,h=t.useIds,f=[],p=[],d=this.exp_caxb,v="",y="",m="",g="",b=[],w=[],k=[],A=u,S=c,x=c*u,C=null;if(c<=0||u<=0||null===l||l.length<1||null===l[0])return!1;if(x<2)return!1;if(s=0,this.exp_abx&&(p[s++]="ABX"),this.exp_axc&&(p[s++]="AXC"),this.exp_xbc&&(p[s++]="XBC"),this.exp_axbc&&(p[s++]="AXBC"),0===s)return!1;for(e=0;e<x;e++){for(o=new n.Operation,i=0;i<60&&(this.genOp(o),this.resultNoDup);i++){for(r=0;r<e&&o.numR.vf!==f[r].numR.vf;r++);if(r===e)break}f[e]=o}if(0!==this.resultOrder)for(e=x-1;e>0;e--)for(i=0;i<e;i++)("SORTASC"===this.resultOrder&&f[i].numR.vf>f[i+1].numR.vf||"SORTDESC"===this.resultOrder&&f[i].numR.vf<f[i+1].numR.vf)&&(o=f[i],f[i]=f[i+1],f[i+1]=o);for(e=0;e<x;e++)switch(a=p[Math.floor(Math.random()*s)],v=n.DecFormat(f[e].numA.vf,f[0].numA.c),y=n.DecFormat(f[e].numB.vf,f[0].numB.c),m=n.DecFormat(f[e].numR.vf,f[0].numR.c),g=ru[f[e].op],k[e]=d?"".concat(m," = ").concat(v," ").concat(g," ").concat(y):"".concat(v," ").concat(g," ").concat(y," = ").concat(m),a){case"AXC":w[e]=y,b[e]=d?"".concat(m," = ").concat(v," ").concat(g," ?"):"".concat(v," ").concat(g," ? = ").concat(m);break;case"XBC":w[e]=v,b[e]=d?"".concat(m," = ? ").concat(g," ").concat(y):"? ".concat(g," ").concat(y," = ").concat(m);break;case"AXBC":w[e]=g,b[e]=d?"".concat(m," = ").concat(v," ? ").concat(y):"".concat(v," ? ").concat(y," = ").concat(m);break;default:w[e]=m,b[e]=d?"? = ".concat(v," ").concat(g," ").concat(y):"".concat(v," ").concat(g," ").concat(y," =")}if(h){C=[];var O=[];for(r=0,e=0;e<x;e++){for(i=0;i<r&&w[e]!==O[i];i++);i===r?(O[r]=w[e],C[e]=r,r++):C[e]=i}for(w=[],e=0;e<r;e++)w[e]=O[e];if(S*A!==r){switch(r){case 6:S=3,A=2;break;case 8:S=4,A=2;break;case 9:S=3,A=3;break;case 10:S=5,A=2;break;case 12:S=4,A=3;break;case 14:S=7,A=2;break;case 15:S=5,A=5;break;case 16:S=4,A=4;break;case 18:S=3,A=6;break;case 20:S=5,A=4;break;default:S=r,A=1}}}if(su){var P=function(t){return t.replace(/\./g,",")};b=b.map(P),w=w.map(P),k=k.map(P)}return l[0].setTextContent(b,u,c),null!==C&&l[0].setIds(C),l.length>1&&null!==l[1]&&(l[1].setTextContent(w,A,S),l[1].getShaper().reset(A,S)),l.length>2&&null!==l[2]&&l[2].setTextContent(k,u,c),!0}}],[{key:"DecFormat",value:function(t,e,n){var i=t.toFixed(e);if(n){var r=i.indexOf(".");for(r<0&&(r=i.length);r<n;r++)i="0".concat(i)}return i}}]),n}(Or);Object.assign(au.prototype,{opA:null,opB:null,use_add:!0,use_subst:!1,use_mult:!1,use_div:!1,exp_abx:!0,exp_axc:!1,exp_xbc:!1,exp_axbc:!1,exp_caxb:!1,resultLimInf:0,resultLimSup:9999,resultCarry:!1,resultNoDup:!1,resultOrder:"NOSORT",opCond:"INDIF"}),au.Operator=function(){function t(){Yc(this,t)}return Xc(t,[{key:"setProperties",value:function(t){var e=this;return de(t.get(0).attributes,(function(n,r){switch(n){case"decimals":e.numDec=Number(r);break;case"values":e.lst=r.split(" ").map((function(t){return Number(t)})),e.fromList=e.lst.length;break;case"from":e.limInf=Number("x"===r?0:r);break;case"to":e.limSup=Number("x"===r?0:r)}t.children().each((function(t,n){var r=i()(n);if("include"===n.nodeName)e.wZero=kt(r.attr("zero")),e.wOne=kt(r.attr("one")),e.wMinusOne=kt(r.attr("minusOne"))}))})),this}},{key:"getAttributes",value:function(){return zt(this,["limInf","limSup","numDec|0","wZero|false","wOne|false","wMinusOne|false","fromList|0","lst"])}},{key:"setAttributes",value:function(t){return Ht(this,t,["limInf","limSup","numDec","wZero","wOne","wMinusOne","fromList","lst"])}}]),t}(),Object.assign(au.Operator.prototype,{limInf:0,limSup:10,numDec:0,wZero:!1,wOne:!1,wMinusOne:!1,fromList:0,lst:[]}),au.Num=function(){function t(){Yc(this,t),this.vf=0,this.c=0}return Xc(t,[{key:"format",value:function(){return au.DecFormat(this.vf,this.c)}}]),t}(),au.Operation=function(){return Xc((function t(){Yc(this,t),this.numA=new au.Num,this.numB=new au.Num,this.numR=new au.Num,this.op=0}))}();var cu=Or.registerClass("@arith.Arith",au);function uu(t){return uu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uu(t)}function lu(t){return function(t){if(Array.isArray(t))return hu(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return hu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hu(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function fu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function pu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fu(Object(n),!0).forEach((function(e){du(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function du(t,e,n){return(e=bu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vu(){return vu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Su(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},vu.apply(this,arguments)}function yu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mu(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,bu(i.key),i)}}function gu(t,e,n){return e&&mu(t.prototype,e),n&&mu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function bu(t){var e=function(t,e){if("object"!==uu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==uu(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===uu(e)?e:String(e)}function wu(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ku(t,e)}function ku(t,e){return ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ku(t,e)}function Au(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Su(t);if(e){var r=Su(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===uu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Su(t){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Su(t)}var xu=function(t){wu(n,t);var e=Au(n);function n(t){return yu(this,n),e.call(this,t)}return gu(n,[{key:"getMinNumActions",value:function(){return this.document?this.document.numTargets:0}}]),n}(po);Object.assign(xu.prototype,{ev:null,checkButtonText:null,prevScreen:!1,prevScreenText:null,prevScreenStyle:null,prevScreenMaxTime:-1});var Cu=function(t){wu(n,t);var e=Au(n);function n(t,i,r){var o;return yu(this,n),(o=e.call(this,t,i,r)).targets=[],o}return gu(n,[{key:"setDocContent",value:function(t,e){var n=this;t.empty().css(e.style.default.css).css({display:"flex","flex-direction":"column"});var r=i()("<div/>").css({"flex-grow":1,overflow:"auto"}),o=i()("<div/>",{class:"JClicTextDocument"}).css({padding:4}).css(e.style.default.css),s=null,a=[];return e.p.forEach((function(t){var r=i()("<p/>").css({margin:0}),c=!0;if(t.style?(s=e.style[t.style].css,r.css(s)):s=null,t.Alignment){var u=Number(t.Alignment);r.css({"text-align":1===u?"center":2===u?"right":"left"})}t.elements.forEach((function(t){var o;switch(t.objectType){case"text":var u=i()("<span/>").html(t.text).text();(n.spanText?Kt(u):[{text:u,sep:""}]).forEach((function(s){var a,c,u=s.text,l=s.sep,h=pu({},n.act.document.style.default.css);null!=t&&null!==(a=t.attr)&&void 0!==a&&a.style&&(h=pu(pu({},h),e.style[t.attr.style].css)),null!=t&&null!==(c=t.attr)&&void 0!==c&&c.css&&(h=pu(pu({},h),t.attr.css)),(n.spanChars?lu(u):[u]).forEach((function(e){t.attr?((o=i()("<span/>").html(e).css(h)).initialCSS=h,r.append(n.$createSpanElement(o))):n.spanText?(o=i()("<span/>").html(e),r.append(n.$createSpanElement(o))):r.append(e)})),""!==l&&r.append(l)}));break;case"cell":o=i()("<span/>");var l=qs.createCell(o.css({position:"relative"}),t);o.css({display:"inline-block","vertical-align":"middle"}),t.mediaContent&&o.on("click",(function(t){return t.preventDefault(),n.ps.stopMedia(1),l.playMedia(n.ps),!1})),r.append(o);break;case"target":if(o=i()("<span/>"),n.showingPrevScreen){o.text(t.text),r.append(o);break}var h=t,f=null;if("no_info"!==h.infoMode&&h.popupContent){f=i()("<span/>").css({position:"absolute","padding-top":"2pt",display:"none"});var p=qs.createCell(f,h.popupContent);h.popupContent.mediaContent&&f.on("click",(function(t){return t.preventDefault(),n.ps.stopMedia(1),p?p.playMedia(n.ps):h.popupContent.mediaContent&&n.ps.playMedia(h.popupContent.mediaContent),!1})),h.$popup=f,a.push({p:r,span:f,box:p})}o=n.$createTargetElement(h,o),h.num=n.targets.length,h.pos=h.num,n.targets.push(h),o&&(o.css(e.style.default.css),s&&o.css(s),n.targetsMarked?h.attr?(h.attr.style||(h.attr.style="target"),o.css(e.style[h.attr.style].css),h.attr.css&&o.css(h.attr.css)):e.style.target&&o.css(e.style.target.css):h.targetStatus="HIDDEN",null!==f&&"onDemand"===h.infoMode&&o.keydown((function(t){t.key===h.popupKey?(t.preventDefault(),n.showPopup(f,h.popupMaxTime,h.popupDelay)):"Escape"===t.key&&(t.preventDefault(),n.showPopup(null))}))),f&&o?h.isList?r.append(o).append(f):r.append(f).append(o):o&&r.append(o),h.$p=r}c=!1})),c&&r.html(" "),o.append(r)})),t.append(r.append(o)),this.act.checkButtonText&&!this.showingPrevScreen&&(this.$checkButton=i()("<button/>",{class:"StockBtn"}).html(this.act.checkButtonText).css({width:"100%","flex-shrink":0}).on("click",(function(){return n.evaluatePanel()})),t.append(this.$checkButton)),a.forEach((function(t){return t.span.css({"margin-top":t.p.css("font-size")})})),this.act.ev&&this.act.ev.init(this.act.project.settings.locales),t}},{key:"$createTargetElement",value:function(t,e){return e.text(t.text),t.$span=e,e}},{key:"$createSpanElement",value:function(t){return t}},{key:"initActivity",value:function(){this.act.prevScreen?this.preInitActivity():this.startActivity()}},{key:"startActivity",value:function(){vu(Su(n.prototype),"initActivity",this).call(this),this.setAndPlayMsg("initial","start"),this.setDocContent(this.$div,this.act.document),this.playing=!0}},{key:"preInitActivity",value:function(){var t=this;if(this.act.prevScreen){var e=function(){return t.showingPrevScreen=!1,t.$div.unbind("click"),t.prevScreenTimer&&(window.clearTimeout(t.prevScreenTimer),t.prevScreenTimer=null),t.startActivity(),!0};if(this.showingPrevScreen=!0,this.$div.empty(),this.act.prevScreenText){this.act.prevScreenStyle||(this.act.prevScreenStyle=new Xi),this.$div.css(this.act.prevScreenStyle.getCSS()).css("overflow","auto");var n=i()("<div/>",{class:"JClicTextDocument"}).css({padding:4}).css(this.act.prevScreenStyle.getCSS()).append(this.act.prevScreenText);this.$div.append(n)}else this.setDocContent(this.$div,this.act.document);this.enableCounters(!0,!1,!1),this.ps.setCounterValue("time",0),this.ps.setMsg(this.act.messages.previous),this.act.prevScreenMaxTime>0&&(this.ps.setCountDown("time",this.act.prevScreenMaxTime),this.prevScreenTimer=window.setTimeout(e,1e3*this.act.prevScreenMaxTime)),this.$div.on("click",e),this.ps.playMsg()}}},{key:"evaluatePanel",value:function(){return this.finishActivity(!0),!0}},{key:"finishActivity",value:function(t){this.$checkButton&&this.$checkButton.prop("disabled",!0),this.targets.forEach((function(t){t.$comboList&&t.$comboList.attr("disabled",!0)})),this.showPopup(null),vu(Su(n.prototype),"finishActivity",this).call(this,t)}},{key:"processEvent",value:function(t){return this.playing}},{key:"showPopup",value:function(t,e,n){var i=this;this.$currentPopup&&(this.$currentPopup.css({display:"none"}),this.$currentPopup=null,this.currentPopupTimer&&(window.clearTimeout(this.currentPopupTimer),this.currentPopupTimer=0)),this.popupWaitTimer&&(window.clearTimeout(this.popupWaitTimer),this.popupWaitTimer=0),n?this.popupWaitTimer=window.setTimeout((function(){i.showPopup(t,e)}),1e3*n):t&&(t.css({display:""}),t.trigger("click"),this.$currentPopup=t,e&&(this.currentPopupTimer=window.setTimeout((function(){t.css({display:"none"}),i.$currentPopup===t&&(i.$currentPopup=null,i.currentPopupTimer=0)}),1e3*e)))}}]),n}(vo);Object.assign(Cu.prototype,{targets:null,targetsMarked:!0,$checkButton:null,prevScreenTimer:null,$currentPopup:null,currentPopupTimer:0,popupWaitTimer:0,spanText:!1,spanChars:!1}),xu.Panel=Cu;var Ou=xu;function Pu(t){return Pu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pu(t)}function Eu(){return Eu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Nu(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Eu.apply(this,arguments)}function Tu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ju(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Bu(i.key),i)}}function _u(t,e,n){return e&&ju(t.prototype,e),n&&ju(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bu(t){var e=function(t,e){if("object"!==Pu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Pu(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Pu(e)?e:String(e)}function Ru(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Iu(t,e)}function Iu(t,e){return Iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Iu(t,e)}function Du(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Nu(t);if(e){var r=Nu(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Pu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Nu(t){return Nu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nu(t)}var Mu=function(t){Ru(n,t);var e=Du(n);function n(t){return Tu(this,n),e.call(this,t)}return _u(n,[{key:"needsKeyboard",value:function(){return!0}}]),n}(xu);Object.assign(Mu.prototype,{autoJump:!1,forceOkToAdvance:!1});var Vu=function(t){Ru(n,t);var e=Du(n);function n(t,i,r){return Tu(this,n),e.call(this,t,i,r)}return _u(n,[{key:"$createTargetElement",value:function(t,e){var n=this;e.addClass("JClicTextTarget");var r="target".concat("000".concat(this.targets.length-1).slice(-3));return t.isList&&t.options&&t.options.length>0?(e=i()("<select/>",{id:r,name:r}),""!==t.options[0].trim()&&i()("<option selected/>",{value:"",text:""}).appendTo(e),t.options.forEach((function(t){return i()("<option/>",{value:t,text:t}).appendTo(e)})),t.$comboList=e.bind("focus change",(function(e){e.textTarget=t,n.processEvent(e)}))):(t.currentText=t.iniText?t.iniText:_t(t.iniChar,t.numIniChars),t.$span=e.text(t.currentText).attr({contenteditable:"true",id:r,autocomplete:"off",spellcheck:"false"}).bind("focus input blur",(function(e){e.textTarget=t,n.processEvent(e)})).bind("keydown keyup",(function(e){13===e.keyCode&&(e.preventDefault(),"keydown"===e.type&&(e.textTarget=t,e.type="blur",n.processEvent(e)))}))),e}},{key:"evaluatePanel",value:function(){var t=this,e=0,n=this.targets.length;return this.targets.forEach((function(n){var i=t.act.ev.evalText(n.readCurrentText(),n.answers),r=t.act.ev.isOk(i);n.targetStatus=r?"SOLVED":"WITH_ERROR",r&&e++,t.markTarget(n,i),t.ps.reportNewAction(t.act,"WRITE",n.currentText,n.getAnswers(),r,e)})),e===n?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}},{key:"checkTarget",value:function(t,e,n){var i=this.act.ev.evalText(t.currentText,t.answers),r=this.act.ev.isOk(i);if(t.targetStatus=r?"SOLVED":"WITH_ERROR",e)return r;this.markTarget(t,i);var o=this.countSolvedTargets(!1,!1);if(t.currentText.length>0&&this.ps.reportNewAction(this.act,"WRITE",t.currentText,t.getAnswers(),r,o),r&&o===this.targets.length)return this.finishActivity(!0),r;if(t.currentText.length>0&&this.playEvent(r?"actionOk":"actionError"),n&&0!==n){var s=t.num+n;s>=this.targets.length?s=0:s<0&&(s=this.targets.length-1);var a=this.targets[s];a.$span?(a.$span.focus(),ge(a.$span.get(-1),0,0)):a.$comboList&&a.$comboList.focus()}return r}},{key:"countSolvedTargets",value:function(t,e){var n=this;return this.targets.reduce((function(i,r){return t&&(r.readCurrentText(),n.checkTarget(r,!e)),"SOLVED"===r.targetStatus?++i:i}),0)}},{key:"markTarget",value:function(t,e){if(t.$comboList||this.act.ev.isOk(e))t.checkColors();else if(t.$span){for(var n=t.currentText,r=[],o=-1,s=-1,a=0;a<e.length&&a<n.length;a++)e[a]!==o&&(r[++s]="",o=e[a]),r[s]+=n.charAt(a);a<n.length&&(r[s]+=n.substr(a)),t.$span.empty(),o=e[0],r.forEach((function(e){i()("<span/>").text(e).css(t.doc.style[0===o?"target":"targetError"].css).appendTo(t.$span),o^=1}))}t.flagModified=!1}},{key:"activityReady",value:function(){Eu(Nu(n.prototype),"activityReady",this).call(this),i()(".JClicTextTarget").css("white-space","normal"),this.targets.length>0&&this.targets[0].$span&&this.targets[0].$span.focus()}},{key:"finishActivity",value:function(t){return this.targets.forEach((function(t){t.$span?t.$span.removeAttr("contenteditable").blur():t.$comboList&&t.$comboList.attr("disabled","true").blur()})),Eu(Nu(n.prototype),"finishActivity",this).call(this,t)}},{key:"processEvent",value:function(t){if(!Eu(Nu(n.prototype),"processEvent",this).call(this,t))return!1;var e=t.textTarget,i=null,r=0;switch(t.type){case"focus":e&&(e.$span&&e.$span.children().length>0?(i=e.$span,r=Math.min(e.currentText.length,ye(i.get(-1))),i.empty(),i.text(e.currentText),ge(i.get(-1),r,r),e.flagModified=!0):e.$comboList&&e.$comboList.css(e.doc.style.target.css),e.$popup&&("always"===e.infoMode||"onError"===e.infoMode&&"WITH_ERROR"===e.targetStatus)?this.showPopup(e.$popup,e.popupMaxTime,e.popupDelay):this.showPopup(null));break;case"blur":e.flagModified&&!this.$checkButton&&this.checkTarget(e,!1,1);break;case"input":if(e&&e.$span){var o=(i=e.$span).html();if(/(<br>|\n|\r)/.test(o))return o=o.replace(/(<br>|\n|\r)/g,""),i.html(o),e.currentText=i.text(),!this.$checkButton&&this.checkTarget(e,!1,1);if((o=i.text())!==e.currentText){e.flagModified=!0;var s=o.length-e.currentText.length;if(s>0){if(o.indexOf(e.iniChar)>=0){r=ye(i.get(-1));for(var a=0;a<s;a++){var c=o.indexOf(e.iniChar);if(c<0)break;o=o.substr(0,c)+o.substr(c+1),c<r&&r--}i.text(o),ge(i.get(-1),r,r)}o.length>e.maxLenResp&&(r=ye(i.get(-1)),o=o.substr(0,e.maxLenResp),r=Math.min(r,o.length),i.text(o),ge(i.get(-1),r,r))}else""===o&&(o=e.iniChar,i.text(o),ge(i.get(-1),0,0));e.currentText=o}}break;case"change":if(e&&e.$comboList)return e.currentText=e.$comboList.val(),e.flagModified=!0,!this.$checkButton&&this.checkTarget(e,!1,1)}return!0}}]),n}(Cu);Object.assign(Vu.prototype,{locked:!0}),Mu.Panel=Vu;var qu=yo.registerClass("@text.FillInBlanks",Mu);function Lu(t){return Lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(t)}function Fu(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,zu(i.key),i)}}function zu(t){var e=function(t,e){if("object"!==Lu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Lu(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Lu(e)?e:String(e)}var Uu="source-over",$u=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.parent=e,this.ctx=n.get(-1).getContext("2d",{willReadFrequently:!0}),this.dim=new Ve(this.ctx.canvas.width,this.ctx.canvas.height),this.origin=new Me,this.dest=new Me,this.relativePos=new Me}var e,n,i;return e=t,(n=[{key:"moveBy",value:function(t,e){this.moveTo(Me(this.dest.x+t,this.dest.y+e))}},{key:"moveTo",value:function(t,e){if(this.active&&(e||!this.dest.equals(t))){this.bgRect&&(this.bgImg?this.ctx.putImageData(this.bgImg,0,0,this.bgRect.pos.x,this.bgRect.pos.y,this.bgRect.dim.width,this.bgRect.dim.height):this.parent&&this.parent.updateContent()),this.dest.moveTo(t);var n=new Me(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y);this.bgRect=new Ue(n,this.bx?this.bx.dim:new Ve);var i=new Me(t.x-this.relativePos.x,t.y-this.relativePos.y);this.bgRect.add(new Ue(i,this.bx?this.bx.dim:new Ve)),this.bgRect.grow(10,10),null!==this.bx?(this.bx.moveTo(new Me(t.x-this.relativePos.x,t.y-this.relativePos.y)),this.bx.setTemporaryHidden(!1),this.bx.update(this.ctx,null),this.bx.setTemporaryHidden(!0)):(this.drawLine(),this.linePainted=!0)}}},{key:"begin",value:function(t,e){this.active&&this.end(),this.origin.moveTo(t),this.dest.moveTo(t),this.linePainted=!1,this.active=!0,e&&(this.bx=e,this.relativePos.moveTo(t.x-e.pos.x,t.y-e.pos.y),this.bx.setFocused(!0),this.bx.setTemporaryHidden(!0),this.linePainted=!1,this.parent.invalidate().update());try{this.bgImg=this.ctx.getImageData(0,0,this.dim.width,this.dim.height)}catch(t){this.bgImg=null}this.bgRect=null,e&&this.moveTo(t,!0)}},{key:"end",value:function(){this.active&&(this.active=!1,this.linePainted=!1,this.bgRect=null,this.bgImg=null,this.bx&&(this.bx.setFocused(!1),this.bx.moveTo(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y),this.bx.setTemporaryHidden(!1),this.bx=null,this.relativePos.moveTo(0,0)),this.ctx.clearRect(0,0,this.dim.width,this.dim.height),this.parent.invalidate().update())}},{key:"drawLine",value:function(){if(this.compositeOp!==Uu?(this.ctx.strokeStyle=this.xorColor,this.ctx.globalCompositeOperation=this.compositeOp):this.ctx.strokeStyle=this.lineColor,this.ctx.lineWidth=this.lineWidth,this.ctx.beginPath(),this.ctx.moveTo(this.origin.x,this.origin.y),this.ctx.lineTo(this.dest.x,this.dest.y),this.ctx.stroke(),this.arrow){var t=Math.atan2(this.origin.x-this.dest.x,this.dest.x-this.origin.x),e=new Me(this.dest.x-this.arrowLength*Math.cos(t+this.arrowAngle),this.dest.y+this.arrowLength*Math.sin(t+this.arrowAngle));this.ctx.beginPath(),this.ctx.moveTo(this.dest.x,this.dest.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),e.moveTo(this.dest.x-this.arrowLength*Math.cos(t-this.arrowAngle),this.dest.y+this.arrowLength*Math.sin(t-this.arrowAngle)),this.ctx.beginPath(),this.ctx.moveTo(this.dest.x,this.dest.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}this.compositeOp!==Uu&&(this.ctx.globalCompositeOperation=Uu)}}])&&Fu(e.prototype,n),i&&Fu(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Object.assign($u.prototype,{bgImg:null,bgRect:null,origin:null,dest:null,arrow:!1,active:!1,linePainted:!1,arrowLength:10,arrowAngle:Math.PI/6,lineColor:"black",xorColor:"white",compositeOp:"difference",DEFAULT_COMPOSITE_OP:Uu,relativePos:null,bx:null,ctx:null,dim:null,parent:null,lineWidth:1.5});var Hu=$u;function Wu(t){return Wu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wu(t)}function Gu(){return Gu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=el(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Gu.apply(this,arguments)}function Ju(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ku(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Yu(i.key),i)}}function Zu(t,e,n){return e&&Ku(t.prototype,e),n&&Ku(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yu(t){var e=function(t,e){if("object"!==Wu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Wu(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Wu(e)?e:String(e)}function Qu(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xu(t,e)}function Xu(t,e){return Xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xu(t,e)}function tl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=el(t);if(e){var r=el(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Wu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function el(t){return el=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},el(t)}var nl=function(t){Qu(n,t);var e=tl(n);function n(t){return Ju(this,n),e.call(this,t)}return Zu(n,[{key:"hasRandom",value:function(){return!0}},{key:"shuffleAlways",value:function(){return!0}},{key:"helpSolutionAllowed",value:function(){return!0}}]),n}(xu);Object.assign(nl.prototype,{amongParagraphs:!1,bc:null});var il=function(t){Qu(n,t);var e=tl(n);function n(t,i,r){return Ju(this,n),e.call(this,t,i,r)}return Zu(n,[{key:"buildVisualComponents",value:function(){this.act.document.style.target.css.cursor="pointer",Gu(el(n.prototype),"buildVisualComponents",this).call(this)}},{key:"setBounds",value:function(t){this.$canvas&&this.$canvas.remove(),Gu(el(n.prototype),"setBounds",this).call(this,t),this.act.dragCells||(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0,"pointer-events":"none"}),this.$div.append(this.$canvas),this.bc=new Hu(this,this.$canvas),this.bc.compositeOp=this.bc.DEFAULT_COMPOSITE_OP,this.invalidate().update())}},{key:"$createTargetElement",value:function(t,e){var i=this;Gu(el(n.prototype),"$createTargetElement",this).call(this,t,e);var r="target".concat("000".concat(this.targets.length-1).slice(-3));return e.addClass("JClicTextTarget").bind("click",(function(e){e.textTarget=t,e.idLabel=r,i.processEvent(e)})),e}},{key:"swapTargets",value:function(t,e){var n=t.$span,r=e.$span,o=i()("<span/>");o.insertAfter(r),r.detach(),r.insertAfter(n),n.detach(),n.insertAfter(o),o.remove();var s=t.pos,a=t.$p;t.pos=e.pos,t.$p=e.$p,e.pos=s,e.$p=a}},{key:"initActivity",value:function(){Gu(el(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents()}},{key:"startActivity",value:function(){var t=this;if(Gu(el(n.prototype),"startActivity",this).call(this),!this.showingPrevScreen){if("orderWords"!==this.act.type||this.act.amongParagraphs)this.shuffleTargets(this.targets,this.act.shuffles);else{var e=[],i=null,r=[];this.targets.forEach((function(t){null!==i&&i.$p!==t.$p&&(e.push(r),r=[]),r.push(t),i=t})),r.length>0&&e.push(r),e.forEach((function(e){return t.shuffleTargets(e,t.act.shuffles)}))}this.playing=!0}this.setBounds(this)}},{key:"shuffleTargets",value:function(t,e){var n=t.length;if(n>1)for(var i=100,r=0;r<e;r++){var o=Math.floor(Math.random()*n),s=Math.floor(Math.random()*n);o!==s?this.swapTargets(t[o],t[s]):--i&&r++}}},{key:"setCurrentTarget",value:function(t){var e=this.act.document.getFullStyle("target").css;this.currentTarget&&this.currentTarget.$span&&this.currentTarget.$span.css(e),t&&t.$span&&t.$span.css({color:e["background-color"],"background-color":e.color}),this.currentTarget=t}},{key:"countSolvedTargets",value:function(){return this.targets.filter((function(t){return t.num===t.pos})).length}},{key:"evaluatePanel",value:function(){var t=this;this.bc&&this.bc.active&&this.bc.end(),this.setCurrentTarget(null);var e=0;return this.targets.forEach((function(n){var i=n.num===n.pos;n.targetStatus=i?"SOLVED":"WITH_ERROR",i&&e++,n.checkColors(),t.ps.reportNewAction(t.act,"PLACE",n.text,n.pos,i,e)})),e===this.targets.length?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}},{key:"finishActivity",value:function(t){return i()(".JClicTextTarget").css("cursor","pointer"),Gu(el(n.prototype),"finishActivity",this).call(this,t)}},{key:"processEvent",value:function(t){if(!Gu(el(n.prototype),"processEvent",this).call(this,t))return!1;var e=t.textTarget,i=null;if(this.bc&&this.playing&&!this.showingPrevScreen){if("touchend"===t.type)i=this.bc.active?this.bc.dest.clone():new Me;else{var r=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,o=t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;i=new Me(r-this.$div.offset().left,o-this.$div.offset().top)}switch(t.type){case"click":if(e&&e!==this.currentTarget)if(this.currentTarget){if(this.bc&&this.bc.active&&this.bc.end(),this.swapTargets(e,this.currentTarget),this.setCurrentTarget(null),!this.$checkButton){var s=this.countSolvedTargets(),a=e.pos===e.num;this.ps.reportNewAction(this.act,"PLACE",e.text,e.pos,a,s),a&&s===this.targets.length?this.finishActivity(!0):this.playEvent(a?"actionOk":"actionError")}}else this.setCurrentTarget(e),this.bc.begin(i),this.playEvent("click");break;case"mousemove":this.bc.moveTo(i)}return t.preventDefault(),!0}}}]),n}(Cu);Object.assign(il.prototype,{currentTarget:null,bc:null,events:["click","mousemove"]}),nl.Panel=il;var rl=yo.registerClass("@text.Order",nl);function ol(t){return ol="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ol(t)}function sl(){return sl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=dl(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},sl.apply(this,arguments)}function al(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ul(i.key),i)}}function cl(t,e,n){return e&&al(t.prototype,e),n&&al(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ul(t){var e=function(t,e){if("object"!==ol(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ol(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ol(e)?e:String(e)}function ll(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fl(t,e)}function fl(t,e){return fl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fl(t,e)}function pl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=dl(t);if(e){var r=dl(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===ol(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function dl(t){return dl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dl(t)}var vl=function(t){hl(n,t);var e=pl(n);function n(t){return ll(this,n),e.call(this,t)}return cl(n)}(xu),yl=function(t){hl(n,t);var e=pl(n);function n(t,i,r){return ll(this,n),e.call(this,t,i,r)}return cl(n,[{key:"$createTargetElement",value:function(t,e){return null}},{key:"startActivity",value:function(){sl(dl(n.prototype),"startActivity",this).call(this),this.$div.find(".JClicTextDocument").attr("contenteditable","true").attr("spellcheck","false")}},{key:"evaluatePanel",value:function(){var t=this.$div.find(".JClicTextDocument").text().trim(),e=this.act.document.getRawText(),n=this.act.ev.checkText(t,e);return this.ps.reportNewAction(this.act,"WRITE",t,e,n,this.targets.length),n?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}},{key:"finishActivity",value:function(t){return this.$div.find(".JClicTextDocument").attr("contenteditable","false"),sl(dl(n.prototype),"finishActivity",this).call(this,t)}}]),n}(Cu);vl.Panel=yl;var ml=yo.registerClass("@text.Complete",vl);function gl(t){return gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gl(t)}function bl(){return bl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pl(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},bl.apply(this,arguments)}function wl(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Al(i.key),i)}}function kl(t,e,n){return e&&wl(t.prototype,e),n&&wl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Al(t){var e=function(t,e){if("object"!==gl(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==gl(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===gl(e)?e:String(e)}function Sl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cl(t,e)}function Cl(t,e){return Cl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cl(t,e)}function Ol(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Pl(t);if(e){var r=Pl(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===gl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Pl(t){return Pl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pl(t)}var El=function(t){xl(n,t);var e=Ol(n);function n(t){return Sl(this,n),e.call(this,t)}return kl(n)}(xu),Tl=function(t){xl(n,t);var e=Ol(n);function n(t,i,r){var o;return Sl(this,n),(o=e.call(this,t,i,r)).spanText=!0,o.spanChars="identifyChars"===t.type,o.spansChecked=new Set,o}return kl(n,[{key:"$createTargetElement",value:function(t,e){var i=this;bl(Pl(n.prototype),"$createTargetElement",this).call(this,t,e);var r="target".concat("000".concat(this.targets.length-1).slice(-3));return e.bind("click",(function(e){e.textTarget=t,e.idLabel=r,i.processEvent(e)})),e}},{key:"$createSpanElement",value:function(t){var e=this;return t.bind("click",(function(n){n.$spanElement=t,e.processEvent(n)})),t}},{key:"initActivity",value:function(){var t=this;bl(Pl(n.prototype),"initActivity",this).call(this,this),this.$div.find(".JClicTextDocument > p").css("cursor","pointer"),this.$div.find(".JClicTextDocument > span").css("cursor","pointer"),this.spansChecked.forEach((function(e){return e.css(e.initialCSS||t.act.document.style.default.css)})),this.spansChecked.clear(),this.playing=!0}},{key:"countSolvedTargets",value:function(){return this.targets.filter((function(t){return"SOLVED"===t.targetStatus})).length}},{key:"evaluatePanel",value:function(){var t=this,e=0;return this.targets.forEach((function(n){var i="SOLVED"===n.targetStatus;i&&e++,n.checkColors(),t.ps.reportNewAction(t.act,"SELECT",n.text,n.pos,i,e)})),e===this.targets.length&&0===this.spansChecked.size?(this.finishActivity(!0),!0):(this.spansChecked.forEach((function(e){return e.css(t.act.document.style.targetError.css)})),this.playEvent("finishedError"),!1)}},{key:"finishActivity",value:function(t){return this.$div.find(".JClicTextDocument > p").css("cursor","pointer"),bl(Pl(n.prototype),"finishActivity",this).call(this,t)}},{key:"processEvent",value:function(t){if(!bl(Pl(n.prototype),"processEvent",this).call(this,t)||t.timeStamp===this.lastTimeStamp)return!1;t.timeStamp&&(this.lastTimeStamp=t.timeStamp);var e=t.textTarget,i=t.$spanElement;if("click"===t.type){var r,o,s=!1;if(e?("SOLVED"===e.targetStatus?e.targetStatus="HIDDEN":(e.targetStatus="SOLVED",s=!0),r=e.text,o=e.pos,e.checkColors()):(i?(i.checked=!i.checked,i.checked?(this.spansChecked.add(i),i.css(this.act.document.style.target.css)):(this.spansChecked.delete(i),i.css(i.initialCSS||this.act.document.style.default.css)),r=i.text()):r="unknown",o=0),!this.$checkButton){var a=this.countSolvedTargets();this.ps.reportNewAction(this.act,"SELECT",r,o,s,a),s&&0===this.spansChecked.size&&a===this.targets.length?this.finishActivity(!0):this.playEvent(s?"actionOk":"actionError")}t.preventDefault()}return!0}}]),n}(Cu);Object.assign(Tl.prototype,{targetsMarked:!1,lastTimeStamp:0,spansChecked:new Set}),El.Panel=Tl;var jl=yo.registerClass("@text.Identify",El);function _l(t){return _l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_l(t)}function Bl(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Rl(i.key),i)}}function Rl(t){var e=function(t,e){if("object"!==_l(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==_l(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===_l(e)?e:String(e)}function Il(){return Il="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ml(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Il.apply(this,arguments)}function Dl(t,e){return Dl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dl(t,e)}function Nl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Ml(t);if(e){var r=Ml(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===_l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Ml(t){return Ml=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ml(t)}var Vl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dl(t,e)}(o,t);var e,n,i,r=Nl(o);function o(t,e,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(i=r.call(this,t,e,n)).preferredBounds=new Ue,i.cells=[],i}return e=o,n=[{key:"getPreferredSize",value:function(){return this.preferredBounds.dim}},{key:"getMinimumSize",value:function(){var t=this.getPreferredSize();return new Ve(Math.max(be.MIN_CELL_SIZE,t.width),Math.max(be.MIN_CELL_SIZE,t.height))}},{key:"getScaledSize",value:function(t){var e=this.getPreferredSize();return new Ve(Math.round(t*e.width),Math.round(t*e.height))}},{key:"addBox",value:function(t){this.cells.push(t),t.setParent(this),1===this.cells.length?Ue.prototype.setBounds.call(this,t):this.add(t),this.preferredBounds.setBounds(this.getBounds())}},{key:"boxIndex",value:function(t){return null===t?-1:this.cells.indexOf(t)}},{key:"getBox",value:function(t){return t<0||t>=this.cells.length?null:this.cells[t]}},{key:"getBackgroundBox",value:function(){return this.backgroundBox}},{key:"setBackgroundBox",value:function(t){this.backgroundBox=t,null!==t&&(t.setParent(this),t.isBackground=!0),Ue.prototype.add.call(this,t),this.preferredBounds.setBounds(this.getBounds())}},{key:"recalcSize",value:function(){var t=this.backgroundBox?new Ue(this.backgroundBox.pos,this.backgroundBox.dim):null;this.cells.forEach((function(e){t?t.add(e):t=new Ue(e.pos,e.dim)})),t||(t=new Ue(this.pos.x,this.pos.y,0,0)),this.preferredBounds.setRect(t),this.x=t.pos.x,this.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height}},{key:"getNumCells",value:function(){return this.cells.length}},{key:"setCellAttr",value:function(t,e){this.cells.forEach((function(n){return n[t]=e})),this.backgroundBox&&(this.backgroundBox[t]=e)}},{key:"setBorder",value:function(t){this.cells.forEach((function(e){return e.setBorder(t)}))}},{key:"setVisible",value:function(t){this.cells.forEach((function(e){return e.setVisible(t)}))}},{key:"setAlternative",value:function(t){Il(Ml(o.prototype),"setAlternative",this).call(this,t),this.cells.forEach((function(e){return e.setAlternative(t)}))}},{key:"setBounds",value:function(t,e,n,i){var r=this;if("number"==typeof t&&(t=new Ue(t,e,n,i)),t.getSurface()>0&&!t.equals(this)){var s=t.dim.width/this.dim.width,a=t.dim.height/this.dim.height,c=t.pos.x-this.pos.x,u=t.pos.y-this.pos.y;if(this.cells.forEach((function(t){var e=new Me(t.pos.x-r.pos.x,t.pos.y-r.pos.y);t.setBounds(c+r.pos.x+s*e.x,u+r.pos.y+a*e.y,s*t.dim.width,a*t.dim.height),t.pos0=null})),null!==this.backgroundBox){var l=this.backgroundBox,h=new Me(l.pos.x-this.pos.x,l.pos.y-this.pos.y);l.setBounds(c+this.pos.x+s*h.x,u+this.pos.y+a*h.y,s*l.dim.width,a*l.dim.height)}}Il(Ml(o.prototype),"setBounds",this).call(this,t)}},{key:"update",value:function(t,e){return!(this.isEmpty()||!this.isVisible()||this.isTemporaryHidden()||e&&!this.intersects(e)||(null!==this.backgroundBox&&this.backgroundBox.update(t,e),this.cells.forEach((function(n){n.isMarked()||n.update(t,e)})),this.cells.forEach((function(n){n.isMarked()&&n.update(t,e)})),0))}},{key:"findBox",value:function(t){for(var e=null,n=this.cells.length-1;n>=0;n--){var i=this.getBox(n);if(i.isVisible()&&i.contains(t)){e=i;break}}return e}},{key:"countInactiveCells",value:function(){return this.cells.reduce((function(t,e){return e.isInactive()?++t:t}),0)}}],i=[{key:"layoutSingle",value:function(t,e,n){if(!e)return t;var i=e.getPreferredSize(),r=e.getMinimumSize(),o=t;o.width-=2*n,o.height-=2*n,(r.width>o.width||r.height>o.height)&&(o=r);var s=i.width>o.width?o.width/i.width:1;return s*i.height>o.height&&(s=o.height/i.height),i=e.getScaledSize(s),e.setBounds(n,n,i.width,i.height),i.width+=2*n,i.height+=2*n,i}},{key:"layoutDouble",value:function(t,e,n,i,r){var o=!1,s=1,a=1;switch(i){case"AB":case"BA":s=2,a=1,o=!0;break;case"AUB":case"BUA":s=1,a=2,o=!1}var c=e.getBounds(),u=n.getBounds(),l=e.getPreferredSize(),h=n.getPreferredSize(),f=new Ve(o?l.width+h.width:Math.max(l.width,h.width),o?Math.max(l.height,h.height):l.height+h.height),p=e.getMinimumSize(),d=n.getMinimumSize(),v=new Ve(o?p.width+d.width:Math.max(p.width,d.width),o?Math.max(p.height,d.height):p.height+d.height),y=t;y.width-=(1+s)*r,y.height-=(1+a)*r,(v.width>y.width||v.height>y.height)&&y.setDimension(v);var m=f.width>y.width?y.width/f.width:1;m*f.height>y.height&&(m=y.height/f.height),l=e.getScaledSize(m);var g=(h=n.getScaledSize(m)).width>l.width?(h.width-l.width)/2:0,b=l.width>h.width?(l.width-h.width)/2:0,w=h.height>l.height?(h.height-l.height)/2:0,k=l.height>h.height?(l.height-h.height)/2:0;switch(i){case"AB":e.setBounds(r,r+w,l.width,l.height),n.setBounds(2*r+l.width,r+k,h.width,h.height);break;case"BA":n.setBounds(r,r+k,h.width,h.height),e.setBounds(2*r+h.width,r+w,l.width,l.height);break;case"AUB":e.setBounds(r+g,r,l.width,l.height),n.setBounds(r+b,2*r+l.height,h.width,h.height);break;case"BUA":n.setBounds(r+b,r,h.width,h.height),e.setBounds(r+g,2*r+h.height,l.width,l.height);break;default:e.setBounds(Math.round(r+m*c.pos.x),Math.round(r+m*c.pos.y),l.width,l.height),n.setBounds(Math.round(r+m*u.pos.x),Math.round(r+m*u.pos.y),l.width,l.height)}var A=new Ue(e.getBounds());return A.add(n.getBounds()),f.width=A.dim.width+2*r,f.height=A.dim.height+2*r,f}}],n&&Bl(e.prototype,n),i&&Bl(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(js);Object.assign(Vl.prototype,{cells:[],preferredBounds:new Ue,backgroundBox:null});var ql=Vl;function Ll(t){return Ll="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ll(t)}function Fl(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,zl(i.key),i)}}function zl(t){var e=function(t,e){if("object"!==Ll(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ll(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ll(e)?e:String(e)}function Ul(t,e){return Ul=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ul(t,e)}function $l(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Hl(t);if(e){var r=Hl(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Ll(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Hl(t){return Hl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hl(t)}var Wl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ul(t,e)}(s,t);var e,n,r,o=$l(s);function s(t,e,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),o.call(this,t,e,n)}return e=s,(n=[{key:"addActiveBox",value:function(t){return t.idLoc=this.cells.length,t.idOrder=t.idLoc,this.addBox(t)}},{key:"getActiveBox",value:function(t){return this.getBox(t)}},{key:"getBackgroundActiveBox",value:function(){return this.getBackgroundBox()}},{key:"setContent",value:function(t,e,n,i,r){n||(n=0),i||(i=0),r||(r=this.cells.length);for(var o=0;o<r;o++){var s=this.getActiveBox(i+o);s.setContent(t,n+o),s.setAlternative(!1),e&&s.setAltContent(e,n+o)}if(null!==t.backgroundContent&&null!==this.getBackgroundActiveBox()){var a=this.getBackgroundActiveBox();a.setContent(t.backgroundContent),t.style!==a.boxBase&&a.setBoxBase(t.style)}}},{key:"findActiveBox",value:function(t){return this.findBox(t)}},{key:"clearAllBoxes",value:function(){this.cells.forEach((function(t){return t.clear()}))}},{key:"clearAll",value:function(){this.clearAllBoxes(),null!==this.backgroundBox&&this.getBackgroundActiveBox().clear()}},{key:"countCellsAtPlace",value:function(){return this.cells.reduce((function(t,e){return e.isAtPlace()?++t:t}),0)}},{key:"getActiveBoxWithIdLoc",value:function(t){return this.cells.find((function(e){return e.idLoc===t}))||null}},{key:"cellIsAtEquivalentPlace",value:function(t,e){return t.isAtPlace()||t.isEquivalent(this.getActiveBoxWithIdLoc(t.idOrder),e)}},{key:"countCellsAtEquivalentPlace",value:function(t){var e=this;return this.cells.reduce((function(n,i){return e.cellIsAtEquivalentPlace(i,t)?++n:n}),0)}},{key:"countCellsWithIdAss",value:function(t){return this.cells.reduce((function(e,n){return n.idAss===t?++e:e}),0)}},{key:"setDefaultIdAss",value:function(){this.cells.map((function(t){return t.setDefaultIdAss()}))}},{key:"shuffleCells",value:function(t,e){var n=this.cells.length;if(n>=2){for(var i=[],r=[],o=new Me,s=0;s<n;s++){var a=this.getActiveBox(s);i[s]=new Me(a.pos),r[s]=a.idLoc}for(var c=0;c<t;c++){var u=Math.floor(Math.random()*n),l=Math.floor(Math.random()*n);if(u!==l){o.moveTo(i[u]),i[u].moveTo(i[l]),i[l].moveTo(o);var h=r[u];r[u]=r[l],r[l]=h}}for(var f=0;f<n;f++){var p=this.getActiveBox(f),d=i[f].x,v=i[f].y;p.moveTo(new Me(d,v)),e&&this.fitCellsInArea([p]),p.idLoc=r[f]}}}},{key:"fitCellsInArea",value:function(t){var e=this,n=this.pos.x+this.dim.width,i=this.pos.y+this.dim.height;t.forEach((function(t){t.pos0||(t.pos0=new Me(t.pos));var r=Math.min(Math.max(t.pos.x,e.pos.x),n-t.dim.width),o=Math.min(Math.max(t.pos.y,e.pos.y),i-t.dim.height);r===t.pos.x&&o===t.pos.y||t.moveTo(new Me(r,o))}))}},{key:"swapCellPositions",value:function(t,e,n){var i=new Me(e.pos),r=e.pos0,o=e.idLoc;e.moveTo(t.pos0||t.pos),e.pos0=t.pos0,e.idLoc=t.idLoc,t.moveTo(r||i),t.pos0=r,t.idLoc=o,n&&this.fitCellsInArea([t,e])}},{key:"resetIds",value:function(){this.cells.forEach((function(t,e){t&&(t.idOrder=e,t.idAss=e,t.idLoc=e)}))}},{key:"getNextItem",value:function(t,e){var n=-12345;e||(e=n);for(var i=t+1;i<this.cells.length;i++){var r=this.cells[i];if(!r)break;if(e!==n){if(e===r.idAss)break}else if(r.idAss>=0)break}return i}},{key:"buildAccessibleElements",value:function(t,e,n){var r=this;return this.$accessibleDiv=""!==this.accessibleText?i()("<div/>",{"aria-label":this.accessibleText,tabindex:0}):null,t.append(this.$accessibleDiv),this.cells.map((function(t){return t})).sort((function(t,e){return t.idLoc>e.idLoc?1:-1})).forEach((function(i){return i.buildAccessibleElement(t,e,r.$accessibleDiv,n)})),this.$accessibleDiv}}])&&Fl(e.prototype,n),r&&Fl(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(ql);function Gl(t){return Gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gl(t)}function Jl(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Kl(i.key),i)}}function Kl(t){var e=function(t,e){if("object"!==Gl(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Gl(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Gl(e)?e:String(e)}function Zl(t,e){return Zl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zl(t,e)}function Yl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Xl(t);if(e){var r=Xl(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Gl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ql(t)}(this,n)}}function Ql(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xl(t){return Xl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xl(t)}Object.assign(Wl.prototype,{$accessibleDiv:null});var th=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zl(t,e)}(o,t);var e,n,i,r=Yl(o);function o(t,e,n,i,s,a,c,u){var l;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(l=r.call(this,t,e,n)).nCols=u.nCols,l.nRows=u.nRows;for(var h=new Ue(new Me(i,s),new Ve(Math.round(a/l.nCols)*l.nCols,Math.round(c/l.nRows)*l.nRows)),f=0;f<u.nCells;f++){var p=u.getShape(f,h),d=new qs(Ql(l),e,n,f,p.getBounds());u.rectangularShapes||d.setShape(p),l.addActiveBox(d)}if(u.hasRemainder){var v=u.getRemainderShape(h),y=new qs(Ql(l),e,n,0,v.getBounds());y.setShape(v),l.setBackgroundBox(y)}return l}return e=o,i=[{key:"createEmptyGrid",value:function(t,e,n,i,r,s,a){var c=r?new o(t,e,a||r.style,n,i,r.getTotalWidth(),r.getTotalHeight(),s||r.getShaper()):null;return c&&c.setBorder(r.border),c}}],(n=[{key:"getMinimumSize",value:function(){return new Ve(be.MIN_CELL_SIZE*this.nCols,be.MIN_CELL_SIZE*this.nRows)}},{key:"getScaledSize",value:function(t){return new Ve(Zt(t*this.preferredBounds.dim.width,this.nCols),Zt(t*this.preferredBounds.dim.height,this.nRows))}},{key:"getCoord",value:function(t){return new Me(t.idLoc%this.nCols,Math.floor(t.idLoc/this.nCols))}},{key:"getCoordDist",value:function(t,e){var n=this.getCoord(t),i=this.getCoord(e);return new Me(i.x-n.x,i.y-n.y)}}])&&Jl(e.prototype,n),i&&Jl(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(Wl);Object.assign(th.prototype,{nCols:1,nRows:1});var eh=th;function nh(t){return nh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nh(t)}function ih(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rh(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,sh(i.key),i)}}function oh(t,e,n){return e&&rh(t.prototype,e),n&&rh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function sh(t){var e=function(t,e){if("object"!==nh(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==nh(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===nh(e)?e:String(e)}function ah(){return ah="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=hh(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},ah.apply(this,arguments)}function ch(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uh(t,e)}function uh(t,e){return uh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},uh(t,e)}function lh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=hh(t);if(e){var r=hh(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===nh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function hh(t){return hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hh(t)}var fh=function(t){ch(n,t);var e=lh(n);function n(t){return ih(this,n),e.call(this,t)}return oh(n,[{key:"setProperties",value:function(t){ah(hh(n.prototype),"setProperties",this).call(this,t),this.abc.primary.avoidAllIdsNull(this.abc.answers.getNumCells())}},{key:"getMinNumActions",value:function(){return this.invAss?this.abc.answers.getNumCells():this.abc.primary.getNumCells()-this.nonAssignedCells}},{key:"hasRandom",value:function(){return!0}},{key:"needsKeyboard",value:function(){return!0}},{key:"helpSolutionAllowed",value:function(){return!0}}]),n}(po);Object.assign(fh.prototype,{nonAssignedCells:0,useIdAss:!0});var ph=function(t){ch(n,t);var e=lh(n);function n(t,i,r){return ih(this,n),e.call(this,t,i,r)}return oh(n,[{key:"clear",value:function(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}},{key:"buildVisualComponents",value:function(){var t=this;this.firstRun&&ah(hh(n.prototype),"buildVisualComponents",this).call(this),this.clear();var e=this.act.abc.primary,r=this.act.abc.answers,o=this.act.abc.solvedPrimary;if(e&&r){if(this.act.invAss&&(this.invAssCheck=Array(r.getNumCells()).fill(!1)),e.image&&(e.setImgContent(this.act.project.mediaBag,null,!1),!e.animatedGifFile||e.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=i()("<span/>").css({"background-image":"url("+e.animatedGifFile+")","background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),o&&o.image&&o.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){var s=[e,r];o&&s.push(o),this.act.acp.generateContent(e.nch,e.ncw,s,!1)}this.bgA=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,e);var a=r.w;"AUB"!==this.act.boxGridPos&&"BUA"!==this.act.boxGridPos||(a=e.getTotalWidth()),this.bgB=new eh(null,this,r.style,this.act.margin,this.act.margin,a,r.h,new yc(1,1)),this.$form=i()("<form/>",{id:"form1"}),this.$form[0].addEventListener("submit",(function(e){return e.preventDefault(),t.playing&&t.setCurrentCell(t.currentCell),!1})),this.$textField=i()("<input/>",{type:"text",size:200}).css(r.style.getCSS()).css({position:"absolute",top:0,left:0,border:0,padding:0,margin:0,"text-align":"center"}).attr({autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.$div.append(this.$form.append(this.$textField)),this.bgA.setContent(e,o||null),this.bgA.setDefaultIdAss(),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.act.nonAssignedCells=0;for(var c=0;c<this.bgA.getNumCells();c++){var u=this.bgA.getActiveBox(c);-1===u.idAss&&(this.act.nonAssignedCells++,u.switchToAlt(this.ps))}this.bgA.setVisible(!0),this.bgB.setVisible(!1)}}},{key:"initActivity",value:function(){ah(hh(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.act.shuffleA&&this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}},{key:"activityReady",value:function(){ah(hh(n.prototype),"activityReady",this).call(this),this.setCurrentCell(0)}},{key:"updateContent",value:function(t){if(ah(hh(n.prototype),"updateContent",this).call(this,t),this.bgA&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t)}return this}},{key:"setDimension",value:function(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?ql.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}},{key:"setBounds",value:function(t){if(this.$canvas&&this.$canvas.remove(),ah(hh(n.prototype),"setBounds",this).call(this,t),this.bgA||this.bgB){var e=t.clone();if("AUB"===this.act.boxGridPos?e.height-=this.bgB.pos.y+this.act.margin/2:"AB"===this.act.boxGridPos&&(e.width-=this.bgB.pos.x+this.act.margin/2),this.$canvas=i()('<canvas width="'+e.dim.width+'" height="'+e.dim.height+'"/>').css({position:"absolute",top:0,left:0}),this.bgA&&this.$animatedBg){var r=this.bgA.getBounds();this.$animatedBg.css({left:r.pos.x,top:r.pos.y,width:r.dim.width+"px",height:r.dim.height+"px","background-size":r.dim.width+"px "+r.dim.height+"px"}),this.$canvas.insertAfter(this.$animatedBg)}else this.$div.prepend(this.$canvas);this.$textField&&this.$textField.css({top:this.bgB.pos.y,left:this.bgB.pos.x,width:this.bgB.dim.width,height:this.bgB.dim.height,zIndex:9}),this.invalidate().update()}}},{key:"buildAccessibleComponents",value:function(){this.$canvas&&this.accessibleCanvas&&(ah(hh(n.prototype),"buildAccessibleComponents",this).call(this),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"click"))}},{key:"checkInvAss",value:function(){return this.act.invAss&&this.invAssCheck&&this.invAssCheck.every((function(t){return t}))}},{key:"setCurrentCell",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.playing){var n=null,i=!1;if(-1!==this.currentCell){var r=!1;if(n=this.bgA?this.bgA.getActiveBoxWithIdLoc(this.currentCell):null){n.setMarked(!1);var o=n.getDescription(),s=n.idAss,a=s>=0?this.act.abc.answers.getActiveBoxContent(s).text:"",c=this.$textField.val().trim();if(Qt(c,a,!1,this.act.numericContent)){r=!0,n.idAss=-1;var u=a.indexOf("|");u>=0&&this.$textField.val(a.substring(0,u)),this.act.abc.solvedPrimary?(n.switchToAlt(this.ps),i=n.playMedia(this.ps,e)):n.clear(),this.act.invAss&&s>=0&&s<this.invAssCheck.length&&(this.invAssCheck[s]=!0),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem))}var l=this.bgA.countCellsWithIdAss(-1);if(c.length>0&&this.ps.reportNewAction(this.act,"WRITE",o,c,r,l),r&&(this.checkInvAss()||l===this.bgA.getNumCells()))return this.finishActivity(!0),this.$textField.prop("disabled",!0),void this.invalidate().update();!i&&c.length>0&&this.playEvent(r?"actionOk":"actionError")}}if(n=this.bgA?this.act.useOrder?this.bgA.getBox(this.currentItem):this.bgA.getActiveBoxWithIdLoc(t):null,this.bgA&&(!n||-1===n.idAss)){for(var h=0;h<this.bgA.getNumCells()&&-1===(n=this.bgA.getActiveBoxWithIdLoc(h)).idAss;h++);if(n&&-1===n.idAss)return this.finishActivity(!1),this.$textField.prop("disabled",!0),void this.invalidate().update()}n&&this.bgA&&this.bgA.getNumCells()>1&&n.setMarked(!0),n&&(this.currentCell=n.idLoc),this.$textField.val(""),this.$textField.focus(),this.invalidate().update(),n&&n.playMedia(this.ps,e)}}},{key:"processEvent",value:function(t){if(this.playing){var e=[];switch(t.type){case"click":t.preventDefault(),this.ps.stopMedia(1);var n=new Me(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top);if(this.bgB.contains(n)){this.$textField.focus();break}var i=this.bgA?this.bgA.findActiveBox(n):null;i&&!i.isInactive()&&(i.getContent()&&null===i.getContent().mediaContent&&this.playEvent("CLICK"),this.setCurrentCell(i.idLoc,e));break;case"change":t.preventDefault(),this.setCurrentCell(this.currentCell,e)}return e.forEach((function(t){return t()})),!1}}}]),n}(vo);Object.assign(ph.prototype,{$textField:null,invAssCheck:null,bgA:null,bgB:null,currentCell:-1,events:["click","change"]}),fh.Panel=ph;var dh=po.registerClass("@text.WrittenAnswer",fh);function vh(t){return vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vh(t)}function yh(){return yh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xh(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},yh.apply(this,arguments)}function mh(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,bh(i.key),i)}}function gh(t,e,n){return e&&mh(t.prototype,e),n&&mh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function bh(t){var e=function(t,e){if("object"!==vh(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==vh(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===vh(e)?e:String(e)}function wh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kh(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ah(t,e)}function Ah(t,e){return Ah=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ah(t,e)}function Sh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=xh(t);if(e){var r=xh(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===vh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function xh(t){return xh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xh(t)}var Ch=function(t){kh(n,t);var e=Sh(n);function n(t){var i;return wh(this,n),(i=e.call(this,t)).includeInReports=!1,i.reportActions=!1,i}return gh(n)}(po),Oh=function(t){kh(n,t);var e=Sh(n);function n(t,i,r){return wh(this,n),e.call(this,t,i,r)}return gh(n,[{key:"clear",value:function(){this.bg&&(this.bg.end(),this.bg=null)}},{key:"buildVisualComponents",value:function(){this.firstRun&&yh(xh(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.abc.primary;t&&(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),t.animatedGifFile&&!t.shaper.rectangularShapes&&(this.$animatedBg=i()("<span/>").css({"background-image":"url(".concat(t.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.$animatedBg&&this.bg.setCellAttr("tmpTrans",!0),this.bg.setVisible(!0))}},{key:"initActivity",value:function(){yh(xh(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0}},{key:"updateContent",value:function(t){if(yh(xh(n.prototype),"updateContent",this).call(this,t),this.bg&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}},{key:"setDimension",value:function(t){return this.getBounds().equals(t)?t:ql.layoutSingle(t,this.bg,this.act.margin)}},{key:"setBounds",value:function(t){var e=this;if(this.$canvas&&this.$canvas.remove(),yh(xh(n.prototype),"setBounds",this).call(this,t),this.bg){if(this.$canvas=i()('<canvas width="'+t.dim.width+'" height="'+t.dim.height+'"/>').css({position:"absolute",top:0,left:0}),this.$animatedBg){var r=this.bg.getBounds();this.$animatedBg.css({left:r.pos.x,top:r.pos.y,width:"".concat(r.dim.width,"px"),height:"".concat(r.dim.height,"px"),"background-size":"".concat(r.dim.width,"px ").concat(r.dim.height,"px")})}this.$div.append(this.$canvas),this.invalidate().update(),window.setTimeout((function(){return e.bg?e.bg.buildAccessibleElements(e.$canvas,e.$div):null}),0)}}},{key:"buildAccessibleComponents",value:function(){this.$canvas&&this.accessibleCanvas&&this.bg&&(yh(xh(n.prototype),"buildAccessibleComponents",this).call(this),this.bg.buildAccessibleElements(this.$canvas,this.$div))}},{key:"processEvent",value:function(t){if(this.playing){var e=new Me(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),n=[];this.ps.stopMedia(1);var i=this.bg.findActiveBox(e);i&&(i.playMedia(this.ps,n)||this.playEvent("click")),n.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(vo);Object.assign(Oh.prototype,{bg:null,events:["click"]}),Ch.Panel=Oh;var Ph=po.registerClass("@panels.InformationScreen",Ch);function Eh(t){return Eh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eh(t)}function Th(){return Th="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mh(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Th.apply(this,arguments)}function jh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _h(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Rh(i.key),i)}}function Bh(t,e,n){return e&&_h(t.prototype,e),n&&_h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rh(t){var e=function(t,e){if("object"!==Eh(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Eh(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Eh(e)?e:String(e)}function Ih(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dh(t,e)}function Dh(t,e){return Dh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dh(t,e)}function Nh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Mh(t);if(e){var r=Mh(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Eh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Mh(t){return Mh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mh(t)}var Vh=function(t){Ih(n,t);var e=Nh(n);function n(t){return jh(this,n),e.call(this,t)}return Bh(n,[{key:"getMinNumActions",value:function(){return this.cellsToMatch}},{key:"hasRandom",value:function(){return!0}}]),n}(po);Object.assign(Vh.prototype,{nonAssignedCells:0,cellsToMatch:1});var qh=function(t){Ih(n,t);var e=Nh(n);function n(t,i,r){return jh(this,n),e.call(this,t,i,r)}return Bh(n,[{key:"clear",value:function(){this.bg&&(this.bg.end(),this.bg=null)}},{key:"buildVisualComponents",value:function(){this.firstRun&&Th(Mh(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.abc.primary,e=this.act.abc.solvedPrimary;if(t){if(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=i()("<span/>").css({"background-image":"url(".concat(t.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),e&&e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){var r=[t];e&&(r.push(null),r.push(e)),this.act.acp.generateContent(t.nch,t.ncw,r,!1)}this.bg=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t,e||null),this.bg.setAlternative(!1),this.$animatedBg&&this.bg.setCellAttr("tmpTrans",!0),this.bg.setDefaultIdAss(),this.act.nonAssignedCells=0,this.act.cellsToMatch=0;for(var o=this.bg.getNumCells(),s=0;s<o;s++){var a=this.bg.getActiveBox(s),c=a.idAss;1===c?this.act.cellsToMatch++:-1===c&&(this.act.nonAssignedCells++,a.switchToAlt(this.ps))}this.bg.setVisible(!0)}}},{key:"initActivity",value:function(){Th(Mh(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.act.shuffleA&&this.shuffle([this.bg],!0,!0),this.useOrder&&(this.currentItem=this.bg.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}},{key:"updateContent",value:function(t){if(Th(Mh(n.prototype),"updateContent",this).call(this,t),this.bg&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return Th(Mh(n.prototype),"updateContent",this).call(this,t)}},{key:"setDimension",value:function(t){return this.getBounds().equals(t)?t:ql.layoutSingle(t,this.bg,this.act.margin)}},{key:"setBounds",value:function(t){var e=this;if(this.$canvas&&this.$canvas.remove(),Th(Mh(n.prototype),"setBounds",this).call(this,t),this.bg){if(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$animatedBg){var r=this.bg.getBounds();this.$animatedBg.css({left:r.pos.x,top:r.pos.y,width:"".concat(r.dim.width,"px"),height:"".concat(r.dim.height,"px"),"background-size":"".concat(r.dim.width,"px ").concat(r.dim.height,"px")})}this.$div.append(this.$canvas),this.invalidate().update(),window.setTimeout((function(){return e.bg?e.bg.buildAccessibleElements(e.$canvas,e.$div):null}),0)}}},{key:"buildAccessibleComponents",value:function(){this.bg&&this.$canvas&&this.accessibleCanvas&&(Th(Mh(n.prototype),"buildAccessibleComponents",this).call(this),this.bg.buildAccessibleElements(this.$canvas,this.$div))}},{key:"processEvent",value:function(t){if(this.playing){var e=new Me(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),n=!1,i=[];if("click"===t.type){this.ps.stopMedia(1);var r=this.bg?this.bg.findActiveBox(e):null;if(r)if(-1!==r.idAss){var o=!1,s=r.getDescription();n=n||r.playMedia(this.ps,i),1!==r.idAss||this.act.useOrder&&r.idOrder!==this.currentItem||(o=!0,r.idAss=-1,r.switchToAlt(this.ps)?n=n||r.playMedia(this.ps,i):r.clear(),this.act.useOrder&&(this.currentItem=this.bg.getNextItem(this.currentItem,1)));var a=this.bg.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"SELECT",s,null,o,a-this.act.nonAssignedCells),o&&a===this.act.cellsToMatch+this.act.nonAssignedCells?this.finishActivity(!0):n||this.playEvent(o?"actionOk":"actionError"),this.update()}else this.playEvent("actionError")}i.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(vo);Object.assign(qh.prototype,{bg:null,events:["click"]}),Vh.Panel=qh;var Lh=po.registerClass("@panels.Identify",Vh);function Fh(t){return Fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fh(t)}function zh(){return zh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zh(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},zh.apply(this,arguments)}function Uh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $h(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Wh(i.key),i)}}function Hh(t,e,n){return e&&$h(t.prototype,e),n&&$h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wh(t){var e=function(t,e){if("object"!==Fh(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Fh(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Fh(e)?e:String(e)}function Gh(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jh(t,e)}function Jh(t,e){return Jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jh(t,e)}function Kh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Zh(t);if(e){var r=Zh(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Fh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Zh(t){return Zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zh(t)}var Yh=function(t){Gh(n,t);var e=Kh(n);function n(t){return Uh(this,n),e.call(this,t)}return Hh(n,[{key:"mustPauseSequence",value:function(){return!0}},{key:"getMinNumActions",value:function(){return 0}},{key:"hasRandom",value:function(){return!0}}]),n}(po),Qh=function(t){Gh(n,t);var e=Kh(n);function n(t,i,r){return Uh(this,n),e.call(this,t,i,r)}return Hh(n,[{key:"clear",value:function(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}},{key:"buildVisualComponents",value:function(){this.firstRun&&zh(Zh(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.abc.primary,e=this.act.abc.secondary;if(t&&e){t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=i()("<span/>").css({"background-image":"url(".concat(t.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t,e],!1),this.bgA=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,t);var r="AUB"===this.act.boxGridPos||"BUA"===this.act.boxGridPos?t.getTotalWidth():e.w;this.bgB=new eh(null,this,e.style,this.act.margin,this.act.margin,r,e.h,new yc(1,1)),this.bgA.setContent(t),this.bgA.setDefaultIdAss(),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.bgB.getActiveBox(0).setInactive(!1),this.bgA.setVisible(!0),this.bgB.setVisible(!0)}}},{key:"initActivity",value:function(){zh(Zh(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.act.shuffleA&&this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}},{key:"updateContent",value:function(t){if(zh(Zh(n.prototype),"updateContent",this).call(this,t),this.bgA&&this.bgB&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}},{key:"setDimension",value:function(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?ql.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}},{key:"setBounds",value:function(t){if(this.$canvas&&this.$canvas.remove(),zh(Zh(n.prototype),"setBounds",this).call(this,t),this.bgA||this.bgB){if(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$animatedBg){var e=this.bgA.getBounds();this.$animatedBg.css({left:e.pos.x,top:e.pos.y,width:"".concat(e.dim.width,"px"),height:"".concat(e.dim.height,"px"),"background-size":"".concat(e.dim.width,"px ").concat(e.dim.height,"px")})}this.$div.append(this.$canvas),this.invalidate().update()}}},{key:"buildAccessibleComponents",value:function(){this.$canvas&&this.accessibleCanvas&&(zh(Zh(n.prototype),"buildAccessibleComponents",this).call(this),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div),this.bgB&&this.bgB.buildAccessibleElements(this.$canvas,this.$div))}},{key:"processEvent",value:function(t){if(this.playing){var e=new Me(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),n=[];if("click"===t.type){this.ps.stopMedia(1);var i=this.bgA.findActiveBox(e);if(i){var r=this.bgB.getActiveBox(0);if(-1===i.idAss||this.act.useOrder&&i.idOrder!==this.currentItem)r.clear(),r.setInactive(!1);else if(r.setContent(this.act.abc.secondary,i.idAss),r.playMedia(this.ps,n)||i.playMedia(this.ps,n)||this.playEvent("CLICK"),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem)),this.ps.reportNewAction(this.act,"SELECT",i.getDescription(),r.getDescription(),!0,0),0===i.idAss&&1===this.bgA.getNumCells()){var o=this.act.project.activitySequence,s=o.getCurrentAct();s&&o.hasNextAct(!0)&&s.delay>0&&"both"!==o.getNavButtonsFlag()&&"fwd"!==o.getNavButtonsFlag()&&this.finishActivity(!0)}this.update()}}n.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(vo);Object.assign(Qh.prototype,{bgA:null,bgB:null,events:["click"]}),Yh.Panel=Qh;var Xh=po.registerClass("@panels.Explore",Yh);function tf(t){return tf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(t)}function ef(){return ef="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=lf(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},ef.apply(this,arguments)}function nf(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,of(i.key),i)}}function rf(t,e,n){return e&&nf(t.prototype,e),n&&nf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function of(t){var e=function(t,e){if("object"!==tf(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==tf(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===tf(e)?e:String(e)}function sf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function af(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cf(t,e)}function cf(t,e){return cf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cf(t,e)}function uf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=lf(t);if(e){var r=lf(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===tf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function lf(t){return lf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lf(t)}var hf=function(t){af(n,t);var e=uf(n);function n(t){var i;return sf(this,n),(i=e.call(this,t)).menuElements=[],i.includeInReports=!1,i.reportActions=!1,i}return rf(n)}(po),ff=function(t){af(n,t);var e=uf(n);function n(t,i,r){var o;return sf(this,n),o=e.call(this,t,i,r),i.lastProjectSkin=null,o}return rf(n,[{key:"buildVisualComponents",value:function(){var t=this;this.firstRun&&ef(lf(n.prototype),"buildVisualComponents",this).call(this);var e=i()("<div/>").css(function(t,e,n){return(e=of(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({width:"100%","max-height":"100%",position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex","flex-wrap":"wrap","overflow-y":"auto","place-content":"center"},"overflow-y","auto"));this.act.menuElements.forEach((function(r){var o=r.description||r.caption||"JClic",s=i()("<button/>",{class:"StockBtn",title:o,"aria-label":o}).css({"min-width":"80px","max-width":"200px","min-height":"80px",margin:"4px",padding:"4px",display:"flex","flex-direction":"column","justify-content":"center","align-items":"center"}),a=n.icons[r.icon||"@ico00.png"],c=i()("<img/>",{src:a||""}).css({"max-width":"180px","max-height":"100px",margin:"4px"});a||t.act.project.mediaBag.getElement(r.icon,!0).getFullPathPromise().then((function(t){return c.attr("src",t)}));s.append(c),s.append(i()("<span/>").css({"max-width":"180px",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}).html(r.caption)),s[0].addEventListener("click",(function(e){var n=new Dn(r.projectPath?"RUN_CLIC_PACKAGE":"RUN_CLIC_ACTIVITY",r.sequence);r.projectPath&&(n.externalParam=r.projectPath),wt("info","Launching ".concat(r.projectPath||""," ").concat(r.sequence||"")),t.ps.playMedia(n),e.preventDefault()})),e.append(s)})),this.$div.empty().append(e)}},{key:"setDimension",value:function(t){return t}},{key:"initActivity",value:function(){ef(lf(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.setAndPlayMsg("initial","start"),this.playing=!0}}]),n}(vo);ff.icons={"@ico00.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAB1UExURUxpcZVZAGyAAGyAAJVZAJVZAJVZAIhmAJVZAJVZAJVZAIhmAGyAAGyAAGyAAGyAAGyAAJVZAJVZAGyAAJVZANj+AP+ZAMFzAPWSALVsANyEAM57AJ66AOiLALXVAM3xAK1nAI6oAIabAJWwAMTnAKFgAGyAAIlz9xYAAAAVdFJOUwB9oCIiZpkRRKq7M4BVu9VmVd1EzJvdA7gAAAE0SURBVDjLjZPZkoMgEEVFFsHdZBQR3M38/ycOKQ1gJKnpV051nwtNEPyrsjBNom9AqNSapxn8CBRjXY+DmjXkbQSXeq9tWJe7ByhVberXqzCY8yGM6GVK9FQ4SpVUxAwnJ+A+2wkLBLLppYgJRgZIrcJYBKxvdLUdFzE4mHBzFNDUvKoVdFfI7YQ1q7gD7LowXNRwaM4R6AzQEXNRWZrPT2jLA9YaQOIXQHV0WIbFvKZImPNGmLCMCwY0lJQQS6vAzEXFjY7Of5iORXwKySHe8+kWWwVeGQUnmW3QTMgDONUbhQ+ABAZwozkTqH1Ox8za3Jz3drLZDMABquuM9nFaKXZpwfFpp+j0ZiHJ21pifiIkQ++Lix+9nc+Z5/tQwrt2fxEBvN8vooQJLgTDX74xSi6z/wAoQC7hWsslMgAAAABJRU5ErkJggg==","@ico01.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAByUExURUxpcfzZt/rfw/pycvrcv/3UrJqf/QAAAP/hxPvOov9sbPqFhYmN/f7nz3V4+/3ky/+AgPrIl11g/P/Klf+Kiv9XV//q1vtHR/rCim1w//pcXISI//tfX5WY/VNT///Dh/86OvwhISUl/js7+klM+vq6e8H/VfEAAAABdFJOUwBA5thmAAABGElEQVQ4y62T23aCMBBFiU48iQlELoJW7b3//4udBIi0MqsvDU+w95yEGSiK/15YrlVhd1+C8Nk05+ribzcvCJlXklBV3u/8pToLAnMk3kiCh0Hkz4LA/NSC+YcgANTWYP4OqVGmtmAuC2St2Mn4EMbq9TaPvABpDborD+OB0QqG8hbo3HTNAikFCtEZBTcMx+t+ewC2U4IyMAFUTgVd5nukHYlrqYcxSBlw15k/gTlXx/ySPT5NLOkyP7IQq0PoOd/wSZLgmLtD5AMLsS70ZbnZEL+LTQmZv6aEQIkrpTUlwWX+FhNCyNzaOiVkHgXODyHzFr87ye/3g+NxGrTgJ6zNa8nXJ04zf4Ew88ylr8KM/At//sB88w0/sBcK3bRRzgAAAABJRU5ErkJggg==","@ico02.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAtUExURUxpcQAAAP///8zMzJmZmfrdwP/hxPvOov3UrP3JlvzZt/zlzf/p0/zBh/rDjUN28cYAAAABdFJOUwBA5thmAAAAyklEQVQ4y6WT6w6DIAxG/YS2XHTv/7grLshF0C1r+KE5n6fFpMvybQHt6bldbXfQcazNsTD4MdCV+S+AQcBUBYa5M4BfHrcB8oNA08HLg0EeAiwOuGtBzoE0Mje4AO4S7QwhgDhlZrcISiNoqxzFoGbSb5Uyozhs4ckdD4M+OfQtUmeKcUsGnaQEyoSp/6YJIr2LXAPqp4OH4BzJtUXyZy7iBwbl8eSDALUc/Z/Sv1DxHfVm5ao5hjtIme+YbOnJMdlj/vCJoB5HX97wIgms7CtjdwAAAABJRU5ErkJggg==","@ico03.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAwUExURUxpcQAAAPrdwP/hxP7mz/8AAAAAmfvOov3UrAAA//3JlvzZtwCZAP8A//zCifq6e7UN6GsAAAABdFJOUwBA5thmAAABA0lEQVQ4y5WS2RbDIAhEHdyTJv3/vy2osVj1oR6zeYcBDcb8NV6v9fp1NV7mgq8cMs/cDWYHhrmomsM1pcj9pgS7FL3IZ6AI8nazsCiCnPOG3wf0QpArfDnoGATC6mwc9oi/AtMFgAFFLQhDCuZcQ0yAMghB+cuNUgJpSVM1zg7phGUFpv3VFdB5gqxolpwdTqYO5EaPJ57PgWOZWgvt0bl4u+LAbwmzv0Q7JxquJM2FSpwTBRHvRU7Mey/E16f4FwfeSkpUBD26CIQ+PMajODTmaw0Dr7/V1zRVQCNvAvNw6QbFb5iWwvRaWKE4Vh3H/6LxG+ueROfYdXXlb+zavg/++ADYLwfSmmk9oQAAAABJRU5ErkJggg==","@icofolder.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUxpcffvhP///2VlZczMZv//zPf39+/nc8zMzDMzmZmZZrW1tbWttcl3sA0AAAABdFJOUwBA5thmAAAAgklEQVQ4y9WSQQ6AIAwEsVtFwf+/14JGbcHeTHSuO9kFQggfBE8BFwLR+mBwFGYSZvh53zjzZTdkLTXCkS/ViDHBCLe8Gla48qpkGEHl+8pdYJo0yOouPA2GhLLiCCyC28DIcAXZ0IfsVKS3BTGUMDas0E9NfkO/ovmQBv2v0BJ+xAaYuQX2hCJNtwAAAABJRU5ErkJggg=="},hf.Panel=ff;var pf=po.registerClass("@panels.Menu",hf);function df(t){return df="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},df(t)}function vf(){return vf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Sf(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},vf.apply(this,arguments)}function yf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mf(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,bf(i.key),i)}}function gf(t,e,n){return e&&mf(t.prototype,e),n&&mf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function bf(t){var e=function(t,e){if("object"!==df(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==df(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===df(e)?e:String(e)}function wf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kf(t,e)}function kf(t,e){return kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kf(t,e)}function Af(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Sf(t);if(e){var r=Sf(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===df(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Sf(t){return Sf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sf(t)}var xf=function(t){wf(n,t);var e=Af(n);function n(t){return yf(this,n),e.call(this,t)}return gf(n,[{key:"getMinNumActions",value:function(){return this.abc.primary.getNumCells()}},{key:"hasRandom",value:function(){return!0}},{key:"shuffleAlways",value:function(){return!0}},{key:"helpSolutionAllowed",value:function(){return!0}}]),n}(po),Cf=function(t){wf(n,t);var e=Af(n);function n(t,i,r){return yf(this,n),e.call(this,t,i,r)}return gf(n,[{key:"clear",value:function(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}},{key:"buildVisualComponents",value:function(){this.firstRun&&vf(Sf(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.abc.primary;if(t){t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bgA=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgB=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgA.setContent(t),this.bgA.accessibleText=gt("source"),this.bgB.accessibleText=gt("target"),this.bgA.setVisible(!0),this.bgB.setVisible(!0);var e=this.bgA.getBackgroundActiveBox(),i=this.bgB.getBackgroundActiveBox();e&&i&&i.exchangeContent(e)}}},{key:"initActivity",value:function(){vf(Sf(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}},{key:"updateContent",value:function(t){if(vf(Sf(n.prototype),"updateContent",this).call(this),this.bgA&&this.bgB&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}},{key:"setDimension",value:function(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?ql.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}},{key:"setBounds",value:function(t){this.$canvas&&this.$canvas.remove(),vf(Sf(n.prototype),"setBounds",this).call(this,t),(this.bgA||this.bgB)&&(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new Hu(this,this.$canvas),this.invalidate().update())}},{key:"buildAccessibleComponents",value:function(){this.$canvas&&this.accessibleCanvas&&(vf(Sf(n.prototype),"buildAccessibleComponents",this).call(this),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"mousedown"),this.bgB&&(this.bgB.setCellAttr("accessibleAlwaysActive",!0),this.bgB.buildAccessibleElements(this.$canvas,this.$div,"mousedown")))}},{key:"processEvent",value:function(t){if(this.bc&&this.playing){var e,n,i=null,r=[];if("touchend"===t.type)i=this.bc.active?this.bc.dest.clone():new Me;else{var o=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,s=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;i=new Me(o-this.$div.offset().left,s-this.$div.offset().top)}var a=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&i.distanceTo(this.bc.origin)<=3)break;a=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bgA.findActiveBox(this.bc.origin),n=this.bgB.findActiveBox(i),this.bc.end(),e&&n&&n.isInactive()){var c=!1,u="".concat(e.getDescription()," (").concat(e.idOrder,")"),l="(".concat(n.idOrder,")"),h=this.act.abc.primary.getActiveBoxContent(n.idOrder);e.getContent().isEquivalent(h,!0)&&(c=!0,e.exchangeContent(n),e.setVisible(!1),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem)));var f=this.bgA.countInactiveCells();this.ps.reportNewAction(this.act,"PLACE",u,l,c,f),c&&f===this.bgA.getNumCells()?this.finishActivity(!0):this.playEvent(c?"actionOk":"actionError")}this.update(),this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.focus()}else{if(a)break;this.ps.stopMedia(1),!(e=this.bgA.findActiveBox(i))||e.isInactive()||this.act.useOrder&&e.idOrder!==this.currentItem||(this.act.dragCells?this.bc.begin(i,e):this.bc.begin(i),e.playMedia(this.ps,r)||this.playEvent("click"),this.bgB.$accessibleDiv&&this.bgB.$accessibleDiv.focus())}break;case"mousemove":case"touchmove":this.bc.moveTo(i)}r.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(vo);Object.assign(Cf.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),xf.Panel=Cf;var Of=po.registerClass("@puzzles.DoublePuzzle",xf);function Pf(t){return Pf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(t)}function Ef(){return Ef="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Nf(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Ef.apply(this,arguments)}function Tf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jf(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Bf(i.key),i)}}function _f(t,e,n){return e&&jf(t.prototype,e),n&&jf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bf(t){var e=function(t,e){if("object"!==Pf(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Pf(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Pf(e)?e:String(e)}function Rf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&If(t,e)}function If(t,e){return If=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},If(t,e)}function Df(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Nf(t);if(e){var r=Nf(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Pf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Nf(t){return Nf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nf(t)}var Mf=function(t){Rf(n,t);var e=Df(n);function n(t){return Tf(this,n),e.call(this,t)}return _f(n,[{key:"getMinNumActions",value:function(){return this.abc.primary.getNumCells()}},{key:"hasRandom",value:function(){return!0}},{key:"shuffleAlways",value:function(){return!0}},{key:"helpSolutionAllowed",value:function(){return!0}}]),n}(po),Vf=function(t){Rf(n,t);var e=Df(n);function n(t,i,r){return Tf(this,n),e.call(this,t,i,r)}return _f(n,[{key:"clear",value:function(){this.bg&&(this.bg.end(),this.bg=null)}},{key:"buildVisualComponents",value:function(){this.firstRun&&Ef(Nf(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.abc.primary;t&&(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.bg.setVisible(!0))}},{key:"initActivity",value:function(){Ef(Nf(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.shuffle([this.bg],!0,!0),this.useOrder&&(this.currentItem=this.bg.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}},{key:"updateContent",value:function(t){if(Ef(Nf(n.prototype),"updateContent",this).call(this,t),this.bg&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}},{key:"setDimension",value:function(t){return!this.bg||this.getBounds().equals(t)?t:ql.layoutSingle(t,this.bg,this.act.margin)}},{key:"setBounds",value:function(t){this.$canvas&&this.$canvas.remove(),Ef(Nf(n.prototype),"setBounds",this).call(this,t),this.bg&&(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new Hu(this,this.$canvas),this.invalidate().update())}},{key:"buildAccessibleComponents",value:function(){this.$canvas&&this.accessibleCanvas&&this.bg&&(Ef(Nf(n.prototype),"buildAccessibleComponents",this).call(this),this.bg.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}},{key:"processEvent",value:function(t){if(this.bc&&this.playing){var e,n,i=null,r=[];if("touchend"===t.type)i=this.bc.active?this.bc.dest.clone():new Me;else{var o=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,s=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;i=new Me(o-this.$div.offset().left,s-this.$div.offset().top)}var a=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&i.distanceTo(this.bc.origin)<=3)break;a=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bg.findActiveBox(this.bc.origin),this.bc.end(),n=this.bg.findActiveBox(i),e&&n){var c="".concat(e.getDescription()," (").concat(e.idOrder,")"),u="(".concat(n.idLoc,")"),l=e.idOrder===n.idLoc;this.bg.swapCellPositions(e,n,!0);var h=this.bg.countCellsAtEquivalentPlace(!0);this.ps.reportNewAction(this.act,"PLACE",c,u,l,h),l&&h===this.bg.getNumCells()?this.finishActivity(!0):this.playEvent(l?"actionOk":"actionError")}this.update()}else{if(a)break;this.ps.stopMedia(1),(e=this.bg.findActiveBox(i))&&(this.act.dragCells?this.bc.begin(i,e):this.bc.begin(i),e.playMedia(this.ps,r)||this.playEvent("click"))}break;case"mousemove":case"touchmove":this.bc.moveTo(i)}r.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(vo);Object.assign(Vf.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Mf.Panel=Vf;var qf=po.registerClass("@puzzles.ExchangePuzzle",Mf);function Lf(t){return Lf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lf(t)}function Ff(){return Ff="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Kf(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Ff.apply(this,arguments)}function zf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uf(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Hf(i.key),i)}}function $f(t,e,n){return e&&Uf(t.prototype,e),n&&Uf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Hf(t){var e=function(t,e){if("object"!==Lf(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Lf(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Lf(e)?e:String(e)}function Wf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gf(t,e)}function Gf(t,e){return Gf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gf(t,e)}function Jf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Kf(t);if(e){var r=Kf(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Lf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Kf(t){return Kf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kf(t)}var Zf=function(t){Wf(n,t);var e=Jf(n);function n(t){return zf(this,n),e.call(this,t)}return $f(n,[{key:"getMinNumActions",value:function(){return this.abc.primary.getNumCells()}},{key:"hasRandom",value:function(){return!0}},{key:"shuffleAlways",value:function(){return!0}},{key:"helpSolutionAllowed",value:function(){return!0}}]),n}(po),Yf=function(t){Wf(n,t);var e=Jf(n);function n(t,i,r){return zf(this,n),e.call(this,t,i,r)}return $f(n,[{key:"clear",value:function(){this.bg&&(this.bg.end(),this.bg=null),this.parkBg&&(this.parkBg.end(),this.parkBg=null)}},{key:"buildVisualComponents",value:function(){this.firstRun&&Ff(Kf(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.abc.primary;t&&(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.bg.setVisible(!0),this.hiddenBoxIndex=Math.floor(Math.random()*this.bg.getNumCells()),this.hiddenBox=this.bg.getActiveBox(this.hiddenBoxIndex),this.hiddenBox.setVisible(!1),this.parkBg=new eh(null,this,t.style,this.act.margin,this.act.margin,this.hiddenBox.dim.width,this.hiddenBox.dim.height,new yc(1,1)),this.parkBg.setContent(t,null,this.hiddenBoxIndex,0,1),this.parkBg.setBorder(this.bg.hasBorder()),this.parkBg.setVisible(!0))}},{key:"initActivity",value:function(){if(Ff(Kf(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg){this.act.shuffles%2!=1&&this.act.shuffles++;for(var t=0;t<this.act.shuffles;t++){var e=this.bg.getCoord(this.hiddenBox),i=0===Math.floor(2*Math.random())?1:-1;0===Math.floor(2*Math.random())?(e.x+=i,(e.x<0||e.x>=this.bg.nCols)&&(e.x-=2*i)):(e.y+=i,(e.y<0||e.y>=this.bg.nRows)&&(e.y-=2*i));var r=this.bg.getActiveBoxWithIdLoc(e.y*this.bg.nCols+e.x);null!==r&&this.hiddenBox.exchangeLocation(r)}this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0}}},{key:"updateContent",value:function(t){if(Ff(Kf(n.prototype),"updateContent",this).call(this,t),this.bg&&this.parkBg&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t),this.parkBg.update(i,t)}return this}},{key:"setDimension",value:function(t){return this.bg&&this.parkBg&&!this.getBounds().equals(t)?ql.layoutDouble(t,this.bg,this.parkBg,this.act.boxGridPos,this.act.margin):t}},{key:"setBounds",value:function(t){this.$canvas&&this.$canvas.remove(),Ff(Kf(n.prototype),"setBounds",this).call(this,t),this.bg&&this.parkBg&&(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.invalidate().update())}},{key:"buildAccessibleComponents",value:function(){this.$canvas&&this.accessibleCanvas&&this.bg&&(Ff(Kf(n.prototype),"buildAccessibleComponents",this).call(this),this.bg.buildAccessibleElements(this.$canvas,this.$div))}},{key:"processEvent",value:function(t){if(this.playing){var e=new Me(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),n=[];if("click"===t.type){this.ps.stopMedia(1);var i=this.bg.findActiveBox(e);if(i)if(i.isVisible()){var r=this.bg.getCoordDist(i,this.hiddenBox);if(Math.abs(r.x)+Math.abs(r.y)===1){var o=i.playMedia(this.ps,n),s="".concat(i.getDescription()," (").concat(i.idOrder,")"),a="(".concat(this.hiddenBox.idLoc,")");i.exchangeLocation(this.hiddenBox);var c=i.idOrder===i.idLoc,u=this.bg.countCellsAtEquivalentPlace(!0);this.ps.reportNewAction(this.act,"SELECT",s,a,c,u),c&&u===this.bg.getNumCells()?(this.hiddenBox.setVisible(!0),this.parkBg.setVisible(!1),this.finishActivity(!0)):o||this.playEvent("click")}this.update()}else this.playEvent("actionError")}n.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(vo);Object.assign(Yf.prototype,{bg:null,parkBg:null,hiddenBox:null,hiddenBoxIndex:-1,events:["click"]}),Zf.Panel=Yf;var Qf=po.registerClass("@puzzles.HolePuzzle",Zf);function Xf(t){return Xf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xf(t)}function tp(){return tp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=cp(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},tp.apply(this,arguments)}function ep(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function np(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,rp(i.key),i)}}function ip(t,e,n){return e&&np(t.prototype,e),n&&np(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function rp(t){var e=function(t,e){if("object"!==Xf(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Xf(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Xf(e)?e:String(e)}function op(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sp(t,e)}function sp(t,e){return sp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sp(t,e)}function ap(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=cp(t);if(e){var r=cp(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Xf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function cp(t){return cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cp(t)}var up=function(t){op(n,t);var e=ap(n);function n(t){return ep(this,n),e.call(this,t)}return ip(n,[{key:"getMinNumActions",value:function(){return this.abc.primary.getNumCells()}},{key:"hasRandom",value:function(){return!0}},{key:"shuffleAlways",value:function(){return!0}}]),n}(po),lp=function(t){op(n,t);var e=ap(n);function n(t,i,r){return ep(this,n),e.call(this,t,i,r)}return ip(n,[{key:"clear",value:function(){this.bg&&(this.bg.end(),this.bg=null)}},{key:"buildVisualComponents",value:function(){this.firstRun&&tp(cp(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.abc.primary,e=this.act.abc.secondary;if(t){if(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),e&&e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){var i=[t];e&&i.push(e),this.act.acp.generateContent(t.nch,t.ncw,i,!1)}var r=t.ncw,o=t.nch;"AB"===this.act.boxGridPos||"BA"===this.act.boxGridPos?r*=2:o*=2,this.bg=new eh(null,this,t.style,this.act.margin,this.act.margin,t.w*r,t.h*o,new yc(r,o));var s=t.getNumCells();this.bg.setBorder(t.border),this.bg.setContent(t,null,0,0,s),this.bg.setContent(e||t,null,0,s,s);for(var a=0;a<2;a++)for(var c=0;c<s;c++){var u=this.bg.getActiveBox(a*s+c);u.idAss=c,u.setInactive(!0)}this.bg.setVisible(!0)}}},{key:"initActivity",value:function(){tp(cp(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.shuffle([this.bg],!0,!0),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0)}},{key:"updateContent",value:function(t){if(tp(cp(n.prototype),"updateContent",this).call(this,t),this.bg&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}},{key:"setDimension",value:function(t){return!this.bg||this.getBounds().equals(t)?t:ql.layoutSingle(t,this.bg,this.act.margin)}},{key:"setBounds",value:function(t){this.$canvas&&this.$canvas.remove(),tp(cp(n.prototype),"setBounds",this).call(this,t),this.bg&&(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new Hu(this,this.$canvas),this.invalidate().update())}},{key:"buildAccessibleComponents",value:function(){this.$canvas&&this.accessibleCanvas&&this.bg&&(tp(cp(n.prototype),"buildAccessibleComponents",this).call(this),this.bg.setCellAttr("accessibleAlwaysActive",!0),this.bg.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}},{key:"processEvent",value:function(t){if(this.bc&&this.playing){var e,n,i=null,r=[];if("touchend"===t.type)i=this.bc.active?this.bc.dest.clone():new Me;else{var o=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,s=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;i=new Me(o-this.$div.offset().left,s-this.$div.offset().top)}var a=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":case"touchend":if(this.bc.active&&i.distanceTo(this.bc.origin)<=3)break;a=!0;case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bg?this.bg.findActiveBox(this.bc.origin):null,this.bc.end(),n=this.bg?this.bg.findActiveBox(i):null,e&&-1!==e.idAss&&n&&-1!==n.idAss)if(e!==n){var c=!1;e.idAss===n.idAss||e.getContent().isEquivalent(n.getContent(),!0)?(c=!0,e.idAss=-1,e.setInactive(!1),n.idAss=-1,n.setInactive(!1)):(e.setInactive(!0),this.act.dragCells?n.setInactive(!0):(n.setInactive(!1),this.update(),this.act.dragCells?this.bc.begin(i,e):this.bc.begin(i)));var u=n.playMedia(this.ps,r);if(this.bg){var l=this.bg.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"MATCH",e.getDescription(),n.getDescription(),c,l/2),c&&l===this.bg.getNumCells()?this.finishActivity(!0):u||this.playEvent(c?"actionOk":"actionError")}}else this.playEvent("CLICK"),e.setInactive(!0);else null!==e&&e.setInactive(!0);this.invalidate().update()}else{if(a)break;this.ps.stopMedia(1),(e=this.bg?this.bg.findActiveBox(i):null)&&-1!==e.idAss&&(e.playMedia(this.ps,r)||this.playEvent("click"),e.setInactive(!1),this.update(),this.act.dragCells?this.bc.begin(i,e):this.bc.begin(i))}break;case"mousemove":case"touchmove":this.bc.moveTo(i)}r.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(vo);Object.assign(lp.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),up.Panel=lp;var hp=po.registerClass("@memory.MemoryGame",up);function fp(t){return fp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fp(t)}function pp(){return pp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=kp(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},pp.apply(this,arguments)}function dp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vp(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,mp(i.key),i)}}function yp(t,e,n){return e&&vp(t.prototype,e),n&&vp(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function mp(t){var e=function(t,e){if("object"!==fp(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==fp(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===fp(e)?e:String(e)}function gp(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bp(t,e)}function bp(t,e){return bp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bp(t,e)}function wp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=kp(t);if(e){var r=kp(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===fp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function kp(t){return kp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kp(t)}var Ap=function(t){gp(n,t);var e=wp(n);function n(t){return dp(this,n),e.call(this,t)}return yp(n,[{key:"getMinNumActions",value:function(){return this.abc.primary.getNumCells()}},{key:"hasRandom",value:function(){return!0}},{key:"shuffleAlways",value:function(){return!0}},{key:"helpSolutionAllowed",value:function(){return!0}}]),n}(po);Object.assign(Ap.prototype,{useIdAss:!1});var Sp=function(t){gp(n,t);var e=wp(n);function n(t,i,r){return dp(this,n),e.call(this,t,i,r)}return yp(n,[{key:"clear",value:function(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}},{key:"buildVisualComponents",value:function(){this.firstRun&&pp(kp(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.abc.primary,e=this.act.abc.secondary,r=this.act.abc.solvedPrimary;if(t&&e){if(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=i()("<span/>").css({"background-image":"url(".concat(t.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),e.image&&(e.setImgContent(this.act.project.mediaBag,null,!1),!e.animatedGifFile||e.shaper.rectangularShapes||this.act.shuffleB||(this.$animatedBgB=i()("<span/>").css({"background-image":"url(".concat(e.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),r&&r.image&&r.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){var o=[t,e];r&&o.push(r),this.act.acp.generateContent(t.nch,t.ncw,o,!1)}this.bgA=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgB=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,e),this.bgA.setContent(t,r||null),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.bgB.setContent(e),this.$animatedBgB&&this.bgB.setCellAttr("tmpTrans",!0),this.bgA.accessibleText=gt("source"),this.bgB.accessibleText=gt("target"),this.bgA.setVisible(!0),this.bgB.setVisible(!0)}}},{key:"initActivity",value:function(){if(pp(kp(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB){var t=[];this.act.shuffleA&&t.push(this.bgA),this.act.shuffleB&&t.push(this.bgB),t.length>0&&this.shuffle(t,!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0}}},{key:"updateContent",value:function(t){if(pp(kp(n.prototype),"updateContent",this).call(this,t),this.bgA&&this.bgB&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}},{key:"setDimension",value:function(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?ql.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}},{key:"setBounds",value:function(t){if(this.$canvas&&this.$canvas.remove(),pp(kp(n.prototype),"setBounds",this).call(this,t),this.bgA||this.bgB){if(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$animatedBg&&this.bgA){var e=this.bgA.getBounds();this.$animatedBg.css({left:e.pos.x,top:e.pos.y,width:e.dim.width+"px",height:e.dim.height+"px","background-size":"".concat(e.dim.width,"px ").concat(e.dim.height,"px")})}if(this.$animatedBgB&&this.bgB){var r=this.bgB.getBounds();this.$animatedBgB.css({left:r.pos.x,top:r.pos.y,width:r.dim.width+"px",height:r.dim.height+"px","background-size":"".concat(r.dim.width,"px ").concat(r.dim.height,"px")})}this.$div.append(this.$canvas),this.bc=new Hu(this,this.$canvas),this.invalidate().update()}}},{key:"buildAccessibleComponents",value:function(){this.$canvas&&this.accessibleCanvas&&(pp(kp(n.prototype),"buildAccessibleComponents",this).call(this),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"mousedown"),this.bgB&&this.bgB.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}},{key:"processEvent",value:function(t){if(this.bc&&this.playing){var e,n,i=null;if("touchend"===t.type)i=this.bc.active?this.bc.dest.clone():new Me;else{var r=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,o=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;i=new Me(r-this.$div.offset().left,o-this.$div.offset().top)}var s=!1,a=!1,c=!1,u=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&i.distanceTo(this.bc.origin)<=3)break;s=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);var l=this.bc.origin;if(this.bc.end(),(e=this.bgA?this.bgA.findActiveBox(l):null)?n=this.bgB?this.bgB.findActiveBox(i):null:(n=this.bgB?this.bgB.findActiveBox(l):null)&&(e=this.bgA?this.bgA.findActiveBox(i):null,c=!0),e&&n&&-1!==e.idAss&&-1!==n.idAss&&this.act.abc.secondary){var h=!1,f=e.getDescription(),p=n.getDescription(),d=this.act.abc.secondary.getActiveBoxContent(e.idOrder);(e.idOrder===n.idOrder||n.getContent().isEquivalent(d,!0))&&(h=!0,e.idAss=-1,n.idAss=-1,this.act.abc.solvedPrimary?(e.switchToAlt(this.ps),a=a||e.playMedia(this.ps,u)):(a=c?a||e.playMedia(this.ps,u):a||n.playMedia(this.ps,u),e.clear()),n.clear(),this.act.useOrder&&this.bgA&&(this.currentItem=this.bgA.getNextItem(this.currentItem)));var v=this.bgB?this.bgB.countCellsWithIdAss(-1):0;this.ps.reportNewAction(this.act,"MATCH",f,p,h,v),h&&v===this.bgB.getNumCells()?this.finishActivity(!0):a||this.playEvent(h?"actionOk":"actionError")}this.update(),this.bgA&&this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.focus()}else{if(s)break;if(this.ps.stopMedia(1),e=this.bgA?this.bgA.findActiveBox(i):null,n=this.bgB?this.bgB.findActiveBox(i):null,e&&(!this.act.useOrder||e.idOrder===this.currentItem)||!this.act.useOrder&&n&&-1!==n.idAss){this.act.dragCells?this.bc.begin(i,e||n):this.bc.begin(i),(a=a||(e||n).playMedia(this.ps,u))||this.playEvent("click");var y=e?this.bgA:this.bgB;y&&y.$accessibleDiv&&(y=e?this.bgB:this.bgA)&&y.$accessibleDiv&&y.$accessibleDiv.focus()}}break;case"mousemove":case"touchmove":this.bc.moveTo(i)}u.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(vo);Object.assign(Sp.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Ap.Panel=Sp;var xp=po.registerClass("@associations.SimpleAssociation",Ap);function Cp(t){return Cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cp(t)}function Op(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pp(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Tp(i.key),i)}}function Ep(t,e,n){return e&&Pp(t.prototype,e),n&&Pp(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Tp(t){var e=function(t,e){if("object"!==Cp(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Cp(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Cp(e)?e:String(e)}function jp(){return jp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ip(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},jp.apply(this,arguments)}function _p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bp(t,e)}function Bp(t,e){return Bp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Bp(t,e)}function Rp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Ip(t);if(e){var r=Ip(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Cp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Ip(t){return Ip=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ip(t)}var Dp=function(t){_p(n,t);var e=Rp(n);function n(t){var i;return Op(this,n),(i=e.call(this,t)).useIdAss=!0,i}return Ep(n,[{key:"setProperties",value:function(t){jp(Ip(n.prototype),"setProperties",this).call(this,t),this.abc.primary.avoidAllIdsNull(this.abc.secondary.getNumCells())}},{key:"getMinNumActions",value:function(){return this.invAss?this.abc.secondary.getNumCells():this.abc.primary.getNumCells()-this.nonAssignedCells}}]),n}(Ap);Object.assign(Dp.prototype,{nonAssignedCells:0,useIdAss:!1});var Np=function(t){_p(n,t);var e=Rp(n);function n(t,i,r){return Op(this,n),e.call(this,t,i,r)}return Ep(n,[{key:"buildVisualComponents",value:function(){var t=this;jp(Ip(n.prototype),"buildVisualComponents",this).call(this);var e=this.act.abc.primary,i=this.act.abc.secondary;e&&i&&(this.act.invAss&&(this.invAssCheck=Array(i.getNumCells()).fill(!1)),this.bgA.setDefaultIdAss(),this.act.nonAssignedCells=0,this.bgA.cells.forEach((function(e){-1===e.idAss&&(t.act.nonAssignedCells++,e.switchToAlt(t.ps))})))}},{key:"checkInvAss",value:function(){return!(!this.act.invAss||!this.invAssCheck)&&this.invAssCheck.every((function(t){return t}))}},{key:"processEvent",value:function(t){if(this.bc&&this.playing){var e,n,i=null;if("touchend"===t.type)i=this.bc.active?this.bc.dest.clone():new Me;else{var r=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,o=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;i=new Me(r-this.$div.offset().left,o-this.$div.offset().top)}var s=!1,a=!1,c=!1,u=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&i.distanceTo(this.bc.origin)<=3)break;s=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);var l=this.bc.origin;if(this.bc.end(),(e=this.bgA?this.bgA.findActiveBox(l):null)?n=this.bgB?this.bgB.findActiveBox(i):null:(n=this.bgB?this.bgB.findActiveBox(l):null)&&(e=this.bgA?this.bgA.findActiveBox(i):null,c=!0),e&&n&&-1!==e.idAss&&!n.isInactive()&&this.act.abc.secondary){var h=e.getDescription(),f=n.getDescription(),p=this.act.abc.secondary.getActiveBoxContent(e.idAss),d=!1;if((e.idAss===n.idOrder||n.getContent().isEquivalent(p,!0))&&(d=!0,e.idAss=-1,this.act.abc.solvedPrimary?(e.switchToAlt(this.ps),a=a||e.playMedia(this.ps,u)):(a=c?a||e.playMedia(this.ps,u):a||n.playMedia(this.ps,u),e.clear()),this.act.invAss&&(this.invAssCheck[n.idOrder]=!0,n.clear()),this.act.useOrder&&this.bgA&&(this.currentItem=this.bgA.getNextItem(this.currentItem))),this.bgA){var v=this.bgA.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"MATCH",h,f,d,v-this.act.nonAssignedCells),d&&(this.checkInvAss()||v===this.bgA.getNumCells())?this.finishActivity(!0):a||this.playEvent(d?"actionOk":"actionError")}}else if(this.bgB&&(c&&this.bgA&&this.bgA.contains(i)||!c&&this.bgB.contains(i))){var y=e?e.getDescription():n?n.getDescription():"null";this.ps.reportNewAction(this.act,"MATCH",y,"null",!1,this.bgB.countCellsWithIdAss(-1)),this.playEvent("actionError")}this.update(),this.bgA&&this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.focus()}else{if(s)break;this.ps.stopMedia(1),e=this.bgA?this.bgA.findActiveBox(i):null,n=this.bgB?this.bgB.findActiveBox(i):null,(e&&-1!==e.idAss&&(!this.act.useOrder||e.idOrder===this.currentItem)||!this.act.useOrder&&n)&&(this.act.dragCells?this.bc.begin(i,e||n):this.bc.begin(i),(a=a||(e||n).playMedia(this.ps,u))||this.playEvent("click"));var m=e?this.bgA:this.bgB;m&&m.$accessibleDiv&&(m=e?this.bgB:this.bgA)&&m.$accessibleDiv&&m.$accessibleDiv.focus()}break;case"mousemove":case"touchmove":this.bc.moveTo(i)}u.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(Sp);Object.assign(Np.prototype,{invAssCheck:null}),Dp.Panel=Np;var Mp=yo.registerClass("@associations.ComplexAssociation",Dp);function Vp(t){return Vp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vp(t)}function qp(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Lp(i.key),i)}}function Lp(t){var e=function(t,e){if("object"!==Vp(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Vp(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Vp(e)?e:String(e)}function Fp(){return Fp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$p(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Fp.apply(this,arguments)}function zp(t,e){return zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zp(t,e)}function Up(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$p(t);if(e){var r=$p(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Vp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function $p(t){return $p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$p(t)}var Hp={MIN_CELL_SIZE:12,DEFAULT_CELL_SIZE:20,MIN_INTERNAL_MARGIN:2},Wp={NORMAL:0,INVERTED:1,HIDDEN:2,LOCKED:4,MARKED:8,TRANSPARENT:16},Gp=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zp(t,e)}(o,t);var e,n,i,r=Up(o);function o(t,e,n,i,s,a,c,u,l,h){var f;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(f=r.call(this,t,e,n)).pos.x=i,f.pos.y=s,f.nCols=Math.max(1,a),f.nRows=Math.max(1,c),f.cellWidth=Math.max(u,Hp.MIN_CELL_SIZE),f.cellHeight=Math.max(l,Hp.MIN_CELL_SIZE),f.dim.width=u*f.nCols,f.dim.height=l*f.nRows,f.setChars(" "),f.preferredBounds=new Ue(f.pos,f.dim),f.setBorder(h),f.cursorTimer=new Je((function(){return f.blink(0)}),500,!1),f.cursorEnabled=!1,f.useCursor=!1,f.wildTransparent=!1,f.cursor=new Me,f}return e=o,n=[{key:"setChars",value:function(t){this.chars=[],this.answers=[],this.attributes=[];for(var e=0;e<this.nRows;e++){var n=e<t.length?t[e]:"";this.chars[e]=n.split(""),this.answers[e]=[],this.attributes[e]=[];for(var i=0;i<this.nCols;i++)i>=n.length&&(this.chars[e][i]=" "),this.answers[e][i]=this.chars[e][i],this.attributes[e][i]=Wp.NORMAL}}},{key:"randomize",value:function(){for(var t=0;t<this.nRows;t++)for(var e=0;e<this.nCols;e++)this.chars[t][e]===this.wild&&(this.chars[t][e]=this.randomChars.charAt(Math.floor(Math.random()*this.randomChars.length)))}},{key:"setCellAttributes",value:function(t,e){var n=Wp.LOCKED;this.wildTransparent?n|=Wp.TRANSPARENT:n|=Wp.INVERTED|Wp.HIDDEN;for(var i=0;i<this.nRows;i++)for(var r=0;r<this.nCols;r++)t&&this.chars[i][r]===this.wild?this.attributes[i][r]=n:(this.attributes[i][r]=Wp.NORMAL,e&&(this.chars[i][r]=" "))}},{key:"setCellLocked",value:function(t,e,n){t>=0&&t<this.nCols&&e>=0&&e<this.nRows&&(this.attributes[e][t]=n?Wp.LOCKED|(this.wildTransparent?Wp.TRANSPARENT:Wp.INVERTED|Wp.HIDDEN):Wp.NORMAL)}},{key:"getItemFor",value:function(t,e){if(!this.isValidCell(t,e))return null;for(var n=new Me,i=!1,r=!1,o=0;o<t;o++)0!=(this.attributes[e][o]&Wp.LOCKED)?i||(r&&n.x++,i=!0):(r=!0,i=!1);i=!1,r=!1;for(var s=0;s<e;s++)0!=(this.attributes[s][t]&Wp.LOCKED)?i||(r&&n.y++,i=!0):(r=!0,i=!1);return n}},{key:"setCursorEnabled",value:function(t){this.cursorEnabled=t,!0===t?this.startCursorBlink():this.stopCursorBlink()}},{key:"startCursorBlink",value:function(){this.useCursor&&this.cursorEnabled&&this.cursorTimer&&!this.cursorTimer.isRunning()&&(this.blink(1),this.cursorTimer.start())}},{key:"stopCursorBlink",value:function(){this.cursorTimer&&this.cursorTimer.isRunning()&&(this.cursorTimer.stop(),this.blink(-1))}},{key:"moveCursor",value:function(t,e,n){if(this.useCursor){var i=this.findNextCellWithAttr(this.cursor.x,this.cursor.y,n?Wp.LOCKED:Wp.NORMAL,t,e,!1);this.cursor.equals(i)||this.setCursorAt(i.x,i.y,n)}}},{key:"findFreeCell",value:function(t,e,n){var i=null;if(t&&(0!==e||0!==n))for(var r=new Me(t);null===i&&(r.x+=e,r.y+=n,!(r.x<0||r.x>=this.nCols||r.y<0||r.y>=this.nRows));)this.getCellAttribute(r.x,r.y,Wp.LOCKED)||(i=r);return i}},{key:"findNextCellWithAttr",value:function(t,e,n,i,r,o){for(var s=new Me(t+i,e+r);s.x<0?(s.x=this.nCols-1,s.y>0?s.y--:s.y=this.nRows-1):s.x>=this.nCols&&(s.x=0,s.y<this.nRows-1?s.y++:s.y=0),s.y<0?(s.y=this.nRows-1,s.x>0?s.x--:s.x=this.nCols-1):s.y>=this.nRows&&(s.y=0,s.x<this.nCols-1?s.x++:s.x=0),(s.x!==t||s.y!==e)&&this.getCellAttribute(s.x,s.y,n)!==o;)s.x+=i,s.y+=r;return s}},{key:"setCursorAt",value:function(t,e,n){this.stopCursorBlink(),this.isValidCell(t,e)&&(this.cursor.x=t,this.cursor.y=e,this.useCursor=!0,n&&this.getCellAttribute(t,e,Wp.LOCKED)?this.moveCursor(1,0,n):this.cursorEnabled&&this.startCursorBlink())}},{key:"setUseCursor",value:function(t){this.useCursor=t}},{key:"getCursor",value:function(){return this.cursor}},{key:"countCharsLike",value:function(t){for(var e=0,n=0;n<this.nRows;n++)for(var i=0;i<this.nCols;i++)this.chars[n][i]===t&&e++;return e}},{key:"getNumCells",value:function(){return this.nRows*this.nCols}},{key:"countCoincidences",value:function(t){var e=0;if(this.answers)for(var n=0;n<this.nRows;n++)for(var i=0;i<this.nCols;i++)this.isCellOk(i,n,t)&&e++;return e}},{key:"isCellOk",value:function(t,e,n){var i=!1;if(this.isValidCell(t,e)){var r=this.chars[e][t];if(r!==this.wild){var o=this.answers[e][t];(r===o||!n&&r.toUpperCase()===o.toUpperCase())&&(i=!0)}}return i}},{key:"getLogicalCoords",value:function(t){if(!this.contains(t))return null;var e=Math.floor((t.x-this.pos.x)/this.cellWidth),n=Math.floor((t.y-this.pos.y)/this.cellHeight);return this.isValidCell(e,n)?new Me(e,n):null}},{key:"isValidCell",value:function(t,e){return t<this.nCols&&e<this.nRows&&t>=0&&e>=0}},{key:"setCharAt",value:function(t,e,n){this.isValidCell(t,e)&&(this.chars[e][t]=n,this.repaintCell(t,e))}},{key:"getCharAt",value:function(t,e){return this.isValidCell(t,e)?this.chars[e][t]:" "}},{key:"getStringBetween",value:function(t,e,n,i){var r="";if(this.isValidCell(t,e)&&this.isValidCell(n,i)){var o=n-t,s=i-e;if(0===o||0===s||Math.abs(o)===Math.abs(s)){var a=Math.max(Math.abs(o),Math.abs(s));a>0&&(o/=a,s/=a);for(var c=0;c<=a;c++)r+=this.getCharAt(t+o*c,e+s*c)}}return r}},{key:"setAttributeBetween",value:function(t,e,n,i,r,o){if(this.isValidCell(t,e)&&this.isValidCell(n,i)){var s=n-t,a=i-e;if(0===s||0===a||Math.abs(s)===Math.abs(a)){var c=Math.max(Math.abs(s),Math.abs(a));c>0&&(s/=c,a/=c);for(var u=0;u<=c;u++)this.setAttribute(t+s*u,e+a*u,r,o)}}}},{key:"setAttribute",value:function(t,e,n,i){this.isValidCell(t,e)&&(this.attribute!==Wp.MARKED||i||this.repaintCell(t,e),this.attributes[e][t]&=~n,this.attributes[e][t]|=i?n:0,(n!==Wp.MARKED||i)&&this.repaintCell(t,e))}},{key:"setAllCellsAttribute",value:function(t,e){for(var n=0;n<this.nRows;n++)for(var i=0;i<this.nCols;i++)this.setAttribute(i,n,t,e)}},{key:"getCellAttribute",value:function(t,e,n){return!!this.isValidCell(t,e)&&0!=(this.attributes[e][t]&n)}},{key:"getCellRect",value:function(t,e){return new Ue(this.pos.x+t*this.cellWidth,this.pos.y+e*this.cellHeight,this.cellWidth,this.cellHeight)}},{key:"getCellBorderBounds",value:function(t,e){var n=this.getCellAttribute(t,e,Wp.MARKED);if(!this.border&&!n)return this.getCellRect(t,e);var i=this.getBoxBaseResolve(),r=n?i.markerStroke:i.borderStroke;return this.getCellRect(t,e).grow(r.lineWidth,r.lineWidth)}},{key:"repaintCell",value:function(t,e){this.container&&this.container.invalidate(this.getCellBorderBounds(t,e)).update()}},{key:"getPreferredSize",value:function(){return this.preferredBounds.dim}},{key:"getMinimumSize",value:function(){return new Ve(Hp.MIN_CELL_SIZE*this.nCols,Hp.MIN_CELL_SIZE*this.nRows)}},{key:"getScaledSize",value:function(t){return new Ve(Zt(t*this.preferredBounds.dim.width,this.nCols),Zt(t*this.preferredBounds.dim.height,this.nRows))}},{key:"setBounds",value:function(t,e,n,i){Fp($p(o.prototype),"setBounds",this).call(this,t,e,n,i),this.cellWidth=this.dim.width/this.nCols,this.cellHeight=this.dim.height/this.nRows}},{key:"updateContent",value:function(t,e){var n=this.getBoxBaseResolve();t.font=n.font.cssFont(),t.textBaseline="alphabetic",n.prepareText(t,"W",this.cellWidth-2*Hp.MIN_INTERNAL_MARGIN,this.cellHeight-2*Hp.MIN_INTERNAL_MARGIN);for(var i=[],r=(this.cellHeight-n.font.getHeight())/2+n.font.getMetrics().ascent,o=0;o<this.nRows;o++)for(var s=0;s<this.nCols;s++)if(this.getCellBorderBounds(s,o).intersects(e)){var a=this.attributes[o][s];if(0==(a&Wp.TRANSPARENT)){var c=0!=(a&Wp.INVERTED),u=0!=(a&Wp.MARKED),l=this.useCursor&&this.cursor.x===s&&this.cursor.y===o,h=this.getCellRect(s,o);if(t.fillStyle=l&&this.cursorBlink?n.inactiveColor:c?n.textColor:n.backColor,h.fill(t),t.strokeStyle="black",0==(a&Wp.HIDDEN)&&(i[0]=this.chars[o][s],i[0])){var f=h.pos.x+(this.cellWidth-t.measureText(i[0]).width)/2,p=h.pos.y+r;if(n.shadow){var d=Math.max(1,n.font.size/10);t.fillStyle=n.shadowColor,t.fillText(i[0],f+d,p+d)}t.fillStyle=c?n.backColor:this.isAlternative()?n.alternativeColor:n.textColor,t.fillText(i[0],f,p)}(this.border||u)&&(t.strokeStyle=n.borderColor,n[u?"markerStroke":"borderStroke"].setStroke(t),u&&(t.globalCompositeOperation="xor"),h.stroke(t),u&&(t.globalCompositeOperation="source-over")),t.strokeStyle="black",Ne.prototype.setStroke(t)}}return!0}},{key:"blink",value:function(t){this.useCursor&&(this.cursorBlink=1===t||-1!==t&&!this.cursorBlink,this.repaintCell(this.cursor.x,this.cursor.y))}},{key:"end",value:function(){this.cursorTimer&&(this.cursorTimer.stop(),this.cursorTimer=null)}}],i=[{key:"createEmptyGrid",value:function(t,e,n,i,r,s){var a=new o(t,e,r.style,n,i,r.ncw,r.nch,r.w,r.h,r.border);return a.wild=r.wild,a.randomChars=r.randomChars,a.wildTransparent=s,a}}],n&&qp(e.prototype,n),i&&qp(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(js);Object.assign(Gp.prototype,{nRows:1,nCols:1,chars:null,answers:null,attributes:null,cellWidth:20,cellHeight:20,preferredBounds:null,wild:_r.prototype.wild,randomChars:_r.prototype.randomChars,cursorEnabled:!1,useCursor:!1,cursor:null,cursorBlink:!1,cursorTimer:null,wildTransparent:!1}),Gp.defaults=Hp,Gp.flags=Wp;var Jp=Gp;function Kp(t){return Kp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kp(t)}function Zp(){return Zp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rd(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Zp.apply(this,arguments)}function Yp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qp(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,td(i.key),i)}}function Xp(t,e,n){return e&&Qp(t.prototype,e),n&&Qp(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function td(t){var e=function(t,e){if("object"!==Kp(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Kp(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Kp(e)?e:String(e)}function ed(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nd(t,e)}function nd(t,e){return nd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nd(t,e)}function id(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=rd(t);if(e){var r=rd(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Kp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function rd(t){return rd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rd(t)}var od=function(t){ed(n,t);var e=id(n);function n(t){return Yp(this,n),e.call(this,t)}return Xp(n,[{key:"getMinNumActions",value:function(){return this.clues.length}},{key:"helpSolutionAllowed",value:function(){return!0}},{key:"hasRandom",value:function(){return!0}}]),n}(po);Object.assign(od.prototype,{clues:null,clueItems:null,shuffleA:!1,shuffleB:!1});var sd=function(t){ed(n,t);var e=id(n);function n(t,i,r){var o;return Yp(this,n),(o=e.call(this,t,i,r)).resolvedClues=[],o}return Xp(n,[{key:"clear",value:function(){this.grid&&(this.grid.end(),this.grid=null),this.bgAlt&&(this.bgAlt.end(),this.bgAlt=null)}},{key:"buildVisualComponents",value:function(){this.firstRun&&Zp(rd(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.tgc,e=this.act.abc.secondary;e&&(e.image&&(e.setImgContent(this.act.project.mediaBag,null,!1),!e.animatedGifFile||e.shaper.rectangularShapes||this.act.shuffleB||(this.$animatedBg=i()("<span/>").css({"background-image":"url(".concat(e.animatedGifFile,")"),"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),null!==this.act.acp&&this.act.acp.generateContent(0,0,[e],!1)),t&&(this.grid=Jp.createEmptyGrid(null,this,this.act.margin,this.act.margin,t,!1),e&&(this.bgAlt=eh.createEmptyGrid(null,this,this.act.margin,this.act.margin,e),this.$animatedBg&&this.bgAlt.backgroundBox&&(this.bgAlt.backgroundBox.tmpTrans=!0)),this.grid.setVisible(!0))}},{key:"initActivity",value:function(){Zp(rd(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.grid&&(this.grid.setChars(this.act.tgc.text),this.grid.randomize(),this.grid.setAllCellsAttribute(Jp.flags.INVERTED,!1),this.resolvedClues=Array(this.act.clueItems.length).fill(!1),this.bgAlt&&(this.bgAlt.setContent(this.act.abc.secondary),this.$animatedBg&&this.bgAlt.clearAllBoxes(),this.act.shuffleB&&this.shuffle([this.bgAlt],!0,!0),this.bgAlt.setVisible(null!==this.$animatedBg||this.act.invAss)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}},{key:"updateContent",value:function(t){if(Zp(rd(n.prototype),"updateContent",this).call(this,t),this.grid&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.grid.update(i,t),this.bgAlt&&this.bgAlt.update(i,t)}return this}},{key:"setDimension",value:function(t){return!this.grid||this.getBounds().equals(t)?t:this.bgAlt?ql.layoutDouble(t,this.grid,this.bgAlt,this.act.boxGridPos,this.act.margin):ql.layoutSingle(t,this.grid,this.act.margin)}},{key:"setBounds",value:function(t){if(this.$canvas&&this.$canvas.remove(),Zp(rd(n.prototype),"setBounds",this).call(this,t),this.grid){if(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$animatedBg&&this.bgAlt){var e=this.bgAlt.getBounds();this.$animatedBg.css({left:e.pos.x,top:e.pos.y,width:"".concat(e.dim.width,"px"),height:"".concat(e.dim.height,"px"),"background-size":"".concat(e.dim.width,"px ").concat(e.dim.height,"px")})}this.$div.append(this.$canvas),this.bc=new Hu(this,this.$canvas),this.invalidate().update()}}},{key:"getCurrentScore",value:function(){return this.resolvedClues.reduce((function(t,e){return e?++t:t}),0)}},{key:"processEvent",value:function(t){if(this.bc&&this.playing){var e=null;if("touchend"===t.type)e=this.bc.active?this.bc.dest.clone():new Me;else{var n=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;e=new Me(n-this.$div.offset().left,i-this.$div.offset().top)}var r=!1,o=!1,s=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&e.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);var a=this.grid.getLogicalCoords(this.bc.origin),c=this.grid.getLogicalCoords(this.bc.dest);this.bc.end();var u=this.grid.getStringBetween(a.x,a.y,c.x,c.y);if(null!==u&&u.length>0){for(var l=!1,h=0;h<this.act.clues.length;h++)if(u===this.act.clues[h]){l=!0;break}var f=this.resolvedClues[h];if(l&&!f&&(this.resolvedClues[h]=!0,this.grid.setAttributeBetween(a.x,a.y,c.x,c.y,Jp.flags.INVERTED,!0),null!==this.bgAlt)){var p=this.act.clueItems[h];if(p>=0&&p<this.bgAlt.getNumCells()){var d=this.bgAlt.getActiveBox(this.act.clueItems[h]);d&&(d.setVisible(null===this.$animatedBg&&!this.act.invAss),o=d.playMedia(this.ps,s))}}if(f)l||o||this.playEvent("actionError");else{var v=this.getCurrentScore();this.ps.reportNewAction(this.act,"ACTION_SELECT",u,null,l,v),v===this.act.clues.length?this.finishActivity(!0):o||this.playEvent(l?"actionOK":"actionError"),this.invalidate()}}else this.playEvent("actionError");this.update()}else{if(r)break;this.ps.stopMedia(1),this.grid.contains(e)&&(this.playEvent("click"),this.bc.begin(e))}break;case"mousemove":case"touchmove":this.bc.moveTo(e)}s.forEach((function(t){return t()})),t.preventDefault()}}}]),n}(vo);Object.assign(sd.prototype,{grid:null,bgAlt:null,resolvedClues:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),od.Panel=sd;var ad=po.registerClass("@textGrid.WordSearch",od);function cd(t){return cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cd(t)}function ud(){return ud="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=md(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},ud.apply(this,arguments)}function ld(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hd(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,pd(i.key),i)}}function fd(t,e,n){return e&&hd(t.prototype,e),n&&hd(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function pd(t){var e=function(t,e){if("object"!==cd(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==cd(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===cd(e)?e:String(e)}function dd(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vd(t,e)}function vd(t,e){return vd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vd(t,e)}function yd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=md(t);if(e){var r=md(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===cd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function md(t){return md=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},md(t)}var gd=function(t){dd(n,t);var e=yd(n);function n(t){return ld(this,n),e.call(this,t)}return fd(n,[{key:"getMinNumActions",value:function(){return this.tgc.getNumChars()-this.tgc.countWildChars()}},{key:"needsKeyboard",value:function(){return!0}}]),n}(po);Object.assign(gd.prototype,{upperCase:!0,checkCase:!0,wildTransparent:!1});var bd=function(t){dd(n,t);var e=yd(n);function n(t,i,r){return ld(this,n),e.call(this,t,i,r)}return fd(n,[{key:"clear",value:function(){this.grid&&(this.grid.end(),this.grid=null),this.style&&(this.style.end(),this.style=null)}},{key:"createBoxBag",value:function(t){var e=this,n=new ql(null,this,null),r=new js(n,this,this.icoBB);r.setBounds(0,0,this.LABEL_WIDTH,this.act.abc[t].h);var o=i()("<button/>",{class:"StockBtn"}).css({width:this.LABEL_WIDTH,height:this.act.abc[t].h,"background-image":"url(".concat("acrossClues"===t?this.hIcon:this.vIcon,")"),"background-repeat":"no-repeat","background-position":"center","border-radius":6,"z-index":10}).on("click",(function(){e.advance="acrossClues"===t?"ADVANCE_RIGHT"===e.advance?"NO_ADVANCE":"ADVANCE_RIGHT":"ADVANCE_DOWN"===e.advance?"NO_ADVANCE":"ADVANCE_DOWN",e.setBtnStatus()})).on("keypress",(function(t){" "===String.fromCharCode(t.charCode||t.keyCode)&&t.stopPropagation()})).appendTo(this.$div);r.setHostedComponent(o),n.addBox(r);var s=new qs(n,null,null,t,new Ue(this.LABEL_WIDTH+this.act.margin,0,this.act.abc[t].w,this.act.abc[t].h));return n.addBox(s),n.setBoxBase(this.act.abc[t].style),"acrossClues"===t?(this.hClue=s,this.hClueBtn=r):(this.vClue=s,this.vClueBtn=r),n}},{key:"buildVisualComponents",value:function(){this.firstRun&&ud(md(n.prototype),"buildVisualComponents",this).call(this),this.clear();var t=this.act.tgc,e=this.act.abc.acrossClues,i=this.act.abc.downClues;if(e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(0,0,this.act.abc,!1),t){this.grid=Jp.createEmptyGrid(null,this,this.act.margin,this.act.margin,t,this.act.wildTransparent),this.style=new ql(null,this,null);var r=this.createBoxBag("acrossClues"),o=this.createBoxBag("downClues");"AUB"===this.act.boxGridPos||"BUA"===this.act.boxGridPos?o.moveTo(new Me(r.dim.width+this.act.margin,0)):o.moveTo(new Me(0,r.dim.height+this.act.margin)),this.style.addBox(r),this.style.addBox(o),this.grid.setVisible(!0),this.style.setVisible(!0)}}},{key:"initActivity",value:function(){ud(md(n.prototype),"initActivity",this).call(this),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.grid&&(this.grid.setChars(this.act.tgc.text),this.numLetters=this.act.getMinNumActions(),this.grid.setCellAttributes(!0,!0),this.grid.setCursorEnabled(!0),this.setCursorAt(0,0),this.advance="ADVANCE_RIGHT",this.setBtnStatus(),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.$div.attr("tabindex",0),this.$div.focus(),this.playing=!0)}},{key:"getCurrentScore",value:function(){return this.grid?this.grid.countCoincidences(this.act.checkCase):0}},{key:"updateContent",value:function(t){if(ud(md(n.prototype),"updateContent",this).call(this,t),this.grid&&this.$canvas){var e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new Ue(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.grid.update(i,t),this.style.update(i,t)}return this}},{key:"setDimension",value:function(t){return this.grid&&this.style&&!this.getBounds().equals(t)?ql.layoutDouble(t,this.grid,this.style,this.act.boxGridPos,this.act.margin):t}},{key:"setBounds",value:function(t){this.$canvas&&(this.$canvas.remove(),this.$canvas=null),ud(md(n.prototype),"setBounds",this).call(this,t),this.grid&&(this.$canvas=i()('<canvas width="'.concat(t.dim.width,'" height="').concat(t.dim.height,'"/>')).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.invalidate().update())}},{key:"processEvent",value:function(t){if(this.playing)switch(t.type){case"click":var e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,n=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY,i=new Me(e-this.$div.offset().left,n-this.$div.offset().top),r=[];if(this.ps.stopMedia(1),this.grid.contains(i)){var o=this.grid.getLogicalCoords(i);if(null!==o&&(this.setCursorAt(o.x,o.y),be.TOUCH_DEVICE)){var s="ADVANCE_DOWN"===this.advance,a=window.prompt("".concat(s?"Vertical":"Horizontal"," word:"),"");this.writeChars(a)}}else if(this.hClue.contains(i))this.hClue.playMedia(this.ps,r);else{if(!this.vClue.contains(i))break;this.vClue.playMedia(this.ps,r)}this.update(),r.forEach((function(t){return t()}));break;case"keypress":var c=t.charCode||t.keyCode;c&&this.grid.getCursor()&&(t.preventDefault(),this.writeChars(String.fromCharCode(c)));break;case"keydown":var u=0,l=0;switch(t.keyCode){case be.VK.RIGHT:u=1;break;case be.VK.LEFT:u=-1;break;case be.VK.DOWN:l=1;break;case be.VK.UP:l=-1}(u||l)&&(t.preventDefault(),this.moveCursor(u,l),this.update())}}},{key:"moveCursor",value:function(t,e){this.grid&&(this.grid.moveCursor(t,e,!0),this.cursorPosChanged())}},{key:"setCursorAt",value:function(t,e){this.grid.setCursorAt(t,e,!0),this.cursorPosChanged()}},{key:"cursorPosChanged",value:function(){var t=this.grid.getCursor();if(null!==t&&null!==this.style){var e=this.grid.getItemFor(t.x,t.y);null!==e&&(this.hClue.setContent(this.act.abc.acrossClues.getActiveBoxContentWith(t.y,e.x)),this.vClue.setContent(this.act.abc.downClues.getActiveBoxContentWith(t.x,e.y)))}}},{key:"writeChars",value:function(t){if(t&&t.length>0)for(var e=0;e<t.length;e++){var n=this.grid.getCursor(),i=t.charAt(e);this.act.upperCase&&(i=i.toLocaleUpperCase()),this.grid.setCharAt(n.x,n.y,i);var r=this.grid.isCellOk(n.x,n.y,this.act.checkCase),o=this.getCurrentScore();this.ps.reportNewAction(this.act,"WRITE",i,"X:".concat(n.x," Y:").concat(n.y),r,o),o===this.numLetters?(this.grid.setCursorEnabled(!1),this.grid.stopCursorBlink(),this.finishActivity(!0)):(this.playEvent("click"),"ADVANCE_DOWN"===this.advance?this.moveCursor(0,1):"ADVANCE_RIGHT"===this.advance&&this.moveCursor(1,0))}this.update()}},{key:"setBtnStatus",value:function(){this.hClueBtn&&this.hClueBtn.setInactive("ADVANCE_RIGHT"!==this.advance),this.vClueBtn&&this.vClueBtn.setInactive("ADVANCE_DOWN"!==this.advance)}}]),n}(vo);Object.assign(bd.prototype,{LABEL_WIDTH:40,grid:null,style:null,numLetters:0,advance:"NO_ADVANCE",hClue:null,vClue:null,hClueBtn:null,vClueBtn:null,events:["click","keydown","keypress"],hIcon:ue('<svg fill="#FFFFFF" height="36" viewBox="0 0 24 24" width="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />\n</svg>\n'),vIcon:ue('<svg fill="#FFFFFF" height="36" viewBox="0 0 24 24" width="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />\n</svg>\n'),icoSize:{w:36,h:36},icoBB:(new Xi).set("backColor","#4285F4").set("inactiveColor","#70A2F6").set("dontFill",!0)}),gd.Panel=bd;var wd=po.registerClass("@textGrid.CrossWord",gd);function kd(t){return kd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kd(t)}function Ad(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sd(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Cd(i.key),i)}}function xd(t,e,n){return e&&Sd(t.prototype,e),n&&Sd(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Cd(t){var e=function(t,e){if("object"!==kd(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==kd(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===kd(e)?e:String(e)}function Od(){return Od="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Td(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Od.apply(this,arguments)}function Pd(t,e){return Pd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pd(t,e)}function Ed(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Td(t);if(e){var r=Td(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===kd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function Td(t){return Td=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Td(t)}var jd=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pd(t,e)}(n,t);var e=Ed(n);function n(t){var i;return Ad(this,n),(i=e.call(this,t)).tasks=[],i}return xd(n,[{key:"getProperty",value:function(t,e){return null!==this.dbProperties&&this.dbProperties.hasOwnProperty(t)?this.dbProperties[t]:e}},{key:"addTask",value:function(t){this.processingTasks?null===this.waitingTasks?this.waitingTasks=[t]:this.waitingTasks.push(t):this.tasks.push(t)}},{key:"flushTasksPromise",value:function(){var t=this;if(this.processingTasks||null===this.currentSessionId||0===this.tasks.length||null===this.serviceUrl)return this.processingTasks&&(this.forceFlush=!0),Promise.resolve(!0);this.processingTasks=!0;for(var e=new _d("multiple"),n=0;n<this.tasks.length;n++)e.appendData(this.tasks[n].$bean);return wt("debug","Reporting:",e.$bean[0]),new Promise((function(n,i){t.transaction(e.$bean).done((function(e,i,r){t.failCount=0,t.waitingTasks?(t.tasks=t.waitingTasks,t.waitingTasks=null):(t.forceFlush=!1,t.tasks=[]),t.forceFlush&&t.tasks.length>0?(t.forceFlush=!1,t.processingTasks=!1,t.flushTasksPromise().then((function(){n(!0)}))):(t.forceFlush=!1,n(!0),t.processingTasks=!1)})).fail((function(e,n,r){++t.failCount>t.maxFails&&t.stopReporting().then(),i("Error reporting results to ".concat(t.serviceUrl," [").concat(n," ").concat(r,"]")),t.processingTasks=!1}))}))}},{key:"init",value:function(t){var e=this;null==t&&(t=this.ps.options),Od(Td(n.prototype),"init",this).call(this,t),this.initiated=!1,this.stopReporting(),this.serverPath=t.path||this.DEFAULT_SERVER_PATH,this.descriptionDetail=this.serverPath;var r=t.service||this.DEFAULT_SERVER_SERVICE;te(r,"/")||(r="/".concat(r));var o=t.protocol||this.DEFAULT_SERVER_PROTOCOL;this.serviceUrl="".concat(o,"://").concat(this.serverPath).concat(r);var s=new _d("get_properties");return new Promise((function(n,r){e.transaction(s.$bean).done((function(o,s,a){e.dbProperties={},i()(o).find("param").each((function(t,n){var r=i()(n);e.dbProperties[r.attr("name")]=r.attr("value")})),e.promptUserId(!1).then((function(i){e.userId=i;var r=t.lap||e.getProperty("TIME_LAP",e.DEFAULT_TIMER_LAP);e.timerLap=Math.min(30,Math.max(1,parseInt(r))),e.timer=window.setInterval((function(){return e.flushTasksPromise().then()}),1e3*e.timerLap),e.beforeUnloadFunction=function(t){if(null!==e.serviceUrl&&(e.tasks.length>0||e.processingTasks)){e.flushTasksPromise().then();var n=gt("Please wait until the results of your activities are sent to the reports system");return t&&(t.returnValue=n),n}},window.addEventListener("beforeunload",e.beforeUnloadFunction),e.initiated=!0,n(!0)})).catch((function(t){e.stopReporting(),r("Error getting the user ID: ".concat(t))}))})).fail((function(t,n,i){e.stopReporting(),r("Error initializing reports service ".concat(e.serviceUrl," [").concat(n," ").concat(i,"]"))}))}))}},{key:"newSession",value:function(t){Od(Td(n.prototype),"newSession",this).call(this,t),this.serviceUrl&&null!==this.userId&&(this.currentSessionId=null)}},{key:"createDBSession",value:function(t){var e=this;return null===this.currentSessionId||t?new Promise((function(t,n){e.initiated&&null!==e.userId&&null!==e.currentSession?e.flushTasksPromise().then((function(){e.currentSessionId=null;var r=new _d("add session");r.setParam("project",e.currentSession.projectName),r.setParam("activities",Number(e.currentSession.reportableActs)),r.setParam("time",Number(e.currentSession.started)),r.setParam("code",e.currentSession.code),r.setParam("user",e.userId),r.setParam("key",e.sessionKey),r.setParam("context",e.sessionContext),e.transaction(r.$bean).done((function(n,r,o){e.currentSessionId=i()(n).find('param[name="session"]').attr("value"),t(e.currentSessionId)})).fail((function(t,i,r){e.stopReporting(),n("Error creating new reports session in ".concat(e.serviceUrl," [").concat(i," ").concat(r,"]"))}))})):n("Unable to start session in remote server!")})):Promise.resolve(this.currentSessionId)}},{key:"end",value:function(){return this.reportActivity(!0),this.stopReporting().then(Od(Td(n.prototype),"end",this).call(this))}},{key:"transaction",value:function(t){return null===this.serviceUrl?null:i().ajax({method:"POST",url:this.serviceUrl,data:'<?xml version="1.0" encoding="UTF-8"?>'+(new XMLSerializer).serializeToString(t.get(0)).replace("minactions","minActions").replace("reportactions","reportActions"),contentType:"text/xml",dataType:"xml"})}},{key:"getGroups",value:function(){var t=this;return new Promise((function(e,n){if(t.userBased()){var r=new _d("get groups");t.transaction(r.$bean).done((function(t,n,r){var o=[];i()(t).find("group").each((function(t,e){var n=i()(e);o.push({id:n.attr("id"),name:n.attr("name")})})),e(o)})).fail((function(e,i,r){n("Error retrieving groups list from ".concat(t.serviceUrl," [").concat(i," ").concat(r,"]"))}))}else n("This system does not manage users!")}))}},{key:"getUsers",value:function(t){var e=this;return new Promise((function(n,r){if(e.userBased()){var o=new _d("get users");null!=t&&o.setParam("group",t),e.transaction(o.$bean).done((function(t,e,r){var o=[];i()(t).find("user").each((function(t,e){var n=i()(e),r={id:n.attr("id"),name:n.attr("name")};n.attr("pwd")&&(r.pwd=n.attr("pwd")),o.push(r)})),n(o)})).fail((function(t,n,i){r("Error retrieving users list from ".concat(e.serviceUrl," [").concat(n," ").concat(i,"]"))}))}else r("This system does not manage users!")}))}},{key:"getUserData",value:function(t){var e=this;return new Promise((function(n,r){if(e.userBased()){var o=new _d("get user data");null!=t?o.setParam("user",t):r("Invalid user ID"),e.transaction(o.$bean).done((function(t,e,r){var o=i()(t).find("user");if(1!==o.length)window.alert(gt("Invalid user")),n("Invalid user ID");else{var s={id:o.attr("id"),name:o.attr("name")};o.attr("pwd")&&(s.pwd=o.attr("pwd")),n(s)}})).fail((function(t,n,i){r("Error retrieving user data from ".concat(e.serviceUrl," [").concat(n," ").concat(i,"]"))}))}else r("This system does not manage users!")}))}},{key:"stopReporting",value:function(){var t=this,e=null;return this.timer>=0&&(window.clearInterval(this.timer),this.timer=-1),this.beforeUnloadFunction&&(window.removeEventListener("beforeunload",this.beforeUnloadFunction),this.beforeUnloadFunction=null),this.initiated&&(e=this.flushTasksPromise().then((function(){t.serviceUrl=null,t.descriptionDetail="".concat(t.serverPath," (").concat(gt("not connected"),")"),t.initiated=!1}))),e||Promise.resolve(!0)}},{key:"reportActivity",value:function(t){var e=this;if(this.lastActivity){this.lastActivity.closed||this.lastActivity.closeActivity();var n=this.actCount++,i=this.lastActivity;this.createDBSession(!1).then((function(){var r=new _d("add activity");r.setParam("session",e.currentSessionId),r.setParam("num",n),r.appendData(i.$getXML()),e.addTask(r),t&&e.flushTasksPromise().then()}))}null!==this.currentSession&&null!==this.currentSession.currentSequence&&this.currentSession.currentSequence.currentActivity!==this.lastActivity?this.lastActivity=this.currentSession.currentSequence.currentActivity:this.lastActivity=null}},{key:"newActivity",value:function(t){Od(Td(n.prototype),"newActivity",this).call(this,t),this.reportActivity(!1)}},{key:"endActivity",value:function(t,e,i){Od(Td(n.prototype),"endActivity",this).call(this,t,e,i),this.reportActivity(!0)}}]),n}(hs);Object.assign(jd.prototype,{descriptionKey:"Reporting to remote server",descriptionDetail:"(not connected)",serverPath:"",beforeUnloadFunction:null,currentSessionId:"",lastActivity:null,actCount:0,serviceUrl:null,dbProperties:null,tasks:null,waitingTasks:null,processingTasks:!1,forceFlush:!1,timer:-1,timerLap:5,failCount:0,maxFails:5,DEFAULT_SERVER_PATH:"localhost:9000",DEFAULT_SERVER_SERVICE:"/JClicReportService",DEFAULT_SERVER_PROTOCOL:document&&document.location&&"http:"===document.location.protocol?"http":"https",DEFAULT_TIMER_LAP:20});var _d=function(){function t(e,n){Ad(this,t),this.$bean=i()("<bean/>").attr({id:e}),n&&this.appendData(n)}return xd(t,[{key:"appendData",value:function(t){t&&this.$bean.append(t)}},{key:"setParam",value:function(t,e){null!=e&&this.appendData(i()("<param/>").attr({name:t,value:e}))}}]),t}();Object.assign(_d.prototype,{$bean:null}),jd.ReportBean=_d;var Bd=hs.registerClass("TCPReporter",jd);function Rd(t){return Rd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rd(t)}function Id(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Dd(i.key),i)}}function Dd(t){var e=function(t,e){if("object"!==Rd(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Rd(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Rd(e)?e:String(e)}function Nd(){return Nd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=qd(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Nd.apply(this,arguments)}function Md(t,e){return Md=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Md(t,e)}function Vd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=qd(t);if(e){var r=qd(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===Rd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function qd(t){return qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qd(t)}var Ld=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Md(t,e)}(o,t);var e,n,i,r=Vd(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,t)).key="jclic_".concat((new Date).toISOString(),"#").concat(Math.ceil(1e3*Math.random())),e}return e=o,(n=[{key:"init",value:function(t){return null==t&&(t=this.ps.options),"local"===t.storage&&(this.storage=window.localStorage,this.descriptionKey="Reporting to local storage"),hs.prototype.init.call(this,t)}},{key:"saveCurrentReport",value:function(){var t=this;window.setTimeout((function(){t.storage.setItem(t.key,JSON.stringify(t.getData()))}),0)}},{key:"endSequence",value:function(){Nd(qd(o.prototype),"endSequence",this).call(this),this.saveCurrentReport()}},{key:"endActivity",value:function(t,e,n){Nd(qd(o.prototype),"endActivity",this).call(this,t,e,n),this.saveCurrentReport()}}])&&Id(e.prototype,n),i&&Id(e,i),Object.defineProperty(e,"prototype",{writable:!1}),o}(hs);Object.assign(Ld.prototype,{storage:window.sessionStorage,descriptionKey:"Reporting to session storage",descriptionDetail:"(browser session)",key:null});var Fd=hs.registerClass("SessionStorageReporter",Ld);function zd(t){return zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zd(t)}function Ud(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return $d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $d(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function $d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Hd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Wd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hd(Object(n),!0).forEach((function(e){Gd(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Gd(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==zd(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==zd(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===zd(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Jd={Deps:{DefaultSkin:Xs,OrangeSkin:ca,GreenSkin:ma,BlueSkin:Oa,SimpleSkin:Da,MiniSkin:$a,EmptySkin:Xa,CustomSkin:cc,Rectangular:yc,Holes:Cc,JigSaw:Rc,TriangularJigSaw:Fc,ClassicJigSaw:Kc,Arith:cu,TextActivityBase:Ou,FillInBlanks:qu,OrderText:rl,Complete:ml,IdentifyText:jl,WrittenAnswer:dh,InformationScreen:Ph,Identify:Lh,Explore:Xh,Menu:pf,DoublePuzzle:Of,ExchangePuzzle:qf,HolePuzzle:Qf,MemoryGame:hp,SimpleAssociation:xp,ComplexAssociation:Mp,WordSearch:ad,CrossWord:wd,TCPReporter:Bd,SessionStorageReporter:Fd},JClicPlayer:ws,JClicProject:ko,AWT:Ze,Utils:ke,$:i(),options:"undefined"==typeof JClicDataOptions?{}:JClicDataOptions,projectFiles:{},currentPlayers:[],loadProject:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=mt(Wd(Wd({},Jd.options),n),!0,!1);var r,o=null,s=Ud(Jd.currentPlayers);try{for(s.s();!(r=s.n()).done;){var a=r.value;if(a&&a.$topDiv&&a.$topDiv.get(-1)===t){wt("debug","Existing JClicPlayer found in div. I will try to reuse it."),o=a;var c,u=Ud(Object.getOwnPropertyNames(n));try{for(u.s();!(c=u.n()).done;){var l=c.value;if(!o.options.hasOwnProperty(l)||o.options[l]!==n[l]){wt("debug","Existing JClicPlayer has diferent options! Creating a new one from scratch."),o=null;break}}}catch(t){u.e(t)}finally{u.f()}break}}}catch(t){s.e(t)}finally{s.f()}o?o.reset():(wt("debug","Creating a new instance of JClicPlayer"),o=new ws(i()(t).empty(),n));e&&o.initReporter().then((function(){return o.load(e)})).catch((function(e){wt("error","Unable to start reporting: ".concat(e.toString(),".\n JClicPlayer will be removed.'")),i()(t).empty().removeAttr("style").append(i()("<h2/>").html(o.getMsg("ERROR"))).append(i()("<p/>").html(e));var n=Jd.currentPlayers.indexOf(o);n>=0&&Jd.currentPlayers.splice(n,1),o=null}));o&&!1!==n.savePlayersRef&&-1===Jd.currentPlayers.indexOf(o)&&Jd.currentPlayers.push(o);return o}};if("undefined"!=typeof window){window.JClicObject=Jd;var Kd=function(){return Jd.currentPlayers.forEach((function(t){t&&t.skin&&t.skin.fit()}))};i()(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",Kd),i()(window).on("resize",Kd)}i()((function(){var t="undefined"==typeof JClicDataOptions?{}:JClicDataOptions;if(Jd.options=t,!t.noInit){var e="string"==typeof JClicDataProject?JClicDataProject:"string"==typeof Jd.projectFile?Jd.projectFile:null;t.browserHistory=1===i()("body>div.JClic").length||t.browserHistory&&1===i()(".JClic").length,i()(".JClic").each((function(n,r){var o=i()(r),s=o.data("project");s&&(e=s);var a=o.data("options");a&&(t=i().extend(Object.create(t),a)),Jd.loadProject(r,e,t)}))}}))}()}();
|
|
26
|
+
!function(){var t={390:function(t){t.exports=function(){function t(e,i,s){function n(a,o){if(!i[a]){if(!e[a]){if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[a]={exports:{}};e[a][0].call(c.exports,(function(t){return n(e[a][1][t]||t)}),c,c.exports,t,e,i,s)}return i[a].exports}for(var r=void 0,a=0;a<s.length;a++)n(s[a]);return n}return t}()({1:[function(t,e,i){function s(t){const e=t.createGain(),i=e._voltage=a(t),s=o(i),r=o(i),l=o(i);return e._startAmount=o(r),e._endAmount=o(l),e._multiplier=o(s),e._multiplier.connect(e),e._startAmount.connect(e),e._endAmount.connect(e),e.value=s.gain,e.startValue=r.gain,e.endValue=l.gain,e.startValue.value=0,e.endValue.value=0,Object.defineProperties(e,n),e}const n={attack:{value:0,writable:!0},decay:{value:0,writable:!0},sustain:{value:1,writable:!0},release:{value:0,writable:!0},getReleaseDuration:{value:function(){return this.release}},start:{value:function(t){const e=this._multiplier.gain,i=this._startAmount.gain,s=this._endAmount.gain;this._voltage.start(t),this._decayFrom=this._decayFrom=t+this.attack,this._startedAt=t;const n=this.sustain;e.cancelScheduledValues(t),i.cancelScheduledValues(t),s.cancelScheduledValues(t),s.setValueAtTime(0,t),this.attack?(e.setValueAtTime(0,t),e.linearRampToValueAtTime(1,t+this.attack),i.setValueAtTime(1,t),i.linearRampToValueAtTime(0,t+this.attack)):(e.setValueAtTime(1,t),i.setValueAtTime(0,t)),this.decay&&e.setTargetAtTime(n,this._decayFrom,l(this.decay))}},stop:{value:function(t,e){e&&(t-=this.release);const i=t+this.release;if(this.release){const e=this._multiplier.gain,i=this._startAmount.gain,s=this._endAmount.gain;e.cancelScheduledValues(t),i.cancelScheduledValues(t),s.cancelScheduledValues(t);const n=l(this.release);if(this.attack&&t<this._decayFrom){const s=c(0,1,this._startedAt,this._decayFrom,t);e.linearRampToValueAtTime(s,t),i.linearRampToValueAtTime(1-s,t),i.setTargetAtTime(0,t,n)}s.setTargetAtTime(1,t,n),e.setTargetAtTime(0,t,n)}return this._voltage.stop(i),i}},onended:{get:function(){return this._voltage.onended},set:function(t){this._voltage.onended=t}}},r=new Float32Array([1,1]);function a(t){const e=t.createBufferSource(),i=t.createBuffer(1,2,t.sampleRate);return i.getChannelData(0).set(r),e.buffer=i,e.loop=!0,e}function o(t){const e=t.context.createGain();return t.connect(e),e}function l(t){return Math.log(t+1)/Math.log(100)}function c(t,e,i,s,n){let r=t+(n-i)/(s-i)*(e-t);return r<=t&&(r=t),r>=e&&(r=e),r}e.exports=s},{}],2:[function(t,e,i){"use strict";function s(t){return t>64&&t<91?t-65:t>96&&t<123?t-71:t>47&&t<58?t+4:43===t?62:47===t?63:0}function n(t,e){const i=t.replace(/[^A-Za-z0-9\+\/]/g,""),n=i.length,r=e?Math.ceil((3*n+1>>2)/e)*e:3*n+1>>2,a=new Uint8Array(r);for(let t,e,o=0,l=0,c=0;c<n;c++)if(e=3&c,o|=s(i.charCodeAt(c))<<18-6*e,3===e||n-c==1){for(t=0;t<3&&l<r;t++,l++)a[l]=o>>>(16>>>t&24)&255;o=0}return a}e.exports={decode:n}},{}],3:[function(t,e,i){"use strict";e.exports=function(t,e){return new Promise((function(i,s){const n=new XMLHttpRequest;e&&(n.responseType=e),n.open("GET",t),n.onload=function(){200===n.status&&i(n.response),s(Error(n.statusText))},n.onerror=()=>s(Error("Network Error")),n.send()}))}},{}],4:[function(t,e,i){"use strict";const s=t("./base64"),n=t("./fetch");function r(t){return function(e){return"string"==typeof e&&t.test(e)}}function a(t,e){return"string"==typeof t?t+e:"function"==typeof t?t(e):e}function o(t,e,i,s){const n=l(e)?c:h(e)?u:d(e)?p:f(e)?g:m(e)?v:b(e)?y:w(e)?A:x(e)?C:null;return n?n(t,e,i||{}):s?Promise.resolve(s):Promise.reject(`Source not valid (${e})`)}function l(t){return t instanceof ArrayBuffer}function c(t,e,i){return new Promise((function(i,s){t.decodeAudioData(e,(function(t){i(t)}),(function(){s(`Can't decode audio data (${e.slice(0,30)}...)`)}))}))}o.fetch=n;const h=r(/\.(mp3|wav|ogg)(\?.*)?$/i);function u(t,e,i){const s=a(i.from,e);return o(t,o.fetch(s,"arraybuffer"),i)}function d(t){return t&&"function"==typeof t.then}function p(t,e,i){return e.then((function(e){return o(t,e,i)}))}const f=Array.isArray;function g(t,e,i){return Promise.all(e.map((e=>o(t,e,i,e))))}function m(t){return t&&"object"==typeof t}function v(t,e,i){const s={},n=Object.keys(e).map((function(n){if(i.only&&-1===i.only.indexOf(n))return null;const r=e[n];return o(t,r,i,r).then((t=>{s[n]=t}))}));return Promise.all(n).then((()=>s))}const b=r(/\.json(\?.*)?$/i);function y(t,e,i){const s=a(i.from,e);return o(t,o.fetch(s,"text").then(JSON.parse),i)}const w=r(/^data:audio/);function A(t,e,i){const n=e.indexOf(",");return o(t,s.decode(e.slice(n+1)).buffer,i)}const x=r(/\.js(\?.*)?$/i);function C(t,e,i){const s=a(i.from,e);return o(t,o.fetch(s,"text").then(k),i)}function k(t){let e=t.indexOf("MIDI.Soundfont.");if(e<0)throw Error("Invalid MIDI.js Soundfont format");e=t.indexOf("=",e)+2;const i=t.lastIndexOf(",");return JSON.parse(t.slice(e,i)+"}")}e.exports={load:o}},{"./base64":2,"./fetch":3}],5:[function(t,e,i){const s={VERSION:"2.0.4",NOTES:[],CIRCLE_OF_FOURTHS:["C","F","Bb","Eb","Ab","Db","Gb","Cb","Fb","Bbb","Ebb","Abb"],CIRCLE_OF_FIFTHS:["C","G","D","A","E","B","F#","C#","G#","D#","A#","E#"]},n=[["C"],["C#","Db"],["D"],["D#","Eb"],["E"],["F"],["F#","Gb"],["G"],["G#","Ab"],["A"],["A#","Bb"],["B"]];let r=0;for(let t=-1;t<=9;t++)n.forEach((e=>{e.forEach((e=>s.NOTES[r]=e+t)),r++}));e.exports.Constants=s},{}],6:[function(t,e,i){const s=t("./player"),n=t("./soundfont-player/index");e.exports={Player:s.Player,Soundfont:n.Soundfont}},{"./player":8,"./soundfont-player/index":14}],7:[function(t,e,i){"use strict";const s=(t,e)=>Array(e+1).join(t),n=t=>"number"==typeof t,r=t=>"string"==typeof t,a=t=>void 0!==t,o=(t,e)=>Math.pow(2,(t-69)/12)*(e||440),l=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function c(){return l}const h=[0,2,4,5,7,9,11];function u(t,e,i){if("string"!=typeof t)return null;const s=l.exec(t);if(!s||!e&&s[4])return null;const n={letter:s[1].toUpperCase(),acc:s[2].replace(/x/g,"##")};n.pc=n.letter+n.acc,n.step=(n.letter.charCodeAt(0)+3)%7,n.alt="b"===n.acc[0]?-n.acc.length:n.acc.length;const r=h[n.step]+n.alt;return n.chroma=r<0?12+r:r%12,s[3]&&(n.oct=+s[3],n.midi=r+12*(n.oct+1),n.freq=o(n.midi,i)),e&&(n.tonicOf=s[4]),n}const d="CDEFGAB",p=t=>n(t)?t<0?s("b",-t):s("#",t):"",f=t=>n(t)?""+t:"";function g(t,e,i){return null==t?null:t.step?g(t.step,t.alt,t.oct):t<0||t>6?null:d.charAt(t)+p(e)+f(i)}function m(t){if((n(t)||r(t))&&t>=0&&t<128)return+t;const e=u(t);return e&&a(e.midi)?e.midi:null}function v(t,e){const i=m(t);return null===i?null:o(i,e)}const b=t=>(u(t)||{}).letter,y=t=>(u(t)||{}).acc,w=t=>(u(t)||{}).pc,A=t=>(u(t)||{}).step,x=t=>(u(t)||{}).alt,C=t=>(u(t)||{}).chroma,k=t=>(u(t)||{}).oct;e.exports={regex:c,parse:u,build:g,midi:m,freq:v,letter:b,acc:y,pc:w,step:A,alt:x,chroma:C,oct:k}},{}],8:[function(t,e,i){const s=t("./utils").Utils,n=t("./track").Track;Uint8Array.prototype.forEach||Object.defineProperty(Uint8Array.prototype,"forEach",{value:Array.prototype.forEach});class r{constructor(t,e){this.sampleRate=5,this.startTime=0,this.buffer=e||null,this.division,this.format,this.setIntervalId=!1,this.tracks=[],this.instruments=[],this.defaultTempo=120,this.tempo=null,this.startTick=0,this.tick=0,this.lastTick=null,this.inLoop=!1,this.totalTicks=0,this.events=[],this.totalEvents=0,this.eventListeners={},"function"==typeof t&&this.on("midiEvent",t)}loadFile(e){const i=t("fs");return this.buffer=i.readFileSync(e),this.fileLoaded()}loadArrayBuffer(t){return this.buffer=new Uint8Array(t),this.fileLoaded()}loadDataUri(t){const e=window.atob(t.split(",")[1]),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return this.buffer=i,this.fileLoaded()}getFilesize(){return this.buffer?this.buffer.length:0}fileLoaded(){if(!this.validate())throw"Invalid MIDI file; should start with MThd";return this.setTempo(this.defaultTempo).getDivision().getFormat().getTracks().dryRun()}validate(){return"MThd"===s.bytesToLetters(this.buffer.subarray(0,4))}getFormat(){return this.format=s.bytesToNumber(this.buffer.subarray(8,10)),this}getTracks(){this.tracks=[];let t=0;for(;t<this.buffer.length;){if("MTrk"==s.bytesToLetters(this.buffer.subarray(t,t+4))){let e=s.bytesToNumber(this.buffer.subarray(t+4,t+8));this.tracks.push(new n(this.tracks.length,this.buffer.subarray(t+8,t+8+e)))}t+=s.bytesToNumber(this.buffer.subarray(t+4,t+8))+8}return this}enableTrack(t){return this.tracks[t-1].enable(),this}disableTrack(t){return this.tracks[t-1].disable(),this}getDivision(){return this.division=s.bytesToNumber(this.buffer.subarray(12,14)),this}playLoop(t){this.inLoop||(this.inLoop=!0,this.tick=this.getCurrentTick(),this.tracks.forEach((function(e){if(!t&&this.endOfFile())this.triggerPlayerEvent("endOfFile"),this.stop();else{let i=e.handleEvent(this.tick,t);t&&i?(i.hasOwnProperty("name")&&"Set Tempo"===i.name&&this.setTempo(i.data),i.hasOwnProperty("name")&&"Program Change"===i.name&&(this.instruments.includes(i.value)||this.instruments.push(i.value))):i&&this.emitEvent(i)}}),this),t||this.triggerPlayerEvent("playing",{tick:this.tick}),this.inLoop=!1)}setTempo(t){return this.tempo=t,this}setStartTime(t){this.startTime=t}play(){if(this.isPlaying())throw"Already playing...";return this.startTime||(this.startTime=(new Date).getTime()),this.setIntervalId=window.setInterval(this.playLoop.bind(this),this.sampleRate),this}pause(){return clearInterval(this.setIntervalId),this.setIntervalId=!1,this.startTick=this.tick,this.startTime=0,this}stop(){return clearInterval(this.setIntervalId),this.setIntervalId=!1,this.startTick=0,this.startTime=0,this.resetTracks(),this}skipToTick(t){return this.stop(),this.startTick=t,this.tracks.forEach((function(e){e.setEventIndexByTick(t)})),this}skipToPercent(t){if(t<0||t>100)throw"Percent must be number between 1 and 100.";return this.skipToTick(Math.round(t/100*this.totalTicks)),this}skipToSeconds(t){const e=this.getSongTime();if(t<0||t>e)throw`${t} seconds not within song time of ${e}`;return this.skipToPercent(t/e*100),this}isPlaying(){return this.setIntervalId>0||"object"==typeof this.setIntervalId}dryRun(){for(this.resetTracks();!this.endOfFile();)this.playLoop(!0);return this.events=this.getEvents(),this.totalEvents=this.getTotalEvents(),this.totalTicks=this.getTotalTicks(),this.startTick=0,this.startTime=0,this.resetTracks(),this.triggerPlayerEvent("fileLoaded",this),this}resetTracks(){return this.tracks.forEach((t=>t.reset())),this}getEvents(){return this.tracks.map((t=>t.events))}getTotalTicks(){return Math.max.apply(null,this.tracks.map((t=>t.delta)))}getTotalEvents(){return this.tracks.reduce(((t,e)=>({events:{length:t.events.length+e.events.length}})),{events:{length:0}}).events.length}getSongTime(){return this.totalTicks/this.division/this.tempo*60}getSongTimeRemaining(){return Math.round((this.totalTicks-this.tick)/this.division/this.tempo*60)}getSongPercentRemaining(){return Math.round(this.getSongTimeRemaining()/this.getSongTime()*100)}bytesProcessed(){return 14+8*this.tracks.length+this.tracks.reduce(((t,e)=>({pointer:t.pointer+e.pointer})),{pointer:0}).pointer}eventsPlayed(){return this.tracks.reduce(((t,e)=>({eventIndex:t.eventIndex+e.eventIndex})),{eventIndex:0}).eventIndex}endOfFile(){return this.isPlaying()?this.eventsPlayed()==this.totalEvents:this.bytesProcessed()==this.buffer.length}getCurrentTick(){return Math.round(((new Date).getTime()-this.startTime)/1e3*(this.division*(this.tempo/60)))+this.startTick}emitEvent(t){return this.triggerPlayerEvent("midiEvent",t),this}on(t,e){return this.eventListeners.hasOwnProperty(t)||(this.eventListeners[t]=[]),this.eventListeners[t].push(e),this}triggerPlayerEvent(t,e){return this.eventListeners.hasOwnProperty(t)&&this.eventListeners[t].forEach((t=>t(e||{}))),this}}e.exports={Player:r}},{"./track":15,"./utils":16,fs:void 0}],9:[function(t,e,i){function s(t,e){return function(i,s,n,r){t(i,s,n,r),e(i,s,n,r)}}e.exports=function(t){return t.on=function(e,i){if(1===arguments.length&&"function"==typeof e)return t.on("event",e);var n="on"+e,r=t[n];return t[n]=r?s(r,i):i,t},t}},{}],10:[function(t,e,i){"use strict";const s=t("./player"),n=t("./events"),r=t("./notes"),a=t("./scheduler");function o(t,e,i){return a(r(n(s(t,e,i))))}e.exports={SamplePlayer:o}},{"./events":9,"./notes":11,"./player":12,"./scheduler":13}],11:[function(t,e,i){"use strict";var s=t("../note-parser/index"),n=function(t){return null!==t&&t!==[]&&t>=0&&t<129},r=function(t){return n(t)?+t:s.midi(t)};function a(t,e){return Object.keys(t).reduce((function(i,s){return i[e(s)]=t[s],i}),{})}e.exports=function(t){if(t.buffers){var e=t.opts.map,i="function"==typeof e?e:r,s=function(t){return t?i(t)||t:null};t.buffers=a(t.buffers,s);var n=t.start;t.start=function(t,e,i){var r=s(t),a=r%1;return a&&(r=Math.floor(r),i=Object.assign(i||{},{cents:Math.floor(100*a)})),n(r,e,i)}}return t}},{"../note-parser/index":7}],12:[function(t,e,i){"use strict";const s=t("../adsr/index"),n={},r={gain:1,attack:.01,decay:.1,sustain:.9,release:.3,loop:!1,cents:0,loopStart:0,loopEnd:0};function a(t,e,i){let s=!1,a=0,o={};const l=t.createGain();l.gain.value=1;const u=Object.assign({},r,i),d={context:t,out:l,opts:u};return e instanceof AudioBuffer?d.buffer=e:d.buffers=e,d.start=function(e,i,r){if(d.buffer&&null!==e)return d.start(null,e,i);var a=e?d.buffers[e]:d.buffer;if(!a)return void console.warn(`Buffer ${e} not found.`);if(!s)return void console.warn("SamplePlayer not connected to any node.");const o=r||n;i=Math.max(t.currentTime,i||0),d.emit("start",i,e,o);var l=f(e,a,o);return l.id=p(e,l),l.env.start(i),l.source.start(i),d.emit("started",i,l.id,l),o.duration&&l.stop(i+o.duration),l},d.play=function(t,e,i){return d.start(t,e,i)},d.stop=function(t,e){return(e=e||Object.keys(o)).map((function(e){const i=o[e];return i?(i.stop(t),i.id):null}))},d.connect=function(t){return s=!0,l.connect(t),d},d.emit=function(t,e,i,s){d.onevent&&d.onevent(t,e,i,s);const n=d["on"+t];n&&n(e,i,s)},d;function p(e,i){return i.id=a++,o[i.id]=i,i.source.onended=function(){const e=t.currentTime;i.source.disconnect(),i.env.disconnect(),i.disconnect(),d.emit("ended",e,i.id,i)},i.id}function f(e,i,s){const n=t.createGain();return n.gain.value=0,n.connect(l),n.env=c(t,s,u),n.env.connect(n.gain),n.source=t.createBufferSource(),n.source.buffer=i,n.source.connect(n),n.source.loop=s.loop||u.loop,n.source.playbackRate.value=h(s.cents||u.cents),n.source.loopStart=s.loopStart||u.loopStart,n.source.loopEnd=s.loopEnd||u.loopEnd,n.stop=function(i){const s=i||t.currentTime;d.emit("stop",s,e);const r=n.env.stop(s);n.source.stop(r)},n}}function o(t){return"number"==typeof t}const l=["attack","decay","sustain","release"];function c(t,e,i){const n=s(t),r=e.adsr||i.adsr;return l.forEach((function(t,s){n[t]=r?r[s]:e[t]||i[t]})),n.value.value=o(e.gain)?e.gain:o(i.gain)?i.gain:1,n}function h(t){return t?Math.pow(2,t/1200):1}e.exports=a},{"../adsr/index":1}],13:[function(t,e,i){"use strict";var s=Array.isArray,n=function(t){return t&&"object"==typeof t},r={};e.exports=function(t){return t.schedule=function(e,i){var a,o,l,c,h=t.context.currentTime,u=e<h?h:e;return t.emit("schedule",u,i),i.map((function(e){return e?(s(e)?(a=e[0],o=e[1]):(a=e.time,o=e),n(o)?(l=o.name||o.key||o.note||o.midi||null,c=o):(l=o,c=r),t.start(l,u+(a||0),c)):null}))},t}},{}],14:[function(t,e,i){"use strict";const s=t("../audio-loader/index").load,n=t("../sample-player/index").SamplePlayer;function r(t,e,i={}){if(1===arguments.length)return function(e,i){return r(t,e,i)};let l="",c="";if("string"==typeof e){l=e;const t=i.isSoundfontURL||a,s=i.nameToUrl||o;c=t(e)?e:s(e,i.soundfont,i.format),e=c}return s(t,e,{only:i.only||i.notes}).then((e=>{const s=n(t,e,i).connect(i.destination?i.destination:t.destination);return s.url=c,s.name=l,s}))}function a(t){return/\.js(\?.*)?$/i.test(t)}function o(t,e,i){return"https://gleitz.github.io/midi-js-soundfonts/"+(e="FluidR3_GM"===e?e:"MusyngKite")+"/"+t+"-"+(i="ogg"===i?i:"mp3")+".js"}const l={instrument:r,nameToUrl:o};e.exports={Soundfont:l}},{"../audio-loader/index":4,"../sample-player/index":10}],15:[function(t,e,i){const s=t("./constants").Constants,n=t("./utils").Utils;class r{constructor(t,e){this.enabled=!0,this.eventIndex=0,this.pointer=0,this.lastTick=0,this.lastStatus=null,this.index=t,this.data=e,this.delta=0,this.runningDelta=0,this.events=[]}reset(){return this.enabled=!0,this.eventIndex=0,this.pointer=0,this.lastTick=0,this.lastStatus=null,this.delta=0,this.runningDelta=0,this}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}setEventIndexByTick(t){t=t||0;for(let e in this.events)if(this.events[e].tick>=t)return this.eventIndex=e,this}getCurrentByte(){return this.data[this.pointer]}getDeltaByteCount(){let t=this.getCurrentByte(),e=1;for(;t>=128;)t=this.data[this.pointer+e],e++;return e}getDelta(){return n.readVarInt(this.data.subarray(this.pointer,this.pointer+this.getDeltaByteCount()))}handleEvent(t,e){if(e=e||!1){const i=t-this.lastTick>=this.getDelta();if(this.pointer<this.data.length&&(e||i)){const t=this.parseEvent();if(this.enabled)return t}}else if(this.events[this.eventIndex]&&this.events[this.eventIndex].tick<=t&&(this.eventIndex++,this.enabled))return this.events[this.eventIndex-1];return null}getStringData(t){const e=1,i=n.readVarInt(this.data.subarray(t+2,t+2+e));return n.bytesToLetters(this.data.subarray(t+e+2,t+e+i+2))}parseEvent(){const t=this.pointer+this.getDeltaByteCount(),e={},i=this.getDeltaByteCount();if(e.track=this.index+1,e.delta=this.getDelta(),this.lastTick=this.lastTick+e.delta,this.runningDelta+=e.delta,e.tick=this.runningDelta,e.byteIndex=this.pointer,255==this.data[t]){switch(this.data[t+1]){case 0:e.name="Sequence Number";break;case 1:e.name="Text Event",e.string=this.getStringData(t);break;case 2:e.name="Copyright Notice";break;case 3:e.name="Sequence/Track Name",e.string=this.getStringData(t);break;case 4:e.name="Instrument Name",e.string=this.getStringData(t);break;case 5:e.name="Lyric",e.string=this.getStringData(t);break;case 6:e.name="Marker";break;case 7:e.name="Cue Point",e.string=this.getStringData(t);break;case 9:e.name="Device Name",e.string=this.getStringData(t);break;case 32:e.name="MIDI Channel Prefix";break;case 33:e.name="MIDI Port",e.data=n.bytesToNumber([this.data[t+3]]);break;case 47:e.name="End of Track";break;case 81:e.name="Set Tempo",e.data=Math.round(6e7/n.bytesToNumber(this.data.subarray(t+3,t+6))),this.tempo=e.data;break;case 84:e.name="SMTPE Offset";break;case 88:e.name="Time Signature",e.data=this.data.subarray(t+3,t+7),e.timeSignature=e.data[0]+"/"+Math.pow(2,e.data[1]);break;case 89:e.name="Key Signature",e.data=this.data.subarray(t+3,t+5),e.data[0]>=0?e.keySignature=s.CIRCLE_OF_FIFTHS[e.data[0]]:e.data[0]<0&&(e.keySignature=s.CIRCLE_OF_FOURTHS[Math.abs(e.data[0])]),0==e.data[1]?e.keySignature+=" Major":1==e.data[1]&&(e.keySignature+=" Minor");break;case 127:e.name="Sequencer-Specific Meta-event";break;default:e.name=`Unknown: ${this.data[t+1].toString(16)}`}const r=this.data[this.pointer+i+2];this.pointer+=i+3+r}else if(240==this.data[t]){e.name="Sysex";const t=this.data[this.pointer+i+1];this.pointer+=i+2+t}else this.data[t]<128?(e.running=!0,e.noteNumber=this.data[t],e.noteName=s.NOTES[this.data[t]],e.velocity=this.data[t+1],this.lastStatus<=143?(e.name="Note off",e.channel=this.lastStatus-128+1):this.lastStatus<=159&&(e.name="Note on",e.channel=this.lastStatus-144+1),this.pointer+=i+2):(this.lastStatus=this.data[t],this.data[t]<=143?(e.name="Note off",e.channel=this.lastStatus-128+1,e.noteNumber=this.data[t+1],e.noteName=s.NOTES[this.data[t+1]],e.velocity=Math.round(this.data[t+2]/127*100),this.pointer+=i+3):this.data[t]<=159?(e.name="Note on",e.channel=this.lastStatus-144+1,e.noteNumber=this.data[t+1],e.noteName=s.NOTES[this.data[t+1]],e.velocity=Math.round(this.data[t+2]/127*100),this.pointer+=i+3):this.data[t]<=175?(e.name="Polyphonic Key Pressure",e.channel=this.lastStatus-160+1,e.note=s.NOTES[this.data[t+1]],e.pressure=event[2],this.pointer+=i+3):this.data[t]<=191?(e.name="Controller Change",e.channel=this.lastStatus-176+1,e.number=this.data[t+1],e.value=this.data[t+2],this.pointer+=i+3):this.data[t]<=207?(e.name="Program Change",e.channel=this.lastStatus-192+1,e.value=this.data[t+1],this.pointer+=i+2):this.data[t]<=223?(e.name="Channel Key Pressure",e.channel=this.lastStatus-208+1,this.pointer+=i+2):this.data[t]<=239?(e.name="Pitch Bend",e.channel=this.lastStatus-224+1,this.pointer+=i+3):e.name=`Unknown. Pointer: ${this.pointer.toString()} ${t.toString()} ${this.data.length}`);return this.delta+=e.delta,this.events.push(e),e}endOfTrack(){return 255==this.data[this.pointer+1]&&47==this.data[this.pointer+2]&&0==this.data[this.pointer+3]}}e.exports={Track:r}},{"./constants":5,"./utils":16}],16:[function(t,e,i){class s{static byteToHex(t){return`0${t.toString(16)}`.slice(-2)}static bytesToHex(t){const e=[];return t.forEach((t=>e.push(s.byteToHex(t)))),e.join("")}static hexToNumber(t){return parseInt(t,16)}static bytesToNumber(t){return s.hexToNumber(s.bytesToHex(t))}static bytesToLetters(t){const e=[];return t.forEach((t=>e.push(String.fromCharCode(t)))),e.join("")}static decToBinary(t){return(t>>>0).toString(2)}static readVarInt(t){let e=0;return t.forEach((t=>{128&t?(e+=127&t,e<<=7):e+=t})),e}}e.exports={Utils:s}},{}]},{},[6])(6)},755:function(t,e){var i;!function(e,i){"use strict";"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,(function(s,n){"use strict";var r=[],a=Object.getPrototypeOf,o=r.slice,l=r.flat?function(t){return r.flat.call(t)}:function(t){return r.concat.apply([],t)},c=r.push,h=r.indexOf,u={},d=u.toString,p=u.hasOwnProperty,f=p.toString,g=f.call(Object),m={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},b=function(t){return null!=t&&t===t.window},y=s.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function A(t,e,i){var s,n,r=(i=i||y).createElement("script");if(r.text=t,e)for(s in w)(n=e[s]||e.getAttribute&&e.getAttribute(s))&&r.setAttribute(s,n);i.head.appendChild(r).parentNode.removeChild(r)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?u[d.call(t)]||"object":typeof t}var C="3.7.1",k=/HTML$/i,S=function(t,e){return new S.fn.init(t,e)};function E(t){var e=!!t&&"length"in t&&t.length,i=x(t);return!v(t)&&!b(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function T(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}S.fn=S.prototype={jquery:C,constructor:S,length:0,toArray:function(){return o.call(this)},get:function(t){return null==t?o.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,i){return t.call(e,i,e)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:r.sort,splice:r.splice},S.extend=S.fn.extend=function(){var t,e,i,s,n,r,a=arguments[0]||{},o=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[o]||{},o++),"object"==typeof a||v(a)||(a={}),o===l&&(a=this,o--);o<l;o++)if(null!=(t=arguments[o]))for(e in t)s=t[e],"__proto__"!==e&&a!==s&&(c&&s&&(S.isPlainObject(s)||(n=Array.isArray(s)))?(i=a[e],r=n&&!Array.isArray(i)?[]:n||S.isPlainObject(i)?i:{},n=!1,a[e]=S.extend(c,r,s)):void 0!==s&&(a[e]=s));return a},S.extend({expando:"jQuery"+(C+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==d.call(t))&&(!(e=a(t))||"function"==typeof(i=p.call(e,"constructor")&&e.constructor)&&f.call(i)===g)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,i){A(t,{nonce:e&&e.nonce},i)},each:function(t,e){var i,s=0;if(E(t))for(i=t.length;s<i&&!1!==e.call(t[s],s,t[s]);s++);else for(s in t)if(!1===e.call(t[s],s,t[s]))break;return t},text:function(t){var e,i="",s=0,n=t.nodeType;if(!n)for(;e=t[s++];)i+=S.text(e);return 1===n||11===n?t.textContent:9===n?t.documentElement.textContent:3===n||4===n?t.nodeValue:i},makeArray:function(t,e){var i=e||[];return null!=t&&(E(Object(t))?S.merge(i,"string"==typeof t?[t]:t):c.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:h.call(e,t,i)},isXMLDoc:function(t){var e=t&&t.namespaceURI,i=t&&(t.ownerDocument||t).documentElement;return!k.test(e||i&&i.nodeName||"HTML")},merge:function(t,e){for(var i=+e.length,s=0,n=t.length;s<i;s++)t[n++]=e[s];return t.length=n,t},grep:function(t,e,i){for(var s=[],n=0,r=t.length,a=!i;n<r;n++)!e(t[n],n)!==a&&s.push(t[n]);return s},map:function(t,e,i){var s,n,r=0,a=[];if(E(t))for(s=t.length;r<s;r++)null!=(n=e(t[r],r,i))&&a.push(n);else for(r in t)null!=(n=e(t[r],r,i))&&a.push(n);return l(a)},guid:1,support:m}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=r[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){u["[object "+e+"]"]=e.toLowerCase()}));var B=r.pop,I=r.sort,P=r.splice,_="[\\x20\\t\\r\\n\\f]",D=new RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g");S.contains=function(t,e){var i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(t.contains?t.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))};var R=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function O(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}S.escapeSelector=function(t){return(t+"").replace(R,O)};var M=y,N=c;!function(){var t,e,i,n,a,l,c,u,d,f,g=N,v=S.expando,b=0,y=0,w=tt(),A=tt(),x=tt(),C=tt(),k=function(t,e){return t===e&&(a=!0),0},E="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="(?:\\\\[\\da-fA-F]{1,6}"+_+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",O="\\["+_+"*("+R+")(?:"+_+"*([*^$|!~]?=)"+_+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+_+"*\\]",$=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",V=new RegExp(_+"+","g"),q=new RegExp("^"+_+"*,"+_+"*"),L=new RegExp("^"+_+"*([>+~]|"+_+")"+_+"*"),j=new RegExp(_+"|>"),F=new RegExp($),z=new RegExp("^"+R+"$"),U={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),bool:new RegExp("^(?:"+E+")$","i"),needsContext:new RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,K=new RegExp("\\\\[\\da-fA-F]{1,6}"+_+"?|\\\\([^\\r\\n\\f])","g"),Z=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},Y=function(){lt()},Q=dt((function(t){return!0===t.disabled&&T(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(r=o.call(M.childNodes),M.childNodes),r[M.childNodes.length].nodeType}catch(t){g={apply:function(t,e){N.apply(t,o.call(e))},call:function(t){N.apply(t,o.call(arguments,1))}}}function X(t,e,i,s){var n,r,a,o,c,h,p,f=e&&e.ownerDocument,b=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==b&&9!==b&&11!==b)return i;if(!s&&(lt(e),e=e||l,u)){if(11!==b&&(c=G.exec(t)))if(n=c[1]){if(9===b){if(!(a=e.getElementById(n)))return i;if(a.id===n)return g.call(i,a),i}else if(f&&(a=f.getElementById(n))&&X.contains(e,a)&&a.id===n)return g.call(i,a),i}else{if(c[2])return g.apply(i,e.getElementsByTagName(t)),i;if((n=c[3])&&e.getElementsByClassName)return g.apply(i,e.getElementsByClassName(n)),i}if(!(C[t+" "]||d&&d.test(t))){if(p=t,f=e,1===b&&(j.test(t)||L.test(t))){for((f=J.test(t)&&ot(e.parentNode)||e)==e&&m.scope||((o=e.getAttribute("id"))?o=S.escapeSelector(o):e.setAttribute("id",o=v)),r=(h=ht(t)).length;r--;)h[r]=(o?"#"+o:":scope")+" "+ut(h[r]);p=h.join(",")}try{return g.apply(i,f.querySelectorAll(p)),i}catch(e){C(t,!0)}finally{o===v&&e.removeAttribute("id")}}}return bt(t.replace(D,"$1"),e,i,s)}function tt(){var t=[];return function i(s,n){return t.push(s+" ")>e.cacheLength&&delete i[t.shift()],i[s+" "]=n}}function et(t){return t[v]=!0,t}function it(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function st(t){return function(e){return T(e,"input")&&e.type===t}}function nt(t){return function(e){return(T(e,"input")||T(e,"button"))&&e.type===t}}function rt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Q(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function at(t){return et((function(e){return e=+e,et((function(i,s){for(var n,r=t([],i.length,e),a=r.length;a--;)i[n=r[a]]&&(i[n]=!(s[n]=i[n]))}))}))}function ot(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var i,s=t?t.ownerDocument||t:M;return s!=l&&9===s.nodeType&&s.documentElement?(c=(l=s).documentElement,u=!S.isXMLDoc(l),f=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&M!=l&&(i=l.defaultView)&&i.top!==i&&i.addEventListener("unload",Y),m.getById=it((function(t){return c.appendChild(t).id=S.expando,!l.getElementsByName||!l.getElementsByName(S.expando).length})),m.disconnectedMatch=it((function(t){return f.call(t,"*")})),m.scope=it((function(){return l.querySelectorAll(":scope")})),m.cssHas=it((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),m.getById?(e.filter.ID=function(t){var e=t.replace(K,Z);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i=e.getElementById(t);return i?[i]:[]}}):(e.filter.ID=function(t){var e=t.replace(K,Z);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i,s,n,r=e.getElementById(t);if(r){if((i=r.getAttributeNode("id"))&&i.value===t)return[r];for(n=e.getElementsByName(t),s=0;r=n[s++];)if((i=r.getAttributeNode("id"))&&i.value===t)return[r]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&u)return e.getElementsByClassName(t)},d=[],it((function(t){var e;c.appendChild(t).innerHTML="<a id='"+v+"' href='' disabled='disabled'></a><select id='"+v+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||d.push("\\["+_+"*(?:value|"+E+")"),t.querySelectorAll("[id~="+v+"-]").length||d.push("~="),t.querySelectorAll("a#"+v+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||d.push("\\["+_+"*name"+_+"*="+_+"*(?:''|\"\")")})),m.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),k=function(t,e){if(t===e)return a=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!m.sortDetached&&e.compareDocumentPosition(t)===i?t===l||t.ownerDocument==M&&X.contains(M,t)?-1:e===l||e.ownerDocument==M&&X.contains(M,e)?1:n?h.call(n,t)-h.call(n,e):0:4&i?-1:1)},l):l}for(t in X.matches=function(t,e){return X(t,null,null,e)},X.matchesSelector=function(t,e){if(lt(t),u&&!C[e+" "]&&(!d||!d.test(e)))try{var i=f.call(t,e);if(i||m.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){C(e,!0)}return X(e,l,null,[t]).length>0},X.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),S.contains(t,e)},X.attr=function(t,i){(t.ownerDocument||t)!=l&<(t);var s=e.attrHandle[i.toLowerCase()],n=s&&p.call(e.attrHandle,i.toLowerCase())?s(t,i,!u):void 0;return void 0!==n?n:t.getAttribute(i)},X.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},S.uniqueSort=function(t){var e,i=[],s=0,r=0;if(a=!m.sortStable,n=!m.sortStable&&o.call(t,0),I.call(t,k),a){for(;e=t[r++];)e===t[r]&&(s=i.push(r));for(;s--;)P.call(t,i[s],1)}return n=null,t},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(o.apply(this)))},e=S.expr={cacheLength:50,createPseudo:et,match:U,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(K,Z),t[3]=(t[3]||t[4]||t[5]||"").replace(K,Z),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||X.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&X.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return U.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&F.test(i)&&(e=ht(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(K,Z).toLowerCase();return"*"===t?function(){return!0}:function(t){return T(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+_+")"+t+"("+_+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,i){return function(s){var n=X.attr(s,t);return null==n?"!="===e:!e||(n+="","="===e?n===i:"!="===e?n!==i:"^="===e?i&&0===n.indexOf(i):"*="===e?i&&n.indexOf(i)>-1:"$="===e?i&&n.slice(-i.length)===i:"~="===e?(" "+n.replace(V," ")+" ").indexOf(i)>-1:"|="===e&&(n===i||n.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,s,n){var r="nth"!==t.slice(0,3),a="last"!==t.slice(-4),o="of-type"===e;return 1===s&&0===n?function(t){return!!t.parentNode}:function(e,i,l){var c,h,u,d,p,f=r!==a?"nextSibling":"previousSibling",g=e.parentNode,m=o&&e.nodeName.toLowerCase(),y=!l&&!o,w=!1;if(g){if(r){for(;f;){for(u=e;u=u[f];)if(o?T(u,m):1===u.nodeType)return!1;p=f="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(w=(d=(c=(h=g[v]||(g[v]={}))[t]||[])[0]===b&&c[1])&&c[2],u=d&&g.childNodes[d];u=++d&&u&&u[f]||(w=d=0)||p.pop();)if(1===u.nodeType&&++w&&u===e){h[t]=[b,d,w];break}}else if(y&&(w=d=(c=(h=e[v]||(e[v]={}))[t]||[])[0]===b&&c[1]),!1===w)for(;(u=++d&&u&&u[f]||(w=d=0)||p.pop())&&(!(o?T(u,m):1===u.nodeType)||!++w||(y&&((h=u[v]||(u[v]={}))[t]=[b,w]),u!==e)););return(w-=n)===s||w%s==0&&w/s>=0}}},PSEUDO:function(t,i){var s,n=e.pseudos[t]||e.setFilters[t.toLowerCase()]||X.error("unsupported pseudo: "+t);return n[v]?n(i):n.length>1?(s=[t,t,"",i],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var s,r=n(t,i),a=r.length;a--;)t[s=h.call(t,r[a])]=!(e[s]=r[a])})):function(t){return n(t,0,s)}):n}},pseudos:{not:et((function(t){var e=[],i=[],s=vt(t.replace(D,"$1"));return s[v]?et((function(t,e,i,n){for(var r,a=s(t,null,n,[]),o=t.length;o--;)(r=a[o])&&(t[o]=!(e[o]=r))})):function(t,n,r){return e[0]=t,s(e,null,r,i),e[0]=null,!i.pop()}})),has:et((function(t){return function(e){return X(t,e).length>0}})),contains:et((function(t){return t=t.replace(K,Z),function(e){return(e.textContent||S.text(e)).indexOf(t)>-1}})),lang:et((function(t){return z.test(t||"")||X.error("unsupported lang: "+t),t=t.replace(K,Z).toLowerCase(),function(e){var i;do{if(i=u?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=s.location&&s.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:rt(!1),disabled:rt(!0),checked:function(t){return T(t,"input")&&!!t.checked||T(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return W.test(t.nodeName)},input:function(t){return H.test(t.nodeName)},button:function(t){return T(t,"input")&&"button"===t.type||T(t,"button")},text:function(t){var e;return T(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:at((function(){return[0]})),last:at((function(t,e){return[e-1]})),eq:at((function(t,e,i){return[i<0?i+e:i]})),even:at((function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t})),odd:at((function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t})),lt:at((function(t,e,i){var s;for(s=i<0?i+e:i>e?e:i;--s>=0;)t.push(s);return t})),gt:at((function(t,e,i){for(var s=i<0?i+e:i;++s<e;)t.push(s);return t}))}},e.pseudos.nth=e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[t]=st(t);for(t in{submit:!0,reset:!0})e.pseudos[t]=nt(t);function ct(){}function ht(t,i){var s,n,r,a,o,l,c,h=A[t+" "];if(h)return i?0:h.slice(0);for(o=t,l=[],c=e.preFilter;o;){for(a in s&&!(n=q.exec(o))||(n&&(o=o.slice(n[0].length)||o),l.push(r=[])),s=!1,(n=L.exec(o))&&(s=n.shift(),r.push({value:s,type:n[0].replace(D," ")}),o=o.slice(s.length)),e.filter)!(n=U[a].exec(o))||c[a]&&!(n=c[a](n))||(s=n.shift(),r.push({value:s,type:a,matches:n}),o=o.slice(s.length));if(!s)break}return i?o.length:o?X.error(t):A(t,l).slice(0)}function ut(t){for(var e=0,i=t.length,s="";e<i;e++)s+=t[e].value;return s}function dt(t,e,i){var s=e.dir,n=e.next,r=n||s,a=i&&"parentNode"===r,o=y++;return e.first?function(e,i,n){for(;e=e[s];)if(1===e.nodeType||a)return t(e,i,n);return!1}:function(e,i,l){var c,h,u=[b,o];if(l){for(;e=e[s];)if((1===e.nodeType||a)&&t(e,i,l))return!0}else for(;e=e[s];)if(1===e.nodeType||a)if(h=e[v]||(e[v]={}),n&&T(e,n))e=e[s]||e;else{if((c=h[r])&&c[0]===b&&c[1]===o)return u[2]=c[2];if(h[r]=u,u[2]=t(e,i,l))return!0}return!1}}function pt(t){return t.length>1?function(e,i,s){for(var n=t.length;n--;)if(!t[n](e,i,s))return!1;return!0}:t[0]}function ft(t,e,i,s,n){for(var r,a=[],o=0,l=t.length,c=null!=e;o<l;o++)(r=t[o])&&(i&&!i(r,s,n)||(a.push(r),c&&e.push(o)));return a}function gt(t,e,i,s,n,r){return s&&!s[v]&&(s=gt(s)),n&&!n[v]&&(n=gt(n,r)),et((function(r,a,o,l){var c,u,d,p,f=[],m=[],v=a.length,b=r||function(t,e,i){for(var s=0,n=e.length;s<n;s++)X(t,e[s],i);return i}(e||"*",o.nodeType?[o]:o,[]),y=!t||!r&&e?b:ft(b,f,t,o,l);if(i?i(y,p=n||(r?t:v||s)?[]:a,o,l):p=y,s)for(c=ft(p,m),s(c,[],o,l),u=c.length;u--;)(d=c[u])&&(p[m[u]]=!(y[m[u]]=d));if(r){if(n||t){if(n){for(c=[],u=p.length;u--;)(d=p[u])&&c.push(y[u]=d);n(null,p=[],c,l)}for(u=p.length;u--;)(d=p[u])&&(c=n?h.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else p=ft(p===a?p.splice(v,p.length):p),n?n(null,a,p,l):g.apply(a,p)}))}function mt(t){for(var s,n,r,a=t.length,o=e.relative[t[0].type],l=o||e.relative[" "],c=o?1:0,u=dt((function(t){return t===s}),l,!0),d=dt((function(t){return h.call(s,t)>-1}),l,!0),p=[function(t,e,n){var r=!o&&(n||e!=i)||((s=e).nodeType?u(t,e,n):d(t,e,n));return s=null,r}];c<a;c++)if(n=e.relative[t[c].type])p=[dt(pt(p),n)];else{if((n=e.filter[t[c].type].apply(null,t[c].matches))[v]){for(r=++c;r<a&&!e.relative[t[r].type];r++);return gt(c>1&&pt(p),c>1&&ut(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(D,"$1"),n,c<r&&mt(t.slice(c,r)),r<a&&mt(t=t.slice(r)),r<a&&ut(t))}p.push(n)}return pt(p)}function vt(t,s){var n,r=[],a=[],o=x[t+" "];if(!o){for(s||(s=ht(t)),n=s.length;n--;)(o=mt(s[n]))[v]?r.push(o):a.push(o);o=x(t,function(t,s){var n=s.length>0,r=t.length>0,a=function(a,o,c,h,d){var p,f,m,v=0,y="0",w=a&&[],A=[],x=i,C=a||r&&e.find.TAG("*",d),k=b+=null==x?1:Math.random()||.1,E=C.length;for(d&&(i=o==l||o||d);y!==E&&null!=(p=C[y]);y++){if(r&&p){for(f=0,o||p.ownerDocument==l||(lt(p),c=!u);m=t[f++];)if(m(p,o||l,c)){g.call(h,p);break}d&&(b=k)}n&&((p=!m&&p)&&v--,a&&w.push(p))}if(v+=y,n&&y!==v){for(f=0;m=s[f++];)m(w,A,o,c);if(a){if(v>0)for(;y--;)w[y]||A[y]||(A[y]=B.call(h));A=ft(A)}g.apply(h,A),d&&!a&&A.length>0&&v+s.length>1&&S.uniqueSort(h)}return d&&(b=k,i=x),w};return n?et(a):a}(a,r)),o.selector=t}return o}function bt(t,i,s,n){var r,a,o,l,c,h="function"==typeof t&&t,d=!n&&ht(t=h.selector||t);if(s=s||[],1===d.length){if((a=d[0]=d[0].slice(0)).length>2&&"ID"===(o=a[0]).type&&9===i.nodeType&&u&&e.relative[a[1].type]){if(!(i=(e.find.ID(o.matches[0].replace(K,Z),i)||[])[0]))return s;h&&(i=i.parentNode),t=t.slice(a.shift().value.length)}for(r=U.needsContext.test(t)?0:a.length;r--&&(o=a[r],!e.relative[l=o.type]);)if((c=e.find[l])&&(n=c(o.matches[0].replace(K,Z),J.test(a[0].type)&&ot(i.parentNode)||i))){if(a.splice(r,1),!(t=n.length&&ut(a)))return g.apply(s,n),s;break}}return(h||vt(t,d))(n,i,!u,s,!i||J.test(t)&&ot(i.parentNode)||i),s}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,m.sortStable=v.split("").sort(k).join("")===v,lt(),m.sortDetached=it((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),S.find=X,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,X.compile=vt,X.select=bt,X.setDocument=lt,X.tokenize=ht,X.escape=S.escapeSelector,X.getText=S.text,X.isXML=S.isXMLDoc,X.selectors=S.expr,X.support=S.support,X.uniqueSort=S.uniqueSort}();var $=function(t,e,i){for(var s=[],n=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(n&&S(t).is(i))break;s.push(t)}return s},V=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},q=S.expr.match.needsContext,L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(t,e,i){return v(e)?S.grep(t,(function(t,s){return!!e.call(t,s,t)!==i})):e.nodeType?S.grep(t,(function(t){return t===e!==i})):"string"!=typeof e?S.grep(t,(function(t){return h.call(e,t)>-1!==i})):S.filter(e,t,i)}S.filter=function(t,e,i){var s=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===s.nodeType?S.find.matchesSelector(s,t)?[s]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,i,s=this.length,n=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e<s;e++)if(S.contains(n[e],this))return!0})));for(i=this.pushStack([]),e=0;e<s;e++)S.find(t,n[e],i);return s>1?S.uniqueSort(i):i},filter:function(t){return this.pushStack(j(this,t||[],!1))},not:function(t){return this.pushStack(j(this,t||[],!0))},is:function(t){return!!j(this,"string"==typeof t&&q.test(t)?S(t):t||[],!1).length}});var F,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,i){var s,n;if(!t)return this;if(i=i||F,"string"==typeof t){if(!(s="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:z.exec(t))||!s[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(s[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(s[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),L.test(s[1])&&S.isPlainObject(e))for(s in e)v(this[s])?this[s](e[s]):this.attr(s,e[s]);return this}return(n=y.getElementById(s[2]))&&(this[0]=n,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==i.ready?i.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,F=S(y);var U=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),i=e.length;return this.filter((function(){for(var t=0;t<i;t++)if(S.contains(this,e[t]))return!0}))},closest:function(t,e){var i,s=0,n=this.length,r=[],a="string"!=typeof t&&S(t);if(!q.test(t))for(;s<n;s++)for(i=this[s];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(a?a.index(i)>-1:1===i.nodeType&&S.find.matchesSelector(i,t))){r.push(i);break}return this.pushStack(r.length>1?S.uniqueSort(r):r)},index:function(t){return t?"string"==typeof t?h.call(S(t),this[0]):h.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return $(t,"parentNode")},parentsUntil:function(t,e,i){return $(t,"parentNode",i)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return $(t,"nextSibling")},prevAll:function(t){return $(t,"previousSibling")},nextUntil:function(t,e,i){return $(t,"nextSibling",i)},prevUntil:function(t,e,i){return $(t,"previousSibling",i)},siblings:function(t){return V((t.parentNode||{}).firstChild,t)},children:function(t){return V(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(T(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(i,s){var n=S.map(this,e,i);return"Until"!==t.slice(-5)&&(s=i),s&&"string"==typeof s&&(n=S.filter(s,n)),this.length>1&&(H[t]||S.uniqueSort(n),U.test(t)&&n.reverse()),this.pushStack(n)}}));var G=/[^\x20\t\r\n\f]+/g;function J(t){return t}function K(t){throw t}function Z(t,e,i,s){var n;try{t&&v(n=t.promise)?n.call(t).done(e).fail(i):t&&v(n=t.then)?n.call(t,e,i):e.apply(void 0,[t].slice(s))}catch(t){i.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(G)||[],(function(t,i){e[i]=!0})),e}(t):S.extend({},t);var e,i,s,n,r=[],a=[],o=-1,l=function(){for(n=n||t.once,s=e=!0;a.length;o=-1)for(i=a.shift();++o<r.length;)!1===r[o].apply(i[0],i[1])&&t.stopOnFalse&&(o=r.length,i=!1);t.memory||(i=!1),e=!1,n&&(r=i?[]:"")},c={add:function(){return r&&(i&&!e&&(o=r.length-1,a.push(i)),function e(i){S.each(i,(function(i,s){v(s)?t.unique&&c.has(s)||r.push(s):s&&s.length&&"string"!==x(s)&&e(s)}))}(arguments),i&&!e&&l()),this},remove:function(){return S.each(arguments,(function(t,e){for(var i;(i=S.inArray(e,r,i))>-1;)r.splice(i,1),i<=o&&o--})),this},has:function(t){return t?S.inArray(t,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return n=a=[],r=i="",this},disabled:function(){return!r},lock:function(){return n=a=[],i||e||(r=i=""),this},locked:function(){return!!n},fireWith:function(t,i){return n||(i=[t,(i=i||[]).slice?i.slice():i],a.push(i),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!s}};return c},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",n={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},catch:function(t){return n.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(i){S.each(e,(function(e,s){var n=v(t[s[4]])&&t[s[4]];r[s[1]]((function(){var t=n&&n.apply(this,arguments);t&&v(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[s[0]+"With"](this,n?[t]:arguments)}))})),t=null})).promise()},then:function(t,i,n){var r=0;function a(t,e,i,n){return function(){var o=this,l=arguments,c=function(){var s,c;if(!(t<r)){if((s=i.apply(o,l))===e.promise())throw new TypeError("Thenable self-resolution");c=s&&("object"==typeof s||"function"==typeof s)&&s.then,v(c)?n?c.call(s,a(r,e,J,n),a(r,e,K,n)):(r++,c.call(s,a(r,e,J,n),a(r,e,K,n),a(r,e,J,e.notifyWith))):(i!==J&&(o=void 0,l=[s]),(n||e.resolveWith)(o,l))}},h=n?c:function(){try{c()}catch(s){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(s,h.error),t+1>=r&&(i!==K&&(o=void 0,l=[s]),e.rejectWith(o,l))}};t?h():(S.Deferred.getErrorHook?h.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(h.error=S.Deferred.getStackHook()),s.setTimeout(h))}}return S.Deferred((function(s){e[0][3].add(a(0,s,v(n)?n:J,s.notifyWith)),e[1][3].add(a(0,s,v(t)?t:J)),e[2][3].add(a(0,s,v(i)?i:K))})).promise()},promise:function(t){return null!=t?S.extend(t,n):n}},r={};return S.each(e,(function(t,s){var a=s[2],o=s[5];n[s[1]]=a.add,o&&a.add((function(){i=o}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(s[3].fire),r[s[0]]=function(){return r[s[0]+"With"](this===r?void 0:this,arguments),this},r[s[0]+"With"]=a.fireWith})),n.promise(r),t&&t.call(r,r),r},when:function(t){var e=arguments.length,i=e,s=Array(i),n=o.call(arguments),r=S.Deferred(),a=function(t){return function(i){s[t]=this,n[t]=arguments.length>1?o.call(arguments):i,--e||r.resolveWith(s,n)}};if(e<=1&&(Z(t,r.done(a(i)).resolve,r.reject,!e),"pending"===r.state()||v(n[i]&&n[i].then)))return r.then();for(;i--;)Z(n[i],a(i),r.reject);return r.promise()}});var Y=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){s.console&&s.console.warn&&t&&Y.test(t.name)&&s.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){s.setTimeout((function(){throw t}))};var Q=S.Deferred();function X(){y.removeEventListener("DOMContentLoaded",X),s.removeEventListener("load",X),S.ready()}S.fn.ready=function(t){return Q.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||Q.resolveWith(y,[S]))}}),S.ready.then=Q.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?s.setTimeout(S.ready):(y.addEventListener("DOMContentLoaded",X),s.addEventListener("load",X));var tt=function(t,e,i,s,n,r,a){var o=0,l=t.length,c=null==i;if("object"===x(i))for(o in n=!0,i)tt(t,e,o,i[o],!0,r,a);else if(void 0!==s&&(n=!0,v(s)||(a=!0),c&&(a?(e.call(t,s),e=null):(c=e,e=function(t,e,i){return c.call(S(t),i)})),e))for(;o<l;o++)e(t[o],i,a?s:s.call(t[o],o,e(t[o],i)));return n?t:c?e.call(t):l?e(t[0],i):r},et=/^-ms-/,it=/-([a-z])/g;function st(t,e){return e.toUpperCase()}function nt(t){return t.replace(et,"ms-").replace(it,st)}var rt=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function at(){this.expando=S.expando+at.uid++}at.uid=1,at.prototype={cache:function(t){var e=t[this.expando];return e||(e={},rt(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var s,n=this.cache(t);if("string"==typeof e)n[nt(e)]=i;else for(s in e)n[nt(s)]=e[s];return n},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][nt(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,s=t[this.expando];if(void 0!==s){if(void 0!==e){i=(e=Array.isArray(e)?e.map(nt):(e=nt(e))in s?[e]:e.match(G)||[]).length;for(;i--;)delete s[e[i]]}(void 0===e||S.isEmptyObject(s))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!S.isEmptyObject(e)}};var ot=new at,lt=new at,ct=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ht=/[A-Z]/g;function ut(t,e,i){var s;if(void 0===i&&1===t.nodeType)if(s="data-"+e.replace(ht,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(s))){try{i=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:ct.test(t)?JSON.parse(t):t)}(i)}catch(t){}lt.set(t,e,i)}else i=void 0;return i}S.extend({hasData:function(t){return lt.hasData(t)||ot.hasData(t)},data:function(t,e,i){return lt.access(t,e,i)},removeData:function(t,e){lt.remove(t,e)},_data:function(t,e,i){return ot.access(t,e,i)},_removeData:function(t,e){ot.remove(t,e)}}),S.fn.extend({data:function(t,e){var i,s,n,r=this[0],a=r&&r.attributes;if(void 0===t){if(this.length&&(n=lt.get(r),1===r.nodeType&&!ot.get(r,"hasDataAttrs"))){for(i=a.length;i--;)a[i]&&0===(s=a[i].name).indexOf("data-")&&(s=nt(s.slice(5)),ut(r,s,n[s]));ot.set(r,"hasDataAttrs",!0)}return n}return"object"==typeof t?this.each((function(){lt.set(this,t)})):tt(this,(function(e){var i;if(r&&void 0===e)return void 0!==(i=lt.get(r,t))||void 0!==(i=ut(r,t))?i:void 0;this.each((function(){lt.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){lt.remove(this,t)}))}}),S.extend({queue:function(t,e,i){var s;if(t)return e=(e||"fx")+"queue",s=ot.get(t,e),i&&(!s||Array.isArray(i)?s=ot.access(t,e,S.makeArray(i)):s.push(i)),s||[]},dequeue:function(t,e){e=e||"fx";var i=S.queue(t,e),s=i.length,n=i.shift(),r=S._queueHooks(t,e);"inprogress"===n&&(n=i.shift(),s--),n&&("fx"===e&&i.unshift("inprogress"),delete r.stop,n.call(t,(function(){S.dequeue(t,e)}),r)),!s&&r&&r.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return ot.get(t,i)||ot.access(t,i,{empty:S.Callbacks("once memory").add((function(){ot.remove(t,[e+"queue",i])}))})}}),S.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?S.queue(this[0],t):void 0===e?this:this.each((function(){var i=S.queue(this,t,e);S._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&S.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){S.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,s=1,n=S.Deferred(),r=this,a=this.length,o=function(){--s||n.resolveWith(r,[r])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(i=ot.get(r[a],t+"queueHooks"))&&i.empty&&(s++,i.empty.add(o));return o(),n.promise(e)}});var dt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,pt=new RegExp("^(?:([+-])=|)("+dt+")([a-z%]*)$","i"),ft=["Top","Right","Bottom","Left"],gt=y.documentElement,mt=function(t){return S.contains(t.ownerDocument,t)},vt={composed:!0};gt.getRootNode&&(mt=function(t){return S.contains(t.ownerDocument,t)||t.getRootNode(vt)===t.ownerDocument});var bt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&mt(t)&&"none"===S.css(t,"display")};function yt(t,e,i,s){var n,r,a=20,o=s?function(){return s.cur()}:function(){return S.css(t,e,"")},l=o(),c=i&&i[3]||(S.cssNumber[e]?"":"px"),h=t.nodeType&&(S.cssNumber[e]||"px"!==c&&+l)&&pt.exec(S.css(t,e));if(h&&h[3]!==c){for(l/=2,c=c||h[3],h=+l||1;a--;)S.style(t,e,h+c),(1-r)*(1-(r=o()/l||.5))<=0&&(a=0),h/=r;h*=2,S.style(t,e,h+c),i=i||[]}return i&&(h=+h||+l||0,n=i[1]?h+(i[1]+1)*i[2]:+i[2],s&&(s.unit=c,s.start=h,s.end=n)),n}var wt={};function At(t){var e,i=t.ownerDocument,s=t.nodeName,n=wt[s];return n||(e=i.body.appendChild(i.createElement(s)),n=S.css(e,"display"),e.parentNode.removeChild(e),"none"===n&&(n="block"),wt[s]=n,n)}function xt(t,e){for(var i,s,n=[],r=0,a=t.length;r<a;r++)(s=t[r]).style&&(i=s.style.display,e?("none"===i&&(n[r]=ot.get(s,"display")||null,n[r]||(s.style.display="")),""===s.style.display&&bt(s)&&(n[r]=At(s))):"none"!==i&&(n[r]="none",ot.set(s,"display",i)));for(r=0;r<a;r++)null!=n[r]&&(t[r].style.display=n[r]);return t}S.fn.extend({show:function(){return xt(this,!0)},hide:function(){return xt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){bt(this)?S(this).show():S(this).hide()}))}});var Ct,kt,St=/^(?:checkbox|radio)$/i,Et=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Tt=/^$|^module$|\/(?:java|ecma)script/i;Ct=y.createDocumentFragment().appendChild(y.createElement("div")),(kt=y.createElement("input")).setAttribute("type","radio"),kt.setAttribute("checked","checked"),kt.setAttribute("name","t"),Ct.appendChild(kt),m.checkClone=Ct.cloneNode(!0).cloneNode(!0).lastChild.checked,Ct.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!Ct.cloneNode(!0).lastChild.defaultValue,Ct.innerHTML="<option></option>",m.option=!!Ct.lastChild;var Bt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function It(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&T(t,e)?S.merge([t],i):i}function Pt(t,e){for(var i=0,s=t.length;i<s;i++)ot.set(t[i],"globalEval",!e||ot.get(e[i],"globalEval"))}Bt.tbody=Bt.tfoot=Bt.colgroup=Bt.caption=Bt.thead,Bt.th=Bt.td,m.option||(Bt.optgroup=Bt.option=[1,"<select multiple='multiple'>","</select>"]);var _t=/<|&#?\w+;/;function Dt(t,e,i,s,n){for(var r,a,o,l,c,h,u=e.createDocumentFragment(),d=[],p=0,f=t.length;p<f;p++)if((r=t[p])||0===r)if("object"===x(r))S.merge(d,r.nodeType?[r]:r);else if(_t.test(r)){for(a=a||u.appendChild(e.createElement("div")),o=(Et.exec(r)||["",""])[1].toLowerCase(),l=Bt[o]||Bt._default,a.innerHTML=l[1]+S.htmlPrefilter(r)+l[2],h=l[0];h--;)a=a.lastChild;S.merge(d,a.childNodes),(a=u.firstChild).textContent=""}else d.push(e.createTextNode(r));for(u.textContent="",p=0;r=d[p++];)if(s&&S.inArray(r,s)>-1)n&&n.push(r);else if(c=mt(r),a=It(u.appendChild(r),"script"),c&&Pt(a),i)for(h=0;r=a[h++];)Tt.test(r.type||"")&&i.push(r);return u}var Rt=/^([^.]*)(?:\.(.+)|)/;function Ot(){return!0}function Mt(){return!1}function Nt(t,e,i,s,n,r){var a,o;if("object"==typeof e){for(o in"string"!=typeof i&&(s=s||i,i=void 0),e)Nt(t,o,i,s,e[o],r);return t}if(null==s&&null==n?(n=i,s=i=void 0):null==n&&("string"==typeof i?(n=s,s=void 0):(n=s,s=i,i=void 0)),!1===n)n=Mt;else if(!n)return t;return 1===r&&(a=n,n=function(t){return S().off(t),a.apply(this,arguments)},n.guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,n,s,i)}))}function $t(t,e,i){i?(ot.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var i,s=ot.get(this,e);if(1&t.isTrigger&&this[e]){if(s)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=o.call(arguments),ot.set(this,e,s),this[e](),i=ot.get(this,e),ot.set(this,e,!1),s!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else s&&(ot.set(this,e,S.event.trigger(s[0],s.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Ot)}})):void 0===ot.get(t,e)&&S.event.add(t,e,Ot)}S.event={global:{},add:function(t,e,i,s,n){var r,a,o,l,c,h,u,d,p,f,g,m=ot.get(t);if(rt(t))for(i.handler&&(i=(r=i).handler,n=r.selector),n&&S.find.matchesSelector(gt,n),i.guid||(i.guid=S.guid++),(l=m.events)||(l=m.events=Object.create(null)),(a=m.handle)||(a=m.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(G)||[""]).length;c--;)p=g=(o=Rt.exec(e[c])||[])[1],f=(o[2]||"").split(".").sort(),p&&(u=S.event.special[p]||{},p=(n?u.delegateType:u.bindType)||p,u=S.event.special[p]||{},h=S.extend({type:p,origType:g,data:s,handler:i,guid:i.guid,selector:n,needsContext:n&&S.expr.match.needsContext.test(n),namespace:f.join(".")},r),(d=l[p])||((d=l[p]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,s,f,a)||t.addEventListener&&t.addEventListener(p,a)),u.add&&(u.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),n?d.splice(d.delegateCount++,0,h):d.push(h),S.event.global[p]=!0)},remove:function(t,e,i,s,n){var r,a,o,l,c,h,u,d,p,f,g,m=ot.hasData(t)&&ot.get(t);if(m&&(l=m.events)){for(c=(e=(e||"").match(G)||[""]).length;c--;)if(p=g=(o=Rt.exec(e[c])||[])[1],f=(o[2]||"").split(".").sort(),p){for(u=S.event.special[p]||{},d=l[p=(s?u.delegateType:u.bindType)||p]||[],o=o[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=r=d.length;r--;)h=d[r],!n&&g!==h.origType||i&&i.guid!==h.guid||o&&!o.test(h.namespace)||s&&s!==h.selector&&("**"!==s||!h.selector)||(d.splice(r,1),h.selector&&d.delegateCount--,u.remove&&u.remove.call(t,h));a&&!d.length&&(u.teardown&&!1!==u.teardown.call(t,f,m.handle)||S.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[c],i,s,!0);S.isEmptyObject(l)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,i,s,n,r,a,o=new Array(arguments.length),l=S.event.fix(t),c=(ot.get(this,"events")||Object.create(null))[l.type]||[],h=S.event.special[l.type]||{};for(o[0]=l,e=1;e<arguments.length;e++)o[e]=arguments[e];if(l.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,l)){for(a=S.event.handlers.call(this,l,c),e=0;(n=a[e++])&&!l.isPropagationStopped();)for(l.currentTarget=n.elem,i=0;(r=n.handlers[i++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==r.namespace&&!l.rnamespace.test(r.namespace)||(l.handleObj=r,l.data=r.data,void 0!==(s=((S.event.special[r.origType]||{}).handle||r.handler).apply(n.elem,o))&&!1===(l.result=s)&&(l.preventDefault(),l.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,l),l.result}},handlers:function(t,e){var i,s,n,r,a,o=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(r=[],a={},i=0;i<l;i++)void 0===a[n=(s=e[i]).selector+" "]&&(a[n]=s.needsContext?S(n,this).index(c)>-1:S.find(n,this,null,[c]).length),a[n]&&r.push(s);r.length&&o.push({elem:c,handlers:r})}return c=this,l<e.length&&o.push({elem:c,handlers:e.slice(l)}),o},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[S.expando]?t:new S.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return St.test(e.type)&&e.click&&T(e,"input")&&$t(e,"click",!0),!1},trigger:function(t){var e=this||t;return St.test(e.type)&&e.click&&T(e,"input")&&$t(e,"click"),!0},_default:function(t){var e=t.target;return St.test(e.type)&&e.click&&T(e,"input")&&ot.get(e,"click")||T(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},S.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},S.Event=function(t,e){if(!(this instanceof S.Event))return new S.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Ot:Mt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&S.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Mt,isPropagationStopped:Mt,isImmediatePropagationStopped:Mt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Ot,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Ot,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Ot,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(t,e){function i(t){if(y.documentMode){var i=ot.get(this,"handle"),s=S.event.fix(t);s.type="focusin"===t.type?"focus":"blur",s.isSimulated=!0,i(t),s.target===s.currentTarget&&i(s)}else S.event.simulate(e,t.target,S.event.fix(t))}S.event.special[t]={setup:function(){var s;if($t(this,t,!0),!y.documentMode)return!1;(s=ot.get(this,e))||this.addEventListener(e,i),ot.set(this,e,(s||0)+1)},trigger:function(){return $t(this,t),!0},teardown:function(){var t;if(!y.documentMode)return!1;(t=ot.get(this,e)-1)?ot.set(this,e,t):(this.removeEventListener(e,i),ot.remove(this,e))},_default:function(e){return ot.get(e.target,t)},delegateType:e},S.event.special[e]={setup:function(){var s=this.ownerDocument||this.document||this,n=y.documentMode?this:s,r=ot.get(n,e);r||(y.documentMode?this.addEventListener(e,i):s.addEventListener(t,i,!0)),ot.set(n,e,(r||0)+1)},teardown:function(){var s=this.ownerDocument||this.document||this,n=y.documentMode?this:s,r=ot.get(n,e)-1;r?ot.set(n,e,r):(y.documentMode?this.removeEventListener(e,i):s.removeEventListener(t,i,!0),ot.remove(n,e))}}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){S.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,s=t.relatedTarget,n=t.handleObj;return s&&(s===this||S.contains(this,s))||(t.type=n.origType,i=n.handler.apply(this,arguments),t.type=e),i}}})),S.fn.extend({on:function(t,e,i,s){return Nt(this,t,e,i,s)},one:function(t,e,i,s){return Nt(this,t,e,i,s,1)},off:function(t,e,i){var s,n;if(t&&t.preventDefault&&t.handleObj)return s=t.handleObj,S(t.delegateTarget).off(s.namespace?s.origType+"."+s.namespace:s.origType,s.selector,s.handler),this;if("object"==typeof t){for(n in t)this.off(n,e,t[n]);return this}return!1!==e&&"function"!=typeof e||(i=e,e=void 0),!1===i&&(i=Mt),this.each((function(){S.event.remove(this,t,i,e)}))}});var Vt=/<script|<style|<link/i,qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Lt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function jt(t,e){return T(t,"table")&&T(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ft(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function zt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ut(t,e){var i,s,n,r,a,o;if(1===e.nodeType){if(ot.hasData(t)&&(o=ot.get(t).events))for(n in ot.remove(e,"handle events"),o)for(i=0,s=o[n].length;i<s;i++)S.event.add(e,n,o[n][i]);lt.hasData(t)&&(r=lt.access(t),a=S.extend({},r),lt.set(e,a))}}function Ht(t,e){var i=e.nodeName.toLowerCase();"input"===i&&St.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function Wt(t,e,i,s){e=l(e);var n,r,a,o,c,h,u=0,d=t.length,p=d-1,f=e[0],g=v(f);if(g||d>1&&"string"==typeof f&&!m.checkClone&&qt.test(f))return t.each((function(n){var r=t.eq(n);g&&(e[0]=f.call(this,n,r.html())),Wt(r,e,i,s)}));if(d&&(r=(n=Dt(e,t[0].ownerDocument,!1,t,s)).firstChild,1===n.childNodes.length&&(n=r),r||s)){for(o=(a=S.map(It(n,"script"),Ft)).length;u<d;u++)c=n,u!==p&&(c=S.clone(c,!0,!0),o&&S.merge(a,It(c,"script"))),i.call(t[u],c,u);if(o)for(h=a[a.length-1].ownerDocument,S.map(a,zt),u=0;u<o;u++)c=a[u],Tt.test(c.type||"")&&!ot.access(c,"globalEval")&&S.contains(h,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?S._evalUrl&&!c.noModule&&S._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},h):A(c.textContent.replace(Lt,""),c,h))}return t}function Gt(t,e,i){for(var s,n=e?S.filter(e,t):t,r=0;null!=(s=n[r]);r++)i||1!==s.nodeType||S.cleanData(It(s)),s.parentNode&&(i&&mt(s)&&Pt(It(s,"script")),s.parentNode.removeChild(s));return t}S.extend({htmlPrefilter:function(t){return t},clone:function(t,e,i){var s,n,r,a,o=t.cloneNode(!0),l=mt(t);if(!(m.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||S.isXMLDoc(t)))for(a=It(o),s=0,n=(r=It(t)).length;s<n;s++)Ht(r[s],a[s]);if(e)if(i)for(r=r||It(t),a=a||It(o),s=0,n=r.length;s<n;s++)Ut(r[s],a[s]);else Ut(t,o);return(a=It(o,"script")).length>0&&Pt(a,!l&&It(t,"script")),o},cleanData:function(t){for(var e,i,s,n=S.event.special,r=0;void 0!==(i=t[r]);r++)if(rt(i)){if(e=i[ot.expando]){if(e.events)for(s in e.events)n[s]?S.event.remove(i,s):S.removeEvent(i,s,e.handle);i[ot.expando]=void 0}i[lt.expando]&&(i[lt.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Gt(this,t,!0)},remove:function(t){return Gt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||jt(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=jt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(It(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},i=0,s=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Vt.test(t)&&!Bt[(Et.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;i<s;i++)1===(e=this[i]||{}).nodeType&&(S.cleanData(It(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Wt(this,arguments,(function(e){var i=this.parentNode;S.inArray(this,t)<0&&(S.cleanData(It(this)),i&&i.replaceChild(e,this))}),t)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){S.fn[t]=function(t){for(var i,s=[],n=S(t),r=n.length-1,a=0;a<=r;a++)i=a===r?this:this.clone(!0),S(n[a])[e](i),c.apply(s,i.get());return this.pushStack(s)}}));var Jt=new RegExp("^("+dt+")(?!px)[a-z%]+$","i"),Kt=/^--/,Zt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=s),e.getComputedStyle(t)},Yt=function(t,e,i){var s,n,r={};for(n in e)r[n]=t.style[n],t.style[n]=e[n];for(n in s=i.call(t),e)t.style[n]=r[n];return s},Qt=new RegExp(ft.join("|"),"i");function Xt(t,e,i){var s,n,r,a,o=Kt.test(e),l=t.style;return(i=i||Zt(t))&&(a=i.getPropertyValue(e)||i[e],o&&a&&(a=a.replace(D,"$1")||void 0),""!==a||mt(t)||(a=S.style(t,e)),!m.pixelBoxStyles()&&Jt.test(a)&&Qt.test(e)&&(s=l.width,n=l.minWidth,r=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=i.width,l.width=s,l.minWidth=n,l.maxWidth=r)),void 0!==a?a+"":a}function te(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(h){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",gt.appendChild(c).appendChild(h);var t=s.getComputedStyle(h);i="1%"!==t.top,l=12===e(t.marginLeft),h.style.right="60%",a=36===e(t.right),n=36===e(t.width),h.style.position="absolute",r=12===e(h.offsetWidth/3),gt.removeChild(c),h=null}}function e(t){return Math.round(parseFloat(t))}var i,n,r,a,o,l,c=y.createElement("div"),h=y.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===h.style.backgroundClip,S.extend(m,{boxSizingReliable:function(){return t(),n},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),r},reliableTrDimensions:function(){var t,e,i,n;return null==o&&(t=y.createElement("table"),e=y.createElement("tr"),i=y.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="box-sizing:content-box;border:1px solid",e.style.height="1px",i.style.height="9px",i.style.display="block",gt.appendChild(t).appendChild(e).appendChild(i),n=s.getComputedStyle(e),o=parseInt(n.height,10)+parseInt(n.borderTopWidth,10)+parseInt(n.borderBottomWidth,10)===e.offsetHeight,gt.removeChild(t)),o}}))}();var ee=["Webkit","Moz","ms"],ie=y.createElement("div").style,se={};function ne(t){var e=S.cssProps[t]||se[t];return e||(t in ie?t:se[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),i=ee.length;i--;)if((t=ee[i]+e)in ie)return t}(t)||t)}var re=/^(none|table(?!-c[ea]).+)/,ae={position:"absolute",visibility:"hidden",display:"block"},oe={letterSpacing:"0",fontWeight:"400"};function le(t,e,i){var s=pt.exec(e);return s?Math.max(0,s[2]-(i||0))+(s[3]||"px"):e}function ce(t,e,i,s,n,r){var a="width"===e?1:0,o=0,l=0,c=0;if(i===(s?"border":"content"))return 0;for(;a<4;a+=2)"margin"===i&&(c+=S.css(t,i+ft[a],!0,n)),s?("content"===i&&(l-=S.css(t,"padding"+ft[a],!0,n)),"margin"!==i&&(l-=S.css(t,"border"+ft[a]+"Width",!0,n))):(l+=S.css(t,"padding"+ft[a],!0,n),"padding"!==i?l+=S.css(t,"border"+ft[a]+"Width",!0,n):o+=S.css(t,"border"+ft[a]+"Width",!0,n));return!s&&r>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-r-l-o-.5))||0),l+c}function he(t,e,i){var s=Zt(t),n=(!m.boxSizingReliable()||i)&&"border-box"===S.css(t,"boxSizing",!1,s),r=n,a=Xt(t,e,s),o="offset"+e[0].toUpperCase()+e.slice(1);if(Jt.test(a)){if(!i)return a;a="auto"}return(!m.boxSizingReliable()&&n||!m.reliableTrDimensions()&&T(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(t,"display",!1,s))&&t.getClientRects().length&&(n="border-box"===S.css(t,"boxSizing",!1,s),(r=o in t)&&(a=t[o])),(a=parseFloat(a)||0)+ce(t,e,i||(n?"border":"content"),r,s,a)+"px"}function ue(t,e,i,s,n){return new ue.prototype.init(t,e,i,s,n)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Xt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,s){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var n,r,a,o=nt(e),l=Kt.test(e),c=t.style;if(l||(e=ne(o)),a=S.cssHooks[e]||S.cssHooks[o],void 0===i)return a&&"get"in a&&void 0!==(n=a.get(t,!1,s))?n:c[e];"string"===(r=typeof i)&&(n=pt.exec(i))&&n[1]&&(i=yt(t,e,n),r="number"),null!=i&&i==i&&("number"!==r||l||(i+=n&&n[3]||(S.cssNumber[o]?"":"px")),m.clearCloneStyle||""!==i||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(i=a.set(t,i,s))||(l?c.setProperty(e,i):c[e]=i))}},css:function(t,e,i,s){var n,r,a,o=nt(e);return Kt.test(e)||(e=ne(o)),(a=S.cssHooks[e]||S.cssHooks[o])&&"get"in a&&(n=a.get(t,!0,i)),void 0===n&&(n=Xt(t,e,s)),"normal"===n&&e in oe&&(n=oe[e]),""===i||i?(r=parseFloat(n),!0===i||isFinite(r)?r||0:n):n}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,i,s){if(i)return!re.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?he(t,e,s):Yt(t,ae,(function(){return he(t,e,s)}))},set:function(t,i,s){var n,r=Zt(t),a=!m.scrollboxSize()&&"absolute"===r.position,o=(a||s)&&"border-box"===S.css(t,"boxSizing",!1,r),l=s?ce(t,e,s,o,r):0;return o&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(r[e])-ce(t,e,"border",!1,r)-.5)),l&&(n=pt.exec(i))&&"px"!==(n[3]||"px")&&(t.style[e]=i,i=S.css(t,e)),le(0,i,l)}}})),S.cssHooks.marginLeft=te(m.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Xt(t,"marginLeft"))||t.getBoundingClientRect().left-Yt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(i){for(var s=0,n={},r="string"==typeof i?i.split(" "):[i];s<4;s++)n[t+ft[s]+e]=r[s]||r[s-2]||r[0];return n}},"margin"!==t&&(S.cssHooks[t+e].set=le)})),S.fn.extend({css:function(t,e){return tt(this,(function(t,e,i){var s,n,r={},a=0;if(Array.isArray(e)){for(s=Zt(t),n=e.length;a<n;a++)r[e[a]]=S.css(t,e[a],!1,s);return r}return void 0!==i?S.style(t,e,i):S.css(t,e)}),t,e,arguments.length>1)}}),S.Tween=ue,ue.prototype={constructor:ue,init:function(t,e,i,s,n,r){this.elem=t,this.prop=i,this.easing=n||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=s,this.unit=r||(S.cssNumber[i]?"":"px")},cur:function(){var t=ue.propHooks[this.prop];return t&&t.get?t.get(this):ue.propHooks._default.get(this)},run:function(t){var e,i=ue.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):ue.propHooks._default.set(this),this}},ue.prototype.init.prototype=ue.prototype,ue.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[ne(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},ue.propHooks.scrollTop=ue.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=ue.prototype.init,S.fx.step={};var de,pe,fe=/^(?:toggle|show|hide)$/,ge=/queueHooks$/;function me(){pe&&(!1===y.hidden&&s.requestAnimationFrame?s.requestAnimationFrame(me):s.setTimeout(me,S.fx.interval),S.fx.tick())}function ve(){return s.setTimeout((function(){de=void 0})),de=Date.now()}function be(t,e){var i,s=0,n={height:t};for(e=e?1:0;s<4;s+=2-e)n["margin"+(i=ft[s])]=n["padding"+i]=t;return e&&(n.opacity=n.width=t),n}function ye(t,e,i){for(var s,n=(we.tweeners[e]||[]).concat(we.tweeners["*"]),r=0,a=n.length;r<a;r++)if(s=n[r].call(i,e,t))return s}function we(t,e,i){var s,n,r=0,a=we.prefilters.length,o=S.Deferred().always((function(){delete l.elem})),l=function(){if(n)return!1;for(var e=de||ve(),i=Math.max(0,c.startTime+c.duration-e),s=1-(i/c.duration||0),r=0,a=c.tweens.length;r<a;r++)c.tweens[r].run(s);return o.notifyWith(t,[c,s,i]),s<1&&a?i:(a||o.notifyWith(t,[c,1,0]),o.resolveWith(t,[c]),!1)},c=o.promise({elem:t,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},i),originalProperties:e,originalOptions:i,startTime:de||ve(),duration:i.duration,tweens:[],createTween:function(e,i){var s=S.Tween(t,c.opts,e,i,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(s),s},stop:function(e){var i=0,s=e?c.tweens.length:0;if(n)return this;for(n=!0;i<s;i++)c.tweens[i].run(1);return e?(o.notifyWith(t,[c,1,0]),o.resolveWith(t,[c,e])):o.rejectWith(t,[c,e]),this}}),h=c.props;for(!function(t,e){var i,s,n,r,a;for(i in t)if(n=e[s=nt(i)],r=t[i],Array.isArray(r)&&(n=r[1],r=t[i]=r[0]),i!==s&&(t[s]=r,delete t[i]),(a=S.cssHooks[s])&&"expand"in a)for(i in r=a.expand(r),delete t[s],r)i in t||(t[i]=r[i],e[i]=n);else e[s]=n}(h,c.opts.specialEasing);r<a;r++)if(s=we.prefilters[r].call(c,t,h,c.opts))return v(s.stop)&&(S._queueHooks(c.elem,c.opts.queue).stop=s.stop.bind(s)),s;return S.map(h,ye,c),v(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),S.fx.timer(S.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}S.Animation=S.extend(we,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return yt(i.elem,t,pt.exec(e),i),i}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(G);for(var i,s=0,n=t.length;s<n;s++)i=t[s],we.tweeners[i]=we.tweeners[i]||[],we.tweeners[i].unshift(e)},prefilters:[function(t,e,i){var s,n,r,a,o,l,c,h,u="width"in e||"height"in e,d=this,p={},f=t.style,g=t.nodeType&&bt(t),m=ot.get(t,"fxshow");for(s in i.queue||(null==(a=S._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,o=a.empty.fire,a.empty.fire=function(){a.unqueued||o()}),a.unqueued++,d.always((function(){d.always((function(){a.unqueued--,S.queue(t,"fx").length||a.empty.fire()}))}))),e)if(n=e[s],fe.test(n)){if(delete e[s],r=r||"toggle"===n,n===(g?"hide":"show")){if("show"!==n||!m||void 0===m[s])continue;g=!0}p[s]=m&&m[s]||S.style(t,s)}if((l=!S.isEmptyObject(e))||!S.isEmptyObject(p))for(s in u&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=m&&m.display)&&(c=ot.get(t,"display")),"none"===(h=S.css(t,"display"))&&(c?h=c:(xt([t],!0),c=t.style.display||c,h=S.css(t,"display"),xt([t]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===S.css(t,"float")&&(l||(d.done((function(){f.display=c})),null==c&&(h=f.display,c="none"===h?"":h)),f.display="inline-block")),i.overflow&&(f.overflow="hidden",d.always((function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]}))),l=!1,p)l||(m?"hidden"in m&&(g=m.hidden):m=ot.access(t,"fxshow",{display:c}),r&&(m.hidden=!g),g&&xt([t],!0),d.done((function(){for(s in g||xt([t]),ot.remove(t,"fxshow"),p)S.style(t,s,p[s])}))),l=ye(g?m[s]:0,s,d),s in m||(m[s]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?we.prefilters.unshift(t):we.prefilters.push(t)}}),S.speed=function(t,e,i){var s=t&&"object"==typeof t?S.extend({},t):{complete:i||!i&&e||v(t)&&t,duration:t,easing:i&&e||e&&!v(e)&&e};return S.fx.off?s.duration=0:"number"!=typeof s.duration&&(s.duration in S.fx.speeds?s.duration=S.fx.speeds[s.duration]:s.duration=S.fx.speeds._default),null!=s.queue&&!0!==s.queue||(s.queue="fx"),s.old=s.complete,s.complete=function(){v(s.old)&&s.old.call(this),s.queue&&S.dequeue(this,s.queue)},s},S.fn.extend({fadeTo:function(t,e,i,s){return this.filter(bt).css("opacity",0).show().end().animate({opacity:e},t,i,s)},animate:function(t,e,i,s){var n=S.isEmptyObject(t),r=S.speed(e,i,s),a=function(){var e=we(this,S.extend({},t),r);(n||ot.get(this,"finish"))&&e.stop(!0)};return a.finish=a,n||!1===r.queue?this.each(a):this.queue(r.queue,a)},stop:function(t,e,i){var s=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,n=null!=t&&t+"queueHooks",r=S.timers,a=ot.get(this);if(n)a[n]&&a[n].stop&&s(a[n]);else for(n in a)a[n]&&a[n].stop&&ge.test(n)&&s(a[n]);for(n=r.length;n--;)r[n].elem!==this||null!=t&&r[n].queue!==t||(r[n].anim.stop(i),e=!1,r.splice(n,1));!e&&i||S.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,i=ot.get(this),s=i[t+"queue"],n=i[t+"queueHooks"],r=S.timers,a=s?s.length:0;for(i.finish=!0,S.queue(this,t,[]),n&&n.stop&&n.stop.call(this,!0),e=r.length;e--;)r[e].elem===this&&r[e].queue===t&&(r[e].anim.stop(!0),r.splice(e,1));for(e=0;e<a;e++)s[e]&&s[e].finish&&s[e].finish.call(this);delete i.finish}))}}),S.each(["toggle","show","hide"],(function(t,e){var i=S.fn[e];S.fn[e]=function(t,s,n){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(be(e,!0),t,s,n)}})),S.each({slideDown:be("show"),slideUp:be("hide"),slideToggle:be("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){S.fn[t]=function(t,i,s){return this.animate(e,t,i,s)}})),S.timers=[],S.fx.tick=function(){var t,e=0,i=S.timers;for(de=Date.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||S.fx.stop(),de=void 0},S.fx.timer=function(t){S.timers.push(t),S.fx.start()},S.fx.interval=13,S.fx.start=function(){pe||(pe=!0,me())},S.fx.stop=function(){pe=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,e){return t=S.fx&&S.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,i){var n=s.setTimeout(e,t);i.stop=function(){s.clearTimeout(n)}}))},function(){var t=y.createElement("input"),e=y.createElement("select").appendChild(y.createElement("option"));t.type="checkbox",m.checkOn=""!==t.value,m.optSelected=e.selected,(t=y.createElement("input")).value="t",t.type="radio",m.radioValue="t"===t.value}();var Ae,xe=S.expr.attrHandle;S.fn.extend({attr:function(t,e){return tt(this,S.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,i){var s,n,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===t.getAttribute?S.prop(t,e,i):(1===r&&S.isXMLDoc(t)||(n=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?Ae:void 0)),void 0!==i?null===i?void S.removeAttr(t,e):n&&"set"in n&&void 0!==(s=n.set(t,i,e))?s:(t.setAttribute(e,i+""),i):n&&"get"in n&&null!==(s=n.get(t,e))?s:null==(s=S.find.attr(t,e))?void 0:s)},attrHooks:{type:{set:function(t,e){if(!m.radioValue&&"radio"===e&&T(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,s=0,n=e&&e.match(G);if(n&&1===t.nodeType)for(;i=n[s++];)t.removeAttribute(i)}}),Ae={set:function(t,e,i){return!1===e?S.removeAttr(t,i):t.setAttribute(i,i),i}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var i=xe[e]||S.find.attr;xe[e]=function(t,e,s){var n,r,a=e.toLowerCase();return s||(r=xe[a],xe[a]=n,n=null!=i(t,e,s)?a:null,xe[a]=r),n}}));var Ce=/^(?:input|select|textarea|button)$/i,ke=/^(?:a|area)$/i;function Se(t){return(t.match(G)||[]).join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function Te(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(G)||[]}S.fn.extend({prop:function(t,e){return tt(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,i){var s,n,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&S.isXMLDoc(t)||(e=S.propFix[e]||e,n=S.propHooks[e]),void 0!==i?n&&"set"in n&&void 0!==(s=n.set(t,i,e))?s:t[e]=i:n&&"get"in n&&null!==(s=n.get(t,e))?s:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):Ce.test(t.nodeName)||ke.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,i,s,n,r,a;return v(t)?this.each((function(e){S(this).addClass(t.call(this,e,Ee(this)))})):(e=Te(t)).length?this.each((function(){if(s=Ee(this),i=1===this.nodeType&&" "+Se(s)+" "){for(r=0;r<e.length;r++)n=e[r],i.indexOf(" "+n+" ")<0&&(i+=n+" ");a=Se(i),s!==a&&this.setAttribute("class",a)}})):this},removeClass:function(t){var e,i,s,n,r,a;return v(t)?this.each((function(e){S(this).removeClass(t.call(this,e,Ee(this)))})):arguments.length?(e=Te(t)).length?this.each((function(){if(s=Ee(this),i=1===this.nodeType&&" "+Se(s)+" "){for(r=0;r<e.length;r++)for(n=e[r];i.indexOf(" "+n+" ")>-1;)i=i.replace(" "+n+" "," ");a=Se(i),s!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(t,e){var i,s,n,r,a=typeof t,o="string"===a||Array.isArray(t);return v(t)?this.each((function(i){S(this).toggleClass(t.call(this,i,Ee(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(t):this.removeClass(t):(i=Te(t),this.each((function(){if(o)for(r=S(this),n=0;n<i.length;n++)s=i[n],r.hasClass(s)?r.removeClass(s):r.addClass(s);else void 0!==t&&"boolean"!==a||((s=Ee(this))&&ot.set(this,"__className__",s),this.setAttribute&&this.setAttribute("class",s||!1===t?"":ot.get(this,"__className__")||""))})))},hasClass:function(t){var e,i,s=0;for(e=" "+t+" ";i=this[s++];)if(1===i.nodeType&&(" "+Se(Ee(i))+" ").indexOf(e)>-1)return!0;return!1}});var Be=/\r/g;S.fn.extend({val:function(t){var e,i,s,n=this[0];return arguments.length?(s=v(t),this.each((function(i){var n;1===this.nodeType&&(null==(n=s?t.call(this,i,S(this).val()):t)?n="":"number"==typeof n?n+="":Array.isArray(n)&&(n=S.map(n,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,n,"value")||(this.value=n))}))):n?(e=S.valHooks[n.type]||S.valHooks[n.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(n,"value"))?i:"string"==typeof(i=n.value)?i.replace(Be,""):null==i?"":i:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:Se(S.text(t))}},select:{get:function(t){var e,i,s,n=t.options,r=t.selectedIndex,a="select-one"===t.type,o=a?null:[],l=a?r+1:n.length;for(s=r<0?l:a?r:0;s<l;s++)if(((i=n[s]).selected||s===r)&&!i.disabled&&(!i.parentNode.disabled||!T(i.parentNode,"optgroup"))){if(e=S(i).val(),a)return e;o.push(e)}return o},set:function(t,e){for(var i,s,n=t.options,r=S.makeArray(e),a=n.length;a--;)((s=n[a]).selected=S.inArray(S.valHooks.option.get(s),r)>-1)&&(i=!0);return i||(t.selectedIndex=-1),r}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},m.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Ie=s.location,Pe={guid:Date.now()},_e=/\?/;S.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{e=(new s.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=e&&e.getElementsByTagName("parsererror")[0],e&&!i||S.error("Invalid XML: "+(i?S.map(i.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var De=/^(?:focusinfocus|focusoutblur)$/,Re=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,i,n){var r,a,o,l,c,h,u,d,f=[i||y],g=p.call(t,"type")?t.type:t,m=p.call(t,"namespace")?t.namespace.split("."):[];if(a=d=o=i=i||y,3!==i.nodeType&&8!==i.nodeType&&!De.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),c=g.indexOf(":")<0&&"on"+g,(t=t[S.expando]?t:new S.Event(g,"object"==typeof t&&t)).isTrigger=n?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:S.makeArray(e,[t]),u=S.event.special[g]||{},n||!u.trigger||!1!==u.trigger.apply(i,e))){if(!n&&!u.noBubble&&!b(i)){for(l=u.delegateType||g,De.test(l+g)||(a=a.parentNode);a;a=a.parentNode)f.push(a),o=a;o===(i.ownerDocument||y)&&f.push(o.defaultView||o.parentWindow||s)}for(r=0;(a=f[r++])&&!t.isPropagationStopped();)d=a,t.type=r>1?l:u.bindType||g,(h=(ot.get(a,"events")||Object.create(null))[t.type]&&ot.get(a,"handle"))&&h.apply(a,e),(h=c&&a[c])&&h.apply&&rt(a)&&(t.result=h.apply(a,e),!1===t.result&&t.preventDefault());return t.type=g,n||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(f.pop(),e)||!rt(i)||c&&v(i[g])&&!b(i)&&((o=i[c])&&(i[c]=null),S.event.triggered=g,t.isPropagationStopped()&&d.addEventListener(g,Re),i[g](),t.isPropagationStopped()&&d.removeEventListener(g,Re),S.event.triggered=void 0,o&&(i[c]=o)),t.result}},simulate:function(t,e,i){var s=S.extend(new S.Event,i,{type:t,isSimulated:!0});S.event.trigger(s,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var i=this[0];if(i)return S.event.trigger(t,e,i,!0)}});var Oe=/\[\]$/,Me=/\r?\n/g,Ne=/^(?:submit|button|image|reset|file)$/i,$e=/^(?:input|select|textarea|keygen)/i;function Ve(t,e,i,s){var n;if(Array.isArray(e))S.each(e,(function(e,n){i||Oe.test(t)?s(t,n):Ve(t+"["+("object"==typeof n&&null!=n?e:"")+"]",n,i,s)}));else if(i||"object"!==x(e))s(t,e);else for(n in e)Ve(t+"["+n+"]",e[n],i,s)}S.param=function(t,e){var i,s=[],n=function(t,e){var i=v(e)?e():e;s[s.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){n(this.name,this.value)}));else for(i in t)Ve(i,t[i],e,n);return s.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&$e.test(this.nodeName)&&!Ne.test(t)&&(this.checked||!St.test(t))})).map((function(t,e){var i=S(this).val();return null==i?null:Array.isArray(i)?S.map(i,(function(t){return{name:e.name,value:t.replace(Me,"\r\n")}})):{name:e.name,value:i.replace(Me,"\r\n")}})).get()}});var qe=/%20/g,Le=/#.*$/,je=/([?&])_=[^&]*/,Fe=/^(.*?):[ \t]*([^\r\n]*)$/gm,ze=/^(?:GET|HEAD)$/,Ue=/^\/\//,He={},We={},Ge="*/".concat("*"),Je=y.createElement("a");function Ke(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var s,n=0,r=e.toLowerCase().match(G)||[];if(v(i))for(;s=r[n++];)"+"===s[0]?(s=s.slice(1)||"*",(t[s]=t[s]||[]).unshift(i)):(t[s]=t[s]||[]).push(i)}}function Ze(t,e,i,s){var n={},r=t===We;function a(o){var l;return n[o]=!0,S.each(t[o]||[],(function(t,o){var c=o(e,i,s);return"string"!=typeof c||r||n[c]?r?!(l=c):void 0:(e.dataTypes.unshift(c),a(c),!1)})),l}return a(e.dataTypes[0])||!n["*"]&&a("*")}function Ye(t,e){var i,s,n=S.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((n[i]?t:s||(s={}))[i]=e[i]);return s&&S.extend(!0,t,s),t}Je.href=Ie.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ie.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ie.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ge,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ye(Ye(t,S.ajaxSettings),e):Ye(S.ajaxSettings,t)},ajaxPrefilter:Ke(He),ajaxTransport:Ke(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,n,r,a,o,l,c,h,u,d,p=S.ajaxSetup({},e),f=p.context||p,g=p.context&&(f.nodeType||f.jquery)?S(f):S.event,m=S.Deferred(),v=S.Callbacks("once memory"),b=p.statusCode||{},w={},A={},x="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Fe.exec(r);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?r:null},setRequestHeader:function(t,e){return null==c&&(t=A[t.toLowerCase()]=A[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)C.always(t[C.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return i&&i.abort(e),k(0,e),this}};if(m.promise(C),p.url=((t||p.url||Ie.href)+"").replace(Ue,Ie.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(G)||[""],null==p.crossDomain){l=y.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Je.protocol+"//"+Je.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),Ze(He,p,e,C),c)return C;for(u in(h=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!ze.test(p.type),n=p.url.replace(Le,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(qe,"+")):(d=p.url.slice(n.length),p.data&&(p.processData||"string"==typeof p.data)&&(n+=(_e.test(n)?"&":"?")+p.data,delete p.data),!1===p.cache&&(n=n.replace(je,"$1"),d=(_e.test(n)?"&":"?")+"_="+Pe.guid+++d),p.url=n+d),p.ifModified&&(S.lastModified[n]&&C.setRequestHeader("If-Modified-Since",S.lastModified[n]),S.etag[n]&&C.setRequestHeader("If-None-Match",S.etag[n])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ge+"; q=0.01":""):p.accepts["*"]),p.headers)C.setRequestHeader(u,p.headers[u]);if(p.beforeSend&&(!1===p.beforeSend.call(f,C,p)||c))return C.abort();if(x="abort",v.add(p.complete),C.done(p.success),C.fail(p.error),i=Ze(We,p,e,C)){if(C.readyState=1,h&&g.trigger("ajaxSend",[C,p]),c)return C;p.async&&p.timeout>0&&(o=s.setTimeout((function(){C.abort("timeout")}),p.timeout));try{c=!1,i.send(w,k)}catch(t){if(c)throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,a,l){var u,d,y,w,A,x=e;c||(c=!0,o&&s.clearTimeout(o),i=void 0,r=l||"",C.readyState=t>0?4:0,u=t>=200&&t<300||304===t,a&&(w=function(t,e,i){for(var s,n,r,a,o=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===s&&(s=t.mimeType||e.getResponseHeader("Content-Type"));if(s)for(n in o)if(o[n]&&o[n].test(s)){l.unshift(n);break}if(l[0]in i)r=l[0];else{for(n in i){if(!l[0]||t.converters[n+" "+l[0]]){r=n;break}a||(a=n)}r=r||a}if(r)return r!==l[0]&&l.unshift(r),i[r]}(p,C,a)),!u&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(t,e,i,s){var n,r,a,o,l,c={},h=t.dataTypes.slice();if(h[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(r=h.shift();r;)if(t.responseFields[r]&&(i[t.responseFields[r]]=e),!l&&s&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=r,r=h.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(!(a=c[l+" "+r]||c["* "+r]))for(n in c)if((o=n.split(" "))[1]===r&&(a=c[l+" "+o[0]]||c["* "+o[0]])){!0===a?a=c[n]:!0!==c[n]&&(r=o[0],h.unshift(o[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+r}}}return{state:"success",data:e}}(p,w,C,u),u?(p.ifModified&&((A=C.getResponseHeader("Last-Modified"))&&(S.lastModified[n]=A),(A=C.getResponseHeader("etag"))&&(S.etag[n]=A)),204===t||"HEAD"===p.type?x="nocontent":304===t?x="notmodified":(x=w.state,d=w.data,u=!(y=w.error))):(y=x,!t&&x||(x="error",t<0&&(t=0))),C.status=t,C.statusText=(e||x)+"",u?m.resolveWith(f,[d,x,C]):m.rejectWith(f,[C,x,y]),C.statusCode(b),b=void 0,h&&g.trigger(u?"ajaxSuccess":"ajaxError",[C,p,u?d:y]),v.fireWith(f,[C,x]),h&&(g.trigger("ajaxComplete",[C,p]),--S.active||S.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,i){return S.get(t,e,i,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,i,s,n){return v(i)&&(n=n||s,s=i,i=void 0),S.ajax(S.extend({url:t,type:e,dataType:n,data:i,success:s},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,i){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,i)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(i){S(this).wrapAll(e?t.call(this,i):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new s.XMLHttpRequest}catch(t){}};var Qe={0:200,1223:204},Xe=S.ajaxSettings.xhr();m.cors=!!Xe&&"withCredentials"in Xe,m.ajax=Xe=!!Xe,S.ajaxTransport((function(t){var e,i;if(m.cors||Xe&&!t.crossDomain)return{send:function(n,r){var a,o=t.xhr();if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)o[a]=t.xhrFields[a];for(a in t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)o.setRequestHeader(a,n[a]);e=function(t){return function(){e&&(e=i=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===t?o.abort():"error"===t?"number"!=typeof o.status?r(0,"error"):r(o.status,o.statusText):r(Qe[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=e(),i=o.onerror=o.ontimeout=e("error"),void 0!==o.onabort?o.onabort=i:o.onreadystatechange=function(){4===o.readyState&&s.setTimeout((function(){e&&i()}))},e=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(s,n){e=S("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&n("error"===t.type?404:200,t.type)}),y.head.appendChild(e[0])},abort:function(){i&&i()}}}));var ti,ei=[],ii=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=ei.pop()||S.expando+"_"+Pe.guid++;return this[t]=!0,t}}),S.ajaxPrefilter("json jsonp",(function(t,e,i){var n,r,a,o=!1!==t.jsonp&&(ii.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ii.test(t.data)&&"data");if(o||"jsonp"===t.dataTypes[0])return n=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,o?t[o]=t[o].replace(ii,"$1"+n):!1!==t.jsonp&&(t.url+=(_e.test(t.url)?"&":"?")+t.jsonp+"="+n),t.converters["script json"]=function(){return a||S.error(n+" was not called"),a[0]},t.dataTypes[0]="json",r=s[n],s[n]=function(){a=arguments},i.always((function(){void 0===r?S(s).removeProp(n):s[n]=r,t[n]&&(t.jsonpCallback=e.jsonpCallback,ei.push(n)),a&&v(r)&&r(a[0]),a=r=void 0})),"script"})),m.createHTMLDocument=((ti=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===ti.childNodes.length),S.parseHTML=function(t,e,i){return"string"!=typeof t?[]:("boolean"==typeof e&&(i=e,e=!1),e||(m.createHTMLDocument?((s=(e=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,e.head.appendChild(s)):e=y),r=!i&&[],(n=L.exec(t))?[e.createElement(n[1])]:(n=Dt([t],e,r),r&&r.length&&S(r).remove(),S.merge([],n.childNodes)));var s,n,r},S.fn.load=function(t,e,i){var s,n,r,a=this,o=t.indexOf(" ");return o>-1&&(s=Se(t.slice(o)),t=t.slice(0,o)),v(e)?(i=e,e=void 0):e&&"object"==typeof e&&(n="POST"),a.length>0&&S.ajax({url:t,type:n||"GET",dataType:"html",data:e}).done((function(t){r=arguments,a.html(s?S("<div>").append(S.parseHTML(t)).find(s):t)})).always(i&&function(t,e){a.each((function(){i.apply(this,r||[t.responseText,e,t])}))}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,(function(e){return t===e.elem})).length},S.offset={setOffset:function(t,e,i){var s,n,r,a,o,l,c=S.css(t,"position"),h=S(t),u={};"static"===c&&(t.style.position="relative"),o=h.offset(),r=S.css(t,"top"),l=S.css(t,"left"),("absolute"===c||"fixed"===c)&&(r+l).indexOf("auto")>-1?(a=(s=h.position()).top,n=s.left):(a=parseFloat(r)||0,n=parseFloat(l)||0),v(e)&&(e=e.call(t,i,S.extend({},o))),null!=e.top&&(u.top=e.top-o.top+a),null!=e.left&&(u.left=e.left-o.left+n),"using"in e?e.using.call(t,u):h.css(u)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){S.offset.setOffset(this,t,e)}));var e,i,s=this[0];return s?s.getClientRects().length?(e=s.getBoundingClientRect(),i=s.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,s=this[0],n={top:0,left:0};if("fixed"===S.css(s,"position"))e=s.getBoundingClientRect();else{for(e=this.offset(),i=s.ownerDocument,t=s.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===S.css(t,"position");)t=t.parentNode;t&&t!==s&&1===t.nodeType&&((n=S(t).offset()).top+=S.css(t,"borderTopWidth",!0),n.left+=S.css(t,"borderLeftWidth",!0))}return{top:e.top-n.top-S.css(s,"marginTop",!0),left:e.left-n.left-S.css(s,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===S.css(t,"position");)t=t.offsetParent;return t||gt}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var i="pageYOffset"===e;S.fn[t]=function(s){return tt(this,(function(t,s,n){var r;if(b(t)?r=t:9===t.nodeType&&(r=t.defaultView),void 0===n)return r?r[e]:t[s];r?r.scrollTo(i?r.pageXOffset:n,i?n:r.pageYOffset):t[s]=n}),t,s,arguments.length)}})),S.each(["top","left"],(function(t,e){S.cssHooks[e]=te(m.pixelPosition,(function(t,i){if(i)return i=Xt(t,e),Jt.test(i)?S(t).position()[e]+"px":i}))})),S.each({Height:"height",Width:"width"},(function(t,e){S.each({padding:"inner"+t,content:e,"":"outer"+t},(function(i,s){S.fn[s]=function(n,r){var a=arguments.length&&(i||"boolean"!=typeof n),o=i||(!0===n||!0===r?"margin":"border");return tt(this,(function(e,i,n){var r;return b(e)?0===s.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===n?S.css(e,i,o):S.style(e,i,n,o)}),e,a?n:void 0,a)}}))})),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){S.fn[e]=function(t){return this.on(e,t)}})),S.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,s){return this.on(e,t,i,s)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},hover:function(t,e){return this.on("mouseenter",t).on("mouseleave",e||t)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){S.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}));var si=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(t,e){var i,s,n;if("string"==typeof e&&(i=t[e],e=t,t=i),v(t))return s=o.call(arguments,2),n=function(){return t.apply(e||this,s.concat(o.call(arguments)))},n.guid=t.guid=t.guid||S.guid++,n},S.holdReady=function(t){t?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=T,S.isFunction=v,S.isWindow=b,S.camelCase=nt,S.type=x,S.now=Date.now,S.isNumeric=function(t){var e=S.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},S.trim=function(t){return null==t?"":(t+"").replace(si,"$1")},void 0===(i=function(){return S}.apply(e,[]))||(t.exports=i);var ni=s.jQuery,ri=s.$;return S.noConflict=function(t){return s.$===S&&(s.$=ri),t&&s.jQuery===S&&(s.jQuery=ni),S},void 0===n&&(s.jQuery=s.$=S),S}))},925:function(t){"use strict";var e={};function i(){try{return new window.XMLHttpRequest}catch(t){}}e._getBinaryFromXHR=function(t){return t.response||t.responseText};var s="undefined"!=typeof window&&window.ActiveXObject?function(){return i()||function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:i;e.getBinaryContent=function(t,i){var n,r,a,o;i||(i={}),"function"==typeof i?(o=i,i={}):"function"==typeof i.callback&&(o=i.callback),o||"undefined"==typeof Promise?(r=function(t){o(null,t)},a=function(t){o(t,null)}):n=new Promise((function(t,e){r=t,a=e}));try{var l=s();l.open("GET",t,!0),"responseType"in l&&(l.responseType="arraybuffer"),l.overrideMimeType&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.onreadystatechange=function(i){if(4===l.readyState)if(200===l.status||0===l.status)try{r(e._getBinaryFromXHR(l))}catch(t){a(new Error(t))}else a(new Error("Ajax error for "+t+" : "+this.status+" "+this.statusText))},i.progress&&(l.onprogress=function(e){i.progress({path:t,originalEvent:e,percent:e.loaded/e.total*100,loaded:e.loaded,total:e.total})}),l.send()}catch(t){a(new Error(t),null)}return n},t.exports=e},733:function(t,e,i){t.exports=function t(e,i,s){function n(a,o){if(!i[a]){if(!e[a]){if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[a]={exports:{}};e[a][0].call(c.exports,(function(t){return n(e[a][1][t]||t)}),c,c.exports,t,e,i,s)}return i[a].exports}for(var r=void 0,a=0;a<s.length;a++)n(s[a]);return n}({1:[function(t,e,i){"use strict";var s=t("./utils"),n=t("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(t){for(var e,i,n,a,o,l,c,h=[],u=0,d=t.length,p=d,f="string"!==s.getTypeOf(t);u<t.length;)p=d-u,n=f?(e=t[u++],i=u<d?t[u++]:0,u<d?t[u++]:0):(e=t.charCodeAt(u++),i=u<d?t.charCodeAt(u++):0,u<d?t.charCodeAt(u++):0),a=e>>2,o=(3&e)<<4|i>>4,l=1<p?(15&i)<<2|n>>6:64,c=2<p?63&n:64,h.push(r.charAt(a)+r.charAt(o)+r.charAt(l)+r.charAt(c));return h.join("")},i.decode=function(t){var e,i,s,a,o,l,c=0,h=0,u="data:";if(t.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var d,p=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===r.charAt(64)&&p--,t.charAt(t.length-2)===r.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=n.uint8array?new Uint8Array(0|p):new Array(0|p);c<t.length;)e=r.indexOf(t.charAt(c++))<<2|(a=r.indexOf(t.charAt(c++)))>>4,i=(15&a)<<4|(o=r.indexOf(t.charAt(c++)))>>2,s=(3&o)<<6|(l=r.indexOf(t.charAt(c++))),d[h++]=e,64!==o&&(d[h++]=i),64!==l&&(d[h++]=s);return d}},{"./support":30,"./utils":32}],2:[function(t,e,i){"use strict";var s=t("./external"),n=t("./stream/DataWorker"),r=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function o(t,e,i,s,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=s,this.compressedContent=n}o.prototype={getContentWorker:function(){var t=new n(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,e,i){return t.pipe(new r).pipe(new a("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){"use strict";var s=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){"use strict";var s=t("./utils"),n=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var s=0;s<8;s++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==s.getTypeOf(t)?function(t,e,i,s){var r=n,a=s+i;t^=-1;for(var o=s;o<a;o++)t=t>>>8^r[255&(t^e[o])];return-1^t}(0|e,t,t.length,0):function(t,e,i,s){var r=n,a=s+i;t^=-1;for(var o=s;o<a;o++)t=t>>>8^r[255&(t^e.charCodeAt(o))];return-1^t}(0|e,t,t.length,0):0}},{"./utils":32}],5:[function(t,e,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){"use strict";var s=null;s="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:s}},{lie:37}],7:[function(t,e,i){"use strict";var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),r=t("./utils"),a=t("./stream/GenericWorker"),o=s?"uint8array":"array";function l(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",r.inherits(l,a),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(r.transformTo(o,t.data),!1)},l.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new l("Deflate",t)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){"use strict";function s(t,e){var i,s="";for(i=0;i<e;i++)s+=String.fromCharCode(255&t),t>>>=8;return s}function n(t,e,i,n,a,h){var u,d,p=t.file,f=t.compression,g=h!==o.utf8encode,m=r.transformTo("string",h(p.name)),v=r.transformTo("string",o.utf8encode(p.name)),b=p.comment,y=r.transformTo("string",h(b)),w=r.transformTo("string",o.utf8encode(b)),A=v.length!==p.name.length,x=w.length!==b.length,C="",k="",S="",E=p.dir,T=p.date,B={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(B.crc32=t.crc32,B.compressedSize=t.compressedSize,B.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),g||!A&&!x||(I|=2048);var P=0,_=0;E&&(P|=16),"UNIX"===a?(_=798,P|=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16}(p.unixPermissions,E)):(_=20,P|=function(t){return 63&(t||0)}(p.dosPermissions)),u=T.getUTCHours(),u<<=6,u|=T.getUTCMinutes(),u<<=5,u|=T.getUTCSeconds()/2,d=T.getUTCFullYear()-1980,d<<=4,d|=T.getUTCMonth()+1,d<<=5,d|=T.getUTCDate(),A&&(k=s(1,1)+s(l(m),4)+v,C+="up"+s(k.length,2)+k),x&&(S=s(1,1)+s(l(y),4)+w,C+="uc"+s(S.length,2)+S);var D="";return D+="\n\0",D+=s(I,2),D+=f.magic,D+=s(u,2),D+=s(d,2),D+=s(B.crc32,4),D+=s(B.compressedSize,4),D+=s(B.uncompressedSize,4),D+=s(m.length,2),D+=s(C.length,2),{fileRecord:c.LOCAL_FILE_HEADER+D+m+C,dirRecord:c.CENTRAL_FILE_HEADER+s(_,2)+D+s(y.length,2)+"\0\0\0\0"+s(P,4)+s(n,4)+m+C+y}}var r=t("../utils"),a=t("../stream/GenericWorker"),o=t("../utf8"),l=t("../crc32"),c=t("../signature");function h(t,e,i,s){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=s,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(h,a),h.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,s=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,a.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-s-1))/i:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,i=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),e)this.push({data:function(t){return c.DATA_DESCRIPTOR+s(t.crc32,4)+s(t.compressedSize,4)+s(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var i=this.bytesWritten-t,n=function(t,e,i,n,a){var o=r.transformTo("string",a(n));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(t,2)+s(t,2)+s(e,4)+s(i,4)+s(o.length,2)+o}(this.dirRecords.length,i,t,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},h.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(t){var e=this._sources;if(!a.prototype.error.call(this,t))return!1;for(var i=0;i<e.length;i++)try{e[i].error(t)}catch(t){}return!0},h.prototype.lock=function(){a.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,i){"use strict";var s=t("../compressions"),n=t("./ZipFileWorker");i.generateWorker=function(t,e,i){var r=new n(e.streamFiles,i,e.platform,e.encodeFileName),a=0;try{t.forEach((function(t,i){a++;var n=function(t,e){var i=t||e,n=s[i];if(!n)throw new Error(i+" is not a valid compression method !");return n}(i.options.compression,e.compression),o=i.options.compressionOptions||e.compressionOptions||{},l=i.dir,c=i.date;i._compressWorker(n,o).withStreamInfo("file",{name:t,dir:l,date:c,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(r)})),r.entriesCount=a}catch(t){r.error(t)}return r}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,i){"use strict";function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new s;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(s.prototype=t("./object")).loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(t,e){return(new s).loadAsync(t,e)},s.external=t("./external"),e.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,i){"use strict";var s=t("./utils"),n=t("./external"),r=t("./utf8"),a=t("./zipEntries"),o=t("./stream/Crc32Probe"),l=t("./nodejsUtils");function c(t){return new n.Promise((function(e,i){var s=t.decompressed.getContentWorker().pipe(new o);s.on("error",(function(t){i(t)})).on("end",(function(){s.streamInfo.crc32!==t.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}e.exports=function(t,e){var i=this;return e=s.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),l.isNode&&l.isStream(t)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var i=new a(e);return i.load(t),i})).then((function(t){var i=[n.Promise.resolve(t)],s=t.files;if(e.checkCRC32)for(var r=0;r<s.length;r++)i.push(c(s[r]));return n.Promise.all(i)})).then((function(t){for(var n=t.shift(),r=n.files,a=0;a<r.length;a++){var o=r[a],l=o.fileNameStr,c=s.resolve(o.fileNameStr);i.file(c,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders}),o.dir||(i.file(c).unsafeOriginalName=l)}return n.zipComment.length&&(i.comment=n.zipComment),i}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,i){"use strict";var s=t("../utils"),n=t("../stream/GenericWorker");function r(t,e){n.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}s.inherits(r,n),r.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},r.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,i){"use strict";var s=t("readable-stream").Readable;function n(t,e,i){s.call(this,e),this._helper=t;var n=this;t.on("data",(function(t,e){n.push(t)||n._helper.pause(),i&&i(e)})).on("error",(function(t){n.emit("error",t)})).on("end",(function(){n.push(null)}))}t("../utils").inherits(n,s),n.prototype._read=function(){this._helper.resume()},e.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,e,i){"use strict";e.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,i){"use strict";function s(t,e,i){var s,n=r.getTypeOf(e),o=r.extend(i||{},l);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(t=g(t)),o.createFolders&&(s=f(t))&&m.call(this,s,!0);var u="string"===n&&!1===o.binary&&!1===o.base64;i&&void 0!==i.binary||(o.binary=!u),(e instanceof c&&0===e.uncompressedSize||o.dir||!e||0===e.length)&&(o.base64=!1,o.binary=!0,e="",o.compression="STORE",n="string");var v=null;v=e instanceof c||e instanceof a?e:d.isNode&&d.isStream(e)?new p(t,e):r.prepareContent(t,e,o.binary,o.optimizedBinaryString,o.base64);var b=new h(t,v,o);this.files[t]=b}var n=t("./utf8"),r=t("./utils"),a=t("./stream/GenericWorker"),o=t("./stream/StreamHelper"),l=t("./defaults"),c=t("./compressedObject"),h=t("./zipObject"),u=t("./generate"),d=t("./nodejsUtils"),p=t("./nodejs/NodejsStreamInputAdapter"),f=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},g=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},m=function(t,e){return e=void 0!==e?e:l.createFolders,t=g(t),this.files[t]||s.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function v(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,s;for(e in this.files)s=this.files[e],(i=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(i,s)},filter:function(t){var e=[];return this.forEach((function(i,s){t(i,s)&&e.push(s)})),e},file:function(t,e,i){if(1!==arguments.length)return t=this.root+t,s.call(this,t,e,i),this;if(v(t)){var n=t;return this.filter((function(t,e){return!e.dir&&n.test(t)}))}var r=this.files[this.root+t];return r&&!r.dir?r:null},folder:function(t){if(!t)return this;if(v(t))return this.filter((function(e,i){return i.dir&&t.test(e)}));var e=this.root+t,i=m.call(this,e),s=this.clone();return s.root=i.name,s},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter((function(e,i){return i.name.slice(0,t.length)===t})),s=0;s<i.length;s++)delete this.files[i[s].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,i={};try{if((i=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),"binarystring"===i.type&&(i.type="string"),!i.type)throw new Error("No output type specified.");r.checkSupport(i.type),"darwin"!==i.platform&&"freebsd"!==i.platform&&"linux"!==i.platform&&"sunos"!==i.platform||(i.platform="UNIX"),"win32"===i.platform&&(i.platform="DOS");var s=i.comment||this.comment||"";e=u.generateWorker(this,i,s)}catch(t){(e=new a("error")).error(t)}return new o(e,i.type||"string",i.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=b},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,i){"use strict";e.exports=t("stream")},{stream:void 0}],17:[function(t,e,i){"use strict";var s=t("./DataReader");function n(t){s.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(n,s),n.prototype.byteAt=function(t){return this.data[this.zero+t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2),n=t.charCodeAt(3),r=this.length-4;0<=r;--r)if(this.data[r]===e&&this.data[r+1]===i&&this.data[r+2]===s&&this.data[r+3]===n)return r-this.zero;return-1},n.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2),n=t.charCodeAt(3),r=this.readData(4);return e===r[0]&&i===r[1]&&s===r[2]&&n===r[3]},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,e,i){"use strict";var s=t("../utils");function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,i=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return s.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,i){"use strict";var s=t("./Uint8ArrayReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){"use strict";var s=t("./DataReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){"use strict";var s=t("./ArrayReader");function n(t){s.call(this,t)}t("../utils").inherits(n,s),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){"use strict";var s=t("../utils"),n=t("../support"),r=t("./ArrayReader"),a=t("./StringReader"),o=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=s.getTypeOf(t);return s.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new o(t):n.uint8array?new l(s.transformTo("uint8array",t)):new r(s.transformTo("array",t)):new a(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){"use strict";var s=t("./GenericWorker"),n=t("../utils");function r(t){s.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(r,s),r.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){"use strict";var s=t("./GenericWorker"),n=t("../crc32");function r(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,s),r.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}s.inherits(r,n),r.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=s.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}s.inherits(r,n),r.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){"use strict";function s(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i<this._listeners[t].length;i++)this._listeners[t][i].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=s},{}],29:[function(t,e,i){"use strict";var s=t("../utils"),n=t("./ConvertWorker"),r=t("./GenericWorker"),a=t("../base64"),o=t("../support"),l=t("../external"),c=null;if(o.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e){return new l.Promise((function(i,n){var r=[],o=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",(function(t,i){r.push(t),e&&e(i)})).on("error",(function(t){r=[],n(t)})).on("end",(function(){try{var t=function(t,e,i){switch(t){case"blob":return s.newBlob(s.transformTo("arraybuffer",e),i);case"base64":return a.encode(e);default:return s.transformTo(t,e)}}(l,function(t,e){var i,s=0,n=null,r=0;for(i=0;i<e.length;i++)r+=e[i].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(n=new Uint8Array(r),i=0;i<e.length;i++)n.set(e[i],s),s+=e[i].length;return n;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(o,r),c);i(t)}catch(t){n(t)}r=[]})).resume()}))}function u(t,e,i){var a=e;switch(e){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=e,this._mimeType=i,s.checkSupport(a),this._worker=t.pipe(new n(a)),t.lock()}catch(t){this._worker=new r("error"),this._worker.error(t)}}u.prototype={accumulate:function(t){return h(this,t)},on:function(t,e){var i=this;return"data"===t?this._worker.on(t,(function(t){e.call(i,t.data,t.meta)})):this._worker.on(t,(function(){s.delay(e,arguments,i)})),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(s.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,i){"use strict";if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,i.nodebuffer="undefined"!=typeof Buffer,i.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=0===new Blob([s],{type:"application/zip"}).size}catch(t){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(s),i.blob=0===n.getBlob("application/zip").size}catch(t){i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch(t){i.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,i){"use strict";for(var s=t("./utils"),n=t("./support"),r=t("./nodejsUtils"),a=t("./stream/GenericWorker"),o=new Array(256),l=0;l<256;l++)o[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function c(){a.call(this,"utf-8 decode"),this.leftOver=null}function h(){a.call(this,"utf-8 encode")}o[254]=o[254]=1,i.utf8encode=function(t){return n.nodebuffer?r.newBufferFrom(t,"utf-8"):function(t){var e,i,s,r,a,o=t.length,l=0;for(r=0;r<o;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=n.uint8array?new Uint8Array(l):new Array(l),r=a=0;a<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63),e[a++]=128|i>>>6&63),e[a++]=128|63&i);return e}(t)},i.utf8decode=function(t){return n.nodebuffer?s.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,n,r,a=t.length,l=new Array(2*a);for(e=i=0;e<a;)if((n=t[e++])<128)l[i++]=n;else if(4<(r=o[n]))l[i++]=65533,e+=r-1;else{for(n&=2===r?31:3===r?15:7;1<r&&e<a;)n=n<<6|63&t[e++],r--;1<r?l[i++]=65533:n<65536?l[i++]=n:(n-=65536,l[i++]=55296|n>>10&1023,l[i++]=56320|1023&n)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),s.applyFromCharCode(l)}(t=s.transformTo(n.uint8array?"uint8array":"array",t))},s.inherits(c,a),c.prototype.processChunk=function(t){var e=s.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}(e),l=e;a!==e.length&&(n.uint8array?(l=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(l=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:i.utf8decode(l),meta:t.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=c,s.inherits(h,a),h.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){"use strict";var s=t("./support"),n=t("./base64"),r=t("./nodejsUtils"),a=t("./external");function o(t){return t}function l(t,e){for(var i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e}t("setimmediate"),i.newBlob=function(t,e){i.checkSupport("blob");try{return new Blob([t],{type:e})}catch(i){try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return s.append(t),s.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var c={stringifyByChunk:function(t,e,i){var s=[],n=0,r=t.length;if(r<=i)return String.fromCharCode.apply(null,t);for(;n<r;)"array"===e||"nodebuffer"===e?s.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+i,r)))):s.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+i,r)))),n+=i;return s.join("")},stringifyByChar:function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(t){return!1}}()}};function h(t){var e=65536,s=i.getTypeOf(t),n=!0;if("uint8array"===s?n=c.applyCanBeUsed.uint8array:"nodebuffer"===s&&(n=c.applyCanBeUsed.nodebuffer),n)for(;1<e;)try{return c.stringifyByChunk(t,s,e)}catch(t){e=Math.floor(e/2)}return c.stringifyByChar(t)}function u(t,e){for(var i=0;i<t.length;i++)e[i]=t[i];return e}i.applyFromCharCode=h;var d={};d.string={string:o,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return d.string.uint8array(t).buffer},uint8array:function(t){return l(t,new Uint8Array(t.length))},nodebuffer:function(t){return l(t,r.allocBuffer(t.length))}},d.array={string:h,array:o,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(t)}},d.arraybuffer={string:function(t){return h(new Uint8Array(t))},array:function(t){return u(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:o,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(new Uint8Array(t))}},d.uint8array={string:h,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:o,nodebuffer:function(t){return r.newBufferFrom(t)}},d.nodebuffer={string:h,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return d.nodebuffer.uint8array(t).buffer},uint8array:function(t){return u(t,new Uint8Array(t.length))},nodebuffer:o},i.transformTo=function(t,e){if(e=e||"",!t)return e;i.checkSupport(t);var s=i.getTypeOf(e);return d[s][t](e)},i.resolve=function(t){for(var e=t.split("/"),i=[],s=0;s<e.length;s++){var n=e[s];"."===n||""===n&&0!==s&&s!==e.length-1||(".."===n?i.pop():i.push(n))}return i.join("/")},i.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":s.nodebuffer&&r.isBuffer(t)?"nodebuffer":s.uint8array&&t instanceof Uint8Array?"uint8array":s.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(t){if(!s[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(t){var e,i,s="";for(i=0;i<(t||"").length;i++)s+="\\x"+((e=t.charCodeAt(i))<16?"0":"")+e.toString(16).toUpperCase();return s},i.delay=function(t,e,i){setImmediate((function(){t.apply(i||null,e||[])}))},i.inherits=function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i},i.extend=function(){var t,e,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===i[e]&&(i[e]=arguments[t][e]);return i},i.prepareContent=function(t,e,r,o,c){return a.Promise.resolve(e).then((function(t){return s.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new a.Promise((function(e,i){var s=new FileReader;s.onload=function(t){e(t.target.result)},s.onerror=function(t){i(t.target.error)},s.readAsArrayBuffer(t)})):t})).then((function(e){var h=i.getTypeOf(e);return h?("arraybuffer"===h?e=i.transformTo("uint8array",e):"string"===h&&(c?e=n.decode(e):r&&!0!==o&&(e=function(t){return l(t,s.uint8array?new Uint8Array(t.length):new Array(t.length))}(e))),e):a.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,i){"use strict";var s=t("./reader/readerFor"),n=t("./utils"),r=t("./signature"),a=t("./zipEntry"),o=t("./support");function l(t){this.files=[],this.loadOptions=t}l.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(e)+", expected "+n.pretty(t)+")")}},isSignature:function(t,e){var i=this.reader.index;this.reader.setIndex(t);var s=this.reader.readString(4)===e;return this.reader.setIndex(i),s},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=o.uint8array?"uint8array":"array",i=n.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,i,s=this.zip64EndOfCentralSize-44;0<s;)t=this.reader.readInt(2),e=this.reader.readInt(4),i=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(t=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var s=e-i;if(0<s)this.isSignature(e,r.CENTRAL_FILE_HEADER)||(this.reader.zero=s);else if(s<0)throw new Error("Corrupted zip: missing "+Math.abs(s)+" bytes.")},prepareReader:function(t){this.reader=s(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,i){"use strict";var s=t("./reader/readerFor"),n=t("./utils"),r=t("./compressedObject"),a=t("./crc32"),o=t("./utf8"),l=t("./compressions"),c=t("./support");function h(t,e){this.options=t,this.loadOptions=e}h.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in l)if(Object.prototype.hasOwnProperty.call(l,e)&&l[e].magic===t)return l[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=s(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,i,s,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<n;)e=t.readInt(2),i=t.readInt(2),s=t.readData(i),this.extraFields[e]={id:e,length:i,value:s};t.setIndex(n)},handleUTF8:function(){var t=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var i=n.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var s=this.findExtraFieldUnicodeComment();if(null!==s)this.fileCommentStr=s;else{var r=n.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=s(t.value);return 1!==e.readInt(1)||a(this.fileName)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=s(t.value);return 1!==e.readInt(1)||a(this.fileComment)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null}},e.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,i){"use strict";function s(t,e,i){this.name=t,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=e,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}}var n=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),a=t("./utf8"),o=t("./compressedObject"),l=t("./stream/GenericWorker");s.prototype={internalStream:function(t){var e=null,i="string";try{if(!t)throw new Error("No output type specified.");var s="string"===(i=t.toLowerCase())||"text"===i;"binarystring"!==i&&"text"!==i||(i="string"),e=this._decompressWorker();var r=!this._dataBinary;r&&!s&&(e=e.pipe(new a.Utf8EncodeWorker)),!r&&s&&(e=e.pipe(new a.Utf8DecodeWorker))}catch(t){(e=new l("error")).error(t)}return new n(e,i,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof o&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(i,t,e)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof l?this._data:new r(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<c.length;u++)s.prototype[c[u]]=h;e.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,s){(function(t){"use strict";var i,s,n=t.MutationObserver||t.WebKitMutationObserver;if(n){var r=0,a=new n(h),o=t.document.createTextNode("");a.observe(o,{characterData:!0}),i=function(){o.data=r=++r%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){h(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(h,0)};else{var l=new t.MessageChannel;l.port1.onmessage=h,i=function(){l.port2.postMessage(0)}}var c=[];function h(){var t,e;s=!0;for(var i=c.length;i;){for(e=c,c=[],t=-1;++t<i;)e[t]();i=c.length}s=!1}e.exports=function(t){1!==c.push(t)||s||i()}}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,i){"use strict";var s=t("immediate");function n(){}var r={},a=["REJECTED"],o=["FULFILLED"],l=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==n&&p(this,t)}function h(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function u(t,e,i){s((function(){var s;try{s=e(i)}catch(s){return r.reject(t,s)}s===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,s)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var i=!1;function s(e){i||(i=!0,r.reject(t,e))}function n(e){i||(i=!0,r.resolve(t,e))}var a=f((function(){e(n,s)}));"error"===a.status&&s(a.value)}function f(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}(e.exports=c).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(i){return e.resolve(t()).then((function(){return i}))}),(function(i){return e.resolve(t()).then((function(){throw i}))}))},c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===o||"function"!=typeof e&&this.state===a)return this;var i=new this.constructor(n);return this.state!==l?u(i,this.state===o?t:e,this.outcome):this.queue.push(new h(i,t,e)),i},h.prototype.callFulfilled=function(t){r.resolve(this.promise,t)},h.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},h.prototype.callRejected=function(t){r.reject(this.promise,t)},h.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},r.resolve=function(t,e){var i=f(d,e);if("error"===i.status)return r.reject(t,i.value);var s=i.value;if(s)p(t,s);else{t.state=o,t.outcome=e;for(var n=-1,a=t.queue.length;++n<a;)t.queue[n].callFulfilled(e)}return t},r.reject=function(t,e){t.state=a,t.outcome=e;for(var i=-1,s=t.queue.length;++i<s;)t.queue[i].callRejected(e);return t},c.resolve=function(t){return t instanceof this?t:r.resolve(new this(n),t)},c.reject=function(t){var e=new this(n);return r.reject(e,t)},c.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,s=!1;if(!i)return this.resolve([]);for(var a=new Array(i),o=0,l=-1,c=new this(n);++l<i;)h(t[l],l);return c;function h(t,n){e.resolve(t).then((function(t){a[n]=t,++o!==i||s||(s=!0,r.resolve(c,a))}),(function(t){s||(s=!0,r.reject(c,t))}))}},c.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,s=!1;if(!i)return this.resolve([]);for(var a,o=-1,l=new this(n);++o<i;)a=t[o],e.resolve(a).then((function(t){s||(s=!0,r.resolve(l,t))}),(function(t){s||(s=!0,r.reject(l,t))}));return l}},{immediate:36}],38:[function(t,e,i){"use strict";var s={};(0,t("./lib/utils/common").assign)(s,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,i){"use strict";var s=t("./zlib/deflate"),n=t("./utils/common"),r=t("./utils/strings"),a=t("./zlib/messages"),o=t("./zlib/zstream"),l=Object.prototype.toString,c=0,h=-1,u=0,d=8;function p(t){if(!(this instanceof p))return new p(t);this.options=n.assign({level:h,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var i=s.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(i!==c)throw new Error(a[i]);if(e.header&&s.deflateSetHeader(this.strm,e.header),e.dictionary){var f;if(f="string"==typeof e.dictionary?r.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(i=s.deflateSetDictionary(this.strm,f))!==c)throw new Error(a[i]);this._dict_set=!0}}function f(t,e){var i=new p(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}p.prototype.push=function(t,e){var i,a,o=this.strm,h=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=r.string2buf(t):"[object ArrayBuffer]"===l.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new n.Buf8(h),o.next_out=0,o.avail_out=h),1!==(i=s.deflate(o,a))&&i!==c)return this.onEnd(i),!(this.ended=!0);0!==o.avail_out&&(0!==o.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(r.buf2binstring(n.shrinkBuf(o.output,o.next_out))):this.onData(n.shrinkBuf(o.output,o.next_out)))}while((0<o.avail_in||0===o.avail_out)&&1!==i);return 4===a?(i=s.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===c):2!==a||(this.onEnd(c),!(o.avail_out=0))},p.prototype.onData=function(t){this.chunks.push(t)},p.prototype.onEnd=function(t){t===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Deflate=p,i.deflate=f,i.deflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},i.gzip=function(t,e){return(e=e||{}).gzip=!0,f(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,i){"use strict";var s=t("./zlib/inflate"),n=t("./utils/common"),r=t("./utils/strings"),a=t("./zlib/constants"),o=t("./zlib/messages"),l=t("./zlib/zstream"),c=t("./zlib/gzheader"),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var i=s.inflateInit2(this.strm,e.windowBits);if(i!==a.Z_OK)throw new Error(o[i]);this.header=new c,s.inflateGetHeader(this.strm,this.header)}function d(t,e){var i=new u(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}u.prototype.push=function(t,e){var i,o,l,c,u,d,p=this.strm,f=this.options.chunkSize,g=this.options.dictionary,m=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?p.input=r.binstring2buf(t):"[object ArrayBuffer]"===h.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new n.Buf8(f),p.next_out=0,p.avail_out=f),(i=s.inflate(p,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&g&&(d="string"==typeof g?r.string2buf(g):"[object ArrayBuffer]"===h.call(g)?new Uint8Array(g):g,i=s.inflateSetDictionary(this.strm,d)),i===a.Z_BUF_ERROR&&!0===m&&(i=a.Z_OK,m=!1),i!==a.Z_STREAM_END&&i!==a.Z_OK)return this.onEnd(i),!(this.ended=!0);p.next_out&&(0!==p.avail_out&&i!==a.Z_STREAM_END&&(0!==p.avail_in||o!==a.Z_FINISH&&o!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=r.utf8border(p.output,p.next_out),c=p.next_out-l,u=r.buf2string(p.output,l),p.next_out=c,p.avail_out=f-c,c&&n.arraySet(p.output,p.output,l,c,0),this.onData(u)):this.onData(n.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(m=!0)}while((0<p.avail_in||0===p.avail_out)&&i!==a.Z_STREAM_END);return i===a.Z_STREAM_END&&(o=a.Z_FINISH),o===a.Z_FINISH?(i=s.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===a.Z_OK):o!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(p.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Inflate=u,i.inflate=d,i.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},i.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,i){"use strict";var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])}}return t},i.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,i,s,n){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+s),n);else for(var r=0;r<s;r++)t[n+r]=e[i+r]},flattenChunks:function(t){var e,i,s,n,r,a;for(e=s=0,i=t.length;e<i;e++)s+=t[e].length;for(a=new Uint8Array(s),e=n=0,i=t.length;e<i;e++)r=t[e],a.set(r,n),n+=r.length;return a}},r={arraySet:function(t,e,i,s,n){for(var r=0;r<s;r++)t[n+r]=e[i+r]},flattenChunks:function(t){return[].concat.apply([],t)}};i.setTyped=function(t){t?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,n)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,r))},i.setTyped(s)},{}],42:[function(t,e,i){"use strict";var s=t("./common"),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){r=!1}for(var a=new s.Buf8(256),o=0;o<256;o++)a[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function l(t,e){if(e<65537&&(t.subarray&&r||!t.subarray&&n))return String.fromCharCode.apply(null,s.shrinkBuf(t,e));for(var i="",a=0;a<e;a++)i+=String.fromCharCode(t[a]);return i}a[254]=a[254]=1,i.string2buf=function(t){var e,i,n,r,a,o=t.length,l=0;for(r=0;r<o;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=new s.Buf8(l),r=a=0;a<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63),e[a++]=128|i>>>6&63),e[a++]=128|63&i);return e},i.buf2binstring=function(t){return l(t,t.length)},i.binstring2buf=function(t){for(var e=new s.Buf8(t.length),i=0,n=e.length;i<n;i++)e[i]=t.charCodeAt(i);return e},i.buf2string=function(t,e){var i,s,n,r,o=e||t.length,c=new Array(2*o);for(i=s=0;i<o;)if((n=t[i++])<128)c[s++]=n;else if(4<(r=a[n]))c[s++]=65533,i+=r-1;else{for(n&=2===r?31:3===r?15:7;1<r&&i<o;)n=n<<6|63&t[i++],r--;1<r?c[s++]=65533:n<65536?c[s++]=n:(n-=65536,c[s++]=55296|n>>10&1023,c[s++]=56320|1023&n)}return l(c,s)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){"use strict";e.exports=function(t,e,i,s){for(var n=65535&t|0,r=t>>>16&65535|0,a=0;0!==i;){for(i-=a=2e3<i?2e3:i;r=r+(n=n+e[s++]|0)|0,--a;);n%=65521,r%=65521}return n|r<<16|0}},{}],44:[function(t,e,i){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,i){"use strict";var s=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var s=0;s<8;s++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e,i,n){var r=s,a=n+i;t^=-1;for(var o=n;o<a;o++)t=t>>>8^r[255&(t^e[o])];return-1^t}},{}],46:[function(t,e,i){"use strict";var s,n=t("../utils/common"),r=t("./trees"),a=t("./adler32"),o=t("./crc32"),l=t("./messages"),c=0,h=4,u=0,d=-2,p=-1,f=4,g=2,m=8,v=9,b=286,y=30,w=19,A=2*b+1,x=15,C=3,k=258,S=k+C+1,E=42,T=113,B=1,I=2,P=3,_=4;function D(t,e){return t.msg=l[e],e}function R(t){return(t<<1)-(4<t?9:0)}function O(t){for(var e=t.length;0<=--e;)t[e]=0}function M(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(n.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function N(t,e){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,M(t.strm)}function $(t,e){t.pending_buf[t.pending++]=e}function V(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function q(t,e){var i,s,n=t.max_chain_length,r=t.strstart,a=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-S?t.strstart-(t.w_size-S):0,c=t.window,h=t.w_mask,u=t.prev,d=t.strstart+k,p=c[r+a-1],f=c[r+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(c[(i=e)+a]===f&&c[i+a-1]===p&&c[i]===c[r]&&c[++i]===c[r+1]){r+=2,i++;do{}while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&r<d);if(s=k-(d-r),r=d-k,a<s){if(t.match_start=e,o<=(a=s))break;p=c[r+a-1],f=c[r+a]}}}while((e=u[e&h])>l&&0!=--n);return a<=t.lookahead?a:t.lookahead}function L(t){var e,i,s,r,l,c,h,u,d,p,f=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-S)){for(n.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=i=t.hash_size;s=t.head[--e],t.head[e]=f<=s?s-f:0,--i;);for(e=i=f;s=t.prev[--e],t.prev[e]=f<=s?s-f:0,--i;);r+=f}if(0===t.strm.avail_in)break;if(c=t.strm,h=t.window,u=t.strstart+t.lookahead,p=void 0,(d=r)<(p=c.avail_in)&&(p=d),i=0===p?0:(c.avail_in-=p,n.arraySet(h,c.input,c.next_in,p,u),1===c.state.wrap?c.adler=a(c.adler,h,p,u):2===c.state.wrap&&(c.adler=o(c.adler,h,p,u)),c.next_in+=p,c.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=C)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+C-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<C)););}while(t.lookahead<S&&0!==t.strm.avail_in)}function j(t,e){for(var i,s;;){if(t.lookahead<S){if(L(t),t.lookahead<S&&e===c)return B;if(0===t.lookahead)break}if(i=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-S&&(t.match_length=q(t,i)),t.match_length>=C)if(s=r._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else s=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(s&&(N(t,!1),0===t.strm.avail_out))return B}return t.insert=t.strstart<C-1?t.strstart:C-1,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B:I}function F(t,e){for(var i,s,n;;){if(t.lookahead<S){if(L(t),t.lookahead<S&&e===c)return B;if(0===t.lookahead)break}if(i=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=C-1,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-S&&(t.match_length=q(t,i),t.match_length<=5&&(1===t.strategy||t.match_length===C&&4096<t.strstart-t.match_start)&&(t.match_length=C-1)),t.prev_length>=C&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-C,s=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=C-1,t.strstart++,s&&(N(t,!1),0===t.strm.avail_out))return B}else if(t.match_available){if((s=r._tr_tally(t,0,t.window[t.strstart-1]))&&N(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return B}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(s=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<C-1?t.strstart:C-1,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B:I}function z(t,e,i,s,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=s,this.func=n}function U(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(2*A),this.dyn_dtree=new n.Buf16(2*(2*y+1)),this.bl_tree=new n.Buf16(2*(2*w+1)),O(this.dyn_ltree),O(this.dyn_dtree),O(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(x+1),this.heap=new n.Buf16(2*b+1),O(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*b+1),O(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function H(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=g,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?E:T,t.adler=2===e.wrap?0:1,e.last_flush=c,r._tr_init(e),u):D(t,d)}function W(t){var e=H(t);return e===u&&function(t){t.window_size=2*t.w_size,O(t.head),t.max_lazy_match=s[t.level].max_lazy,t.good_match=s[t.level].good_length,t.nice_match=s[t.level].nice_length,t.max_chain_length=s[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=C-1,t.match_available=0,t.ins_h=0}(t.state),e}function G(t,e,i,s,r,a){if(!t)return d;var o=1;if(e===p&&(e=6),s<0?(o=0,s=-s):15<s&&(o=2,s-=16),r<1||v<r||i!==m||s<8||15<s||e<0||9<e||a<0||f<a)return D(t,d);8===s&&(s=9);var l=new U;return(t.state=l).strm=t,l.wrap=o,l.gzhead=null,l.w_bits=s,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=r+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+C-1)/C),l.window=new n.Buf8(2*l.w_size),l.head=new n.Buf16(l.hash_size),l.prev=new n.Buf16(l.w_size),l.lit_bufsize=1<<r+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new n.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=a,l.method=i,W(t)}s=[new z(0,0,0,0,(function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(L(t),0===t.lookahead&&e===c)return B;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var s=t.block_start+i;if((0===t.strstart||t.strstart>=s)&&(t.lookahead=t.strstart-s,t.strstart=s,N(t,!1),0===t.strm.avail_out))return B;if(t.strstart-t.block_start>=t.w_size-S&&(N(t,!1),0===t.strm.avail_out))return B}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?P:_):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),B)})),new z(4,4,8,4,j),new z(4,5,16,8,j),new z(4,6,32,32,j),new z(4,4,16,16,F),new z(8,16,32,32,F),new z(8,16,128,128,F),new z(8,32,128,256,F),new z(32,128,258,1024,F),new z(32,258,258,4096,F)],i.deflateInit=function(t,e){return G(t,e,m,15,8,0)},i.deflateInit2=G,i.deflateReset=W,i.deflateResetKeep=H,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?d:(t.state.gzhead=e,u):d},i.deflate=function(t,e){var i,n,a,l;if(!t||!t.state||5<e||e<0)return t?D(t,d):d;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&e!==h)return D(t,0===t.avail_out?-5:d);if(n.strm=t,i=n.last_flush,n.last_flush=e,n.status===E)if(2===n.wrap)t.adler=0,$(n,31),$(n,139),$(n,8),n.gzhead?($(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),$(n,255&n.gzhead.time),$(n,n.gzhead.time>>8&255),$(n,n.gzhead.time>>16&255),$(n,n.gzhead.time>>24&255),$(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),$(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&($(n,255&n.gzhead.extra.length),$(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=o(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):($(n,0),$(n,0),$(n,0),$(n,0),$(n,0),$(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),$(n,3),n.status=T);else{var p=m+(n.w_bits-8<<4)<<8;p|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(p|=32),p+=31-p%31,n.status=T,V(n,p),0!==n.strstart&&(V(n,t.adler>>>16),V(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),M(t),a=n.pending,n.pending!==n.pending_buf_size));)$(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),M(t),a=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,$(n,l)}while(0!==l);n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===l&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),M(t),a=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,$(n,l)}while(0!==l);n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===l&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&M(t),n.pending+2<=n.pending_buf_size&&($(n,255&t.adler),$(n,t.adler>>8&255),t.adler=0,n.status=T)):n.status=T),0!==n.pending){if(M(t),0===t.avail_out)return n.last_flush=-1,u}else if(0===t.avail_in&&R(e)<=R(i)&&e!==h)return D(t,-5);if(666===n.status&&0!==t.avail_in)return D(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==c&&666!==n.status){var f=2===n.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(L(t),0===t.lookahead)){if(e===c)return B;break}if(t.match_length=0,i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(N(t,!1),0===t.strm.avail_out))return B}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B:I}(n,e):3===n.strategy?function(t,e){for(var i,s,n,a,o=t.window;;){if(t.lookahead<=k){if(L(t),t.lookahead<=k&&e===c)return B;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=C&&0<t.strstart&&(s=o[n=t.strstart-1])===o[++n]&&s===o[++n]&&s===o[++n]){a=t.strstart+k;do{}while(s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&s===o[++n]&&n<a);t.match_length=k-(a-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=C?(i=r._tr_tally(t,1,t.match_length-C),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(N(t,!1),0===t.strm.avail_out))return B}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?P:_):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?B:I}(n,e):s[n.level].func(n,e);if(f!==P&&f!==_||(n.status=666),f===B||f===P)return 0===t.avail_out&&(n.last_flush=-1),u;if(f===I&&(1===e?r._tr_align(n):5!==e&&(r._tr_stored_block(n,0,0,!1),3===e&&(O(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),M(t),0===t.avail_out))return n.last_flush=-1,u}return e!==h?u:n.wrap<=0?1:(2===n.wrap?($(n,255&t.adler),$(n,t.adler>>8&255),$(n,t.adler>>16&255),$(n,t.adler>>24&255),$(n,255&t.total_in),$(n,t.total_in>>8&255),$(n,t.total_in>>16&255),$(n,t.total_in>>24&255)):(V(n,t.adler>>>16),V(n,65535&t.adler)),M(t),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?u:1)},i.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==E&&69!==e&&73!==e&&91!==e&&103!==e&&e!==T&&666!==e?D(t,d):(t.state=null,e===T?D(t,-3):u):d},i.deflateSetDictionary=function(t,e){var i,s,r,o,l,c,h,p,f=e.length;if(!t||!t.state)return d;if(2===(o=(i=t.state).wrap)||1===o&&i.status!==E||i.lookahead)return d;for(1===o&&(t.adler=a(t.adler,e,f,0)),i.wrap=0,f>=i.w_size&&(0===o&&(O(i.head),i.strstart=0,i.block_start=0,i.insert=0),p=new n.Buf8(i.w_size),n.arraySet(p,e,f-i.w_size,i.w_size,0),e=p,f=i.w_size),l=t.avail_in,c=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,L(i);i.lookahead>=C;){for(s=i.strstart,r=i.lookahead-(C-1);i.ins_h=(i.ins_h<<i.hash_shift^i.window[s+C-1])&i.hash_mask,i.prev[s&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=s,s++,--r;);i.strstart=s,i.lookahead=C-1,L(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=C-1,i.match_available=0,t.next_in=c,t.input=h,t.avail_in=l,i.wrap=o,u},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,i){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,i){"use strict";e.exports=function(t,e){var i,s,n,r,a,o,l,c,h,u,d,p,f,g,m,v,b,y,w,A,x,C,k,S,E;i=t.state,s=t.next_in,S=t.input,n=s+(t.avail_in-5),r=t.next_out,E=t.output,a=r-(e-t.avail_out),o=r+(t.avail_out-257),l=i.dmax,c=i.wsize,h=i.whave,u=i.wnext,d=i.window,p=i.hold,f=i.bits,g=i.lencode,m=i.distcode,v=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;t:do{f<15&&(p+=S[s++]<<f,f+=8,p+=S[s++]<<f,f+=8),y=g[p&v];e:for(;;){if(p>>>=w=y>>>24,f-=w,0==(w=y>>>16&255))E[r++]=65535&y;else{if(!(16&w)){if(0==(64&w)){y=g[(65535&y)+(p&(1<<w)-1)];continue e}if(32&w){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}A=65535&y,(w&=15)&&(f<w&&(p+=S[s++]<<f,f+=8),A+=p&(1<<w)-1,p>>>=w,f-=w),f<15&&(p+=S[s++]<<f,f+=8,p+=S[s++]<<f,f+=8),y=m[p&b];i:for(;;){if(p>>>=w=y>>>24,f-=w,!(16&(w=y>>>16&255))){if(0==(64&w)){y=m[(65535&y)+(p&(1<<w)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(x=65535&y,f<(w&=15)&&(p+=S[s++]<<f,(f+=8)<w&&(p+=S[s++]<<f,f+=8)),l<(x+=p&(1<<w)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=w,f-=w,(w=r-a)<x){if(h<(w=x-w)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(k=d,(C=0)===u){if(C+=c-w,w<A){for(A-=w;E[r++]=d[C++],--w;);C=r-x,k=E}}else if(u<w){if(C+=c+u-w,(w-=u)<A){for(A-=w;E[r++]=d[C++],--w;);if(C=0,u<A){for(A-=w=u;E[r++]=d[C++],--w;);C=r-x,k=E}}}else if(C+=u-w,w<A){for(A-=w;E[r++]=d[C++],--w;);C=r-x,k=E}for(;2<A;)E[r++]=k[C++],E[r++]=k[C++],E[r++]=k[C++],A-=3;A&&(E[r++]=k[C++],1<A&&(E[r++]=k[C++]))}else{for(C=r-x;E[r++]=E[C++],E[r++]=E[C++],E[r++]=E[C++],2<(A-=3););A&&(E[r++]=E[C++],1<A&&(E[r++]=E[C++]))}break}}break}}while(s<n&&r<o);s-=A=f>>3,p&=(1<<(f-=A<<3))-1,t.next_in=s,t.next_out=r,t.avail_in=s<n?n-s+5:5-(s-n),t.avail_out=r<o?o-r+257:257-(r-o),i.hold=p,i.bits=f}},{}],49:[function(t,e,i){"use strict";var s=t("../utils/common"),n=t("./adler32"),r=t("./crc32"),a=t("./inffast"),o=t("./inftrees"),l=1,c=2,h=0,u=-2,d=1,p=852,f=592;function g(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=d,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new s.Buf32(p),e.distcode=e.distdyn=new s.Buf32(f),e.sane=1,e.back=-1,h):u}function b(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,v(t)):u}function y(t,e){var i,s;return t&&t.state?(s=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?u:(null!==s.window&&s.wbits!==e&&(s.window=null),s.wrap=i,s.wbits=e,b(t))):u}function w(t,e){var i,s;return t?(s=new m,(t.state=s).window=null,(i=y(t,e))!==h&&(t.state=null),i):u}var A,x,C=!0;function k(t){if(C){var e;for(A=new s.Buf32(512),x=new s.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(o(l,t.lens,0,288,A,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(c,t.lens,0,32,x,0,t.work,{bits:5}),C=!1}t.lencode=A,t.lenbits=9,t.distcode=x,t.distbits=5}function S(t,e,i,n){var r,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new s.Buf8(a.wsize)),n>=a.wsize?(s.arraySet(a.window,e,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n<(r=a.wsize-a.wnext)&&(r=n),s.arraySet(a.window,e,i-n,r,a.wnext),(n-=r)?(s.arraySet(a.window,e,i-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0}i.inflateReset=b,i.inflateReset2=y,i.inflateResetKeep=v,i.inflateInit=function(t){return w(t,15)},i.inflateInit2=w,i.inflate=function(t,e){var i,p,f,m,v,b,y,w,A,x,C,E,T,B,I,P,_,D,R,O,M,N,$,V,q=0,L=new s.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return u;12===(i=t.state).mode&&(i.mode=13),v=t.next_out,f=t.output,y=t.avail_out,m=t.next_in,p=t.input,b=t.avail_in,w=i.hold,A=i.bits,x=b,C=y,N=h;t:for(;;)switch(i.mode){case d:if(0===i.wrap){i.mode=13;break}for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(2&i.wrap&&35615===w){L[i.check=0]=255&w,L[1]=w>>>8&255,i.check=r(i.check,L,2,0),A=w=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&w)<<8)+(w>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&w)){t.msg="unknown compression method",i.mode=30;break}if(A-=4,M=8+(15&(w>>>=4)),0===i.wbits)i.wbits=M;else if(M>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<M,t.adler=i.check=1,i.mode=512&w?10:12,A=w=0;break;case 2:for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(i.flags=w,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=w>>8&1),512&i.flags&&(L[0]=255&w,L[1]=w>>>8&255,i.check=r(i.check,L,2,0)),A=w=0,i.mode=3;case 3:for(;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.head&&(i.head.time=w),512&i.flags&&(L[0]=255&w,L[1]=w>>>8&255,L[2]=w>>>16&255,L[3]=w>>>24&255,i.check=r(i.check,L,4,0)),A=w=0,i.mode=4;case 4:for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.head&&(i.head.xflags=255&w,i.head.os=w>>8),512&i.flags&&(L[0]=255&w,L[1]=w>>>8&255,i.check=r(i.check,L,2,0)),A=w=0,i.mode=5;case 5:if(1024&i.flags){for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.length=w,i.head&&(i.head.extra_len=w),512&i.flags&&(L[0]=255&w,L[1]=w>>>8&255,i.check=r(i.check,L,2,0)),A=w=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(b<(E=i.length)&&(E=b),E&&(i.head&&(M=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),s.arraySet(i.head.extra,p,m,E,M)),512&i.flags&&(i.check=r(i.check,p,E,m)),b-=E,m+=E,i.length-=E),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===b)break t;for(E=0;M=p[m+E++],i.head&&M&&i.length<65536&&(i.head.name+=String.fromCharCode(M)),M&&E<b;);if(512&i.flags&&(i.check=r(i.check,p,E,m)),b-=E,m+=E,M)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===b)break t;for(E=0;M=p[m+E++],i.head&&M&&i.length<65536&&(i.head.comment+=String.fromCharCode(M)),M&&E<b;);if(512&i.flags&&(i.check=r(i.check,p,E,m)),b-=E,m+=E,M)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;A<16;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(w!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}A=w=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}t.adler=i.check=g(w),A=w=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=v,t.avail_out=y,t.next_in=m,t.avail_in=b,i.hold=w,i.bits=A,2;t.adler=i.check=1,i.mode=12;case 12:if(5===e||6===e)break t;case 13:if(i.last){w>>>=7&A,A-=7&A,i.mode=27;break}for(;A<3;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}switch(i.last=1&w,A-=1,3&(w>>>=1)){case 0:i.mode=14;break;case 1:if(k(i),i.mode=20,6!==e)break;w>>>=2,A-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}w>>>=2,A-=2;break;case 14:for(w>>>=7&A,A-=7&A;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if((65535&w)!=(w>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&w,A=w=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(E=i.length){if(b<E&&(E=b),y<E&&(E=y),0===E)break t;s.arraySet(f,p,m,E,v),b-=E,m+=E,y-=E,v+=E,i.length-=E;break}i.mode=12;break;case 17:for(;A<14;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(i.nlen=257+(31&w),w>>>=5,A-=5,i.ndist=1+(31&w),w>>>=5,A-=5,i.ncode=4+(15&w),w>>>=4,A-=4,286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;A<3;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.lens[j[i.have++]]=7&w,w>>>=3,A-=3}for(;i.have<19;)i.lens[j[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,$={bits:i.lenbits},N=o(0,i.lens,0,19,i.lencode,0,i.work,$),i.lenbits=$.bits,N){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;P=(q=i.lencode[w&(1<<i.lenbits)-1])>>>16&255,_=65535&q,!((I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(_<16)w>>>=I,A-=I,i.lens[i.have++]=_;else{if(16===_){for(V=I+2;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(w>>>=I,A-=I,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}M=i.lens[i.have-1],E=3+(3&w),w>>>=2,A-=2}else if(17===_){for(V=I+3;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}A-=I,M=0,E=3+(7&(w>>>=I)),w>>>=3,A-=3}else{for(V=I+7;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}A-=I,M=0,E=11+(127&(w>>>=I)),w>>>=7,A-=7}if(i.have+E>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;E--;)i.lens[i.have++]=M}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,$={bits:i.lenbits},N=o(l,i.lens,0,i.nlen,i.lencode,0,i.work,$),i.lenbits=$.bits,N){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,$={bits:i.distbits},N=o(c,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,$),i.distbits=$.bits,N){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(6<=b&&258<=y){t.next_out=v,t.avail_out=y,t.next_in=m,t.avail_in=b,i.hold=w,i.bits=A,a(t,C),v=t.next_out,f=t.output,y=t.avail_out,m=t.next_in,p=t.input,b=t.avail_in,w=i.hold,A=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;P=(q=i.lencode[w&(1<<i.lenbits)-1])>>>16&255,_=65535&q,!((I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(P&&0==(240&P)){for(D=I,R=P,O=_;P=(q=i.lencode[O+((w&(1<<D+R)-1)>>D)])>>>16&255,_=65535&q,!(D+(I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}w>>>=D,A-=D,i.back+=D}if(w>>>=I,A-=I,i.back+=I,i.length=_,0===P){i.mode=26;break}if(32&P){i.back=-1,i.mode=12;break}if(64&P){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&P,i.mode=22;case 22:if(i.extra){for(V=i.extra;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.length+=w&(1<<i.extra)-1,w>>>=i.extra,A-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;P=(q=i.distcode[w&(1<<i.distbits)-1])>>>16&255,_=65535&q,!((I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(0==(240&P)){for(D=I,R=P,O=_;P=(q=i.distcode[O+((w&(1<<D+R)-1)>>D)])>>>16&255,_=65535&q,!(D+(I=q>>>24)<=A);){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}w>>>=D,A-=D,i.back+=D}if(w>>>=I,A-=I,i.back+=I,64&P){t.msg="invalid distance code",i.mode=30;break}i.offset=_,i.extra=15&P,i.mode=24;case 24:if(i.extra){for(V=i.extra;A<V;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}i.offset+=w&(1<<i.extra)-1,w>>>=i.extra,A-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===y)break t;if(E=C-y,i.offset>E){if((E=i.offset-E)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}T=E>i.wnext?(E-=i.wnext,i.wsize-E):i.wnext-E,E>i.length&&(E=i.length),B=i.window}else B=f,T=v-i.offset,E=i.length;for(y<E&&(E=y),y-=E,i.length-=E;f[v++]=B[T++],--E;);0===i.length&&(i.mode=21);break;case 26:if(0===y)break t;f[v++]=i.length,y--,i.mode=21;break;case 27:if(i.wrap){for(;A<32;){if(0===b)break t;b--,w|=p[m++]<<A,A+=8}if(C-=y,t.total_out+=C,i.total+=C,C&&(t.adler=i.check=i.flags?r(i.check,f,C,v-C):n(i.check,f,C,v-C)),C=y,(i.flags?w:g(w))!==i.check){t.msg="incorrect data check",i.mode=30;break}A=w=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;A<32;){if(0===b)break t;b--,w+=p[m++]<<A,A+=8}if(w!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}A=w=0}i.mode=29;case 29:N=1;break t;case 30:N=-3;break t;case 31:return-4;default:return u}return t.next_out=v,t.avail_out=y,t.next_in=m,t.avail_in=b,i.hold=w,i.bits=A,(i.wsize||C!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&S(t,t.output,t.next_out,C-t.avail_out)?(i.mode=31,-4):(x-=t.avail_in,C-=t.avail_out,t.total_in+=x,t.total_out+=C,i.total+=C,i.wrap&&C&&(t.adler=i.check=i.flags?r(i.check,f,C,t.next_out-C):n(i.check,f,C,t.next_out-C)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==x&&0===C||4===e)&&N===h&&(N=-5),N)},i.inflateEnd=function(t){if(!t||!t.state)return u;var e=t.state;return e.window&&(e.window=null),t.state=null,h},i.inflateGetHeader=function(t,e){var i;return t&&t.state?0==(2&(i=t.state).wrap)?u:((i.head=e).done=!1,h):u},i.inflateSetDictionary=function(t,e){var i,s=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?u:11===i.mode&&n(1,e,s,0)!==i.check?-3:S(t,e,s,s)?(i.mode=31,-4):(i.havedict=1,h):u},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,i){"use strict";var s=t("../utils/common"),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,i,l,c,h,u,d){var p,f,g,m,v,b,y,w,A,x=d.bits,C=0,k=0,S=0,E=0,T=0,B=0,I=0,P=0,_=0,D=0,R=null,O=0,M=new s.Buf16(16),N=new s.Buf16(16),$=null,V=0;for(C=0;C<=15;C++)M[C]=0;for(k=0;k<l;k++)M[e[i+k]]++;for(T=x,E=15;1<=E&&0===M[E];E--);if(E<T&&(T=E),0===E)return c[h++]=20971520,c[h++]=20971520,d.bits=1,0;for(S=1;S<E&&0===M[S];S++);for(T<S&&(T=S),C=P=1;C<=15;C++)if(P<<=1,(P-=M[C])<0)return-1;if(0<P&&(0===t||1!==E))return-1;for(N[1]=0,C=1;C<15;C++)N[C+1]=N[C]+M[C];for(k=0;k<l;k++)0!==e[i+k]&&(u[N[e[i+k]]++]=k);if(b=0===t?(R=$=u,19):1===t?(R=n,O-=257,$=r,V-=257,256):(R=a,$=o,-1),C=S,v=h,I=k=D=0,g=-1,m=(_=1<<(B=T))-1,1===t&&852<_||2===t&&592<_)return 1;for(;;){for(y=C-I,A=u[k]<b?(w=0,u[k]):u[k]>b?(w=$[V+u[k]],R[O+u[k]]):(w=96,0),p=1<<C-I,S=f=1<<B;c[v+(D>>I)+(f-=p)]=y<<24|w<<16|A|0,0!==f;);for(p=1<<C-1;D&p;)p>>=1;if(0!==p?(D&=p-1,D+=p):D=0,k++,0==--M[C]){if(C===E)break;C=e[i+u[k]]}if(T<C&&(D&m)!==g){for(0===I&&(I=T),v+=S,P=1<<(B=C-I);B+I<E&&!((P-=M[B+I])<=0);)B++,P<<=1;if(_+=1<<B,1===t&&852<_||2===t&&592<_)return 1;c[g=D&m]=T<<24|B<<16|v-h|0}}return 0!==D&&(c[v+D]=C-I<<24|64<<16|0),d.bits=T,0}},{"../utils/common":41}],51:[function(t,e,i){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,i){"use strict";var s=t("../utils/common"),n=0,r=1;function a(t){for(var e=t.length;0<=--e;)t[e]=0}var o=0,l=29,c=256,h=c+1+l,u=30,d=19,p=2*h+1,f=15,g=16,m=7,v=256,b=16,y=17,w=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=new Array(2*(h+2));a(S);var E=new Array(2*u);a(E);var T=new Array(512);a(T);var B=new Array(256);a(B);var I=new Array(l);a(I);var P,_,D,R=new Array(u);function O(t,e,i,s,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=s,this.max_length=n,this.has_stree=t&&t.length}function M(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function N(t){return t<256?T[t]:T[256+(t>>>7)]}function $(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function V(t,e,i){t.bi_valid>g-i?(t.bi_buf|=e<<t.bi_valid&65535,$(t,t.bi_buf),t.bi_buf=e>>g-t.bi_valid,t.bi_valid+=i-g):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function q(t,e,i){V(t,i[2*e],i[2*e+1])}function L(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function j(t,e,i){var s,n,r=new Array(f+1),a=0;for(s=1;s<=f;s++)r[s]=a=a+i[s-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=L(r[o]++,o))}}function F(t){var e;for(e=0;e<h;e++)t.dyn_ltree[2*e]=0;for(e=0;e<u;e++)t.dyn_dtree[2*e]=0;for(e=0;e<d;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*v]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function z(t){8<t.bi_valid?$(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function U(t,e,i,s){var n=2*e,r=2*i;return t[n]<t[r]||t[n]===t[r]&&s[e]<=s[i]}function H(t,e,i){for(var s=t.heap[i],n=i<<1;n<=t.heap_len&&(n<t.heap_len&&U(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!U(e,s,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=s}function W(t,e,i){var s,n,r,a,o=0;if(0!==t.last_lit)for(;s=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],n=t.pending_buf[t.l_buf+o],o++,0===s?q(t,n,e):(q(t,(r=B[n])+c+1,e),0!==(a=A[r])&&V(t,n-=I[r],a),q(t,r=N(--s),i),0!==(a=x[r])&&V(t,s-=R[r],a)),o<t.last_lit;);q(t,v,e)}function G(t,e){var i,s,n,r=e.dyn_tree,a=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=p,i=0;i<l;i++)0!==r[2*i]?(t.heap[++t.heap_len]=c=i,t.depth[i]=0):r[2*i+1]=0;for(;t.heap_len<2;)r[2*(n=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=a[2*n+1]);for(e.max_code=c,i=t.heap_len>>1;1<=i;i--)H(t,r,i);for(n=l;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],H(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=s,r[2*n]=r[2*i]+r[2*s],t.depth[n]=(t.depth[i]>=t.depth[s]?t.depth[i]:t.depth[s])+1,r[2*i+1]=r[2*s+1]=n,t.heap[1]=n++,H(t,r,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,s,n,r,a,o,l=e.dyn_tree,c=e.max_code,h=e.stat_desc.static_tree,u=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,g=e.stat_desc.extra_base,m=e.stat_desc.max_length,v=0;for(r=0;r<=f;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<p;i++)m<(r=l[2*l[2*(s=t.heap[i])+1]+1]+1)&&(r=m,v++),l[2*s+1]=r,c<s||(t.bl_count[r]++,a=0,g<=s&&(a=d[s-g]),o=l[2*s],t.opt_len+=o*(r+a),u&&(t.static_len+=o*(h[2*s+1]+a)));if(0!==v){do{for(r=m-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[m]--,v-=2}while(0<v);for(r=m;0!==r;r--)for(s=t.bl_count[r];0!==s;)c<(n=t.heap[--i])||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),s--)}}(t,e),j(r,c,t.bl_count)}function J(t,e,i){var s,n,r=-1,a=e[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),e[2*(i+1)+1]=65535,s=0;s<=i;s++)n=a,a=e[2*(s+1)+1],++o<l&&n===a||(o<c?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*b]++):o<=10?t.bl_tree[2*y]++:t.bl_tree[2*w]++,r=n,c=(o=0)===a?(l=138,3):n===a?(l=6,3):(l=7,4))}function K(t,e,i){var s,n,r=-1,a=e[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),s=0;s<=i;s++)if(n=a,a=e[2*(s+1)+1],!(++o<l&&n===a)){if(o<c)for(;q(t,n,t.bl_tree),0!=--o;);else 0!==n?(n!==r&&(q(t,n,t.bl_tree),o--),q(t,b,t.bl_tree),V(t,o-3,2)):o<=10?(q(t,y,t.bl_tree),V(t,o-3,3)):(q(t,w,t.bl_tree),V(t,o-11,7));r=n,c=(o=0)===a?(l=138,3):n===a?(l=6,3):(l=7,4)}}a(R);var Z=!1;function Y(t,e,i,n){V(t,(o<<1)+(n?1:0),3),function(t,e,i,n){z(t),n&&($(t,i),$(t,~i)),s.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}(t,e,i,!0)}i._tr_init=function(t){Z||(function(){var t,e,i,s,n,r=new Array(f+1);for(s=i=0;s<l-1;s++)for(I[s]=i,t=0;t<1<<A[s];t++)B[i++]=s;for(B[i-1]=s,s=n=0;s<16;s++)for(R[s]=n,t=0;t<1<<x[s];t++)T[n++]=s;for(n>>=7;s<u;s++)for(R[s]=n<<7,t=0;t<1<<x[s]-7;t++)T[256+n++]=s;for(e=0;e<=f;e++)r[e]=0;for(t=0;t<=143;)S[2*t+1]=8,t++,r[8]++;for(;t<=255;)S[2*t+1]=9,t++,r[9]++;for(;t<=279;)S[2*t+1]=7,t++,r[7]++;for(;t<=287;)S[2*t+1]=8,t++,r[8]++;for(j(S,h+1,r),t=0;t<u;t++)E[2*t+1]=5,E[2*t]=L(t,5);P=new O(S,A,c+1,h,f),_=new O(E,x,0,u,f),D=new O(new Array(0),C,0,d,m)}(),Z=!0),t.l_desc=new M(t.dyn_ltree,P),t.d_desc=new M(t.dyn_dtree,_),t.bl_desc=new M(t.bl_tree,D),t.bi_buf=0,t.bi_valid=0,F(t)},i._tr_stored_block=Y,i._tr_flush_block=function(t,e,i,s){var a,o,l=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return n;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return r;for(e=32;e<c;e++)if(0!==t.dyn_ltree[2*e])return r;return n}(t)),G(t,t.l_desc),G(t,t.d_desc),l=function(t){var e;for(J(t,t.dyn_ltree,t.l_desc.max_code),J(t,t.dyn_dtree,t.d_desc.max_code),G(t,t.bl_desc),e=d-1;3<=e&&0===t.bl_tree[2*k[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),a=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=a&&(a=o)):a=o=i+5,i+4<=a&&-1!==e?Y(t,e,i,s):4===t.strategy||o===a?(V(t,2+(s?1:0),3),W(t,S,E)):(V(t,4+(s?1:0),3),function(t,e,i,s){var n;for(V(t,e-257,5),V(t,i-1,5),V(t,s-4,4),n=0;n<s;n++)V(t,t.bl_tree[2*k[n]+1],3);K(t,t.dyn_ltree,e-1),K(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,l+1),W(t,t.dyn_ltree,t.dyn_dtree)),F(t),s&&z(t)},i._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(B[i]+c+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){V(t,2,3),q(t,v,S),function(t){16===t.bi_valid?($(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,i){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,s){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var i,s,n,r,a=1,o={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,i="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?(r="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){n.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(s=c.documentElement,function(t){var e=c.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,s.removeChild(e),e=null},s.appendChild(e)}):function(t){setTimeout(d,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),s=0;s<e.length;s++)e[s]=arguments[s+1];var n={callback:t,args:e};return o[a]=n,i(a),a++},h.clearImmediate=u}function u(t){delete o[t]}function d(t){if(l)setTimeout(d,0,t);else{var i=o[t];if(i){l=!0;try{!function(t){var i=t.callback,s=t.args;switch(s.length){case 0:i();break;case 1:i(s[0]);break;case 2:i(s[0],s[1]);break;case 3:i(s[0],s[1],s[2]);break;default:i.apply(e,s)}}(i)}finally{u(t),l=!1}}}}function p(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&d(+e.data.slice(r.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},933:function(t,e,i){var s;!function(){function n(t,e,i){return t.call.apply(t.bind,arguments)}function r(t,e,i){if(!t)throw Error();if(2<arguments.length){var s=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,s),t.apply(e,i)}}return function(){return t.apply(e,arguments)}}function a(t,e,i){return(a=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?n:r).apply(null,arguments)}var o=Date.now||function(){return+new Date};function l(t,e){this.a=t,this.o=e||t,this.c=this.o.document}var c=!!window.FontFace;function h(t,e,i,s){if(e=t.c.createElement(e),i)for(var n in i)i.hasOwnProperty(n)&&("style"==n?e.style.cssText=i[n]:e.setAttribute(n,i[n]));return s&&e.appendChild(t.c.createTextNode(s)),e}function u(t,e,i){(t=t.c.getElementsByTagName(e)[0])||(t=document.documentElement),t.insertBefore(i,t.lastChild)}function d(t){t.parentNode&&t.parentNode.removeChild(t)}function p(t,e,i){e=e||[],i=i||[];for(var s=t.className.split(/\s+/),n=0;n<e.length;n+=1){for(var r=!1,a=0;a<s.length;a+=1)if(e[n]===s[a]){r=!0;break}r||s.push(e[n])}for(e=[],n=0;n<s.length;n+=1){for(r=!1,a=0;a<i.length;a+=1)if(s[n]===i[a]){r=!0;break}r||e.push(s[n])}t.className=e.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function f(t,e){for(var i=t.className.split(/\s+/),s=0,n=i.length;s<n;s++)if(i[s]==e)return!0;return!1}function g(t,e,i){function s(){o&&n&&r&&(o(a),o=null)}e=h(t,"link",{rel:"stylesheet",href:e,media:"all"});var n=!1,r=!0,a=null,o=i||null;c?(e.onload=function(){n=!0,s()},e.onerror=function(){n=!0,a=Error("Stylesheet failed to load"),s()}):setTimeout((function(){n=!0,s()}),0),u(t,"head",e)}function m(t,e,i,s){var n=t.c.getElementsByTagName("head")[0];if(n){var r=h(t,"script",{src:e}),a=!1;return r.onload=r.onreadystatechange=function(){a||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(a=!0,i&&i(null),r.onload=r.onreadystatechange=null,"HEAD"==r.parentNode.tagName&&n.removeChild(r))},n.appendChild(r),setTimeout((function(){a||(a=!0,i&&i(Error("Script load timeout")))}),s||5e3),r}return null}function v(){this.a=0,this.c=null}function b(t){return t.a++,function(){t.a--,w(t)}}function y(t,e){t.c=e,w(t)}function w(t){0==t.a&&t.c&&(t.c(),t.c=null)}function A(t){this.a=t||"-"}function x(t,e){this.c=t,this.f=4,this.a="n";var i=(e||"n4").match(/^([nio])([1-9])$/i);i&&(this.a=i[1],this.f=parseInt(i[2],10))}function C(t){var e=[];t=t.split(/,\s*/);for(var i=0;i<t.length;i++){var s=t[i].replace(/['"]/g,"");-1!=s.indexOf(" ")||/^\d/.test(s)?e.push("'"+s+"'"):e.push(s)}return e.join(",")}function k(t){return t.a+t.f}function S(t){var e="normal";return"o"===t.a?e="oblique":"i"===t.a&&(e="italic"),e}function E(t){var e=4,i="n",s=null;return t&&((s=t.match(/(normal|oblique|italic)/i))&&s[1]&&(i=s[1].substr(0,1).toLowerCase()),(s=t.match(/([1-9]00|normal|bold)/i))&&s[1]&&(/bold/i.test(s[1])?e=7:/[1-9]00/.test(s[1])&&(e=parseInt(s[1].substr(0,1),10)))),i+e}function T(t,e){this.c=t,this.f=t.o.document.documentElement,this.h=e,this.a=new A("-"),this.j=!1!==e.events,this.g=!1!==e.classes}function B(t){if(t.g){var e=f(t.f,t.a.c("wf","active")),i=[],s=[t.a.c("wf","loading")];e||i.push(t.a.c("wf","inactive")),p(t.f,i,s)}I(t,"inactive")}function I(t,e,i){t.j&&t.h[e]&&(i?t.h[e](i.c,k(i)):t.h[e]())}function P(){this.c={}}function _(t,e){this.c=t,this.f=e,this.a=h(this.c,"span",{"aria-hidden":"true"},this.f)}function D(t){u(t.c,"body",t.a)}function R(t){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+C(t.c)+";font-style:"+S(t)+";font-weight:"+t.f+"00;"}function O(t,e,i,s,n,r){this.g=t,this.j=e,this.a=s,this.c=i,this.f=n||3e3,this.h=r||void 0}function M(t,e,i,s,n,r,a){this.v=t,this.B=e,this.c=i,this.a=s,this.s=a||"BESbswy",this.f={},this.w=n||3e3,this.u=r||null,this.m=this.j=this.h=this.g=null,this.g=new _(this.c,this.s),this.h=new _(this.c,this.s),this.j=new _(this.c,this.s),this.m=new _(this.c,this.s),t=R(t=new x(this.a.c+",serif",k(this.a))),this.g.a.style.cssText=t,t=R(t=new x(this.a.c+",sans-serif",k(this.a))),this.h.a.style.cssText=t,t=R(t=new x("serif",k(this.a))),this.j.a.style.cssText=t,t=R(t=new x("sans-serif",k(this.a))),this.m.a.style.cssText=t,D(this.g),D(this.h),D(this.j),D(this.m)}A.prototype.c=function(t){for(var e=[],i=0;i<arguments.length;i++)e.push(arguments[i].replace(/[\W_]+/g,"").toLowerCase());return e.join(this.a)},O.prototype.start=function(){var t=this.c.o.document,e=this,i=o(),s=new Promise((function(s,n){!function r(){o()-i>=e.f?n():t.fonts.load(function(t){return S(t)+" "+t.f+"00 300px "+C(t.c)}(e.a),e.h).then((function(t){1<=t.length?s():setTimeout(r,25)}),(function(){n()}))}()})),n=null,r=new Promise((function(t,i){n=setTimeout(i,e.f)}));Promise.race([r,s]).then((function(){n&&(clearTimeout(n),n=null),e.g(e.a)}),(function(){e.j(e.a)}))};var N={D:"serif",C:"sans-serif"},$=null;function V(){if(null===$){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);$=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return $}function q(t,e,i){for(var s in N)if(N.hasOwnProperty(s)&&e===t.f[N[s]]&&i===t.f[N[s]])return!0;return!1}function L(t){var e,i=t.g.a.offsetWidth,s=t.h.a.offsetWidth;(e=i===t.f.serif&&s===t.f["sans-serif"])||(e=V()&&q(t,i,s)),e?o()-t.A>=t.w?V()&&q(t,i,s)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?j(t,t.v):j(t,t.B):function(t){setTimeout(a((function(){L(this)}),t),50)}(t):j(t,t.v)}function j(t,e){setTimeout(a((function(){d(this.g.a),d(this.h.a),d(this.j.a),d(this.m.a),e(this.a)}),t),0)}function F(t,e,i){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=i}M.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),L(this)};var z=null;function U(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&p(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),I(t,"active")):B(t.a))}function H(t){this.j=t,this.a=new P,this.h=0,this.f=this.g=!0}function W(t,e,i,s,n){var r=0==--t.h;(t.f||t.g)&&setTimeout((function(){var t=n||null,o=s||{};if(0===i.length&&r)B(e.a);else{e.f+=i.length,r&&(e.j=r);var l,c=[];for(l=0;l<i.length;l++){var h=i[l],u=o[h.c],d=e.a,f=h;if(d.g&&p(d.f,[d.a.c("wf",f.c,k(f).toString(),"loading")]),I(d,"fontloading",f),d=null,null===z)if(window.FontFace){f=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var g=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);z=f?42<parseInt(f[1],10):!g}else z=!1;d=z?new O(a(e.g,e),a(e.h,e),e.c,h,e.s,u):new M(a(e.g,e),a(e.h,e),e.c,h,e.s,t,u),c.push(d)}for(l=0;l<c.length;l++)c[l].start()}}),0)}function G(t,e){this.c=t,this.a=e}function J(t,e){this.c=t,this.a=e}function K(t,e){this.c=t||Z,this.a=[],this.f=[],this.g=e||""}F.prototype.g=function(t){var e=this.a;e.g&&p(e.f,[e.a.c("wf",t.c,k(t).toString(),"active")],[e.a.c("wf",t.c,k(t).toString(),"loading"),e.a.c("wf",t.c,k(t).toString(),"inactive")]),I(e,"fontactive",t),this.m=!0,U(this)},F.prototype.h=function(t){var e=this.a;if(e.g){var i=f(e.f,e.a.c("wf",t.c,k(t).toString(),"active")),s=[],n=[e.a.c("wf",t.c,k(t).toString(),"loading")];i||s.push(e.a.c("wf",t.c,k(t).toString(),"inactive")),p(e.f,s,n)}I(e,"fontinactive",t),U(this)},H.prototype.load=function(t){this.c=new l(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes,function(t,e,i){var s=[],n=i.timeout;!function(t){t.g&&p(t.f,[t.a.c("wf","loading")]),I(t,"loading")}(e);s=function(t,e,i){var s,n=[];for(s in e)if(e.hasOwnProperty(s)){var r=t.c[s];r&&n.push(r(e[s],i))}return n}(t.a,i,t.c);var r=new F(t.c,e,n);for(t.h=s.length,e=0,i=s.length;e<i;e++)s[e].load((function(e,i,s){W(t,r,e,i,s)}))}(this,new T(this.c,t),t)},G.prototype.load=function(t){function e(){if(r["__mti_fntLst"+s]){var i,n=r["__mti_fntLst"+s](),a=[];if(n)for(var o=0;o<n.length;o++){var l=n[o].fontfamily;null!=n[o].fontStyle&&null!=n[o].fontWeight?(i=n[o].fontStyle+n[o].fontWeight,a.push(new x(l,i))):a.push(new x(l))}t(a)}else setTimeout((function(){e()}),50)}var i=this,s=i.a.projectId,n=i.a.version;if(s){var r=i.c.o;m(this.c,(i.a.api||"https://fast.fonts.net/jsapi")+"/"+s+".js"+(n?"?v="+n:""),(function(n){n?t([]):(r["__MonotypeConfiguration__"+s]=function(){return i.a},e())})).id="__MonotypeAPIScript__"+s}else t([])},J.prototype.load=function(t){var e,i,s=this.a.urls||[],n=this.a.families||[],r=this.a.testStrings||{},a=new v;for(e=0,i=s.length;e<i;e++)g(this.c,s[e],b(a));var o=[];for(e=0,i=n.length;e<i;e++)if((s=n[e].split(":"))[1])for(var l=s[1].split(","),c=0;c<l.length;c+=1)o.push(new x(s[0],l[c]));else o.push(new x(s[0]));y(a,(function(){t(o,r)}))};var Z="https://fonts.googleapis.com/css";function Y(t){this.f=t,this.a=[],this.c={}}var Q={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},X={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},tt={i:"i",italic:"i",n:"n",normal:"n"},et=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function it(t,e){this.c=t,this.a=e}var st={Arimo:!0,Cousine:!0,Tinos:!0};function nt(t,e){this.c=t,this.a=e}function rt(t,e){this.c=t,this.f=e,this.a=[]}it.prototype.load=function(t){var e=new v,i=this.c,s=new K(this.a.api,this.a.text),n=this.a.families;!function(t,e){for(var i=e.length,s=0;s<i;s++){var n=e[s].split(":");3==n.length&&t.f.push(n.pop());var r="";2==n.length&&""!=n[1]&&(r=":"),t.a.push(n.join(r))}}(s,n);var r=new Y(n);!function(t){for(var e=t.f.length,i=0;i<e;i++){var s=t.f[i].split(":"),n=s[0].replace(/\+/g," "),r=["n4"];if(2<=s.length){var a;if(a=[],o=s[1])for(var o,l=(o=o.split(",")).length,c=0;c<l;c++){var h;if((h=o[c]).match(/^[\w-]+$/))if(null==(u=et.exec(h.toLowerCase())))h="";else{if(h=null==(h=u[2])||""==h?"n":tt[h],null==(u=u[1])||""==u)u="4";else var u=X[u]||(isNaN(u)?"4":u.substr(0,1));h=[h,u].join("")}else h="";h&&a.push(h)}0<a.length&&(r=a),3==s.length&&(a=[],0<(s=(s=s[2])?s.split(","):a).length&&(s=Q[s[0]])&&(t.c[n]=s))}for(t.c[n]||(s=Q[n])&&(t.c[n]=s),s=0;s<r.length;s+=1)t.a.push(new x(n,r[s]))}}(r),g(i,function(t){if(0==t.a.length)throw Error("No fonts to load!");if(-1!=t.c.indexOf("kit="))return t.c;for(var e=t.a.length,i=[],s=0;s<e;s++)i.push(t.a[s].replace(/ /g,"+"));return e=t.c+"?family="+i.join("%7C"),0<t.f.length&&(e+="&subset="+t.f.join(",")),0<t.g.length&&(e+="&text="+encodeURIComponent(t.g)),e}(s),b(e)),y(e,(function(){t(r.a,r.c,st)}))},nt.prototype.load=function(t){var e=this.a.id,i=this.c.o;e?m(this.c,(this.a.api||"https://use.typekit.net")+"/"+e+".js",(function(e){if(e)t([]);else if(i.Typekit&&i.Typekit.config&&i.Typekit.config.fn){e=i.Typekit.config.fn;for(var s=[],n=0;n<e.length;n+=2)for(var r=e[n],a=e[n+1],o=0;o<a.length;o++)s.push(new x(r,a[o]));try{i.Typekit.load({events:!1,classes:!1,async:!0})}catch(t){}t(s)}}),2e3):t([])},rt.prototype.load=function(t){var e=this.f.id,i=this.c.o,s=this;e?(i.__webfontfontdeckmodule__||(i.__webfontfontdeckmodule__={}),i.__webfontfontdeckmodule__[e]=function(e,i){for(var n=0,r=i.fonts.length;n<r;++n){var a=i.fonts[n];s.a.push(new x(a.name,E("font-weight:"+a.weight+";font-style:"+a.style)))}t(s.a)},m(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(t){return t.o.location.hostname||t.a.location.hostname}(this.c)+"/"+e+".js",(function(e){e&&t([])}))):t([])};var at=new H(window);at.a.c.custom=function(t,e){return new J(e,t)},at.a.c.fontdeck=function(t,e){return new rt(e,t)},at.a.c.monotype=function(t,e){return new G(e,t)},at.a.c.typekit=function(t,e){return new nt(e,t)},at.a.c.google=function(t,e){return new it(e,t)};var ot={load:a(at.load,at)};void 0===(s=function(){return ot}.call(e,i,e,t))||(t.exports=s)}()}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,{a:e}),e},i.d=function(t,e){for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){"use strict";var t={};i.r(t),i.d(t,{ClipboardItem:function(){return Y},read:function(){return st},readText:function(){return K},setDebugLog:function(){return d},suppressWarnings:function(){return f},write:function(){return it},writeText:function(){return G}});var e=i(755),s=i.n(e),n=i(733),r=i.n(n),a=i(925),o=i.n(a),l="text/plain",c="text/html",h=t=>{};function u(t){h(t)}function d(t){h=t}var p=!0;function f(){p=!1}(function(){(console.warn||console.log).apply(console,arguments)}).bind("[clipboard-polyfill]");var g,m,v,b="undefined"==typeof window?void 0:window,y="undefined"==typeof globalThis?void 0:globalThis,w=null!=(v=null==(g=b)?void 0:g.Promise)?v:null==(m=y)?void 0:m.Promise;var A,x,C,k,S,E="undefined"==typeof navigator?void 0:navigator,T=null==E?void 0:E.clipboard,B=null==(A=null==T?void 0:T.read)?void 0:A.bind(T),I=null==(x=null==T?void 0:T.readText)?void 0:x.bind(T),P=null==(C=null==T?void 0:T.write)?void 0:C.bind(T),_=null==(k=null==T?void 0:T.writeText)?void 0:k.bind(T),D=null==(S=b)?void 0:S.ClipboardItem,R=function(){if(!w)throw new Error("No `Promise` implementation available for `clipboard-polyfill`. Consider using: https://github.com/lgarron/clipboard-polyfill#flat-file-version-with-promise-included");return w}(),O=b;function M(){return"undefined"==typeof ClipboardEvent&&void 0!==(null==O?void 0:O.clipboardData)&&void 0!==(null==O?void 0:O.clipboardData.setData)}function N(t,e,i){for(var s in u("listener called"),t.success=!0,e){var n=e[s],r=i.clipboardData;r.setData(s,n),s===l&&r.getData(s)!==n&&(u("setting text/plain failed"),t.success=!1)}i.preventDefault()}function $(t){var e={success:!1},i=N.bind(this,e,t);document.addEventListener("copy",i);try{document.execCommand("copy")}finally{document.removeEventListener("copy",i)}return e.success}function V(t,e){q(t);var i=$(e);return L(),i}function q(t){var e=document.getSelection();if(e){var i=document.createRange();i.selectNodeContents(t),e.removeAllRanges(),e.addRange(i)}}function L(){var t=document.getSelection();t&&t.removeAllRanges()}function j(t){var e=l in t;if(M()){if(!e)throw new Error("No `text/plain` value was specified.");if(function(t){if(!O.clipboardData)return!1;var e=O.clipboardData.setData("Text",t);return e&&u("writeTextIE worked"),e}(t[l]))return!0;throw new Error("Copying failed, possibly because the user rejected it.")}return $(t)?(u("regular execCopy worked"),!0):navigator.userAgent.indexOf("Edge")>-1?(u('UA "Edge" => assuming success'),!0):V(document.body,t)?(u("copyUsingTempSelection worked"),!0):function(t){var e=document.createElement("div");e.setAttribute("style","-webkit-user-select: text !important"),e.textContent="temporary element",document.body.appendChild(e);var i=V(e,t);return document.body.removeChild(e),i}(t)?(u("copyUsingTempElem worked"),!0):!!function(t){u("copyTextUsingDOM");var e=document.createElement("div");e.setAttribute("style","-webkit-user-select: text !important");var i=e;e.attachShadow&&(u("Using shadow DOM."),i=e.attachShadow({mode:"open"}));var s=document.createElement("span");s.innerText=t,i.appendChild(s),document.body.appendChild(e),q(s);var n=document.execCommand("copy");return L(),document.body.removeChild(e),n}(t[l])&&(u("copyTextUsingDOM worked"),!0)}function F(t,e){var i=[];for(var s in t){var n=t[s];i.push(e(n))}return R.all(i).then((e=>{for(var i={},s=0;s<t.length;s++)i[t[s]]=e[s];return i}))}var z=R.resolve(),U=()=>R.resolve(!0),H=R.resolve(!1);function W(t){return new R(((e,i)=>{try{e(t())}catch(t){i(t)}}))}function G(t){return W((()=>_?(u("Using `navigator.clipboard.writeText()`."),_(t).catch(J)):R.resolve(J(t))))}function J(t){if(!j(function(t){var e={};return e[l]=t,e}(t)))throw new Error("writeText() failed")}function K(){return W((()=>{if(I)return u("Using `navigator.clipboard.readText()`."),I();if(M()){var t=function(){if(!O.clipboardData)throw new Error("Cannot read IE clipboard Data ");var t=O.clipboardData.getData("Text");if(""===t)throw new Error("Empty clipboard or could not read plain text from clipboard");return t}();return R.resolve(t)}throw new Error("Read is not supported in your browser.")}))}function Z(t,e){for(var i in t){if(-1!==t[i].types.indexOf(e))return!0}return!1}var Y=function(t,e){var i,s=Object.keys(t),n={};for(var r in t){var a=t[r];n[r]="string"==typeof a?Q(r,a):a}return{types:s,presentationStyle:null!=(i=null==e?void 0:e.presentationStyle)?i:"unspecified",getType:function(t){return R.resolve(n[t])}}};function Q(t,e){return new Blob([e],{type:t})}function X(t){return F(t.types,(function(e){return t.getType(e)})).then((e=>new Promise(((i,s)=>{var n={};t.presentationStyle&&(n.presentationStyle=t.presentationStyle),D?i(new D(e,n)):s("window.ClipboardItem is not defined")}))))}function tt(t){var e={};return e[l]=Q(t,l),new Y(e)}function et(t,e){return t.getType(e).then((t=>{return e=t,new R(((t,i)=>{var s=new FileReader;s.addEventListener("load",(()=>{var e=s.result;"string"==typeof e?t(e):i("could not convert blob to string")})),s.readAsText(e)}));var e}))}function it(t){return W((()=>{if(P&&D){var e=P;return u("Using `navigator.clipboard.write()`."),R.all(t.map(X)).then((i=>e(i).then(U).catch((e=>{if(!Z(t,l)&&!Z(t,c))throw e;return H}))))}return H})).then((e=>{if(e)return z;var i=Z(t,l);return p&&!i&&u("clipboard.write() was called without a `text/plain` data type. On some platforms, this may result in an empty clipboard. Call suppressWarnings() to suppress this warning."),function(t){return F(t.types,(function(e){return et(t,e)}))}(t[0]).then((t=>{if(!j(t))throw new Error("write() failed")}))}))}function st(){return W((()=>B?(u("Using `navigator.clipboard.read()`."),B()):K().then((t=>[tt(t)]))))}var nt=i(933),rt=i.n(nt),at={version:"2.1.15 (2023-10-20)",languages:["en","ar","ast","bs","ca","ca_ES@valencia","cs","da","de","el","es","eu","fr","gl","he","it","ja","nl","pl","pt","pt_BR","ro","ru","tr","vec","zh_TW"],messages:{ar:{Version:"الإصدار",time:"الوقت",actions:"المحاولات",score:"النتيجة","Next activity":"النشاط التالي","Previous activity":"النشاط السابق","Restart activity":"استئنف النشاط",Information:"المعلومة","Current results":"تقارير المستخدم","User:":"المستخدم:","Projects:":"المشاريع:",Project:"المشروع:",sequence:"التسلسل",activity:"النشاط",OK:"موافق","Total:":"المجموع:"},ast:{Version:"Versión",time:"tiempu",actions:"intentos",score:"marcador","Next activity":"Xera siguiente","Previous activity":"Xera anterior","Restart activity":"Reaniciar xera",Information:"Información","Results are not currently being saved":"L'informe nun ta rexistráu en nenguna base de datos","Current results":"Informes d'usuariu","Session started:":"Entamu de sesión:","Reports system:":"Sistema d'informes:","User:":"Usuariu:","Projects:":"Proyeutos:","Sequences:":"Secuencies:","Activities done:":"Xeres feches:","Activities solved:":"Xeres correctes:","Global score:":"Puntuación global:","Total time in activities:":"Tiempu total en xeres:","Actions done:":"Aiciones feches:","No activities done!":"¡Nenguna información sobre xeres!",Project:"Proyeutu:",sequence:"Secuencia",activity:"Xera",OK:"OK",YES:"SI",NO:"NON","Total:":"Total:"},bs:{Version:"Verzija",time:"vrijeme",actions:"pokušaji",score:"rezultat","Next activity":"Sljedeća aktivnost","Previous activity":"Prethodna aktivnost","Restart activity":"Ponovno pokreni aktivnost",Information:"Informacije","Current results":"Izvješća korisnika","Session started:":"Sesija započeta:","User:":"Korisnik:","Projects:":"Projekti:","Activities done:":"Urađene aktivnosti:","Activities solved:":"Aktivnosti ok:","Global score:":"Ukupan rezultat:","Total time in activities:":"Ukupno vrijeme aktivnosti:","Actions done:":"Urađene aktivnosti:",Project:"Projekt:",sequence:"Sekvenca",activity:"Aktivnost",OK:"Uredu",YES:"DA",NO:"NE","Total:":"Ukupno:"},ca:{Version:"Versió",time:"temps",actions:"accions",score:"encerts","Next activity":"Activitat següent","Previous activity":"Activitat anterior","Restart activity":"Reinicia l'activitat",Information:"Informació","Results are not currently being saved":"Els resultats no s'estan desant","Current results":"Resultats actuals","Session started:":"Inici de sessió:","Reports system:":"Sistema d'informes:","User:":"Usuari/ària:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","(out of all project activities)":"(sobre totes les activitats del projecte)","Total time in activities:":"Temps total en les activitats:","Actions done:":"Accions fetes:","No activities done!":"No heu fet cap activitat!",Project:"Projecte",sequence:"seqüència",activity:"activitat",OK:"OK",YES:"SÍ",NO:"NO","Total:":"Totals:","Select group:":"Seleccioneu el grup:","Select user:":"Seleccioneu l'usuari:",Cancel:"Cancel·la",Close:"Tanca","Copy data to clipboard":"Copia les dades al porta-retalls","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les dades s'han copiat en format HTML. Enganxeu-les a un full de càlcul o a un editor de text enriquit.","The data has been copied to clipboard":"Les dades s'han copiat al porta-retalls","not connected":"no connectat","Please wait until the results of your activities are sent to the reports system":"Si us plau, espereu a que els resultats de les vostres activitats s'enviïn al servidor d'informes","Password:":"Contrasenya:","Incorrect password":"Contrasenya incorrecta","Invalid user":"Usuari/ària incorrecte","Partial score:":"Puntuació parcial:","(out of played activities)":"(sobre les activitats fetes)","Activities played at least once:":"Activitats fetes almenys una vegada:",Reports:"Informes","Toggle full screen":"Commuta pantalla completa","JClic logo":"Logotip del JClic",message:"missatge","Activity panel":"Tauler d'activitats",cell:"cel·la",image:"imatge",source:"origen",target:"destí","image fragment":"fragment d'imatge"},"ca_ES@valencia":{Version:"Versió",time:"temps",actions:"accions",score:"encerts","Next activity":"Activitat següent","Previous activity":"Activitat anterior","Restart activity":"Reinicia l'activitat",Information:"Informació","Results are not currently being saved":"Els resultats no s'estan alçant","Current results":"Resultats actuals","Session started:":"Inici de sessió:","Reports system:":"Sistema d'informes:","User:":"Usuari/ària:","Projects:":"Projectes:","Sequences:":"Seqüències:","Activities done:":"Activitats fetes:","Activities solved:":"Activitats resoltes:","Global score:":"Puntuació global:","Total time in activities:":"Temps total en les activitats:","Actions done:":"Accions fetes:","No activities done!":"No heu fet cap activitat!",Project:"Projecte",sequence:"seqüència",activity:"activitat",OK:"OK",YES:"SÍ",NO:"NO","Total:":"Totals:"},cs:{Version:"Verze",time:"čas",actions:"pokusů",score:"skóre","Next activity":"Další aktivita","Previous activity":"Předchozí aktivita","Restart activity":"Restartovat aktivitu",Information:"Informace","Results are not currently being saved":"Zpráva není zaregistrována v žádné DB","Current results":"Uživatelská sestava","Session started:":"Sezení spuštěno:","Reports system:":"Systém zprávy:","User:":"Uživatel:","Projects:":"Projekty:","Sequences:":"Sekvence:","Activities done:":"Dokončené aktivity:","Activities solved:":"Aktivity ok:","Global score:":"Celkové skóre:","Total time in activities:":"Celkový čas aktivit:","Actions done:":"Provedené akce:","No activities done!":"Nebyly nahlášeny žádné aktivity!",Project:"Projekt",sequence:"Sekvence",activity:"Aktivita",OK:"Ok",YES:"ANO",NO:"NE","Total:":"Celkem:"},da:{Version:"Version",time:"tid",actions:"forsøg",score:"score","Next activity":"Næste aktivitet","Previous activity":"Forrige aktivitet","Restart activity":"Genstart aktivitet",Information:"Information","Current results":"Bruger rapport","User:":"Bruger:","Projects:":"Projekter:","Sequences:":"Sekvenser:","Activities done:":"Aktiviteter udført:","Activities solved:":"Aktiviteter OK:","Global score:":"Global score:","No activities done!":"Ingen aktiviteter rapporteret!",Project:"Projekt",sequence:"Sequence",activity:"Aktivitet",OK:"Ok",YES:"JA",NO:"IKKE","Total:":"Total:"},de:{Version:"Version",time:"Zeit",actions:"Versuche",score:"Ergebnis","Next activity":"Nächste Übung","Previous activity":"Vorherige Übung","Restart activity":"Übung neu starten",Information:"Information","Results are not currently being saved":"Bericht in keiner Datenbank eingetragen","Current results":"Benutzerberichte","Session started:":"Sitzung gestartet:","Reports system:":"Report system:","User:":"User:","Projects:":"Projekte:","Sequences:":"Sequenzen:","Activities done:":"Beendete Übungen:","Activities solved:":"Korrekte Übungen:","Global score:":"Gesamtpunktezahl:","Total time in activities:":"Übungs-Gesamtzeit:","Actions done:":"Durchgeführte Aktionen:","No activities done!":"Keine Übungsberichte vorhanden!",Project:"Projekt",sequence:"Sequenz",activity:"Übung",OK:"OK",YES:"JA",NO:"NEIN","Total:":"Gesamt:"},el:{Version:"Έκδοση",time:"χρόνος",actions:"προσπάθειες",score:"βαθμολογία","Next activity":"Επόμενη δραστηριότητα","Previous activity":"Προηγούμενη δραστηριότητα","Restart activity":"Επανεκκίνηση δραστηριότητας",Information:"Πληροφορίες","Results are not currently being saved":"Η αναφορά δεν εγγράφηκε στις βάσεις δεδομένων","Current results":"Αναφορές χρήστη","Session started:":"Έναρξη συνεδρίας:","Reports system:":"Σύστημα αναφορών:","User:":"Χρήστης:","Projects:":"Έργα:","Sequences:":"Αλληλουχίες:","Activities done:":"Ολοκληρωμένες δραστηριότητες:","Activities solved:":"Δραστηριότητες, εντάξει:","Global score:":"Συνολική βαθμολογία:","Total time in activities:":"Συνολικός χρόνος δραστηριοτήτων:","Actions done:":"Οι ενέργειες ολοκληρώθηκαν:","No activities done!":"Για καμμία δραστηριότητα δεν έχει υποβληθεί αναφορά!",Project:"Έργο",sequence:"Αλληλουχία",activity:"Δραστηριότητα",OK:"Εντάξει",YES:"Ναί",NO:"όχι","Total:":"Σύνολο:"},es:{Version:"Versión",time:"tiempo",actions:"acciones",score:"aciertos","Next activity":"Actividad siguiente","Previous activity":"Actividad anterior","Restart activity":"Reiniciar actividad",Information:"Información","Results are not currently being saved":"Los resultados no se están guardando","Current results":"Resultados actuales","Session started:":"Inicio de sesión:","Reports system:":"Sistema de informes:","User:":"Usuario/aria:","Projects:":"Proyectos:","Sequences:":"Secuencias:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades resueltas:","Global score:":"Puntuación global:","(out of all project activities)":"(sobre todas las actividades del proyecto)","Total time in activities:":"Tiempo total en las actividades:","Actions done:":"Acciones realizadas:","No activities done!":"¡No se ha realizado ninguna actividad!",Project:"Proyecto",sequence:"secuencia",activity:"actividad",OK:"OK",YES:"SI",NO:"NO","Total:":"Totales:","Select group:":"Seleccionar grupo:","Select user:":"Seleccionar usuario:",Cancel:"Cancelar",Close:"Cerrar","Copy data to clipboard":"Copiar datos al portapapeles","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Los datos se han copiado en formato HTML. Puedes pegarlos en una hoja de cálculo o en un editor de texto rico.","The data has been copied to clipboard":"Los datos se han copiado al portapapeles","not connected":"no conectado","Please wait until the results of your activities are sent to the reports system":"Por favor, espera mientras los resultados de las actividades se envian al servidor de informes","Password:":"Contraseña:","Incorrect password":"Contraseña incorrecta","Invalid user":"Usuario incorrecto","Partial score:":"Puntuación parcial:","(out of played activities)":"(sobre las actividades realizadas)","Activities played at least once:":"Actividades realizadas al menos una vez:",Reports:"Informes","Toggle full screen":"Conmutar pantalla completa","JClic logo":"Logotipo de JClic",message:"mensaje","Activity panel":"Panel de actividad",cell:"celda",image:"imagen",source:"origen",target:"destino","image fragment":"fragmento de imagen"},eu:{Version:"Bertsioa",time:"denbora",actions:"saiakerak",score:"puntuazioa","Next activity":"Hurrengo jarduera","Previous activity":"Aurreko jarduera","Restart activity":"Jarduera berriro hasi",Information:"Informazioa","Results are not currently being saved":"Txostena ez dago ezein datu-basetan","Current results":"Erabiltzailearen txostenak","Session started:":"Saio-hasiera:","Reports system:":"Txosten-sistema:","User:":"Erabiltzailea:","Projects:":"Proiektuak:","Sequences:":"Sekuentziak:","Activities done:":"Burututako ekinzak:","Activities solved:":"Jarduera zuzenak:","Global score:":"Jarduera zuzenak:","Total time in activities:":"Jardueretan emandako denbora guztira:","Actions done:":"Burututako ekintzak:","No activities done!":"Ez da jardueren txostenik!",Project:"Proiektua",sequence:"Sekuentzia",activity:"Jarduera",OK:"Ados",YES:"BAI",NO:"EZ","Total:":"Guztira:"},fr:{Version:"Version",time:"temps",actions:"essais",score:"résultat","Next activity":"Activité suivante","Previous activity":"Activité précédente","Restart activity":"Recommencer l'activité",Information:"Information","Results are not currently being saved":"Le rapport n'est enregistré dans aucune base de données","Current results":"Rapports utilisateur","Session started:":"Session démarrée:","Reports system:":"Report système:","User:":"Utilisateur:","Projects:":"Projets:","Sequences:":"Séquences:","Activities done:":"Activités faites:","Activities solved:":"Activités ok:","Global score:":"Score global:","(out of all project activities)":"(Hors de toutes les activités du projet)","Total time in activities:":"Temps total sur les activités:","Actions done:":"Actions faites:","No activities done!":"Pas d'activités rapportées!",Project:"Projet",sequence:"séquence",activity:"activité",OK:"Ok",YES:"OUI",NO:"NON","Total:":"Total:","Select group:":"Sélectionner un groupe:","Select user:":"Sélectionner l'utilisateur:",Cancel:"Annuler",Close:"Fermer","Copy data to clipboard":"Copier les données dans le presse-papier","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Les données ont été copiées au format HTML. Veuillez les coller dans une feuille de calcul ou dans un éditeur de texte","The data has been copied to clipboard":"Les données sont copier dans le presse-papier","not connected":"Non connecté ","Please wait until the results of your activities are sent to the reports system":"Veuillez patienter durant l'envoi de votre activité au rapport système","Password:":"Mot de passe: ","Incorrect password":"Mot de passe incorrect","Invalid user":"Utilisateur invalide","Partial score:":"Score partiel:","(out of played activities)":"(Hors activités jouées)","Activities played at least once:":"Les activités joué au moins une fois:",Reports:"Rapport","Toggle full screen":"Basculer en plein écran","JClic logo":"JClic logo",message:"message","Activity panel":"Groupe d'activités",cell:"cellule",image:"image",source:"source",target:"cible","image fragment":"fragment d'image"},gl:{Version:"Versión",time:"tempo",actions:"intentos",score:"acertos","Next activity":"Seguinte actividade","Previous activity":"Anterior actividade","Restart activity":"Reiniciar a actividade",Information:"Información","Results are not currently being saved":"O informe non está rexistrado en ningunha base de datos","Current results":"Informes de usuario","Session started:":"Inicio de sesión:","Reports system:":"Sistema de informes:","User:":"Usuario:","Projects:":"Proxectos:","Sequences:":"Secuencias:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades correctas:","Global score:":"Puntuación global:","Total time in activities:":"Tempo total nas actividades:","Actions done:":"Accións efectuadas:","No activities done!":"Non hai informada ningunha actividade!",Project:"Proxecto",sequence:"secuencia",activity:"actividade",OK:"Correcta",YES:"SI",NO:"NON","Total:":"Total:"},he:{Version:"גירסה",time:"זמן",actions:"נסיונות",score:"ניקוד","Next activity":"הפעילות הבאה","Previous activity":"הפעילות הקודמת","Restart activity":"התחל פעילות מחדש",Information:"מידע","Results are not currently being saved":"הדיווח אינו רשום במסד נתונים כלשהו","Current results":"דוחות משתמש","Session started:":"הפעלה החלה:","Reports system:":"מערכת דוחות:","User:":"משתמש:","Projects:":"פרוייקטים:","Sequences:":"רצפים:","Activities done:":"פעילויות שהושלמו:","Activities solved:":"פעילויות מאושרות:","Global score:":"ניקוד כללי:","Total time in activities:":"משך הפעילויות המצטבר:","Actions done:":"פעולות שבוצעו:","No activities done!":"לא דווחו פעילויות!",Project:"פרוייקט",sequence:"רצף",activity:"פעילות",OK:"אישור",YES:"כן",NO:"לא","Total:":"סך הכל:"},it:{Version:"Versione",time:"tempo",actions:"tentativi",score:"punteggio","Next activity":"Attività successiva","Previous activity":"Attività precedente","Restart activity":"Riavvia l'attività",Information:"Informazioni","Results are not currently being saved":"Rapporto non registrato in alcun database","Current results":"Rapporti utente","Session started:":"Sessione avviata:","Reports system:":"Sistema dei rapporti:","User:":"Utente:","Projects:":"Progetti:","Sequences:":"Sequenze:","Activities done:":"Attività eseguite:","Activities solved:":"Attività ok:","Global score:":"Punteggio globale:","Total time in activities:":"Tempo totale nelle attività:","Actions done:":"Azioni compiute:","No activities done!":"Nessuna attività a rapporto!",Project:"Progetto",sequence:"sequenza",activity:"attività",OK:"Ok",YES:"SI",NO:"NO","Total:":"Totale:"},ja:{Version:"バージョン",time:"時間",actions:"アクション",score:"スコア","Next activity":"次のアクティビティ","Previous activity":"前のアクティビティ","Restart activity":"アクティビティを再起動",Information:"情報","Results are not currently being saved":"結果は、現在保存されていません","Current results":"現在の結果","Session started:":"セッションが開始しました:","Reports system:":"レポート システム:","User:":"ユーザー:","Projects:":"プロジェクト:","Sequences:":"シーケンス:","Activities done:":"完了したアクティビティ:","Activities solved:":"解決したアクティビティ:","Global score:":"グローバル スコア:","(out of all project activities)":"(すべてのプロジェクト アクティビティの結果)","Total time in activities:":"アクティビティ時間の合計:","Actions done:":"完了したアクション:","No activities done!":"アクティビティは行われていません!",Project:"プロジェクト",sequence:"シーケンス",activity:"アクティビティ",OK:"OK",YES:"はい",NO:"いいえ","Total:":"合計:","Select group:":"グループを選択:","Select user:":"ユーザーを選択:",Cancel:"キャンセル",Close:"閉じる","Copy data to clipboard":"データをクリップボードにコピー","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"データは HTML 形式でコピーされます。リッチ テキスト エディターやスプレッドシートに貼り付けてください","The data has been copied to clipboard":"クリップボードにデータがコピーされました","not connected":"接続されていません","Please wait until the results of your activities are sent to the reports system":"アクティビティの結果がレポート システムに送信されるまでお待ちください","Password:":"パスワード:","Incorrect password":"パスワードが正しくありません","Invalid user":"無効なユーザー","Partial score:":"部分スコア:","(out of played activities)":"(プレイしたアクティビティの結果)","Activities played at least once:":"少なくとも一度プレイしたアクティビティ:",Reports:"レポート","Toggle full screen":"全画面の切り替え","JClic logo":"JClic ロゴ",message:"メッセージ","Activity panel":"アクティビティ パネル",cell:"セル",image:"画像",source:"ソース",target:"ターゲット","image fragment":"画像フラグメント"},nl:{Version:"Versie",time:"tijd",actions:"pogingen",score:"punten","Next activity":"Volgende activiteit","Previous activity":"Vorige activiteit","Restart activity":"Herstart activiteit",Information:"Informatie","Results are not currently being saved":"Rapport niet geregistreerd in een DB","Current results":"Gebruikers rapport","Session started:":"Reeks gestart:","Reports system:":"Rapporteer systeem:","User:":"Gebruiker:","Projects:":"Projecten:","Sequences:":"Reeksen:","Activities done:":"Activiteiten klaar:","Activities solved:":"Activiteiten ok:","Global score:":"Puntentotaal:","Total time in activities:":"Totale tijd activiteiten:","Actions done:":"Einde activiteiten:","No activities done!":"Geen activiteiten gerapporteerd!",Project:"Project",sequence:"Volgorde",activity:"Activiteit",OK:"Ok",YES:"JA",NO:"NEE","Total:":"Totaal:"},pl:{Version:"Wersja",time:"czas",actions:"działania",score:"wynik","Next activity":"Następne działanie","Previous activity":"Poprzednia aktywność","Restart activity":"Restartuj aktywność",Information:"Informacje","Results are not currently being saved":"Wyniki nie są obecnie zapisywane","Current results":"Aktualne wyniki","Session started:":"Sesja rozpoczęła się:","Reports system:":"System raportów:","User:":"Użytkownik:","Projects:":"Projekty:","Sequences:":"Sekwencje:","Activities done:":"Działania wykonane:","Activities solved:":"Działania rozwiązane:","Global score:":"Globalny wynik:","(out of all project activities)":"(poza wszystkimi działaniami projektu)","Total time in activities:":"Całkowity czas aktywności:","Actions done:":"Wykonane czynności:","No activities done!":"Nie wykonano żadnych czynności!",Project:"Projekt",sequence:"kolejność",activity:"aktywność",OK:"OK",YES:"Tak",NO:"Nie","Total:":"Całkowity:","Select group:":"Wybierz grupę:","Select user:":"Wybierz użytkownika:",Cancel:"Anuluj",Close:"Zamknij","Copy data to clipboard":"Skopiuj dane do schowka","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Dane zostały skopiowane w formacie HTML. Wklej je do arkusza kalkulacyjnego lub edytora tekstu","The data has been copied to clipboard":"Dane zostały skopiowane do schowka","not connected":"nie połączony","Please wait until the results of your activities are sent to the reports system":"Poczekaj, aż wyniki Twoich działań zostaną przesłane do systemu raportów","Password:":"Hasło:","Incorrect password":"Niepoprawne hasło","Invalid user":"Nieprawidłowy użytkownik","Partial score:":"Wynik częściowy:","(out of played activities)":"(z granych działań)","Activities played at least once:":"Działania grane co najmniej raz:",Reports:"Raporty","Toggle full screen":"Przełącz tryb pełnoekranowy","JClic logo":"Logo JClic",message:"komunikat","Activity panel":"Panel aktywności",cell:"komórka",image:"obraz",source:"źródło",target:"miejsce docelowe","image fragment":"fragment obrazu"},pt:{Version:"Versão",time:"tempo",actions:"tentativas",score:"acertos","Next activity":"Actividade seguinte","Previous activity":"Actividade anterior","Restart activity":"Reiniciar a actividade",Information:"Informação","Results are not currently being saved":"O relatório não está registado em nenhuma base de dados","Current results":"Relatórios do utilizador","Session started:":"Início da sessão:","Reports system:":"Sistema de relatórios:","User:":"Utilizador:","Projects:":"Projectos:","Sequences:":"Sequências:","Activities done:":"Actividades realizadas:","Activities solved:":"Actividades correctas:","Global score:":"Pontuação global:","Total time in activities:":"Tempo total das actividades:","Actions done:":"Acções efectuadas:","No activities done!":"Nenhuma actividade registada!",Project:"Projecto",sequence:"sequência",activity:"Actividade",OK:"Correcta",YES:"sim",NO:"não","Total:":"Total:"},pt_BR:{Version:"Versão",time:"tempo",actions:"tentativas",score:"acertos","Next activity":"atividade seguinte","Previous activity":"atividade anterior","Restart activity":"Reiniciar a atividade",Information:"Informação","Results are not currently being saved":"O relatório não está registrando em nenhuma base de dados","Current results":"relatórios de usuário","Session started:":"Início da sessão:","Reports system:":"Sistema de relatórios:","User:":"Usuário:","Projects:":"Projetos:","Sequences:":"Sequências:","Activities done:":"Atividades realizadas:","Activities solved:":"Atividades corretas:","Global score:":"Pontuação geral:","Total time in activities:":"Tempo total das atividades:","Actions done:":"Ações efetuadas:","No activities done!":"Nenhuma atividade registrada!",Project:"Projeto",sequence:"sequência",activity:"atividade",OK:"Correta",YES:"sim",NO:"não","Total:":"Total:"},ro:{Version:"Versiune",time:"timp",actions:"acțiuni",score:"rezultat","Next activity":"Activitatea următoare","Previous activity":"Activitatea anterioară","Restart activity":"Restartează activitatea",Information:"Informații","Results are not currently being saved":"Rezultatul nu pare a fi salvat","Current results":"Rezultatul curent","Session started:":"Sesiune pornită la:","Reports system:":"Sistem raportare:","User:":"Utilizator","Projects:":"Proiecte:","Sequences:":"Secvențe:","Activities done:":"Activități realizate: ","Activities solved:":"Activități rezolvate: ","Global score:":"Rezultat global:","(out of all project activities)":"(în afara activităților din proiect)","Total time in activities:":"Timp total în activitate:","Actions done:":"Activități realizate: ","No activities done!":"Activități nerealizate: ",Project:"Proiect",sequence:"secvență",activity:"activitate",OK:"OK",YES:"DA",NO:"NU","Total:":"Total:","Select group:":"Alege grup:","Select user:":"Alege utilizator:",Cancel:"Anuleaza",Close:"Închide","Copy data to clipboard":"Copiază datele in clipboard","The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor":"Datele au fost copiate în format HTML. Vă rog lipiți-le într-o foaie de calcul sau într-un editor compatibil rich text","The data has been copied to clipboard":"Datele au fost copiate în clipboard","not connected":"neconectat","Please wait until the results of your activities are sent to the reports system":"Vă rugăm să așteptați până ce rezultatele activităților sunt trimise către sistemul de raportare","Password:":"Parolă:","Incorrect password":"Parolă incorectă","Invalid user":"Utilizator incorect","Partial score:":"Rezultat parțial:","(out of played activities)":"(în afara activități jucate) ","Activities played at least once:":"Activități jucate cel puțin o dată: ",Reports:"Rapoarte","Toggle full screen":"Comută în ecran plin","JClic logo":"Jclic logo",message:"mesaj","Activity panel":"Panou activități",cell:"celulă",image:"imagine",source:"sursă",target:"țintă","image fragment":"fragment de imagine "},ru:{Version:"Версия",time:"время",actions:"попытки",score:"счёт","Next activity":"Следующее действие","Previous activity":"Предыдущее действие","Restart activity":"Перезапуск действия",Information:"Информация","Results are not currently being saved":"Отчёт не зарегистрирован в БД","Current results":"Отчёты пользователя","Session started:":"Сессия начата:","Reports system:":"Система отчётов:","User:":"Пользователь:","Projects:":"Проекты:","Sequences:":"Последовательности:","Activities done:":"Совершенные действия:","Activities solved:":"Действия в порядке:","Global score:":"Общий счёт:","Total time in activities:":"Общее время активности:","Actions done:":"Завершено действий:","No activities done!":"Нет сообщенных действий!",Project:"Проект",sequence:"Последовательность",activity:"Активность",OK:"ОК",YES:"да",NO:"нет","Total:":"Итого:"},tr:{Version:"Sürüm",time:"zaman",actions:"Denemeler",score:"sonuç","Next activity":"Bir sonraki etkinlik","Previous activity":"Bir önceki etkinlik","Restart activity":"Etkinliği tekrar başlat",Information:"Bilgi","Results are not currently being saved":"Rapor herhangi bir veritabanında kaydedilmedi","Current results":"Kullanıcı raporları","Session started:":"Oturum başlatıldı","Reports system:":"Sistem raporu:","User:":"Kullanıcı:","Projects:":"Projeler:","Sequences:":"Etkinlik dizisi","Activities done:":"Etkinlikler başlatılıyor:","Activities solved:":"Etkinlikler tamam:","Global score:":"Genel sonuç:","Total time in activities:":"Etkinlikde geçirilen toplam zaman:","Actions done:":"Eylem gerçekleştiriliyor:","No activities done!":"Etkinlik raporu yok!",Project:"Proje",sequence:"Etkinlik dizisi",activity:"Etkinlik",OK:"Tamam",YES:"Evet",NO:"hiçbir","Total:":"Toplam:"},vec:{Version:"Version",time:"tenpo",actions:"tentadivi",score:"pontexio","Next activity":"Pròsima atività","Previous activity":"Atività presedente","Restart activity":"Invìa atività da novo",Information:"Informasion","Results are not currently being saved":"Report no registrà inte nisun database","Current results":"Reports utenti","Session started:":"Sesion inviada:","Reports system:":"Sistèma de report","User:":"Utente:","Projects:":"Proxèti:","Sequences:":"Secuense:","Activities done:":"Atività fate:","Activities solved:":"Atività ok:","Global score:":"Pontexio global","Total time in activities:":"Tenpo total so ƚe atività","Actions done:":"Asion exeguìe","No activities done!":"No xé stà reportà atività!",Project:"Proxèto:",sequence:"secuensa",activity:"Atività",OK:"Ok",YES:"SI",NO:"NO","Total:":"Total:"},zh_TW:{Version:"版本",time:"時間",actions:"嘗試次數",score:"分數","Next activity":"下一個活動","Previous activity":"上一個活動","Restart activity":"重設活動",Information:"相關資訊","Results are not currently being saved":"回報在DB中無註冊","Current results":"使用者報告","Session started:":"工作開始:","Reports system:":"報告系統:","User:":"使用者:","Projects:":"專案:","Sequences:":"順序:","Activities done:":"活動結束:","Activities solved:":"活動完成:","Global score:":"總成績:","Total time in activities:":"活動總時間:","Actions done:":"活動完成:","No activities done!":"沒有活動報告",Project:"專案:",sequence:"順序",activity:"活動",OK:"確定",YES:"是",NO:"否","Total:":"總計:"}}};const ot={clipboard:t,$:s(),JSZip:r(),JSZipUtils:o(),WebFont:rt()},lt=["none","error","warn","info","debug","trace","all"],ct=[" ","ERROR","WARN ","INFO ","DEBUG","TRACE","ALL "],ht={level:2,prefix:"JClic",timestamp:!0,popupOnErrors:!1,chainTo:null,pipeTo:null};let ut={};function dt(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t=Nt(t),e&&(void 0!==t.logLevel&&ft(t.logLevel),"function"==typeof t.chainLogTo&&(ht.chainTo=t.chainLogTo),"function"==typeof t.pipeLogTo&&(ht.pipeTo=t.pipeLogTo)),i){const e=t.lang,i=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=-1,n=[];if(i){const t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[,e=null,i=null,s=null]=/^([a-zA-Z]{2,3})[_-]?([a-zA-Z]{2})?@?([a-zA-Z0-9]*)?$/.exec(t.trim())||[];return e?`${e.toLowerCase()}${i?`_${i.toUpperCase()}`:""}${s?`@${s.toLowerCase()}`:""}`:""}(i);t&&n.push(t)}window.navigator.languages&&(n=n.concat(window.navigator.languages));window.navigator.language&&n.push(window.navigator.language);n.push(e);for(let e=0;e<n.length;e++){let i=-1;for(let r in t)if(0===n[e].indexOf(t[r])&&(i=r,n[e]===t[r])){s=r;break}if(s>=0||(s=i)>=0)break}return t[s>=0?s:0]}(at.languages,"en",e);gt("debug",`Language ${e?`requested: "${e}" `:""} used: "${i}"`),ut="en"===i?{}:at.messages[i]}return t}function pt(t){return ut[t]||t}function ft(t){const e=lt.indexOf(t);e>=0&&(ht.level=e)}function gt(t,e){const i=lt.indexOf(t),s=Array.prototype.slice.call(arguments);if(i<0||i<=ht.level)if(ht.pipeTo)ht.pipeTo.apply(null,s);else{const t=`${ht.prefix||""} ${ct[i]} ${ht.timestamp?xt():""} ${e}`;console[1===i?"error":2===i?"warn":"log"].apply(console,[t].concat(s.slice(2))),ht.chainTo&&ht.chainTo.apply(null,s)}}function mt(t){return"true"===t||"false"!==t&&(arguments.length>1&&void 0!==arguments[1]&&arguments[1])}function vt(t){return""===t||null==t?arguments.length>1&&void 0!==arguments[1]?arguments[1]:null:t}function bt(t,e){return Number(vt(t,e))}function yt(t){return`${Math.round(100*t)}%`}function wt(t){return`0${t}`.slice(-2)}function At(t){const e=new Date(t),i=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds();return`${i?i+"h ":""}${i||s?wt(s)+"'":""}${wt(n)}"`}function xt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return`${t.getFullYear()}/${wt(t.getMonth()+1)}/${wt(t.getDate())} ${wt(t.getHours())}:${wt(t.getMinutes())}:${wt(t.getSeconds())}`}function Ct(t){let e=null;if(t){const i=t.trim().split("/");if(3===i.length){let t=parseInt(i[0])||0,s=parseInt(i[1])||0,n=parseInt(i[2])||0;if(t>12&&s<=12){const e=t;t=s,s=e}n<1980&&(n+=n<90?2e3:1900),s&&t&&n&&(e=new Date(Date.parse(`${t}/${s}/${n}`)))}}return e||new Date}function kt(t){if(t){if(!t.match(/^[a-z][a-z][a-z]?$/)){const e=t.match(/\(([a-z][a-z][a-z]?)\)/);t=e&&2===e.length?e[1]:"--"}}else t="--";return t}function St(t){return"true"===t?1:"false"===t?0:arguments.length>1&&void 0!==arguments[1]?arguments[1]:2}function Et(t){return Array(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0).fill(t).join("")}function Tt(t){return null==t}function Bt(t,e){return null==t&&null==e||t===e}function It(t){let e="";return s()(t).children("p").each(((t,i)=>{e+=`<p>${i.textContent}</p>`})),e}function Pt(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i={};t.attributes&&ce(t.attributes,((t,e)=>i[t]=/^-?\d*$/.test(e)?Number(e):e));const s=[],n=Array.from(t.children||t.childNodes||[]),r=n.filter((t=>"p"===t.nodeName));if(r.length>0&&r.length===n.filter((t=>"#text"!==t.nodeName)).length){const e=r.map((t=>t.textContent)).join("\n");return t.attributes?(i.text=e,i):e}return n.forEach((t=>{if("#text"===t.nodeName&&!e)return;const n=Pt(t,e);if(i[t.nodeName]||(i[t.nodeName]={},s.push(t.nodeName)),n.id)i[t.nodeName][n.id]=n;else{const e=Object.keys(i[t.nodeName]).length;i[t.nodeName][e]=n}})),s.forEach((t=>{const e=Object.keys(i[t]);if(!e.find((t=>isNaN(t))))if(1===e.length)i[t]=i[t][0];else{const s=[];e.forEach((e=>s.push(i[t][e]))),i[t]=s}})),0===n.length&&t.textContent&&(i.textContent=t.textContent),i}function _t(t){const e=Pt(t);return"string"==typeof e?e:e.hasOwnProperty("text")?e.text:e.hasOwnProperty("textContent")?e.textContent:e}function Dt(t){if(t){Object.keys(t).forEach((e=>{const i=t[e];if("object"==typeof i){const s=Object.keys(i);1===s.length&&"text"===s[0]?t[e]=i.text:t[e]=Dt(i)}}))}return t}function Rt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe.BoxBase.BACK_COLOR;if(null==t&&(t=e),"#"===(t=t.replace("0x","#")).charAt(0)&&t.length>7){const e=Wt(parseInt(t.substring(1,3),16)/255,2);t=`rgba(${parseInt(t.substring(3,5),16)},${parseInt(t.substring(5,7),16)},${parseInt(t.substring(7,9),16)},${e})`}return t}function Ot(t){if(Kt(t,"rgba(")){var e=parseInt(t.substring(t.lastIndexOf(",")));return"number"==typeof e&&e<1}return!1}function Mt(t){return s().extend(!0,Object.create(Object.getPrototypeOf(t)),t)}function Nt(t){const e={};return t&&s().each(t,((t,i)=>{let s;"string"==typeof i&&""!==(s=i.trim().toLowerCase())&&(i="true"===s||"false"!==s&&(isNaN(s)?i:Number(s))),e[t]=i})),e}function $t(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i={};return e=e||Object.keys(t),e.forEach((e=>{const[s,n]=e.split("|");if(t.hasOwnProperty(s)&&void 0!==t[s]&&null!==t[s]&&t[s].toString()!==n){const e=Vt(t[s]);qt(e)||(i[s]=e)}})),e=Object.keys(i),1===e.length&&"text"===e[0]&&(i=i.text),i}function Vt(t){return t.getAttributes?t.getAttributes():t instanceof Array?t.map((t=>Vt(t))):t instanceof Date?t.toISOString():t instanceof Object?$t(t):t}function qt(t){let e=null==t;if(!e)switch(typeof t){case"object":e=0===Object.keys(t).length;break;case"string":e=0===t.length}return e}function Lt(t,e,i){return i.forEach((i=>{if(i.key){const{key:s,fn:n,group:r,init:a,params:o}=i;if(!qt(e[s])){const i=e[s];t[s]="object"===r?Object.keys(i).reduce(((t,e)=>(t[e]=jt(n,i[e],"key"===a?e:a,o),t)),{}):"array"===r?i.map(((t,e)=>jt(n,t,"key"===a?e:a,o))):jt(n,i,a,o)}}else qt(e[i])||(t[i]=e[i])})),t}function jt(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return t.factory?t.factory(e,i,s):new t(i).setAttributes(e,...s)}function Ft(t){return fe.SEPARATORS.includes(t)}function zt(t){return fe.WORD_DELIMITERS.includes(t)}function Ut(t){const e=[];let i={text:"",sep:""},s=!0;for(let n=0;n<t.length;n++){const r=t.charAt(n),a=zt(r);s?a?(s=!1,i.sep=r):i.text+=r:a?i.sep+=r:(e.push(i),i={text:r,sep:""},s=!0)}return e.push(i),e}function Ht(t,e){return Math.round(t/e)*e}function Wt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return t.toFixed?Number(t.toFixed(e)):t}function Gt(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(null===t||0===t.length||null===e||0===e.length)return!1;i||s||(t=t.toUpperCase()),t=t.trim(),s=s&&/\d/.test(t);for(let n of e.split("|"))if(s){if(Number.parseFloat(t.replace(/,/,"."))===Number.parseFloat(n.replace(/,/,".")))return!0}else if(t===(i?n:n.toUpperCase()).trim())return!0;return!1}function Jt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return"string"==typeof t&&((arguments.length>2?arguments[2]:void 0)?t.trim():t).endsWith(e)}function Kt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return"string"==typeof t&&0===((arguments.length>2?arguments[2]:void 0)?t.trim():t).indexOf(e)}function Zt(t){return t?t.replace(/\\/g,"/"):t}function Yt(t){return/^(filesystem:)?(https?|file|data|ftps?):/i.test(t)}function Qt(t){const e=t.lastIndexOf("/");return e>=0?t.substring(0,e+1):""}function Xt(t,e){return e&&""!==e&&0===t.indexOf(e)?t.substring(e.length):t}function te(t,e){return Yt(e)?e:t+e}function ee(t,e,i){if(i){const s=Xt(t+e,i.zipBasePath);if(i.files[s])return new Promise(((t,n)=>{i.file(s).async("base64").then((i=>{const s=e.toLowerCase().split(".").pop(),n=fe.MIME_TYPES[s]||"application/octet-stream";t(`data:${n};base64,${i}`)})).catch(n)}))}return Promise.resolve(te(t,e))}const ie={doubleCell:(t,e)=>s()("<tr/>").append(s()("<td/>").html(t)).append(s()("<td/>").html(e)),p:t=>s()("<p/>").html(t),td:(t,e)=>s()("<td/>",e?{class:e}:null).html(t),th:(t,e)=>s()("<th/>",e?{class:e}:null).html(t)};function se(t,e,i,s){return e&&(t=t.replace(/width=\"\d*\"/,`width="${e}"`)),i&&(t=t.replace(/height=\"\d*\"/,`height="${i}"`)),s&&(t=t.replace(/fill=\"[#A-Za-z0-9]*\"/,`fill="${s}"`)),t}function ne(t,e,i,s){return"data:image/svg+xml;base64,"+window.btoa(se(t,e,i,s))}function re(t,e,i,s){const n=null==t?null:isNaN(t)?t:t<0?`${Math.abs(t)}%`:`${t}px`;return e&&i&&(n||s)&&(e[i]=null!==n?n:s),n}function ae(t,e){const i=document.createElement("canvas");i.width=e.dim.width,i.height=e.dim.height;const s=i.getContext("2d");let n="";try{s.drawImage(t,e.pos.x,e.pos.y,e.dim.width,e.dim.height,0,0,e.dim.width,e.dim.height),n=i.toDataURL()}catch(t){gt("error",t)}return n}function oe(t){if(t){for(;t.parentElement;)t=t.parentElement;t instanceof HTMLElement&&(t=t.parentNode||t),t=t.head||t}return t||document.head}function le(t,e){const i=oe(e&&e.$topDiv?e.$topDiv[0]:null),s=document.createElement("style");return s.type="text/css",s.appendChild(document.createTextNode(t)),i.appendChild(s)}function ce(t,e){for(let i=0;i<t.length;i++)e(t[i].name,t[i].value)}function he(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t[e]?i.push(t):Object.values(t).forEach((t=>{"object"==typeof t&&he(t,e,i)})),i}function ue(t){let e=0;const i=t.ownerDocument||t.document,s=i.defaultView||i.parentWindow;let n;if(void 0!==s.getSelection){if(n=s.getSelection(),n.rangeCount>0){const i=s.getSelection().getRangeAt(0),n=i.cloneRange();n.selectNodeContents(t),n.setEnd(i.endContainer,i.endOffset),e=n.toString().length}}else if((n=i.selection)&&"Control"!==n.type){const s=n.createRange(),r=i.body.createTextRange();r.moveToElementText(t),r.setEndPoint("EndToEnd",s),e=r.text.length}return e}function de(t){const e=[];if(3===t.nodeType)e.push(t);else{const i=t.childNodes;for(let t=0,s=i.length;t<s;++t)e.push.apply(e,de(i[t]))}return e}function pe(t,e,i){if(Tt(i)&&(i=e),document.createRange&&window.getSelection){const s=document.createRange();s.selectNodeContents(t);const n=de(t);let r,a,o=!1,l=0;for(let t=0;t<n.length;t++){if(a=n[t],r=l+a.length,!o&&e>=l&&(e<r||e===r&&t+1<=n.length)&&(s.setStart(a,e-l),o=!0),o&&i<=r){s.setEnd(a,i-l);break}l=r}const c=window.getSelection();c.removeAllRanges(),c.addRange(s)}else if(document.selection&&document.body.createTextRange){const s=document.body.createTextRange();s.moveToElementText(t),s.collapse(!0),s.moveEnd("character",i),s.moveStart("character",e),s.select()}}const fe={VERSION:at.version,NODEJS:"nodejs"===window.name,AB:0,BA:1,AUB:2,BUA:3,LAYOUT_NAMES:["AB","BA","AUB","BUA"],DEFAULT_WIDTH:400,DEFAULT_HEIGHT:300,MINIMUM_WIDTH:40,MINIMUM_HEIGHT:40,DEFAULT_NAME:"---",DEFAULT_MARGIN:8,DEFAULT_SHUFFLES:31,DEFAULT_GRID_ELEMENT_SIZE:20,MIN_CELL_SIZE:10,DEFAULT_BG_COLOR:"#C0C0C0",ACTIONS:{ACTION_MATCH:"MATCH",ACTION_PLACE:"PLACE",ACTION_WRITE:"WRITE",ACTION_SELECT:"SELECT",ACTION_HELP:"HELP"},PREVIOUS:0,MAIN:1,END:2,END_ERROR:3,NUM_MSG:4,MSG_TYPE:["previous","initial","final","finalError"],RANDOM_CHARS:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",NUM_COUNTERS:3,MAX_RECORD_LENGTH:180,BoxBase:{REDUCE_FONT_STEP:1,MIN_FONT_SIZE:8,STROKE:1,AC_MARGIN:6,BACK_COLOR:"#C0C0C0",TEXT_COLOR:"black",SHADOW_COLOR:"gray",INACTIVE_COLOR:"gray",ALTERNATIVE_COLOR:"gray",BORDER_COLOR:"black",BORDER_STROKE_WIDTH:.75,MARKER_STROKE_WIDTH:2.75},FILE_TYPES:{image:"gif,jpg,png,jpeg,bmp,ico,svg",audio:"wav,mp3,ogg,oga,au,aiff,flac",video:"avi,mov,mpeg,mp4,ogv,m4v,webm",font:"ttf,otf,eot,woff,woff2",midi:"mid,midi",anim:"swf",xml:"xml"},MIME_TYPES:{xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",wav:"audio/wav",mp3:"audio/mpeg",mp4:"video/mp4",m4v:"video/mp4",ogg:"audio/ogg",oga:"audio/ogg",ogv:"video/ogg",webm:"video/webm",au:"audio/basic",aiff:"audio/x-aiff",flac:"audio/flac",avi:"video/avi",mov:"video/quicktime",mpeg:"video/mpeg",ttf:"application/font-sfnt",otf:"application/font-sfnt",eot:" application/vnd.ms-fontobject",woff:"application/font-woff",woff2:"application/font-woff2",swf:"application/x-shockwave-flash",mid:"audio/midi",midi:"audio/midi"},COMPRESS_IMAGES:!0,VK:{LEFT:37,UP:38,RIGHT:39,DOWN:40},TOUCH_DEVICE:!1,LOAD_TIMEOUT:1e4,BEZIER_POINTS:4,CANVAS_DRAW_FOCUS:void 0!==window.CanvasRenderingContext2D&&"function"==typeof window.CanvasRenderingContext2D.prototype.drawFocusIfNeeded,WHITESPACES:" \f\n\r\t\v \u2028\u2029 \ufeff"};fe.SEPARATORS=`${fe.WHITESPACES}.,;-|`,fe.WORD_DELIMITERS=`${fe.SEPARATORS}…_<>"“”«»'´\`‘’•~+–—―=%¿?¡!:/\\()[]{}$£€`;var ge={pkg:ot,settings:fe,getMsg:pt,LOG_LEVELS:lt,LOG_PRINT_LABELS:ct,LOG_OPTIONS:ht,init:dt,setLogLevel:ft,log:gt,getBoolean:mt,getVal:vt,getNumber:bt,getPercent:yt,zp:wt,getHMStime:At,getDateTime:xt,parseOldDate:Ct,cleanOldLanguageTag:kt,FALSE:0,TRUE:1,DEFAULT:2,getTriState:St,fillString:Et,isNullOrUndef:Tt,isEquivalent:Bt,getXmlText:It,parseXmlNode:Pt,getXmlNodeText:_t,reduceTextsToStrings:Dt,cssToString:function(t){return Object.keys(t).reduce(((e,i)=>`${e}${i}:${t[i]};`),"")},checkColor:Rt,colorHasTransparency:Ot,cloneObject:Mt,normalizeObject:Nt,getAttr:$t,getValue:Vt,isEmpty:qt,setAttr:Lt,buildObj:jt,isSeparator:Ft,isWordDelimiter:zt,stringToWords:Ut,roundTo:Ht,fx:Wt,compareMultipleOptions:Gt,endsWith:Jt,startsWith:Kt,nSlash:Zt,isURL:Yt,getBasePath:Qt,getRelativePath:Xt,getPath:te,getPathPromise:ee,$HTML:ie,getSvg:se,svgToURI:ne,toCssSize:re,getImgClipUrl:ae,getRootHead:oe,appendStyleAtHead:le,attrForEach:ce,findParentsWithChild:he,getCaretCharacterOffsetWithin:ue,getTextNodesIn:de,setSelectionRange:pe};class me{constructor(t,e,i,s,n){t&&(this.family=t),"number"==typeof e&&(this.size=e),i&&(this.bold=i),s&&(this.italic=s),n&&(this.variant=n),this._metrics={ascent:-1,descent:-1,height:-1}}static checkTree(t,e){let i=me.SUBSTITUTIONS;e&&e.ownFonts&&e.ownFonts.forEach((t=>{me.ALREADY_LOADED_FONTS.indexOf(t)<0&&rt()&&rt().load&&(rt().load({custom:{families:[t]}}),me.ALREADY_LOADED_FONTS.push(t),delete i[t.trim().toLowerCase()])})),e&&e.fontSubstitutions&&(i=s().extend(Object.create(i),e.fontSubstitutions)),t.jquery?t.find("style[family],font[family]").each(((t,e)=>{const n=s()(e),r=n.attr("family").trim().toLowerCase();if(r in i){const t=i[r];""!==t&&(me.loadGoogleFont(t),n.attr("family",t))}})):he(t,"family").forEach((t=>{if("string"==typeof t.family){const e=t.family;if(me.GOOGLEFONTS.includes(e))me.loadGoogleFont(e);else{const s=i[e.trim().toLowerCase()];s&&(me.loadGoogleFont(s),t.family=s)}}}))}static loadGoogleFont(t){t&&!me.ALREADY_LOADED_FONTS.includes(t)&&rt()&&rt().load&&(rt().load({google:{families:[t]}}),me.ALREADY_LOADED_FONTS.push(t))}static loadGoogleFonts(t){t&&t.forEach&&t.forEach((t=>me.loadGoogleFont(t)))}setProperties(t){return t.attr("family")&&(this.family=t.attr("family")),t.attr("size")&&(this.size=Number(t.attr("size"))),t.attr("bold")&&(this.bold=mt(t.attr("bold"))),t.attr("italic")&&(this.italic=mt(t.attr("italic"))),t.attr("variant")&&(this.variant=t.attr("variant")),this}getAttributes(){return $t(this,["family|Arial","size|17","bold|0","italic|0","variant"])}setAttributes(t){return Lt(this,t,["family","size","bold","italic","variant"])}setSize(t){const e=this.size;return this.size=t,e!==t&&(this._metrics.height=-1),this}zoom(t){return this.setSize(this.size+t)}getMetrics(){if(this._metrics.height<0){const t=me.ALREADY_CALCULATED_FONTS.find((t=>t.equals(this)));t&&Object.assign(this._metrics,t._metrics),this._metrics.height<0&&(this._calcHeight(),this._metrics.height>0&&me.ALREADY_CALCULATED_FONTS.push(this))}return this._metrics}getHeight(){return this.getMetrics().height}toCss(t){return t||(t={}),t["font-family"]=this.family,t["font-size"]=`${this.size}px`,this.hasOwnProperty("bold")&&(t["font-weight"]=this.bold?"bold":"normal"),this.hasOwnProperty("italic")&&(t["font-style"]=this.italic?"italic":"normal"),this.hasOwnProperty("variant")&&(t["font-variant"]=this.variant),t}cssFont(){return`${this.italic?"italic ":"normal"} ${""===this.variant?"normal":this.variant} ${this.bold?"bold ":"normal"} ${this.size}px ${this.family}`}_calcHeight(){const t=s()("<span/>").html("Hg").css(this.toCss()),e=s()("<div/>").css({display:"inline-block",width:"1px",height:"0px"}),i=s()("<div/>").append(t,e);s()("body").append(i);try{e.css({verticalAlign:"baseline"}),this._metrics.ascent=e.offset().top-t.offset().top,e.css({verticalAlign:"bottom"}),this._metrics.height=e.offset().top-t.offset().top,this._metrics.descent=this._metrics.height-this._metrics.ascent}finally{i.remove()}return this}equals(t){return this.family===t.family&&this.size===t.size&&this.bold===t.bold&&this.italic===t.italic&&this.variant===t.variant}}me.ALREADY_CALCULATED_FONTS=[],me.ALREADY_LOADED_FONTS=["serif","sans-serif","monospace","cursive","fantasy"],me.SUBSTITUTIONS={dialog:"sans-serif",dialoginput:"sans-serif",monospaced:"monospace",sansserif:"sans-serif",abc:"Kalam","a.c.m.e. secret agent":"Permanent Marker","comic sans ms":"Patrick Hand",impact:"Oswald",massallera:"Vibur",memima:"Vibur",memima_n1:"Vibur",memima_n2:"Vibur","memimas-regularalternate":"Vibur",palmemim:"Vibur",zurichcalligraphic:"Felipa"},me.GOOGLEFONTS=["Kalam","Permanent Marker","Patrick Hand","Oswald","Vibur","Felipa"],Object.assign(me.prototype,{family:"Arial",size:17,bold:0,italic:0,variant:"",_metrics:{ascent:-1,descent:-1,height:-1}});class ve{constructor(t,e,i,s){t&&(this.c1=t),e&&(this.c2=e),"number"==typeof i&&(this.angle=i%360),"number"==typeof s&&(this.cycles=s)}setProperties(t){return this.c1=Rt(t.attr("source"),"black"),this.c2=Rt(t.attr("dest"),"white"),this.angle=Number(t.attr("angle")||0)%360,this.cycles=Number(t.attr("cycles")||1),this}getAttributes(){return $t(this,["c1","c2","angle|0","cycles|1"])}setAttributes(t){return Lt(this,t,["c1","c2","angle","cycles"])}getGradient(t,e){const i=e.getOppositeVertex(),s=t.createLinearGradient(e.pos.x,e.pos.y,i.x,i.y),n=1/Math.max(this.cycles,1);for(let t=0;t<=this.cycles;t++)s.addColorStop(t*n,t%2?this.c1:this.c2);return s}getCss(){let t=`linear-gradient(${this.angle+90}deg, ${this.c1}, ${this.c2}`;for(let e=1;e<this.cycles;e++)t=`${t}, ${e%2>0?this.c1:this.c2}`;return`${t})`}hasTransparency(){return Ot(this.c1)||Ot(this.c2)}}Object.assign(ve.prototype,{c1:"white",c2:"black",angle:0,cycles:1});class be{constructor(t,e,i,s){"number"==typeof t&&(this.lineWidth=t),e&&(this.lineCap=e),i&&(this.lineJoin=i),"number"==typeof s&&(this.miterLimit=s)}getAttributes(){return $t(this,["lineWidth|1","lineCap|butt","lineJoin|miter","miterLimit|10"])}setAttributes(t){return Lt(this,t,["lineWidth","lineCap","lineJoin","miterLimit"])}setStroke(t){return t.lineWidth=this.lineWidth,t.lineCap=this.lineCap,t.lineJoin=this.lineJoin,t.miterLimit=this.miterLimit,t}}Object.assign(be.prototype,{lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10});class ye{constructor(t,e){t instanceof ye?(this.x=t.x,this.y=t.y):(this.x=t||0,this.y=e||0)}setProperties(t){return this.x=Number(t.attr("x")),this.y=Number(t.attr("y")),this}getAttributes(){return $t(this,["x","y"])}setAttributes(t){return Lt(this,t,["x","y"])}moveBy(t){return this.x+=t.x||t.width||0,this.y+=t.y||t.height||0,this}moveTo(t,e){return"number"==typeof t?(this.x=t,this.y=e):(this.x=t.x,this.y=t.y),this}multBy(t){return this.x*=t.x||t.width||0,this.y*=t.y||t.height||0,this}equals(t){return this.x===t.x&&this.y===t.y}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2),Math.pow(this.y-t.y,2))}clone(){return new ye(this)}}Object.assign(ye.prototype,{x:0,y:0});class we{constructor(t,e){t instanceof ye&&e instanceof ye?(this.width=e.x-t.x,this.height=e.y-t.y):(this.width=t||0,this.height=e||0)}setProperties(t){return this.width=Number(t.attr("width")),this.height=Number(t.attr("height")),this}getAttributes(){return $t(this,["width","height"])}setAttributes(t){return Lt(this,t,["width","height"])}equals(t){return this.width===t.width&&this.height===t.height}multBy(t){return this.width*=t.x||t.width||0,this.height*=t.y||t.height||0,this}setDimension(t,e){return t instanceof we&&(e=t.height,t=t.width),this.width=t,this.height=e,this}getSurface(){return this.width*this.height}}Object.assign(we.prototype,{width:0,height:0});class Ae{constructor(t){this.pos=t||new ye}moveBy(t){return this.pos.moveBy(t),this}moveTo(t){return this.pos.moveTo(t),this}getBounds(){return new xe(this.pos)}equals(t){return this.pos.equals(t.pos)}scaleBy(t){return this}getShape(t){return this.clone().scaleBy(t.dim).moveBy(t.pos)}contains(t){return!1}intersects(t){return!1}fill(t,e){return t.save(),e&&e.getSurface()>0&&(t.beginPath(),t.rect(e.pos.x,e.pos.y,e.dim.width,e.dim.height),t.clip()),this.preparePath(t),t.fill(),t.restore(),t}stroke(t){return this.preparePath(t),t.stroke(),t}preparePath(t){return t}clip(t,e){return this.preparePath(t),t.clip(e||"nonzero"),t}isRect(){return!1}toString(){return`Shape enclosed in ${this.getBounds().getCoords()}`}setAttributes(t){return Ae.buildShape(t)}static buildShape(t){const e="rect"===t.type&&xe||"ellipse"===t.type&&Ce||"path"===t.type&&ke||null;if(e)return(new e).setAttributes(t);console.log("unknown shape:",t)}}Object.assign(Ae.prototype,{type:"shape",pos:new ye,type:"shape"});class xe extends Ae{constructor(t,e,i,s){let n=t,r=e;t instanceof xe?(r=new we(t.dim.width,t.dim.height),n=new ye(t.pos.x,t.pos.y)):t instanceof ye?(n=new ye(t.x,t.y),e instanceof we&&(r=new we(e.width,e.height))):t instanceof Array?(n=new ye(t[0],t[1]),r=new we(t[2]-t[0],t[3]-t[1])):"number"==typeof i&&"number"==typeof s&&(n=new ye(t,e),r=new we(i,s)),super(n),this.dim=r instanceof we?r:r instanceof ye?new we(r.x-this.pos.x,r.y-this.pos.y):new we,this.type="rect"}getBounds(){return this}setBounds(t){return t||(t=new xe),this.pos.x=t.pos.x,this.pos.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height,this}equals(t){return t instanceof xe&&this.pos.equals(t.pos)&&this.dim.equals(t.dim)}clone(){return new xe(this)}scaleBy(t){return this.pos.multBy(t),this.dim.multBy(t),this}grow(t,e){return this.pos.x-=t,this.pos.y-=e,this.dim.width+=2*t,this.dim.height+=2*e,this}getOppositeVertex(){return new ye(this.pos.x+this.dim.width,this.pos.y+this.dim.height)}add(t){const e=this.getOppositeVertex(),i=t.getBounds().getOppositeVertex();return this.pos.moveTo(Math.min(this.pos.x,t.getBounds().pos.x),Math.min(this.pos.y,t.getBounds().pos.y)),this.dim.setDimension(Math.max(e.x,i.x)-this.pos.x,Math.max(e.y,i.y)-this.pos.y),this}contains(t){const e=this.getOppositeVertex();return t.x>=this.pos.x&&t.x<=e.x&&t.y>=this.pos.y&&t.y<=e.y}intersects(t){const e=this.pos,i=this.getOppositeVertex(),s=t.pos,n=t.getOppositeVertex();return n.x>=e.x&&s.x<=i.x&&n.y>=e.y&&s.y<=i.y}preparePath(t){return t.beginPath(),t.rect(this.pos.x,this.pos.y,this.dim.width,this.dim.height),t}getSurface(){return this.dim.getSurface()}isEmpty(){return 0===this.getSurface()}isRect(){return!0}toString(){return`Rectangle ${this.getCoords()}`}getCoords(){return`[${Math.round(this.pos.x)},${Math.round(this.pos.y)},${Math.round(this.pos.x+this.dim.width)},${Math.round(this.pos.y+this.dim.height)}]`}getAttributes(){return $t(this,["type","pos","dim"])}setAttributes(t){return Lt(this,t,["type",{key:"pos",fn:ye},{key:"dim",fn:we}])}}Object.assign(xe.prototype,{type:"rect",dim:new we});class Ce extends xe{constructor(t,e,i,s){super(t,e,i,s)}preparePath(t){const e=.5522848,i=e*this.dim.width/2,s=e*this.dim.height/2,n=this.pos.x+this.dim.width,r=this.pos.y+this.dim.height,a=this.pos.x+this.dim.width/2,o=this.pos.y+this.dim.height/2;return t.beginPath(),t.moveTo(this.pos.x,o),t.bezierCurveTo(this.pos.x,o-s,a-i,this.pos.y,a,this.pos.y),t.bezierCurveTo(a+i,this.pos.y,n,o-s,n,o),t.bezierCurveTo(n,o+s,a+i,r,a,r),t.bezierCurveTo(a-i,r,this.pos.x,o+s,this.pos.x,o),t.closePath(),t}contains(t){let e=super.contains(t);if(e){const i=this.dim.width/2,s=this.dim.height/2,n=this.pos.x+i,r=this.pos.y+s;e=Math.pow(t.x-n,2)/Math.pow(i,2)+Math.pow(t.y-r,2)/Math.pow(s,2)<=1}return e}getSurface(){return Math.PI*this.dim.width/2*this.dim.height/2}equals(t){return t instanceof Ce&&super.equals(t)}clone(){return new Ce(this.pos,this.dim)}isRect(){return!1}toString(){return`Ellipse enclosed in ${this.getCoords()}`}}Object.assign(Ce.prototype,{type:"ellipse"});class ke extends Ae{constructor(t){super(),t&&this.setStrokes(t)}setStrokes(t){return this.strokes=[],t.forEach((t=>this.strokes.push(new Se(t.type||t.action,t.points||t.data)))),this.enclosing=new xe,this.enclosingPoints=[],this.calcEnclosingRect(),this.pos=this.enclosing.pos,this}clone(){return new ke(this.strokes.map((t=>t.clone())))}addStroke(t){return this.strokes.push(t),this}calcEnclosingRect(){this.enclosingPoints=[];let t=new ye;this.strokes.forEach((e=>{e.getEnclosingPoints(t).forEach((e=>{t=new ye(e),this.enclosingPoints.push(t)}))}));let e=this.enclosingPoints.length;e>1&&this.enclosingPoints[0].equals(this.enclosingPoints[e-1])&&(this.enclosingPoints.pop(),e--);const i=new ye(this.enclosingPoints[0]),s=new ye(this.enclosingPoints[0]);for(let t=1;t<e;t++){const e=this.enclosingPoints[t];i.x=Math.min(e.x,i.x),i.y=Math.min(e.y,i.y),s.x=Math.max(e.x,s.x),s.y=Math.max(e.y,s.y)}return this.enclosing.setBounds(new xe(i,new we(i,s))),this.enclosing}getBounds(){return this.enclosing}moveBy(t){return this.strokes.forEach((e=>e.moveBy(t))),this.enclosingPoints.forEach((e=>e.moveBy(t))),this.enclosing.moveBy(t),this}moveTo(t){return this.moveBy(new we(t.x-this.pos.x,t.y-this.pos.y))}equals(t){return!1}scaleBy(t){return this.strokes.forEach((e=>e.multBy(t))),this.enclosingPoints.forEach((e=>e.multBy(t))),this.enclosing.scaleBy(t),this}contains(t){let e=this.enclosing.contains(t);if(e){const i=this.enclosingPoints.length;let s=0,n=0,r=this.enclosingPoints[0];for(let e=1;e<=i;e++){const a=this.enclosingPoints[e%i];t.y>Math.min(r.y,a.y)&&t.y<=Math.max(r.y,a.y)&&t.x<=Math.max(r.x,a.x)&&r.y!==a.y&&(s=(t.y-r.y)*(a.x-r.x)/(a.y-r.y)+r.x,(r.x===a.x||t.x<=s)&&n++),r=a}n%2==0&&(e=!1)}return e}intersects(t){return this.enclosing.intersects(t)}preparePath(t){return t.beginPath(),this.strokes.forEach((e=>e.stroke(t))),t}getAttributes(){return{type:this.type,strokes:this.strokes.map((t=>t.getAttributes())).join("|")}}setAttributes(t){const e=t.strokes.split("|").map((t=>{const[e,i]=t.split(":");return new Se(e,i?i.split(","):[])}));return this.setStrokes(e)}}Object.assign(ke.prototype,{type:"path",strokes:[],enclosing:new xe,enclosingPoints:[]});class Se{constructor(t,e){if(this.type=t,e&&e.length>0)if(e[0]instanceof ye)this.points=e.map((t=>new ye(t)));else{this.points=[];for(let t=0;t<e.length;t+=2)this.points.push(new ye(e[t],e[t+1]))}}static getQuadraticPoints(t,e,i,s){s||(s=fe.BEZIER_POINTS);const n=[],r=new ye,a=new ye;for(let o=0;o<s;o++){const l=(o+1)/(s+1);r.x=t.x+(e.x-t.x)*l,r.y=t.y-(t.y-e.y)*l,a.x=e.x+(i.x-e.x)*l,a.y=e.y+(i.y-e.y)*l,n.push(new ye(r.x+(a.x-r.x)*l,r.y-(r.y-a.y)*l))}return n}static getCubicPoints(t,e,i,s,n){const r=[];n||(n=fe.BEZIER_POINTS);const a=Se.getQuadraticPoints(t,e,i,n),o=Se.getQuadraticPoints(e,i,s,n);for(let t=0;t<n;t++){const e=(t+1)/(n+1);r.push(new ye(a[t].x+(o[t].x-a[t].x)*e,a[t].y-(a[0].y-o[0].y)*e))}return r}clone(){return new Se(this.type,this.points)}moveBy(t){return this.points&&this.points.forEach((e=>e.moveBy(t))),this}multBy(t){return this.points&&this.points.forEach((e=>e.multBy(t))),this}stroke(t){switch(this.type){case"M":t.moveTo(this.points[0].x,this.points[0].y);break;case"L":t.lineTo(this.points[0].x,this.points[0].y);break;case"Q":t.quadraticCurveTo(this.points[0].x,this.points[0].y,this.points[1].x,this.points[1].y);break;case"B":t.bezierCurveTo(this.points[0].x,this.points[0].y,this.points[1].x,this.points[1].y,this.points[2].x,this.points[2].y);break;case"X":t.closePath()}return t}getEnclosingPoints(t){let e=[];switch(this.type){case"M":case"L":e.push(this.points[0]);break;case"Q":e=Se.getQuadraticPoints(t,this.points[0],this.points[1]),e.push(this.points[1]);break;case"B":e=Se.getCubicPoints(t,this.points[0],this.points[1],this.points[2]),e.push(this.points[2])}return e}getAttributes(){return`${this.type}:${this.points?this.points.map((t=>`${Wt(t.x)},${Wt(t.y)}`)).join(","):""}`}}Object.assign(Se.prototype,{type:"X",points:null});class Ee{constructor(t,e){this.name=t,this.actionPerformed=e,this._statusListeners=[]}actionPerformed(t,e){return this}processEvent(t){return this.actionPerformed(this,t)}addStatusListener(t){this._statusListeners.push(t)}removeStatusListener(t){this._statusListeners=this._statusListeners.map((e=>e!==t))}setEnabled(t){return this.enabled=t,this._statusListeners.forEach((t=>t.call(this,this))),this}}Object.assign(Ee.prototype,{name:null,description:null,enabled:!1,_statusListeners:null});class Te{constructor(t,e,i){this.actionPerformed=t,this.interval=e,this.setEnabled(!0===i)}actionPerformed(t){return this}processTimer(t){return this.ticks++,this.repeats||this.stop(),this.actionPerformed.call(this)}setEnabled(t,e){if(e||(this.ticks=0),!t||null===this.timer)return t?this.timer=window.setInterval((()=>this.processTimer(null)),this.interval):null!==this.timer&&(window.clearInterval(this.timer),this.timer=null),this}isRunning(){return null!==this.timer}start(t){return this.setEnabled(!0,t)}stop(t){return this.setEnabled(!1,t)}}Object.assign(Te.prototype,{interval:0,ticks:0,timer:null,repeats:!0});class Be extends xe{constructor(t,e,i,s){super(t,e,i,s)}invalidate(t){return t?null===this.invalidatedRect?this.invalidatedRect=t.clone():this.invalidatedRect.add(t):this.invalidatedRect=null,this}update(){return this.updateContent(this.invalidatedRect),this.invalidatedRect=null,this}updateContent(t){return this}}Object.assign(Be.prototype,{invalidatedRect:null});var Ie={Font:me,Gradient:ve,Stroke:be,Point:ye,Dimension:we,Shape:Ae,Rectangle:xe,Ellipse:Ce,Path:ke,PathStroke:Se,Action:Ee,Timer:Te,Container:Be};class Pe{constructor(t){this.player=t,this.sequenceStack=[],window&&window.history&&t.options.browserHistory&&(this.browserHistory=!0,s()(window).on("popstate",(t=>{const e=t.originalEvent.state;e&&this.processPopStateEvent(e)})))}processPopStateEvent(t){gt("info","Processing History popstate event with state:",t),this.processingPop=!0,t.projectPath===this.player.project.path&&Bt(t.fullZipPath,this.player.zip?this.player.zip.fullZipPath:null)?this.player.load(null,t.activity,null):this.player.load(t.fullZipPath||t.projectPath,t.activity,null)}pushBrowserHistory(){if(this.browserHistory){if(this.processingPop)return void(this.processingPop=!1);const t=this.player.project.activitySequence,e=t.currentAct,i=this.player.actPanel.act.name||"No name",s=new this.HistoryElement(this.player.project.path,t.getSequenceForElement(e),e,this.player.zip?this.player.zip.fullZipPath:null);window.history.state?window.history.pushState(s,i):window.history.replaceState(s,i)}}storedElementsCount(){return this.sequenceStack.length}clearHistory(){this.sequenceStack=[0]}push(){if(null!==this.player.project&&null!==this.player.project.path){const t=this.player.project.activitySequence,e=t.currentAct;if(e>=0){if(this.sequenceStack.length>0){const t=this.sequenceStack[this.sequenceStack.length-1];if(t.projectPath===this.player.project.path&&t.activity===e)return}this.sequenceStack.push(new this.HistoryElement(this.player.project.path,t.getSequenceForElement(e),e,this.player.zip?this.player.zip.fullZipPath:null))}}}pop(){if(this.sequenceStack.length>0){const t=this.sequenceStack.pop();t.projectPath===this.player.project.path&&Bt(t.fullZipPath,this.player.zip?this.player.zip.fullZipPath:null)?this.player.load(null,t.activity,null):this.testMode&&null!==t.projectPath&&t.projectPath.length>0?gt("info",`At this point, a jump to "${t.projectPath}" should be performed.`):this.player.load(t.fullZipPath||t.projectPath,t.activity,null)}return!0}processJump(t,e){let i=!1;if(null!==t&&null!==this.player.project)switch(t.action){case"STOP":break;case"RETURN":if(this.sequenceStack.length>0||!this.player.options.returnAsExit){i=this.pop();break}case"EXIT":this.testMode?gt("info","At this point, the program should exit."):this.player.exit(t.sequence);break;case"JUMP":if(t.sequence||t.projectPath)this.testMode&&null!==t.projectPath&&t.projectPath.length>0?gt("info",`At this point, a jump to "${t.projectPath}" should be performed.`):i=this.jumpToSequence(t.sequence,t.projectPath?te(this.player.project.basePath,t.projectPath):null,e);else{const s=this.player.project.activitySequence.getElement(t.actNum,!0);null!==s&&(e&&this.push(),this.player.load(null,null,s.activity),i=!0)}}return i}jumpToSequence(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Tt(t)&&Tt(e))return!1;if(Tt(e)&&(e=this.player.project.path),this.sequenceStack.length>0){const i=this.sequenceStack[this.sequenceStack.length-1];if(!Tt(t)&&e===i.projectPath){let s=t===i.sequence;if(e===this.player.project.path){const e=this.player.project.activitySequence.getElement(i.activity,!1);s=null!==e&&t===e.tag}if(s)return this.pop()}}return i&&this.push(),e===this.player.project.path?this.player.load(null,t,null):this.player.load(e,t,null),!0}}Object.assign(Pe.prototype,{player:null,sequenceStack:[],testMode:!1,browserHistory:!1,processingPop:!1,HistoryElement:class{constructor(t,e,i,s){this.projectPath=t,this.sequence=e,this.activity=i,this.fullZipPath=s}}});var _e=Pe;class De{constructor(t){navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&(this.enabled=!0),t&&(this.seconds=t),this.chunks=[]}play(){this.stop(),this.mediaPlayer?(this.mediaPlayer.currentTime=0,this.mediaPlayer.play()):this.playWhenFinished=!0}stop(){this.mediaRecorder&&"recording"===this.mediaRecorder.state?this.mediaRecorder.stop():this.mediaPlayer&&!this.mediaPlayer.paused&&this.mediaPlayer.pause()}record(t){this.mediaRecorder&&"recording"===this.mediaRecorder.state?this.mediaRecorder.stop():this.enabled&&(this.stop(),this.mediaPlayer=null,navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((e=>{this.mediaRecorder=new MediaRecorder(e),this.mediaRecorder.ondataavailable=t=>this.chunks.push(t.data),this.mediaRecorder.onerror=t=>{gt("error",`Error recording audio: ${t}`),this.mediaRecorder=null},this.mediaRecorder.onstart=()=>{gt("debug","Recording audio started"),this.visualFeedbak(!0,t)},this.mediaRecorder.onstop=()=>{gt("debug","Recording audio finished"),this.visualFeedbak(!1,t),this.timeoutID&&(window.clearTimeout(this.timeoutID),this.timeoutID=null);const e={};this.chunks.length>0&&this.chunks[0].type&&(e.type=this.chunks[0].type);const i=new Blob(this.chunks,e);this.chunks=[],this.mediaPlayer=document.createElement("audio"),this.mediaPlayer.src=URL.createObjectURL(i),this.mediaPlayer.pause(),this.mediaRecorder=null,this.playWhenFinished&&(this.playWhenFinished=!1,this.mediaPlayer.play())},this.mediaRecorder.onwarning=t=>gt("warn",`Warning recording audio: ${t}`),this.playWhenFinished=!1,this.mediaRecorder.start(),this.timeoutID=window.setTimeout((()=>{this.mediaRecorder,this.mediaRecorder.stop()}),1e3*this.seconds)})).catch((e=>{gt("error",e.toString()),this.visualFeedbak(!1,t)})))}visualFeedbak(t,e){e&&e.css("cursor",t?"progress":"inherit")}clear(){this.stop(),this.mediaPlayer=null}}Object.assign(De.prototype,{enabled:!1,seconds:20,mediaRecorder:null,chunks:null,mediaPlayer:null,timeoutID:null,playWhenFinished:!1}),De.MAX_RECORD_LENGTH=180;var Re=De;class Oe{constructor(t,e,i){switch(this.mc=t,this.ps=i,t.type){case"RECORD_AUDIO":Oe.AUDIO_BUFFERS&&(this.clearAudioBuffer(t.recBuffer),Oe.AUDIO_BUFFERS[t.recBuffer]=new Re(t.length));case"PLAY_RECORDED_AUDIO":this.useAudioBuffer=!0;break;case"PLAY_AUDIO":case"PLAY_VIDEO":case"PLAY_MIDI":this.mbe=e.getElement(t.file,!0)}}realize(){this.mbe&&this.mbe.build((t=>{t.data&&t.data.pause&&!t.data.paused&&!t.data.ended&&t.data.currentTime&&t.data.pause(),"video"!==t.type&&"anim"!==t.type||!t.data||(this.$visualComponent=s()(t.data),this.$visualComponent.css("z-index",20))}),this.ps,!1,this.mc.level)}playNow(t){if(this.useAudioBuffer){if(Oe.AUDIO_BUFFERS){const t=this.ps&&this.ps.$div,e=Oe.AUDIO_BUFFERS[this.mc.recBuffer];e&&("RECORD_AUDIO"===this.mc.type?e.record(t):e.play())}}else this.mbe&&this.mbe.build((()=>{if(this.mbe.data){if("midi"===this.mbe.type)this.mbe.data.playTo=this.mc.to||0;else{let t=!1;const e=s()(this.mbe.data);e.off(),this.mc.to>0&&e.on("timeupdate",(()=>{t&&this.mbe.data.currentTime>=this.mc.to/1e3&&(e.off("timeupdate"),this.mbe.data.pause())})),t=!0}this.mbe.data.paused||this.mbe.data.ended||!this.mbe.data.currentTime||this.mbe.data.pause(),this.mbe.data.currentTime=this.mc.from>0?this.mc.from/1e3:0,this.mbe.data.play()}}),this.ps,!0,this.mc.level)}play(t){this.stopAllAudioBuffers(),this.playNow(t)}stop(){this.useAudioBuffer?this.stopAudioBuffer(this.mc.recBuffer):this.mbe&&this.mbe.data&&this.mbe.data.pause&&!this.mbe.data.paused&&!this.mbe.data.ended&&this.mbe.data.currentTime&&this.mbe.data.pause()}clear(){this.stop(),this.useAudioBuffer&&this.clearAudioBuffer(this.mc.recBuffer)}clearAudioBuffer(t){Oe.AUDIO_BUFFERS&&t>=0&&t<Oe.AUDIO_BUFFERS.length&&Oe.AUDIO_BUFFERS[t]&&(Oe.AUDIO_BUFFERS[t].clear(),Oe.AUDIO_BUFFERS[t]=null)}clearAllAudioBuffers(){Oe.AUDIO_BUFFERS&&Oe.AUDIO_BUFFERS.forEach(((t,e)=>this.clearAudioBuffer(e)))}countActiveBuffers(){return Oe.AUDIO_BUFFERS?Oe.AUDIO_BUFFERS.reduce(((t,e)=>t+e?1:0),0):0}stopAllAudioBuffers(){Oe.AUDIO_BUFFERS&&Oe.AUDIO_BUFFERS.forEach((t=>t?t.stop():null))}stopAudioBuffer(t){Oe.AUDIO_BUFFERS&&t>=0&&t<Oe.AUDIO_BUFFERS.length&&Oe.AUDIO_BUFFERS[t]&&Oe.AUDIO_BUFFERS[t].stop()}checkVisualComponentBounds(t){}setVisualComponentVisible(t){}linkTo(t){this.bx=t,this.bx&&this.$visualComponent&&this.bx.setHostedComponent(this.$visualComponent)}}Object.assign(Oe.prototype,{mc:null,ps:null,bx:null,$visualComponent:null,useAudioBuffer:!1,mbe:null}),Oe.REC_ENABLED="undefined"!=typeof MediaRecorder&&"undefined"!=typeof navigator,Oe.REC_ENABLED&&(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia),Oe.AUDIO_BUFFERS=Oe.REC_ENABLED?[]:null;var Me=Oe;class Ne{constructor(){this.players=[]}createActiveMediaPlayer(t,e,i){let s=null;switch(t.type){case"RECORD_AUDIO":if(t.length<=0||t.length>=fe.MAX_RECORD_LENGTH)break;case"PLAY_RECORDED_AUDIO":if(t.recBuffer<0||t.recBuffer>=10)break;case"PLAY_AUDIO":case"PLAY_MIDI":case"PLAY_VIDEO":s=new Me(t,e,i)}return null!==s&&this.players.push(s),s}getActiveMediaPlayer(t,e,i){return this.players.find((e=>e.mc===t||e.mc.isEquivalent(t)))||this.createActiveMediaPlayer(t,e,i)}removeActiveMediaPlayer(t){const e=this.players.findIndex((e=>e.mc===t));e>=0&&(this.players[e].clear(),this.players.splice(e,1))}realizeAll(){this.players.forEach((t=>t.realize()))}stopAll(t){void 0===t&&(t=-1),this.players.forEach((e=>{(-1===t||null!==e.mc&&e.mc.level<=t)&&e.stop()}))}removeAll(){this.players.forEach((t=>t.clear())),this.players.length=0,Me.prototype.clearAllAudioBuffers()}}Object.assign(Ne.prototype,{players:[]});var $e=Ne;class Ve extends Be{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(super(),this.ps=t,null!==e&&(this.name=e),this.options=i,this.options.skinId&&(this.skinId=this.options.skinId),!Ve.registerStyleSheet(this.skinId,t)){let e=this._getStyleSheets("default"),i=this._getStyleSheets("twoThirds");i.length>0&&(e+=` @media (max-width:${this.twoThirdsMedia.width}px),(max-height:${this.twoThirdsMedia.height}px){${i}}`);let s=this._getStyleSheets("half");s.length>0&&(e+=` @media (max-width:${this.halfMedia.width}px),(max-height:${this.halfMedia.height}px){${s}}`),le(e.replace(/\.ID/g,`.${this.skinId}`),t)}let n="";this.$div=s()("<div/>",{class:this.skinId}),this.$playerCnt=s()("<div/>",{class:"JClicPlayerCnt"}),this.$progress=s()("<progress/>",{class:"progressBar"}).css({display:"none"}),this.$waitPanel=s()("<div/>").css({display:"none","background-color":"rgba(255, 255, 255, .60)","z-index":99}).append(s()("<div/>",{class:"waitPanel"}).css({display:"flex","flex-direction":"column"}).append(s()("<div/>",{class:"animImgBox"}).append(s()(this.waitImgBig),s()(this.waitImgSmall))).append(this.$progress)),this.$playerCnt.append(this.$waitPanel),this.buttons=Mt(Ve.prototype.buttons),this.counters=Mt(Ve.prototype.counters),this.msgArea=Mt(Ve.prototype.msgArea),this.$dlgOverlay=s()("<div/>",{class:"dlgOverlay"}).css({"z-index":98,position:"fixed",left:0,top:0,width:"100%",height:"100%",display:"none","background-color":"rgba(30,30,30,0.7)"}).on("click",(()=>(this._isModalDlg||this._closeDlg(!0),!1)));const r=s()("<div/>",{class:"dlgDiv",role:"dialog","aria-labelledby":t.getUniqueId("ReportsLb"),"aria-describedby":t.getUniqueId("ReportsCnt")}).css({display:"inline-block",position:"relative",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}).on("click",(()=>!1));this.$dlgMainPanel=s()("<div/>",{class:"dlgMainPanel",id:t.getUniqueId("ReportsCnt")}),this.$dlgBottomPanel=s()("<div/>",{class:"dlgBottomPanel",role:"navigation"}),this.$div.append(this.$playerCnt,this.$dlgOverlay.append(r.append(this.$dlgMainPanel,this.$dlgBottomPanel))),n=pt("JClic logo"),this.$infoHead=s()("<div/>",{class:"infoHead"}).append(s()("<div/>",{class:"headTitle unselectableText"}).append(s()(this.appLogo,{"aria-label":n}).css({width:"1.5em",height:"1.5em","vertical-align":"bottom"}).on("dblclick",(()=>{ft("all"),gt("trace",'Log level set to "trace"')}))).append(s()("<span/>").html("JClic.js"))).append(s()("<p/>").css({"margin-top":0,"margin-left":"3.5em"}).append(s()("<a/>",{href:"http://clic.xtec.cat/repo/index.html?page=info"}).html("http://clic.xtec.cat")).append(s()("<br>")).append(s()("<span/>").html(`${pt("Version")} ${fe.VERSION}`))),this.$reportsPanel=s()("<div/>",{class:"reportsPanel",role:"document"}),n=pt("Copy data to clipboard"),this.$copyBtn=s()("<button/>",{title:n,"aria-label":n}).append(s()(this.copyIcon).css({width:"26px",height:"26px"})).on("click",(()=>{it([new Y({"text/plain":`===> ${pt("The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor")} <===`,"text/html":this.$reportsPanel.html()})]).then((()=>this.$copyBtn.parent().append(s()("<div/>",{class:"smallPopup"}).html(pt("The data has been copied to clipboard")).fadeIn().delay(3e3).fadeOut((function(){s()(this).remove()}))))).catch((t=>this.$copyBtn.parent().append(s()("<div/>",{class:"smallPopup"}).html(`ERROR: Unable to write data into the clipboard: ${t}`).fadeIn().delay(3e3).fadeOut((function(){s()(this).remove()})))))})),n=pt("Close"),this.$closeDlgBtn=s()("<button/>",{title:n,"aria-label":n}).append(s()(this.closeDialogIcon).css({width:"26px",height:"26px"})).on("click",(()=>this._closeDlg(!0))),n=pt("OK"),this.$okDlgBtn=s()("<button/>",{title:n,"aria-label":n}).append(s()(this.okDialogIcon).css({width:"26px",height:"26px"})).on("click",(()=>this._closeDlg(!0))),n=pt("Cancel"),this.$cancelDlgBtn=s()("<button/>",{title:n,"aria-label":n}).append(s()(this.closeDialogIcon).css({width:"26px",height:"26px"})).on("click",(()=>this._closeDlg(!1))),Ve.skinStack.push(this)}static registerClass(t,e){return Ve.CLASSES[t]=e,e}static registerStyleSheet(t,e){let i=!1;const s=oe(e);s.__JClicID||(s.__JClicID="SK"+Ve.lastId++);let n=Ve.rootStyles[s.__JClicID];return n||(n=[],Ve.rootStyles[s.__JClicID]=n),n.indexOf(t)<0?(gt("trace",`Stylesheet "${t}" has been registered for root node labeled as "${s.__JClicID}"`),n.push(t)):i=!0,i}static getSkin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t=t||"default","@"===t.charAt(0,1)&&t.endsWith(".xml")&&(t=t.substring(1,t.length-4)),t&&e){const i=Ve.skinStack.find((i=>i.name===t&&i.ps===e));if(i)return i}let s=Ve.CLASSES[t];if(!s){const n=e.project.mediaBag.getElement(t,!1);n&&n.data&&(i=Object.assign({},i,n.data),i.skinId=`JClic-${t.replace(".xml","")}`),!e.zip&&"edu.xtec.jclic.skins.BasicSkin"===i.class&&i.image&&e.project.mediaBag.getElement(i.image,!1)&&e.project.mediaBag.getElement(i.image,!1).data?s=Ve.CLASSES.custom:(gt("warn",`Unknown skin class: ${t}`),s=Ve.CLASSES.default)}return new s(e,t,i)}_getStyleSheets(){return"default"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default")?this.basicCSS+this.waitAnimCSS+this.reportsCSS:""}attach(t){this.detach(),null!==t&&null!==t.skin&&t.skin.detach(),this.player=t,this.$playerCnt.prepend(t.$div),this.setSkinSizes(),t.$mainContainer.append(this.$div)}setSkinSizes(t){const e={},i=this.player?.$topDiv.height()||0,s=this.player.fullScreenChecked?"inherit":null;void 0===t&&(t=!(!document||!document.fullscreenElement)),re(t?"100vw":this.ps.options.minWidth,e,"min-width",s),re(t?"100vh":this.ps.options.minHeight,e,"min-height",s),re(t?"100vw":this.ps.options.maxWidth,e,"max-width",s),re(t?"100vh":this.ps.options.maxHeight,e,"max-height",s),re(t?"100vw":this.ps.options.width,e,"width","100%"),re(t?"100vh":this.ps.options.height,e,"height",i>0?"100%":"100vh"),this.$div.css(e)}detach(){null!==this.player&&(this.player.$div.remove(),this.$div.detach(),this.player=null)}updateContent(t){if(this.$msgBoxDivCanvas){const e=this.$msgBoxDivCanvas.get(-1).getContext("2d");e.clearRect(0,0,e.canvas.clientWidth,e.canvas.clientHeight),this.msgBox.update(e,t)}return super.updateContent()}resetAllCounters(t){s().each(this.counters,((e,i)=>{null!==i&&(i.value=0,i.countDown=0,i.enabled=t,i.refreshDisplay())}))}setWaitCursor(t){if(void 0===t)this.$waitPanel&&this.$waitPanel.css({display:this.waitCursorCount>0?"initial":"none"});else{switch(t){case!0:this.waitCursorCount++;break;case!1:--this.waitCursorCount<0&&(this.waitCursorCount=0);break;case"reset":this.waitCursorCount=0}this.setWaitCursor()}}setProgress(t,e){this.$progress&&(this.currentProgress=t,t<0?this.$progress.css({display:"none"}):(e&&(this.maxProgress=e,this.$progress.attr("max",e).css({display:"initial"})),this.$progress.attr("value",t)),gt("trace",`Progress: ${this.currentProgress}/${this.maxProgress}`))}incProgress(t){this.currentProgress>=0&&this.setProgress(this.currentProgress+(t||1))}showHelp(t){}showDlg(t,e){return new Promise(((i,s)=>{this._dlgOkValue="ok",this._dlgCancelValue="cancelled",this._isModalDlg=t,this.$dlgMainPanel.children().detach(),this.$dlgBottomPanel.children().detach(),e.main&&this.$dlgMainPanel.append(e.main),e.bottom&&this.$dlgBottomPanel.append(e.bottom),this._closeDlg=t=>{t&&i?i(this._dlgOkValue):!t&&s&&s(this._dlgCancelValue),this.$dlgOverlay.css({display:"none"}),this.enableMainButtons(!0),this._closeDlg=Ve.prototype._closeDlg},this.enableMainButtons(!1),this.$dlgOverlay.css({display:"initial"})}))}enableMainButtons(t){this.$playerCnt.find("button").attr("tabindex",t?"0":"-1")}_closeDlg(){}showReports(t){return this.$reportsPanel.html(this.$printReport(t)),this.showDlg(!1,{main:[this.$infoHead,this.$reportsPanel],bottom:[this.$copyBtn,this.$closeDlgBtn]})}$printReport(t){let e=[];if(t){const i=t.getData(),n=new Date(i.started);e.push(s()("<div/>",{class:"subTitle",id:this.ps.getUniqueId("ReportsLb")}).html(pt("Current results")));const r=s()("<table/>",{class:"JCGlobalResults"});r.append(ie.doubleCell(pt("Session started:"),`${n.toLocaleDateString()} ${n.toLocaleTimeString()}`),ie.doubleCell(pt("Reports system:"),`${pt(i.descriptionKey)} ${i.descriptionDetail}`)),i.userId?r.append(ie.doubleCell(pt("User:"),i.userId)):i.user&&r.append(ie.doubleCell(pt("User:"),i.user)),i.sequences>0?(i.sessions.length>1&&r.append(ie.doubleCell(pt("Projects:"),i.sessions.length)),r.append(ie.doubleCell(pt("Sequences:"),i.sequences),ie.doubleCell(pt("Activities done:"),i.activitiesDone),ie.doubleCell(pt("Activities played at least once:"),`${i.playedOnce}/${i.reportable} (${yt(i.ratioPlayed/100)})`)),i.activitiesDone>0&&(r.append(ie.doubleCell(pt("Activities solved:"),`${i.activitiesSolved} (${yt(i.ratioSolved/100)})`)),i.actScore>0&&r.append(ie.doubleCell(pt("Partial score:"),`${yt(i.partialScore/100)} ${pt("(out of played activities)")}`),ie.doubleCell(pt("Global score:"),`${yt(i.globalScore/100)} ${pt("(out of all project activities)")}`)),r.append(ie.doubleCell(pt("Total time in activities:"),At(1e3*i.time)),ie.doubleCell(pt("Actions done:"),i.actions))),e.push(r),i.sessions.forEach((t=>{if(t.sequences.length>0){const n=s()("<table/>",{class:"JCDetailed"});e.push(s()("<p/>").html(i.sessions.length>1?`${pt("Project")} ${t.projectName}`:"")),n.append(s()("<thead/>").append(s()("<tr/>").append(ie.th(pt("sequence")),ie.th(pt("activity")),ie.th(pt("OK")),ie.th(pt("actions")),ie.th(pt("score")),ie.th(pt("time"))))),t.sequences.forEach((t=>{let e=s()("<tr/>").append(s()("<td/>",{rowspan:t.activities.length}).html(t.sequence));t.activities.forEach((t=>{if(t.closed)e.append(ie.td(t.name)),e.append(t.solved?ie.td(pt("YES"),"ok"):ie.td(pt("NO"),"no")),e.append(ie.td(t.actions)),e.append(ie.td(yt(t.precision/100))),e.append(ie.td(At(1e3*t.time)));else{e.append(ie.td(t.name,"incomplete"));for(let t=0;t<4;t++)e.append(ie.td("-","incomplete"))}n.append(e),e=s()("<tr/>")}))})),n.append(s()("<tr/>").append(ie.td(pt("Total:")),ie.td(`${t.played} (${yt(t.ratioPlayed/100)})`),ie.td(`${t.solved} (${yt(t.ratioSolved/100)})`),ie.td(t.actions),ie.td(yt(t.score/100)),ie.td(At(1e3*t.time)))),e.push(n)}}),this)):e.push(s()("<p/>").html(pt("No activities done!")))}return e}enableCounter(t,e){this.counters[t]&&this.counters[t].setEnabled(e)}doLayout(){this.player.doLayout(),this.$msgBoxDiv&&window.setTimeout((()=>{this.$msgBoxDivCanvas&&this.$msgBoxDivCanvas.remove();const t=this.$msgBoxDiv.outerWidth(),e=this.$msgBoxDiv.outerHeight();null!==this.$msgBoxDivCanvas&&this.msgBox.dim.widht===t&&this.msgBox.dim.height===e||(this.$msgBoxDivCanvas=s()(`<canvas width="${t}" height="${e}"/>`),this.msgBox.setBounds(new xe(0,0,t+1,e)),this.msgBox.buildAccessibleElement(this.$msgBoxDivCanvas,this.$msgBoxDiv)),this.$msgBoxDiv.append(this.$msgBoxDivCanvas),this.updateContent()}),0)}fit(){return this.doLayout(),new we(this.$div.width(),this.$div.height())}setScreenFull(t){if(document&&document.fullscreenEnabled&&(!0===t&&!document.fullscreenElement||!1===t&&!document.fullscreenElement||!0!==t&&!1!==t)){const t=!!document.fullscreenElement;if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen();else{const t=this.player.$mainContainer.get(-1);t&&t.requestFullscreen&&t.requestFullscreen()}this.player.fullScreenChecked=!0,this.setSkinSizes(!t)}}actionStatusChanged(t){t.name&&this.buttons[t.name]&&this.setEnabled(this.buttons[t.name],t.enabled)}setEnabled(t,e){t&&e?t.removeAttr("disabled"):t&&t.attr("disabled",!0)}equals(t){return t&&this.name===t.name&&this.ps===t.ps}getMsgBox(){return this.msgBox}}Ve.skinStack=[],Ve.rootStyles={},Ve.lastId=1,Ve.CLASSES={},Object.assign(Ve.prototype,{skinId:"JClicBasicSkin",$div:null,$playerCnt:null,name:"default",options:{},$waitPanel:null,$progress:null,currentProgress:-1,maxProgress:0,msgBox:null,$msgBoxDiv:null,$msgBoxDivCanvas:null,$dlgOverlay:null,$dlgMainPanel:null,$dlgBottomPanel:null,$infoHead:null,$copyBtn:null,$closeDlgBtn:null,$okDlgBtn:null,$cancelDlgBtn:null,_dlgOkValue:null,_dlgCancelValue:null,_isModalDlg:!1,$reportsPanel:null,buttons:{prev:null,next:null,return:null,reset:null,info:null,help:null,audio:null,about:null,fullscreen:null,close:null},counters:{actions:null,score:null,time:null},msgArea:{main:null,aux:null,mem:null},player:null,ps:null,waitCursorCount:0,basicCSS:".ID {\n width: 100%;\n background-color: #3F51B5;\n display: -webkit-flex;\n display: flex;\n -webkit-flex-direction: column;\n flex-direction: column;\n}\n\n.ID .JClicPlayerCnt {\n background-color: lightblue;\n margin: 18px;\n -webkit-flex-grow: 1;\n flex-grow: 1;\n position: relative;\n}\n\n.ID .JClicPlayerCnt>div {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.ID button:not(.StockBtn) {\n background: transparent;\n padding: 0;\n border: none;\n box-shadow: none;\n text-shadow: none;\n}\n\n.ID .unselectableText {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ID .progressBar {\n width: 250px\n}\n",waitAnimCSS:".ID .waitPanel {\n display: -webkit-flex;\n display: flex;\n width: 100%;\n height: 100%;\n -webkit-justify-content: center;\n justify-content: center;\n -webkit-align-items: center;\n align-items: center;\n}\n\n.ID .animImgBox {\n position: relative;\n width: 300px;\n height: 300px;\n max-width: 80%;\n max-height: 80%;\n}\n\n.ID .animImgBox svg {\n position: absolute;\n width: 100%;\n height: 100%;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n}\n\n.ID #waitImgBig {\n animation-duration: 0.8s;\n animation-name: rotate-right;\n}\n\n@keyframes rotate-right {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(1turn);\n }\n}\n\n.ID #waitImgSmall {\n animation-duration: 0.6s;\n animation-name: rotate-left;\n}\n\n@keyframes rotate-left {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(-1turn);\n }\n}\n",waitImgBig:'<svg id="waitImgBig" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg">\n <path fill="#3F51B5" d="m 65.99,40.19 c -0.42,5.33 7.80,4.94 8.11,0.20 C 74.50,34.37 66.35,8.59 42.92,7.98 15.90,7.29 9.96,29.50 9.94,39.41 15.33,-1.66 68.61,7.048 65.99,40.19 Z" />\n</svg>\n',waitImgSmall:'<svg id="waitImgSmall" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg">\n <path fill="#3F51B5" d="m 57.00,39.43 c -0.28,-3.53 5.16,-3.27 5.37,-0.13 0.26,3.99 -5.13,21.04 -20.63,21.44 C 23.85,61.19 19.93,46.50 19.92,39.94 23.48,67.11 58.73,61.35 57.00,39.43 Z" />\n</svg>\n',reportsCSS:".ID .dlgDiv {\n background-color: #efefef;\n color: #757575;\n font-family: Roboto, sans-serif;\n font-size: 10pt;\n line-height: normal;\n}\n\n.ID .dlgDiv a, a:visited, a:active, a:hover {\n text-decoration: none;\n color: inherit;\n}\n\n.ID .dlgMainPanel {\n padding: 1em 2em;\n max-height: calc(100vh - 8em);\n max-width: calc(100vw - 2em);\n min-width: 20em;\n overflow: auto;\n}\n\n.ID .dlgMainPanel .headTitle {\n font-size: 2.5em;\n font-weight: bold;\n margin: auto;\n}\n\n.ID .dlgMainPanel .subTitle {\n font-size: 1.4em;\n font-weight: bold;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel p {\n font-size: 1.1em;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel table {\n table-layout: fixed;\n width: 40em;\n margin: 0.5em 0 1.7em 0;\n border-collapse: collapse;\n}\n\n.ID .dlgMainPanel select {\n min-width: 20em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n color: #757575;\n}\n\n.ID .dlgMainPanel input {\n margin-left: 1em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n border-color: lightgray;\n}\n\n.ID .infoHead {\n padding: 1em 0em 0.5em;\n}\n\n.ID .JCGlobalResults td {\n padding: 0.4em;\n border-bottom: 1px solid #b6b6b6;\n}\n\n.ID .JCGlobalResults td:first-child {\n font-weight: 600;\n width: 14em;\n}\n\n.ID .JCDetailed td, th {\n border-bottom: 1px solid #b6b6b6;\n padding: 0.3em 0.4em;\n vertical-align: top;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ID .JCDetailed thead {\n font-weight: 600;\n}\n\n.ID .JCDetailed th:first-child {\n width: 7em;\n}\n\n.ID .JCDetailed th:nth-last-child(4) {\n width: 4em;\n}\n\n.ID .JCDetailed th:nth-last-child(-n+3) {\n width: 4.1em;\n text-align: right;\n}\n\n.ID .JCDetailed td:nth-last-child(-n+3) {\n text-align: right;\n}\n\n.ID .JCDetailed .ok {\n color: #4bae4f;\n font-weight: 600;\n}\n\n.ID .JCDetailed .no {\n color: #f34235;\n font-weight: 600;\n}\n\n.ID .JCDetailed tr:last-child {\n font-weight: bold;\n}\n\n.ID .JCDetailed .incomplete {\n font-style: italic;\n}\n\n.ID .dlgBottomPanel {\n height: 3.5em;\n background-color: white;\n padding: 0.5em;\n font-weight: bold;\n text-align: right;\n border-top: 1px solid #eee;\n position: relative;\n}\n\n.ID .dlgBottomPanel .smallPopup {\n background-color: #222;\n color: #ddd;\n padding: 0.5em;\n font-size: 0.9em;\n position: absolute;\n right: 6em;\n top: 1em;\n}\n\n.ID .dlgBottomPanel button {\n display: inline-block;\n padding: 10px;\n cursor: pointer;\n line-height: 0;\n}\n\n.ID .dlgBottomPanel button:hover {\n background-color: #eee;\n border-radius: 80px;\n}\n\n.ID .dlgBottomPanel button:active {\n background-color: #b3e5fc;\n}\n",closeDialogIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />\n</svg>\n',okDialogIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />\n</svg>\n',copyIcon:'<svg fill="#757575" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" />\n</svg>\n',appLogo:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">\n <g transform="matrix(.02081 0 0-.02081 5 62.33)">\n <path d="m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1999 519 3 11 999-266 999-266z" fill="none" stroke="#9d6329" stroke-linejoin="round" stroke-linecap="round" stroke-width="180" stroke-miterlimit="3.864" />\n <path d="m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1998 519 3 11 999-266 999-266" fill="#f89c0e" />\n <path d="m357 2850l1000-268-267-992-1000 266 267 994z" fill="none" stroke="#86882b" stroke-linejoin="round" stroke-linecap="round" stroke-width="180" stroke-miterlimit="3.864" />\n <path d="m357 2850l1000-268-267-992-1000 266 267 994" fill="#d9e70c" />\n </g>\n</svg>\n',halfMedia:{width:376,height:282},twoThirdsMedia:{width:420,height:315}});var qe=Ve;class Le{constructor(t,e){this.type=t,e&&(this.file=e)}setProperties(t){return ce(t.get(0).attributes,((t,e)=>{switch(t){case"type":this.type=e;break;case"file":this.file=Zt(e);break;case"params":this.externalParam=Zt(e);break;case"pFrom":this.absLocationFrom=e;break;case"buffer":this.recBuffer=Number(e);break;case"level":case"from":case"to":case"length":this[t]=Number(e);break;case"px":case"py":null===this.absLocation&&(this.absLocation=new ye(0,0)),"px"===t?this.absLocation.x=Number(e):this.absLocation.y=Number(e);break;case"stretch":case"free":case"catchMouseEvents":case"loop":case"autostart":this[t]=mt(e)}})),this}getAttributes(){return $t(this,["type","file","externalParam","absLocation","absLocationFrom","recBuffer","level|1","from","to","length","stretch","free","catchMouseEvents","loop","autostart"])}setAttributes(t){return Lt(this,t,["type","file","externalParam",{key:"absLocation",fn:ye},"absLocationFrom","recBuffer","level","from","to","length","stretch","free","catchMouseEvents","loop","autostart"])}isEquivalent(t){return this.type===t.type&&(this.file===t.file||null!==this.file&&null!==t.file&&this.file.toLocaleLowerCase()===t.file.toLocaleLowerCase())&&this.from===t.from&&this.to===t.to&&this.recBuffer===t.recBuffer}getDescription(){let t=`${this.type}`;return this.file?t=`${t} ${this.file}${this.from>=0?` from:${this.from}`:""}${this.to>=0?` to:${this.to}`:""}`:this.externalParam&&(t=`${t} ${this.externalParam}`),t}toString(){return`${this.type}${this.file?` ${this.file}`:""}`}getIcon(){let t=null;switch(this.type){case"PLAY_AUDIO":case"PLAY_RECORDED_AUDIO":t="audio";break;case"RECORD_AUDIO":t="mic";break;case"PLAY_VIDEO":t="movie";break;case"PLAY_MIDI":t="music";break;case"URL":t="url";break;default:t="generic"}return t?Le.ICONS[t]:null}}Object.assign(Le.prototype,{type:"UNKNOWN",level:1,file:null,externalParam:null,from:-1,to:-1,length:3,recBuffer:0,stretch:!1,free:!1,absLocation:null,absLocationFrom:null,catchMouseEvents:!1,loop:!1,autoStart:!1});const je={generic:'<svg height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M28.8 12L28 8H10v34h4V28h11.2l.8 4h14V12z" />\n</svg>\n',audio:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" />\n</svg>\n',movie:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z" />\n</svg>\n',mic:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z" />\n</svg>\n',music:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" />\n</svg>\n',url:'<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z" />\n</svg>\n'};Le.ICONS={},s().each(je,((t,e)=>{const i=new Image;i.src=ne(e),Le.ICONS[t]=i}));var Fe=Le;class ze{constructor(t,e){this.id=t,e&&(Kt(e,"data:")?this.audio=new Audio(e):this.file=e)}setProperties(t){return this.file=t.attr("file"),this.enabled=St(t.attr("enabled")),this}getAttributes(){return $t(this,["enabled|2","file"])}setAttributes(t){return Lt(this,t,["enabled","file"])}realize(t,e){this.audio||null!==this.player||null===this.file||(this.player=new Me(new Fe("PLAY_AUDIO",this.file),e,t),this.player.realize())}play(){this.enabled&&(this.audio?(this.audio.currentTime=0,this.audio.play()):this.player&&this.player.play())}stop(){this.enabled&&(this.audio?this.audio.pause():this.player&&this.player.stop())}}Object.assign(ze.prototype,{file:null,enabled:2,player:null,audio:null});var Ue=ze;class He{constructor(t){t&&(this.elements=Object.assign({},this.elements,t.elements),this.enabled=t.enabled)}setProperties(t){return this.enabled=St(t.attr("enabled"),this.enabled),t.children().each(((t,e)=>{const i=e.getAttribute("id");this.elements[i]=new Ue(i),this.elements[i].setProperties(s()(e))})),this}getAttributes(){return $t(this,["enabled|2","elements"])}setAttributes(t){return Lt(this,t,["enabled",{key:"elements",fn:Ue,group:"object"}])}realize(t,e){s().each(this.elements,((i,s)=>s.realize(t,e)))}play(t){if(this.globalEnabled&&this.enabled){const e=this.elements[t];e&&e.enabled&&e.play()}}}He.MEDIA={start:"data:audio/mpeg;base64,//NAxAARGk5RdUEQANIEZEBAPGPyIAAYAKMY/6EaQn8hP+c/yEb//kITU7oc9Cf6nPnPoT/8nQhCKEEEnDizkAwM8ThYH1Bj/EAYEhyUGghyivv7fn0vtsLdYI0CiTQE+aaqfH3BW37/80LEFhl6nvZfj1ACplLtsfx19gOQfBp7iHeEWRj8WxiLLI6khikjEI9IvsePycfERCSpPJ9s95IbO1O/tRX70XQiOGX+n+hmeb+aMirKxN/IibInf//G3K9PVym7NoL/W2usCkcMT5T/80DEDBcivuJd0lADkXMLoGxcA7ENhPlAY8LMK280iLkhQq80ojkRQCwz/rEsTjjTlMPMu3RWZ2c3dmONON0NVDzDzDzP79Y9PFg9v//oqi4hHyp+7HGl2b///I8VcYAAls9qrCT1Mv/zQsQKFsrCvlzLRNa/FN/jd/HUrGLUa8tKonzDK8+t55alG5sbKYilBExD8Id1ugmp+eKIdSplGpaoxNZiznEU/J9KJmUsqBzPVjJ/+Aif//71QCdv+gE7f//6gICqPAAci1sbgH8/G//zQMQKFfF2qb9ZaAKU9PlY3uHFsAqAXfgZvyyhtTM2fC1zH/8+tFlslODFHjTHsClFqSTfprRCxdzMcppQ8yHsbbEkzpoLvZFBnWt1GBa/+8se/+SPdQe//FIIsAAAba7YbC65AQAf//NCxA0XMh6xv5OIAEIz0mVENAJ0DbwIQjpGYFNAvTSI1ePBuh+MwYk+xib0DA/K5YQadIk+o0Z0UyLmiv+h5bMD1Ro3/3/TSUggmu/+v/7KNL03CcLAh//5dpCqkltAAAqFFpldqAHI//NAxAwXGl7aXYxoABm/nTyF8EwhIPY/DSOKUIQ2WXUzAlFDQXzyRCXBUNUk33XoqQNhyeltWFUL6CKTImv7/vSZNZw0MP6v/v2oFQ5EUR7/1SVyb//E7FkIn9f9NXWQAg47vXRBbzv/80LEChbaYs5f2IAC9rPHK1z/yygqmvwSoaAGvNLr9jCagdVUGyxOpVqpp79lJPf9ZNEttWXTUvf/9azMUgOcZrZPMThF00d7//v///9SnpUlpJJJJJFeLhp3///yKi4QAHWdrdQE07P/80DEChTJvrI+Ro6Oalhjl3DYQyyMpMHHcIbTFNlqYvp6GKBJBYZ89G+PKyt/Q4oCbx9z9b//80CTA+F3zTlSqOz6G0PoVCIItC3/CnwN/xZAvcr/99VSIAEKz7+UABhWz01LyctXJv/zQsQRE5nOvl4WFHISWA9Ybn87+VaIKzA0kk7n33/KHo6qv1QKoNjMTHtX//ocaRCuGg2MP8jbueS9WIWU3NPcenOEv/CbcsVAKiIkATNv/9QAb60qFitrzbcZQ+ixX7169gCfAOpwHf/zQMQeE+Fasl4T0HJRrdobjyh8XBKr80WAqJQaiQPhY7vmJ4///ppkOhOaLMDbgVOwVdYt0SgqM/4hBQO+qglKQAFQM0aPnrrVvpRJLyCYt2amWVGBpcJrSl6ypI4hgoMQk5Di+Yv3//NCxCkP+IpANGYehC+92dkrPJ/1a+z+3/r/sL/6f+6G7BotKqkVeDWsJLMDPP8pf2a4///Jf+VgHuRkfn85h7MIeAY9RE3ZM3IRTyUaGvCJpep52lDPb0nCY5xRqRkEWzDKgw+8Ftdp//NAxEUS42YhgAhHHAG9ZCQjo0VONppYbQStB6qWUv5f591O8bze0/3y//62eUqnWzSn9vNsnOBzK8TN6urr6bcxGukbeqNZjuyIMO5FREnqzI6SVZVcahzgpCwMa561B4M8zjedy6v/80LEVBI7ViYoCEsdN5b7kv/+Rsub5P/X6yz0/JdhcZdZl+/hII/xFYdTSmc0ck3O0055fkc2R+ZgsyZsEagnMwRqkK1xle//6iZh/ITJmiF/yEKT4QyEKEP8hMQl/mNYxv+hn/lKZyn/80DEZxEbPiWICEc9StmmMZW0r1KXR/qYxnX0UpWMZAxQFqoapnCiQwqxihWDAQEBAQEKE6mZGZGTTMiMjTWZHa/aZkZlTRGXojIzL///////8yP85/5k1lspGrWRyNWCggYME4kGJf/zQsR9EkNiDAAARN1MNUkqTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/zQMSQDcslQAoAR1mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",click:"data:audio/mpeg;base64,//NAxAASsyJgIUEQAY///gX8///yfyHO/8hCEafoRp3nPQgAAEUAABBCEIT//QhCKQhNGyEIQhCNITU5//OQhCN7f/yEZQAAIynOc5CEIhGnABGY/4gAIQZ4h4h4d3Z2Z9Jba5XWhWP/80LEEBhJOxcfiUAC9BEda+oiKFQsViiMpvHFC98pLjySjUNeKoYxMpwIT21HmHlEhx83A9K5vDAuZUQxzq7nJPgEVWKQZ1Iu5oJH3UpGObWV/MfAgLC4Z/yhP/ULKnqHd/syOQenhOL/80DEChZpZs7rzBgAT3bBWub0T/xNtn9nY5bvQdCA0TvnpXNC7EJ3iRPtebJ//7xK4IAqIii2AKbfkBAJxATDLN7wiUGv6VANBNjqQwGCayGoaBAJaNC79/z5wP2IuJbfZsNFgBVo7P/zQsQLF0lGxvRJhlQVDyEmYldHXJGadquTRs6aYmq9VY1hqqt6xmqts2zGTvGNrl+u1IMBHREJREbkpaFQkFRoa2FYSDvBp6DwSf1lgFqfkQ0JcRCYlKxKg0eEw8sKqgaEogGBH3EZpv/zQMQJEyEudaoIBoAf+HV2UBjoOsP2/IwrkezQ1Y4e2wVxgxlVAqDQUSRUBRU6LrBY1lvxEdUBWBIOnZWOCrvlVnTsltWNOqPP4seUBcKgKpW44m3GkHLjaBS4ohHZdTGi6FXXVo6+//NCxBcNYAYyWAhEAJ3U+j3uXdl1z1Du30fCySCGablvUTrhwggLTomAAmrWsmWY9ym89ZcvlwX/zf+a95ZLwXOar/LNrJ60LUl25Hs58yKRWIjSbt9DCIs0UtF/TOlm2cyNTpKysuCB//NAxD0Rw1YliAhHPdmd9nYYQOsGCgAfmqIAXlnhbNZeUBQvyL/y6NlP/r1LLlEiSPL/7lE9SirM5zxZEwCseMDL330yrtl8/8jJs6mt5dTloYsvNSGbmTkYQhpVpRpCG1yr9YSfr1b/80LEURFLZiWQCEc8v/rLXPzys+Z9z8v+H9qyCMpGLn3bla9qtcxYZXk9cbOUjb8t0q2ytz79ImM1R0ht3QdWK11myihIpt8SZBRAlbWq3CDpDKWUte/VHgJDH6k+lsqSPbRj+pHWWrL/80DEZxKjYh2ICIfhxIKhMBeLPjgKlFRIKjCxIKjCukkFAKCSCxFtgTAQFIkisqIg2EngUVFg8FQCQUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQsR3EnAF9kgARgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",actionOk:"data:audio/mpeg;base64,//NAxAAT+gKmPUFoAI81KAANYQZECuQAASjAD820006kC+buYDgGEGEKIcsCYAUQYA6JeI2JmS5wcY5yXL6b1IJpp6kG////9X+h/oaaaadAvpvBA5/9QIDQQOQ+cbQllsQQAKTggvn/80LECxdCcupdjFACwA8cFoNFZuosRJUe3E48kEhWIRueePjSdR4T9XMQ4SwB/BZ1GQNAtHHOPzOFryImV2zlb//rZV/6MYp56IY00sPgvi5vp1NN///3Q4ZlSUVV6wAAHLn//b/+Bv3/80DEChbo7s5fmGgA8cDgPEdPslrmVdkwdsV66+p2vZktFECYbF0sxMc6XTyGfU7omIDWqTLdIdocopcSHkqkN/1OLnGEiTI5lQIHz6F//h8+Aw////SWn6Ai////RQCALJttttthGP/zQsQJFgLXBl+PUAJpUBpuDr/a/Bn7vbuBpTSaJu9C26HLGnV05pymMa+52rjwoQl9HX5xkseQEWn/zR+C+CGcTN1IQsr/O/6N///////zyotv//Ulb+WNu/4a/G/DAGASAsBQ86QpAv/zQMQNFyqWqFWaUACorGJ3w70JwQXdB1Iw8FBR6w8BkLlXmCwSQKbRFEDGyFEFw/LiWNeT8eOSG/++3///5oEpv5wrF/RmoYsz////+yuLZ55GT//yosfyqj5gugANMBv///+Bt0Bw//NCxAsWul7hv49QAIAcsuZ3XnIKHgXVwYS+wjbgGuEvA8WjfAsaQmNk2QkZh5517ceH7uZegsm5y///0VTDzzDz09dev/6IIMKcL8i/5CSjE3/oqRMBZpmk7R/RgAAbjwkkcZrZNKRG//NAxAwW4j6pudpoAwwbDspelxARGBQ5l21KTHGz7RkyVSuLZ5l3/S9SQ1CutfuvPzIvF4HUFzRXNkiXJVH+pv//mvMTVRJGyT6S29LRao2Wqj///UbLJxLHVPBVD9SWyADnc5p6REf/80LECxb6Uoxe3A7SY0MyGLYtINLEx4dXVEEvywRGZ7pcZEtrkjRpam6yOArCCRZNX/W3WOoGKq04z/0I/nt/UCYZf6GfovMahvTn21oZ7KnY4oNhuRFQuLsBID8cKC5qSQAC9j29EzH/80DECxNZYoT+xuAyRLbuBA8WRBNAN0Eq+mboAV7G62xjgCvi7cM0Ov1kOELDyoy/75RGdB8iaMZJ//S9SaPWe8oonsV4o5NO40K5FG2xNQZo78WcFOwcZjQQYvlIW6mGkh0f0ZiOBv/zQsQYE8jiVBDfVogDF7hUFzGQhTgpeTFkKEeXlL8syjVHZ03ZCDR2nSxR7Pq7np3LRaHB9adBZ07r018kdy3tjTX1KiSqekjtoMGlaAKNEYCZkOHzpZziA0FmwmEDZhMwfvxGWFAY3P/zQMQkE5DaRAjW1ohECprRK1TRrKRtJsNpyJrNfLvndF7g+gSnAyt351B5obyX8r/u//////rqgBmlYGs01hNdBQpEQyNoHhEMuUtgytPS01oLy0hu6NVNabzryYxwzfIqvKPaRFls//NCxDAQ+FYw8gjSKH7tHbMxfJlUtVpIB16SI0SEXBsf68/+/L//zfLll/nmj7F/1pcpZ/+Z3Ur5Eq5WpbM9MfPljxeb9Lamv/nXIuOSkVXJVRmzRxLpVUlMiBhOahamKCgmCgSwVXHX//NAxEgRU1YcAABGvSNI0Nzzp5SNpUj5aE3ZUqAvIkhEnnq1D3/yxFqrceAgEVIho8WKlhKVGBUJHjzvOh0JndVbtdYykkFQmdDoaDqCIaLKTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqr/80LEXRFYBf5ICEYAqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=",actionError:"data:audio/mpeg;base64,//M4xAAUuVJUAUgYARcXFz4DgFAeKHAeChiIie7u+iaIibgYuAYGcTz3OIhf/Xd38v+J6J7u+gGBiw8P8PDw8PDHRw8/+O6GADo/h78BEQz8HAHh5+v+A4A6H/8AAEfIiZmZBXlicwVCsWj1//M4xAwYWvL/H4goAHY5EADTzSBEDUpfz/OhTMPGC+NAMWAgfAcAgHFSjhZD1PCRAUQFBjMUxMhGGuOVyndnXzvlH2dGLp+jbHsUykMTTFkX/+ror2841v+k//+MIOdv/GUVmvrpkGSqAYta//M4xAkXMsLmN89oAg/iwxc/bCcqY374+ZYv8ms1WUWQHQlTUFCJgbIjvMcd6K1m71G+ttB9Pt32bR6OptTZxtV0l/ov20P3b9/1/1f0dSCkh7FjKTdSRbQKiRLyBKFroXi7uP0CAvGOAWNk//M4xAsXwr7a/mPUwS+O1HXtgEWD0qvqiuk8xOG4QoqkAU5eFUIMYl8WHoK3Hcq2dx5p5fTjLvlFtLucF2SuaciHhslc4JhNnm5XU2pCS6c3n6+3/9GyFsk+xwWUQmSTumm7e5ggAEWsUBor//M4xAsXCrLXHntO7NUoPTkrtfAzt+Vmc1QDhdvOk4mMiMaxzG9AERpgbNKfJVp0/lfOvjfl9SWj5XpoXfIYVep7R0WTaUAGDj1IkMHy1Oyrfnfq2e37/22fJduLdKpFmVawABglJaFVG03L//M4xA0XurK+5HnLTJeQXpCP4L6DAO1L6jOnPOCx/wVBu4nAIHEgOCbXJbP5R/74hGiwND1iw7BYtTsqM6viJ1aoa14o/kdXwsdo2K6nxravl7al1/t+rUDz4J+IDtW7bbVAX+3gDwiUL8lI//M4xA0Xgq7qVnoO+zaBvGmHeGt1WGsEPh7RWPKQT82FEhiWLGeUlRHjRERFE6UUhhATy9J5Lcv+PM+axpVIkaHDqqvi+yUHdjW3sp2vTv+rav9F/Kt+Lm9QJFdnwrvt7SXHLLMAFKoGoNaO//M4xA4UurLyXkDFT5XYo5iQ9ckoWFh61037WowPpb5NVRWlrUmVVqxmNV/b6q+xuJVfY1VVXfDHvnL7TGOFMb6ifdZf0etaP//lZH6FbyuK5MUAYWLKUvoamjS5tZpdNnrWz2ASUXdsckcS//M4xBoUcVJ4IisMydfHkiAUZzmoyajzSOzOf1T9qlFq+ORkFFeC//HxXOxf/PKPG/CNxYO4+WKbl+Lv4VBQU6KKhP/K/+vK3+WXVv/9SobSZ1b/lb9SshjN9S/Upahjf/LMahjv6qx/DpAR//M4xCcS40IEABDN5DMaqqrVVVjWLGPjH7GpWZ/7dqr47Eq/7HQds4duAxGfzkjUTpoLSIv///qn///YxTAwQIGhyP/u7O/3P2eqNZ2k4so4sp2NFAYhnZ2couBNTEFNRTMuOTkuNVVVVVVV//M4xDoKqz1wDACNy1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",finishedOk:"data:audio/mpeg;base64,//NAxAAQiXIEAUIQAPnfO/OdyAYGehP/U5Gqd+c/8785zoBi3QhCMpCVP+SpwM6AYGODH/8TvB+sPiMP5cMCcPygIAg7/lAff4IAgcBCD6ofD4diQbC0WaISi0SB3EAzA8WZgeALXg3/80LEGBoDGyZfglACgsRODRuWFcnMLm+eQEhRVQz5IePy5Icm/2Yn5GLY58hG3/J0JyAkq54WhVHosmkTmr//OYkIx+aejta5yObVf////fbcgJP/8oP//L/+w6tzSgKyRVuaO6jleQb/80DEDBdLJs4/2FABfMefV3NU1/Pu+MiMj5TGccdZM7mtR9poqDaj269WQ7clU5//OzTSgSRYFoL8eoeaaxhw+u9lq/9jn/NY7/3VPohqW+///////5ELQ+cqSm8F1QfSAHmkZP3Rz//zQsQJFgHCul9ZUACtuzlS2auXefrUxQUkTU+etjYpBz++SrehymLQlDIbPScu+uppsoFMTf/5uSiO7kpKKo1ONQ6/NbKkDv8iJj3OE/xEHRQl1Hv//4UPLBeWtoFTaaAttttstQEAgP/zQMQNF1PXDl+BUAJQhUAPuz0DJsKELcVBuf+NDz79ceCoSE/meeYSBfk6fQt91kZOYYxE3/+2YwtnyQxn////0JHMY+w/H5OSN/////zDGf5+p7///////kjSQxXTFGTyENw7gapG//NCxAoVUeLUAYKYABCegFrFga4BpxsoJJHKbdSSNc9rTRNTiRTtofSWUkUt1o19fWkoiIJAGaRYixFlM4yQ2FK7pDOlX6q0Ty0TFQNc910f521f//sEw5VqWAAa0xN/4IJysXXPUXWj//NAxBAYQc7CX9RQAD7L1moNjonkAxWFww4nWd9JCeciFDR6QsKgKiayKccZU7pWdi9jnzTd7C9HzWNZFE6VNY70udouzEPUInt/WdLG0YKntR5SDn/rBWjQpBIJjCnEADG403RAjmT/80LEChYx1rpfU2gCXkzXRRXSZBTHSfAUM4JVGmSJvr92ZalqJzOtY1C+n3qXd7ojHpJVph9KfTv2QF00S62UsnjyUkk+pbH0Uf+akuloBUN9eziVT/Kbf//1pSuJ/YIvIGDjaERizGT/80DEDRciBtzLgWgAnyaG0C1lwTMAJBpi0QiX27oskt/p2pJGx1aanoWQ9R1FMw1JVmtN1vSNE2ZKcL4kwhTIv+7hPkVpum9/54qQNoCB5od9Wc/WVZltv//9olVqRkBpkMgFbWp6pf/zQsQLFGGq0jfYOAJYZ33eO8O4ay/WUDUrPXKa0BSIWhEPEua1Jvfvd1CxL/0T7nGsppoSEjjaf6tN1ZTTR0SRqRO/+K/Ou/9CwVOnmrcSdMqBpY56yFdrrd+BUSsXF/De07+HriXkC//zQMQVEyIO7l9IOAINDw83zXmx47coMuc54Km6W6HL5VI1dHUoFS9CrJ/FZBL1apo8Bec67a3b/1JDQt4iEv/niXtWlQKNhcSXFrNXq9RoxmJPGjO8N0UWAZDR6hQZVGYs4HkcGtuz//NCxCMcqvMKX4VQAp6GEjERDVO0nICRTDDitdHYkPnkRhZTDzS5o/yvFTPc9GLCuTkX7OXt7fseehISK578TUFArC8lNQ06n//2Gg/Jy48bb9TWcmmH//93/Fyy29rQUkjgEwC74QXH//NAxAwTWb76X8xoAtGYil8Sf13FyrazOOzs66VgJUPYvJbKXWr+myS2SrPPf1KWiiiyOpLSWjRTZFlalf//omqn///Bl/gqd4NSP1sCtUboQAq2KfAZcuompqTyWlosplpidkw4Y4D/80LEGRRiJrZdUqAAgAJMBywG+KiSmxrWtlKfMj6SV386x0gTt/1OtvvS0CizI+umWkl/XUbP1ESayKkktX93dfzztT61SAEkgBQEjccjkciAYAa39zxcaPCYCFY9Q550fgIUwErGSDn/80DEIxwS+tZfhWgDSkw83gvvZTK1Iko2tI9rLpf1mZ+b1tMy4Nm06mXyUQY9ZLXyQUJTs9RmYhzjd0y+bppJEj+8v/+81fqQYzTN1ppIW/////+pA0UgaXaVuC5FVLzhMlMyKAyi3P/zQsQNF/I62AGBiABLhOwsg1FMBUmAa4LK0kU0GslRZGmpJb+3on0EzNJjN/Rt+6CJfdTUtj6KkvV+iRcjyBCdC2XzhNFUvstzFYtImJ1Ff9ZRIj59h0HQICe1It//pYprEApJJFaBDP/zQMQJFHJu5l/GaALvVEYd0Zlq2t/CXLznyPVFYKIeRsUnRSrZNn/r6CnqdQ5i8i3q1bKfpGtS0UV2JMeKP6knf2Nf0VaLGLbf//rR0WRKyF4MhrBplw9IE232uwC4QyFzCiYsW86d//NCxBIT0nLqXgpUxo9sRW7llTyJzaqvmIaPi3VgsG/mt9ykwfCQIU3OOY04ehw7/ppOC+OfQ45TbwRmsdOf9V//3NEgtEX//4aVAAFRFv32vuC0ePWVlkuksMhlhMTeSZcTTa6TL1tX//NAxB4T0m7aXgNUnlF5nDuaJdERvfmX6mCXNcKxO/V1USAU/9yGy3Aqp/1gZFJn/1f/82RAAwvUf/9n/4aVAAEIF91+vwCeBTp6TCmP9INghMQii720i+pAnlzzrUX1IHQtju2swb//80LEKRQCbtJeAJqGnOo/ai6SKYMAWbN+pyk9BZgJk//uSoi1brV+z//mZmmHNKZ13/4fAAEADstllgF/v972towZ0QXK8AA+PC5cN0PRTdbHW9k5M9zgqso/zibfk+1ZC/skJF/61jz/80DENROyfrpeA9qODemqMKr/rUHwRS1Nq9SKD//rZIcRZmT//kUEALSZ3D//6vAmzqOlAm8FwxbwFiX8VRMT/DEsPCqRbOw8Q1mIxxtBkkSi3qAOVm6F2/FRWYSyB/bF4bP/YoK6TP/zQsRBE7JuiRpulMRYCzO1V/Bgm+3///oVNQABURf9/bgBP/8U9MW42GQb/AyP4bURvzzGIYvAhJL0x3ooCTlFLZYWlmfqPt+PdVErEQz3RZKDyTFf60vWSP/2GMeX/qsr/+oxmB0RAP/zQMROEzJqxl4CWpcBmBvv9vwBTX/L98zdfopM4GlbpJtgUn1eHHhe8yxjmqcdp+upQEuTdtU3X9x6VTAMv2qIoiG/VYg/GN7/nhJgfH2Qf0qSKab/9STkueh1IDkmklAH5fflAZLq//NCxFwT8m7CXgPall7BM4igvw7JyAbmlbrY2Zmc95UkokD/dw4U/VNjZq2TcStZukKgZTDVrng8v/mRTZa8Yre35WIl+v9boo3/1pprJU2wFQAyBI5tJABr9/77Z/CdRCLoRWqEYrN6//NAxGgUEnKcfgPaq4nSU+eNbpg1JSTemhOK12Eir1L/WdGRPphACdmzWMj7GIgg/nV/2MkNzYiH1f+MUXviFwhf5ESNESoACMgKy22UAf/oZWmPclPEoiClH5cGwN0IZce9FABAWFr/80LEchQJ8p2+BhqSJMm0Y97b+IcHG7exHP1o1ozptGFJY96zeDFv2jvm5WapBNLZ6npCx39f9//xJxaUAGauYYNH0NxP49ytAzAugiwASDuCaDUpRXKKAro0F7oKjNigqK2bCimismz/80DEfRPCbrJeUYsW2bJs07zhUJE83J52vOGiuPNiokv/+//8tONhddJC82Fk8VX//+//+L/+X8vgX38/zyBLzXnwocMyMyN5mLPJsiIzhs/AZfSMyzTJX/zT7ykZlXbe+/dxn2i68f/zQsSJFBiqZBYAXknZ3GPTCDzzqqXjKRMJwaRC8G6IQU2nG4n4GGmXKsyZrv9S/Pz0LNbNUKz3/+L//YfmT5sn3CfNUKp/vzCv+a/PzXF+sMhBLEGQyJlrOq0Ao4kKJILAayo7MqEZp//zQMSUEvNmFAAIzcjp0sip/9jKz0mW6zFUj/RP6r+xkUjlR2Mj/dbbIrGRyodjWKh2MrGEVYys5TKUSGhweBQ8NIQysZWMrlRxEYLh0SRVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//NCxKMQi2IeUAhHXVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//NAxLwR22HQAAgKnVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",finishedError:"data:audio/mpeg;base64,/+MgxAAT5BX8AUEoAP///mNkc/////1Oc/6noc/9f///85/0O///r/kI2jf+pCf/Of/6HP/znOc7znPkIQgfFzvIRjhwOChCEIQOB8Ph853yHOc/zvEA4AAAAABF/UgSPmQKhhYBw4f/4yLECxVpXpgBmYgAKgCEXoz6Bj24G4gxlPDKhgAUoFxwtiGufjWFsGbKgF+Fh4noT/8i5uaFcZgLm1i2k0Mbam8ZAiwbYX0nExHIEEx2FBBP9J3S5vA6wAAltAA+pUwHS9e7B4EtiwD/4yDEERexdr1fz2ABlQrFTFPgXqqjQRzMFqGEeDUkEbrrMjtB+lU/tcuj+umyBDN1q/2GlFesgKLdHTqWo7RktruiRwdRlfa8J/BPRN+XHtgb0Y/AzC/2cZdiQgBuTa69W4S8bMAAXP/jIsQNF0k6wVZ5xSYzp4BvjV+T2Udd8R2+On01SiRpX5PGv6QjYpD1nBt8VZ0skMc9QHq1CpqJlnhoqVPKPHZYGqnIypEyWPAo8SPz0OhX//QJmyvHu/o8qM/6CtXSAhKu34FZMGcPy//jIMQLFcmeyX5pRy5R0BZEoNVh/FruKTVBRcR5rUTQpGyFqJx7CzcOcPjqoGcWJjOrcdzfsGXZAsFs2WdUKwcLiEIhWFB7w0GpuTa0XaMGgcqzrQsz/+kNKkIAFLvgP/OonDe+4DCL/+MixA4XgpK9XsKG9sYelKU8J/UGwRrm0l9/tjMjWMAOthrqK45iONNBfxi+hbllz+raE/If6Y91Y8jnb49Kxn0WeTT6ihhKnGOj8LGIiWQHuOogUc/66H/hHf+ZgAISpdgBncq6Fj3n/+MgxAwWYfa9fnqHEiCLPLVweu/9CIz6wGZbXVpry1Kg57ZhtwxXKh82K2giB2guGug/OyF9W1JuQftstdzJ1LPcEKLR5hTreUz/iBxskEVBY+CqAyCgQoz+yuNqlTn/4AmceACjmEH/4yLEDROBjtGfTFACEdnXxxr0lwp2+ghopgB4IjWCiAiL1Fns+pLqPWoKx2ncfG0InzW1JerftHxMpxQ801HHziUMvQeK6+SzxEliW+qFqaEByyhgQELpGQIgqtQ3JzIWch4kp17kEgX/4yDEGxrBdpwBmcgA2HbmH2R4LIKeMtsKwjCc/PT00y9l+qMGDIckAycFqvMfuJz7iPxLEzFQo5sngfD9d/3Lh+njFJYublz8Q5Rf////T2+4Yc+Lz9NurVqf9g+AKTd3AE4qU1E2vP/jIsQLFHFG1N/MMAKBuH8oS/ikp9KqlSqkwegTJgTLjeYlyndKcQSsCSPJJQRk9HC1Mj+l42THqWrK1khp0NFfwKks86SKw6IipGbLX60JBY92Jgpy/gAfjbqATePy62LBPlndI3QLQ//jIMQVEzHK0D5ITaKR7RryvYmOsx1fbM6V2JJnbpavk1iJiS8JPqV6qgWaY6uxhvzoBzN51ktGpofVlW2syZxMO0b3qgp3fgAeIb4DIseOluSeSAlQn7hrzAjZSZuJ1hX4vsT7jPQ//+MixCMTSZ7MPlmQ9/X6VzdY3edjF975aHZclh+kp0dpLevY334aVbI8HpNcncwNu/n4iv+WjdUp78AD9ctNSZuODC31N8HTqGeWmtBbEAMsHqNC8I2hSomoRqXy9S0ceUx3G2Xy1HlX/+MgxDETia7EHnnS35XKZuzIM1elCplWUbSZUyasFtQGBXZtvjOkd7fyKgXdgAP2BBZD9S9RP5NG79jO2pTIwZr7J8G1gzEtzOp2ieBOgOaBuVOqMyrSjT9MjQyjbxO0deP52eZM5EX/4yLEPRPR9rgeeccSHPRatU3MJQt+RHNLSiTFR+5aqgXbiAQBNtgMw1oA6FmGT6BBFIiJwdNzPHg4GwWjwaEZMdZCYHjSgwh4y0x3apZUmcmPvrb6vn+zvD/t5itoX1ejvi2HXytG9Pf/4yDESRRRirQZT1gDn6MGwmcJJfWqPBUiBf4SQhy0VHhgDRhoxv1ZsAhtWpzFYcHZOFihgb4zFC60dOmrlmXJiSomyBZ2YpiZigYKoIYAIGkiMAiwM8MMgCyIACjNhTPqzAnwKNMoKP/jIsRSJSlqhAma0AChCECX2WopEOPhhoiCKtdUFCCgKJA0W01lY2TxupC5HD8td2jhciVYlirC37fwM/kcmq9jHKMSipK977GKSz039KNFCnN8BxNkyKQ7PaifSU06ZWbLXIRrxeNesv/jIMQZFAk6zD/MMAKWQS5DeCUx/Y3lI4WvyH8L5+c/sB9iWul3X4R9zz7SwOgUyMBtTkhABBIUn1CLs///////9YC1KgVL/IbU4pxAdm9RCY22Fl3QDjRdhcbGgh/GwR2i7lo1CmY0/+MixCMT0ZasGMPKX2VNy3/JfvZB7an/a3fEB8Ky4hh6gJUlR8Y0bs8ZsysdHzOS5lQSpSjDL8SjagVdQAPkgaNhAzDy0U7Ny7ewjcdcD9uihn7LI+uRtxwzNFzBvzo+Dh1KUoG4nLxM/+MgxC8TQaK0HnnHLvdpTPyNVqWq8ps87Xc4tp+84odaBg0EhAGhAEm9SAVb+0XZfMCMzNKdBLCfWT9Cl5ZjyQd6VlAraiTVvTti91RulyZBkwXuoV3YXmOkKVn5U0rzPNMp1ltR6t7/4yLEPRQ5lqwYw1ETceczuhocBflPuWRyT5NPfTibxXsKc3HAHohRMAuHFwWYsiboQoSDQaBHij2BTtI1iU2jto6ycFqsuHDPAswsJlcSaDHBypOCRwT6zM81yPX/lTY4KIGgWSGQ4+n/4yDESBLppsg+SYaW///sUgodAxFs3LEahGcMIGORNKMFqJMRseA8gjpVF3QapN5RoQOoQ0DWBwiRkkW4R+n8dpREBICTA00IFzMpEJUo25plEqklOrq6VWSDH6/u3crqCEL0P4bJIP/jIsRXE9ECWADD0lknZeEGlVUAgUCFiDzDzCj4WjRpT2WWWUGKhkz4qKC1QsK/ioqLN9ISFhURmfWKi3//////////QDIVFBIHgZFaTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqqqqqqqqv/jIMRjEaCVZAp5hlCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"},Object.assign(He.prototype,{elements:{start:new Ue("start",He.MEDIA.start),click:new Ue("click",He.MEDIA.click),actionOk:new Ue("actionOk",He.MEDIA.actionOk),actionError:new Ue("actionError",He.MEDIA.actionError),finishedOk:new Ue("finishedOk",He.MEDIA.finishedOk),finishedError:new Ue("finishedError",He.MEDIA.finishedError)},enabled:2,globalEnabled:!0});var We=He;class Ge{constructor(t){this.project=t,this.authors=[],this.organizations=[],this.revisions=[],this.languages=[],this.locales=[],this.description={},this.tags={}}setProperties(t){let e=null;const i=[];return t.children().each(((t,n)=>{switch(n.nodeName){case"title":this.title=n.textContent;break;case"description":e=_t(n);break;case"descriptions":s()(n).children().each(((t,e)=>i.push(Pt(e))));break;case"author":this.authors.push(Dt(Pt(n)));break;case"organization":this.organizations.push(Dt(Pt(n)));break;case"revision":const t=Dt(Pt(n));t.date&&(t.date=Ct(t.date)),this.revisions.push(t);break;case"language":this.languages.push(kt(n.textContent));break;case"eventSounds":this.eventSounds=new We,this.eventSounds.setProperties(s()(n));break;case"skin":this.skinFileName=s()(n).attr("file");break;case"descriptors":this.tags=Pt(n,!0),this.tags["#text"]&&(this.tags.other=this.tags["#text"].textContent,delete this.tags["#text"]);break;case"license":this.license=_t(n);break;case"cover":case"thumb":const r=_t(n);r.file&&(this[n.nodeName]=r.file)}})),this.buildLocales(),i.forEach((t=>{t.language&&t.text&&(this.description[t.language]=t.text)})),e&&this.languages.length>0&&!this.description[this.languages[0]]&&(this.description[this.languages[0]]=e),this}buildLocales(){return this.languages.length>0&&window.Intl&&window.Intl.getCanonicalLocales&&(this.locales=[],this.languages.forEach((t=>{const e=/\(([a-z,A-Z,-]+)\)/.exec(t);if(e&&e.length>1)try{const t=window.Intl.getCanonicalLocales(e[1]);t&&(this.locales=this.locales.concat(t))}catch(e){gt("error",`Invalid language: ${t}`)}}))),this}getAttributes(){return $t(this,["title","description","tags","languages","license","authors","organizations","revisions","cover","thumb","skinFileName","eventSounds"])}setAttributes(t){return Lt(this,t,["title","description","tags","languages","license","authors","organizations","revisions","cover","thumb","skinFileName","eventSounds"]),this.revisions&&this.revisions.forEach((t=>{t.date&&(t.date=new Date(t.date))})),this.buildLocales()}}Object.assign(Ge.prototype,{project:null,title:"Untitled",authors:null,organizations:null,revisions:null,description:null,languages:null,tags:null,cover:null,thumb:null,license:{type:"by-nc-sa",url:"https://creativecommons.org/licenses/by-nc-sa/4.0"},locales:null,skinFileName:null,eventSounds:new We});var Je=Ge;class Ke{constructor(t,e){switch(this.action=t,typeof e){case"string":this.sequence=e;break;case"number":this.actNum=e}}setProperties(t){return this.id=t.attr("id"),this.action=t.attr("action")||"JUMP",t.attr("tag")&&(this.sequence=Zt(t.attr("tag"))),t.attr("project")&&(this.projectPath=Zt(t.attr("project"))),this}getAttributes(){return $t(this,["id","action","actNum","sequence","projectPath"])}setAttributes(t){return["id","action","actNum","sequence","projectPath"].forEach((e=>{qt(t[e])||(this[e]=t[e])})),this}}Object.assign(Ke.prototype,{id:null,action:null,actNum:-1,sequence:null,projectPath:null});var Ze=Ke;class Ye extends Ze{constructor(t,e,i,s){super(t,e),this.threshold="number"==typeof i?i:-1,this.time="number"==typeof i?s:-1}setProperties(t){return super.setProperties(t),void 0!==t.attr("threshold")&&(this.threshold=t.attr("threshold")),void 0!==t.attr("time")&&(this.time=t.attr("time")),this}getAttributes(){return Object.assign(super.getAttributes(),$t(this,["threshold","time"]))}setAttributes(t){return super.setAttributes(t),["threshold","time"].forEach((e=>{qt(t[e])||(this[e]=t[e])})),this}}Object.assign(Ye.prototype,{threshold:-1,time:-1});var Qe=Ye;class Xe extends Ze{constructor(t,e){super(t,e)}setProperties(t){return super.setProperties(t),t.children("jump").each(((t,e)=>{const i=(new Qe).setProperties(s()(e));"upper"===i.id?this.upperJump=i:"lower"===i.id&&(this.lowerJump=i)})),this}getAttributes(){return Object.assign(super.getAttributes(),$t(this,["upperJump","lowerJump"]))}setAttributes(t){return super.setAttributes(t),["upperJump","lowerJump"].forEach((e=>{t[e]&&(this[e]=(new Qe).setAttributes(t[e]))})),this}resolveJump(t,e){let i=this;return t>=0&&e>=0&&(null!==this.upperJump&&t>this.upperJump.threshold&&(this.upperJump.time<=0||e<this.upperJump.time)?i=this.upperJump:null!==this.lowerJump&&(t<this.lowerJump.threshold||this.lowerJump.time>0&&e>this.lowerJump.time)&&(i=this.lowerJump)),i}}Object.assign(Xe.prototype,{upperJump:null,lowerJump:null});var ti=Xe;class ei{constructor(){}setProperties(t){return ce(t.get(0).attributes,((t,e)=>{switch(t){case"id":this.tag=Zt(e);break;case"name":this.activity=e;break;case"description":case"navButtons":this[t]=e;break;case"delay":this[t]=Number(e)}})),t.children("jump").each(((t,e)=>{const i=(new ti).setProperties(s()(e));"forward"===i.id?this.fwdJump=i:"back"===i.id&&(this.backJump=i)})),this}getAttributes(){return $t(this,["tag","description","activity","fwdJump","backJump","navButtons","delay"])}setAttributes(t){return["tag","description","activity","navButtons","delay"].forEach((e=>{qt(t[e])||(this[e]=t[e])})),["fwdJump","backJump"].forEach((e=>{t[e]&&(this[e]=(new ti).setAttributes(t[e]))})),this}}Object.assign(ei.prototype,{tag:null,description:null,activity:"",fwdJump:null,backJump:null,navButtons:"both",delay:0});var ii=ei;class si{constructor(t){this.project=t,this.elements=[]}setProperties(t){return t.children("item").each(((t,e)=>this.elements.push((new ii).setProperties(s()(e))))),this}getAttributes(){return this.elements.map((t=>t.getAttributes()))}setAttributes(t){return t.forEach((t=>this.elements.push((new ii).setAttributes(t)))),this}getElementIndex(t){return null===t?-1:this.elements.indexOf(t)}getElement(t,e){let i=null;return t>=0&&t<this.elements.length&&(i=this.elements[t],e&&(this.currentAct=t)),i}getElementByTag(t,e){let i=null,s=-1;return t&&(t=Zt(t),this.elements.some(((e,n)=>(e.tag===t&&(i=e,s=n),-1!==s))),-1!==s&&e&&(this.currentAct=s)),i}getCurrentAct(){return this.getElement(this.currentAct,!1)}hasNextAct(t){let e=!1;const i=this.getCurrentAct();if(i)if(null===i.fwdJump)e=!0;else switch(i.fwdJump.action){case"STOP":break;case"RETURN":e=t;break;default:e=!0}return e}hasPrevAct(t){let e=!1;const i=this.getCurrentAct();if(i)if(null===i.backJump)e=!0;else switch(i.backJump.action){case"STOP":break;case"RETURN":e=t;break;default:e=!0}return e}getNavButtonsFlag(){let t="none";const e=this.getCurrentAct();return e&&(t=e.navButtons),t}getJump(t,e){const i=this.getCurrentAct();let s=null;if(i){const n=t?i.backJump:i.fwdJump;if(null===n){let e=this.currentAct+(t?-1:1);(e>=this.elements.length||e<0)&&(e=0),s=new Ze("JUMP",e)}else{let t=-1,i=-1;if(null!==e){const s=e.getCurrentSequenceInfo();null!==s&&(t=Math.round(s.tScore),i=Math.round(s.tTime/1e3))}s=n.resolveJump(t,i)}}return s}getSequenceForElement(t){let e=null;if(t>=0&&t<this.elements.length)for(let i=t;null===e&&i>=0;i--)e=this.getElement(i,!1).tag;return e}getElementByActivityName(t){let e=null;if(null!==t)for(let i=0;null===e&&i<this.elements.length;i++){const s=this.getElement(i,!1);s.activity.toLowerCase()===t.toLowerCase()&&(e=s)}return e}checkCurrentActivity(t){let e=this.getCurrentAct();if(null===e||e.activity.toUpperCase()!==t.toUpperCase()){for(let e=0;e<this.elements.length;e++)if(this.getElement(e,!1).activity.toUpperCase()===t.toUpperCase())return this.currentAct=e,!1;return e=new ii,e.activity=t,e.fwdJump=new ti("STOP"),e.backJump=new ti("STOP"),this.elements.push(e),this.currentAct=this.elements.length-1,!1}return!0}}Object.assign(si.prototype,{elements:null,project:null,currentAct:-1});var ni=si,ri=i(390),ai=i.n(ri);class oi{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=window&&(window.AudioContext||window.webkitAudioContext);i&&(oi.prepareInstrument(e,new i),this.data=t,this.player=new(ai().Player)((t=>this.playEvent(t))),this.player&&this.player.loadArrayBuffer(t))}static prepareInstrument(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;!1===oi.loadingInstrument&&(oi.loadingInstrument=!0,oi.audioContext=e,ai().Soundfont.instrument(oi.audioContext,t.MIDISoundFontObject||oi.MIDISoundFontObject||`${t.MIDISoundFontBase||oi.MIDISoundFontBase}/${t.MIDISoundFontName||oi.MIDISoundFontName}${t.MIDISoundFontExtension||oi.MIDISoundFontExtension}`).then((t=>{gt("info","MIDI soundfont instrument loaded"),oi.instrument=t})).catch((t=>{gt("error",`Error loading soundfont base instrument: ${t}`)})))}pause(){this.player&&(this.player.pause(),this.startedNotes=[])}play(){this.player&&(this.startedNotes=[],this.player.play())}get paused(){return this.player&&!this.player.isPlaying()}get ended(){return this.player&&this.player.getSongTimeRemaining()<=0}get currentTime(){return this.player&&1e3*this.player.getSongTime()||0}set currentTime(t){this.player&&this.player.skipToSeconds(t/1e3)}playEvent(t){this.player&&oi.instrument&&(this.playTo>0&&this.currentTime>=this.playTo?this.pause():"Controller Change"===t.name&&7===t.number?this.mainVolume=t.value/127:"Note on"===t.name&&t.velocity>0?this.startedNotes[t.noteNumber]=oi.instrument.play(t.noteName,oi.audioContext.currentTime,{gain:this.mainVolume*t.velocity/100*2}):"Note off"===t.name&&t.noteNumber&&this.startedNotes[t.noteNumber]&&(this.startedNotes[t.noteNumber].stop(),delete this.startedNotes[t.noteNumber]))}}Object.assign(oi.prototype,{data:null,player:null,playTo:0,mainVolume:1,startedNotes:[]}),oi.audioContext=null,oi.instrument=null,oi.loadingInstrument=!1,oi.MIDISoundFontObject=null,oi.MIDISoundFontBase="https://clic.xtec.cat/dist/jclic.js/soundfonts/MusyngKite",oi.MIDISoundFontName="acoustic_grand_piano",oi.MIDISoundFontExtension="-mp3.js";var li=oi;class ci{constructor(t,e,i){t&&(this.basePath=t),e&&(this.file=Zt(e),this.name=Zt(e),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext&&this.checkAnimatedGif()),i&&(this.zip=i),this.timeout=Date.now()+fe.LOAD_TIMEOUT}static _audioPlayers=[];static getAudioPlayer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return ci._audioPlayers[t]||(ci._audioPlayers[t]=document.createElement("audio")),ci._audioPlayers[t]}static _currentAudioElements=[];static resetAudioElements(){ci._audioPlayers.fill(null),ci._currentAudioElements.fill(null)}setProperties(t){if(this.name=Zt(t.attr("name")),this.file=Zt(t.attr("file")),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext){const e=t.attr("animated");void 0===e?this.checkAnimatedGif():this.animated="true"===e}return"font"===this.type&&(this.fontName=this.name===this.file&&this.name.lastIndexOf(".")>0?this.name.substring(0,this.name.lastIndexOf(".")):this.name),this}getAttributes(){return $t(this,["name","file","animated"])}setAttributes(t){return["name","file","animated"].forEach((e=>{qt(t[e])||(this[e]=t[e])})),this.ext=this.file.toLowerCase().split(".").pop(),this.type=this.getFileType(this.ext),"gif"===this.ext&&"undefined"===this.animated&&this.checkAnimatedGif(),"font"===this.type&&(this.fontName=this.name===this.file&&this.name.lastIndexOf(".")>0?this.name.substring(0,this.name.lastIndexOf(".")):this.name),this}checkAnimatedGif(){const t=new XMLHttpRequest;t.addEventListener("load",(()=>{const e=new Uint8Array(t.response),i=e.length;if(71===e[0]&&73===e[1]&&70===e[2]&&56===e[3]){for(let t=0,s=i-3,n=0;t<s&&n<2;++t)if(0===e[t]&&33===e[t+1]&&249===e[t+2]){const s=t+4+e[t+3];if(s+1<i&&0===e[s]&&(44===e[s+1]||33===e[s+1])&&++n>1){this.animated=!0,gt("debug",`Animated GIF detected: ${this.file}`);break}}}else this.animated=!1})),this.getFullPathPromise().then((e=>{t.open("GET",e,!0),t.responseType="arraybuffer",t.send()}))}isEmpty(){return null===this.data}getFileType(t){let e=null;for(let i in fe.FILE_TYPES)if(fe.FILE_TYPES[i].indexOf(t)>=0){e=i;break}return e}build(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return fe.NODEJS&&(this.data=[],this.ready=!0),t&&(this._whenReady||(this._whenReady=[]),this._whenReady.push(t)),this.data?this.ready&&this._onReady():this.getFullPathPromise().then((t=>{switch(this.type){case"font":const r="ttf"===this.ext?"truetype":"otf"===this.ext?"embedded-opentype":this.ext;le(`@font-face{font-family:"${this.fontName}";src:url(${t}) format("${r}");}`,e),this.data=new me(this.name),this.ready=!0;break;case"image":this.data=new Image,this.data.addEventListener("load",(()=>{this._onReady.call(this)}),{once:!0}),this.data.src=t;break;case"video":this.data=document.createElement(this.type),this.data.addEventListener("canplay",(()=>{this._onReady.call(this)}),{once:!0}),this.data.src=t,this.data.load(),this.data.pause();break;case"audio":if(i){const e=ci._currentAudioElements[n];e&&e!==this&&(e.data=null,e.ready=!1),ci._currentAudioElements[n]=this;const i=ci.getAudioPlayer(n);i.src!==t?(gt("trace",`Loading static player #${n} with new audio: ${t}`),this.data=i,this.ready=!1,i.addEventListener("canplay",(()=>{this._onReady.call(this)}),{once:!0}),i.src=t,i.load(),i.pause()):gt("trace",`Reusing existing audio in player #${n}: ${t}`)}else this.ready=!0;break;case"anim":this.data=s()(`<object type"application/x-shockwave-flash" width="300" height="200" data="${t}"/>`).get(-1),this.ready=!0;break;case"xml":s().get(t,null,null,"xml").done((t=>{const e=t?t.children||t.childNodes:null;this.data=e&&e.length>0?Pt(e[0]):null,this._onReady()})).fail((t=>{gt("error",`Error loading ${this.name}: ${t}`),this._onReady()}));break;case"midi":const a=new XMLHttpRequest;a.onreadystatechange=()=>{4===a.readyState&&(200===a.status?this.data=new li(a.response,e&&e.options):gt("error",`Error loading ${this.name}: ${a.statusText}`),this._onReady())},a.open("GET",t,!0),a.responseType="arraybuffer",a.send();break;default:gt("trace",`Media currently not supported: ${this.name}`),this.ready=!0}this.ready&&this._onReady()})),this}checkReady(){if(this.data&&!this.ready)switch(this.type){case"image":this.ready=!0===this.data.complete;break;case"audio":case"video":case"anim":this.ready=this.data.readyState>=1;break;default:this.ready=!0}return this.ready}checkTimeout(){const t=Date.now()>this.timeout;return t&>("warn",`Timeout while loading: ${this.name}`),t}_onReady(){this.ready=!0,this._whenReady&&(this._whenReady.forEach((t=>t.call(this,this))),this._whenReady=null)}getFullPath(){return this._fullPath}getFullPathPromise(){return ee(this.basePath,this.file,this.zip).then((t=>(this._fullPath=fe.NODEJS?t:new URL(t,document.location.href).toString(),this._fullPath)))}}Object.assign(ci.prototype,{name:"",file:"",fontName:"",basePath:"",zip:null,data:null,ready:!1,_whenReady:null,ext:"",type:null,timeout:0,animated:!1,_fullPath:null});var hi=ci;class ui{constructor(t){this.project=t,this.elements={}}setProperties(t){return t.children("media").each(((t,e)=>{const i=new hi(this.project.basePath,null,this.project.zip);i.setProperties(s()(e)),this.elements[i.name]=i})),this}getAttributes(){return Object.keys(this.elements).map((t=>this.elements[t].getAttributes()))}setAttributes(t){return t.forEach((t=>{const e=new hi(this.project.basePath,null,this.project.zip);e.setAttributes(t),this.elements[e.name]=e})),this}getElement(t,e){t=Zt(t);let i=this.elements[t];return e&&!i&&(i=this.getElementByFileName(t,e)),i}getElementByFileName(t,e){let i=null;if(t){t=Zt(t);for(let e in this.elements)if(this.elements[e].file===t){i=this.elements[e];break}!i&&e&&(i=new hi(this.project.basePath,null,this.project.zip),i.name=t,i.file=t,i.ext=t.toLowerCase().split("#")[0].split(".").pop(),i.type=i.getFileType(i.ext),this.elements[i.name]=i)}return i}getElementsOfType(t){const e=[];return s().each(this.elements,((i,s)=>{s.type===t&&e.push("font"===t?s.fontName:i)})),e}buildAll(t,e,i){let n=0;return s().each(this.elements,((s,r)=>{t&&r.type!==t||(r.build(e,i,!1),n++)})),n}countWaitingElements(){let t=0,e=!0;return s().each(this.elements,((i,s)=>{!s.data||s.ready||s.checkReady()||s.checkTimeout()?t++:(gt("debug","... waiting for: %s",i),e=!1)})),e?-1:t}getSkinElement(t,e){return qe.getSkin(t,e)}}Object.assign(ui.prototype,{elements:null,project:null});var di=ui;const pi=fe.BoxBase;class fi{constructor(t){this.parent=t||null}setProperties(t){return ce(t.get(0).attributes,((t,e)=>{switch(t){case"shadow":case"transparent":this[t]=mt(e,!1);break;case"margin":this[t]=Number(e);break;case"borderStroke":this.borderStroke=new be(Number(e));break;case"markerStroke":this.markerStroke=new be(Number(e))}})),t.children().each(((t,e)=>{const i=s()(e);switch(e.nodeName){case"font":this.font=(new me).setProperties(i);break;case"gradient":this.bgGradient=(new ve).setProperties(i);break;case"color":this.textColor=Rt(i.attr("foreground"),this.textColor),this.backColor=Rt(i.attr("background"),this.backColor),this.shadowColor=Rt(i.attr("shadow"),this.shadowColor),this.inactiveColor=Rt(i.attr("inactive"),this.inactiveColor),this.alternativeColor=Rt(i.attr("alternative"),this.alternativeColor),this.borderColor=Rt(i.attr("border"),this.borderColor)}})),this}getAttributes(){return $t(this,["shadow","transparent","margin","borderStroke","markerStroke","font","bgGradient",`textColor|${fi.prototype.textColor}`,`backColor|${fi.prototype.backColor}`,`shadowColor|${fi.prototype.shadowColor}`,`inactiveColor|${fi.prototype.inactiveColor}`,`alternativeColor|${fi.prototype.alternativeColor}`,`borderColor|${fi.prototype.borderColor}`])}setAttributes(t){return Lt(this,t,["shadow","transparent","margin",{key:"borderStroke",fn:be},{key:"markerStroke",fn:be},{key:"font",fn:me},{key:"bgGradient",fn:ve},"textColor","backColor","shadowColor","inactiveColor","alternativeColor","borderColor"])}get(t){return this.hasOwnProperty(t)||null===this.parent?this[t]:this.parent.get(t)}set(t,e){return this[t]=e,this}getOwn(t){return this.hasOwnProperty(t)?this[t]:null!==this.parent?this.parent.getOwn(t):("object"==typeof this[t]?this[t]=Mt(fi.prototype[t]):this[t]=fi.prototype[t],this[t])}getCSS(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n=this.get("font");(t=n.toCss(t)).color=i?this.get("backColor"):s?this.get("alternativeColor"):this.get("textColor");const r=this.get("transparent");t["background-color"]=r?"transparent":e?this.get("inactiveColor"):i?this.get("textColor"):this.get("backColor");const a=this.get("bgGradient");if(a&&!r&&(t["background-image"]=a.getCss()),1===this.shadow){const e=Math.max(1,Math.round(n.size/10)),i=this.get("shadowColor");t["text-shadow"]=`${e}px ${e}px 3px ${i}`}return t}prepareText(t,e,i,s){const n=[],r=this.get("font"),a=r.getHeight();let o=0;const l=e.trim().split("\n");t.font=r.cssFont();for(let c=0;c<l.length;c++){let h=l[c].trim(),u=t.measureText(h).width;if(u>i){let n=0,a=0;for(let e=0;e<h.length;e++)if(Ft(h[e])){const s=t.measureText(h.substring(0,e).trim()).width;if(s>i)break;n=e,a=s}if(n>0)l.splice(c+1,0,h.substring(n+1).trim()),h=l[c]=h.substring(0,n).trim(),u=a;else if(r.size>pi.MIN_FONT_SIZE)return this.getOwn("font").zoom(-1),this.prepareText(t,e,i,s)}if(n.push({text:h,size:new we(u,a)}),o+=a,o>s&&r.size>pi.MIN_FONT_SIZE)return this.getOwn("font").zoom(-1),this.prepareText(t,e,i,s)}return n}}Object.assign(fi.prototype,{parent:null,default:pi,font:new me,dynFontSize:0,resetFontCounter:0,backColor:pi.BACK_COLOR,bgGradient:null,textColor:pi.TEXT_COLOR,shadowColor:pi.SHADOW_COLOR,borderColor:pi.BORDER_COLOR,inactiveColor:pi.INACTIVE_COLOR,alternativeColor:pi.ALTERNATIVE_COLOR,shadow:!1,transparent:!1,dontFill:!1,textMargin:pi.AC_MARGIN,borderStroke:new be(pi.BORDER_STROKE_WIDTH),markerStroke:new be(pi.MARKER_STROKE_WIDTH)}),fi.DEFAULT_BOX_BASE=new fi;var gi=fi;class mi{constructor(t,e){t&&(this.h=t),e&&(this.v=e)}getAttributes(){return $t(this,["h|center","v|center"])}setAttributes(t){return Lt(this,t,["h","v"])}}Object.assign(mi.prototype,{h:"center",v:"center"});class vi{constructor(t){void 0!==t&&(this.id=t),this.imgAlign=new mi,this.txtAlign=new mi}setProperties(t,e){return ce(t.get(0).attributes,((t,e)=>{switch(t){case"id":case"item":this[t]=Number(e);break;case"width":case"height":null===this.dimension&&(this.dimension=new we(0,0)),this.dimension[t]=Number(e);break;case"txtAlign":case"imgAlign":this[t]=this.readAlign(e);break;case"hAlign":this.txtAlign=this.readAlign(e+",center"),this.imgAlign=this.readAlign(e+",center");break;case"border":case"avoidOverlapping":this[t]=mt(e);break;case"image":this.image=Zt(e)}})),t.children().each(((t,e)=>{const i=s()(e);switch(e.nodeName){case"style":this.style=new gi(null).setProperties(i);break;case"media":this.mediaContent=(new Fe).setProperties(i);break;case"p":null===this.text?this.text="":this.text+="\n",this.text+=e.textContent}})),e&&this.realizeContent(e),this}getAttributes(){return $t(this,["id","item","dimension","border","avoidOverlapping","image","text","objectType","txtAlign","imgAlign","style","mediaContent"])}setAttributes(t,e){return"string"==typeof t?this.text=t:Lt(this,t,["id","item","border","avoidOverlapping","image","text","objectType",{key:"dimension",fn:we},{key:"txtAlign",fn:mi},{key:"imgAlign",fn:mi},{key:"style",fn:gi},{key:"mediaContent",fn:Fe}]),e&&this.realizeContent(e),this}readAlign(t){const e=new mi;if(t){const i=t.split(",");e.h=i[0].replace("middle","center"),e.v=i[1].replace("middle","center")}return e}isEmpty(){return null===this.text&&null===this.img}isEquivalent(t,e){if(t===this)return!0;let i=!1;return null!==t&&(i=this.isEmpty()&&t.isEmpty()?this.id===t.id:(null===this.text?null===t.text:e?this.text===t.text:this.text.toLocaleLowerCase()===t.text.toLocaleLowerCase())&&(null===this.mediaContent?null===t.mediaContent:this.mediaContent.isEquivalent(t.mediaContent))&&this.img===t.img&&(null===this.imgClip?null===t.imgClip:this.imgClip.equals(t.imgClip))),i}setTextContent(t){null!==t?(this.text=t,this.checkHtmlText()):(this.text=null,this.innerHtmlText=null)}checkHtmlText(){if(this.innerHtmlText=null,Kt(this.text,"<html>",!0)){const t=this.text.trim(),e=t.toLocaleLowerCase();if(-1===e.indexOf("<body")){const i=e.indexOf("</html>");i>=0&&(this.innerHtmlText=t.substring(6,i))}}}setImgContent(t,e,i){this.img=t,this.image=null,this.imgClip=e,i&&(this.animatedGifFile=i)}prepareMedia(t){!this.amp&&this.mediaContent&&"PLAY_VIDEO"===this.mediaContent.type&&(this.amp=t.getActiveMediaPlayer(this.mediaContent),this.amp.realize())}realizeContent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;null!==this.image&&this.image.length>0&&(this.mbe=t.getElement(this.image,!0),this.mbe&&this.mbe.build((()=>{this.img=this.mbe.data,this.animatedGifFile=this.mbe.animated?this.mbe.getFullPath():null}),e,!0)),null!==this.mediaContent&&(null!==this.image||null!==this.text&&0!==this.text.length||(this.img=this.mediaContent.getIcon(),this.animatedGifFile=null)),this.checkHtmlText(t)}getDescription(){const t=[];return this.text&&this.text.length&&t.push(this.text),this.image&&t.push(`${pt("image")} ${this.image}`),this.imgClip&&t.push(this.imgClip.toString()),this.mediaContent&&t.push(this.mediaContent.getDescription()),t.join(" ")}toString(){const t=[];return this.text&&this.text.length&&t.push(this.text),this.image&&t.push(`${pt("image")} ${this.image}`),this.imgClip&&t.push(`${pt("image fragment")} ${(this.id>=0?this.id:this.item)+1}`),t.join(" ")||pt("cell")}}Object.assign(vi.prototype,{style:null,dimension:null,border:null,text:null,image:null,imgClip:null,mediaContent:null,imgAlign:null,txtAlign:null,avoidOverlapping:!1,id:-1,item:-1,img:null,animatedGifFile:null,innerHtmlText:null,amp:null,mbe:null}),vi.EMPTY_CONTENT=new vi;var bi=vi;class yi{constructor(t,e){this.reset(t,e)}static registerClass(t,e){return yi.CLASSES[t]=e,e}static getShaper(t,e,i){const s=yi.CLASSES[(t||"").replace(/^edu\.xtec\.jclic\.shapers\./,"@")];return s||gt("error",`Unknown shaper: ${t}`),s?new s(e,i):null}reset(t,e){this.nCols=t,this.nRows=e,this.nCells=e*t,this.initiated=!1,this.shapeData=[];for(let t=0;t<this.nCells;t++)this.shapeData[t]=new Ae}setProperties(t){return ce(t.get(0).attributes,((t,e)=>{switch(t){case"class":this.className=e;break;case"cols":this.nCols=Number(e);break;case"rows":this.nRows=Number(e);break;case"baseWidthFactor":case"toothHeightFactor":case"scaleX":case"scaleY":this[t]=Number(e);break;case"randomLines":case"showEnclosure":this[t]=mt(e,!0)}})),t.children("enclosing:first").each(((t,e)=>{s()(e).children("shape:first").each(((t,e)=>{let i=yi.readShapeData(e,this.scaleX,this.scaleY);this.enclosing=i,this.showEnclosure=!0,this.hasRemainder=!0}))})),t.children("shape").each(((t,e)=>{this.shapeData[t]=yi.readShapeData(e,this.scaleX,this.scaleY)})),this.shapeData.length>0&&(this.nCells=this.shapeData.length),this}static readShapeData(t,e,i){const n=[];let r=null;return s().each(t.textContent.split("|"),((t,s)=>{const a=s.split(":");let o=a.length>1?a[1].split(","):null;switch(o&&(o=o.map(((t,s)=>t/(s%2?i:e)))),a[0]){case"rectangle":r=new xe(o[0],o[1],o[2],o[3]);break;case"ellipse":r=new Ce(o[0],o[1],o[2],o[3]);break;default:n.push(new Se(a[0],o))}})),!r&&n.length>0?new ke(n):r}getAttributes(){const t=["className","nCols","nRows","baseWidthFactor","toothHeightFactor","scaleX","scaleY","randomLines"];return this.customShapes&&["showEnclosure","hasRemainder","enclosing","shapeData"].forEach((e=>t.push(e))),$t(this,t)}static factory(t){const e=yi.getShaper(t.className,t.nCols,t.nRows);return Lt(e,t,["className","nCols","nRows","baseWidthFactor","toothHeightFactor","scaleX","scaleY","randomLines","showEnclosure","hasRemainder",{key:"enclosing",fn:Ae},{key:"shapeData",fn:Ae,group:"array"}]),e.nCells=e.shapeData.length||e.nCols*e.nRows,e}buildShapes(){}getShape(t,e){return this.initiated||this.buildShapes(),t>=this.nCells||null===this.shapeData[t]?null:this.shapeData[t].getShape(e)}getShapeData(t){return t>=0&&t<this.shapeData.length?this.shapeData[t]:null}getEnclosingShapeData(){return new xe(0,0,1,1)}getRemainderShape(t){if(!this.hasRemainder)return null;this.initiated||this.buildShapes();const e=this.getEnclosingShapeData(),i=e?e.getShape(t):new xe;for(let e=0;e<this.nCells;e++)this.shapeData[e]&&i.add(this.shapeData[e].getShape(t),!1);return i}}Object.assign(yi.prototype,{className:"Shaper",nCols:0,nRows:0,nCells:0,shapeData:null,initiated:!1,baseWidthFactor:1/3,toothHeightFactor:1/6,randomLines:!1,scaleX:1,scaleY:1,enclosing:null,showEnclosure:!1,rectangularShapes:!1,hasRemainder:!1,customShapes:!1}),yi.CLASSES={};var wi=yi;class Ai{constructor(t,e,i){t&&(this.id=t),this.cells=[],this.ncw=Math.max(1,e),this.nch=Math.max(1,i)}setProperties(t,e){let i=!1;if(ce(t.get(0).attributes,((t,e)=>{switch(t){case"id":this.id=e;break;case"image":this.image=Zt(e);break;case"rows":this.nch=Number(e);break;case"columns":i=!0;case"cols":this.ncw=Number(e);break;case"cellWidth":this.w=Number(e);break;case"cellHeight":this.h=Number(e);break;case"border":this.border=mt(e)}})),i){let t=this.ncw;this.ncw=this.nch,this.nch=t}t.children().each(((t,i)=>{const n=s()(i);switch(i.nodeName){case"style":this.style=new gi(null).setProperties(n);break;case"shaper":const t=n.attr("class"),s=Math.max(1,n.attr("cols")),r=Math.max(1,n.attr("rows"));this.shaper=wi.getShaper(t,s,r),this.shaper.setProperties(n);break;case"ids":this.ids=i.textContent,this.ids.split(" ").forEach(((t,e)=>{this.cells[e]=new bi(Number(t))}));break;case"cell":this.cells.push((new bi).setProperties(n,e))}}));let n=this.cells.length;if(0===n&&this.shaper&&this.shaper.nCells>0&&(this.initiallyEmptyCells=!0,n=this.shaper.nCells,this.getActiveBoxContent(n-1)),n>0){let t=!0;for(let e=0;e<n;e++){const i=this.getActiveBoxContent(e);if(-1!==i.id||-1!==i.item||!i.isEmpty()){t=!1;break}}if(t)for(let t=0;t<n;t++)this.getActiveBoxContent(t).id=t}return this.style&&this.cells.forEach((t=>{t.style&&(t.style.parent=this.style)})),this}getAttributes(){const t=["id","image","ncw","nch","w","h","border","style","shaper"];return this.initiallyEmptyCells||t.push(this.ids?"ids":"cells"),$t(this,t)}setAttributes(t,e){Lt(this,t,["id","image","ncw","nch","w","h","border",{key:"style",fn:gi},{key:"shaper",fn:wi},"ids",{key:"cells",fn:bi,group:"array",params:[e]}]);let i=this.cells.length;if(0===i&&this.shaper&&this.shaper.nCells>0&&(this.initiallyEmptyCells=!0,i=this.shaper.nCells,this.getActiveBoxContent(i-1),this.ids&&this.ids.split(" ").forEach(((t,e)=>{this.getActiveBoxContent(e).id=Number(t)}))),i>0){let t=!0;for(let e=0;e<i;e++){const i=this.getActiveBoxContent(e);if(-1!==i.id||-1!==i.item||!i.isEmpty()){t=!1;break}}if(t)for(let t=0;t<i;t++)this.getActiveBoxContent(t).id=t}return this.style&&this.cells.forEach((t=>{t.style&&(t.style.parent=this.style)})),e&&this.cells.forEach((t=>t.realizeContent(e))),this}prepareMedia(t){this.cells.forEach((e=>e.prepareMedia(t)))}getTotalWidth(){return this.w*this.ncw}getTotalHeight(){return this.h*this.nch}getNumCells(){return this.cells.length}isEmpty(){return 0===this.cells.length}getShaper(){return null===this.shaper&&(this.shaper=wi.getShaper("@Rectangular",this.ncw,this.nch)),this.shaper}getBoxBase(){return null===this.style&&(this.style=new gi),this.style}addActiveBoxContent(t){this.cells.push(t),0!==this.ncw&&0!==this.nch||(this.ncw=this.nch=1)}getActiveBoxContent(t){if(t>=this.cells.length)for(let e=this.cells.length;e<=t;e++)this.cells.push(new bi);return this.cells[t]}getActiveBoxContentWith(t,e){return this.cells.find((i=>i.id===t&&i.item===e))}setImgContent(t,e,i){e&&this.setShaper(e),"@Holes"===this.shaper.className&&(this.shaper.hasRemainder=!0),this.ncw=this.shaper.nCols,this.nch=this.shaper.nRows;const s=t.elements[this.image];t&&this.image&&s&&s.ready?(this.img=s.data,s.animated&&(this.animatedGifFile=s.getFullPath()),this.w=this.img.width/this.ncw,this.h=this.img.height/this.nch,i&&(this.w=Math.round(this.w),this.h=Math.round(this.h))):(this.img=null,this.w=Math.max(this.w,10),this.h=Math.max(this.h,10));const n=new xe(0,0,this.w*this.ncw,this.h*this.nch);for(let t=0;t<this.shaper.nCells;t++)this.getActiveBoxContent(t).setImgContent(this.img,this.shaper.getShape(t,n),this.animatedGifFile);this.shaper.hasRemainder&&(this.backgroundContent=new bi,this.backgroundContent.setImgContent(this.img,this.shaper.getRemainderShape(n)))}setTextContent(t,e,i){this.ncw=Math.max(1,e),this.nch=Math.max(1,i);const s=this.ncw*this.nch;for(let e=0;e<s;e++)this.getActiveBoxContent(e).setTextContent(e>=t.length||null===t[e]?"":t[e])}setIds(t){for(let e=0;e<t.length&&e<this.cells.length;e++)this.getActiveBoxContent(e).id=t[e]}setCellsAttribute(t,e){this.cells.forEach((i=>i[t]=e))}avoidAllIdsNull(t){this.cells.every((t=>-1===t.id))&&(t=Math.max(1,t),this.cells.forEach(((e,i)=>{e.id=i%t})))}}Object.assign(Ai.prototype,{id:"primary",image:null,img:null,animatedGifFile:null,ncw:1,nch:1,w:fe.DEFAULT_GRID_ELEMENT_SIZE,h:fe.DEFAULT_GRID_ELEMENT_SIZE,border:!0,style:null,shaper:null,backgroundContent:null,cells:null,defaultIdValue:-1,ids:null});var xi=Ai;class Ci{constructor(){}static getProvider(t){let e=null;if(t){const i=(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),s=Ci.CLASSES[i];s?(e=new s,e.setProperties(t)):gt("error",`Unknown AutoContentProvider class: ${i}`)}return e}setProperties(t){return this.className=(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.automation\./,"@"),this}getAttributes(){return $t(this,["className"])}static factory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(new(0,Ci.CLASSES[t.className])).setAttributes(t,...e)}init(){}generateContent(t,e,i,s){return this.process(new Ci.ActiveBagContentKit(t,e,i,s))}process(t){return!1}static registerClass(t,e){return Ci.CLASSES[t]=e,e}}Object.assign(Ci.prototype,{numericContent:!1}),Ci.ActiveBagContentKit=class{constructor(t,e,i,s){this.nRows=t,this.nCols=e,this.content=i,this.useIds=s}},Ci.CLASSES={"@tagreplace.TagReplace":Ci},Ci.registerClass("@tagreplace.TagReplace",Ci);var ki=Ci;class Si{constructor(){this.style=new gi(null),this.text=[]}setProperties(t){ce(t.get(0).attributes,((t,e)=>{switch(t){case"rows":this.ncw=Number(e);break;case"columns":this.nch=Number(e);break;case"cellWidth":this.w=Number(e);break;case"cellHeight":this.h=Number(e);break;case"border":this.border=mt(e);break;case"wild":case"randomChars":this[t]=e}})),t.children("style:first").each(((t,e)=>{this.style=(new gi).setProperties(s()(e))})),t.find("text:first > row").each(((t,e)=>this.text.push(e.textContent)));for(let t=this.text.length;t<this.nch;t++)this.text[t]="";return this}getAttributes(){return $t(this,["ncw","nch","w","h","text","style","border","wild|*",`randomChars|${fe.RANDOM_CHARS}`])}setAttributes(t){return Lt(this,t,["ncw","nch","w","h","text",{key:"style",fn:gi},"border","wild","randomChars"])}countWildChars(){let t=0;if(this.text)for(let e=0;e<this.nch;e++)for(let i=0;i<this.ncw;i++)this.text[e].charAt(i)===this.wild&&t++;return t}getNumChars(){return this.ncw*this.nch}setCharAt(t,e,i){t>=0&&t<this.ncw&&e>=0&&e<this.nch&&(this.text[e]=this.text[e].substring(0,t)+i+this.text[e].substring(t+1))}}Object.assign(Si.prototype,{ncw:1,nch:1,w:20,h:20,border:!1,style:null,text:null,wild:"*",randomChars:fe.RANDOM_CHARS});var Ei=Si;class Ti{constructor(t){this.className=t,this.collator=window.Intl&&window.Intl.Collator?new window.Intl.Collator:{compare:(t,e)=>this.checkCase?t===e:t.toUpperCase()===e.toUpperCase()}}static getEvaluator(t){let e=null;if(t){const i=t.attr("class"),s=Ti.CLASSES[i];s?(e=new s(i),e.setProperties(t)):gt("error",`Unknown evaluator class: "${i}"`)}return e}setProperties(t){return ce(t.get(0).attributes,((t,e)=>{switch(t){case"class":this.className=e;break;case"checkCase":case"checkAccents":case"checkPunctuation":case"checkDoubleSpaces":case"detail":this[t]=mt(e);break;case"checkSteps":case"checkScope":this[t]=Number(e)}})),this}static factory(t){const e=Ti.CLASSES[t.className];if(e){return Lt(new e(t.className),t,["className","checkCase","checkAccents","checkPunctuation","checkDoubleSpaces","detail","checkSteps","checkScope"])}return null}getAttributes(){return $t(this,["className","checkCase","checkAccents","checkPunctuation","checkDoubleSpaces","detail","checkSteps","checkScope"])}init(t){this.initiated=!0}checkText(t,e){return e instanceof Array?e.some((e=>this._checkText(t,e))):!!e&&this._checkText(t,e)}_checkText(t,e){return!1}evalText(t,e){return e instanceof Array||(e=[e]),this._evalText(t,e)}_evalText(t,e){return[]}isOk(t){return t&&t.length>0&&!t.some((t=>0!==t))}}Object.assign(Ti.prototype,{className:null,initiated:!1,collator:null,checkCase:!1});class Bi extends Ti{constructor(t){super(t)}init(t){super.init([t]),window.Intl&&window.Intl.Collator&&(this.collator=new window.Intl.Collator(t,{sensitivity:this.checkAccents?this.checkCase?"case":"accent":"base",ignorePunctuation:!this.checkPunctuation}))}_checkText(t,e){return 0===this.collator.compare(this.getClearedText(t),this.getClearedText(e))}_evalText(t,e){return Array(t.length).fill(this._checkText(t,e[0])?0:1)}getClearedText(t,e){if(this.checkPunctuation&&this.checkDoubleSpaces)return t;e||(e=Array(t.length).fill(!1));let i="";for(let s=0,n=!1;s<t.length;s++){const r=t.charAt(s);this.PUNCTUATION.indexOf(r)>=0&&!this.checkPunctuation?(n?e[s]=!0:i+=" ",n=!0):" "===r?(this.checkDoubleSpaces||!n?i+=r:e[s]=!0,n=!0):(n=!1,i+=r)}return i}}Object.assign(Bi.prototype,{checkAccents:!0,checkPunctuation:!0,checkDoubleSpaces:!1,PUNCTUATION:".,;:"});class Ii extends Bi{constructor(t){super(t)}_evalText(t,e){if(!this.detail)return super._evalText(t,e);const i=Array(t.length).fill(!1),s=this.getClearedText(t,i),n=Array(e.length),r=Array(e.length),a=Array(t.length);let o=-1,l=-1;for(let i=0;i<e.length;i++){r[i]=Array(t.length).fill(0);const a=this.compareSegment(s,s.length,e[i],e[i].length,r[i],!1);n[i]=this.countFlagsOk(r[i]),a&&(l=i,o=n[i])}if(-1===l)for(let t=0;t<e.length;t++)n[t]>o&&(o=n[t],l=t);for(let e=0,s=0;e<t.length;e++)a[e]=i[e]?0:r[l][s++];return a}countFlagsOk(t){return t.reduce(((t,e)=>0==e?++t:t),0)}compareSegment(t,e,i,s,n,r){let a=0,o=0,l=0,c=!0,h=!0,u="",d="";if(0===e||0===s||null===t||null===i)return!1;for(;a<e;a++,o++)if(u=t.charAt(a),l=a,d=o>=0&&o<s?i.charAt(o):0,0===this.collator.compare(u,d))n[a]=0,c=!0;else if(h=!1,n[a]=1,!r&&c&&0!==d&&this.checkSteps>0&&this.checkScope>0){const n=2*this.checkSteps+1,r=[];let l=0,h=0;for(;h<n;h++){if(r[h]=0,l=o+Math.floor((h+1)/2)*(0!=(1&h)?1:-1),l>=s)continue;const n=l<0?a-l:a;if(n>=e)continue;const c=Math.min(e-n,this.checkScope),u=l<0?0:l,d=Math.min(s-u,this.checkScope),p=Array(t.length-n).fill(0),f=this.compareSegment(t.substring(n),c,i.substring(u),d,p,!0);if(r[h]=this.countFlagsOk(p),f)break}if(h===n){let t=this.checkSteps;for(h=0;h<n;h++)r[h]>r[t]&&(t=h);l=o+Math.floor((t+1)/2)*(0!=(1&t)?1:-1)}o=l,c=!1}return o!==s&&(h=!1,n[l]=1),h}}Object.assign(Ii.prototype,{detail:!0,checkSteps:3,checkScope:6}),Ti.CLASSES={"@BasicEvaluator":Bi,"@ComplexEvaluator":Ii};var Pi=Ti;class _i{constructor(){this.style={default:{..._i.DEFAULT_DOC_STYLE}},this.p=[]}setProperties(t,e){return t.children("style").toArray().sort(((t,e)=>{var i=t.getAttribute("name"),s=t.getAttribute("base")||null,n=e.getAttribute("name"),r=e.getAttribute("base")||null;return"default"===i?-1:"default"===n||s===n?1:r===i?-1:s?r?0:1:-1})).forEach((t=>{const e=this.readDocAttributes(s()(t));this.style[e.name]="default"===e.name?s().extend(!0,this.style.default,e):e})),t.find("section > p").each(((t,i)=>{const n={elements:[]};ce(i.attributes,((t,e)=>{switch(t){case"style":n[t]=e;break;case"bidiLevel":case"Alignment":n[t]=Number(e)}})),s()(i).children().each(((t,i)=>{let r;const a=s()(i);switch(i.nodeName){case"cell":r=(new bi).setProperties(a,e);break;case"text":r={text:i.textContent.replace(/\t/g,"	")};const t=this.readDocAttributes(a);s().isEmptyObject(t)||(r.attr=t);break;case"target":r=new Di(this,i.textContent.replace(/\t/g,"	")),r.setProperties(a,e),this.numTargets++;break;default:gt("error",`Unknown object in activity document: "${i.nodeName}"`)}r&&(r.objectType=i.nodeName,n.elements.push(r))})),this.p.push(n)})),this}readDocAttributes(t){let e={},i={};return ce(t.get(0).attributes,((t,n)=>{switch(t){case"background":n=Rt(n,"white"),e[t]=n,i["background-color"]=n;break;case"foreground":n=Rt(n,"black"),e[t]=n,i.color=n;break;case"family":i["font-family"]=n;case"name":case"style":e[t]=n;break;case"base":e[t]=n,this.style[n]&&(e=s().extend(!0,{},this.style[n],e),this.style[n].css&&(i=s().extend({},this.style[n].css,i)));break;case"bold":n=mt(n),e[t]=n,i["font-weight"]=n?"bold":"normal";break;case"italic":n=mt(n),e[t]=n,i["font-style"]=n?"italic":"normal";break;case"target":e[t]=mt(n);break;case"size":e[t]=Number(n),i["font-size"]=`${n}px`;break;case"tabWidth":this.tabSpc=n,i["tab-size"]=this.tabSpc,i["white-space"]="pre-wrap";break;default:gt("warn",`Unknown text attribute: "${t}" = "${n}"`),e[t]=n}})),s().isEmptyObject(i)||(e.css=i),e}getAttributes(){return $t(this,["style","tabSpc","targetType","p"])}setAttributes(t,e){return Lt(this,t,["style","tabSpc","targetType","p"]),this.p.forEach((t=>{t.elements?t.elements=t.elements.map((t=>"cell"===t.objectType?(new bi).setAttributes(t,e):"target"===t.objectType?new Di(this).setAttributes(t,e):t)):t.elements=[]})),this}getRawText(){const t=s()("<div/>");return this.p.forEach((e=>{const i=s()("<p/>");let n=!0;e.elements.forEach((t=>{switch(t.objectType){case"text":case"target":i.append(t.text)}n=!1})),n&&i.html(" "),t.append(i)})),t.text().trim()}getFullStyle(t){const e=s().extend(!0,{},this.style.default);return s().extend(!0,e,this.style[t]?this.style[t]:{})}}_i.DEFAULT_DOC_STYLE={background:"0xFFFFFF",foreground:"0x000000",family:"Arial",bold:!1,italic:!1,size:17,css:{"background-color":"#FFFFFF",color:"#000000","font-family":"Arial","font-weight":"normal","font-style":"normal","font-size":"17px"}},Object.assign(_i.prototype,{tabSpc:12,lastBoxId:0,tmb:null,numTargets:0,targetType:"TT_FREE",style:null,p:null});class Di{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.doc=t,this.text=e,this.numIniChars=e.length,this.answers=[e],this.maxLenResp=this.numIniChars}reset(t){this.targetStatus=t||"NOT_EDITED",this.flagModified=!1}setProperties(t,e){let i=!0;t.children().each(((t,n)=>{const r=s()(n);switch(n.nodeName){case"answer":i&&(i=!1,this.answers=[]),null===this.answers&&(this.answers=[]),this.answers.push(n.textContent);break;case"optionList":r.children("option").each(((t,e)=>{this.isList=!0,null===this.options&&(this.options=[]),this.options.push(e.textContent)}));break;case"response":this.iniChar=vt(r.attr("fill"),this.iniChar).charAt(0),fe.WHITESPACES.indexOf(this.iniChar)>=0&&(this.iniChar="_"),this.numIniChars=bt(r.attr("length"),this.numIniChars),this.maxLenResp=bt(r.attr("maxLength"),this.maxLenResp),this.iniText=vt(r.attr("show"),this.iniText);break;case"info":this.infoMode=vt(r.attr("mode"),"always"),this.popupDelay=bt(r.attr("delay"),this.popupDelay),this.popupMaxTime=bt(r.attr("maxTime"),this.popupMaxTime),r.children("media").each(((t,e)=>{this.onlyPlay=!0,this.popupContent=new bi,this.popupContent.mediaContent=(new Fe).setProperties(s()(e))})),this.popupContent||r.children("cell").each(((t,i)=>{this.popupContent=(new bi).setProperties(s()(i),e)}));break;case"text":this.text=n.textContent.replace(/\t/g,"	");const t=this.doc.readDocAttributes(s()(n));s().isEmptyObject(t)||(this.attr=t)}}))}getAttributes(){return $t(this,["objectType","text","attr","isList","answers","options","iniChar","numIniChars","maxLenResp","iniText","infoMode","popupDelay","popupKey","popupMaxTime","onlyPlay","popupContent"])}setAttributes(t,e){return Lt(this,t,["objectType","text","attr","isList","answers","options","iniChar","numIniChars","maxLenResp","iniText","infoMode","popupDelay","popupKey","popupMaxTime","onlyPlay",{key:"popupContent",fn:bi,params:[e]}])}getAnswers(){return this.answers?this.answers.join("|"):""}checkColors(){const t=this.$comboList||this.$span;if(t){const e=this.doc.style["WITH_ERROR"===this.targetStatus?"targetError":"HIDDEN"===this.targetStatus?"default":"target"];e&&e.css&&t.css(e.css)}}readCurrentText(){return this.$span?this.currentText=this.$span.text():this.$comboList&&(this.currentText=this.$comboList.val()),this.currentText}}Object.assign(Di.prototype,{doc:null,text:null,attr:null,isList:!1,numIniChars:1,iniChar:"_",maxLenResp:0,answers:null,options:null,iniText:null,infoMode:"no_info",popupKey:"F1",popupContent:null,popupDelay:0,popupMaxTime:0,onlyPlay:!1,$comboList:null,$span:null,$p:null,$popup:null,currentText:"",num:0,pos:0,targetStatus:"NOT_EDITED",flagModified:!1,parentPane:null}),_i.TextTarget=Di;var Ri=_i;const Oi="touchstart";class Mi{constructor(t){this.project=t,this.eventSounds=new We(this.project.settings.eventSounds),this.messages={},this.abc={}}static registerClass(t,e){return Mi.CLASSES[t]=e,e}static getActivity(t,e){let i=null;const s=t.jquery&&!0;if(t&&e){const n=s?(t.attr("class")||"").replace(/^edu\.xtec\.jclic\.activities\./,"@"):t.className,r=Mi.CLASSES[n];r?(i=new r(e),s?i.setProperties(t):i.setAttributes(t)):gt("error",`Unknown activity class: ${n}`)}return i}setProperties(t){return ce(t.get(0).attributes,((t,e)=>{switch(t){case"name":e=Zt(e);case"code":case"type":case"description":this[t]=e;break;case"class":this.className=e.replace(/^edu\.xtec\.jclic\.activities\./,"@");break;case"inverse":this.invAss=mt(e,!1);break;case"autoJump":case"forceOkToAdvance":case"amongParagraphs":this[t]=mt(e,!1)}})),t.children().each(((t,e)=>{const i=s()(e);switch(e.nodeName){case"settings":ce(i.get(0).attributes,((t,e)=>{switch(t){case"infoUrl":case"infoCmd":this[t]=e;break;case"margin":case"maxTime":case"maxActions":this[t]=Number(e);break;case"report":this.includeInReports=mt(e,!1);break;case"countDownTime":case"countDownActions":case"reportActions":case"useOrder":case"dragCells":this[t]=mt(e,!1)}})),i.children().each(((t,e)=>{const i=s()(e);switch(e.nodeName){case"skin":this.skinFileName=i.attr("file");break;case"helpWindow":this.helpMsg=It(this),this.showSolution=mt(i.attr("showSolution"),!1),this.helpWindow=null!==this.helpMsg||this.showSolution;break;case"container":this.bgColor=Rt(i.attr("bgColor"),fe.BoxBase.BACK_COLOR),i.children().each(((t,e)=>{const i=s()(e);switch(e.nodeName){case"image":this.bgImageFile=i.attr("name"),this.tiledBgImg=mt(i.attr("tiled"),!1);break;case"counters":this.bTimeCounter=mt(i.attr("time"),!0),this.bActionsCounter=mt(i.attr("actions"),!0),this.bScoreCounter=mt(i.attr("score"),!0);break;case"gradient":this.bgGradient=(new ve).setProperties(i)}}));break;case"window":this.activityBgColor=Rt(i.attr("bgColor"),fe.DEFAULT_BG_COLOR),this.transparentBg=mt(i.attr("transparent"),!1),this.border=mt(i.attr("border"),!1),i.children().each(((t,e)=>{const i=s()(e);switch(e.nodeName){case"gradient":this.activityBgGradient=(new ve).setProperties(i);break;case"position":this.absolutePosition=(new ye).setProperties(i),this.absolutePositioned=!0;break;case"size":this.windowSize=(new we).setProperties(i)}}));break;case"eventSounds":this.eventSounds.setProperties(i)}}));break;case"messages":i.children("cell").each(((t,e)=>{const i=this.readMessage(s()(e));this.messages[i.type]=i}));break;case"automation":this.acp=ki.getProvider(i,this.project),this.acp&&(this.numericContent=this.acp.numericContent);break;case"cells":const t=(new xi).setProperties(i,this.project.mediaBag);this.abc[t.id]=t;break;case"scramble":this.shuffles=Number(i.attr("times")),this.shuffleA=mt(i.attr("primary")),this.shuffleB=mt(i.attr("secondary"));break;case"layout":ce(i.get(0).attributes,((t,e)=>{switch(t){case"position":this.boxGridPos=e;break;case"wildTransparent":case"upperCase":case"checkCase":this[t]=mt(e)}}));break;case"menuElement":this.menuElements.push({caption:i.attr("caption")||"",icon:i.attr("icon")||null,projectPath:i.attr("path")||null,sequence:i.attr("sequence")||null,description:i.attr("description")||""});break;case"textGrid":this.tgc=(new Ei).setProperties(i);break;case"clues":this.clues=[],this.clueItems=[],i.children("clue").each(((t,e)=>{this.clueItems[t]=Number(s()(e).attr("id")),this.clues[t]=e.textContent}));break;case"checkButton":this.checkButtonText=e.textContent||"check";break;case"prevScreen":this.prevScreen=!0,this.prevScreenMaxTime=i.attr("maxTime")||-1,i.children().each(((t,e)=>{switch(e.nodeName){case"style":this.prevScreenStyle=(new gi).setProperties(s()(e));break;case"p":null===this.prevScreenText&&(this.prevScreenText=""),this.prevScreenText+=`<p>${e.textContent}</p>`}}));break;case"evaluator":this.ev=Pi.getEvaluator(i);break;case"document":this.document=(new Ri).setProperties(i,this.project.mediaBag)}})),this}readMessage(t){const e=(new bi).setProperties(t,this.project.mediaBag);return e.type=t.attr("type"),Tt(e.style)&&(e.style=new gi(null)),e}getAttributes(){return $t(this,["name","className","code","type","description","invAss","numericContent","autoJump","forceOkToAdvance","amongParagraphs","infoUrl","infoCmd",`margin|${fe.DEFAULT_MARGIN}`,"maxTime","maxActions","includeInReports|true","reportActions|false","countDownTime","countDownActions","useOrder","dragCells","skinFileName","showSolution|false","helpMsg",`bgColor|${fe.DEFAULT_BG_COLOR}`,"bgImageFile","tiledBgImg","bTimeCounter|true","bActionsCounter|true","bScoreCounter|true",`activityBgColor|${fe.DEFAULT_BG_COLOR}`,"transparentBg|false","border|true","shuffleA","shuffleB","shuffles","boxGridPos","wildTransparent","upperCase","checkCase","checkButtonText","prevScreen","prevScreenMaxTime","prevScreenText","bgGradient","activityBgGradient","absolutePosition","windowSize","eventSounds","messages","acp","abc","menuElements","tgc","clues","clueItems","prevScreenStyle","ev","document"])}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.project.mediaBag;return Lt(this,t,["name","className","code","type","description","invAss","numericContent","autoJump","forceOkToAdvance","amongParagraphs","infoUrl","infoCmd","margin","maxTime","maxActions","includeInReports","reportActions","countDownTime","countDownActions","useOrder","dragCells","skinFileName","showSolution","helpMsg","bgColor","bgImageFile","tiledBgImg","bTimeCounter","bActionsCounter","bScoreCounter","activityBgColor","transparentBg","border","shuffleA","shuffleB","shuffles","boxGridPos","wildTransparent","upperCase","checkCase","checkButtonText","prevScreen","prevScreenMaxTime","prevScreenText",{key:"bgGradient",fn:ve},{key:"activityBgGradient",fn:ve},{key:"absolutePosition",fn:ye},{key:"windowSize",fn:we},{key:"messages",fn:bi,group:"object",init:"key",params:[e]},{key:"abc",fn:xi,group:"object",init:"key",params:[e]},{key:"acp",fn:ki,params:[e]},"menuElements",{key:"tgc",fn:Ei},"clues","clueItems",{key:"prevScreenStyle",fn:gi},{key:"ev",fn:Pi},{key:"document",fn:Ri,params:[e]}]),t.eventSounds&&this.eventSounds.setAttributes(t.eventSounds),this.absolutePosition&&(this.absolutePositioned=!0),this}initAutoContentProvider(){null!==this.acp&&this.acp.init()}prepareMedia(t){return this.eventSounds.realize(t,this.project.mediaBag),s().each(this.messages,((e,i)=>{null!==i&&i.prepareMedia(t)})),s().each(this.abc,((e,i)=>{null!==i&&i.prepareMedia(t)})),!0}helpSolutionAllowed(){return!1}helpWindowAllowed(){return this.helpWindow&&(this.helpSolutionAllowed()&&this.showSolution||null!==this.helpMsg)}getMinNumActions(){return 0}mustPauseSequence(){return 0!==this.getMinNumActions()}canReinit(){return!0}hasInfo(){return null!==this.infoUrl&&this.infoUrl.length>0||null!==this.infoCmd&&this.infoCmd.length>0}hasRandom(){return!1}shuffleAlways(){return!1}needsKeyboard(){return!1}end(){this.eventSounds.close(),this.clear()}clear(){}getWindowSize(){return new we(this.windowSize)}setWindowSize(t){this.windowSize=new we(t)}getActivityPanel(t){return new this.constructor.Panel(this,t)}}Mi.CLASSES={"@panels.Menu":Mi},Object.assign(Mi.prototype,{project:null,name:fe.DEFAULT_NAME,className:null,code:null,type:null,description:null,margin:fe.DEFAULT_MARGIN,bgColor:fe.DEFAULT_BG_COLOR,bgGradient:null,tiledBgImg:!1,bgImageFile:null,border:!0,absolutePositioned:!1,absolutePosition:null,includeInReports:!0,reportActions:!1,helpWindow:!1,showSolution:!1,helpMsg:"",eventSounds:null,useOrder:!1,dragCells:!1,skinFileName:null,maxTime:0,countDownTime:!1,maxActions:0,countDownActions:!1,infoUrl:null,infoCmd:null,messages:null,windowSize:new we(fe.DEFAULT_WIDTH,fe.DEFAULT_HEIGHT),transparentBg:!1,activityBgColor:fe.DEFAULT_BG_COLOR,activityBgGradient:null,bTimeCounter:!0,bScoreCounter:!0,bActionsCounter:!0,acp:null,abc:null,tgc:null,document:null,boxGridPos:"AB",shuffles:fe.DEFAULT_SHUFFLES,shuffleA:!0,shuffleB:!0,invAss:!1,menuElements:null,numericContent:!1});class Ni extends Be{constructor(t,e,i){super(),this.act=t,this.ps=e,this.minimumSize=new we(100,100),this.preferredSize=new we(500,400),this.$div=i||s()("<div/>",{class:"JClicActivity","aria-label":pt("Activity panel")}),this.act.initAutoContentProvider()}setBounds(t){this.pos.x=t.pos.x,this.pos.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height,this.invalidate(t),this.$div.css({position:"relative",left:t.pos.x,top:t.pos.y,width:t.dim.width,height:t.dim.height})}buildVisualComponents(){if(this.playing=!1,this.skin=null,this.act.skinFileName&&this.act.skinFileName.length>0&&this.act.skinFileName!==this.act.project.settings.skinFileName&&(this.skin=this.act.project.mediaBag.getSkinElement(this.act.skinFileName,this.ps)),this.bgImage=null,this.act.bgImageFile&&this.act.bgImageFile.length>0){const t=this.act.project.mediaBag.getElement(this.act.bgImageFile,!0);t&&(this.bgImage=t.data)}this.backgroundColor=this.act.activityBgColor,this.act.transparentBg&&(this.backgroundTransparent=!0),this.act.border&&(this.border=!0);const t={display:"block","background-color":this.backgroundTransparent?"transparent":this.backgroundColor};this.border&&(t["box-shadow"]="0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)",t["border-radius"]="2px",t.color="#272727"),this.act.activityBgGradient&&(t["background-image"]=this.act.activityBgGradient.getCss()),this.$div.css(t)}updateContent(t){return super.updateContent(t)}playEvent(t){this.act.eventSounds.play(t)}initActivity(){this.playing&&(this.playing=!1,this.ps.reportEndActivity(this.act,this.solved)),this.solved=!1,this.ps.reportNewActivity(this.act,0),this.attachEvents(),this.enableCounters()}startActivity(){this.playing=!0}activityReady(){}showHelp(){}setDimension(t){return new we(Math.min(t.width,this.act.windowSize.width),Math.min(t.height,this.act.windowSize.height))}attachEvents(){this.events.forEach((t=>this.attachEvent(this.$div,t))),fe.TOUCH_DEVICE||-1!==s().inArray(Oi,this.events)||this.attachEvent(this.$div,Oi)}attachEvent(t,e){t.on(e,this,(e=>{if(e.type!==Oi||(fe.TOUCH_DEVICE||(fe.TOUCH_DEVICE=!0),-1!==s().inArray(Oi,this.events)))return e.data.processEvent.call(e.data,e);t.off(Oi)}))}processEvent(t){return!1}fitTo(t,e){const i=new ye;this.act.absolutePositioned&&null!==this.act.absolutePosition&&(i.x=Math.max(0,this.act.absolutePosition.x+t.pos.x),i.y=Math.max(0,this.act.absolutePosition.y+t.pos.y),t.dim.width-=this.act.absolutePosition.x,t.dim.height-=this.act.absolutePosition.y);const s=this.setDimension(new we(Math.max(2*this.act.margin+fe.MINIMUM_WIDTH,t.dim.width),Math.max(2*this.act.margin+fe.MINIMUM_HEIGHT,t.dim.height)));this.act.absolutePositioned||i.moveTo(Math.max(0,t.pos.x+(t.dim.width-s.width)/2),Math.max(0,t.pos.y+(t.dim.height-s.height)/2)),i.x+s.width>e.dim.width&&(i.x=Math.max(0,e.dim.width-s.width)),i.y+s.height>e.dim.height&&(i.y=Math.max(0,e.dim.height-s.height)),this.setBounds(new xe(i.x,i.y,s.width,s.height)),window.setTimeout((()=>this.buildAccessibleComponents()),0)}buildAccessibleComponents(){this.accessibleCanvas&&this.$canvas&&this.$canvas.children().length>0&&this.$canvas.empty()}forceFinishActivity(){}finishActivity(t){this.playing=!1,this.solved=t,null!==this.bc&&this.bc.end(),t?this.setAndPlayMsg("final","finishedOk"):this.setAndPlayMsg("finalError","finishedError"),this.ps.activityFinished(this.solved),this.ps.reportEndActivity(this.act,this.solved)}setAndPlayMsg(t,e){const i=this.act.messages[t]||null;this.ps.setMsg(i),null!==i&&null!==i.mediaContent||this.playEvent(e)}end(){this.forceFinishActivity(),this.playing&&(null!==this.bc&&this.bc.end(),this.ps.reportEndActivity(this.act,this.solved),this.playing=!1,this.solved=!1),this.clear()}clear(){}enableCounters(t,e,i){void 0===t&&(t=this.act.bTimeCounter),void 0===e&&(e=this.act.bScoreCounter),void 0===i&&(i=this.act.bActionsCounter),this.ps.setCounterEnabled("time",t),this.act.countDownTime&&this.ps.setCountDown("time",this.act.maxTime),this.ps.setCounterEnabled("score",e),this.ps.setCounterEnabled("actions",i),this.act.countDownActions&&this.ps.setCountDown("actions",this.act.maxActions)}shuffle(t,e,i){const s=this.act.shuffles;let n=s;for(;n>0;){const e=n>s?s:n;t.forEach((t=>{t&&t.shuffleCells(e,i)})),n-=s}}}Object.assign(Ni.prototype,{act:null,$div:null,$canvas:null,accessibleCanvas:!0,skin:null,$animatedBg:null,$animatedBgB:null,solved:!1,bgImage:null,playing:!1,firstRun:!0,currentItem:0,bc:null,ps:null,minimumSize:null,preferredSize:null,events:["click"],backgroundColor:null,backgroundTransparent:!1,border:null}),Mi.Panel=Ni;var $i=Mi;class Vi{constructor(){this.settings=new Je(this),this.activitySequence=new ni(this),this._activities={},this.mediaBag=new di(this)}setProperties(t,e,i,n){e&&(this.path=e,e.file?this.basePath=e:this.basePath=Qt(e)),this.zip=i,this.name=t.attr("name"),this.version=t.attr("version"),void 0!==t.attr("type")&&""!==t.attr("type")&&(this.type=t.attr("type")),void 0!==t.attr("code")&&""!==t.attr("code")&&(this.code=t.attr("code")),this.settings.setProperties(t.children("settings")),this.activitySequence.setProperties(t.children("sequence")),this.mediaBag.setProperties(t.children("mediaBag")),this.reportableActs=0,this._activities={};const r=t.children("activities").children("activity"),a=this.mediaBag.getElementsOfType("font");return a.length>0&&(n.ownFonts=(n.ownFonts||[]).concat(a)),me.checkTree(r,n),r.each(((t,e)=>{const i=s()(e);this._activities[Zt(i.attr("name"))]=i,"true"===i.children("settings").attr("report")&&this.reportableActs++})),this}getAttributes(){const t=Object.keys(this._activities);return this.activities={},t.forEach((t=>{const e=this._activities[t];this.activities[t]=e.jquery?$i.getActivity(e,this):e})),$t(this,["name","version","type","code","settings","activitySequence","activities","mediaBag"])}getJSON(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return JSON.stringify(this.getAttributes(),((t,e)=>e.toFixed?Number(e.toFixed(4)):e),t)}setAttributes(t,e,i,s){e&&(this.path=e,e.file?this.basePath=e:this.basePath=Qt(e)),this.zip=i,this.name=t.name,this.version=t.version,t.type&&(this.type=t.type),t.code&&(this.code=t.code),this.settings.setAttributes(t.settings),this.activitySequence.setAttributes(t.activitySequence),this.mediaBag.setAttributes(t.mediaBag),this.reportableActs=0,this._activities=t.activities;const n=this.mediaBag.getElementsOfType("font");return n.length>0&&(s.ownFonts=(s.ownFonts||[]).concat(n)),me.checkTree(this._activities,s),this.reportableActs=Object.keys(this._activities).filter((t=>this._activities[t].includeInReports)).length,this}getActivity(t){return $i.getActivity(this._activities[Zt(t)],this)}realize(t){null===this.skin&&null!==this.settings.skinFileName&&this.settings.skinFileName.length>0&&(this.skin=this.mediaBag.getSkinElement(this.settings.skinFileName,t)),this.settings.eventSounds.realize(t,this.mediaBag),this.mediaBag.buildAll("font",null,t)}end(){}}Object.assign(Vi.prototype,{name:"unknown",version:"0.1.3",type:null,code:null,settings:null,activitySequence:null,_activities:null,reportableActs:0,mediaBag:null,skin:null,basePath:"",path:null,zip:null});var qi=Vi;class Li{constructor(t,e,i,s){this.type=t,this.source=e||null,this.dest=i||null,this.ok=s||!1,this.time=(new Date).valueOf()}$getXML(){const t={ok:this.ok,time:this.time};return this.type&&(t.type=this.type),this.source&&(t.source=this.source),this.dest&&(t.dest=this.dest),s()("<action/>",t)}setProperties(t){ce(t.get(0).attributes,((t,e)=>{switch(t){case"type":case"source":case"dest":this[t]=e;break;case"time":this[t]=Number(e);break;case"ok":this[t]=mt(e,!1)}}))}}Object.assign(Li.prototype,{type:"unknown",source:null,dest:null,time:0,isOk:!1});var ji=Li;class Fi{constructor(t){this.name=t.name,this.code=t.code,this.actions=[],this.startTime=(new Date).valueOf(),this.minActions=t.getMinNumActions(),this.reportActions=t.reportActions}$getXML(){const t={start:this.startTime,time:this.totalTime,solved:this.solved,score:this.score,minActions:this.minActions,actions:this.numActions};this.name&&(t.name=this.name),this.code&&(t.code=this.code),this.closed||(t.closed=!1),this.reportActions&&(t.reportActions=!0);const e=s()("<activity/>",t);return this.actions.forEach((t=>{e.append(t.$getXML())})),e}getData(){const t={name:this.name,time:Math.round(this.totalTime/10)/100,solved:this.solved,score:this.score,minActions:this.minActions,actions:this.numActions,precision:this.getPrecision(),closed:this.closed};return this.code&&(t.code=this.code),t}setProperties(t){ce(t.get(0).attributes,((t,e)=>{switch(t){case"name":case"code":this[t]=e;break;case"start":case"time":case"score":case"minActions":case"actions":this[t]=Number(e);break;case"solved":case"closed":case"reportActions":this[t]=mt(e,!1)}})),t.children("action").each(((t,e)=>{const i=new ji;i.setProperties(s()(e)),this.actions.push(i)}))}newAction(t,e,i,s){this.closed||(this.lastAction=new ji(t,e,i,s),this.actions.push(this.lastAction))}getActionReg(t){return t>=this.actions.length?null:this.actions[t]}closeActivity(){this.closed||(this.lastAction?this.totalTime=this.lastAction.time-this.startTime:this.totalTime=(new Date).valueOf()-this.startTime,this.closed=!0)}getPrecision(){let t=0;return this.closed&&this.minActions>0&&this.numActions>0&&(t=this.solved?this.numActions<this.minActions?100:Math.round(100*this.minActions/this.numActions):Math.round(this.score*this.score*100/(this.minActions*this.numActions))),t}endActivity(t,e,i){this.closed||(this.solved=i,this.numActions=e,this.score=t,this.closeActivity())}}Object.assign(Fi.prototype,{name:"",code:"",startTime:0,totalTime:0,actions:[],solved:!1,lastAction:null,score:0,minActions:0,closed:!1,reportActions:!1,numActions:0});var zi=Fi;class Ui{constructor(t){this.name=t.tag,this.description=t.description,this.activities=[],this.currentActivity=null,this.totalTime=0,this.closed=!1,this.info=new Hi(this)}getData(){const t={sequence:this.name,activities:[]};return this.activities.forEach((e=>t.activities.push(e.getData()))),t}getInfo(){return this.info.recalc()}endSequence(){this.currentActivity&&this.activities.length>0&&(this.currentActivity.closed||this.currentActivity.closeActivity(),this.totalTime=this.currentActivity.startTime+this.currentActivity.totalTime-this.activities[0].startTime,this.info.valid=!1)}newActivity(t){this.closed||(this.currentActivity=new zi(t),this.activities.push(this.currentActivity),this.info.valid=!1)}endActivity(t,e,i){this.currentActivity&&(this.currentActivity.endActivity(t,e,i),this.info.valid=!1)}newAction(t,e,i,s){this.currentActivity&&(this.currentActivity.newAction(t,e,i,s),this.info.valid=!1)}}Object.assign(Ui.prototype,{name:"",description:"",activities:[],currentActivity:null,totalTime:0,closed:!1,info:null});class Hi{constructor(t){this.sqReg=t}clear(){this.nActivities=this.nActClosed=this.nActSolved=this.nActScore=0,this.ratioSolved=this.nActions=this.tScore=this.tTime=0,this.valid=!1}recalc(){return this.valid||(this.clear(),this.nActivities=this.sqReg.activities.length,this.nActivities>0&&(this.sqReg.activities.forEach((t=>{if(t.closed){this.nActClosed++,this.tTime+=t.totalTime,this.nActions+=t.numActions,t.solved&&this.nActSolved++;const e=t.getPrecision();e>=0&&(this.tScore+=e,this.nActScore++)}})),this.nActClosed>0&&(this.ratioSolved=this.nActSolved/this.nActClosed),this.nActScore>0&&(this.tScore=Math.round(this.tScore/this.nActScore))),this.valid=!0),this}}Object.assign(Hi.prototype,{sqReg:null,valid:!1,nActivities:0,nActClosed:0,nActSolved:0,nActScore:0,ratioSolved:0,nActions:0,tScore:0,tTime:0}),Ui.Info=Hi;var Wi=Ui;class Gi{constructor(t,e){this.projectName=t.name,this.code=e||t.code,this.sequences=[],this.actNames=[],this.started=new Date,this.info=new Ji(this),this.reportableActs=t.reportableActs}getData(t,e){t&&this.info.recalc();const i={projectName:this.projectName,played:this.info.nActivities,ratioPlayed:Math.round(100*this.info.ratioPlayed),solved:this.info.nActSolved,ratioSolved:Math.round(100*this.info.ratioSolved),actions:this.info.nActions,score:this.info.tScore,time:Math.round(this.info.tTime/10)/100,sequences:[]};return this.sequences.forEach((t=>{const s=t.getData();(e||s.activities.length>0)&&i.sequences.push(s)})),i}getInfo(){return this.info.recalc()}end(){this.endSequence()}endSequence(){this.currentSequence&&0===this.currentSequence.totalTime&&this.currentSequence.endSequence(),this.currentSequence=null,this.info.valid=!1}newSequence(t){this.endSequence(),this.currentSequence=new Wi(t),this.sequences.push(this.currentSequence),this.info.valid=!1}newActivity(t){this.currentSequence&&(-1===this.actNames.indexOf(t.name)&&this.actNames.push(t.name),this.currentSequence.newActivity(t),this.info.valid=!1)}endActivity(t,e,i){this.currentSequence&&(this.currentSequence.endActivity(t,e,i),this.info.valid=!1)}newAction(t,e,i,s){this.currentSequence&&(this.currentSequence.newAction(t,e,i,s),this.info.valid=!1)}getCurrentSequenceTag(){return this.currentSequence?this.currentSequence.name:null}getCurrentSequenceInfo(){return this.currentSequence?this.currentSequence.getInfo():null}}Object.assign(Gi.prototype,{reportableActs:0,actNames:null,sequences:null,currentSequence:null,started:null,projectName:"",info:null,code:null});class Ji{constructor(t){this.sReg=t}clear(){this.numSequences=this.nActivities=this.nActSolved=this.nActScore=0,this.ratioSolved=this.ratioPlayed=this.nActions=this.tScore=this.tTime=0,this.valid=!1}recalc(){return this.valid||(this.clear(),this.sReg.sequences.forEach((t=>{const e=t.getInfo();e.nActivities>0&&(this.numSequences++,e.nActClosed>0&&(this.nActivities+=e.nActClosed,this.nActions+=e.nActions,e.nActScore>0&&(this.nActScore+=e.nActScore,this.tScore+=e.tScore*e.nActScore),this.tTime+=e.tTime,this.nActSolved+=e.nActSolved))})),this.nActScore>0&&(this.tScore=Math.round(this.tScore/this.nActScore)),this.nActivities>0&&(this.ratioSolved=this.nActSolved/this.nActivities,this.sReg.reportableActs>0&&(this.ratioPlayed=this.sReg.actNames.length/this.sReg.reportableActs)),this.valid=!0),this}}Object.assign(Ji.prototype,{sReg:null,valid:!1,numSequences:0,nActivities:0,nActSolved:0,nActScore:0,ratioSolved:0,ratioPlayed:0,nActions:0,tScore:0,tTime:0}),Gi.Info=Ji;var Ki=Gi;class Zi{static Decrypt(t){if(null===t||0===t.length)return null;const e=Zi.decodify(t);return e===Zi.BLANK?"":e}static hexCharArrayToChar(t,e){let i=0;for(let s=0;s<=3;s++){const n=Number.parseInt(t[e+s],16);if(isNaN(n))throw"Invalid expression!";i=16*i+n}return String.fromCharCode(i)}static hexCharArrayToInt(t,e){let i=0;for(let s=0;s<=1;s++){const n=Number.parseInt(t[e+s],16);if(isNaN(n))throw"Invalid expression!";i=16*i+n}return i}static decodifyZerosField(t){let e="",i=Number.parseInt(t[0],32),s=0,n=0;for(n=0;0!==i;n++){for(;i>0;)e=e+t[3*n+1]+t[3*n+2],i--,s++;i=t.length>3*n+3?Number.parseInt(t[3*n+3],32):0}for(let i=3*n+1;i<t.length;i++)e+=t[i];return Number.parseInt(s,32)+e}static decompressZeros(t){t=Zi.decodifyZerosField(t);let e=Number.parseInt(t[0],32),i=2*e+1,s=!1,n="";for(let r=0;r<e&&!s;r++){let e=Zi.hexCharArrayToInt(t,1+2*r).toString(2);for(;e.length<8;)e="0"+e;for(let r=0;r<=7&&!s;r++)"1"===e[r]?n+="0":i<t.length?n+=t[i++]:s=!0}return n}static decodifyFromHex(t){let e="",i=0;for(let s=0;i<t.length;s++){e+=Zi.hexCharArrayToChar(t,i),i+=4}return e}static unchangeOrder(t){let e=0,i=t.length-1;const s=[];for(let e=0;e<t.length;e++)s[e]="";for(let n=0;n<t.length;n++)s[n]=n%2==0?t[e++]:t[i--];return s.join("")}static codify(t){if(t.length>24)throw"Password is too large!";return Zi.changeOrder(Zi.compressZeros(Zi.codifyToHexWord(t)))}static decodify(t){try{return Zi.decodifyFromHex(Zi.decompressZeros(Zi.unchangeOrder(t)))}catch(t){return""}}}Zi.BLANK="___blank___##";var Yi=Zi;class Qi{constructor(t,e){this.API=t,"function"==typeof t.Initialize?this.is2004=!0:(this.prefix="LMS",this.core="cmi.core."),this.reporter=e}static scanForAPI(t,e){return t.API_1484_11&&t.API_1184_11.Initialize&&t.API_1184_11.SetValue&&t.API_1184_11.Commit?t.API_1184_11:t.API&&t.API.LMSInitialize&&t.API.LMSSetValue&&t.API.LMSCommit?t.API:t.parent&&t.parent!==t&&e++<Qi.DISCOVER_MAX_TRIES?Qi.scanForAPI(t.parent,e):null}static getSCORM(t){let e=null;try{let i=Qi.scanForAPI(window,0);null===i&&window.opener&&(i=Qi.scanForAPI(window.opener,0)),i&&(e=new Qi(i,t),e.initialize()||(e=null))}catch(t){e=null,gt("warn","Unable to use SCORM: %s",t.toString())}return e}initialize(){let t=!1;try{t=this.API[this.prefix+"Initialize"](""),t&&(this.studentId=this.getValue(this.core+(this.is2004?"learner_id":"student_id")),this.studentName=this.getValue(this.core+(this.is2004?"learner_name":"student_name")),this.setValue(this.core+"score.min",0),this.setValue(this.core+"score.max",100),s()(window).on("unload",(()=>{this.commitInfo(),this.terminate(),this.API=null}))),gt("debug","SCORM initialized")}catch(t){gt("error",`Error initializing SCORM API: ${t.message}`)}return t}terminate(){let t=!1;try{t=this.API[this.is2004?"Terminate":"LMSFinish"]("")}catch(t){gt("error",`Error terminating SCORM API: ${t.message}`)}return t}commitInfo(){const t=this.reporter.getInfo(),e=Math.round(100*t.globalScore),i=this.getTimeExpression(t.tTime);this.setValue(this.core+"score.raw",e),this.setValue(this.core+"session_time",i),this.commit(),gt("debug",`SCORM results reported: ${e} (${i})`)}commit(){let t=!1;try{t=this.API[this.prefix+"Commit"]("")}catch(t){gt("error","Error commiting data to the SCORM API: ${ex.message}")}return t}setValue(t,e){let i=!1;try{i=this.API[this.prefix+"SetValue"](t,e)}catch(i){gt("error",`Error setting value "${e}" to "${t}" in SCORM API: ${i.message}`)}return i}getValue(t){let e=!1;try{e=this.API[this.prefix+"GetValue"](t)}catch(e){gt("error",`Error retrieving "${t}" from SCORM API: ${e.message}`)}return e}getTimeExpression(t){const e=new Date(t),i=e.getUTCHours(),s=e.getUTCMinutes(),n=e.getUTCSeconds();return this.is2004?`PT${i}H${s}M${n}S`:`${("0000"+i).slice(-4)}:${("00"+s).slice(-2)}:${("00"+n).slice(-2)}`}getScormType(){return"SCORM "+(this.is2004?"2004":"1.2")}}Object.assign(Qi.prototype,{is2004:!1,reporter:null,prefix:"",core:"cmi.",API:null,studentId:"",studentName:""}),Qi.DISCOVER_MAX_TRIES=50;var Xi=Qi;class ts{constructor(t){this.ps=t,this.sessions=[],this.started=new Date,this.initiated=!1,this.info=new es(this)}static registerClass(t,e){return ts.CLASSES[t]=e,e}static getReporter(t,e){let i=null;return null===t&&(t="Reporter",e.options.hasOwnProperty("reporter")&&(t=e.options.reporter)),ts.CLASSES.hasOwnProperty(t)?i=new ts.CLASSES[t](e):gt("error","Unknown reporter class: %s",t),i}getInfo(){return this.info.recalc()}getProperty(t,e){return e}getBooleanProperty(t,e){const i=this.getProperty(t,!0===e?"true":"false");return null===t?e:"true"===i}getGroups(){return Promise.reject("No groups defined!")}getUsers(t){return Promise.reject("No users defined in "+t)}getUserData(t){return Promise.reject("Unknown user!")}getGroupData(t){return Promise.reject("Unknown group!")}userBased(){return null===this.bUserBased&&(this.bUserBased=this.getBooleanProperty("USER_TABLES",!1)),this.bUserBased}promptForNewGroup(){return Promise.reject("Remote creation of groups not yet implemented!")}promptForNewUser(){return Promise.reject("Remote creation of users not yet implemented!")}promptGroupId(){return new Promise(((t,e)=>{this.userBased()?this.getGroups().then((i=>{if(!i||i.length<1)e("No groups defined!");else{let n=0;const r=s()("<select/>").attr({size:Math.max(3,Math.min(15,i.length))});i.forEach((t=>r.append(s()("<option/>").attr({value:t.id}).text(t.name)))),r.change((t=>{n=t.target.selectedIndex})),this.ps.skin.showDlg(!0,{main:[s()("<h2/>",{class:"subtitle"}).html(pt("Select group:")),r],bottom:[this.ps.skin.$okDlgBtn,this.ps.skin.$cancelDlgBtn]}).then((()=>{t(i[n].id)})).catch(e)}})).catch(e):e("This system does not manage users!")}))}promptUserId(t){return new Promise(((e,i)=>{if(null===this.userId||t)if(this.userBased()){const t=s()("<input/>",{type:"password",size:8,maxlength:64});if(this.getBooleanProperty("SHOW_USER_LIST",!0))this.promptGroupId().then((n=>{this.getUsers(n).then((r=>{if(!r||r.length<1)i("Group "+n+" has no users!");else{let n=-1;const a=s()("<select/>").attr({size:Math.max(3,Math.min(15,r.length))});r.forEach((t=>a.append(s()("<option/>").attr({value:t.id}).text(t.name)))),a.change((t=>{n=t.target.selectedIndex})),this.ps.skin.showDlg(!0,{main:[s()("<h2/>",{class:"subtitle"}).html(pt("Select user:")),a,s()("<h2/>",{class:"subtitle"}).html(pt("Password:")).append(t)],bottom:[this.ps.skin.$okDlgBtn,this.ps.skin.$cancelDlgBtn]}).then((()=>{n>=0?r[n].pwd&&Yi.Decrypt(r[n].pwd)!==t.val()?(window.alert(pt("Incorrect password")),i("Incorrect password")):(this.userId=r[n].id,e(this.userId)):i("No user has been selected")})).catch(i)}})).catch(i)})).catch(i);else{const n=s()("<input/>",{type:"text",size:8,maxlength:64});this.ps.skin.showDlg(!0,{main:[s()("<div/>").css({"text-align":"right"}).append(s()("<h2/>",{class:"subtitle"}).html(pt("User:")).append(n)).append(s()("<h2/>",{class:"subtitle"}).html(pt("Password:")).append(t))],bottom:[this.ps.skin.$okDlgBtn,this.ps.skin.$cancelDlgBtn]}).then((()=>{this.getUserData(n.val()).then((s=>{s.pwd&&Yi.Decrypt(s.pwd)!==t.val()?(window.alert(pt("Incorrect password")),i("Incorrect password")):(this.userId=s.id,e(this.userId))})).catch(i)})).catch(i)}}else i("This system does not manage users!");else e(this.userId)}))}getData(){this.info.recalc();const t={started:this.started.toISOString(),descriptionKey:this.descriptionKey,descriptionDetail:this.descriptionDetail,projects:this.info.numSessions,sequences:this.info.numSequences,activitiesDone:this.info.nActivities,playedOnce:this.info.nActPlayed,reportable:this.info.reportableActs,ratioPlayed:Math.round(100*this.info.ratioPlayed),activitiesSolved:this.info.nActSolved,ratioSolved:Math.round(100*this.info.ratioSolved),actScore:this.info.nActScore,partialScore:Math.round(100*this.info.partialScore),globalScore:Math.round(100*this.info.globalScore),time:Math.round(this.info.tTime/10)/100,actions:this.info.nActions,sessions:[]};return this.userId?t.userId=this.userId:this.SCORM&&(t.user=this.SCORM.studentName+(""===this.SCORM.studentId?"":` (${this.SCORM.studentId})`)),this.sessions.forEach((e=>{e.getInfo().numSequences>0&&t.sessions.push(e.getData(!1,!1))})),t}init(t){return t||(t=this.ps.options),this.userId=vt(t.user),this.sessionKey=vt(t.key),this.sessionContext=vt(t.context),this.groupCodeFilter=vt(t.groupCodeFilter),this.userCodeFilter=vt(t.userCodeFilter),!1!==t.SCORM&&(this.SCORM=Xi.getSCORM(this),null!==this.SCORM&&this.descriptionKey===ts.prototype.descriptionKey&&(this.descriptionKey=this.SCORM.getScormType())),this.initiated=!0,gt("debug","Basic Reporter initialized"),Promise.resolve(!0)}end(){return gt("debug","Basic Reporter ending"),this.endSession(),Promise.resolve(!0)}endSequence(){this.currentSession&&(this.currentSession.endSequence(),this.info.valid=!1)}endSession(){this.endSequence(),this.currentSession=null}newGroup(t){throw"No database!"}newUser(t){throw"No database!"}newSession(t){this.endSession(),this.currentSession=new Ki(t),this.sessions.push(this.currentSession),this.info.valid=!1}newSequence(t){this.currentSession&&(this.currentSession.newSequence(t),this.info.valid=!1,this.SCORM&&this.SCORM.commitInfo())}newActivity(t){this.currentSession&&(this.currentSession.newActivity(t),this.info.valid=!1)}endActivity(t,e,i){this.currentSession&&(this.currentSession.endActivity(t,e,i),this.info.valid=!1)}newAction(t,e,i,s){this.currentSession&&(this.currentSession.newAction(t,e,i,s),this.info.valid=!1)}getCurrentSequenceInfo(){return null===this.currentSession?null:this.currentSession.getCurrentSequenceInfo()}getCurrentSequenceTag(){return null===this.currentSession?null:this.currentSession.getCurrentSequenceTag()}}Object.assign(ts.prototype,{info:null,ps:null,SCORM:null,userId:null,sessionKey:null,sessionContext:null,groupCodeFilter:null,userCodeFilter:null,descriptionKey:"Results are not currently being saved",descriptionDetail:"",started:null,sessions:[],currentSession:null,initiated:!1,bUserBased:null,MAX_USERID_PROMPT_ATTEMPTS:3});class es{constructor(t){this.rep=t}clear(){this.numSessions=this.numSequences=this.nActivities=this.reportableActs=this.nActSolved=this.nActPlayed=this.nActScore=this.nActions=this.ratioSolved=this.ratioPlayed=this.tScore=this.tTime=this.partialScore=this.globalScore=0,this.valid=!1}recalc(){return this.valid||(this.clear(),this.rep.sessions.forEach((t=>{const e=t.getInfo();this.reportableActs+=e.sReg.reportableActs,e.numSequences>0&&(this.numSessions++,this.numSequences+=e.numSequences,e.nActivities>0&&(this.nActivities+=e.nActivities,this.nActPlayed+=e.sReg.actNames.length,this.nActSolved+=e.nActSolved,this.nActions+=e.nActions,e.nActScore>0&&(this.tScore+=e.tScore*e.nActScore,this.nActScore+=e.nActScore),this.tTime+=e.tTime))})),this.nActivities>0&&(this.ratioSolved=this.nActSolved/this.nActivities,this.reportableActs>0&&(this.ratioPlayed=this.nActPlayed/this.reportableActs),this.partialScore=this.tScore/(100*this.nActScore),this.globalScore=this.partialScore*this.ratioPlayed),this.valid=!0),this}}Object.assign(es.prototype,{rep:null,valid:!1,numSessions:0,numSequences:0,nActivities:0,reportableActs:0,nActSolved:0,nActPlayed:0,nActScore:0,nActions:0,ratioSolved:0,ratioPlayed:0,tScore:0,partialScore:0,tTime:0,globalScore:0}),ts.Info=es,ts.CLASSES={Reporter:ts};var is=ts;class ss extends Be{constructor(t,e){super(),e=dt(e),this.options=s().extend(Object.create(this.options),e),this.id=`JC${(65536+Math.round(65535*Math.random())).toString(16).toUpperCase().substring(1)}`,this.$topDiv=t||s()("<div/>"),this.$topDiv.css({"text-align":"initial"}),this.$topDiv.parent().is("td")&&this.$topDiv.css({width:re(this.options.width,null,null,"100%"),height:re(this.options.height,null,null,"100%")}),this.$mainContainer=s()("<div/>",{class:"JClicContainer",id:this.id}).css({width:"100%",height:"100%"}).appendTo(this.$topDiv),this.localFS=location&&"file:"===location.protocol,this.$div=s()("<div/>",{class:"JClicPlayer"}),this.project=new qi,this.activeMediaBag=new $e,this.counterVal={score:0,actions:0,time:0},this.bgImageOrigin=new ye,this.buildActions(),this.history=new _e(this),this.audioEnabled=this.options.audioEnabled,this.navButtonsAlways=this.options.navButtonsAlways,this.defaultSkin=qe.getSkin(this.options.skin,this),this.setSkin(qe.getSkin("@empty.xml",this)),this.initTimers(),this.listenTouchEvents(),gt("info","JClicPlayer ready")}listenTouchEvents(){let t=null,e=0,i=this.$div[0];const{minSwipeX:s,maxSwipeY:n,rightToLeft:r}=this.options,a=a=>{if(a.target===i&&a.changedTouches&&1===a.changedTouches.length){const i=a.changedTouches[0],o=t?i.clientX-t.clientX:0,l=t?i.clientY-t.clientY:0,c=Math.sqrt(o*o+l*l);switch(a.type){case"touchstart":const h=new Date;document&&document.fullscreenEnabled&&t&&e&&h-e<800&&c<s?(a.preventDefault(),gt("info","Toggle full screen mode from double touch"),this.skin.setScreenFull(),t=null):(t=i,e=h);break;case"touchend":if(t&&Math.abs(o)>s&&Math.abs(l)<n){const e=o<0&&!r?"next":"prev",i=this.actions[e];i&&i.enabled&&(a.preventDefault(),gt("info",`Performing action "${e}" from touch gesture`),i.actionPerformed(a)),t=null}else c>s&&(t=null);break;case"touchcancel":t=null}}else t=null};i.addEventListener("touchstart",a),i.addEventListener("touchend",a),i.addEventListener("touchcancel",a)}getUniqueId(t){return`${this.id}-${t}`}buildActions(){this.actions={next:new Ee("next",(()=>this.history.processJump(this.project.activitySequence.getJump(!1,this.reporter),!1))),prev:new Ee("prev",(()=>this.history.processJump(this.project.activitySequence.getJump(!0,this.reporter),!1))),return:new Ee("return",(()=>this.history.pop())),reset:new Ee("reset",(()=>{this.actPanel&&this.actPanel.act.canReinit()&&this.initActivity()})),help:new Ee("help",(()=>{this.actPanel&&this.actPanel.showHelp()})),info:new Ee("info",(()=>{this.actPanel&&this.actPanel.act.hasInfo()&&(this.actPanel.act.infoUrl?this.displayURL(this.act.infoUrl,!0):this.actPanel.act.infoCmd&&this.runCmd(this.actPanel.act.infoCmd))})),reports:new Ee("reports",(()=>this.showReports())),audio:new Ee("audio",(()=>{this.audioEnabled=!this.audioEnabled,this.audioEnabled||this.stopMedia(),We.prototype.globalEnabled=this.audioEnabled}))},s().each(this.actions,((t,e)=>{e.addStatusListener((t=>{this.skin&&this.skin.actionStatusChanged(t)}))}))}reset(){gt("info","Restoring player"),this.removeActivity(),this.end(),this.activeMediaBag=new $e,this.history.clearHistory(),this.setSkin(null),this.setMsg(null),this.setCounterValue("score",0),this.setCounterValue("actions",0),this.setCounterValue("time",0),this.skin&&this.skin.setWaitCursor("reset")}stop(){this.stopMedia(-1)}end(){let t=null;return this.stopMedia(),this.closeHelpWindow(),this.reporter&&(t=this.reporter.end(),this.reporter=null),this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null),this.project&&(this.project.end(),this.project=null),this.activeMediaBag&&this.activeMediaBag.removeAll(),t||Promise.resolve(!0)}initReporter(){return this.reporter&&(this.reporter.end(),this.reporter=null),this.reporter=is.getReporter(null,this),this.reporter.init()}initTimers(){this.timer&&this.timer.stop(),this.timer=new Te((()=>{this.incCounterValue("time"),this.actPanel&&this.actPanel.act.maxTime>0&&this.actPanel.playing&&this.counterVal.time>=this.actPanel.act.maxTime&&this.actPanel.finishActivity(!1)}),1e3,!1),this.delayedTimer&&this.delayedTimer.stop(),this.delayedTimer=new Te((()=>{this.delayedAction&&this.delayedAction.processEvent(this.delayedAction,null)}),1e3,!1),this.delayedTimer.repeats=!1}showReports(){this.skin&&this.skin.showReports(this.reporter)}closeHelpWindow(){this.skin&&this.skin._closeDlg(!1)}setSkin(t){!(t=t||(this.project&&this.project.skin?this.project.skin:this.defaultSkin))||null!==this.skin&&t.name===this.skin.name||(t.attach(this),this.skin=t,this.skin.doLayout())}setProject(t){this.project&&(this.project!==t&&this.project.end(),this.removeActivity()),this.project=t||new qi,this.project.realize(this)}load(t,e,i){this.forceFinishActivity(),this.setWaitCursor(!0);let n=null;if(t){if("string"==typeof t){const n=te(this.basePath,t);if(n.endsWith("project.json"))return gt("info",`Loading JSON info from: ${n}`),void s().getJSON(n).done((t=>{let{mainFile:s}=t;s&&Jt(s,".jclic")||Jt(s,".jclic.json")?this.load(te(Qt(n),s),e,i):gt("error",`Invalid or null "mainFile" specified in ${n} - "project.json".`)})).fail(((e,i,s)=>{const n=`${i} (${s}) while loading ${t}`;gt(n),window.alert(`Error!\n${n}`)})).always((()=>this.setWaitCursor(!1)));if(n.endsWith(".zip"))return this.zip=null,gt("info",`Loading ZIP file: ${n}`),void o().getBinaryContent(n,((t,s)=>{if(t)return this.setWaitCursor(!1),void gt("error",`Error loading ZIP file: ${t.toString()}`);(new(r())).loadAsync(s).then((t=>{this.zip=t,this.zip.fullZipPath=n,this.zip.zipBasePath=Qt(n);let s=null;this.zip.files["project.json"]?this.zip.files["project.json"].async("string").then((t=>{try{const s=JSON.parse(t);Jt(s.mainFile,".jclic")?this.load(te(this.zip.zipBasePath,s.mainFile),e,i):gt("error",`Invalid or null "mainFile" specified in ${n} - "project.json".`)}catch(t){gt("error",`Error reading "project.json" in ${n}: ${t?t.toString():"unknown error"}`)}})).catch((t=>{gt("error",`Error reading ZIP file: ${t?t.toString():"unknown reason"}`)})):(s=Object.keys(this.zip.files).find((t=>t.endsWith(".jclic")))||null,s?this.load(te(this.zip.zipBasePath,s),e,i):gt("error","This ZIP file does not contain any JClic project!")),this.setWaitCursor(!1)})).catch((t=>{gt("error",`Error reading ZIP file: ${t?t.toString():"unknown reason"}`),this.setWaitCursor(!1)}))}));if(this.localFS&&window.JClicObject&&!window.JClicObject.projectFiles[n]){const s=document.createElement("script");return s.src=`${n}.js`,s.onload=()=>{var s,r;window.JClicObject.projectFiles[n]&&(window.JClicObject.projectFiles[n]=(s=[[/
/g,"\r"],[/
/g,"\n"],[/	/g,"\t"]],r=window.JClicObject.projectFiles[n],s.reduce(((t,e)=>{let[i,s]=e;return t.replace(i,s)}),r)),this.load(t,e,i))},document.head.appendChild(s),void this.setWaitCursor(!1)}const a=r=>{const a=0===r.indexOf("data:text/xml;")||r.endsWith(".jclic");(a?s().get(r,null,null,"xml"):s().getJSON(r)).done((r=>{if(null===r||"object"!=typeof r)return void gt("error",`Bad data. Project not loaded: ${t}`);const o=new qi;a?o.setProperties(s()(r).find("JClicProject"),n,this.zip,this.options):o.setAttributes(r,n,this.zip,this.options),gt("info",`Project file loaded and parsed: ${t}`);const l=o.mediaBag.buildAll(null,(t=>{gt("trace",`"${t.name}" ready.`),this.incProgress(1)}),this);gt("info",`Media elements to be loaded: ${l}`),this.setProgress(0,l);let c=0;this.setWaitCursor(!0);const h=window.setInterval((()=>{++c>this.options.maxWaitTime/500&&(window.clearInterval(h),this.setProgress(-1),this.setWaitCursor(!1),gt("error","Error loading media"));-1===o.mediaBag.countWaitingElements()&&(window.clearInterval(h),this.setProgress(-1),this.setWaitCursor(!1),this.load(o,e,i))}),500)})).fail(((e,i,s)=>{const n=`${i} (${s}) while loading ${t}`;gt(n),window.alert(`Error!\n${n}`)})).always((()=>this.setWaitCursor(!1)))};gt("info",`Loading project: ${t}`);let l=n;if(this.zip){const t=Xt(l,this.zip.zipBasePath);if(this.zip.files[t])return void this.zip.file(t).async("string").then((e=>{a(`data:${t.endsWith(".jclic")?"text/xml":"application/json"};charset=UTF-8,${e}`)})).catch((e=>{gt("error",`Unable to extract "${t}" from ZIP file because of: ${e?e.toString():"unknown reason"}`),this.setWaitCursor(!1)}))}else if(this.localFS){if(!window.JClicObject||!window.JClicObject.projectFiles[n])return gt("error",`Unable to load: ${n}.js`),void this.setWaitCursor(!1);l=`data:${n.endsWith(".jclic")?"text/xml":"application/json"};charset=UTF-8,${window.JClicObject.projectFiles[n]}`}return void a(l)}this.setProject(t),e||i||(e="0"),this.reporter&&this.reporter.newSession(t)}if(!Tt(e)){gt("info",`Loading sequence: ${e}`),this.navButtonsDisabled=!1;let t=null;if("string"==typeof e&&(t=this.project.activitySequence.getElementByTag(e,!0)),null===t){const i=parseInt(e,10);"number"==typeof i&&(t=this.project.activitySequence.getElement(i,!0))}null!==t&&(this.reporter&&this.reporter.newSequence(t),i=t.activity)}if(i){const t=this.project.getActivity(i);t?(gt("info",`Loading activity: ${i}`),hi.resetAudioElements(),t.prepareMedia(this),this.project.activitySequence.checkCurrentActivity(t.name),n=t.getActivityPanel(this),n.buildVisualComponents()):gt("error",`Missing activity: ${i}`)}if(null!==this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null,this.setCounterValue("time",0)),n){if(this.actPanel=n,this.options.fade>0&&this.actPanel.$div.css("display","none"),this.$div.prepend(this.actPanel.$div),this.skin&&this.skin.resetAllCounters(!1),this.actPanel.skin?this.setSkin(this.actPanel.skin):this.project.skin?(this.setSkin(this.project.skin),this.lastProjectSkin=this.project.skin):this.lastProjectSkin?this.setSkin(this.lastProjectSkin):this.setSkin(null),this.skin){const t=this.history.storedElementsCount()>0||this.options.returnAsExit,e=this.navButtonsAlways?"both":this.navButtonsDisabled?"none":this.project.activitySequence.getNavButtonsFlag();this.actions.next.setEnabled(("fwd"===e||"both"===e)&&this.project.activitySequence.hasNextAct(t)),this.actions.prev.setEnabled(("back"===e||"both"===e)&&this.project.activitySequence.hasPrevAct(t)),this.actions.return.setEnabled(t),this.actions.help.setEnabled(this.actPanel.act.helpWindowAllowed()),this.actions.reset.setEnabled(this.actPanel.act.canReinit()),this.actions.info.setEnabled(this.actPanel.act.hasInfo())}this.doLayout(),this.initActivity(),this.history.pushBrowserHistory(),this.actPanel.$div.fadeIn(this.options.fade,(()=>this.activityReady()))}this.setWaitCursor(!1)}forceFinishActivity(){this.timer.stop(),this.delayedTimer.stop(),this.actPanel&&(this.closeHelpWindow(),this.actPanel.forceFinishActivity(),this.stopMedia(),this.activeMediaBag.removeAll())}removeActivity(){this.forceFinishActivity(),this.actPanel&&(this.actPanel.end(),this.actPanel.$div.remove(),this.actPanel=null,this.setMsg(null),this.doLayout())}initActivity(){this.setWaitCursor(!0),this.timer.stop(),this.delayedTimer.stop(),this.setCounterValue("time",0),this.stopMedia(),this.actPanel&&(this.actPanel.initActivity(),this.timer.start(),this.actPanel.act.mustPauseSequence()||this.startAutoPassTimer(),gt("info",`Activity "${this.actPanel.act.name}" running`)),this.setWaitCursor(!1)}activityReady(){this.actPanel&&(this.actPanel.activityReady(),gt("info","Activity ready"))}startActivity(){this.setWaitCursor(!0),this.actPanel&&this.actPanel.startActivity(),this.setWaitCursor(!1)}doLayout(){const t=this.dim.width=this.$div.width(),e=this.dim.height=this.$div.height(),i={"background-color":this.actPanel?this.actPanel.act.bgColor:"azure","background-image":""};if(this.actPanel){const s=this.actPanel.act;s.bgGradient&&(i["background-image"]=s.bgGradient.getCss()),s.bgImageFile&&s.bgImageFile.length>0&&this.project.mediaBag.getElement(s.bgImageFile,!0).getFullPathPromise().then((t=>{this.$div.css({"background-image":"url('"+t+"')","background-repeat":s.tiledBgImg?"repeat":"no-repeat","background-position":s.tiledBgImg?"":"center center"})}));const n=fe.BoxBase.AC_MARGIN,r=new xe(n,n,t-2*n,e-2*n);this.actPanel.bgImage&&!s.tiledBgImg&&s.absolutePositioned&&(this.bgImageOrigin.x=(t-this.actPanel.bgImage.width)/2,this.bgImageOrigin.y=(e-this.actPanel.bgImage.height)/2,r.pos.moveTo(this.bgImageOrigin),r.dim.width-=this.bgImageOrigin.x-n,r.dim.height-=this.bgImageOrigin.y-n,r.dim.width=Math.min(r.dim.width,t),r.dim.height=Math.min(r.dim.height,e)),this.actPanel.fitTo(r,this)}this.$div.css(i)}playMedia(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=null;const n=t.file;let r=null;switch(t.type){case"PLAY_AUDIO":case"PLAY_VIDEO":case"PLAY_MIDI":case"RECORD_AUDIO":case"PLAY_RECORDED_AUDIO":if(this.audioEnabled){const i=this.activeMediaBag.getActiveMediaPlayer(t,this.project.mediaBag,this);i&&(r=()=>i.play(e))}break;case"RUN_CLIC_PACKAGE":s=new Ze("JUMP",n),t.externalParam&&(s.projectPath=t.externalParam),r=()=>this.history.processJump(s,!0);break;case"RUN_CLIC_ACTIVITY":this.history.push(),r=()=>this.load(null,null,n);break;case"RETURN":if(this.history.storedElementsCount()>0||!this.options.returnAsExit){r=()=>this.history.pop();break}case"EXIT":s=new Ze("EXIT",n),r=()=>this.history.processJump(s,!1);break;case"RUN_EXTERNAL":r=()=>this.runCmd(n);break;case"URL":n&&(r=()=>this.displayURL(n,t.level>1));break;default:gt("error",`Unknown media type: ${t.type}`)}i&&r?i.push(r):r&&r()}stopMedia(t){"number"!=typeof t&&(t=-1),this.activeMediaBag.stopAll(t)}runCmd(t){gt("warn",`Unsupported call to external command: "${t}"`)}activityFinished(t){this.closeHelpWindow(),gt("info","Activity finished"),this.timer.stop(),this.startAutoPassTimer()}startAutoPassTimer(){const t=this.project.activitySequence.getCurrentAct();null!==t&&t.delay>0&&!this.delayedTimer.isRunning()&&!this.navButtonsDisabled&&(this.delayedAction=this.actions.next,this.delayedTimer.interval=1e3*t.delay,this.delayedTimer.start())}setMsg(t){const e=this.skin?this.skin.getMsgBox():null;e&&(e.clear(),this.skin.invalidate(e).update(),e.setContent(t||bi.EMPTY_CONTENT),this.skin.invalidate(e).update(),e.playMedia(this))}playMsg(){this.skin&&this.skin.getMsgBox()&&this.skin.getMsgBox().playMedia(this)}setCounterValue(t,e){this.counterVal[t]=e,this.skin&&this.skin.counters[t]&&this.skin.counters[t].setValue(e)}getCounterValue(t){return this.counterVal[t]}setCounterEnabled(t,e){this.skin&&(this.skin.enableCounter(t,e),this.setCountDown(t,0))}incCounterValue(t){this.counterVal[t]++;const e=this.actPanel,i=this.skin?this.skin.counters[t]:null;i&&i.setValue(this.counterVal[t]),"actions"===t&&null!==e&&e.act.maxActions>0&&e.playing&&this.counterVal.actions>=e.act.maxActions&&window.setTimeout((()=>{e.finishActivity(e.solved)}),0)}setCountDown(t,e){this.skin&&this.skin.counters[t]&&this.skin.counters[t].setCountDown(e)}setWaitCursor(t){this.skin&&this.skin.setWaitCursor(t)}setProgress(t,e){this.skin&&this.skin.setProgress(t,e)}incProgress(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.skin&&this.skin.incProgress(t)}getActiveMediaPlayer(t){return this.activeMediaBag&&t?this.activeMediaBag.getActiveMediaPlayer(t,this.project.mediaBag,this):null}reportNewActivity(t){const e=this.project.activitySequence.getCurrentAct();this.reporter&&(e.tag===this.reporter.getCurrentSequenceTag()&&this.reporter.newSequence(e),t.includeInReports&&this.reporter.newActivity(t)),this.setCounterValue("actions",0),this.setCounterValue("score",0)}reportNewAction(t,e,i,s,n,r){this.reporter&&t.includeInReports&&t.reportActions&&this.reporter.newAction(e,i,s,n),r>=0&&(this.incCounterValue("actions"),this.setCounterValue("score",r))}reportEndActivity(t,e){this.reporter&&t.includeInReports&&this.reporter.endActivity(this.counterVal.score,this.counterVal.actions,e)}showHelp(t){return!!this.skin&&this.skin.showHelp(t)}displayURL(t,e){t&&(e?window.open(t,this.options.infoUrlFrame):this.end().then((()=>{window.location.href=t})))}exit(t){this.displayURL(t||this.options.exitUrl,!1)}setWindowTitle(t){gt("info",`running ${t}`)}}Object.assign(ss.prototype,{options:{maxWaitTime:12e4,infoUrlFrame:"_blank",exitUrl:null,returnAsExit:!1,audioEnabled:!0,navButtonsAlways:!1,fade:300,minSwipeX:40,maxSwipeY:100,rightToLeft:!1},id:"JC0000",$div:null,$topDiv:null,$mainContainer:null,fullScreenChecked:!1,project:null,basePath:"",zip:null,localFS:!1,actPanel:null,history:null,skin:null,defaultSkin:null,lastProjectSkin:null,activeMediaBag:null,reporter:null,actions:{},timer:null,delayedTimer:null,delayedAction:null,counterVal:{score:0,actions:0,time:0},bgImageOrigin:null,audioEnabled:!0,navButtonsDisabled:!1,navButtonsAlways:!1});var ns=ss;class rs extends xe{constructor(t,e,i){super(),this.container=e,this.parent=t,this.boxBase=i,this.shape=this,this.specialShape=!1,this.visible=!0}setParent(t){this.parent=t}getParent(){return this.parent}end(){}setContainer(t){this.container=t,this.$hostedComponent&&this.container&&this.container.$div&&(this.$hostedComponent.detach(),this.container.$div.append(this.$hostedComponent))}getContainerX(){return this.container}getContainerResolve(){let t=this;for(;null===t.container&&null!==t.parent;)t=t.parent;return t.container}invalidate(t){const e=this.getContainerResolve();e&&e.invalidate(t)}setBoxBase(t){this.boxBase=t,this.invalidate()}getBoxBaseResolve(){let t=this;for(;!t.boxBase&&t.parent;)t=t.parent;return t.boxBase||gi.DEFAULT_BOX_BASE}setShape(t){this.shape=t,this.specialShape=!0,this.invalidate(),super.setBounds(t.getBounds()),this.invalidate()}getShape(){return this.shape}contains(t){return this.shape===this?super.contains(t):this.shape.contains(t)}setBounds(t,e,i,s){if("number"==typeof t&&(t=new xe(t,e,i,s)),this.equals(t))return;const n=!this.dim.equals(t.dim);return this.specialShape?(n&&(this.shape.scaleBy(new we(t.dim.width/this.dim.width,t.dim.height/this.dim.height)),this.setShape(this.shape)),this.pos.equals(t.pos)||this.shape.moveTo(t.pos),this.setShape(this.shape)):super.setBounds(t),this.$hostedComponent&&this.setHostedComponentBounds(n),this}moveTo(t,e){"number"==typeof t&&(t=new ye(t,e)),this.setBounds(new xe(this).moveTo(t))}moveBy(t,e){this.setBounds(new xe(this).moveBy(t,e))}setSize(t,e){this.setBounds(new xe(this.pos,new we(t,e)))}hasBorder(){return this.border}setBorder(t){t||this.invalidate(),this.border=t,t&&this.invalidate()}isVisible(){return this.visible}setVisible(t){this.visible=t,this.setHostedComponentVisible(),this.invalidate()}setHostedComponentVisible(){this.$hostedComponent&&this.$hostedComponent.css("visibility",this.visible?"visible":"hidden")}isTemporaryHidden(){return this.temporaryHidden}setTemporaryHidden(t){this.temporaryHidden=t}isInactive(){return this.inactive}setInactive(t){if(this.inactive=t,this.$hostedComponent)this.setHostedComponentColors(),this.setHostedComponentVisible();else{if(this.$accessibleElement){const t=this.isInactive()&&!this.accessibleAlwaysActive;this.$accessibleElement.prop({disabled:t,tabindex:t?-1:0})}this.invalidate()}}isInverted(){return this.inverted}setInverted(t){this.inverted=t,this.$hostedComponent?this.setHostedComponentColors():this.invalidate()}isMarked(){return this.marked}setMarked(t){t||this.invalidate(),this.marked=t,this.$hostedComponent?(this.setHostedComponentColors(),this.setHostedComponentBorder()):t&&this.invalidate()}isFocused(){return this.focused}setFocused(t){t||this.invalidate(),this.focused=t,t&&this.invalidate(),this.$hostedComponent&&this.$hostedComponent.css("z-index",this.focused?20:2)}isAlternative(){return this.alternative}setAlternative(t){this.alternative=t,this.invalidate()}update(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty()||!this.isVisible()||this.isTemporaryHidden())return!1;if(e&&!this.shape.intersects(e))return!1;const i=this.getBoxBaseResolve();return i.transparent||i.dontFill||this.tmpTrans||(i.bgGradient&&!i.bgGradient.hasTransparency()||(t.fillStyle=this.inactive?i.inactiveColor:this.inverted?i.textColor:i.backColor,this.shape.fill(t,e)),i.bgGradient&&(t.fillStyle=i.bgGradient.getGradient(t,this.shape.getBounds()),this.shape.fill(t,e)),t.fillStyle="black"),this.$hostedComponent||this.updateContent(t,e),this.drawBorder(t),!0}updateContent(t,e){}drawBorder(t){if(this.border||this.marked){const e=this.getBoxBaseResolve();t.strokeStyle=e.borderColor,e[this.marked?"markerStroke":"borderStroke"].setStroke(t),this.marked&&(t.globalCompositeOperation="xor"),this.shape.stroke(t),this.marked&&(t.globalCompositeOperation="source-over"),t.strokeStyle="black",be.prototype.setStroke(t)}}getBorderBounds(){const t=new xe(this.getBounds());if(this.border||this.marked){const e=this.getBoxBaseResolve()[this.marked?"markerStroke":"borderStroke"].lineWidth;t.moveBy(-e/2,-e/2),t.dim.width+=e,t.dim.height+=e}return t}setHostedComponent(t){this.$hostedComponent&&this.$hostedComponent.detach(),this.$hostedComponent=t,this.$hostedComponent&&(this.setContainer(this.container),this.setHostedComponentColors(),this.setHostedComponentBorder(),this.setHostedComponentBounds(!0),this.setHostedComponentVisible(),this.setFocused(this.focused))}getHostedComponent(){return this.$hostedComponent}setHostedComponentColors(){if(this.$hostedComponent){const t=this.getBoxBaseResolve().getCSS(null,this.inactive,this.inverted,this.alternative);this.$hostedComponent.data("background-image")&&t["background-image"]&&(t["background-image"]=`${this.$hostedComponent.data("background-image")},${t["background-image"]}`),this.$hostedComponent.css(t)}}setHostedComponentBorder(){if(this.$hostedComponent&&(this.border||this.marked)){const t=this.getBoxBaseResolve();this.$hostedComponent.css({"border-width":`${t.get(this.marked?"markerStroke":"borderStroke").lineWidth}px`,"border-style":"solid","border-color":t.get("borderColor")})}}setHostedComponentBounds(t){if(this.$hostedComponent){const t=this.getBounds(),e=this.border||this.marked?this.getBoxBaseResolve().get(this.marked?"markerStroke":"borderStroke").lineWidth:0;this.$hostedComponent.css({position:"absolute",width:t.dim.width-2*e+"px",height:t.dim.height-2*e+"px",top:t.pos.y+"px",left:t.pos.x+"px"})}}}Object.assign(rs.prototype,{parent:null,container:null,boxBase:null,border:!1,shape:null,specialShape:!1,visible:!0,temporaryHidden:!1,tmpTrans:!1,inactive:!1,inverted:!1,alternative:!1,marked:!1,focused:!1,accessibleText:"",role:"cell",$accessibleElement:null,accessibleAlwaysActive:!1,$hostedComponent:null});var as=rs;class os extends as{constructor(t,e,i,s,n){super(t,e,i),this.clear(),"number"==typeof s&&(this.idLoc=s,this.idAss=0,this.idOrder=0),n&&this.setBounds(n)}static createCell(t,e){if(e&&e.dimension){const i=new os,n=s()('<canvas width="'+e.dimension.width+'" height="'+e.dimension.height+'"/>'),r=new xe(0,0,e.dimension.width,e.dimension.height);return i.container=new Be,i.container.$div=t,i.setContent(e),i.setBounds(r),t.append(n),e.mediaContent&&i.buildAccessibleElement(n,t),i.update(n.get(-1).getContext("2d"),r),i}}getCurrentContent(){return this.isAlternative()?this.altContent:this.content}getContent(){return this.content||this.setContent(new bi),this.content}clear(){this.content=null,this.altContent=null,this.idOrder=-1,this.setInactive(!0),this.hasHostedComponent||this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.$accessibleElement&&this.$accessibleElement.html(""),this.tmpTrans&&(this.tmpTrans=!1),this.invalidate()}isEquivalent(t,e){return null!==t&&null!==this.content&&this.content.isEquivalent(t.content,e)}isCurrentContentEquivalent(t,e){return null!==t&&null!==this.getCurrentContent()&&this.getCurrentContent().isEquivalent(t.getCurrentContent(),e)}exchangeLocation(t){const e=new ye(this.pos),i=this.idLoc;this.moveTo(t.pos),t.moveTo(e),this.idLoc=t.idLoc,t.idLoc=i}copyContent(t){this.idOrder=t.idOrder,this.idAss=t.idAss,this.content=t.content,this.altContent=t.altContent,this.content&&(this.content.style&&this.setBoxBase(this.content.style),null!==this.content.border&&t.hasBorder()!==this.content.border&&this.setBorder(this.content.border)),this.setInactive(t.isInactive()),this.setInverted(t.isInverted()),this.setAlternative(t.isAlternative()),this.setHostedComponent(t.getHostedComponent()),this.hasHostedComponent=t.hasHostedComponent,this.setHostedMediaPlayer(t.hostedMediaPlayer),this.hostedMediaPlayer&&this.hostedMediaPlayer.setVisualComponentVisible(!this.isInactive()&&this.isVisible()),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}exchangeContent(t){const e=new os(this.getParent(),this.getContainerX(),this.boxBase);e.copyContent(this),this.copyContent(t),t.copyContent(e)}setTextContent(t){t||(t=""),this.content||(this.content=new bi),this.content.text=t,this.content.mediaContent=null,this.content.img=null,this.setHostedComponent(null),this.setInactive(!1),this.checkHostedComponent(),this.setHostedMediaPlayer(null),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}setDefaultIdAss(){this.idAss=null===this.content?-1:this.content.id}isAtPlace(){return this.idOrder===this.idLoc}setContent(t,e){if(t instanceof xi){if(e<0&&(e=this.idOrder),e>=t.getNumCells())return;t.style!==this.boxBase&&this.setBoxBase(t.style),t=t.getActiveBoxContent(e)}if(this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.content=t,t){if(t.animatedGifFile&&!this.specialShape){const e=`url(${t.animatedGifFile})`,i=s()("<span/>").css({"background-image":e,"background-position":"center","background-repeat":"no-repeat"});i.data("background-image",e),null!==t.imgClip&&i.css({"background-origin":"border-box","background-position":`${-t.imgClip.pos.x}px ${-t.imgClip.pos.y}px`}),this.setHostedComponent(i)}t.style!==this.boxBase&&this.setBoxBase(t.style),t.innerHtmlText&&this.setHostedComponent(s()("<div/>").html(t.innerHtmlText)),t.hasOwnProperty("border")&&this.hasBorder()!==t.border&&this.setBorder(t.border),this.setInactive(!1),t.amp&&this.setHostedMediaPlayer(t.amp),this.checkHostedComponent(),this.checkAutoStartMedia()}else this.clear();this.invalidate(),this.$accessibleElement&&this.$accessibleElement.html(this.toString())}setAltContent(t,e){t instanceof xi&&(e<0&&(e=this.idOrder),t=t.getActiveBoxContent(e)),this.altContent=t,this.checkHostedComponent(),this.isAlternative()&&this.hostedMediaPlayer&&this.setHostedMediaPlayer(null),this.$accessibleElement&&(this.$accessibleElement.html(this.toString()),this.$accessibleElement.prop("disabled",!0))}setCurrentContent(t){this.isAlternative()?this.setAltContent(t):this.setContent(t),this.invalidate()}switchToAlt(){return!(this.isAlternative()||!this.altContent||this.altContent.isEmpty())&&(this.setHostedComponent(null),this.setHostedMediaPlayer(null),this.setAlternative(!0),this.tmpTrans=!1,this.checkHostedComponent(),this.checkAutoStartMedia(),this.$accessibleElement&&this.$accessibleElement.html(this.toString()),!0)}checkHostedComponent(){if(this.hasHostedComponent)return;const t=this.getCurrentContent(),e=this.getBoxBaseResolve();!this.isInactive()&&t&&t.innerHtmlText&&(e.getCSS()["text-align"]=t.txtAlign.h.replace("middle","center"))}checkAutoStartMedia(){const t=this.getContent();t&&t.mediaContent&&t.mediaContent.autoStart&&t.amp&&t.amp.playNow(this)}updateContent(t,e){const i=this.getCurrentContent(),s=this.getBoxBaseResolve();if(this.isInactive()||!i||this.dim.width<2||this.dim.height<2)return this._focusAccessibleElement(t),!0;if(e&&!this.intersects(e))return!1;let n=null;if(i.img&&!this.tmpTrans)try{if(i.imgClip){const e=i.imgClip.getBounds();let s=i.img;if(!i.imgClip.isRect()){const t=document.createElement("canvas");t.width=e.pos.x+e.dim.width,t.height=e.pos.y+e.dim.height;const n=t.getContext("2d");i.imgClip.clip(n),n.drawImage(i.img,0,0),s=t}t.drawImage(s,Math.max(0,e.pos.x),Math.max(0,e.pos.y),Math.min(s.width,e.dim.width),Math.min(s.height,e.dim.height),this.pos.x,this.pos.y,this.dim.width,this.dim.height)}else{let e=i.img.naturalWidth||this.dim.width,s=i.img.naturalHeight||this.dim.height,r=!1,a=1;fe.COMPRESS_IMAGES&&this.dim.width>0&&this.dim.height>0&&(e>this.dim.width||s>this.dim.height)&&(a=Math.min(this.dim.width/e,this.dim.height/s),e*=a,s*=a,r=!0);const o="left"===i.imgAlign.h?0:"right"===i.imgAlign.h?this.dim.width-e:(this.dim.width-e)/2,l="top"===i.imgAlign.v?0:"bottom"===i.imgAlign.v?this.dim.height-s:(this.dim.height-s)/2;r?t.drawImage(i.img,this.pos.x+o,this.pos.y+l,e,s):t.drawImage(i.img,this.pos.x+o,this.pos.y+l),i.avoidOverlapping&&i.text&&(n=new xe(Math.max(0,o),Math.max(0,l),Math.min(this.dim.width,e),Math.min(this.dim.height,s)))}}catch(t){gt("warn",`Unable to draw image "${i.image}": ${t.message}`)}if(i.text&&i.text.length>0){let e=this.pos.x,r=this.pos.y,a=this.dim.width,o=this.dim.height;if(n){const t=[0,n.pos.x,n.pos.x+n.dim.width,a],s=[0,n.pos.y,n.pos.y+n.dim.height,o],l=[new xe(t[0],s[0],t[3],s[1]),new xe(t[0],s[2],t[3],s[3]-s[2]),new xe(t[0],s[0],t[1],s[3]),new xe(t[2],s[0],t[3]-t[2],s[3])];let c=l[0],h=c.dim.width*c.dim.height;for(let t=1;t<l.length;t++){let e=l[t].dim.width*l[t].dim.height;if(e>h-1){if(Math.abs(e-h)<=1){let e=!1;switch(t){case 1:e="bottom"===i.txtAlign.v;break;case 2:e="left"===i.txtAlign.h;break;case 3:e="right"===i.txtAlign.h}if(!e)continue}h=e,c=l[t]}}e+=c.pos.x,r+=c.pos.y,a=c.dim.width,o=c.dim.height}const l=Math.max(5,a-2*s.textMargin),c=Math.max(5,o-2*s.textMargin),h=s.prepareText(t,i.text,l,c);t.font=s.font.cssFont(),t.textBaseline="alphabetic";const u=s.font.getHeight(),d=u*h.length;let p=r+s.textMargin+("top"===i.txtAlign.v?0:"bottom"===i.txtAlign.v?c-d:(c-d)/2)+s.font.getMetrics().ascent;for(let n=0;n<h.length;n++,p+=u){const r=e+s.textMargin+("left"===i.txtAlign.h?0:"right"===i.txtAlign.h?l-h[n].size.width:(l-h[n].size.width)/2);if(s.shadow){const e=Math.max(1,s.font.size/10);t.fillStyle=s.shadowColor,t.fillText(h[n].text,r+e,p+e)}t.fillStyle=this.isInverted()?s.backColor:this.isAlternative()?s.alternativeColor:s.textColor,t.fillText(h[n].text,r,p)}this._focusAccessibleElement(t)}return!0}_focusAccessibleElement(t){fe.CANVAS_DRAW_FOCUS&&this.$accessibleElement&&(this.shape.preparePath(t),t.drawFocusIfNeeded(this.$accessibleElement.get(-1)))}getDescription(){return this.content?this.content.getDescription():""}toString(){return("cell"!==this.role?pt(this.role):"")+(this.getCurrentContent()||"-").toString()}playMedia(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.getCurrentContent();return!(!i||!i.mediaContent)&&(gt("debug",`Playing: ${i.mediaContent.toString()}`),t.playMedia(i.mediaContent,this,e),!0)}setHostedMediaPlayer(t){const e=this.hostedMediaPlayer;this.hostedMediaPlayer=t,e&&e!==t&&e.linkTo(null),t&&t.linkTo(this)}setBounds(t,e,i,s){"number"==typeof t&&(t=new xe(t,e,i,s)),this.equals(t)||(super.setBounds(t),this.hostedMediaPlayer&&this.hostedMediaPlayer.checkVisualComponentBounds(this))}setHostedComponentBounds(t){if(this.$hostedComponent){super.setHostedComponentBounds(t);const e=this.getCurrentContent();if(t&&e&&e.animatedGifFile&&e.img){const t=e.img,i=Math.max(t.naturalWidth,this.dim.width),s=Math.max(t.naturalHeight,this.dim.height);let n=1,r="";if(e.imgClip){const t=e.imgClip.getBounds();(this.dim.width<t.dim.width||this.dim.height<t.dim.height)&&(n=Math.min(this.dim.width/t.dim.width,this.dim.height/t.dim.height),r=`${i*n}px ${s*n}px`),this.$hostedComponent.css({"background-position":`${-e.imgClip.pos.x*n}px ${-e.imgClip.pos.y*n}px`,"background-size":r})}else(this.dim.width<i||this.dim.height<s)&&(n=Math.min(this.dim.width/i,this.dim.height/s),r=`${i*n}px ${s*n}px`),this.$hostedComponent.css({"background-size":r})}}}buildAccessibleElement(t,e,i,n){this.$accessibleElement&&this.$accessibleElement.remove();const r=t.get(-1);if(r.width>0&&r.height>0){const a=Math.round(1e5*Math.random()),o=this.isInactive()&&!this.accessibleAlwaysActive;this.$accessibleElement=s()("<button/>",{tabindex:o?-1:0,id:`AE${a}`,disabled:o}).html(this.toString()).on("click",(i=>{if(i.originalEvent&&(0!==i.originalEvent.pageX||0!==i.originalEvent.pageY))return!0;gt("debug",`Click on accessible element: ${this.toString()}`);const r=s().Event(n||"click"),a=this.getBounds(),o=t.offset();return r.pageX=o.left+a.pos.x+a.dim.width/2,r.pageY=o.top+a.pos.y+a.dim.height/2,e.trigger(r),!1}));(i||t).append(this.$accessibleElement),fe.CANVAS_DRAW_FOCUS&&this.$accessibleElement.on("focus blur",(t=>{gt("debug",`${t.type} accessible element: ${this.toString()}`),this.container&&this.container.update(),this.updateContent(r.getContext("2d"),null)}))}return this.$accessibleElement}}Object.assign(os.prototype,{idOrder:-1,idLoc:-1,idAss:-1,pos0:null,content:null,altContent:null,hasHostedComponent:!1,hostedMediaPlayer:null,isBackground:!1});var ls=os;class cs{constructor(t,e){t&&(this.id=t),e&&(this.$div=e)}getDisplayValue(){let t=this.countDown>0?this.countDown-this.value:this.value;return this.displayDiffFrom&&(t-=this.displayDiffFrom.value),Math.max(0,Math.min(this.MAX_DISPLAY_VALUE,t))}refreshDisplay(){this.$div&&this.$div.html(this.enabled?(this.getDisplayValue()+1e3).toString().substring(1):"000")}setEnabled(t){this.enabled!==t&&(this.enabled=t,this.$div&&(this.refreshDisplay(),this.$div.css("opacity",this.enabled?1:.3)))}setCountDown(t){this.countDown!==(this.countDown=t)&&this.refreshDisplay()}incValue(){this.value++,this.enabled&&this.refreshDisplay()}setValue(t){this.enabled&&this.value!==(this.value=t)&&this.refreshDisplay()}}Object.assign(cs.prototype,{id:"",$div:null,value:0,countDown:0,enabled:!0,MAX_DISPLAY_VALUE:999,displayDiffFrom:null});var hs=cs;class us extends qe{constructor(t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e);let i="";if(me.loadGoogleFonts(this.cssFonts),this.$ctrlCnt=s()("<div/>",{class:"JClicCtrlCnt unselectableText",role:"navigation"}),this.$div.append(this.$ctrlCnt),i=pt("Previous activity"),this.buttons.prev=s()("<button/>",{class:"JClicBtn",title:i,"aria-label":i}).append(s()(se(this.prevIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(t=>{this.ps&&this.ps.actions.prev.processEvent(t)})),this.$ctrlCnt.append(this.buttons.prev),this.msgBox=new ls,this.msgBox.role="message",this.$msgBoxDiv=s()("<div/>",{class:"JClicMsgBox"}).on("click",(()=>(this.msgBox.playMedia(t),!1))),this.$ctrlCnt.append(this.$msgBoxDiv),i=pt("Next activity"),this.buttons.next=s()("<button/>",{class:"JClicBtn",title:i,"aria-label":i}).append(s()(se(this.nextIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(t=>{this.ps&&this.ps.actions.next.processEvent(t)})),this.$ctrlCnt.append(this.buttons.next),!1!==this.ps.options.counters&&!1!==e.counters){i=pt("Reports");const t=s()("<button/>",{class:"JClicCountCnt","aria-label":i}).on("click",(t=>{this.ps&&this.ps.actions.reports.processEvent(t)}));s().each(qe.prototype.counters,((e,n)=>{i=pt(e),this.counters[e]=new hs(e,s()("<div/>",{class:"JClicCounter",title:i,"aria-label":i}).css({"background-image":`url(${ne(this[e+"Icon"],this.counterIconWidth,this.counterIconHeight,this.counterIconFill)})`,color:this.counterIconFill}).html("000").appendTo(t))})),this.$ctrlCnt.append(t)}if(!0!==this.ps.options.info&&!0!==e.info||(i=pt("Information"),this.buttons.info=s()("<button/>",{class:"JClicBtn",title:i,"aria-label":i}).append(s()(se(this.infoIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(t=>{this.ps&&this.ps.actions.info.processEvent(t)})),this.$ctrlCnt.append(this.buttons.info)),!0!==this.ps.options.reportsBtn&&!0!==e.reportsBtn||(i=pt("Reports"),this.buttons.about=s()("<button/>",{class:"JClicBtn",title:i,"aria-label":i}).append(s()(se(this.reportsIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(t=>{this.ps&&this.ps.actions.reports.processEvent(t)})),this.$ctrlCnt.append(this.buttons.about)),document&&document.fullscreenEnabled&&(i=pt("Toggle full screen"),this.buttons.fullscreen=s()("<button/>",{class:"JClicBtn",title:i,"aria-label":i}).append(s()("<img/>",{src:ne(this.fullScreenIcon,this.iconWidth,this.iconHeight,this.iconFill)})).on("click",(()=>{this.setScreenFull(null)})),this.$ctrlCnt.append(this.buttons.fullscreen)),"function"==typeof this.ps.options.closeFn){i=pt("Close");const t=this.ps.options.closeFn;this.buttons.close=s()("<button/>",{class:"JClicBtn",title:i,"aria-label":i}).append(s()(se(this.closeIcon,this.iconWidth,this.iconHeight,this.iconFill))).on("click",(()=>{gt("info","Closing the player"),t()})),this.$ctrlCnt.append(this.buttons.close)}let n=null;s().each(this.buttons,((t,e)=>{!e||"function"==typeof e[0].focus&&"function"==typeof e[0].blur||(null===n&&(n=()=>gt("error",'"blur" and "focus" not defined for SVG objects in Explorer/Edge')),e[0].focus=e[0].blur=n)}))}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return`${super._getStyleSheets(t)}${"default"===t?this.mainCSS:"half"===t?this.mainCSSHalf:"twoThirds"===t?this.mainCSSTwoThirds:""}`}doLayout(){super.doLayout(),this.buttons.fullscreen&&(this.buttons.fullscreen.find("img").get(-1).src=ne(this[document&&document.fullscreenElement?"fullScreenExitIcon":"fullScreenIcon"],this.iconWidth,this.iconHeight,this.iconFill))}enableMainButtons(t){this.$ctrlCnt.find(".JClicBtn,.JClicCountCnt").attr("tabindex",t?"0":"-1")}}Object.assign(us.prototype,{skinId:"JClicDefaultSkin",$ctrlCnt:null,margin:18,msgBoxHeight:60,countersWidth:60,countersHeight:20,mainCSS:".ID .JClicCtrlCnt {\n margin: 0 9px 18px 9px;\n display: -webkit-flex;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.ID .JClicCountCnt {\n display: -webkit-flex;\n display: flex;\n flex-direction: column;\n}\n\n.ID .JClicMsgBox {\n height: 60px;\n flex-grow: 1;\n background-color: lightblue;\n}\n\n.ID .JClicBtn {\n cursor: pointer;\n line-height: 0;\n}\n\n.ID .JClicBtn:disabled {\n cursor: inherit;\n opacity: 0.3;\n}\n\n.ID .JClicCounter {\n width: 40px;\n height: 20px;\n padding-left: 20px;\n color: white;\n cursor: pointer;\n font-family: Roboto, Sans-serif;\n font-size: 18px;\n text-align: center;\n background-repeat: no-repeat;\n background-position: left;\n box-sizing: content-box;\n}\n",mainCSSHalf:".ID .JClicPlayerCnt {\n margin: 9px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 4px 9px 4px;\n}\n\n.ID .JClicCtrlCnt button svg, img {\n width: 18px;\n height: 18px;\n}\n\n.ID .JClicMsgBox {\n height: 30px;\n}\n\n.ID .JClicCounter {\n width: 20px;\n height: 10px;\n margin-left: -15px;\n transform: scale(0.5);\n}\n",mainCSSTwoThirds:".ID .JClicPlayerCnt {\n margin: 12px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 6px 12px 6px;\n}\n\n.ID .JClicCtrlCnt button svg, img {\n width: 24px;\n height: 24px;\n}\n\n.ID .JClicMsgBox {\n height: 40px;\n}\n\n.ID .JClicCounter {\n width: 27px;\n height: 13px;\n margin-left: -10px;\n transform: scale(0.666);\n}\n",cssFonts:["Roboto"],iconWidth:36,iconHeight:36,iconFill:"#FFFFFF",prevIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" />\n</svg>\n',nextIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" />\n</svg>\n',fullScreenIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" />\n</svg>\n',fullScreenExitIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" />\n</svg>\n',closeIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />\n</svg>\n',infoIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z" />\n</svg>\n',reportsIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z" />\n</svg>\n',counterIconWidth:18,counterIconHeight:18,counterIconFill:"#FFFFFF",timeIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />\n <path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" />\n</svg>\n',scoreIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />\n</svg>\n',actionsIcon:'<svg fill="#FFFFFF" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.49 5.48c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-3.6 13.9l1-4.4 2.1 2v6h2v-7.5l-2.1-2 .6-3c1.3 1.5 3.3 2.5 5.5 2.5v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1l-5.2 2.2v4.7h2v-3.4l1.8-.7-1.6 8.1-4.9-1-.4 2 7 1.4z" />\n</svg>\n'});var ds=qe.registerClass("default",us);class ps extends ds{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(ps.prototype,{skinId:"JClicOrangeSkin",skinCSS:".ID {background-color:#FF8B19;}"});var fs=qe.registerClass("orange",ps);class gs extends ds{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(gs.prototype,{skinId:"JClicGreenSkin",iconFill:"#20640E",counterIconFill:"#20640E",skinCSS:".ID {background-color:#4AFF19;}"});var ms=qe.registerClass("green",gs);class vs extends ds{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(vs.prototype,{skinId:"JClicBlueSkin",skinCSS:".ID {background-color:#1990FF;}"});var bs=qe.registerClass("blue",vs);class ys extends ds{constructor(t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,Object.assign({},e,{counters:!1,reportsBtn:!0})),this.$ctrlCnt.detach().prependTo(this.$div),this.$msgBoxDiv.detach().appendTo(this.$div),s()("<div/>").css({"flex-grow":1}).insertAfter(this.$ctrlCnt.children(":nth-child(2)"))}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return`${super._getStyleSheets(t)}${"default"===t?this.skinCSS:"half"===t?this.skinCSSHalf:"twoThirds"===t?this.skinCSSTwoThirds:""}`}}Object.assign(ys.prototype,{skinId:"JClicSimpleSkin",skinCSS:".ID {\n background-color: #888888;\n}\n\n.ID .JClicCtrlCnt {\n margin: 9px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 18px 18px;\n}\n\n.ID .JClicMsgBox {\n flex-grow: 0;\n margin: 0 18px 18px 18px;\n}\n",skinCSSHalf:".ID .JClicCtrlCnt {\n margin: 4px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 9px 9px;\n}\n\n.ID .JClicMsgBox {\n margin: 0 9px 9px 9px;\n}\n",skinCSSTwoThirds:".ID .JClicCtrlCnt {\n margin: 6px;\n}\n\n.ID .JClicPlayerCnt {\n margin: 0px 12px 12px;\n}\n\n.ID .JClicMsgBox {\n margin: 0 12px 12px 12px;\n}\n"});var ws=qe.registerClass("simple",ys);class As extends ds{constructor(t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,Object.assign({},e,{counters:!1,reportsBtn:!0}))}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.skinCSS:"")}}Object.assign(As.prototype,{skinId:"JClicMiniSkin",iconWidth:18,iconHeight:18,iconFill:"#080808",counterIconFill:"#080808",margin:8,skinCSS:".ID {\n background-color: #F4F4F4;\n}\n\n.ID .JClicPlayerCnt {\n margin: 4px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 2px 4px 2px;\n}\n\n.ID .JClicMsgBox {\n height: 25px;\n}\n",mainCSSHalf:"",mainCSSTwoThirds:""});var xs=qe.registerClass("mini",As);class Cs extends qe{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this.msgBox=new ls,this.msgBox.role="message"}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return super._getStyleSheets(t)+("default"===t?this.mainCSS:"")}}Object.assign(Cs.prototype,{skinId:"JClicEmptySkin",mainCSS:".ID .JClicPlayerCnt {margin:0;}"});var ks=qe.registerClass("empty",Cs);class Ss extends qe{constructor(t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e),this.$mainPanel=s()("<div/>",{class:"JClicCustomMainPanel"}),this.$gridPanel=s()("<div/>",{class:"JClicGridPanel"});for(let t=0;t<9;t++)this.$gridPanel.append(s()("<div/>",{class:`JClicCell JClicCell${t+1}`}));this.$mainPanel.append(this.$gridPanel),this.$playerCnt.detach().addClass("JClicPlayerCell").appendTo(this.$mainPanel),this.$div.prepend(this.$mainPanel),e.buttons&&Object.keys(e.buttons.button).forEach((e=>{const i="about"===e?"reports":e,n=pt(this.msgKeys[i]||i);this.buttons[i]=s()("<button/>",{class:`JClicBtn JClicTransform Btn-${i}`,title:n,"aria-label":n,disabled:void 0===this.msgKeys[i]}).on("click",(e=>{t.actions[i]&&t.actions[i].processEvent(e)})),this.$mainPanel.append(this.buttons[i])})),e.rectangle.messages&&(this.msgBox=new ls,this.msgBox.role="message",this.$msgBoxDiv=s()("<div/>",{class:"JClicMsgBox"}).on("click",(()=>(this.msgBox.playMedia(t),!1))),this.$mainPanel.append(this.$msgBoxDiv)),!1!==this.ps.options.counters&&e.counters&&e.counters.counter&&s().each(qe.prototype.counters,((t,i)=>{if(e.counters.counter[t]){const e=pt(t);this.counters[t]=new hs(t,s()("<div/>",{class:`JClicCounter JClicTransform Counter-${t}`,title:e,"aria-label":e}).html("000").appendTo(this.$mainPanel))}})),e.progressAnimation&&(this.$progressAnimation=s()("<div/>",{class:"JClicProgressAnimation JClicTransform"}),this.$mainPanel.append(this.$progressAnimation))}enableMainButtons(t){this.$mainPanel.find(".JClicBtn").attr("tabindex",t?"0":"-1")}_computeStyleSheets(){const t=this.options.dimension.preferredSize.width,e=this.options.dimension.preferredSize.height;this.twoThirdsMedia={width:t,height:e},this.halfMedia={width:Math.round(2*t/3),height:Math.round(2*e/3)};const i=this.options.rectangle.frame.left,s=i+this.options.rectangle.player.left,n=i+this.options.slicer.left,r=i+this.options.slicer.right,a=s+this.options.rectangle.player.width,o=i+this.options.rectangle.frame.width,l=this.options.rectangle.frame.top,c=l+this.options.rectangle.player.top,h=l+this.options.slicer.top,u=l+this.options.slicer.bottom,d=c+this.options.rectangle.player.height,p=l+this.options.rectangle.frame.height,f=this.ps.project.mediaBag.getElement(this.options.image,!0),g=f.data&&f.data.src?f.data.src:"",m=f.data?ae(f.data,new xe(i,l,n-i,h-l)):"",v=f.data?ae(f.data,new xe(n-i,l,r-n,h-l)):"",b=f.data?ae(f.data,new xe(r,l,o-r,h-l)):"",y=f.data?ae(f.data,new xe(i,h-l,n-i,u-h)):"",w=f.data?ae(f.data,new xe(r-i,h-l,o-r,u-h)):"",A=f.data?ae(f.data,new xe(i,u-l,n-i,p-u)):"",x=f.data?ae(f.data,new xe(n-i,u-l,r-n,p-u)):"",C=f.data?ae(f.data,new xe(r,u-l,o-r,p-u)):"";let k=`\n.ID .JClicCustomMainPanel {flex-grow:1;position:relative;background-color: ${Rt(this.options.color.fill.value)};}\n.ID .JClicGridPanel {position:absolute;width:100%;height:100%;display:grid;grid-template-columns:${n-i}px 1fr ${o-r}px;grid-template-rows:${h-l}px 1fr ${p-u}px;}\n.ID .JClicCell {background-repeat:no-repeat;background-size:contain;}\n.ID .JClicPlayerCell {position:absolute;top:${c-l}px;right:${o-a}px;bottom:${p-d}px;left:${s-i}px;}\n.ID .JClicCell1 {background-image:url(${m});}\n.ID .JClicCell2 {background-image:url(${v});background-repeat:repeat-x;}\n.ID .JClicCell3 {background-image:url(${b});}\n.ID .JClicCell4 {background-image:url(${y});background-repeat:repeat-y;}\n.ID .JClicCell5 {}\n.ID .JClicCell6 {background-image:url(${w});background-repeat:repeat-y;}\n.ID .JClicCell7 {background-image:url(${A});}\n.ID .JClicCell8 {background-image:url(${x});background-repeat:repeat-x;}\n.ID .JClicCell9 {background-image:url(${C});}`,S=`\n.ID .JClicGridPanel {grid-template-columns:${Math.round((n-i)/2)}px 1fr ${Math.round((o-r)/2)}px;grid-template-rows:${Math.round((h-l)/2)}px 1fr ${Math.round((p-u)/2)}px;}\n.ID .JClicPlayerCell {top:${Math.round((c-l)/2)}px;right:${Math.round((o-a)/2)}px;bottom:${Math.round((p-d)/2)}px;left:${Math.round((s-i)/2)}px;}\n.ID .JClicTransform {transform: scale(0.5);}`,E=`\n.ID .JClicGridPanel {grid-template-columns:${Math.round(2*(n-i)/3)}px 1fr ${Math.round(2*(o-r)/3)}px;grid-template-rows:${Math.round(2*(h-l)/3)}px 1fr ${Math.round(2*(p-u)/3)}px;}\n.ID .JClicPlayerCell {top:${Math.round(2*(c-l)/3)}px;right:${Math.round(2*(o-a)/3)}px;bottom:${Math.round(2*(p-d)/3)}px;left:${Math.round(2*(s-i)/3)}px;}\n.ID .JClicTransform {transform: scale(0.666);}`;if(this.options.buttons){const t=this.options.buttons;let e=30,i=30,s={};t.settings&&(t.settings.dimension&&(e=t.settings.dimension.width||e,i=t.settings.dimension.height||i),t.settings.offset&&Object.assign(s,t.settings.offset)),Object.keys(this.options.buttons.button).forEach((r=>{const a=t.button[r],l="about"===r?"reports":r;let c=e,u=i,d=s;a.settings&&(a.settings.dimension&&(c=a.settings.dimension.width||c,u=a.settings.dimension.height||u),a.settings.offset&&(d=Object.assign({},s,a.settings.offset)));const f=a.point.pos.left,m=f<n?`left:${f}`:"right:"+(o-f-c),v=f<n?`left:${Math.round(f/2-c/4)}`:`right:${Math.round((o-f-c)/2-c/4)}`,b=f<n?`left:${Math.round(2*f/3-c/6)}`:`right:${Math.round(2*(o-f-c)/3-c/6)}`,y=a.point.pos.top,w=y<h?`top:${y}`:"bottom:"+(p-y-u),A=y<h?`top:${Math.round(y/2-u/4)}`:`bottom:${Math.round((p-y-u)/2-u/4)}`,x=y<h?`top:${Math.round(2*y/3-u/6)}`:`bottom:${Math.round(2*(p-y-u)/3-u/6)}`,C=a.point.source.left,T=a.point.source.top;k+=`.ID .Btn-${l} {position:absolute;${m}px;${w}px;width:${c}px;height:${u}px;background:url(${g}) !important;background-position:-${C}px -${T}px !important;}\n`,S+=`.ID .Btn-${l} {${v}px;${A}px;}\n`,E+=`.ID .Btn-${l} {${b}px;${x}px;}\n`,d.active&&(k+=`.ID .Btn-${l}:active {background-position:-${C+d.active.right}px -${T+d.active.down}px !important;}\n`),d.over&&(k+=`.ID .Btn-${l}:hover {background-position:-${C+d.over.right}px -${T+d.over.down}px !important;}\n`),d.disabled&&(k+=`.ID .Btn-${l}:disabled {background-position:-${C+d.disabled.right}px -${T+d.disabled.down}px !important;}\n`)}))}if(this.options.counters&&this.options.counters.settings){const t=this.options.counters;let e=35,i=20;t.settings.dimension&&t.settings.dimension.counter&&(e=t.settings.dimension.counter.width||e,i=t.settings.dimension.counter.height||i);let s=37,r=14;t.settings.dimension&&t.settings.dimension.label&&(s=t.settings.dimension.label.width||s,r=t.settings.dimension.label.height||r);let a="black";t.style&&t.style.color&&t.style.color.foreground&&(a=Rt(t.style.color.foreground.value||a));let l=r-4,c="Roboto";t.style&&t.style.font&&t.style.font.label&&(l=Math.max(8,t.style.font.label.size||l),c=`${t.style.font.label.family||"Roboto"},Roboto,sans-serif`),k+=`.ID .JClicCounter {font-size:${i-2}px;color:${a}}\n`,Object.keys(this.options.counters.counter).forEach((a=>{const u=t.counter[a];let d=e,f=i;const g=u.point.counter.left,m=u.point.label.left||g-Math.round((s-e)/2),v=g<n?`left:${g}`:"right:"+(o-g-d),b=g<n?`left:${Math.round(g/2-d/4)}`:`right:${Math.round((o-g-d)/2-d/4)}`,y=g<n?`left:${Math.round(2*g/3-d/6)}`:`right:${Math.round(2*(o-g-d)/3-d/6)}`,w=u.point.counter.top,A=u.point.label.top||w-r,x=w<h?`top:${w}`:"bottom:"+(p-w-f),C=w<h?`top:${Math.round(w/2-f/4)}`:`bottom:${Math.round((p-w-f)/2-f/4)}`,T=w<h?`top:${Math.round(2*w/3-f/6)}`:`bottom:${Math.round(2*(p-w-f)/3-f/6)}`;k+=`.ID .Counter-${a} {position:absolute;${v}px;${x}px;width:${d}px;height:${f}px;line-height:${f}px;}\n`,k+=`.ID .Counter-${a}:before {content:"${pt(a)}";font-size:${l}px;font-family:${c};width:${s}px;height:${r}px;line-height:${r}px;position:absolute;top:${A-w}px;left:${m-g}px;}`,S+=`.ID .Counter-${a} {${b}px;${C}px;}\n`,E+=`.ID .Counter-${a} {${y}px;${T}px;}\n`}))}if(this.options.progressAnimation){const t=this.options.progressAnimation;let e=30,i=30;t.dimension&&(e=t.dimension.width||e,i=t.dimension.height||i);const s=t.point.pos.left,r=s<n?`left:${s}`:"right:"+(o-s-e),a=s<n?`left:${Math.round(s/2-e/4)}`:`right:${Math.round((o-s-e)/2-e/4)}`,l=s<n?`left:${Math.round(2*s/3-e/6)}`:`right:${Math.round(2*(o-s-e)/3-e/6)}`,c=t.point.pos.top,u=c<h?`top:${c}`:"bottom:"+(p-c-i),d=c<h?`top:${Math.round(c/2-i/4)}`:`bottom:${Math.round((p-c-i)/2-i/4)}`,f=c<h?`top:${Math.round(2*c/3-i/6)}`:`bottom:${Math.round(2*(p-c-i)/3-i/6)}`,m=t.point.source.left,v=t.point.source.top;if(k+=`.ID .JClicProgressAnimation {position:absolute;${r}px;${u}px;width:${e}px;height:${i}px;background:url(${g});background-position:-${m}px -${v}px;}\n`,S+=`.ID .JClicProgressAnimation {${a}px;${d}px;}\n`,E+=`.ID .JClicProgressAnimation {${l}px;${f}px;}\n`,t.frames&&t.direction){const s=(t.step||e)*("right"===t.direction?1:"left"===t.direction?-1:0),n=(t.step||i)*("down"===t.direction?1:"up"===t.direction?-1:0);k+=`\n@keyframes anim {100% {background-position:${-1*(m+s*t.frames)}px ${-1*(v+n*t.frames)}px;}}\n.ID .JClicProgressAnimation {animation: anim ${t.frames*t.delay}ms steps(${t.frames}) infinite;}`}}if(this.options.rectangle.messages){const t=this.options.rectangle.messages,e=i+t.left,s=o-t.width-t.left-i,n=t.top<h?`top:${t.top}`:"bottom:"+(p-t.height-t.top),r=t.top<h?`top:${Math.round(t.top/2)}`:`bottom:${Math.round((p-t.height-t.top)/2)}`,a=t.top<h?`top:${Math.round(2*t.top/3)}`:`bottom:${Math.round(2*(p-t.height-t.top)/3)}`;k+=`.ID .JClicMsgBox {position:absolute;left:${e}px;right:${s}px;height:${t.height}px;${n}px;}`,S+=`.ID .JClicMsgBox {left:${Math.round(e/2)}px;right:${Math.round(s/2)}px;height:${Math.round(t.height/2)}px;${r}px;}`,E+=`.ID .JClicMsgBox {left:${Math.round(2*e/3)}px;right:${Math.round(2*s/3)}px;height:${Math.round(2*t.height/3)}px;${a}px;}`}this.cssVariants={default:this.mainCSS+k,half:S,twoThirds:E}}_getStyleSheets(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return this.cssVariants||this._computeStyleSheets(),`${super._getStyleSheets(t)}${this.cssVariants[t]||""}`}setWaitCursor(t){super.setWaitCursor(t),this.$progressAnimation&&this.$progressAnimation.css("animation-play-state",this.waitCursorCount>0?"running":"paused")}}Object.assign(Ss.prototype,{skinId:"JClicCustomSkin",image:null,mainCSS:".ID .JClicPlayerCnt {margin:0;}.ID .JClicBtn:focus {outline:0;}.ID .JClicCounter {font-family:Roboto,sans-serif;text-align:center;}",cssVariants:null,msgKeys:{next:"Next activity",prev:"Previous activity",info:"Information",help:"Help",reports:"Reports",audio:"Audio on/off",reset:"Reset activity"},$progressAnimation:null});var Es=qe.registerClass("custom",Ss);class Ts extends wi{constructor(t,e){super(t,e)}buildShapes(){const t=1/this.nCols,e=1/this.nRows;for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.shapeData[i*this.nCols+s]=new xe(new ye(s*t,i*e),new we(t,e));this.initiated=!0}}Object.assign(Ts.prototype,{rectangularShapes:!0});var Bs=wi.registerClass("@Rectangular",Ts);var Is=wi.registerClass("@Holes",class extends wi{constructor(t,e){super(1,1),this.customShapes=!0,this.nCols=t,this.nRows=e,this.showEnclosure=!0}buildShapes(){this.nCells>0&&(this.initiated=!0)}getEnclosingShapeData(){return this.showEnclosure?this.enclosing||super.getEnclosingShapeData():null}});var Ps=wi.registerClass("@JigSaw",class extends wi{constructor(t,e){super(t,e)}buildShapes(){let t=[],e=[];for(let i=0;i<=this.nRows;i++)t[i]=[],e[i]=[];for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)t[i][s]=0===i?0:1+(this.randomLines?Math.round(9*Math.random()):i+s)%2,e[i][s]=0===s?0:1+(this.randomLines?Math.round(9*Math.random()):s+i+1)%2,s===this.nCols-1&&(e[i][s+1]=0),i===this.nRows-1&&(t[i+1][s]=0);const i=1/this.nCols,s=1/this.nRows;for(let n=0;n<this.nRows;n++)for(let r=0;r<this.nCols;r++){const a=i*r,o=s*n,l=new ke([new Se("M",[a,o])]);this.hLine(l,t[n][r],a+0,o+0,i,s,!1),this.vLine(l,e[n][r+1],a+i,o+0,i,s,!1),this.hLine(l,t[n+1][r],a+i,o+s,i,s,!0),this.vLine(l,e[n][r],a+0,o+s,i,s,!0),l.addStroke(new Se("X")),l.calcEnclosingRect(),this.shapeData[n*this.nCols+r]=l}this.initiated=!0}hLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Se("L",[i+n*o,s]));else{const e=i+(n-n*this.baseWidthFactor)/2*o,a=n*this.baseWidthFactor*o;t.addStroke(new Se("L",[e,s]));const c=r*this.toothHeightFactor*l;t.addStroke(new Se("L",[e,s+c])),t.addStroke(new Se("L",[e+a,s+c])),t.addStroke(new Se("L",[e+a,s])),t.addStroke(new Se("L",[i+n*o,s]))}}vLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Se("L",[i,s+r*o]));else{const e=s+(r-r*this.baseWidthFactor)/2*o,a=r*this.baseWidthFactor*o;t.addStroke(new Se("L",[i,e]));const c=n*this.toothHeightFactor*l;t.addStroke(new Se("L",[i+c,e])),t.addStroke(new Se("L",[i+c,e+a])),t.addStroke(new Se("L",[i,e+a])),t.addStroke(new Se("L",[i,s+r*o]))}}});var _s=wi.registerClass("@TriangularJigSaw",class extends Ps{constructor(t,e){super(t,e)}hLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Se("L",[i+n*o,s]));else{const e=i+(n-n*this.baseWidthFactor)/2*o,a=n*this.baseWidthFactor*o;t.addStroke(new Se("L",[e,s]));const c=r*this.toothHeightFactor*l;t.addStroke(new Se("L",[e+a/2,s+c])),t.addStroke(new Se("L",[e+a,s])),t.addStroke(new Se("L",[i+n*o,s]))}}vLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Se("L",[i,s+r*o]));else{const e=s+(r-r*this.baseWidthFactor)/2*o,a=r*this.baseWidthFactor*o;t.addStroke(new Se("L",[i,e]));const c=n*this.toothHeightFactor*l;t.addStroke(new Se("L",[i+c,e+a/2])),t.addStroke(new Se("L",[i,e+a])),t.addStroke(new Se("L",[i,s+r*o]))}}});class Ds extends Ps{constructor(t,e){super(t,e)}hLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Se("L",[i+n*o,s]));else{const e=i+(n-n*this.baseWidthFactor)/2*o,a=n*(this.baseWidthFactor/12)*o;t.addStroke(new Se("L",[e,s]));const c=r*this.toothHeightFactor*l/8;t.addStroke(new Se("B",[e+4*a,s,e+6*a,s-c,e+4*a,s-3*c])),t.addStroke(new Se("B",[e+2*a,s-5*c,e+10*a,s-5*c,e+8*a,s-3*c])),t.addStroke(new Se("B",[e+6*a,s-1*c,e+8*a,s,e+12*a,s])),t.addStroke(new Se("L",[i+n*o,s]))}}vLine(t,e,i,s,n,r,a){const o=a?-1:1,l=1===e?1:-1;if(0===e)t.addStroke(new Se("L",[i,s+r*o]));else{const e=s+(r-r*this.baseWidthFactor)/2*o,a=r*this.baseWidthFactor/12*o;t.addStroke(new Se("L",[i,e]));const c=n*this.toothHeightFactor*l/8;t.addStroke(new Se("B",[i,e+4*a,i-c,e+6*a,i-3*c,e+4*a])),t.addStroke(new Se("B",[i-5*c,e+2*a,i-5*c,e+10*a,i-3*c,e+8*a])),t.addStroke(new Se("B",[i-1*c,e+6*a,i,e+8*a,i,e+12*a])),t.addStroke(new Se("L",[i,s+r*o]))}}}Object.assign(Ds.prototype,{baseWidthFactor:3/4,toothHeightFactor:.6});var Rs=wi.registerClass("@ClassicJigSaw",Ds);const Os=["+","-",String.fromCharCode(215),":"],Ms=-12345,Ns=Intl&&Intl.NumberFormat().format(1.1).indexOf(",")>0;class $s extends ki{constructor(){super(),this.className="@arith.Arith",this.numericContent=!0,this.opA=new $s.Operator,this.opB=new $s.Operator}static DecFormat(t,e,i){let s=t.toFixed(e);if(i){let t=s.indexOf(".");for(t<0&&(t=s.length);t<i;t++)s=`0${s}`}return s}setProperties(t){return t.children().each(((t,e)=>{const i=s()(e);let n="";switch(e.nodeName){case"operand":switch(i.attr("id")){case"A":this.opA.setProperties(i);break;case"B":this.opB.setProperties(i)}break;case"operations":this.use_add=mt(i.attr("plus")),this.use_subst=mt(i.attr("minus")),this.use_mult=mt(i.attr("multiply")),this.use_div=mt(i.attr("divide"));break;case"unknown":this.exp_abx=mt(i.attr("result")),this.exp_xbc=mt(i.attr("first")),this.exp_axc=mt(i.attr("last")),this.exp_axbc=mt(i.attr("operand")),this.exp_caxb=mt(i.attr("inverse"));break;case"result":n=i.attr("from"),this.resultLimInf=bt("x"===n?0:n,this.resultLimInf),n=i.attr("to"),this.resultLimSup=bt("x"===n?0:n,this.resultLimSup),this.resultCarry=mt(i.attr("notCarry"),this.resultCarry),this.resultNoDup=!mt(i.attr("duplicates"),!this.resultNoDup);let t=i.attr("order");this.resultOrder="ascending"===t?"SORTASC":"descending"===t?"SORTDESC":"NOSORT",t=i.attr("condition"),this.opCond="firstBig"===t?"AGB":"lastBig"===t?"BGA":"INDIF"}})),this}getAttributes(){return $t(this,["className","opA","opB","use_add","use_subst","use_mult","use_div","exp_abx|true","exp_axc|false","exp_xbc|false","exp_axbc|false","exp_caxb|false","resultLimInf|0","resultLimSup|9999","resultCarry|false","resultNoDup|false","resultOrder|NOSORT","opCond|INDIF"])}setAttributes(t){return Lt(this,t,["className",{key:"opA",fn:$s.Operator},{key:"opB",fn:$s.Operator},"use_add","use_subst","use_mult","use_div","exp_abx","exp_axc","exp_xbc","exp_axbc","exp_caxb","resultLimInf","resultLimSup","resultCarry","resultNoDup","resultOrder","opCond"])}genNum(t,e,i,s){let n=!1;t.c=e.numDec;const r=0===t.c?1:1===t.c?10:100;let a=e.limSup;s!==Ms&&s<a&&(a=s);let o=e.limInf;if(i!==Ms&&i>o&&(o=i),e.fromList>0&&(t.vf=e.lst[Math.floor(Math.random()*e.fromList)],n=!0),!n){const i=Math.floor(100*Math.random());e.wZero&&i<=10?(t.vf=0,n=!0):e.wOne&&i>10&&i<=20?(t.vf=1,n=!0):e.wMinusOne&&i>20&&i<=30&&(t.vf=-1,n=!0)}if(!n){if(o>a){const t=o;o=a,a=t}let e=Math.floor(a-o+1);e<0&&(e=1);let i=(Math.floor(Math.random()*e)+o)*r;r>1&&(i+=Math.floor(Math.random()*r)),t.vf=i/r}return!0}genOp(t){let e,i,s,n,r,a,o,l;const c=[],h=this.resultLimInf,u=this.resultLimSup;let d=0;this.use_add&&(c[d++]="SUM"),this.use_subst&&(c[d++]="REST"),this.use_mult&&(c[d++]="MULT"),this.use_div&&(c[d++]="DIV");switch(c[Math.floor(Math.random()*d)]){case"SUM":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,u),i=t.numA.vf<h?h-Math.floor(t.numA.vf):this.RES,s=u-Math.floor(t.numA.vf),this.opCond){case"AGB":(s===this.RES||s>t.numA.vf)&&(s=Math.floor(t.numA.vf));break;case"BGA":(i===this.RES||i<t.numA.vf)&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),t.numR.vf=t.numA.vf+t.numB.vf,t.numR.vf>=h&&t.numR.vf<=u)break}if(t.numR.c=t.numA.c>t.numB.c?t.numA.c:t.numB.c,t.op=0,this.resultCarry&&t.numA.vf>0&&t.numB.vf>0){for(n=2===t.numR.c?100:1===t.numR.c?10:1,o=$s.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),l=$s.DecFormat(Math.floor(t.numB.vf*n+.5),0,10).split(""),e=0;e<10&&("0"===o[e]&&"0"===l[e]);e++);for(;e<10;e++)if(r=parseInt(o[e]),a=parseInt(l[e]),!(r+a<10)){for(;r+a>9;)r>a?r=r>0?Math.floor(Math.random()*r):0:a=a>0?Math.floor(Math.random()*a):0;o[e]=r.toFixed(0),l[e]=a.toFixed(0)}t.numA.vf=parseInt(o.join(""))/n,t.numB.vf=parseInt(l.join(""))/n,t.numR.vf=Math.floor(t.numA.vf*n+t.numB.vf*n+.5)/n}break;case"REST":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,h,this.RES),i=t.numA.vf>u?Math.floor(t.numA.vf-u):this.RES,s=Math.floor(t.numA.vf-h),this.opCond){case"AGB":(s===this.RES||s>t.numA.vf)&&(s=Math.floor(t.numA.vf));break;case"BGA":(i===this.RES||i<t.numA.vf)&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),t.numR.vf=t.numA.vf-t.numB.vf,t.numR.vf>=h&&t.numR.vf<=u)break}if(t.numR.c=t.numA.c>t.numB.c?t.numA.c:t.numB.c,t.op=1,this.resultCarry&&t.numA.vf>0&&t.numB.vf>0&&t.numA.vf>=t.numB.vf){for(n=2===t.numR.c?100:1===t.numR.c?10:1,o=$s.DecFormat(Math.floor(t.numA.vf*n+.5),0,10).split(""),l=$s.DecFormat(Math.floor(t.numB.vf*n+.5),0,10).split(""),e=0;e<10&&"0"===l[e];e++);for(;e<10;e++)r=parseInt(o[e]),a=parseInt(l[e]),r>=a||(a=r>0?Math.floor(Math.random()*r):0,l[e]=a.toFixed(0));t.numA.vf=parseInt(o.join(""))/n,t.numB.vf=parseInt(l.join(""))/n,t.numR.vf=Math.floor(t.numA.vf*n-t.numB.vf*n+.5)/n}break;case"MULT":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,this.RES),i=this.opB.limInf,s=this.opB.limSup,this.opCond){case"AGB":s>t.numA.vf&&(s=Math.floor(t.numA.vf));break;case"BGA":i<t.numA.vf&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),t.numR.vf=t.numA.vf*t.numB.vf,t.numR.vf>=h&&t.numR.vf<=u)break}t.numR.c=t.numA.c+t.numB.c,t.op=2;break;case"DIV":for(e=0;e<60;e++){switch(this.genNum(t.numA,this.opA,this.RES,this.RES),i=this.opB.limInf,s=this.opB.limSup,this.opCond){case"AGB":s>t.numA.vf&&(s=Math.floor(t.numA.vf));break;case"BGA":i<t.numA.vf&&(i=Math.floor(t.numA.vf))}if(this.genNum(t.numB,this.opB,i,s),0!==t.numB.vf&&Math.abs(t.numA.vf)>=Math.abs(t.numB.vf)&&(t.numR.vf=t.numA.vf/t.numB.vf)>=h&&t.numR.vf<=u)break}0===t.numB.vf&&(t.numB.vf=1),t.numR.vf=t.numA.vf/t.numB.vf,e=t.numA.c-t.numB.c,n=Math.pow(10,e),t.numA.vf*=n,t.numR.vf*=n,t.numR.vf=Math.floor(t.numR.vf),t.numA.vf=t.numR.vf*t.numB.vf,t.numA.vf/=n,t.numR.vf/=n,t.numR.c=e>0?e:0,t.op=3;break;default:return!1}return!0}process(t){let e,i,s,n,r,a,o=t.nRows,l=t.nCols,c=t.content,h=t.useIds,u=[],d=[],p=this.exp_caxb,f="",g="",m="",v="",b=[],y=[],w=[],A=l,x=o,C=o*l,k=null;if(o<=0||l<=0||null===c||c.length<1||null===c[0])return!1;if(C<2)return!1;if(r=0,this.exp_abx&&(d[r++]="ABX"),this.exp_axc&&(d[r++]="AXC"),this.exp_xbc&&(d[r++]="XBC"),this.exp_axbc&&(d[r++]="AXBC"),0===r)return!1;for(e=0;e<C;e++){for(n=new $s.Operation,i=0;i<60&&(this.genOp(n),this.resultNoDup);i++){for(s=0;s<e&&n.numR.vf!==u[s].numR.vf;s++);if(s===e)break}u[e]=n}if(0!==this.resultOrder)for(e=C-1;e>0;e--)for(i=0;i<e;i++)("SORTASC"===this.resultOrder&&u[i].numR.vf>u[i+1].numR.vf||"SORTDESC"===this.resultOrder&&u[i].numR.vf<u[i+1].numR.vf)&&(n=u[i],u[i]=u[i+1],u[i+1]=n);for(e=0;e<C;e++)switch(a=d[Math.floor(Math.random()*r)],f=$s.DecFormat(u[e].numA.vf,u[0].numA.c),g=$s.DecFormat(u[e].numB.vf,u[0].numB.c),m=$s.DecFormat(u[e].numR.vf,u[0].numR.c),v=Os[u[e].op],w[e]=p?`${m} = ${f} ${v} ${g}`:`${f} ${v} ${g} = ${m}`,a){case"AXC":y[e]=g,b[e]=p?`${m} = ${f} ${v} ?`:`${f} ${v} ? = ${m}`;break;case"XBC":y[e]=f,b[e]=p?`${m} = ? ${v} ${g}`:`? ${v} ${g} = ${m}`;break;case"AXBC":y[e]=v,b[e]=p?`${m} = ${f} ? ${g}`:`${f} ? ${g} = ${m}`;break;default:y[e]=m,b[e]=p?`? = ${f} ${v} ${g}`:`${f} ${v} ${g} =`}if(h){k=[];let S=[];for(s=0,e=0;e<C;e++){for(i=0;i<s&&y[e]!==S[i];i++);i===s?(S[s]=y[e],k[e]=s,s++):k[e]=i}for(y=[],e=0;e<s;e++)y[e]=S[e];if(x*A!==s){let E=!1;switch(s){case 6:x=E?2:3,A=E?3:2;break;case 8:x=E?2:4,A=E?4:2;break;case 9:x=3,A=3;break;case 10:x=E?2:5,A=E?5:2;break;case 12:x=E?3:4,A=E?4:3;break;case 14:x=E?2:7,A=E?7:2;break;case 15:x=E?3:5,A=E?3:5;break;case 16:x=4,A=4;break;case 18:x=E?6:3,A=E?3:6;break;case 20:x=E?4:5,A=E?5:4;break;default:x=E?1:s,A=E?s:1}}}if(Ns){function T(t){return t.replace(/\./g,",")}b=b.map(T),y=y.map(T),w=w.map(T)}return c[0].setTextContent(b,l,o),null!==k&&c[0].setIds(k),c.length>1&&null!==c[1]&&(c[1].setTextContent(y,A,x),c[1].getShaper().reset(A,x)),c.length>2&&null!==c[2]&&c[2].setTextContent(w,l,o),!0}}Object.assign($s.prototype,{opA:null,opB:null,use_add:!0,use_subst:!1,use_mult:!1,use_div:!1,exp_abx:!0,exp_axc:!1,exp_xbc:!1,exp_axbc:!1,exp_caxb:!1,resultLimInf:0,resultLimSup:9999,resultCarry:!1,resultNoDup:!1,resultOrder:"NOSORT",opCond:"INDIF"}),$s.Operator=class{constructor(){}setProperties(t){return ce(t.get(0).attributes,((e,i)=>{switch(e){case"decimals":this.numDec=Number(i);break;case"values":this.lst=i.split(" ").map((t=>Number(t))),this.fromList=this.lst.length;break;case"from":this.limInf=Number("x"===i?0:i);break;case"to":this.limSup=Number("x"===i?0:i)}t.children().each(((t,e)=>{const i=s()(e);if("include"===e.nodeName)this.wZero=mt(i.attr("zero")),this.wOne=mt(i.attr("one")),this.wMinusOne=mt(i.attr("minusOne"))}))})),this}getAttributes(){return $t(this,["limInf","limSup","numDec|0","wZero|false","wOne|false","wMinusOne|false","fromList|0","lst"])}setAttributes(t){return Lt(this,t,["limInf","limSup","numDec","wZero","wOne","wMinusOne","fromList","lst"])}},Object.assign($s.Operator.prototype,{limInf:0,limSup:10,numDec:0,wZero:!1,wOne:!1,wMinusOne:!1,fromList:0,lst:[]}),$s.Num=class{constructor(){this.vf=0,this.c=0}format(){return $s.DecFormat(this.vf,this.c)}},$s.Operation=class{constructor(){this.numA=new $s.Num,this.numB=new $s.Num,this.numR=new $s.Num,this.op=0}};var Vs=ki.registerClass("@arith.Arith",$s);class qs extends Mi{constructor(t){super(t)}getMinNumActions(){return this.document?this.document.numTargets:0}}Object.assign(qs.prototype,{ev:null,checkButtonText:null,prevScreen:!1,prevScreenText:null,prevScreenStyle:null,prevScreenMaxTime:-1});class Ls extends Ni{constructor(t,e,i){super(t,e,i),this.targets=[]}setDocContent(t,e){t.empty().css(e.style.default.css).css({display:"flex","flex-direction":"column"});const i=s()("<div/>").css({"flex-grow":1,overflow:"auto"}),n=s()("<div/>",{class:"JClicTextDocument"}).css({padding:4}).css(e.style.default.css);let r=null;const a=[];return e.p.forEach((t=>{const i=s()("<p/>").css({margin:0});let o=!0;if(t.style?(r=e.style[t.style].css,i.css(r)):r=null,t.Alignment){const e=Number(t.Alignment);i.css({"text-align":1===e?"center":2===e?"right":"left"})}t.elements.forEach((t=>{let n;switch(t.objectType){case"text":const o=s()("<span/>").html(t.text).text();(this.spanText?Ut(o):[{text:o,sep:""}]).forEach((r=>{let{text:a,sep:o}=r,l={...this.act.document.style.default.css};t?.attr?.style&&(l={...l,...e.style[t.attr.style].css}),t?.attr?.css&&(l={...l,...t.attr.css});(this.spanChars?[...a]:[a]).forEach((e=>{t.attr?(n=s()("<span/>").html(e).css(l),n.initialCSS=l,i.append(this.$createSpanElement(n))):this.spanText?(n=s()("<span/>").html(e),i.append(this.$createSpanElement(n))):i.append(e)})),""!==o&&i.append(o)}));break;case"cell":n=s()("<span/>");const l=ls.createCell(n.css({position:"relative"}),t);n.css({display:"inline-block","vertical-align":"middle"}),t.mediaContent&&n.on("click",(t=>(t.preventDefault(),this.ps.stopMedia(1),l.playMedia(this.ps),!1))),i.append(n);break;case"target":if(n=s()("<span/>"),this.showingPrevScreen){n.text(t.text),i.append(n);break}const c=t;let h=null;if("no_info"!==c.infoMode&&c.popupContent){h=s()("<span/>").css({position:"absolute","padding-top":"2pt",display:"none"});const t=ls.createCell(h,c.popupContent);c.popupContent.mediaContent&&h.on("click",(e=>(e.preventDefault(),this.ps.stopMedia(1),t?t.playMedia(this.ps):c.popupContent.mediaContent&&this.ps.playMedia(c.popupContent.mediaContent),!1))),c.$popup=h,a.push({p:i,span:h,box:t})}n=this.$createTargetElement(c,n),c.num=this.targets.length,c.pos=c.num,this.targets.push(c),n&&(n.css(e.style.default.css),r&&n.css(r),this.targetsMarked?c.attr?(c.attr.style||(c.attr.style="target"),n.css(e.style[c.attr.style].css),c.attr.css&&n.css(c.attr.css)):e.style.target&&n.css(e.style.target.css):c.targetStatus="HIDDEN",null!==h&&"onDemand"===c.infoMode&&n.keydown((t=>{t.key===c.popupKey?(t.preventDefault(),this.showPopup(h,c.popupMaxTime,c.popupDelay)):"Escape"===t.key&&(t.preventDefault(),this.showPopup(null))}))),h&&n?c.isList?i.append(n).append(h):i.append(h).append(n):n&&i.append(n),c.$p=i}o=!1})),o&&i.html(" "),n.append(i)})),t.append(i.append(n)),this.act.checkButtonText&&!this.showingPrevScreen&&(this.$checkButton=s()("<button/>",{class:"StockBtn"}).html(this.act.checkButtonText).css({width:"100%","flex-shrink":0}).on("click",(()=>this.evaluatePanel())),t.append(this.$checkButton)),a.forEach((t=>t.span.css({"margin-top":t.p.css("font-size")}))),this.act.ev&&this.act.ev.init(this.act.project.settings.locales),t}$createTargetElement(t,e){return e.text(t.text),t.$span=e,e}$createSpanElement(t){return t}initActivity(){this.act.prevScreen?this.preInitActivity():this.startActivity()}startActivity(){super.initActivity(),this.setAndPlayMsg("initial","start"),this.setDocContent(this.$div,this.act.document),this.playing=!0}preInitActivity(){if(!this.act.prevScreen)return;const t=()=>(this.showingPrevScreen=!1,this.$div.unbind("click"),this.prevScreenTimer&&(window.clearTimeout(this.prevScreenTimer),this.prevScreenTimer=null),this.startActivity(),!0);if(this.showingPrevScreen=!0,this.$div.empty(),this.act.prevScreenText){this.act.prevScreenStyle||(this.act.prevScreenStyle=new gi),this.$div.css(this.act.prevScreenStyle.getCSS()).css("overflow","auto");const t=s()("<div/>",{class:"JClicTextDocument"}).css({padding:4}).css(this.act.prevScreenStyle.getCSS()).append(this.act.prevScreenText);this.$div.append(t)}else this.setDocContent(this.$div,this.act.document);this.enableCounters(!0,!1,!1),this.ps.setCounterValue("time",0),this.ps.setMsg(this.act.messages.previous),this.act.prevScreenMaxTime>0&&(this.ps.setCountDown("time",this.act.prevScreenMaxTime),this.prevScreenTimer=window.setTimeout(t,1e3*this.act.prevScreenMaxTime)),this.$div.on("click",t),this.ps.playMsg()}evaluatePanel(){return this.finishActivity(!0),!0}finishActivity(t){this.$checkButton&&this.$checkButton.prop("disabled",!0),this.targets.forEach((t=>{t.$comboList&&t.$comboList.attr("disabled",!0)})),this.showPopup(null),super.finishActivity(t)}processEvent(t){return this.playing}showPopup(t,e,i){this.$currentPopup&&(this.$currentPopup.css({display:"none"}),this.$currentPopup=null,this.currentPopupTimer&&(window.clearTimeout(this.currentPopupTimer),this.currentPopupTimer=0)),this.popupWaitTimer&&(window.clearTimeout(this.popupWaitTimer),this.popupWaitTimer=0),i?this.popupWaitTimer=window.setTimeout((()=>{this.showPopup(t,e)}),1e3*i):t&&(t.css({display:""}),t.trigger("click"),this.$currentPopup=t,e&&(this.currentPopupTimer=window.setTimeout((()=>{t.css({display:"none"}),this.$currentPopup===t&&(this.$currentPopup=null,this.currentPopupTimer=0)}),1e3*e)))}}Object.assign(Ls.prototype,{targets:null,targetsMarked:!0,$checkButton:null,prevScreenTimer:null,$currentPopup:null,currentPopupTimer:0,popupWaitTimer:0,spanText:!1,spanChars:!1}),qs.Panel=Ls;var js=qs;class Fs extends qs{constructor(t){super(t)}needsKeyboard(){return!0}}Object.assign(Fs.prototype,{autoJump:!1,forceOkToAdvance:!1});class zs extends Ls{constructor(t,e,i){super(t,e,i)}$createTargetElement(t,e){e.addClass("JClicTextTarget");const i=`target${("000"+(this.targets.length-1)).slice(-3)}`;return t.isList&&t.options&&t.options.length>0?(e=s()("<select/>",{id:i,name:i}),""!==t.options[0].trim()&&s()("<option selected/>",{value:"",text:""}).appendTo(e),t.options.forEach((t=>s()("<option/>",{value:t,text:t}).appendTo(e))),t.$comboList=e.bind("focus change",(e=>{e.textTarget=t,this.processEvent(e)}))):(t.currentText=t.iniText?t.iniText:Et(t.iniChar,t.numIniChars),t.$span=e.text(t.currentText).attr({contenteditable:"true",id:i,autocomplete:"off",spellcheck:"false"}).bind("focus input blur",(e=>{e.textTarget=t,this.processEvent(e)})).bind("keydown keyup",(e=>{13===e.keyCode&&(e.preventDefault(),"keydown"===e.type&&(e.textTarget=t,e.type="blur",this.processEvent(e)))}))),e}evaluatePanel(){let t=0;const e=this.targets.length;return this.targets.forEach((e=>{const i=this.act.ev.evalText(e.readCurrentText(),e.answers),s=this.act.ev.isOk(i);e.targetStatus=s?"SOLVED":"WITH_ERROR",s&&t++,this.markTarget(e,i),this.ps.reportNewAction(this.act,"WRITE",e.currentText,e.getAnswers(),s,t)})),t===e?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}checkTarget(t,e,i){const s=this.act.ev.evalText(t.currentText,t.answers),n=this.act.ev.isOk(s);if(t.targetStatus=n?"SOLVED":"WITH_ERROR",e)return n;this.markTarget(t,s);const r=this.countSolvedTargets(!1,!1);if(t.currentText.length>0&&this.ps.reportNewAction(this.act,"WRITE",t.currentText,t.getAnswers(),n,r),n&&r===this.targets.length)return this.finishActivity(!0),n;if(t.currentText.length>0&&this.playEvent(n?"actionOk":"actionError"),i&&0!==i){let e=t.num+i;e>=this.targets.length?e=0:e<0&&(e=this.targets.length-1);const s=this.targets[e];s.$span?(s.$span.focus(),pe(s.$span.get(-1),0,0)):s.$comboList&&s.$comboList.focus()}return n}countSolvedTargets(t,e){return this.targets.reduce(((i,s)=>(t&&(s.readCurrentText(),this.checkTarget(s,!e)),"SOLVED"===s.targetStatus?++i:i)),0)}markTarget(t,e){if(t.$comboList||this.act.ev.isOk(e))t.checkColors();else if(t.$span){const i=t.currentText,n=[];let r=-1,a=-1,o=0;for(;o<e.length&&o<i.length;o++)e[o]!==r&&(n[++a]="",r=e[o]),n[a]+=i.charAt(o);o<i.length&&(n[a]+=i.substring(o)),t.$span.empty(),r=e[0],n.forEach((e=>{s()("<span/>").text(e).css(t.doc.style[0===r?"target":"targetError"].css).appendTo(t.$span),r^=1}))}t.flagModified=!1}activityReady(){super.activityReady(),s()(".JClicTextTarget").css("white-space","normal"),this.targets.length>0&&this.targets[0].$span&&this.targets[0].$span.focus()}finishActivity(t){return this.targets.forEach((t=>{t.$span?t.$span.removeAttr("contenteditable").blur():t.$comboList&&t.$comboList.attr("disabled","true").blur()})),super.finishActivity(t)}processEvent(t){if(!super.processEvent(t))return!1;const e=t.textTarget;let i=null,s=0;switch(t.type){case"focus":e&&(e.$span&&e.$span.children().length>0?(i=e.$span,s=Math.min(e.currentText.length,ue(i.get(-1))),i.empty(),i.text(e.currentText),pe(i.get(-1),s,s),e.flagModified=!0):e.$comboList&&e.$comboList.css(e.doc.style.target.css),e.$popup&&("always"===e.infoMode||"onError"===e.infoMode&&"WITH_ERROR"===e.targetStatus)?this.showPopup(e.$popup,e.popupMaxTime,e.popupDelay):this.showPopup(null));break;case"blur":e.flagModified&&!this.$checkButton&&this.checkTarget(e,!1,1);break;case"input":if(e&&e.$span){i=e.$span;let t=i.html();if(/(<br>|\n|\r)/.test(t))return t=t.replace(/(<br>|\n|\r)/g,""),i.html(t),e.currentText=i.text(),!this.$checkButton&&this.checkTarget(e,!1,1);if(t=i.text(),t!==e.currentText){e.flagModified=!0;const n=t.length-e.currentText.length;if(n>0){if(t.indexOf(e.iniChar)>=0){s=ue(i.get(-1));for(let i=0;i<n;i++){const i=t.indexOf(e.iniChar);if(i<0)break;t=t.substring(0,i)+t.substring(i+1),i<s&&s--}i.text(t),pe(i.get(-1),s,s)}t.length>e.maxLenResp&&(s=ue(i.get(-1)),t=t.substring(0,e.maxLenResp),s=Math.min(s,t.length),i.text(t),pe(i.get(-1),s,s))}else""===t&&(t=e.iniChar,i.text(t),pe(i.get(-1),0,0));e.currentText=t}}break;case"change":if(e&&e.$comboList)return e.currentText=e.$comboList.val(),e.flagModified=!0,!this.$checkButton&&this.checkTarget(e,!1,1)}return!0}}Object.assign(zs.prototype,{locked:!0}),Fs.Panel=zs;var Us=$i.registerClass("@text.FillInBlanks",Fs);const Hs="source-over";class Ws{constructor(t,e){this.parent=t,this.ctx=e.get(-1).getContext("2d",{willReadFrequently:!0}),this.dim=new we(this.ctx.canvas.width,this.ctx.canvas.height),this.origin=new ye,this.dest=new ye,this.relativePos=new ye}moveBy(t,e){this.moveTo(ye(this.dest.x+t,this.dest.y+e))}moveTo(t,e){if(!this.active||!e&&this.dest.equals(t))return;this.bgRect&&(this.bgImg?this.ctx.putImageData(this.bgImg,0,0,this.bgRect.pos.x,this.bgRect.pos.y,this.bgRect.dim.width,this.bgRect.dim.height):this.parent&&this.parent.updateContent()),this.dest.moveTo(t);const i=new ye(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y);this.bgRect=new xe(i,this.bx?this.bx.dim:new we);const s=new ye(t.x-this.relativePos.x,t.y-this.relativePos.y);this.bgRect.add(new xe(s,this.bx?this.bx.dim:new we)),this.bgRect.grow(10,10),null!==this.bx?(this.bx.moveTo(new ye(t.x-this.relativePos.x,t.y-this.relativePos.y)),this.bx.setTemporaryHidden(!1),this.bx.update(this.ctx,null),this.bx.setTemporaryHidden(!0)):(this.drawLine(),this.linePainted=!0)}begin(t,e){this.active&&this.end(),this.origin.moveTo(t),this.dest.moveTo(t),this.linePainted=!1,this.active=!0,e&&(this.bx=e,this.relativePos.moveTo(t.x-e.pos.x,t.y-e.pos.y),this.bx.setFocused(!0),this.bx.setTemporaryHidden(!0),this.linePainted=!1,this.parent.invalidate().update());try{this.bgImg=this.ctx.getImageData(0,0,this.dim.width,this.dim.height)}catch(t){this.bgImg=null}this.bgRect=null,e&&this.moveTo(t,!0)}end(){this.active&&(this.active=!1,this.linePainted=!1,this.bgRect=null,this.bgImg=null,this.bx&&(this.bx.setFocused(!1),this.bx.moveTo(this.origin.x-this.relativePos.x,this.origin.y-this.relativePos.y),this.bx.setTemporaryHidden(!1),this.bx=null,this.relativePos.moveTo(0,0)),this.ctx.clearRect(0,0,this.dim.width,this.dim.height),this.parent.invalidate().update())}drawLine(){if(this.compositeOp!==Hs?(this.ctx.strokeStyle=this.xorColor,this.ctx.globalCompositeOperation=this.compositeOp):this.ctx.strokeStyle=this.lineColor,this.ctx.lineWidth=this.lineWidth,this.ctx.beginPath(),this.ctx.moveTo(this.origin.x,this.origin.y),this.ctx.lineTo(this.dest.x,this.dest.y),this.ctx.stroke(),this.arrow){const t=Math.atan2(this.origin.x-this.dest.x,this.dest.x-this.origin.x),e=new ye(this.dest.x-this.arrowLength*Math.cos(t+this.arrowAngle),this.dest.y+this.arrowLength*Math.sin(t+this.arrowAngle));this.ctx.beginPath(),this.ctx.moveTo(this.dest.x,this.dest.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),e.moveTo(this.dest.x-this.arrowLength*Math.cos(t-this.arrowAngle),this.dest.y+this.arrowLength*Math.sin(t-this.arrowAngle)),this.ctx.beginPath(),this.ctx.moveTo(this.dest.x,this.dest.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}this.compositeOp!==Hs&&(this.ctx.globalCompositeOperation=Hs)}}Object.assign(Ws.prototype,{bgImg:null,bgRect:null,origin:null,dest:null,arrow:!1,active:!1,linePainted:!1,arrowLength:10,arrowAngle:Math.PI/6,lineColor:"black",xorColor:"white",compositeOp:"difference",DEFAULT_COMPOSITE_OP:Hs,relativePos:null,bx:null,ctx:null,dim:null,parent:null,lineWidth:1.5});var Gs=Ws;class Js extends qs{constructor(t){super(t)}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}Object.assign(Js.prototype,{amongParagraphs:!1,bc:null});class Ks extends Ls{constructor(t,e,i){super(t,e,i)}buildVisualComponents(){this.act.document.style.target.css.cursor="pointer",super.buildVisualComponents()}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.act.dragCells||(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0,"pointer-events":"none"}),this.$div.append(this.$canvas),this.bc=new Gs(this,this.$canvas),this.bc.compositeOp=this.bc.DEFAULT_COMPOSITE_OP,this.invalidate().update())}$createTargetElement(t,e){super.$createTargetElement(t,e);const i=`target${("000"+(this.targets.length-1)).slice(-3)}`;return e.addClass("JClicTextTarget").bind("click",(e=>{e.textTarget=t,e.idLabel=i,this.processEvent(e)})),e}swapTargets(t,e){const i=t.$span,n=e.$span,r=s()("<span/>");r.insertAfter(n),n.detach(),n.insertAfter(i),i.detach(),i.insertAfter(r),r.remove();const a=t.pos,o=t.$p;t.pos=e.pos,t.$p=e.$p,e.pos=a,e.$p=o}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents()}startActivity(){if(super.startActivity(),!this.showingPrevScreen){if("orderWords"!==this.act.type||this.act.amongParagraphs)this.shuffleTargets(this.targets,this.act.shuffles);else{const t=[];let e=null,i=[];this.targets.forEach((s=>{null!==e&&e.$p!==s.$p&&(t.push(i),i=[]),i.push(s),e=s})),i.length>0&&t.push(i),t.forEach((t=>this.shuffleTargets(t,this.act.shuffles)))}this.playing=!0}this.setBounds(this)}shuffleTargets(t,e){const i=t.length;if(i>1){let s=100;for(let n=0;n<e;n++){const e=Math.floor(Math.random()*i),r=Math.floor(Math.random()*i);e!==r?this.swapTargets(t[e],t[r]):--s&&n++}}}setCurrentTarget(t){const e=this.act.document.getFullStyle("target").css;this.currentTarget&&this.currentTarget.$span&&this.currentTarget.$span.css(e),t&&t.$span&&t.$span.css({color:e["background-color"],"background-color":e.color}),this.currentTarget=t}countSolvedTargets(){return this.targets.filter((t=>{let{num:e,pos:i}=t;return e===i})).length}evaluatePanel(){this.bc&&this.bc.active&&this.bc.end(),this.setCurrentTarget(null);let t=0;return this.targets.forEach((e=>{const i=e.num===e.pos;e.targetStatus=i?"SOLVED":"WITH_ERROR",i&&t++,e.checkColors(),this.ps.reportNewAction(this.act,"PLACE",e.text,e.pos,i,t)})),t===this.targets.length?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}finishActivity(t){return s()(".JClicTextTarget").css("cursor","pointer"),super.finishActivity(t)}processEvent(t){if(!super.processEvent(t))return!1;const e=t.textTarget;let i=null;if(this.bc&&this.playing&&!this.showingPrevScreen){if("touchend"===t.type)i=this.bc.active?this.bc.dest.clone():new ye;else{const e=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,s=t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;i=new ye(e-this.$div.offset().left,s-this.$div.offset().top)}switch(t.type){case"click":if(e&&e!==this.currentTarget)if(this.currentTarget){if(this.bc&&this.bc.active&&this.bc.end(),this.swapTargets(e,this.currentTarget),this.setCurrentTarget(null),!this.$checkButton){const t=this.countSolvedTargets(),i=e.pos===e.num;this.ps.reportNewAction(this.act,"PLACE",e.text,e.pos,i,t),i&&t===this.targets.length?this.finishActivity(!0):this.playEvent(i?"actionOk":"actionError")}}else this.setCurrentTarget(e),this.bc.begin(i),this.playEvent("click");break;case"mousemove":this.bc.moveTo(i)}return t.preventDefault(),!0}}}Object.assign(Ks.prototype,{currentTarget:null,bc:null,events:["click","mousemove"]}),Js.Panel=Ks;var Zs=$i.registerClass("@text.Order",Js);class Ys extends qs{constructor(t){super(t)}}Ys.Panel=class extends Ls{constructor(t,e,i){super(t,e,i)}$createTargetElement(t,e){return null}startActivity(){super.startActivity(),this.$div.find(".JClicTextDocument").attr("contenteditable","true").attr("spellcheck","false")}evaluatePanel(){const t=this.$div.find(".JClicTextDocument").text().trim(),e=this.act.document.getRawText(),i=this.act.ev.checkText(t,e);return this.ps.reportNewAction(this.act,"WRITE",t,e,i,this.targets.length),i?(this.finishActivity(!0),!0):(this.playEvent("finishedError"),!1)}finishActivity(t){return this.$div.find(".JClicTextDocument").attr("contenteditable","false"),super.finishActivity(t)}};var Qs=$i.registerClass("@text.Complete",Ys);class Xs extends qs{constructor(t){super(t)}}class tn extends Ls{constructor(t,e,i){super(t,e,i),this.spanText=!0,this.spanChars="identifyChars"===t.type,this.spansChecked=new Set}$createTargetElement(t,e){super.$createTargetElement(t,e);const i=`target${("000"+(this.targets.length-1)).slice(-3)}`;return e.bind("click",(e=>{e.textTarget=t,e.idLabel=i,this.processEvent(e)})),e}$createSpanElement(t){return t.bind("click",(e=>{e.$spanElement=t,this.processEvent(e)})),t}initActivity(){super.initActivity(this),this.$div.find(".JClicTextDocument > p").css("cursor","pointer"),this.$div.find(".JClicTextDocument > span").css("cursor","pointer"),this.spansChecked.forEach((t=>t.css(t.initialCSS||this.act.document.style.default.css))),this.spansChecked.clear(),this.playing=!0}countSolvedTargets(){return this.targets.filter((t=>{let{targetStatus:e}=t;return"SOLVED"===e})).length}evaluatePanel(){let t=0;return this.targets.forEach((e=>{const i="SOLVED"===e.targetStatus;i&&t++,e.checkColors(),this.ps.reportNewAction(this.act,"SELECT",e.text,e.pos,i,t)})),t===this.targets.length&&0===this.spansChecked.size?(this.finishActivity(!0),!0):(this.spansChecked.forEach((t=>t.css(this.act.document.style.targetError.css))),this.playEvent("finishedError"),!1)}finishActivity(t){return this.$div.find(".JClicTextDocument > p").css("cursor","pointer"),super.finishActivity(t)}processEvent(t){if(!super.processEvent(t)||t.timeStamp===this.lastTimeStamp)return!1;t.timeStamp&&(this.lastTimeStamp=t.timeStamp);const e=t.textTarget,i=t.$spanElement;if("click"===t.type){let s,n,r=!1;if(e?("SOLVED"===e.targetStatus?e.targetStatus="HIDDEN":(e.targetStatus="SOLVED",r=!0),s=e.text,n=e.pos,e.checkColors()):(i?(i.checked=!i.checked,i.checked?(this.spansChecked.add(i),i.css(this.act.document.style.target.css)):(this.spansChecked.delete(i),i.css(i.initialCSS||this.act.document.style.default.css)),s=i.text()):s="unknown",n=0),!this.$checkButton){const t=this.countSolvedTargets();this.ps.reportNewAction(this.act,"SELECT",s,n,r,t),r&&0===this.spansChecked.size&&t===this.targets.length?this.finishActivity(!0):this.playEvent(r?"actionOk":"actionError")}t.preventDefault()}return!0}}Object.assign(tn.prototype,{targetsMarked:!1,lastTimeStamp:0,spansChecked:new Set}),Xs.Panel=tn;var en=$i.registerClass("@text.Identify",Xs);class sn extends as{constructor(t,e,i){super(t,e,i),this.preferredBounds=new xe,this.cells=[]}static layoutSingle(t,e,i){if(!e)return t;let s=e.getPreferredSize(),n=e.getMinimumSize(),r=t;r.width-=2*i,r.height-=2*i,(n.width>r.width||n.height>r.height)&&(r=n);let a=s.width>r.width?r.width/s.width:1;return a*s.height>r.height&&(a=r.height/s.height),s=e.getScaledSize(a),e.setBounds(i,i,s.width,s.height),s.width+=2*i,s.height+=2*i,s}static layoutDouble(t,e,i,s,n){let r=!1,a=1,o=1;switch(s){case"AB":case"BA":a=2,o=1,r=!0;break;case"AUB":case"BUA":a=1,o=2,r=!1}const l=e.getBounds(),c=i.getBounds();let h=e.getPreferredSize(),u=i.getPreferredSize();const d=new we(r?h.width+u.width:Math.max(h.width,u.width),r?Math.max(h.height,u.height):h.height+u.height),p=e.getMinimumSize(),f=i.getMinimumSize(),g=new we(r?p.width+f.width:Math.max(p.width,f.width),r?Math.max(p.height,f.height):p.height+f.height),m=t;m.width-=(1+a)*n,m.height-=(1+o)*n,(g.width>m.width||g.height>m.height)&&m.setDimension(g);let v=d.width>m.width?m.width/d.width:1;v*d.height>m.height&&(v=m.height/d.height),h=e.getScaledSize(v),u=i.getScaledSize(v);let b=u.width>h.width?(u.width-h.width)/2:0,y=h.width>u.width?(h.width-u.width)/2:0,w=u.height>h.height?(u.height-h.height)/2:0,A=h.height>u.height?(h.height-u.height)/2:0;switch(s){case"AB":e.setBounds(n,n+w,h.width,h.height),i.setBounds(2*n+h.width,n+A,u.width,u.height);break;case"BA":i.setBounds(n,n+A,u.width,u.height),e.setBounds(2*n+u.width,n+w,h.width,h.height);break;case"AUB":e.setBounds(n+b,n,h.width,h.height),i.setBounds(n+y,2*n+h.height,u.width,u.height);break;case"BUA":i.setBounds(n+y,n,u.width,u.height),e.setBounds(n+b,2*n+u.height,h.width,h.height);break;default:e.setBounds(Math.round(n+v*l.pos.x),Math.round(n+v*l.pos.y),h.width,h.height),i.setBounds(Math.round(n+v*c.pos.x),Math.round(n+v*c.pos.y),h.width,h.height)}const x=new xe(e.getBounds());return x.add(i.getBounds()),d.width=x.dim.width+2*n,d.height=x.dim.height+2*n,d}getPreferredSize(){return this.preferredBounds.dim}getMinimumSize(){const t=this.getPreferredSize();return new we(Math.max(fe.MIN_CELL_SIZE,t.width),Math.max(fe.MIN_CELL_SIZE,t.height))}getScaledSize(t){const e=this.getPreferredSize();return new we(Math.round(t*e.width),Math.round(t*e.height))}addBox(t){this.cells.push(t),t.setParent(this),1===this.cells.length?xe.prototype.setBounds.call(this,t):this.add(t),this.preferredBounds.setBounds(this.getBounds())}boxIndex(t){return null===t?-1:this.cells.indexOf(t)}getBox(t){return t<0||t>=this.cells.length?null:this.cells[t]}getBackgroundBox(){return this.backgroundBox}setBackgroundBox(t){this.backgroundBox=t,null!==t&&(t.setParent(this),t.isBackground=!0),xe.prototype.add.call(this,t),this.preferredBounds.setBounds(this.getBounds())}recalcSize(){let t=this.backgroundBox?new xe(this.backgroundBox.pos,this.backgroundBox.dim):null;this.cells.forEach((e=>{t?t.add(e):t=new xe(e.pos,e.dim)})),t||(t=new xe(this.pos.x,this.pos.y,0,0)),this.preferredBounds.setRect(t),this.x=t.pos.x,this.y=t.pos.y,this.dim.width=t.dim.width,this.dim.height=t.dim.height}getNumCells(){return this.cells.length}setCellAttr(t,e){this.cells.forEach((i=>i[t]=e)),this.backgroundBox&&(this.backgroundBox[t]=e)}setBorder(t){this.cells.forEach((e=>e.setBorder(t)))}setVisible(t){this.cells.forEach((e=>e.setVisible(t)))}setAlternative(t){super.setAlternative(t),this.cells.forEach((e=>e.setAlternative(t)))}setBounds(t,e,i,s){if("number"==typeof t&&(t=new xe(t,e,i,s)),t.getSurface()>0&&!t.equals(this)){const e=t.dim.width/this.dim.width,i=t.dim.height/this.dim.height,s=t.pos.x-this.pos.x,n=t.pos.y-this.pos.y;if(this.cells.forEach((t=>{const r=new ye(t.pos.x-this.pos.x,t.pos.y-this.pos.y);t.setBounds(s+this.pos.x+e*r.x,n+this.pos.y+i*r.y,e*t.dim.width,i*t.dim.height),t.pos0=null})),null!==this.backgroundBox){const t=this.backgroundBox,r=new ye(t.pos.x-this.pos.x,t.pos.y-this.pos.y);t.setBounds(s+this.pos.x+e*r.x,n+this.pos.y+i*r.y,e*t.dim.width,i*t.dim.height)}}super.setBounds(t)}update(t,e){return!(this.isEmpty()||!this.isVisible()||this.isTemporaryHidden())&&(!(e&&!this.intersects(e))&&(null!==this.backgroundBox&&this.backgroundBox.update(t,e),this.cells.forEach((i=>{i.isMarked()||i.update(t,e)})),this.cells.forEach((i=>{i.isMarked()&&i.update(t,e)})),!0))}findBox(t){let e=null;for(let i=this.cells.length-1;i>=0;i--){const s=this.getBox(i);if(s.isVisible()&&s.contains(t)){e=s;break}}return e}countInactiveCells(){return this.cells.reduce(((t,e)=>e.isInactive()?++t:t),0)}}Object.assign(sn.prototype,{cells:[],preferredBounds:new xe,backgroundBox:null});var nn=sn;class rn extends nn{constructor(t,e,i){super(t,e,i)}addActiveBox(t){return t.idLoc=this.cells.length,t.idOrder=t.idLoc,this.addBox(t)}getActiveBox(t){return this.getBox(t)}getBackgroundActiveBox(){return this.getBackgroundBox()}setContent(t,e,i,s,n){i||(i=0),s||(s=0),n||(n=this.cells.length);for(let r=0;r<n;r++){const n=this.getActiveBox(s+r);n.setContent(t,i+r),n.setAlternative(!1),e&&n.setAltContent(e,i+r)}if(null!==t.backgroundContent&&null!==this.getBackgroundActiveBox()){const e=this.getBackgroundActiveBox();e.setContent(t.backgroundContent),t.style!==e.boxBase&&e.setBoxBase(t.style)}}findActiveBox(t){return this.findBox(t)}clearAllBoxes(){this.cells.forEach((t=>t.clear()))}clearAll(){this.clearAllBoxes(),null!==this.backgroundBox&&this.getBackgroundActiveBox().clear()}countCellsAtPlace(){return this.cells.reduce(((t,e)=>e.isAtPlace()?++t:t),0)}getActiveBoxWithIdLoc(t){return this.cells.find((e=>e.idLoc===t))||null}cellIsAtEquivalentPlace(t,e){return t.isAtPlace()||t.isEquivalent(this.getActiveBoxWithIdLoc(t.idOrder),e)}countCellsAtEquivalentPlace(t){return this.cells.reduce(((e,i)=>this.cellIsAtEquivalentPlace(i,t)?++e:e),0)}countCellsWithIdAss(t){return this.cells.reduce(((e,i)=>i.idAss===t?++e:e),0)}setDefaultIdAss(){this.cells.map((t=>t.setDefaultIdAss()))}shuffleCells(t,e){let i=this.cells.length;if(i>=2){const s=[],n=[],r=new ye;for(let t=0;t<i;t++){const e=this.getActiveBox(t);s[t]=new ye(e.pos),n[t]=e.idLoc}for(let e=0;e<t;e++){const t=Math.floor(Math.random()*i),e=Math.floor(Math.random()*i);if(t!==e){r.moveTo(s[t]),s[t].moveTo(s[e]),s[e].moveTo(r);const i=n[t];n[t]=n[e],n[e]=i}}for(let t=0;t<i;t++){const i=this.getActiveBox(t),r=s[t].x,a=s[t].y;i.moveTo(new ye(r,a)),e&&this.fitCellsInArea([i]),i.idLoc=n[t]}}}fitCellsInArea(t){const e=this.pos.x+this.dim.width,i=this.pos.y+this.dim.height;t.forEach((t=>{t.pos0||(t.pos0=new ye(t.pos));const s=Math.min(Math.max(t.pos.x,this.pos.x),e-t.dim.width),n=Math.min(Math.max(t.pos.y,this.pos.y),i-t.dim.height);s===t.pos.x&&n===t.pos.y||t.moveTo(new ye(s,n))}))}swapCellPositions(t,e,i){const s=new ye(e.pos),n=e.pos0,r=e.idLoc;e.moveTo(t.pos0||t.pos),e.pos0=t.pos0,e.idLoc=t.idLoc,t.moveTo(n||s),t.pos0=n,t.idLoc=r,i&&this.fitCellsInArea([t,e])}resetIds(){this.cells.forEach(((t,e)=>{t&&(t.idOrder=e,t.idAss=e,t.idLoc=e)}))}getNextItem(t,e){const i=-12345;e||(e=i);let s=t+1;for(;s<this.cells.length;s++){const t=this.cells[s];if(!t)break;if(e!==i){if(e===t.idAss)break}else if(t.idAss>=0)break}return s}buildAccessibleElements(t,e,i){return this.$accessibleDiv=""!==this.accessibleText?s()("<div/>",{"aria-label":this.accessibleText,tabindex:0}):null,t.append(this.$accessibleDiv),this.cells.map((t=>t)).sort(((t,e)=>t.idLoc>e.idLoc?1:-1)).forEach((s=>s.buildAccessibleElement(t,e,this.$accessibleDiv,i))),this.$accessibleDiv}}Object.assign(rn.prototype,{$accessibleDiv:null});var an=rn;class on extends an{constructor(t,e,i,s,n,r,a,o){super(t,e,i),this.nCols=o.nCols,this.nRows=o.nRows;const l=new xe(new ye(s,n),new we(Math.round(r/this.nCols)*this.nCols,Math.round(a/this.nRows)*this.nRows));for(let t=0;t<o.nCells;t++){const s=o.getShape(t,l),n=new ls(this,e,i,t,s.getBounds());o.rectangularShapes||n.setShape(s),this.addActiveBox(n)}if(o.hasRemainder){const t=o.getRemainderShape(l),s=new ls(this,e,i,0,t.getBounds());s.setShape(t),this.setBackgroundBox(s)}}static createEmptyGrid(t,e,i,s,n,r,a){const o=n?new on(t,e,a||n.style,i,s,n.getTotalWidth(),n.getTotalHeight(),r||n.getShaper()):null;return o&&o.setBorder(n.border),o}getMinimumSize(){return new we(fe.MIN_CELL_SIZE*this.nCols,fe.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new we(Ht(t*this.preferredBounds.dim.width,this.nCols),Ht(t*this.preferredBounds.dim.height,this.nRows))}getCoord(t){return new ye(t.idLoc%this.nCols,Math.floor(t.idLoc/this.nCols))}getCoordDist(t,e){const i=this.getCoord(t),s=this.getCoord(e);return new ye(s.x-i.x,s.y-i.y)}}Object.assign(on.prototype,{nCols:1,nRows:1});var ln=on;class cn extends Mi{constructor(t){super(t)}setProperties(t){super.setProperties(t),this.abc.primary.avoidAllIdsNull(this.abc.answers.getNumCells())}getMinNumActions(){return this.invAss?this.abc.answers.getNumCells():this.abc.primary.getNumCells()-this.nonAssignedCells}hasRandom(){return!0}needsKeyboard(){return!0}helpSolutionAllowed(){return!0}}Object.assign(cn.prototype,{nonAssignedCells:0,useIdAss:!0});class hn extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,e=this.act.abc.answers,i=this.act.abc.solvedPrimary;if(t&&e){if(this.act.invAss&&(this.invAssCheck=Array(e.getNumCells()).fill(!1)),t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=s()("<span/>").css({"background-image":"url("+t.animatedGifFile+")","background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),i&&i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const s=[t,e];i&&s.push(i),this.act.acp.generateContent(t.nch,t.ncw,s,!1)}this.bgA=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,t);let r=e.w;"AUB"!==this.act.boxGridPos&&"BUA"!==this.act.boxGridPos||(r=t.getTotalWidth()),this.bgB=new ln(null,this,e.style,this.act.margin,this.act.margin,r,e.h,new Bs(1,1)),this.$form=s()("<form/>",{id:"form1"}),this.$form[0].addEventListener("submit",(t=>(t.preventDefault(),this.playing&&this.setCurrentCell(this.currentCell),!1))),this.$textField=s()("<input/>",{type:"text",size:200}).css(e.style.getCSS()).css({position:"absolute",top:0,left:0,border:0,padding:0,margin:0,"text-align":"center"}).attr({autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.$div.append(this.$form.append(this.$textField)),this.bgA.setContent(t,i||null),this.bgA.setDefaultIdAss(),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.act.nonAssignedCells=0;for(let t=0;t<this.bgA.getNumCells();t++){var n=this.bgA.getActiveBox(t);-1===n.idAss&&(this.act.nonAssignedCells++,n.switchToAlt(this.ps))}this.bgA.setVisible(!0),this.bgB.setVisible(!1)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.act.shuffleA&&this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}activityReady(){super.activityReady(),this.setCurrentCell(0)}updateContent(t){if(super.updateContent(t),this.bgA&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?nn.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bgA||this.bgB){const i=t.clone();if("AUB"===this.act.boxGridPos?i.height-=this.bgB.pos.y+this.act.margin/2:"AB"===this.act.boxGridPos&&(i.width-=this.bgB.pos.x+this.act.margin/2),this.$canvas=s()('<canvas width="'+i.dim.width+'" height="'+i.dim.height+'"/>').css({position:"absolute",top:0,left:0}),this.bgA&&this.$animatedBg){var e=this.bgA.getBounds();this.$animatedBg.css({left:e.pos.x,top:e.pos.y,width:e.dim.width+"px",height:e.dim.height+"px","background-size":e.dim.width+"px "+e.dim.height+"px"}),this.$canvas.insertAfter(this.$animatedBg)}else this.$div.prepend(this.$canvas);this.$textField&&this.$textField.css({top:this.bgB.pos.y,left:this.bgB.pos.x,width:this.bgB.dim.width,height:this.bgB.dim.height,zIndex:9}),this.invalidate().update()}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"click"))}checkInvAss(){return this.act.invAss&&this.invAssCheck&&this.invAssCheck.every((t=>t))}setCurrentCell(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this.playing)return;let i=null,s=!1;if(-1!==this.currentCell){let t=!1;if(i=this.bgA?this.bgA.getActiveBoxWithIdLoc(this.currentCell):null,i){i.setMarked(!1);const n=i.getDescription(),r=i.idAss,a=r>=0?this.act.abc.answers.getActiveBoxContent(r).text:"",o=this.$textField.val().trim();if(Gt(o,a,!1,this.act.numericContent)){t=!0,i.idAss=-1;const n=a.indexOf("|");n>=0&&this.$textField.val(a.substring(0,n)),this.act.abc.solvedPrimary?(i.switchToAlt(this.ps),s=i.playMedia(this.ps,e)):i.clear(),this.act.invAss&&r>=0&&r<this.invAssCheck.length&&(this.invAssCheck[r]=!0),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem))}const l=this.bgA.countCellsWithIdAss(-1);if(o.length>0&&this.ps.reportNewAction(this.act,"WRITE",n,o,t,l),t&&(this.checkInvAss()||l===this.bgA.getNumCells()))return this.finishActivity(!0),this.$textField.prop("disabled",!0),void this.invalidate().update();!s&&o.length>0&&this.playEvent(t?"actionOk":"actionError")}}if(i=this.bgA?this.act.useOrder?this.bgA.getBox(this.currentItem):this.bgA.getActiveBoxWithIdLoc(t):null,this.bgA&&(!i||-1===i.idAss)){for(var n=0;n<this.bgA.getNumCells()&&(i=this.bgA.getActiveBoxWithIdLoc(n),-1===i.idAss);n++);if(i&&-1===i.idAss)return this.finishActivity(!1),this.$textField.prop("disabled",!0),void this.invalidate().update()}i&&this.bgA&&this.bgA.getNumCells()>1&&i.setMarked(!0),i&&(this.currentCell=i.idLoc),this.$textField.val(""),this.$textField.focus(),this.invalidate().update(),i&&i.playMedia(this.ps,e)}processEvent(t){if(this.playing){const e=[];switch(t.type){case"click":t.preventDefault(),this.ps.stopMedia(1);const i=new ye(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top);if(this.bgB.contains(i)){this.$textField.focus();break}const s=this.bgA?this.bgA.findActiveBox(i):null;s&&!s.isInactive()&&(s.getContent()&&null===s.getContent().mediaContent&&this.playEvent("CLICK"),this.setCurrentCell(s.idLoc,e));break;case"change":t.preventDefault(),this.setCurrentCell(this.currentCell,e)}return e.forEach((t=>t())),!1}}}Object.assign(hn.prototype,{$textField:null,invAssCheck:null,bgA:null,bgB:null,currentCell:-1,events:["click","change"]}),cn.Panel=hn;var un=Mi.registerClass("@text.WrittenAnswer",cn);class dn extends Mi{constructor(t){super(t),this.includeInReports=!1,this.reportActions=!1}}class pn extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;t&&(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),t.animatedGifFile&&!t.shaper.rectangularShapes&&(this.$animatedBg=s()("<span/>").css({"background-image":`url(${t.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.$animatedBg&&this.bg.setCellAttr("tmpTrans",!0),this.bg.setVisible(!0))}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}setDimension(t){return this.getBounds().equals(t)?t:nn.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg){if(this.$canvas=s()('<canvas width="'+t.dim.width+'" height="'+t.dim.height+'"/>').css({position:"absolute",top:0,left:0}),this.$animatedBg){const t=this.bg.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:`${t.dim.width}px`,height:`${t.dim.height}px`,"background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.invalidate().update(),window.setTimeout((()=>this.bg?this.bg.buildAccessibleElements(this.$canvas,this.$div):null),0)}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new ye(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),i=[];this.ps.stopMedia(1);const s=this.bg.findActiveBox(e);s&&(s.playMedia(this.ps,i)||this.playEvent("click")),i.forEach((t=>t())),t.preventDefault()}}}Object.assign(pn.prototype,{bg:null,events:["click"]}),dn.Panel=pn;var fn=Mi.registerClass("@panels.InformationScreen",dn);class gn extends Mi{constructor(t){super(t)}getMinNumActions(){return this.cellsToMatch}hasRandom(){return!0}}Object.assign(gn.prototype,{nonAssignedCells:0,cellsToMatch:1});class mn extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,e=this.act.abc.solvedPrimary;if(t){if(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=s()("<span/>").css({"background-image":`url(${t.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),e&&e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const i=[t];e&&(i.push(null),i.push(e)),this.act.acp.generateContent(t.nch,t.ncw,i,!1)}this.bg=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t,e||null),this.bg.setAlternative(!1),this.$animatedBg&&this.bg.setCellAttr("tmpTrans",!0),this.bg.setDefaultIdAss(),this.act.nonAssignedCells=0,this.act.cellsToMatch=0;const i=this.bg.getNumCells();for(let t=0;t<i;t++){const e=this.bg.getActiveBox(t),i=e.idAss;1===i?this.act.cellsToMatch++:-1===i&&(this.act.nonAssignedCells++,e.switchToAlt(this.ps))}this.bg.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.act.shuffleA&&this.shuffle([this.bg],!0,!0),this.useOrder&&(this.currentItem=this.bg.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return super.updateContent(t)}setDimension(t){return this.getBounds().equals(t)?t:nn.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg){if(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$animatedBg){const t=this.bg.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:`${t.dim.width}px`,height:`${t.dim.height}px`,"background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.invalidate().update(),window.setTimeout((()=>this.bg?this.bg.buildAccessibleElements(this.$canvas,this.$div):null),0)}}buildAccessibleComponents(){this.bg&&this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new ye(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top);let i=!1;const s=[];if("click"===t.type){this.ps.stopMedia(1);const t=this.bg?this.bg.findActiveBox(e):null;if(t)if(-1!==t.idAss){let e=!1;const n=t.getDescription();i=i||t.playMedia(this.ps,s),1!==t.idAss||this.act.useOrder&&t.idOrder!==this.currentItem||(e=!0,t.idAss=-1,t.switchToAlt(this.ps)?i=i||t.playMedia(this.ps,s):t.clear(),this.act.useOrder&&(this.currentItem=this.bg.getNextItem(this.currentItem,1)));const r=this.bg.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"SELECT",n,null,e,r-this.act.nonAssignedCells),e&&r===this.act.cellsToMatch+this.act.nonAssignedCells?this.finishActivity(!0):i||this.playEvent(e?"actionOk":"actionError"),this.update()}else this.playEvent("actionError")}s.forEach((t=>t())),t.preventDefault()}}}Object.assign(mn.prototype,{bg:null,events:["click"]}),gn.Panel=mn;var vn=Mi.registerClass("@panels.Identify",gn);class bn extends Mi{constructor(t){super(t)}mustPauseSequence(){return!0}getMinNumActions(){return 0}hasRandom(){return!0}}class yn extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,e=this.act.abc.secondary;if(t&&e){t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=s()("<span/>").css({"background-image":`url(${t.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t,e],!1),this.bgA=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,t);const i="AUB"===this.act.boxGridPos||"BUA"===this.act.boxGridPos?t.getTotalWidth():e.w;this.bgB=new ln(null,this,e.style,this.act.margin,this.act.margin,i,e.h,new Bs(1,1)),this.bgA.setContent(t),this.bgA.setDefaultIdAss(),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.bgB.getActiveBox(0).setInactive(!1),this.bgA.setVisible(!0),this.bgB.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.act.shuffleA&&this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bgA&&this.bgB&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?nn.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bgA||this.bgB){if(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$animatedBg){const t=this.bgA.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:`${t.dim.width}px`,height:`${t.dim.height}px`,"background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.invalidate().update()}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div),this.bgB&&this.bgB.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new ye(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),i=[];if("click"===t.type){this.ps.stopMedia(1);const t=this.bgA.findActiveBox(e);if(t){const e=this.bgB.getActiveBox(0);if(-1===t.idAss||this.act.useOrder&&t.idOrder!==this.currentItem)e.clear(),e.setInactive(!1);else if(e.setContent(this.act.abc.secondary,t.idAss),e.playMedia(this.ps,i)||t.playMedia(this.ps,i)||this.playEvent("CLICK"),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem)),this.ps.reportNewAction(this.act,"SELECT",t.getDescription(),e.getDescription(),!0,0),0===t.idAss&&1===this.bgA.getNumCells()){const t=this.act.project.activitySequence,e=t.getCurrentAct();e&&t.hasNextAct(!0)&&e.delay>0&&"both"!==t.getNavButtonsFlag()&&"fwd"!==t.getNavButtonsFlag()&&this.finishActivity(!0)}this.update()}}i.forEach((t=>t())),t.preventDefault()}}}Object.assign(yn.prototype,{bgA:null,bgB:null,events:["click"]}),bn.Panel=yn;var wn=Mi.registerClass("@panels.Explore",bn);class An extends Mi{constructor(t){super(t),this.menuElements=[],this.includeInReports=!1,this.reportActions=!1}}class xn extends Ni{constructor(t,e,i){super(t,e,i),e.lastProjectSkin=null}buildVisualComponents(){this.firstRun&&super.buildVisualComponents();const t=s()("<div/>").css({width:"100%","max-height":"100%",position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex","flex-wrap":"wrap","overflow-y":"auto","place-content":"center","overflow-y":"auto"});this.act.menuElements.forEach((e=>{const i=e.description||e.caption||"JClic",n=s()("<button/>",{class:"StockBtn",title:i,"aria-label":i}).css({"min-width":"80px","max-width":"200px","min-height":"80px",margin:"4px",padding:"4px",display:"flex","flex-direction":"column","justify-content":"center","align-items":"center"}),r=xn.icons[e.icon||"@ico00.png"],a=s()("<img/>",{src:r||""}).css({"max-width":"180px","max-height":"100px",margin:"4px"});if(!r){this.act.project.mediaBag.getElement(e.icon,!0).getFullPathPromise().then((t=>a.attr("src",t)))}n.append(a),n.append(s()("<span/>").css({"max-width":"180px",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}).html(e.caption)),n[0].addEventListener("click",(t=>{const i=new Fe(e.projectPath?"RUN_CLIC_PACKAGE":"RUN_CLIC_ACTIVITY",e.sequence);e.projectPath&&(i.externalParam=e.projectPath),gt("info",`Launching ${e.projectPath||""} ${e.sequence||""}`),this.ps.playMedia(i),t.preventDefault()})),t.append(n)})),this.$div.empty().append(t)}setDimension(t){return t}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.setAndPlayMsg("initial","start"),this.playing=!0}}xn.icons={"@ico00.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAB1UExURUxpcZVZAGyAAGyAAJVZAJVZAJVZAIhmAJVZAJVZAJVZAIhmAGyAAGyAAGyAAGyAAGyAAJVZAJVZAGyAAJVZANj+AP+ZAMFzAPWSALVsANyEAM57AJ66AOiLALXVAM3xAK1nAI6oAIabAJWwAMTnAKFgAGyAAIlz9xYAAAAVdFJOUwB9oCIiZpkRRKq7M4BVu9VmVd1EzJvdA7gAAAE0SURBVDjLjZPZkoMgEEVFFsHdZBQR3M38/ycOKQ1gJKnpV051nwtNEPyrsjBNom9AqNSapxn8CBRjXY+DmjXkbQSXeq9tWJe7ByhVberXqzCY8yGM6GVK9FQ4SpVUxAwnJ+A+2wkLBLLppYgJRgZIrcJYBKxvdLUdFzE4mHBzFNDUvKoVdFfI7YQ1q7gD7LowXNRwaM4R6AzQEXNRWZrPT2jLA9YaQOIXQHV0WIbFvKZImPNGmLCMCwY0lJQQS6vAzEXFjY7Of5iORXwKySHe8+kWWwVeGQUnmW3QTMgDONUbhQ+ABAZwozkTqH1Ox8za3Jz3drLZDMABquuM9nFaKXZpwfFpp+j0ZiHJ21pifiIkQ++Lix+9nc+Z5/tQwrt2fxEBvN8vooQJLgTDX74xSi6z/wAoQC7hWsslMgAAAABJRU5ErkJggg==","@ico01.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAByUExURUxpcfzZt/rfw/pycvrcv/3UrJqf/QAAAP/hxPvOov9sbPqFhYmN/f7nz3V4+/3ky/+AgPrIl11g/P/Klf+Kiv9XV//q1vtHR/rCim1w//pcXISI//tfX5WY/VNT///Dh/86OvwhISUl/js7+klM+vq6e8H/VfEAAAABdFJOUwBA5thmAAABGElEQVQ4y62T23aCMBBFiU48iQlELoJW7b3//4udBIi0MqsvDU+w95yEGSiK/15YrlVhd1+C8Nk05+ribzcvCJlXklBV3u/8pToLAnMk3kiCh0Hkz4LA/NSC+YcgANTWYP4OqVGmtmAuC2St2Mn4EMbq9TaPvABpDborD+OB0QqG8hbo3HTNAikFCtEZBTcMx+t+ewC2U4IyMAFUTgVd5nukHYlrqYcxSBlw15k/gTlXx/ySPT5NLOkyP7IQq0PoOd/wSZLgmLtD5AMLsS70ZbnZEL+LTQmZv6aEQIkrpTUlwWX+FhNCyNzaOiVkHgXODyHzFr87ye/3g+NxGrTgJ6zNa8nXJ04zf4Ew88ylr8KM/At//sB88w0/sBcK3bRRzgAAAABJRU5ErkJggg==","@ico02.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAtUExURUxpcQAAAP///8zMzJmZmfrdwP/hxPvOov3UrP3JlvzZt/zlzf/p0/zBh/rDjUN28cYAAAABdFJOUwBA5thmAAAAyklEQVQ4y6WT6w6DIAxG/YS2XHTv/7grLshF0C1r+KE5n6fFpMvybQHt6bldbXfQcazNsTD4MdCV+S+AQcBUBYa5M4BfHrcB8oNA08HLg0EeAiwOuGtBzoE0Mje4AO4S7QwhgDhlZrcISiNoqxzFoGbSb5Uyozhs4ckdD4M+OfQtUmeKcUsGnaQEyoSp/6YJIr2LXAPqp4OH4BzJtUXyZy7iBwbl8eSDALUc/Z/Sv1DxHfVm5ao5hjtIme+YbOnJMdlj/vCJoB5HX97wIgms7CtjdwAAAABJRU5ErkJggg==","@ico03.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAwUExURUxpcQAAAPrdwP/hxP7mz/8AAAAAmfvOov3UrAAA//3JlvzZtwCZAP8A//zCifq6e7UN6GsAAAABdFJOUwBA5thmAAABA0lEQVQ4y5WS2RbDIAhEHdyTJv3/vy2osVj1oR6zeYcBDcb8NV6v9fp1NV7mgq8cMs/cDWYHhrmomsM1pcj9pgS7FL3IZ6AI8nazsCiCnPOG3wf0QpArfDnoGATC6mwc9oi/AtMFgAFFLQhDCuZcQ0yAMghB+cuNUgJpSVM1zg7phGUFpv3VFdB5gqxolpwdTqYO5EaPJ57PgWOZWgvt0bl4u+LAbwmzv0Q7JxquJM2FSpwTBRHvRU7Mey/E16f4FwfeSkpUBD26CIQ+PMajODTmaw0Dr7/V1zRVQCNvAvNw6QbFb5iWwvRaWKE4Vh3H/6LxG+ueROfYdXXlb+zavg/++ADYLwfSmmk9oQAAAABJRU5ErkJggg==","@icofolder.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUxpcffvhP///2VlZczMZv//zPf39+/nc8zMzDMzmZmZZrW1tbWttcl3sA0AAAABdFJOUwBA5thmAAAAgklEQVQ4y9WSQQ6AIAwEsVtFwf+/14JGbcHeTHSuO9kFQggfBE8BFwLR+mBwFGYSZvh53zjzZTdkLTXCkS/ViDHBCLe8Gla48qpkGEHl+8pdYJo0yOouPA2GhLLiCCyC28DIcAXZ0IfsVKS3BTGUMDas0E9NfkO/ovmQBv2v0BJ+xAaYuQX2hCJNtwAAAABJRU5ErkJggg=="},An.Panel=xn;var Cn=Mi.registerClass("@panels.Menu",An);class kn extends Mi{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Sn extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;if(t){t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bgA=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgB=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgA.setContent(t),this.bgA.accessibleText=pt("source"),this.bgB.accessibleText=pt("target"),this.bgA.setVisible(!0),this.bgB.setVisible(!0);const e=this.bgA.getBackgroundActiveBox(),i=this.bgB.getBackgroundActiveBox();e&&i&&i.exchangeContent(e)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB&&(this.shuffle([this.bgA],!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(),this.bgA&&this.bgB&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?nn.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),(this.bgA||this.bgB)&&(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new Gs(this,this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"mousedown"),this.bgB&&(this.bgB.setCellAttr("accessibleAlwaysActive",!0),this.bgB.buildAccessibleElements(this.$canvas,this.$div,"mousedown")))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;const n=[];if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new ye;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new ye(e-this.$div.offset().left,i-this.$div.offset().top)}let r=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bgA.findActiveBox(this.bc.origin),i=this.bgB.findActiveBox(s),this.bc.end(),e&&i&&i.isInactive()){let t=!1;const s=`${e.getDescription()} (${e.idOrder})`,n=`(${i.idOrder})`,r=this.act.abc.primary.getActiveBoxContent(i.idOrder);e.getContent().isEquivalent(r,!0)&&(t=!0,e.exchangeContent(i),e.setVisible(!1),this.act.useOrder&&(this.currentItem=this.bgA.getNextItem(this.currentItem)));const a=this.bgA.countInactiveCells();this.ps.reportNewAction(this.act,"PLACE",s,n,t,a),t&&a===this.bgA.getNumCells()?this.finishActivity(!0):this.playEvent(t?"actionOk":"actionError")}this.update(),this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.focus()}else{if(r)break;this.ps.stopMedia(1),e=this.bgA.findActiveBox(s),!e||e.isInactive()||this.act.useOrder&&e.idOrder!==this.currentItem||(this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s),e.playMedia(this.ps,n)||this.playEvent("click"),this.bgB.$accessibleDiv&&this.bgB.$accessibleDiv.focus())}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}n.forEach((t=>t())),t.preventDefault()}}}Object.assign(Sn.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),kn.Panel=Sn;var En=Mi.registerClass("@puzzles.DoublePuzzle",kn);class Tn extends Mi{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class Bn extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;t&&(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.bg.setVisible(!0))}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.shuffle([this.bg],!0,!0),this.useOrder&&(this.currentItem=this.bg.getNextItem(-1)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}setDimension(t){return!this.bg||this.getBounds().equals(t)?t:nn.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg&&(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new Gs(this,this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;const n=[];if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new ye;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new ye(e-this.$div.offset().left,i-this.$div.offset().top)}let r=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bg.findActiveBox(this.bc.origin),this.bc.end(),i=this.bg.findActiveBox(s),e&&i){const t=`${e.getDescription()} (${e.idOrder})`,s=`(${i.idLoc})`;let n=e.idOrder===i.idLoc;this.bg.swapCellPositions(e,i,!0);const r=this.bg.countCellsAtEquivalentPlace(!0);this.ps.reportNewAction(this.act,"PLACE",t,s,n,r),n&&r===this.bg.getNumCells()?this.finishActivity(!0):this.playEvent(n?"actionOk":"actionError")}this.update()}else{if(r)break;this.ps.stopMedia(1),e=this.bg.findActiveBox(s),e&&(this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s),e.playMedia(this.ps,n)||this.playEvent("click"))}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}n.forEach((t=>t())),t.preventDefault()}}}Object.assign(Bn.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Tn.Panel=Bn;var In=Mi.registerClass("@puzzles.ExchangePuzzle",Tn);class Pn extends Mi{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}class _n extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null),this.parkBg&&(this.parkBg.end(),this.parkBg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary;t&&(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(t.nch,t.ncw,[t],!1),this.bg=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bg.setContent(t),this.bg.setVisible(!0),this.hiddenBoxIndex=Math.floor(Math.random()*this.bg.getNumCells()),this.hiddenBox=this.bg.getActiveBox(this.hiddenBoxIndex),this.hiddenBox.setVisible(!1),this.parkBg=new ln(null,this,t.style,this.act.margin,this.act.margin,this.hiddenBox.dim.width,this.hiddenBox.dim.height,new Bs(1,1)),this.parkBg.setContent(t,null,this.hiddenBoxIndex,0,1),this.parkBg.setBorder(this.bg.hasBorder()),this.parkBg.setVisible(!0))}initActivity(){if(super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg){this.act.shuffles%2!=1&&this.act.shuffles++;for(var t=0;t<this.act.shuffles;t++){const t=this.bg.getCoord(this.hiddenBox),i=0===Math.floor(2*Math.random())?1:-1;0===Math.floor(2*Math.random())?(t.x+=i,(t.x<0||t.x>=this.bg.nCols)&&(t.x-=2*i)):(t.y+=i,(t.y<0||t.y>=this.bg.nRows)&&(t.y-=2*i));var e=this.bg.getActiveBoxWithIdLoc(t.y*this.bg.nCols+t.x);null!==e&&this.hiddenBox.exchangeLocation(e)}this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0}}updateContent(t){if(super.updateContent(t),this.bg&&this.parkBg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t),this.parkBg.update(i,t)}return this}setDimension(t){return this.bg&&this.parkBg&&!this.getBounds().equals(t)?nn.layoutDouble(t,this.bg,this.parkBg,this.act.boxGridPos,this.act.margin):t}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg&&this.parkBg&&(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.buildAccessibleElements(this.$canvas,this.$div))}processEvent(t){if(this.playing){const e=new ye(t.pageX-this.$div.offset().left,t.pageY-this.$div.offset().top),i=[];if("click"===t.type){this.ps.stopMedia(1);const t=this.bg.findActiveBox(e);if(t)if(t.isVisible()){const e=this.bg.getCoordDist(t,this.hiddenBox);if(Math.abs(e.x)+Math.abs(e.y)===1){let e=t.playMedia(this.ps,i);const s=`${t.getDescription()} (${t.idOrder})`,n=`(${this.hiddenBox.idLoc})`;t.exchangeLocation(this.hiddenBox);const r=t.idOrder===t.idLoc,a=this.bg.countCellsAtEquivalentPlace(!0);this.ps.reportNewAction(this.act,"SELECT",s,n,r,a),r&&a===this.bg.getNumCells()?(this.hiddenBox.setVisible(!0),this.parkBg.setVisible(!1),this.finishActivity(!0)):e||this.playEvent("click")}this.update()}else this.playEvent("actionError")}i.forEach((t=>t())),t.preventDefault()}}}Object.assign(_n.prototype,{bg:null,parkBg:null,hiddenBox:null,hiddenBoxIndex:-1,events:["click"]}),Pn.Panel=_n;var Dn=Mi.registerClass("@puzzles.HolePuzzle",Pn);class Rn extends Mi{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}}class On extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.bg&&(this.bg.end(),this.bg=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,e=this.act.abc.secondary;if(t){if(t.image&&t.setImgContent(this.act.project.mediaBag,null,!1),e&&e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const i=[t];e&&i.push(e),this.act.acp.generateContent(t.nch,t.ncw,i,!1)}let i=t.ncw,s=t.nch;"AB"===this.act.boxGridPos||"BA"===this.act.boxGridPos?i*=2:s*=2,this.bg=new ln(null,this,t.style,this.act.margin,this.act.margin,t.w*i,t.h*s,new Bs(i,s));const n=t.getNumCells();this.bg.setBorder(t.border),this.bg.setContent(t,null,0,0,n),this.bg.setContent(e||t,null,0,n,n);for(let t=0;t<2;t++)for(let e=0;e<n;e++){const i=this.bg.getActiveBox(t*n+e);i.idAss=e,i.setInactive(!0)}this.bg.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bg&&(this.shuffle([this.bg],!0,!0),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.bg&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bg.update(i,t)}return this}setDimension(t){return!this.bg||this.getBounds().equals(t)?t:nn.layoutSingle(t,this.bg,this.act.margin)}setBounds(t){this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bg&&(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.bc=new Gs(this,this.$canvas),this.invalidate().update())}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&this.bg&&(super.buildAccessibleComponents(),this.bg.setCellAttr("accessibleAlwaysActive",!0),this.bg.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null,n=[];if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new ye;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new ye(e-this.$div.offset().left,i-this.$div.offset().top)}let r=!1;switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":case"touchend":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;r=!0;case"touchstart":case"mousedown":if(this.bc.active){if(this.ps.stopMedia(1),e=this.act.dragCells?this.bc.bx:this.bg?this.bg.findActiveBox(this.bc.origin):null,this.bc.end(),i=this.bg?this.bg.findActiveBox(s):null,e&&-1!==e.idAss&&i&&-1!==i.idAss)if(e!==i){let t=!1;e.idAss===i.idAss||e.getContent().isEquivalent(i.getContent(),!0)?(t=!0,e.idAss=-1,e.setInactive(!1),i.idAss=-1,i.setInactive(!1)):(e.setInactive(!0),this.act.dragCells?i.setInactive(!0):(i.setInactive(!1),this.update(),this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s)));let r=i.playMedia(this.ps,n);if(this.bg){const s=this.bg.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"MATCH",e.getDescription(),i.getDescription(),t,s/2),t&&s===this.bg.getNumCells()?this.finishActivity(!0):r||this.playEvent(t?"actionOk":"actionError")}}else this.playEvent("CLICK"),e.setInactive(!0);else null!==e&&e.setInactive(!0);this.invalidate().update()}else{if(r)break;this.ps.stopMedia(1),e=this.bg?this.bg.findActiveBox(s):null,e&&-1!==e.idAss&&(e.playMedia(this.ps,n)||this.playEvent("click"),e.setInactive(!1),this.update(),this.act.dragCells?this.bc.begin(s,e):this.bc.begin(s))}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}n.forEach((t=>t())),t.preventDefault()}}}Object.assign(On.prototype,{bg:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Rn.Panel=On;var Mn=Mi.registerClass("@memory.MemoryGame",Rn);class Nn extends Mi{constructor(t){super(t)}getMinNumActions(){return this.abc.primary.getNumCells()}hasRandom(){return!0}shuffleAlways(){return!0}helpSolutionAllowed(){return!0}}Object.assign(Nn.prototype,{useIdAss:!1});class $n extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.bgA&&(this.bgA.end(),this.bgA=null),this.bgB&&(this.bgB.end(),this.bgB=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.abc.primary,e=this.act.abc.secondary,i=this.act.abc.solvedPrimary;if(t&&e){if(t.image&&(t.setImgContent(this.act.project.mediaBag,null,!1),!t.animatedGifFile||t.shaper.rectangularShapes||this.act.shuffleA||(this.$animatedBg=s()("<span/>").css({"background-image":`url(${t.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),e.image&&(e.setImgContent(this.act.project.mediaBag,null,!1),!e.animatedGifFile||e.shaper.rectangularShapes||this.act.shuffleB||(this.$animatedBgB=s()("<span/>").css({"background-image":`url(${e.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),i&&i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp){const s=[t,e];i&&s.push(i),this.act.acp.generateContent(t.nch,t.ncw,s,!1)}this.bgA=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,t),this.bgB=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,e),this.bgA.setContent(t,i||null),this.$animatedBg&&this.bgA.setCellAttr("tmpTrans",!0),this.bgB.setContent(e),this.$animatedBgB&&this.bgB.setCellAttr("tmpTrans",!0),this.bgA.accessibleText=pt("source"),this.bgB.accessibleText=pt("target"),this.bgA.setVisible(!0),this.bgB.setVisible(!0)}}initActivity(){if(super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.bgA&&this.bgB){const t=[];this.act.shuffleA&&t.push(this.bgA),this.act.shuffleB&&t.push(this.bgB),t.length>0&&this.shuffle(t,!0,!0),this.useOrder&&(this.currentItem=this.bgA.getNextItem(-1)),this.invalidate().update(),this.setAndPlayMsg("initial","start"),this.playing=!0}}updateContent(t){if(super.updateContent(t),this.bgA&&this.bgB&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.bgA.update(i,t),this.bgB.update(i,t)}return this}setDimension(t){return this.bgA&&this.bgB&&!this.getBounds().equals(t)?nn.layoutDouble(t,this.bgA,this.bgB,this.act.boxGridPos,this.act.margin):t}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.bgA||this.bgB){if(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$animatedBg&&this.bgA){const t=this.bgA.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:t.dim.width+"px",height:t.dim.height+"px","background-size":`${t.dim.width}px ${t.dim.height}px`})}if(this.$animatedBgB&&this.bgB){const t=this.bgB.getBounds();this.$animatedBgB.css({left:t.pos.x,top:t.pos.y,width:t.dim.width+"px",height:t.dim.height+"px","background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.bc=new Gs(this,this.$canvas),this.invalidate().update()}}buildAccessibleComponents(){this.$canvas&&this.accessibleCanvas&&(super.buildAccessibleComponents(),this.bgA&&this.bgA.buildAccessibleElements(this.$canvas,this.$div,"mousedown"),this.bgB&&this.bgB.buildAccessibleElements(this.$canvas,this.$div,"mousedown"))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new ye;else{const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new ye(e-this.$div.offset().left,i-this.$div.offset().top)}let n=!1,r=!1,a=!1,o=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;n=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);const t=this.bc.origin;if(this.bc.end(),e=this.bgA?this.bgA.findActiveBox(t):null,e?i=this.bgB?this.bgB.findActiveBox(s):null:(i=this.bgB?this.bgB.findActiveBox(t):null,i&&(e=this.bgA?this.bgA.findActiveBox(s):null,a=!0)),e&&i&&-1!==e.idAss&&-1!==i.idAss&&this.act.abc.secondary){let t=!1;const s=e.getDescription(),n=i.getDescription(),l=this.act.abc.secondary.getActiveBoxContent(e.idOrder);(e.idOrder===i.idOrder||i.getContent().isEquivalent(l,!0))&&(t=!0,e.idAss=-1,i.idAss=-1,this.act.abc.solvedPrimary?(e.switchToAlt(this.ps),r=r||e.playMedia(this.ps,o)):(r=a?r||e.playMedia(this.ps,o):r||i.playMedia(this.ps,o),e.clear()),i.clear(),this.act.useOrder&&this.bgA&&(this.currentItem=this.bgA.getNextItem(this.currentItem)));const c=this.bgB?this.bgB.countCellsWithIdAss(-1):0;this.ps.reportNewAction(this.act,"MATCH",s,n,t,c),t&&c===this.bgB.getNumCells()?this.finishActivity(!0):r||this.playEvent(t?"actionOk":"actionError")}this.update(),this.bgA&&this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.focus()}else{if(n)break;if(this.ps.stopMedia(1),e=this.bgA?this.bgA.findActiveBox(s):null,i=this.bgB?this.bgB.findActiveBox(s):null,e&&(!this.act.useOrder||e.idOrder===this.currentItem)||!this.act.useOrder&&i&&-1!==i.idAss){this.act.dragCells?this.bc.begin(s,e||i):this.bc.begin(s),r=r||(e||i).playMedia(this.ps,o),r||this.playEvent("click");let t=e?this.bgA:this.bgB;t&&t.$accessibleDiv&&(t=e?this.bgB:this.bgA,t&&t.$accessibleDiv&&t.$accessibleDiv.focus())}}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}o.forEach((t=>t())),t.preventDefault()}}}Object.assign($n.prototype,{bgA:null,bgB:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Nn.Panel=$n;var Vn=Mi.registerClass("@associations.SimpleAssociation",Nn);class qn extends Nn{constructor(t){super(t),this.useIdAss=!0}setProperties(t){super.setProperties(t),this.abc.primary.avoidAllIdsNull(this.abc.secondary.getNumCells())}getMinNumActions(){return this.invAss?this.abc.secondary.getNumCells():this.abc.primary.getNumCells()-this.nonAssignedCells}}Object.assign(qn.prototype,{nonAssignedCells:0,useIdAss:!1});class Ln extends $n{constructor(t,e,i){super(t,e,i)}buildVisualComponents(){super.buildVisualComponents();const t=this.act.abc.primary,e=this.act.abc.secondary;t&&e&&(this.act.invAss&&(this.invAssCheck=Array(e.getNumCells()).fill(!1)),this.bgA.setDefaultIdAss(),this.act.nonAssignedCells=0,this.bgA.cells.forEach((t=>{-1===t.idAss&&(this.act.nonAssignedCells++,t.switchToAlt(this.ps))})))}checkInvAss(){return!(!this.act.invAss||!this.invAssCheck)&&this.invAssCheck.every((t=>t))}processEvent(t){if(this.bc&&this.playing){let e,i,s=null;if("touchend"===t.type)s=this.bc.active?this.bc.dest.clone():new ye;else{let e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;s=new ye(e-this.$div.offset().left,i-this.$div.offset().top)}let n=!1,r=!1,a=!1,o=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&s.distanceTo(this.bc.origin)<=3)break;n=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);const t=this.bc.origin;if(this.bc.end(),e=this.bgA?this.bgA.findActiveBox(t):null,e?i=this.bgB?this.bgB.findActiveBox(s):null:(i=this.bgB?this.bgB.findActiveBox(t):null,i&&(e=this.bgA?this.bgA.findActiveBox(s):null,a=!0)),e&&i&&-1!==e.idAss&&!i.isInactive()&&this.act.abc.secondary){const t=e.getDescription(),s=i.getDescription(),n=this.act.abc.secondary.getActiveBoxContent(e.idAss);let l=!1;if((e.idAss===i.idOrder||i.getContent().isEquivalent(n,!0))&&(l=!0,e.idAss=-1,this.act.abc.solvedPrimary?(e.switchToAlt(this.ps),r=r||e.playMedia(this.ps,o)):(r=a?r||e.playMedia(this.ps,o):r||i.playMedia(this.ps,o),e.clear()),this.act.invAss&&(this.invAssCheck[i.idOrder]=!0,i.clear()),this.act.useOrder&&this.bgA&&(this.currentItem=this.bgA.getNextItem(this.currentItem))),this.bgA){const e=this.bgA.countCellsWithIdAss(-1);this.ps.reportNewAction(this.act,"MATCH",t,s,l,e-this.act.nonAssignedCells),l&&(this.checkInvAss()||e===this.bgA.getNumCells())?this.finishActivity(!0):r||this.playEvent(l?"actionOk":"actionError")}}else if(this.bgB&&(a&&this.bgA&&this.bgA.contains(s)||!a&&this.bgB.contains(s))){const t=e?e.getDescription():i?i.getDescription():"null";this.ps.reportNewAction(this.act,"MATCH",t,"null",!1,this.bgB.countCellsWithIdAss(-1)),this.playEvent("actionError")}this.update(),this.bgA&&this.bgA.$accessibleDiv&&this.bgA.$accessibleDiv.focus()}else{if(n)break;this.ps.stopMedia(1),e=this.bgA?this.bgA.findActiveBox(s):null,i=this.bgB?this.bgB.findActiveBox(s):null,(e&&-1!==e.idAss&&(!this.act.useOrder||e.idOrder===this.currentItem)||!this.act.useOrder&&i)&&(this.act.dragCells?this.bc.begin(s,e||i):this.bc.begin(s),r=r||(e||i).playMedia(this.ps,o),r||this.playEvent("click"));let t=e?this.bgA:this.bgB;t&&t.$accessibleDiv&&(t=e?this.bgB:this.bgA,t&&t.$accessibleDiv&&t.$accessibleDiv.focus())}break;case"mousemove":case"touchmove":this.bc.moveTo(s)}o.forEach((t=>t())),t.preventDefault()}}}Object.assign(Ln.prototype,{invAssCheck:null}),qn.Panel=Ln;var jn=$i.registerClass("@associations.ComplexAssociation",qn);const Fn={MIN_CELL_SIZE:12,DEFAULT_CELL_SIZE:20,MIN_INTERNAL_MARGIN:2},zn={NORMAL:0,INVERTED:1,HIDDEN:2,LOCKED:4,MARKED:8,TRANSPARENT:16};class Un extends as{constructor(t,e,i,s,n,r,a,o,l,c){super(t,e,i),this.pos.x=s,this.pos.y=n,this.nCols=Math.max(1,r),this.nRows=Math.max(1,a),this.cellWidth=Math.max(o,Fn.MIN_CELL_SIZE),this.cellHeight=Math.max(l,Fn.MIN_CELL_SIZE),this.dim.width=o*this.nCols,this.dim.height=l*this.nRows,this.setChars(" "),this.preferredBounds=new xe(this.pos,this.dim),this.setBorder(c),this.cursorTimer=new Te((()=>this.blink(0)),500,!1),this.cursorEnabled=!1,this.useCursor=!1,this.wildTransparent=!1,this.cursor=new ye}static createEmptyGrid(t,e,i,s,n,r){const a=new Un(t,e,n.style,i,s,n.ncw,n.nch,n.w,n.h,n.border);return a.wild=n.wild,a.randomChars=n.randomChars,a.wildTransparent=r,a}setChars(t){this.chars=[],this.answers=[],this.attributes=[];for(let e=0;e<this.nRows;e++){const i=e<t.length?t[e]:"";this.chars[e]=i.split(""),this.answers[e]=[],this.attributes[e]=[];for(let t=0;t<this.nCols;t++)t>=i.length&&(this.chars[e][t]=" "),this.answers[e][t]=this.chars[e][t],this.attributes[e][t]=zn.NORMAL}}randomize(){for(let t=0;t<this.nRows;t++)for(let e=0;e<this.nCols;e++)this.chars[t][e]===this.wild&&(this.chars[t][e]=this.randomChars.charAt(Math.floor(Math.random()*this.randomChars.length)))}setCellAttributes(t,e){let i=zn.LOCKED;this.wildTransparent?i|=zn.TRANSPARENT:i|=zn.INVERTED|zn.HIDDEN;for(let s=0;s<this.nRows;s++)for(let n=0;n<this.nCols;n++)t&&this.chars[s][n]===this.wild?this.attributes[s][n]=i:(this.attributes[s][n]=zn.NORMAL,e&&(this.chars[s][n]=" "))}setCellLocked(t,e,i){t>=0&&t<this.nCols&&e>=0&&e<this.nRows&&(this.attributes[e][t]=i?zn.LOCKED|(this.wildTransparent?zn.TRANSPARENT:zn.INVERTED|zn.HIDDEN):zn.NORMAL)}getItemFor(t,e){if(!this.isValidCell(t,e))return null;const i=new ye;let s=!1,n=!1;for(let r=0;r<t;r++)0!=(this.attributes[e][r]&zn.LOCKED)?s||(n&&i.x++,s=!0):(n=!0,s=!1);s=!1,n=!1;for(let r=0;r<e;r++)0!=(this.attributes[r][t]&zn.LOCKED)?s||(n&&i.y++,s=!0):(n=!0,s=!1);return i}setCursorEnabled(t){this.cursorEnabled=t,!0===t?this.startCursorBlink():this.stopCursorBlink()}startCursorBlink(){this.useCursor&&this.cursorEnabled&&this.cursorTimer&&!this.cursorTimer.isRunning()&&(this.blink(1),this.cursorTimer.start())}stopCursorBlink(){this.cursorTimer&&this.cursorTimer.isRunning()&&(this.cursorTimer.stop(),this.blink(-1))}moveCursor(t,e,i){if(this.useCursor){const s=this.findNextCellWithAttr(this.cursor.x,this.cursor.y,i?zn.LOCKED:zn.NORMAL,t,e,!1);this.cursor.equals(s)||this.setCursorAt(s.x,s.y,i)}}findFreeCell(t,e,i){let s=null;if(t&&(0!==e||0!==i)){const n=new ye(t);for(;null===s&&(n.x+=e,n.y+=i,!(n.x<0||n.x>=this.nCols||n.y<0||n.y>=this.nRows));)this.getCellAttribute(n.x,n.y,zn.LOCKED)||(s=n)}return s}findNextCellWithAttr(t,e,i,s,n,r){const a=new ye(t+s,e+n);for(;a.x<0?(a.x=this.nCols-1,a.y>0?a.y--:a.y=this.nRows-1):a.x>=this.nCols&&(a.x=0,a.y<this.nRows-1?a.y++:a.y=0),a.y<0?(a.y=this.nRows-1,a.x>0?a.x--:a.x=this.nCols-1):a.y>=this.nRows&&(a.y=0,a.x<this.nCols-1?a.x++:a.x=0),(a.x!==t||a.y!==e)&&this.getCellAttribute(a.x,a.y,i)!==r;)a.x+=s,a.y+=n;return a}setCursorAt(t,e,i){this.stopCursorBlink(),this.isValidCell(t,e)&&(this.cursor.x=t,this.cursor.y=e,this.useCursor=!0,i&&this.getCellAttribute(t,e,zn.LOCKED)?this.moveCursor(1,0,i):this.cursorEnabled&&this.startCursorBlink())}setUseCursor(t){this.useCursor=t}getCursor(){return this.cursor}countCharsLike(t){let e=0;for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.chars[i][s]===t&&e++;return e}getNumCells(){return this.nRows*this.nCols}countCoincidences(t){let e=0;if(this.answers)for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.isCellOk(s,i,t)&&e++;return e}isCellOk(t,e,i){let s=!1;if(this.isValidCell(t,e)){const n=this.chars[e][t];if(n!==this.wild){const r=this.answers[e][t];(n===r||!i&&n.toUpperCase()===r.toUpperCase())&&(s=!0)}}return s}getLogicalCoords(t){if(!this.contains(t))return null;const e=Math.floor((t.x-this.pos.x)/this.cellWidth),i=Math.floor((t.y-this.pos.y)/this.cellHeight);return this.isValidCell(e,i)?new ye(e,i):null}isValidCell(t,e){return t<this.nCols&&e<this.nRows&&t>=0&&e>=0}setCharAt(t,e,i){this.isValidCell(t,e)&&(this.chars[e][t]=i,this.repaintCell(t,e))}getCharAt(t,e){return this.isValidCell(t,e)?this.chars[e][t]:" "}getStringBetween(t,e,i,s){let n="";if(this.isValidCell(t,e)&&this.isValidCell(i,s)){let r=i-t,a=s-e;if(0===r||0===a||Math.abs(r)===Math.abs(a)){const i=Math.max(Math.abs(r),Math.abs(a));i>0&&(r/=i,a/=i);for(let s=0;s<=i;s++)n+=this.getCharAt(t+r*s,e+a*s)}}return n}setAttributeBetween(t,e,i,s,n,r){if(this.isValidCell(t,e)&&this.isValidCell(i,s)){let a=i-t,o=s-e;if(0===a||0===o||Math.abs(a)===Math.abs(o)){const i=Math.max(Math.abs(a),Math.abs(o));i>0&&(a/=i,o/=i);for(let s=0;s<=i;s++)this.setAttribute(t+a*s,e+o*s,n,r)}}}setAttribute(t,e,i,s){this.isValidCell(t,e)&&(this.attribute!==zn.MARKED||s||this.repaintCell(t,e),this.attributes[e][t]&=~i,this.attributes[e][t]|=s?i:0,(i!==zn.MARKED||s)&&this.repaintCell(t,e))}setAllCellsAttribute(t,e){for(let i=0;i<this.nRows;i++)for(let s=0;s<this.nCols;s++)this.setAttribute(s,i,t,e)}getCellAttribute(t,e,i){return!!this.isValidCell(t,e)&&0!=(this.attributes[e][t]&i)}getCellRect(t,e){return new xe(this.pos.x+t*this.cellWidth,this.pos.y+e*this.cellHeight,this.cellWidth,this.cellHeight)}getCellBorderBounds(t,e){const i=this.getCellAttribute(t,e,zn.MARKED);if(!this.border&&!i)return this.getCellRect(t,e);const s=this.getBoxBaseResolve(),n=i?s.markerStroke:s.borderStroke;return this.getCellRect(t,e).grow(n.lineWidth,n.lineWidth)}repaintCell(t,e){this.container&&this.container.invalidate(this.getCellBorderBounds(t,e)).update()}getPreferredSize(){return this.preferredBounds.dim}getMinimumSize(){return new we(Fn.MIN_CELL_SIZE*this.nCols,Fn.MIN_CELL_SIZE*this.nRows)}getScaledSize(t){return new we(Ht(t*this.preferredBounds.dim.width,this.nCols),Ht(t*this.preferredBounds.dim.height,this.nRows))}setBounds(t,e,i,s){super.setBounds(t,e,i,s),this.cellWidth=this.dim.width/this.nCols,this.cellHeight=this.dim.height/this.nRows}updateContent(t,e){const i=this.getBoxBaseResolve();t.font=i.font.cssFont(),t.textBaseline="alphabetic",i.prepareText(t,"W",this.cellWidth-2*Fn.MIN_INTERNAL_MARGIN,this.cellHeight-2*Fn.MIN_INTERNAL_MARGIN);const s=[],n=(this.cellHeight-i.font.getHeight())/2+i.font.getMetrics().ascent;for(let r=0;r<this.nRows;r++)for(let a=0;a<this.nCols;a++){if(this.getCellBorderBounds(a,r).intersects(e)){const e=this.attributes[r][a];if(0==(e&zn.TRANSPARENT)){const o=0!=(e&zn.INVERTED),l=0!=(e&zn.MARKED),c=this.useCursor&&this.cursor.x===a&&this.cursor.y===r,h=this.getCellRect(a,r);if(t.fillStyle=c&&this.cursorBlink?i.inactiveColor:o?i.textColor:i.backColor,h.fill(t),t.strokeStyle="black",0==(e&zn.HIDDEN)&&(s[0]=this.chars[r][a],s[0])){const e=h.pos.x+(this.cellWidth-t.measureText(s[0]).width)/2,r=h.pos.y+n;if(i.shadow){const n=Math.max(1,i.font.size/10);t.fillStyle=i.shadowColor,t.fillText(s[0],e+n,r+n)}t.fillStyle=o?i.backColor:this.isAlternative()?i.alternativeColor:i.textColor,t.fillText(s[0],e,r)}(this.border||l)&&(t.strokeStyle=i.borderColor,i[l?"markerStroke":"borderStroke"].setStroke(t),l&&(t.globalCompositeOperation="xor"),h.stroke(t),l&&(t.globalCompositeOperation="source-over")),t.strokeStyle="black",be.prototype.setStroke(t)}}}return!0}blink(t){this.useCursor&&(this.cursorBlink=1===t||-1!==t&&!this.cursorBlink,this.repaintCell(this.cursor.x,this.cursor.y))}end(){this.cursorTimer&&(this.cursorTimer.stop(),this.cursorTimer=null)}}Object.assign(Un.prototype,{nRows:1,nCols:1,chars:null,answers:null,attributes:null,cellWidth:20,cellHeight:20,preferredBounds:null,wild:Ei.prototype.wild,randomChars:Ei.prototype.randomChars,cursorEnabled:!1,useCursor:!1,cursor:null,cursorBlink:!1,cursorTimer:null,wildTransparent:!1}),Un.defaults=Fn,Un.flags=zn;var Hn=Un;class Wn extends Mi{constructor(t){super(t)}getMinNumActions(){return this.clues.length}helpSolutionAllowed(){return!0}hasRandom(){return!0}}Object.assign(Wn.prototype,{clues:null,clueItems:null,shuffleA:!1,shuffleB:!1});class Gn extends Ni{constructor(t,e,i){super(t,e,i),this.resolvedClues=[]}clear(){this.grid&&(this.grid.end(),this.grid=null),this.bgAlt&&(this.bgAlt.end(),this.bgAlt=null)}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.tgc,e=this.act.abc.secondary;e&&(e.image&&(e.setImgContent(this.act.project.mediaBag,null,!1),!e.animatedGifFile||e.shaper.rectangularShapes||this.act.shuffleB||(this.$animatedBg=s()("<span/>").css({"background-image":`url(${e.animatedGifFile})`,"background-position":"center","background-repeat":"no-repeat",position:"absolute"}).appendTo(this.$div))),null!==this.act.acp&&this.act.acp.generateContent(0,0,[e],!1)),t&&(this.grid=Hn.createEmptyGrid(null,this,this.act.margin,this.act.margin,t,!1),e&&(this.bgAlt=ln.createEmptyGrid(null,this,this.act.margin,this.act.margin,e),this.$animatedBg&&this.bgAlt.backgroundBox&&(this.bgAlt.backgroundBox.tmpTrans=!0)),this.grid.setVisible(!0))}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.grid&&(this.grid.setChars(this.act.tgc.text),this.grid.randomize(),this.grid.setAllCellsAttribute(Hn.flags.INVERTED,!1),this.resolvedClues=Array(this.act.clueItems.length).fill(!1),this.bgAlt&&(this.bgAlt.setContent(this.act.abc.secondary),this.$animatedBg&&this.bgAlt.clearAllBoxes(),this.act.shuffleB&&this.shuffle([this.bgAlt],!0,!0),this.bgAlt.setVisible(null!==this.$animatedBg||this.act.invAss)),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.playing=!0)}updateContent(t){if(super.updateContent(t),this.grid&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.grid.update(i,t),this.bgAlt&&this.bgAlt.update(i,t)}return this}setDimension(t){return!this.grid||this.getBounds().equals(t)?t:this.bgAlt?nn.layoutDouble(t,this.grid,this.bgAlt,this.act.boxGridPos,this.act.margin):nn.layoutSingle(t,this.grid,this.act.margin)}setBounds(t){if(this.$canvas&&this.$canvas.remove(),super.setBounds(t),this.grid){if(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$animatedBg&&this.bgAlt){const t=this.bgAlt.getBounds();this.$animatedBg.css({left:t.pos.x,top:t.pos.y,width:`${t.dim.width}px`,height:`${t.dim.height}px`,"background-size":`${t.dim.width}px ${t.dim.height}px`})}this.$div.append(this.$canvas),this.bc=new Gs(this,this.$canvas),this.invalidate().update()}}getCurrentScore(){return this.resolvedClues.reduce(((t,e)=>e?++t:t),0)}processEvent(t){if(this.bc&&this.playing){let e=null;if("touchend"===t.type)e=this.bc.active?this.bc.dest.clone():new ye;else{const i=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,s=t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY;e=new ye(i-this.$div.offset().left,s-this.$div.offset().top)}let i=!1,s=!1;const n=[];switch(t.type){case"touchcancel":this.bc.active&&this.bc.end();break;case"mouseup":if(this.bc.active&&e.distanceTo(this.bc.origin)<=3)break;i=!0;case"touchend":case"touchstart":case"mousedown":if(this.bc.active){this.ps.stopMedia(1);const t=this.grid.getLogicalCoords(this.bc.origin),e=this.grid.getLogicalCoords(this.bc.dest);this.bc.end();const i=this.grid.getStringBetween(t.x,t.y,e.x,e.y);if(null!==i&&i.length>0){let r=!1,a=0;for(;a<this.act.clues.length;a++)if(i===this.act.clues[a]){r=!0;break}const o=this.resolvedClues[a];if(r&&!o&&(this.resolvedClues[a]=!0,this.grid.setAttributeBetween(t.x,t.y,e.x,e.y,Hn.flags.INVERTED,!0),null!==this.bgAlt)){const t=this.act.clueItems[a];if(t>=0&&t<this.bgAlt.getNumCells()){const t=this.bgAlt.getActiveBox(this.act.clueItems[a]);t&&(t.setVisible(null===this.$animatedBg&&!this.act.invAss),s=t.playMedia(this.ps,n))}}if(o)r||s||this.playEvent("actionError");else{const t=this.getCurrentScore();this.ps.reportNewAction(this.act,"ACTION_SELECT",i,null,r,t),t===this.act.clues.length?this.finishActivity(!0):s||this.playEvent(r?"actionOK":"actionError"),this.invalidate()}}else this.playEvent("actionError");this.update()}else{if(i)break;this.ps.stopMedia(1),this.grid.contains(e)&&(this.playEvent("click"),this.bc.begin(e))}break;case"mousemove":case"touchmove":this.bc.moveTo(e)}n.forEach((t=>t())),t.preventDefault()}}}Object.assign(Gn.prototype,{grid:null,bgAlt:null,resolvedClues:null,bc:null,events:["mousedown","mouseup","mousemove","touchstart","touchend","touchmove","touchcancel"]}),Wn.Panel=Gn;var Jn=Mi.registerClass("@textGrid.WordSearch",Wn);class Kn extends Mi{constructor(t){super(t)}getMinNumActions(){return this.tgc.getNumChars()-this.tgc.countWildChars()}needsKeyboard(){return!0}}Object.assign(Kn.prototype,{upperCase:!0,checkCase:!0,wildTransparent:!1});class Zn extends Ni{constructor(t,e,i){super(t,e,i)}clear(){this.grid&&(this.grid.end(),this.grid=null),this.style&&(this.style.end(),this.style=null)}createBoxBag(t){const e=new nn(null,this,null),i=new as(e,this,this.icoBB);i.setBounds(0,0,this.LABEL_WIDTH,this.act.abc[t].h);const n=s()("<button/>",{class:"StockBtn"}).css({width:this.LABEL_WIDTH,height:this.act.abc[t].h,"background-image":`url(${"acrossClues"===t?this.hIcon:this.vIcon})`,"background-repeat":"no-repeat","background-position":"center","border-radius":6,"z-index":10}).on("click",(()=>{this.advance="acrossClues"===t?"ADVANCE_RIGHT"===this.advance?"NO_ADVANCE":"ADVANCE_RIGHT":"ADVANCE_DOWN"===this.advance?"NO_ADVANCE":"ADVANCE_DOWN",this.setBtnStatus()})).on("keypress",(t=>{" "===String.fromCharCode(t.charCode||t.keyCode)&&t.stopPropagation()})).appendTo(this.$div);i.setHostedComponent(n),e.addBox(i);const r=new ls(e,null,null,t,new xe(this.LABEL_WIDTH+this.act.margin,0,this.act.abc[t].w,this.act.abc[t].h));return e.addBox(r),e.setBoxBase(this.act.abc[t].style),"acrossClues"===t?(this.hClue=r,this.hClueBtn=i):(this.vClue=r,this.vClueBtn=i),e}buildVisualComponents(){this.firstRun&&super.buildVisualComponents(),this.clear();const t=this.act.tgc,e=this.act.abc.acrossClues,i=this.act.abc.downClues;if(e.image&&e.setImgContent(this.act.project.mediaBag,null,!1),i.image&&i.setImgContent(this.act.project.mediaBag,null,!1),null!==this.act.acp&&this.act.acp.generateContent(0,0,this.act.abc,!1),t){this.grid=Hn.createEmptyGrid(null,this,this.act.margin,this.act.margin,t,this.act.wildTransparent),this.style=new nn(null,this,null);const e=this.createBoxBag("acrossClues"),i=this.createBoxBag("downClues");"AUB"===this.act.boxGridPos||"BUA"===this.act.boxGridPos?i.moveTo(new ye(e.dim.width+this.act.margin,0)):i.moveTo(new ye(0,e.dim.height+this.act.margin)),this.style.addBox(e),this.style.addBox(i),this.grid.setVisible(!0),this.style.setVisible(!0)}}initActivity(){super.initActivity(),this.firstRun?this.firstRun=!1:this.buildVisualComponents(),this.grid&&(this.grid.setChars(this.act.tgc.text),this.numLetters=this.act.getMinNumActions(),this.grid.setCellAttributes(!0,!0),this.grid.setCursorEnabled(!0),this.setCursorAt(0,0),this.advance="ADVANCE_RIGHT",this.setBtnStatus(),this.setAndPlayMsg("initial","start"),this.invalidate().update(),this.$div.attr("tabindex",0),this.$div.focus(),this.playing=!0)}getCurrentScore(){return this.grid?this.grid.countCoincidences(this.act.checkCase):0}updateContent(t){if(super.updateContent(t),this.grid&&this.$canvas){const e=this.$canvas.get(-1),i=e.getContext("2d");t||(t=new xe(0,0,e.width,e.height)),i.clearRect(t.pos.x,t.pos.y,t.dim.width,t.dim.height),this.grid.update(i,t),this.style.update(i,t)}return this}setDimension(t){return this.grid&&this.style&&!this.getBounds().equals(t)?nn.layoutDouble(t,this.grid,this.style,this.act.boxGridPos,this.act.margin):t}setBounds(t){this.$canvas&&(this.$canvas.remove(),this.$canvas=null),super.setBounds(t),this.grid&&(this.$canvas=s()(`<canvas width="${t.dim.width}" height="${t.dim.height}"/>`).css({position:"absolute",top:0,left:0}),this.$div.append(this.$canvas),this.invalidate().update())}processEvent(t){if(this.playing)switch(t.type){case"click":const e=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,i=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY,s=new ye(e-this.$div.offset().left,i-this.$div.offset().top),n=[];if(this.ps.stopMedia(1),this.grid.contains(s)){const t=this.grid.getLogicalCoords(s);if(null!==t&&(this.setCursorAt(t.x,t.y),fe.TOUCH_DEVICE)){const t="ADVANCE_DOWN"===this.advance,e=window.prompt((t?"Vertical":"Horizontal")+" word:","");this.writeChars(e)}}else if(this.hClue.contains(s))this.hClue.playMedia(this.ps,n);else{if(!this.vClue.contains(s))break;this.vClue.playMedia(this.ps,n)}this.update(),n.forEach((t=>t()));break;case"keypress":const r=t.charCode||t.keyCode;r&&this.grid.getCursor()&&(t.preventDefault(),this.writeChars(String.fromCharCode(r)));break;case"keydown":let a=0,o=0;switch(t.keyCode){case fe.VK.RIGHT:a=1;break;case fe.VK.LEFT:a=-1;break;case fe.VK.DOWN:o=1;break;case fe.VK.UP:o=-1}(a||o)&&(t.preventDefault(),this.moveCursor(a,o),this.update())}}moveCursor(t,e){this.grid&&(this.grid.moveCursor(t,e,!0),this.cursorPosChanged())}setCursorAt(t,e){this.grid.setCursorAt(t,e,!0),this.cursorPosChanged()}cursorPosChanged(){const t=this.grid.getCursor();if(null!==t&&null!==this.style){const e=this.grid.getItemFor(t.x,t.y);null!==e&&(this.hClue.setContent(this.act.abc.acrossClues.getActiveBoxContentWith(t.y,e.x)),this.vClue.setContent(this.act.abc.downClues.getActiveBoxContentWith(t.x,e.y)))}}writeChars(t){if(t&&t.length>0)for(let e=0;e<t.length;e++){const i=this.grid.getCursor();let s=t.charAt(e);this.act.upperCase&&(s=s.toLocaleUpperCase()),this.grid.setCharAt(i.x,i.y,s);const n=this.grid.isCellOk(i.x,i.y,this.act.checkCase),r=this.getCurrentScore();this.ps.reportNewAction(this.act,"WRITE",s,`X:${i.x} Y:${i.y}`,n,r),r===this.numLetters?(this.grid.setCursorEnabled(!1),this.grid.stopCursorBlink(),this.finishActivity(!0)):(this.playEvent("click"),"ADVANCE_DOWN"===this.advance?this.moveCursor(0,1):"ADVANCE_RIGHT"===this.advance&&this.moveCursor(1,0))}this.update()}setBtnStatus(){this.hClueBtn&&this.hClueBtn.setInactive("ADVANCE_RIGHT"!==this.advance),this.vClueBtn&&this.vClueBtn.setInactive("ADVANCE_DOWN"!==this.advance)}}Object.assign(Zn.prototype,{LABEL_WIDTH:40,grid:null,style:null,numLetters:0,advance:"NO_ADVANCE",hClue:null,vClue:null,hClueBtn:null,vClueBtn:null,events:["click","keydown","keypress"],hIcon:ne('<svg fill="#FFFFFF" height="36" viewBox="0 0 24 24" width="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />\n</svg>\n'),vIcon:ne('<svg fill="#FFFFFF" height="36" viewBox="0 0 24 24" width="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />\n</svg>\n'),icoSize:{w:36,h:36},icoBB:(new gi).set("backColor","#4285F4").set("inactiveColor","#70A2F6").set("dontFill",!0)}),Kn.Panel=Zn;var Yn=Mi.registerClass("@textGrid.CrossWord",Kn);class Qn extends is{constructor(t){super(t),this.tasks=[]}getProperty(t,e){return null!==this.dbProperties&&this.dbProperties.hasOwnProperty(t)?this.dbProperties[t]:e}addTask(t){this.processingTasks?null===this.waitingTasks?this.waitingTasks=[t]:this.waitingTasks.push(t):this.tasks.push(t)}flushTasksPromise(){if(this.processingTasks||null===this.currentSessionId||0===this.tasks.length||null===this.serviceUrl)return this.processingTasks&&(this.forceFlush=!0),Promise.resolve(!0);{this.processingTasks=!0;const t=new Xn("multiple");for(let e=0;e<this.tasks.length;e++)t.appendData(this.tasks[e].$bean);return gt("debug","Reporting:",t.$bean[0]),new Promise(((e,i)=>{this.transaction(t.$bean).done(((t,i,s)=>{this.failCount=0,this.waitingTasks?(this.tasks=this.waitingTasks,this.waitingTasks=null):(this.forceFlush=!1,this.tasks=[]),this.forceFlush&&this.tasks.length>0?(this.forceFlush=!1,this.processingTasks=!1,this.flushTasksPromise().then((()=>{e(!0)}))):(this.forceFlush=!1,e(!0),this.processingTasks=!1)})).fail(((t,e,s)=>{++this.failCount>this.maxFails&&this.stopReporting().then(),i(`Error reporting results to ${this.serviceUrl} [${e} ${s}]`),this.processingTasks=!1}))}))}}init(t){null==t&&(t=this.ps.options),super.init(t),this.initiated=!1,this.stopReporting(),this.serverPath=t.path||this.DEFAULT_SERVER_PATH,this.descriptionDetail=this.serverPath;let e=t.service||this.DEFAULT_SERVER_SERVICE;Kt(e,"/")||(e=`/${e}`);const i=t.protocol||this.DEFAULT_SERVER_PROTOCOL;this.serviceUrl=`${i}://${this.serverPath}${e}`;const n=new Xn("get_properties");return new Promise(((e,i)=>{this.transaction(n.$bean).done(((n,r,a)=>{this.dbProperties={},s()(n).find("param").each(((t,e)=>{const i=s()(e);this.dbProperties[i.attr("name")]=i.attr("value")})),this.promptUserId(!1).then((i=>{this.userId=i;const s=t.lap||this.getProperty("TIME_LAP",this.DEFAULT_TIMER_LAP);this.timerLap=Math.min(30,Math.max(1,parseInt(s))),this.timer=window.setInterval((()=>this.flushTasksPromise().then()),1e3*this.timerLap),this.beforeUnloadFunction=t=>{if(null!==this.serviceUrl&&(this.tasks.length>0||this.processingTasks)){this.flushTasksPromise().then();const e=pt("Please wait until the results of your activities are sent to the reports system");return t&&(t.returnValue=e),e}},window.addEventListener("beforeunload",this.beforeUnloadFunction),this.initiated=!0,e(!0)})).catch((t=>{this.stopReporting(),i(`Error getting the user ID: ${t}`)}))})).fail(((t,e,s)=>{this.stopReporting(),i(`Error initializing reports service ${this.serviceUrl} [${e} ${s}]`)}))}))}newSession(t){super.newSession(t),this.serviceUrl&&null!==this.userId&&(this.currentSessionId=null)}createDBSession(t){return null===this.currentSessionId||t?new Promise(((t,e)=>{this.initiated&&null!==this.userId&&null!==this.currentSession?this.flushTasksPromise().then((()=>{this.currentSessionId=null;const i=new Xn("add session");i.setParam("project",this.currentSession.projectName),i.setParam("activities",Number(this.currentSession.reportableActs)),i.setParam("time",Number(this.currentSession.started)),i.setParam("code",this.currentSession.code),i.setParam("user",this.userId),i.setParam("key",this.sessionKey),i.setParam("context",this.sessionContext),this.transaction(i.$bean).done(((e,i,n)=>{this.currentSessionId=s()(e).find('param[name="session"]').attr("value"),t(this.currentSessionId)})).fail(((t,i,s)=>{this.stopReporting(),e(`Error creating new reports session in ${this.serviceUrl} [${i} ${s}]`)}))})):e("Unable to start session in remote server!")})):Promise.resolve(this.currentSessionId)}end(){return this.reportActivity(!0),this.stopReporting().then(super.end())}transaction(t){return null===this.serviceUrl?null:s().ajax({method:"POST",url:this.serviceUrl,data:'<?xml version="1.0" encoding="UTF-8"?>'+(new XMLSerializer).serializeToString(t.get(0)).replace("minactions","minActions").replace("reportactions","reportActions"),contentType:"text/xml",dataType:"xml"})}getGroups(){return new Promise(((t,e)=>{if(this.userBased()){const i=new Xn("get groups");this.transaction(i.$bean).done(((e,i,n)=>{const r=[];s()(e).find("group").each(((t,e)=>{const i=s()(e);r.push({id:i.attr("id"),name:i.attr("name")})})),t(r)})).fail(((t,i,s)=>{e(`Error retrieving groups list from ${this.serviceUrl} [${i} ${s}]`)}))}else e("This system does not manage users!")}))}getUsers(t){return new Promise(((e,i)=>{if(this.userBased()){const n=new Xn("get users");null!=t&&n.setParam("group",t),this.transaction(n.$bean).done(((t,i,n)=>{const r=[];s()(t).find("user").each(((t,e)=>{const i=s()(e),n={id:i.attr("id"),name:i.attr("name")};i.attr("pwd")&&(n.pwd=i.attr("pwd")),r.push(n)})),e(r)})).fail(((t,e,s)=>{i(`Error retrieving users list from ${this.serviceUrl} [${e} ${s}]`)}))}else i("This system does not manage users!")}))}getUserData(t){return new Promise(((e,i)=>{if(this.userBased()){const n=new Xn("get user data");null!=t?n.setParam("user",t):i("Invalid user ID"),this.transaction(n.$bean).done(((t,i,n)=>{const r=s()(t).find("user");if(1!==r.length)window.alert(pt("Invalid user")),e("Invalid user ID");else{const t={id:r.attr("id"),name:r.attr("name")};r.attr("pwd")&&(t.pwd=r.attr("pwd")),e(t)}})).fail(((t,e,s)=>{i(`Error retrieving user data from ${this.serviceUrl} [${e} ${s}]`)}))}else i("This system does not manage users!")}))}stopReporting(){let t=null;return this.timer>=0&&(window.clearInterval(this.timer),this.timer=-1),this.beforeUnloadFunction&&(window.removeEventListener("beforeunload",this.beforeUnloadFunction),this.beforeUnloadFunction=null),this.initiated&&(t=this.flushTasksPromise().then((()=>{this.serviceUrl=null,this.descriptionDetail=`${this.serverPath} (${pt("not connected")})`,this.initiated=!1}))),t||Promise.resolve(!0)}reportActivity(t){if(this.lastActivity){this.lastActivity.closed||this.lastActivity.closeActivity();const e=this.actCount++,i=this.lastActivity;this.createDBSession(!1).then((()=>{const s=new Xn("add activity");s.setParam("session",this.currentSessionId),s.setParam("num",e),s.appendData(i.$getXML()),this.addTask(s),t&&this.flushTasksPromise().then()}))}null!==this.currentSession&&null!==this.currentSession.currentSequence&&this.currentSession.currentSequence.currentActivity!==this.lastActivity?this.lastActivity=this.currentSession.currentSequence.currentActivity:this.lastActivity=null}newActivity(t){super.newActivity(t),this.reportActivity(!1)}endActivity(t,e,i){super.endActivity(t,e,i),this.reportActivity(!0)}}Object.assign(Qn.prototype,{descriptionKey:"Reporting to remote server",descriptionDetail:"(not connected)",serverPath:"",beforeUnloadFunction:null,currentSessionId:"",lastActivity:null,actCount:0,serviceUrl:null,dbProperties:null,tasks:null,waitingTasks:null,processingTasks:!1,forceFlush:!1,timer:-1,timerLap:5,failCount:0,maxFails:5,DEFAULT_SERVER_PATH:"localhost:9000",DEFAULT_SERVER_SERVICE:"/JClicReportService",DEFAULT_SERVER_PROTOCOL:document&&document.location&&"http:"===document.location.protocol?"http":"https",DEFAULT_TIMER_LAP:20});class Xn{constructor(t,e){this.$bean=s()("<bean/>").attr({id:t}),e&&this.appendData(e)}appendData(t){t&&this.$bean.append(t)}setParam(t,e){null!=e&&this.appendData(s()("<param/>").attr({name:t,value:e}))}}Object.assign(Xn.prototype,{$bean:null}),Qn.ReportBean=Xn;var tr=is.registerClass("TCPReporter",Qn);class er extends is{constructor(t){super(t),this.key=`jclic_${(new Date).toISOString()}#${Math.ceil(1e3*Math.random())}`}init(t){return null==t&&(t=this.ps.options),"local"===t.storage&&(this.storage=window.localStorage,this.descriptionKey="Reporting to local storage"),is.prototype.init.call(this,t)}saveCurrentReport(){window.setTimeout((()=>{this.storage.setItem(this.key,JSON.stringify(this.getData()))}),0)}endSequence(){super.endSequence(),this.saveCurrentReport()}endActivity(t,e,i){super.endActivity(t,e,i),this.saveCurrentReport()}}Object.assign(er.prototype,{storage:window.sessionStorage,descriptionKey:"Reporting to session storage",descriptionDetail:"(browser session)",key:null});var ir=is.registerClass("SessionStorageReporter",er);const sr={Deps:{DefaultSkin:ds,OrangeSkin:fs,GreenSkin:ms,BlueSkin:bs,SimpleSkin:ws,MiniSkin:xs,EmptySkin:ks,CustomSkin:Es,Rectangular:Bs,Holes:Is,JigSaw:Ps,TriangularJigSaw:_s,ClassicJigSaw:Rs,Arith:Vs,TextActivityBase:js,FillInBlanks:Us,OrderText:Zs,Complete:Qs,IdentifyText:en,WrittenAnswer:un,InformationScreen:fn,Identify:vn,Explore:wn,Menu:Cn,DoublePuzzle:En,ExchangePuzzle:In,HolePuzzle:Dn,MemoryGame:Mn,SimpleAssociation:Vn,ComplexAssociation:jn,WordSearch:Jn,CrossWord:Yn,TCPReporter:tr,SessionStorageReporter:ir},JClicPlayer:ns,JClicProject:qi,AWT:Ie,Utils:ge,$:s(),options:"undefined"==typeof JClicDataOptions?{}:JClicDataOptions,projectFiles:{},currentPlayers:[],loadProject:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i=dt({...sr.options,...i},!0,!1);let n=null;for(const e of sr.currentPlayers)if(e&&e.$topDiv&&e.$topDiv.get(-1)===t){gt("debug","Existing JClicPlayer found in div. I will try to reuse it."),n=e;for(const t of Object.getOwnPropertyNames(i))if(!n.options.hasOwnProperty(t)||n.options[t]!==i[t]){gt("debug","Existing JClicPlayer has diferent options! Creating a new one from scratch."),n=null;break}break}n?n.reset():(gt("debug","Creating a new instance of JClicPlayer"),n=new ns(s()(t).empty(),i));e&&n.initReporter().then((()=>n.load(e))).catch((e=>{gt("error",`Unable to start reporting: ${e.toString()}.\n JClicPlayer will be removed.'`),s()(t).empty().removeAttr("style").append(s()("<h2/>").html(n.getMsg("ERROR"))).append(s()("<p/>").html(e));const i=sr.currentPlayers.indexOf(n);i>=0&&sr.currentPlayers.splice(i,1),n=null}));n&&!1!==i.savePlayersRef&&-1===sr.currentPlayers.indexOf(n)&&sr.currentPlayers.push(n);return n}};if("undefined"!=typeof window){window.JClicObject=sr;const t=()=>sr.currentPlayers.forEach((t=>{t&&t.skin&&t.skin.fit()}));s()(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",t),s()(window).on("resize",t)}s()((function(){let t="undefined"==typeof JClicDataOptions?{}:JClicDataOptions;if(sr.options=t,!t.noInit){let e="string"==typeof JClicDataProject?JClicDataProject:"string"==typeof sr.projectFile?sr.projectFile:null;t.browserHistory=1===s()("body>div.JClic").length||t.browserHistory&&1===s()(".JClic").length,s()(".JClic").each(((i,n)=>{const r=s()(n),a=r.data("project");a&&(e=a);const o=r.data("options");o&&(t=s().extend(Object.create(t),o)),sr.loadProject(n,e,t)}))}}))}()}();
|
|
27
27
|
//# sourceMappingURL=jclic.min.js.map
|