@gamelearn/arcade-components 3.2.7 → 3.3.0

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.
@@ -61,7 +61,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
61
61
  `).split(`
62
62
  `),T="00:00.000",P=0,w=0,O=0,k=[],D,F=!0,G=new u.default;G.oncue=function(V){var W=g[S],Z=g.ccOffset;W&&W.new&&(w!==void 0?Z=g.ccOffset=W.start:y(g,S,O)),O&&(Z=O-g.presentationOffset),V.startTime+=Z-w,V.endTime+=Z-w,V.id=h(V.startTime.toString())+h(V.endTime.toString())+h(V.text),V.text=decodeURIComponent(encodeURIComponent(V.text)),V.endTime>0&&k.push(V)},G.onparsingerror=function(V){D=V},G.onflush=function(){if(D&&R){R(D);return}C(k)},A.forEach(function(V){if(F)if(f(V,"X-TIMESTAMP-MAP=")){F=!1,V.substr(16).split(",").forEach(function(W){f(W,"LOCAL:")?T=W.substr(6):f(W,"MPEGTS:")&&(P=parseInt(W.substr(7)))});try{_+(g[S].start*9e4||0)<0&&(_+=8589934592),P-=_,w=c(T)/1e3,O=P/9e4,w===-1&&(D=new Error("Malformed X-TIMESTAMP-MAP: "+V))}catch{D=new Error("Malformed X-TIMESTAMP-MAP: "+V)}return}else V===""&&(F=!1);G.parse(V+`
63
63
  `)}),G.flush()}};t.default=E}).call(this,n("./src/polyfills/number.js").Number)},"./src/utils/xhr-loader.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/logger.js"),u=window.performance,l=window.XMLHttpRequest,f=function(){function c(h){h&&h.xhrSetup&&(this.xhrSetup=h.xhrSetup)}return c.prototype.destroy=function(){this.abort(),this.loader=null},c.prototype.abort=function(){var h=this.loader;h&&h.readyState!==4&&(this.stats.aborted=!0,h.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},c.prototype.load=function(h,y,E){this.context=h,this.config=y,this.callbacks=E,this.stats={trequest:u.now(),retry:0},this.retryDelay=y.retryDelay,this.loadInternal()},c.prototype.loadInternal=function(){var h,y=this.context;h=this.loader=new l;var E=this.stats;E.tfirst=0,E.loaded=0;var p=this.xhrSetup;try{if(p)try{p(h,y.url)}catch{h.open("GET",y.url,!0),p(h,y.url)}h.readyState||h.open("GET",y.url,!0)}catch(_){this.callbacks.onError({code:h.status,text:_.message},y,h);return}y.rangeEnd&&h.setRequestHeader("Range","bytes="+y.rangeStart+"-"+(y.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=y.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),h.send()},c.prototype.readystatechange=function(h){var y=h.currentTarget,E=y.readyState,p=this.stats,_=this.context,g=this.config;if(!p.aborted&&E>=2)if(window.clearTimeout(this.requestTimeout),p.tfirst===0&&(p.tfirst=Math.max(u.now(),p.trequest)),E===4){var S=y.status;if(S>=200&&S<300){p.tload=Math.max(p.tfirst,u.now());var C=void 0,R=void 0;_.responseType==="arraybuffer"?(C=y.response,R=C.byteLength):(C=y.responseText,R=C.length),p.loaded=p.total=R;var x={url:y.responseURL,data:C};this.callbacks.onSuccess(x,p,_,y)}else p.retry>=g.maxRetry||S>=400&&S<499?(a.logger.error(S+" while loading "+_.url),this.callbacks.onError({code:S,text:y.statusText},_,y)):(a.logger.warn(S+" while loading "+_.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,g.maxRetryDelay),p.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),g.timeout)},c.prototype.loadtimeout=function(){a.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},c.prototype.loadprogress=function(h){var y=h.currentTarget,E=this.stats;E.loaded=h.loaded,h.lengthComputable&&(E.total=h.total);var p=this.callbacks.onProgress;p&&p(E,this.context,null,y)},c}();t.default=f}}).default})})(hls);var hlsExports=hls.exports;const Hls=getDefaultExportFromCjs(hlsExports);var propTypes={exports:{}},ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var o="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1=o,ReactPropTypesSecret_1}var checkPropTypes_1,hasRequiredCheckPropTypes;function requireCheckPropTypes(){if(hasRequiredCheckPropTypes)return checkPropTypes_1;hasRequiredCheckPropTypes=1;var o=function(){};if(process.env.NODE_ENV!=="production"){var e=requireReactPropTypesSecret(),r={},t=Function.call.bind(Object.prototype.hasOwnProperty);o=function(a){var u="Warning: "+a;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}}}function n(a,u,l,f,c){if(process.env.NODE_ENV!=="production"){for(var h in a)if(t(a,h)){var y;try{if(typeof a[h]!="function"){var E=Error((f||"React class")+": "+l+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.");throw E.name="Invariant Violation",E}y=a[h](u,h,f,l,null,e)}catch(_){y=_}if(y&&!(y instanceof Error)&&o((f||"React class")+": type specification of "+l+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof y+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),y instanceof Error&&!(y.message in r)){r[y.message]=!0;var p=c?c():"";o("Failed "+l+" type: "+y.message+(p??""))}}}}return n.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},checkPropTypes_1=n,checkPropTypes_1}var factoryWithTypeCheckers,hasRequiredFactoryWithTypeCheckers;function requireFactoryWithTypeCheckers(){if(hasRequiredFactoryWithTypeCheckers)return factoryWithTypeCheckers;hasRequiredFactoryWithTypeCheckers=1;var o=requireReactIs(),e=requireObjectAssign(),r=requireReactPropTypesSecret(),t=requireCheckPropTypes(),n=Function.call.bind(Object.prototype.hasOwnProperty),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(l){var f="Warning: "+l;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function u(){return null}return factoryWithTypeCheckers=function(l,f){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function y(I){var $=I&&(c&&I[c]||I[h]);if(typeof $=="function")return $}var E="<<anonymous>>",p={array:C("array"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:R(),arrayOf:x,element:A(),elementType:T(),instanceOf:P,node:D(),objectOf:O,oneOf:w,oneOfType:k,shape:F,exact:G};function _(I,$){return I===$?I!==0||1/I===1/$:I!==I&&$!==$}function g(I){this.message=I,this.stack=""}g.prototype=Error.prototype;function S(I){if(process.env.NODE_ENV!=="production")var $={},z=0;function X(J,ne,se,ee,ie,oe,fe){if(ee=ee||E,oe=oe||se,fe!==r){if(f){var de=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw de.name="Invariant Violation",de}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ce=ee+":"+se;!$[ce]&&z<3&&(a("You are manually calling a React.PropTypes validation function for the `"+oe+"` prop on `"+ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),$[ce]=!0,z++)}}return ne[se]==null?J?ne[se]===null?new g("The "+ie+" `"+oe+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new g("The "+ie+" `"+oe+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:I(ne,se,ee,ie,oe)}var Q=X.bind(null,!1);return Q.isRequired=X.bind(null,!0),Q}function C(I){function $(z,X,Q,J,ne,se){var ee=z[X],ie=Z(ee);if(ie!==I){var oe=q(ee);return new g("Invalid "+J+" `"+ne+"` of type "+("`"+oe+"` supplied to `"+Q+"`, expected ")+("`"+I+"`."))}return null}return S($)}function R(){return S(u)}function x(I){function $(z,X,Q,J,ne){if(typeof I!="function")return new g("Property `"+ne+"` of component `"+Q+"` has invalid PropType notation inside arrayOf.");var se=z[X];if(!Array.isArray(se)){var ee=Z(se);return new g("Invalid "+J+" `"+ne+"` of type "+("`"+ee+"` supplied to `"+Q+"`, expected an array."))}for(var ie=0;ie<se.length;ie++){var oe=I(se,ie,Q,J,ne+"["+ie+"]",r);if(oe instanceof Error)return oe}return null}return S($)}function A(){function I($,z,X,Q,J){var ne=$[z];if(!l(ne)){var se=Z(ne);return new g("Invalid "+Q+" `"+J+"` of type "+("`"+se+"` supplied to `"+X+"`, expected a single ReactElement."))}return null}return S(I)}function T(){function I($,z,X,Q,J){var ne=$[z];if(!o.isValidElementType(ne)){var se=Z(ne);return new g("Invalid "+Q+" `"+J+"` of type "+("`"+se+"` supplied to `"+X+"`, expected a single ReactElement type."))}return null}return S(I)}function P(I){function $(z,X,Q,J,ne){if(!(z[X]instanceof I)){var se=I.name||E,ee=U(z[X]);return new g("Invalid "+J+" `"+ne+"` of type "+("`"+ee+"` supplied to `"+Q+"`, expected ")+("instance of `"+se+"`."))}return null}return S($)}function w(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),u;function $(z,X,Q,J,ne){for(var se=z[X],ee=0;ee<I.length;ee++)if(_(se,I[ee]))return null;var ie=JSON.stringify(I,function(fe,de){var ce=q(de);return ce==="symbol"?String(de):de});return new g("Invalid "+J+" `"+ne+"` of value `"+String(se)+"` "+("supplied to `"+Q+"`, expected one of "+ie+"."))}return S($)}function O(I){function $(z,X,Q,J,ne){if(typeof I!="function")return new g("Property `"+ne+"` of component `"+Q+"` has invalid PropType notation inside objectOf.");var se=z[X],ee=Z(se);if(ee!=="object")return new g("Invalid "+J+" `"+ne+"` of type "+("`"+ee+"` supplied to `"+Q+"`, expected an object."));for(var ie in se)if(n(se,ie)){var oe=I(se,ie,Q,J,ne+"."+ie,r);if(oe instanceof Error)return oe}return null}return S($)}function k(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var $=0;$<I.length;$++){var z=I[$];if(typeof z!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(z)+" at index "+$+"."),u}function X(Q,J,ne,se,ee){for(var ie=0;ie<I.length;ie++){var oe=I[ie];if(oe(Q,J,ne,se,ee,r)==null)return null}return new g("Invalid "+se+" `"+ee+"` supplied to "+("`"+ne+"`."))}return S(X)}function D(){function I($,z,X,Q,J){return V($[z])?null:new g("Invalid "+Q+" `"+J+"` supplied to "+("`"+X+"`, expected a ReactNode."))}return S(I)}function F(I){function $(z,X,Q,J,ne){var se=z[X],ee=Z(se);if(ee!=="object")return new g("Invalid "+J+" `"+ne+"` of type `"+ee+"` "+("supplied to `"+Q+"`, expected `object`."));for(var ie in I){var oe=I[ie];if(oe){var fe=oe(se,ie,Q,J,ne+"."+ie,r);if(fe)return fe}}return null}return S($)}function G(I){function $(z,X,Q,J,ne){var se=z[X],ee=Z(se);if(ee!=="object")return new g("Invalid "+J+" `"+ne+"` of type `"+ee+"` "+("supplied to `"+Q+"`, expected `object`."));var ie=e({},z[X],I);for(var oe in ie){var fe=I[oe];if(!fe)return new g("Invalid "+J+" `"+ne+"` key `"+oe+"` supplied to `"+Q+"`.\nBad object: "+JSON.stringify(z[X],null," ")+`
64
- Valid keys: `+JSON.stringify(Object.keys(I),null," "));var de=fe(se,oe,Q,J,ne+"."+oe,r);if(de)return de}return null}return S($)}function V(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(V);if(I===null||l(I))return!0;var $=y(I);if($){var z=$.call(I),X;if($!==I.entries){for(;!(X=z.next()).done;)if(!V(X.value))return!1}else for(;!(X=z.next()).done;){var Q=X.value;if(Q&&!V(Q[1]))return!1}}else return!1;return!0;default:return!1}}function W(I,$){return I==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function Z(I){var $=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":W($,I)?"symbol":$}function q(I){if(typeof I>"u"||I===null)return""+I;var $=Z(I);if($==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return $}function B(I){var $=q(I);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function U(I){return!I.constructor||!I.constructor.name?E:I.constructor.name}return p.checkPropTypes=t,p.resetWarningCache=t.resetWarningCache,p.PropTypes=p,p},factoryWithTypeCheckers}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var o=requireReactPropTypesSecret();function e(){}function r(){}return r.resetWarningCache=e,factoryWithThrowingShims=function(){function t(u,l,f,c,h,y){if(y!==o){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}t.isRequired=t;function n(){return t}var a={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,elementType:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},factoryWithThrowingShims}if(process.env.NODE_ENV!=="production"){var ReactIs=requireReactIs(),throwOnDirectAccess=!0;propTypes.exports=requireFactoryWithTypeCheckers()(ReactIs.isElement,throwOnDirectAccess)}else propTypes.exports=requireFactoryWithThrowingShims()();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function BufferBar({time:o,setTimePoint:e,mandatory:r,mandatoryHasBeenViewed:t,viewed:n}){const a=Math.trunc(o.current*1e3/o.duration)/10,u=React$2.useRef(),[l,f]=React$2.useState(!1),c=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),h=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),y=(g,S)=>{f(!0);let C=g.offsetX;g.changedTouches&&(C=g.changedTouches[0].clientX);const R=S.offsetWidth+S.offsetLeft;C<=R&&C>=S.offsetLeft&&e(C,S.offsetWidth,S.offsetLeft)},E=()=>{window.onmousemove=null,window.onmouseup=null,f(!1)},p=g=>{window.onmousemove=S=>y(S,g),window.onmouseup=S=>E()},_=(g,S)=>{(!r||r&&t||n)&&(g.preventDefault(),e(g.clientX,S.offsetWidth,S.offsetLeft),p(S),f(!0))};return jsxRuntimeExports.jsx("div",{id:"buffer",ref:u,className:"video--controls__bar",onMouseDown:g=>{const S=u.current;_(g,S)},onTouchMove:g=>{const S=u.current;y(g,S)},onTouchStart:g=>{const S=u.current;f(!0),e(g.changedTouches[0].clientX,S.offsetWidth,S.offsetLeft)},children:jsxRuntimeExports.jsx("div",{className:"video--controls__progress",style:{width:`${a}%`},children:jsxRuntimeExports.jsx("span",{className:l?"video--controls__handle active":"video--controls__handle",children:l?jsxRuntimeExports.jsxs("div",{className:"video--current__time active",children:[c,":",h]}):null})})})}BufferBar.defaultProps={time:{current:0,duration:0},setTimePoint:()=>{}};BufferBar.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number}),setTimePoint:PropTypes.func};function Timer({time:o}){const e=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),r=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),t=Math.trunc(o.duration/60)<10?["0",Math.trunc(o.duration/60)].join("").trim():Math.trunc(o.duration/60),n=Math.trunc(o.duration%60)<10?["0",Math.trunc(o.duration%60)].join("").trim():Math.trunc(o.duration%60);return jsxRuntimeExports.jsxs("div",{className:"video--time",children:[jsxRuntimeExports.jsxs("span",{className:"time",children:[e,":",r]}),jsxRuntimeExports.jsxs("span",{className:"duration",children:[t,":",n]})]})}Timer.defaultProps={time:{current:0,duration:0}};Timer.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};function ControlButtons({pauseVideo:o,paused:e,translate:r}){return jsxRuntimeExports.jsx("div",{className:"video--controls__buttons",children:jsxRuntimeExports.jsx("button",{id:"playPause","aria-label":r(e?"storylines.misc.play":"storylines.misc.pause"),className:e?"unset-button icon-play":"unset-button icon-pause",type:"button",onClick:()=>{o(),document.querySelector("#playPause").blur()}})})}ControlButtons.defaultProps={paused:!1,pauseVideo:()=>{}};function FinishedVideoButtons({restart:o,translate:e}){return jsxRuntimeExports.jsx("div",{className:"video--extra__actions video--extra__actions--widthTransparencyLayer position--absolute z-index1",children:jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>{o()},className:"gat--btn gat--btn__secondary","aria-label":e("video.replay"),children:[jsxRuntimeExports.jsx("span",{className:"icon-rewind"}),jsxRuntimeExports.jsx("span",{id:"video.replay"})]})})}FinishedVideoButtons.defaultProps={restart:()=>{},finished:!1};function PlayInitButton({play:o,finished:e,paused:r}){return e||!r?jsxRuntimeExports.jsx("div",{}):jsxRuntimeExports.jsx("div",{className:"video--extra__actions position--absolute z-index1",children:jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,"aria-label":"play video",onKeyUp:()=>{},onClick:()=>{o()},className:"play--video__button",children:jsxRuntimeExports.jsx("span",{className:"icon-play-outline"})})})}PlayInitButton.defaultProps={play:()=>{},finished:!1,paused:!1};function skipButton({viewed:o,mandatory:e,finished:r,skip:t,mandatoryHasBeenViewed:n,translate:a}){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&o||!e||r||n?jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{className:"gat--btn__round gat--btn__close",type:"button","aria-label":a("storylines.misc.closePiece"),onKeyUp:()=>{},onClick:()=>{t()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}):null})}skipButton.defaultProps={mandatory:!1,viewed:!1,finished:!1,skip:()=>{}};function VolumeBar({volume:o,muted:e,setVolume:r,mute:t}){const n=React$2.useRef(),a=e?0:Math.floor(o*100),u=(h,y)=>{const E=y.offsetWidth+y.offsetLeft;let p=h.clientX;h.changedTouches&&(p=h.changedTouches[0].clientX),p<=E&&p>=y.offsetLeft&&r(p,y.offsetWidth,y.offsetLeft)},l=()=>{window.onmousemove=null,window.onmouseup=null},f=h=>{window.onmousemove=y=>u(y,h),window.onmouseup=y=>l()},c=(h,y)=>{h.preventDefault(),r(h.clientX,y.offsetWidth,y.offsetLeft),f(y)};return jsxRuntimeExports.jsxs("div",{className:"video--sound",children:[jsxRuntimeExports.jsx("span",{onClick:()=>t(),className:a===0?"icon-sound-off":"icon-sound"}),jsxRuntimeExports.jsx("div",{ref:n,onMouseDown:h=>{const y=n.current;c(h,y)},onTouchMove:h=>{const y=n.current;u(h,y)},onTouchStart:h=>{const y=n.current;r(h.changedTouches[0].clientX,y.offsetWidth,y.offsetLeft)},id:"volume",className:"video--sound__level",children:jsxRuntimeExports.jsx("span",{style:{width:`${a<10?10:a}%`},className:"video--sound__progress",children:jsxRuntimeExports.jsx("span",{className:"video--handle"})})})]})}VolumeBar.defaultProps={volume:0,muted:!1,setVolume:()=>{},mute:()=>{}};VolumeBar.propTypes={volume:PropTypes.number,setVolume:PropTypes.func,mute:PropTypes.func,muted:PropTypes.bool};function VideoControllers({pause:o,mandatory:e,viewed:r,skip:t,rewind:n,paused:a,time:u,finished:l,restart:f,volume:c,muted:h,mute:y,setVolume:E,setTimePoint:p,audioAnimation:_,mandatoryHasBeenViewed:g,translate:S,visibility:C}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(skipButton,{mandatory:e,finished:l,viewed:r,skip:t,rewind:n,mandatoryHasBeenViewed:g,translate:S}),jsxRuntimeExports.jsxs("div",{className:`video--controls-wrap ${C?"video--controls-wrap--hidden":""}`,children:[_?null:jsxRuntimeExports.jsx(PlayInitButton,{play:o,paused:a,finished:l}),l?jsxRuntimeExports.jsx(FinishedVideoButtons,{restart:f,translate:S}):null,jsxRuntimeExports.jsxs("div",{className:"video--controls",children:[jsxRuntimeExports.jsx(BufferBar,{mandatory:e,mandatoryHasBeenViewed:g,time:u,setTimePoint:p,finished:l,viewed:r}),jsxRuntimeExports.jsxs("div",{className:"video--controls__actions",children:[jsxRuntimeExports.jsx(Timer,{time:u}),_?jsxRuntimeExports.jsx("div",{className:"audio-animation-wrap",children:jsxRuntimeExports.jsx("div",{className:`audio-animation ${a?"audio-animation--notAnimate ":null}`})}):null,jsxRuntimeExports.jsx(ControlButtons,{paused:a,pauseVideo:o,translate:S}),jsxRuntimeExports.jsx(VolumeBar,{muted:h,mute:y,volume:c,setVolume:E})]})]})]})]})}VideoControllers.defaultProps={audioAnimation:!1,paused:!1,mandatory:!1,viewed:!1,volume:0,muted:!1,finished:!1,restart:()=>{},pause:()=>{},skip:()=>{},rewind:()=>{},setTimePoint:()=>{},setVolume:()=>{},mute:()=>{},time:{current:0,duration:0}};VideoControllers.propTypes={audioAnimation:PropTypes.bool,paused:PropTypes.bool,mandatory:PropTypes.bool,muted:PropTypes.bool,volume:PropTypes.number,viewed:PropTypes.bool,pause:PropTypes.func,finished:PropTypes.bool,restart:PropTypes.func,skip:PropTypes.func,rewind:PropTypes.func,mute:PropTypes.func,setTimePoint:PropTypes.func,setVolume:PropTypes.func,time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};const defaultBgImageForAudio="https://min.gamelearn.io/css-resources/gamelearn/resources/bgAudioPiece.jpg";function VideoVisor({documentType:o,url:e,required:r,viewed:t,backgroundImage:n,soundActions:a,endVideo:u,translate:l}){const[f,c]=React$2.useState(!1),[h]=a,[y,E]=React$2.useState(0),[p,_]=React$2.useState(0),[g,S]=React$2.useState(!1),[C,R]=React$2.useState(!0),[x,A]=React$2.useState(!1),[T,P]=React$2.useState(),[w,O]=React$2.useState(0),[k,D]=React$2.useState(!1),F=e&&e.match(/\.m3u8(\?.+=.+)*$/i)&&Hls.isSupported(),G=e&&(e.match(/youtube/i)||e.match(/vimeo/i)),V=e&&(e.match(/.mp3/i)||e.match(/.ogg/i)||e.match(/.wav/i)||e.match(/.m4a/i)),W={ref:fe=>{P(fe)},src:e,style:{height:"100%",width:"100%"}},Z=()=>{r&&c(!0),S(!1),T.pause(),R(!0),A(!0),D(!1),o!=="document"&&o!=="lesson"&&u()},q=()=>{u()},B=()=>{R(!1),S(!1)},U=()=>{S(!0)},I=()=>{S(!1),E(T.duration)};React$2.useEffect(()=>{let fe;if(T){if(F){fe=new Hls;const de=`${e}?v=${Math.floor(Math.random()*99999999)}`;fe.loadSource(de),fe.attachMedia(T),fe.on(Hls.Events.FRAG_LOAD_PROGRESS,(ce,Se)=>{const{stats:ke}=Se;_(ke.loaded*100/ke.total)})}return()=>{fe&&fe.destroy(),fe=null}}},[F,e,T]);const $=()=>{T.currentTime-=15},z=()=>{h("click-ui"),C?(T.play(),A(!1)):T.pause(),R(!C)},X=(fe,de,ce)=>{A(!1),T.currentTime=de?parseFloat((fe-ce)/de*T.duration):0},Q=()=>{A(!1),T.currentTime=0,z()},J=()=>{h("click-ui"),T.muted=!T.muted},ne=(fe,de,ce)=>{T.muted=!1;const Se=fe-ce>=0?(fe-ce)/de:0;T.volume=Se*100>10?Se:0,O(T.volume)};React$2.useEffect(()=>{let fe;return!k&&!C&&(fe=setTimeout(()=>{D(!0),clearTimeout(fe)},3e3)),()=>clearTimeout(fe)},[k,C]);const se=()=>{k&&D(!1)},ee=n||defaultBgImageForAudio,ie=ee===defaultBgImageForAudio?"cover":"contain",oe={backgroundImage:`url("${ee}")`,backgroundSize:ie,backgroundRepeat:"no-repeat",backgroundPosition:"center center"};return jsxRuntimeExports.jsx("div",{className:`video ${r&&!f&&!t?"forward-disabled":""}`,style:V?oe:null,children:G?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{type:"button","aria-label":l("storylines.misc.closePiece"),className:"gat--btn__round gat--btn__close",onClick:()=>{h("click-ui"),u()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}),jsxRuntimeExports.jsx("iframe",{className:"embeddedVideo",title:"title",...W})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(VideoControllers,{visibility:k,mandatoryHasBeenViewed:f,audioAnimation:!!V,skip:u,mandatory:r,viewed:t,volume:T?T.volume:0,mute:J,muted:T?T.muted:!1,paused:C,finished:x,restart:Q,setTimePoint:X,time:{duration:y,current:T?T.currentTime:0},rewind:$,pause:z,volumeState:w,setVolume:ne,translate:l}),jsxRuntimeExports.jsx("video",{onMouseMove:()=>se(),onClick:()=>{se()},onFocus:()=>{se()},onCanPlayThrough:I,onWaiting:U,onEnded:Z,onError:q,onPlaying:B,...W,children:jsxRuntimeExports.jsx("track",{kind:"captions"})}),g?jsxRuntimeExports.jsxs("div",{className:"video-loading-container",style:{top:0,left:0},children:[jsxRuntimeExports.jsx("div",{className:"video-loading-container-bg opacity-wrapper"}),jsxRuntimeExports.jsx("div",{className:"popup-alert warning",children:jsxRuntimeExports.jsx("div",{className:"popup-message",children:jsxRuntimeExports.jsx("p",{children:Math.floor(p)})})})]}):null]})})}VideoVisor.defaultProps={url:"",name:"",backgroundImage:null,documentType:"",required:!1,viewed:!1,endVideo:()=>{}};function VideoComponent({emitEvent:o,name:e,documentType:r,document:t,documentId_labelId:n,soundActions:a,required:u,viewed:l,visible:f,img:c,imgId_labelId:h,keyboardControl:y}){const E=S=>o({type:"translate",payload:S}),{url:p}=t,_=React$2.useMemo(()=>({documentId:n,imgId:h,required:u,name:e,type:"video",viewed:l,documentType:r}),[n,h,u,e,l,r]),g=React$2.useCallback(()=>{o({type:"finishMedia",payload:_})},[o,_]);return React$2.useEffect(()=>{f||g()},[g,f]),f?(y(null,l?null:g,l?null:g),jsxRuntimeExports.jsx(VideoVisor,{backgroundImage:c==null?void 0:c.url,url:p,soundActions:a,documentType:r,required:u,viewed:l,endVideo:()=>g(),translate:E})):null}var htmlReactParser={exports:{}},lib$4={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(lib$4,"__esModule",{value:!0});function _slicedToArray(o,e){return _arrayWithHoles(o)||_iterableToArrayLimit(o,e)||_unsupportedIterableToArray(o,e)||_nonIterableRest()}function _arrayWithHoles(o){if(Array.isArray(o))return o}function _iterableToArrayLimit(o,e){var r=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(r!=null){var t=[],n=!0,a=!1,u,l;try{for(r=r.call(o);!(n=(u=r.next()).done)&&(t.push(u.value),!(e&&t.length===e));n=!0);}catch(f){a=!0,l=f}finally{try{!n&&r.return!=null&&r.return()}finally{if(a)throw l}}return t}}function _unsupportedIterableToArray(o,e){if(o){if(typeof o=="string")return _arrayLikeToArray(o,e);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(o,e)}}function _arrayLikeToArray(o,e){(e==null||e>o.length)&&(e=o.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=o[r];return t}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
64
+ Valid keys: `+JSON.stringify(Object.keys(I),null," "));var de=fe(se,oe,Q,J,ne+"."+oe,r);if(de)return de}return null}return S($)}function V(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(V);if(I===null||l(I))return!0;var $=y(I);if($){var z=$.call(I),X;if($!==I.entries){for(;!(X=z.next()).done;)if(!V(X.value))return!1}else for(;!(X=z.next()).done;){var Q=X.value;if(Q&&!V(Q[1]))return!1}}else return!1;return!0;default:return!1}}function W(I,$){return I==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function Z(I){var $=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":W($,I)?"symbol":$}function q(I){if(typeof I>"u"||I===null)return""+I;var $=Z(I);if($==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return $}function B(I){var $=q(I);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function U(I){return!I.constructor||!I.constructor.name?E:I.constructor.name}return p.checkPropTypes=t,p.resetWarningCache=t.resetWarningCache,p.PropTypes=p,p},factoryWithTypeCheckers}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var o=requireReactPropTypesSecret();function e(){}function r(){}return r.resetWarningCache=e,factoryWithThrowingShims=function(){function t(u,l,f,c,h,y){if(y!==o){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}t.isRequired=t;function n(){return t}var a={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,elementType:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},factoryWithThrowingShims}if(process.env.NODE_ENV!=="production"){var ReactIs=requireReactIs(),throwOnDirectAccess=!0;propTypes.exports=requireFactoryWithTypeCheckers()(ReactIs.isElement,throwOnDirectAccess)}else propTypes.exports=requireFactoryWithThrowingShims()();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function BufferBar({time:o,setTimePoint:e,mandatory:r,mandatoryHasBeenViewed:t,viewed:n}){const a=Math.trunc(o.current*1e3/o.duration)/10,u=React$2.useRef(),[l,f]=React$2.useState(!1),c=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),h=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),y=(g,S)=>{f(!0);let C=g.offsetX;g.changedTouches&&(C=g.changedTouches[0].clientX);const R=S.offsetWidth+S.offsetLeft;C<=R&&C>=S.offsetLeft&&e(C,S.offsetWidth,S.offsetLeft)},E=()=>{window.onmousemove=null,window.onmouseup=null,f(!1)},p=g=>{window.onmousemove=S=>y(S,g),window.onmouseup=S=>E()},_=(g,S)=>{(!r||r&&t||n)&&(g.preventDefault(),e(g.clientX,S.offsetWidth,S.offsetLeft),p(S),f(!0))};return jsxRuntimeExports.jsx("div",{id:"buffer",ref:u,className:"video--controls__bar",onMouseDown:g=>{const S=u.current;_(g,S)},onTouchMove:g=>{const S=u.current;y(g,S)},onTouchStart:g=>{const S=u.current;f(!0),e(g.changedTouches[0].clientX,S.offsetWidth,S.offsetLeft)},children:jsxRuntimeExports.jsx("div",{className:"video--controls__progress",style:{width:`${a}%`},children:jsxRuntimeExports.jsx("span",{className:l?"video--controls__handle active":"video--controls__handle",children:l?jsxRuntimeExports.jsxs("div",{className:"video--current__time active",children:[c,":",h]}):null})})})}BufferBar.defaultProps={time:{current:0,duration:0},setTimePoint:()=>{}};BufferBar.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number}),setTimePoint:PropTypes.func};function Timer({time:o}){const e=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),r=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),t=Math.trunc(o.duration/60)<10?["0",Math.trunc(o.duration/60)].join("").trim():Math.trunc(o.duration/60),n=Math.trunc(o.duration%60)<10?["0",Math.trunc(o.duration%60)].join("").trim():Math.trunc(o.duration%60);return jsxRuntimeExports.jsxs("div",{className:"video--time",children:[jsxRuntimeExports.jsxs("span",{className:"time",children:[e,":",r]}),jsxRuntimeExports.jsxs("span",{className:"duration",children:[t,":",n]})]})}Timer.defaultProps={time:{current:0,duration:0}};Timer.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};function ControlButtons({pauseVideo:o,paused:e,translate:r}){return jsxRuntimeExports.jsx("div",{className:"video--controls__buttons",children:jsxRuntimeExports.jsx("button",{id:"playPause","aria-label":r(e?"storylines.misc.play":"storylines.misc.pause"),className:e?"unset-button icon-play":"unset-button icon-pause",type:"button",onClick:()=>{o(),document.querySelector("#playPause").blur()}})})}ControlButtons.defaultProps={paused:!1,pauseVideo:()=>{}};function FinishedVideoButtons({restart:o,translate:e}){return jsxRuntimeExports.jsx("div",{className:"video--extra__actions video--extra__actions--widthTransparencyLayer position--absolute z-index1",children:jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>{o()},className:"gat--btn gat--btn__secondary","aria-label":e("video.replay"),children:[jsxRuntimeExports.jsx("span",{className:"icon-rewind"}),jsxRuntimeExports.jsx("span",{id:"video.replay"})]})})}FinishedVideoButtons.defaultProps={restart:()=>{},finished:!1};function PlayInitButton({play:o,finished:e,paused:r}){return e||!r?jsxRuntimeExports.jsx("div",{}):jsxRuntimeExports.jsx("div",{className:"video--extra__actions position--absolute z-index1",children:jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,"aria-label":"play video",onKeyUp:()=>{},onClick:()=>{o()},className:"play--video__button",children:jsxRuntimeExports.jsx("span",{className:"icon-play-outline"})})})}PlayInitButton.defaultProps={play:()=>{},finished:!1,paused:!1};function skipButton({viewed:o,mandatory:e,finished:r,skip:t,mandatoryHasBeenViewed:n,translate:a}){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&o||!e||r||n?jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{className:"gat--btn__round gat--btn__close",type:"button","aria-label":a("storylines.misc.closePiece"),onKeyUp:()=>{},onClick:()=>{t()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}):null})}skipButton.defaultProps={mandatory:!1,viewed:!1,finished:!1,skip:()=>{}};function VolumeBar({volume:o,muted:e,setVolume:r,mute:t}){const n=React$2.useRef(),a=e?0:Math.floor(o*100),u=(h,y)=>{const E=y.offsetWidth+y.offsetLeft;let p=h.clientX;h.changedTouches&&(p=h.changedTouches[0].clientX),p<=E&&p>=y.offsetLeft&&r(p,y.offsetWidth,y.offsetLeft)},l=()=>{window.onmousemove=null,window.onmouseup=null},f=h=>{window.onmousemove=y=>u(y,h),window.onmouseup=y=>l()},c=(h,y)=>{h.preventDefault(),r(h.clientX,y.offsetWidth,y.offsetLeft),f(y)};return jsxRuntimeExports.jsxs("div",{className:"video--sound",children:[jsxRuntimeExports.jsx("span",{onClick:()=>t(),className:a===0?"icon-sound-off":"icon-sound"}),jsxRuntimeExports.jsx("div",{ref:n,onMouseDown:h=>{const y=n.current;c(h,y)},onTouchMove:h=>{const y=n.current;u(h,y)},onTouchStart:h=>{const y=n.current;r(h.changedTouches[0].clientX,y.offsetWidth,y.offsetLeft)},id:"volume",className:"video--sound__level",children:jsxRuntimeExports.jsx("span",{style:{width:`${a<10?10:a}%`},className:"video--sound__progress",children:jsxRuntimeExports.jsx("span",{className:"video--handle"})})})]})}VolumeBar.defaultProps={volume:0,muted:!1,setVolume:()=>{},mute:()=>{}};VolumeBar.propTypes={volume:PropTypes.number,setVolume:PropTypes.func,mute:PropTypes.func,muted:PropTypes.bool};function VideoControllers({pause:o,mandatory:e,viewed:r,skip:t,rewind:n,paused:a,time:u,finished:l,restart:f,volume:c,muted:h,mute:y,setVolume:E,setTimePoint:p,audioAnimation:_,mandatoryHasBeenViewed:g,translate:S,visibility:C}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(skipButton,{mandatory:e,finished:l,viewed:r,skip:t,rewind:n,mandatoryHasBeenViewed:g,translate:S}),jsxRuntimeExports.jsxs("div",{className:`video--controls-wrap ${C?"video--controls-wrap--hidden":""}`,children:[_?null:jsxRuntimeExports.jsx(PlayInitButton,{play:o,paused:a,finished:l}),l?jsxRuntimeExports.jsx(FinishedVideoButtons,{restart:f,translate:S}):null,jsxRuntimeExports.jsxs("div",{className:"video--controls",children:[jsxRuntimeExports.jsx(BufferBar,{mandatory:e,mandatoryHasBeenViewed:g,time:u,setTimePoint:p,finished:l,viewed:r}),jsxRuntimeExports.jsxs("div",{className:"video--controls__actions",children:[jsxRuntimeExports.jsx(Timer,{time:u}),_?jsxRuntimeExports.jsx("div",{className:"audio-animation-wrap",children:jsxRuntimeExports.jsx("div",{className:`audio-animation ${a?"audio-animation--notAnimate ":null}`})}):null,jsxRuntimeExports.jsx(ControlButtons,{paused:a,pauseVideo:o,translate:S}),jsxRuntimeExports.jsx(VolumeBar,{muted:h,mute:y,volume:c,setVolume:E})]})]})]})]})}VideoControllers.defaultProps={audioAnimation:!1,paused:!1,mandatory:!1,viewed:!1,volume:0,muted:!1,finished:!1,restart:()=>{},pause:()=>{},skip:()=>{},rewind:()=>{},setTimePoint:()=>{},setVolume:()=>{},mute:()=>{},time:{current:0,duration:0}};VideoControllers.propTypes={audioAnimation:PropTypes.bool,paused:PropTypes.bool,mandatory:PropTypes.bool,muted:PropTypes.bool,volume:PropTypes.number,viewed:PropTypes.bool,pause:PropTypes.func,finished:PropTypes.bool,restart:PropTypes.func,skip:PropTypes.func,rewind:PropTypes.func,mute:PropTypes.func,setTimePoint:PropTypes.func,setVolume:PropTypes.func,time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};const defaultBgImageForAudio="https://min.gamelearn.io/css-resources/gamelearn/resources/bgAudioPiece.jpg";function VideoVisor({documentType:o,url:e,required:r,viewed:t,backgroundImage:n,soundActions:a,endVideo:u,translate:l}){const[f,c]=React$2.useState(!1),[h]=a,[y,E]=React$2.useState(0),[p,_]=React$2.useState(0),[g,S]=React$2.useState(!1),[C,R]=React$2.useState(!0),[x,A]=React$2.useState(!1),[T,P]=React$2.useState(),[w,O]=React$2.useState(0),[k,D]=React$2.useState(!1),F=e&&e.match(/\.m3u8(\?.+=.+)*$/i)&&Hls.isSupported(),G=e&&(e.match(/youtube/i)||e.match(/vimeo/i)),V=e&&(e.match(/.mp3/i)||e.match(/.ogg/i)||e.match(/.wav/i)||e.match(/.m4a/i)),W={ref:fe=>{P(fe)},src:e,style:{height:"100%",width:"100%"}},Z=()=>{r&&c(!0),S(!1),T.pause(),R(!0),A(!0),D(!1),o!=="document"&&o!=="lesson"&&u()},q=()=>{u()},B=()=>{R(!1),S(!1)},U=()=>{S(!0)},I=()=>{S(!1),E(T.duration)};React$2.useEffect(()=>{let fe;if(T){if(F){fe=new Hls;const de=`${e}?v=${Math.floor(Math.random()*99999999)}`;fe.loadSource(de),fe.attachMedia(T),fe.on(Hls.Events.FRAG_LOAD_PROGRESS,(ce,Se)=>{const{stats:ke}=Se;_(ke.loaded*100/ke.total)})}return()=>{fe&&fe.destroy(),fe=null}}},[F,e,T]);const $=()=>{T.currentTime-=15},z=()=>{h("click-ui"),C?(T.play(),A(!1)):T.pause(),R(!C)},X=(fe,de,ce)=>{A(!1),T.currentTime=de?parseFloat((fe-ce)/de*T.duration):0},Q=()=>{A(!1),T.currentTime=0,z()},J=()=>{h("click-ui"),T.muted=!T.muted},ne=(fe,de,ce)=>{T.muted=!1;const Se=fe-ce>=0?(fe-ce)/de:0;T.volume=Se*100>10?Se:0,O(T.volume)};React$2.useEffect(()=>{let fe;return!k&&!C&&(fe=setTimeout(()=>{D(!0),clearTimeout(fe)},3e3)),()=>clearTimeout(fe)},[k,C]);const se=()=>{k&&D(!1)},ee=n||defaultBgImageForAudio,ie=ee===defaultBgImageForAudio?"cover":"contain",oe={backgroundImage:`url("${ee}")`,backgroundSize:ie,backgroundRepeat:"no-repeat",backgroundPosition:"center center"};return jsxRuntimeExports.jsx("div",{className:`video ${r&&!f&&!t?"forward-disabled":""}`,style:V?oe:null,children:G?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{type:"button","aria-label":l("storylines.misc.closePiece"),className:"gat--btn__round gat--btn__close",onClick:()=>{h("click-ui"),u()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}),jsxRuntimeExports.jsx("iframe",{className:"embeddedVideo",title:"title",...W})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(VideoControllers,{visibility:k,mandatoryHasBeenViewed:f,audioAnimation:!!V,skip:u,mandatory:r,viewed:t,volume:T?T.volume:0,mute:J,muted:T?T.muted:!1,paused:C,finished:x,restart:Q,setTimePoint:X,time:{duration:y,current:T?T.currentTime:0},rewind:$,pause:z,volumeState:w,setVolume:ne,translate:l}),jsxRuntimeExports.jsx("video",{onMouseMove:()=>se(),onClick:()=>{se()},onFocus:()=>{se()},onCanPlayThrough:I,onWaiting:U,onEnded:Z,onError:q,onPlaying:B,...W,children:jsxRuntimeExports.jsx("track",{kind:"captions"})}),g?jsxRuntimeExports.jsxs("div",{className:"video-loading-container",style:{top:0,left:0},children:[jsxRuntimeExports.jsx("div",{className:"video-loading-container-bg opacity-wrapper"}),jsxRuntimeExports.jsx("div",{className:"popup-alert warning",children:jsxRuntimeExports.jsx("div",{className:"popup-message",children:jsxRuntimeExports.jsx("p",{children:Math.floor(p)})})})]}):null]})})}VideoVisor.defaultProps={url:"",name:"",backgroundImage:null,documentType:"",required:!1,viewed:!1,endVideo:()=>{}};function VideoComponent({emitEvent:o,name:e,documentType:r,document:t,documentId_labelId:n,soundActions:a,required:u,viewed:l,visible:f,img:c,imgId_labelId:h,keyboardControl:y}){const E=S=>o({type:"translate",payload:S}),{url:p}=t,_=React$2.useMemo(()=>({documentId:n,imgId:h,required:u,name:e,type:"video",viewed:l,documentType:r}),[n,h,u,e,l,r]),g=React$2.useCallback(()=>{o({type:"finishMedia",payload:_})},[o,_]);return React$2.useEffect(()=>{f||g()},[g,f]),f?(y(null,l?null:g,l?null:g),jsxRuntimeExports.jsx(VideoVisor,{backgroundImage:c==null?void 0:c.url,url:p,soundActions:a,documentType:r,required:u,viewed:l,endVideo:()=>g(),translate:E})):null}function ChangeCamera({targetUid:o,emitEvent:e,transition:r={type:"pan",speed:10}}){const{change:t}=arcadeThreeCore.CameraControls.useStore(),n=fiber.useThree(a=>a.camera);return React$2.useEffect(()=>{const a=()=>{e({type:"success"})};return n.addEventListener("transitionEnd",a),()=>{n.removeEventListener("transitionEnd",a)}},[]),React$2.useEffect(()=>{t(o,r)},[o,r]),null}var htmlReactParser={exports:{}},lib$4={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(lib$4,"__esModule",{value:!0});function _slicedToArray(o,e){return _arrayWithHoles(o)||_iterableToArrayLimit(o,e)||_unsupportedIterableToArray(o,e)||_nonIterableRest()}function _arrayWithHoles(o){if(Array.isArray(o))return o}function _iterableToArrayLimit(o,e){var r=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(r!=null){var t=[],n=!0,a=!1,u,l;try{for(r=r.call(o);!(n=(u=r.next()).done)&&(t.push(u.value),!(e&&t.length===e));n=!0);}catch(f){a=!0,l=f}finally{try{!n&&r.return!=null&&r.return()}finally{if(a)throw l}}return t}}function _unsupportedIterableToArray(o,e){if(o){if(typeof o=="string")return _arrayLikeToArray(o,e);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(o,e)}}function _arrayLikeToArray(o,e){(e==null||e>o.length)&&(e=o.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=o[r];return t}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
65
65
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var RESERVED=0,STRING=1,BOOLEANISH_STRING=2,BOOLEAN=3,OVERLOADED_BOOLEAN=4,NUMERIC=5,POSITIVE_NUMERIC=6;function getPropertyInfo(o){return properties.hasOwnProperty(o)?properties[o]:null}function PropertyInfoRecord(o,e,r,t,n,a,u){this.acceptsBooleans=e===BOOLEANISH_STRING||e===BOOLEAN||e===OVERLOADED_BOOLEAN,this.attributeName=t,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=o,this.type=e,this.sanitizeURL=a,this.removeEmptyString=u}var properties={},reservedProps=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];reservedProps.forEach(function(o){properties[o]=new PropertyInfoRecord(o,RESERVED,!1,o,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var e=_slicedToArray(o,2),r=e[0],t=e[1];properties[r]=new PropertyInfoRecord(r,STRING,!1,t,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEANISH_STRING,!1,o.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEANISH_STRING,!1,o,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEAN,!1,o.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEAN,!0,o,null,!1,!1)});["capture","download"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,OVERLOADED_BOOLEAN,!1,o,null,!1,!1)});["cols","rows","size","span"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,POSITIVE_NUMERIC,!1,o,null,!1,!1)});["rowSpan","start"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,NUMERIC,!1,o.toLowerCase(),null,!1,!1)});var CAMELIZE=/[\-\:]([a-z])/g,capitalize$1=function o(e){return e[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(o){var e=o.replace(CAMELIZE,capitalize$1);properties[e]=new PropertyInfoRecord(e,STRING,!1,o,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(o){var e=o.replace(CAMELIZE,capitalize$1);properties[e]=new PropertyInfoRecord(e,STRING,!1,o,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(o){var e=o.replace(CAMELIZE,capitalize$1);properties[e]=new PropertyInfoRecord(e,STRING,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,STRING,!1,o.toLowerCase(),null,!1,!1)});var xlinkHref="xlinkHref";properties[xlinkHref]=new PropertyInfoRecord("xlinkHref",STRING,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,STRING,!1,o.toLowerCase(),null,!0,!0)});var _require=possibleStandardNamesOptimized$1,CAMELCASE=_require.CAMELCASE,SAME=_require.SAME,possibleStandardNamesOptimized=_require.possibleStandardNames,ATTRIBUTE_NAME_START_CHAR=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ATTRIBUTE_NAME_CHAR=ATTRIBUTE_NAME_START_CHAR+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",isCustomAttribute=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+ATTRIBUTE_NAME_CHAR+"]*$")),possibleStandardNames=Object.keys(possibleStandardNamesOptimized).reduce(function(o,e){var r=possibleStandardNamesOptimized[e];return r===SAME?o[e]=e:r===CAMELCASE?o[e.toLowerCase()]=e:o[e]=r,o},{});lib$4.BOOLEAN=BOOLEAN;lib$4.BOOLEANISH_STRING=BOOLEANISH_STRING;lib$4.NUMERIC=NUMERIC;lib$4.OVERLOADED_BOOLEAN=OVERLOADED_BOOLEAN;lib$4.POSITIVE_NUMERIC=POSITIVE_NUMERIC;lib$4.RESERVED=RESERVED;lib$4.STRING=STRING;lib$4.getPropertyInfo=getPropertyInfo;lib$4.isCustomAttribute=isCustomAttribute;lib$4.possibleStandardNames=possibleStandardNames;var cjs={},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=`
66
66
  `,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING$1="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(o,e){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];e=e||{};var r=1,t=1;function n(_){var g=_.match(NEWLINE_REGEX);g&&(r+=g.length);var S=_.lastIndexOf(NEWLINE);t=~S?_.length-S:t+_.length}function a(){var _={line:r,column:t};return function(g){return g.position=new u(_),c(),g}}function u(_){this.start=_,this.end={line:r,column:t},this.source=e.source}u.prototype.content=o;function l(_){var g=new Error(e.source+":"+r+":"+t+": "+_);if(g.reason=_,g.filename=e.source,g.line=r,g.column=t,g.source=o,!e.silent)throw g}function f(_){var g=_.exec(o);if(g){var S=g[0];return n(S),o=o.slice(S.length),g}}function c(){f(WHITESPACE_REGEX)}function h(_){var g;for(_=_||[];g=y();)g!==!1&&_.push(g);return _}function y(){var _=a();if(!(FORWARD_SLASH!=o.charAt(0)||ASTERISK!=o.charAt(1))){for(var g=2;EMPTY_STRING$1!=o.charAt(g)&&(ASTERISK!=o.charAt(g)||FORWARD_SLASH!=o.charAt(g+1));)++g;if(g+=2,EMPTY_STRING$1===o.charAt(g-1))return l("End of comment missing");var S=o.slice(2,g-2);return t+=2,n(S),o=o.slice(g),t+=2,_({type:TYPE_COMMENT,comment:S})}}function E(){var _=a(),g=f(PROPERTY_REGEX);if(g){if(y(),!f(COLON_REGEX))return l("property missing ':'");var S=f(VALUE_REGEX),C=_({type:TYPE_DECLARATION,property:trim(g[0].replace(COMMENT_REGEX,EMPTY_STRING$1)),value:S?trim(S[0].replace(COMMENT_REGEX,EMPTY_STRING$1)):EMPTY_STRING$1});return f(SEMICOLON_REGEX),C}}function p(){var _=[];h(_);for(var g;g=E();)g!==!1&&(_.push(g),h(_));return _}return c(),p()};function trim(o){return o?o.replace(TRIM_REGEX,EMPTY_STRING$1):EMPTY_STRING$1}var parse=inlineStyleParser;function StyleToObject(o,e){var r=null;if(!o||typeof o!="string")return r;for(var t,n=parse(o),a=typeof e=="function",u,l,f=0,c=n.length;f<c;f++)t=n[f],u=t.property,l=t.value,a?e(u,l,t):l&&(r||(r={}),r[u]=l);return r}var styleToObject=StyleToObject,utilities$4={};utilities$4.__esModule=!0;utilities$4.camelCase=void 0;var CUSTOM_PROPERTY_REGEX=/^--[a-zA-Z0-9-]+$/,HYPHEN_REGEX=/-([a-z])/g,NO_HYPHEN_REGEX=/^[^-]+$/,VENDOR_PREFIX_REGEX=/^-(webkit|moz|ms|o|khtml)-/,MS_VENDOR_PREFIX_REGEX=/^-(ms)-/,skipCamelCase=function(o){return!o||NO_HYPHEN_REGEX.test(o)||CUSTOM_PROPERTY_REGEX.test(o)},capitalize=function(o,e){return e.toUpperCase()},trimHyphen=function(o,e){return"".concat(e,"-")},camelCase=function(o,e){return e===void 0&&(e={}),skipCamelCase(o)?o:(o=o.toLowerCase(),e.reactCompat?o=o.replace(MS_VENDOR_PREFIX_REGEX,trimHyphen):o=o.replace(VENDOR_PREFIX_REGEX,trimHyphen),o.replace(HYPHEN_REGEX,capitalize))};utilities$4.camelCase=camelCase;(function(o){var e=commonjsGlobal&&commonjsGlobal.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};o.__esModule=!0;var r=e(styleToObject),t=utilities$4;function n(a,u){var l={};return!a||typeof a!="string"||(0,r.default)(a,function(f,c){f&&c&&(l[(0,t.camelCase)(f,u)]=c)}),l}o.default=n})(cjs);var React$1=React$2,styleToJS=cjs.default;function invertObject(o,e){if(!o||typeof o!="object")throw new TypeError("First argument must be an object");var r,t,n=typeof e=="function",a={},u={};for(r in o){if(t=o[r],n&&(a=e(r,t),a&&a.length===2)){u[a[0]]=a[1];continue}typeof t=="string"&&(u[t]=r)}return u}function isCustomComponent(o,e){if(o.indexOf("-")===-1)return e&&typeof e.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var styleToJSOptions={reactCompat:!0};function setStyleProp$1(o,e){if(o!=null)try{e.style=styleToJS(o,styleToJSOptions)}catch{e.style={}}}var PRESERVE_CUSTOM_ATTRIBUTES=React$1.version.split(".")[0]>=16,elementsWithNoTextChildren=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function canTextBeChildOfNode$1(o){return!elementsWithNoTextChildren.has(o.name)}var utilities$3={PRESERVE_CUSTOM_ATTRIBUTES,invertObject,isCustomComponent,setStyleProp:setStyleProp$1,canTextBeChildOfNode:canTextBeChildOfNode$1,elementsWithNoTextChildren},reactProperty=lib$4,utilities$2=utilities$3,attributesToProps$2=function o(e){e=e||{};var r={reset:!0,submit:!0},t,n,a,u,l,f={},c=e.type&&r[e.type];for(t in e){if(a=e[t],reactProperty.isCustomAttribute(t)){f[t]=a;continue}if(n=t.toLowerCase(),u=getPropName(n),u){switch(l=reactProperty.getPropertyInfo(u),(u==="checked"||u==="value")&&!c&&(u=getPropName("default"+n)),f[u]=a,l&&l.type){case reactProperty.BOOLEAN:f[u]=!0;break;case reactProperty.OVERLOADED_BOOLEAN:a===""&&(f[u]=!0);break}continue}utilities$2.PRESERVE_CUSTOM_ATTRIBUTES&&(f[t]=a)}return utilities$2.setStyleProp(e.style,f),f};function getPropName(o){return reactProperty.possibleStandardNames[o]}var React=React$2,attributesToProps$1=attributesToProps$2,utilities$1=utilities$3,setStyleProp=utilities$1.setStyleProp,canTextBeChildOfNode=utilities$1.canTextBeChildOfNode;function domToReact$1(o,e){e=e||{};for(var r=e.library||React,t=r.cloneElement,n=r.createElement,a=r.isValidElement,u=[],l,f,c=typeof e.replace=="function",h,y,E,p=e.trim,_=0,g=o.length;_<g;_++){if(l=o[_],c&&(h=e.replace(l),a(h))){g>1&&(h=t(h,{key:h.key||_})),u.push(h);continue}if(l.type==="text"){if(f=!l.data.trim().length,f&&l.parent&&!canTextBeChildOfNode(l.parent)||p&&f)continue;u.push(l.data);continue}switch(y=l.attribs,skipAttributesToProps(l)?setStyleProp(y.style,y):y&&(y=attributesToProps$1(y)),E=null,l.type){case"script":case"style":l.children[0]&&(y.dangerouslySetInnerHTML={__html:l.children[0].data});break;case"tag":l.name==="textarea"&&l.children[0]?y.defaultValue=l.children[0].data:l.children&&l.children.length&&(E=domToReact$1(l.children,e));break;default:continue}g>1&&(y.key=_),u.push(n(l.name,y,E))}return u.length===1?u[0]:u}function skipAttributesToProps(o){return utilities$1.PRESERVE_CUSTOM_ATTRIBUTES&&o.type==="tag"&&utilities$1.isCustomComponent(o.name,o.attribs)}var domToReact_1=domToReact$1,CASE_SENSITIVE_TAG_NAMES$1=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],constants$2={CASE_SENSITIVE_TAG_NAMES:CASE_SENSITIVE_TAG_NAMES$1},node={},lib$3={},hasRequiredLib$1;function requireLib$1(){return hasRequiredLib$1||(hasRequiredLib$1=1,function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Doctype=o.CDATA=o.Tag=o.Style=o.Script=o.Comment=o.Directive=o.Text=o.Root=o.isTag=o.ElementType=void 0;var e;(function(t){t.Root="root",t.Text="text",t.Directive="directive",t.Comment="comment",t.Script="script",t.Style="style",t.Tag="tag",t.CDATA="cdata",t.Doctype="doctype"})(e=o.ElementType||(o.ElementType={}));function r(t){return t.type===e.Tag||t.type===e.Script||t.type===e.Style}o.isTag=r,o.Root=e.Root,o.Text=e.Text,o.Directive=e.Directive,o.Comment=e.Comment,o.Script=e.Script,o.Style=e.Style,o.Tag=e.Tag,o.CDATA=e.CDATA,o.Doctype=e.Doctype}(lib$3)),lib$3}var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var o=function(e,r){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])},o(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");o(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(o){for(var e,r=1,t=arguments.length;r<t;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n])}return o},__assign.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0});node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var domelementtype_1=requireLib$1(),nodeTypes=new Map([[domelementtype_1.ElementType.Tag,1],[domelementtype_1.ElementType.Script,1],[domelementtype_1.ElementType.Style,1],[domelementtype_1.ElementType.Directive,1],[domelementtype_1.ElementType.Text,3],[domelementtype_1.ElementType.CDATA,4],[domelementtype_1.ElementType.Comment,8],[domelementtype_1.ElementType.Root,9]]),Node$2=function(){function o(e){this.type=e,this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(o.prototype,"nodeType",{get:function(){var e;return(e=nodeTypes.get(this.type))!==null&&e!==void 0?e:1},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),o.prototype.cloneNode=function(e){return e===void 0&&(e=!1),cloneNode(this,e)},o}();node.Node=Node$2;var DataNode=function(o){__extends(e,o);function e(r,t){var n=o.call(this,r)||this;return n.data=t,n}return Object.defineProperty(e.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),e}(Node$2);node.DataNode=DataNode;var Text$4=function(o){__extends(e,o);function e(r){return o.call(this,domelementtype_1.ElementType.Text,r)||this}return e}(DataNode);node.Text=Text$4;var Comment$1=function(o){__extends(e,o);function e(r){return o.call(this,domelementtype_1.ElementType.Comment,r)||this}return e}(DataNode);node.Comment=Comment$1;var ProcessingInstruction$1=function(o){__extends(e,o);function e(r,t){var n=o.call(this,domelementtype_1.ElementType.Directive,t)||this;return n.name=r,n}return e}(DataNode);node.ProcessingInstruction=ProcessingInstruction$1;var NodeWithChildren=function(o){__extends(e,o);function e(r,t){var n=o.call(this,r)||this;return n.children=t,n}return Object.defineProperty(e.prototype,"firstChild",{get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.children},set:function(r){this.children=r},enumerable:!1,configurable:!0}),e}(Node$2);node.NodeWithChildren=NodeWithChildren;var Document=function(o){__extends(e,o);function e(r){return o.call(this,domelementtype_1.ElementType.Root,r)||this}return e}(NodeWithChildren);node.Document=Document;var Element$1=function(o){__extends(e,o);function e(r,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=r==="script"?domelementtype_1.ElementType.Script:r==="style"?domelementtype_1.ElementType.Style:domelementtype_1.ElementType.Tag);var u=o.call(this,a,n)||this;return u.name=r,u.attribs=t,u}return Object.defineProperty(e.prototype,"tagName",{get:function(){return this.name},set:function(r){this.name=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){var r=this;return Object.keys(this.attribs).map(function(t){var n,a;return{name:t,value:r.attribs[t],namespace:(n=r["x-attribsNamespace"])===null||n===void 0?void 0:n[t],prefix:(a=r["x-attribsPrefix"])===null||a===void 0?void 0:a[t]}})},enumerable:!1,configurable:!0}),e}(NodeWithChildren);node.Element=Element$1;function isTag(o){return(0,domelementtype_1.isTag)(o)}node.isTag=isTag;function isCDATA(o){return o.type===domelementtype_1.ElementType.CDATA}node.isCDATA=isCDATA;function isText(o){return o.type===domelementtype_1.ElementType.Text}node.isText=isText;function isComment(o){return o.type===domelementtype_1.ElementType.Comment}node.isComment=isComment;function isDirective(o){return o.type===domelementtype_1.ElementType.Directive}node.isDirective=isDirective;function isDocument(o){return o.type===domelementtype_1.ElementType.Root}node.isDocument=isDocument;function hasChildren(o){return Object.prototype.hasOwnProperty.call(o,"children")}node.hasChildren=hasChildren;function cloneNode(o,e){e===void 0&&(e=!1);var r;if(isText(o))r=new Text$4(o.data);else if(isComment(o))r=new Comment$1(o.data);else if(isTag(o)){var t=e?cloneChildren(o.children):[],n=new Element$1(o.name,__assign({},o.attribs),t);t.forEach(function(f){return f.parent=n}),o.namespace!=null&&(n.namespace=o.namespace),o["x-attribsNamespace"]&&(n["x-attribsNamespace"]=__assign({},o["x-attribsNamespace"])),o["x-attribsPrefix"]&&(n["x-attribsPrefix"]=__assign({},o["x-attribsPrefix"])),r=n}else if(isCDATA(o)){var t=e?cloneChildren(o.children):[],a=new NodeWithChildren(domelementtype_1.ElementType.CDATA,t);t.forEach(function(c){return c.parent=a}),r=a}else if(isDocument(o)){var t=e?cloneChildren(o.children):[],u=new Document(t);t.forEach(function(c){return c.parent=u}),o["x-mode"]&&(u["x-mode"]=o["x-mode"]),r=u}else if(isDirective(o)){var l=new ProcessingInstruction$1(o.name,o.data);o["x-name"]!=null&&(l["x-name"]=o["x-name"],l["x-publicId"]=o["x-publicId"],l["x-systemId"]=o["x-systemId"]),r=l}else throw new Error("Not implemented yet: ".concat(o.type));return r.startIndex=o.startIndex,r.endIndex=o.endIndex,o.sourceCodeLocation!=null&&(r.sourceCodeLocation=o.sourceCodeLocation),r}node.cloneNode=cloneNode;function cloneChildren(o){for(var e=o.map(function(t){return cloneNode(t,!0)}),r=1;r<e.length;r++)e[r].prev=e[r-1],e[r-1].next=e[r];return e}var constants$1=constants$2,domhandler=node,CASE_SENSITIVE_TAG_NAMES=constants$1.CASE_SENSITIVE_TAG_NAMES,Comment=domhandler.Comment,Element=domhandler.Element,ProcessingInstruction=domhandler.ProcessingInstruction,Text$3=domhandler.Text,caseSensitiveTagNamesMap={},tagName;for(var i$1=0,len=CASE_SENSITIVE_TAG_NAMES.length;i$1<len;i$1++)tagName=CASE_SENSITIVE_TAG_NAMES[i$1],caseSensitiveTagNamesMap[tagName.toLowerCase()]=tagName;function getCaseSensitiveTagName(o){return caseSensitiveTagNamesMap[o]}function formatAttributes(o){for(var e={},r,t=0,n=o.length;t<n;t++)r=o[t],e[r.name]=r.value;return e}function formatTagName(o){o=o.toLowerCase();var e=getCaseSensitiveTagName(o);return e||o}function formatDOM$1(o,e,r){e=e||null;for(var t=[],n=0,a=o.length;n<a;n++){var u=o[n],l;switch(u.nodeType){case 1:l=new Element(formatTagName(u.nodeName),formatAttributes(u.attributes)),l.children=formatDOM$1(u.childNodes,l);break;case 3:l=new Text$3(u.nodeValue);break;case 8:l=new Comment(u.nodeValue);break;default:continue}var f=t[n-1]||null;f&&(f.next=l),l.parent=e,l.prev=f,l.next=null,t.push(l)}return r&&(l=new ProcessingInstruction(r.substring(0,r.indexOf(" ")).toLowerCase(),r),l.next=t[0]||null,l.parent=e,t.unshift(l),t[1]&&(t[1].prev=t[0])),t}function isIE$1(){return/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}var utilities={formatAttributes,formatDOM:formatDOM$1,isIE:isIE$1},HTML="html",HEAD="head",BODY="body",FIRST_TAG_REGEX=/<([a-zA-Z]+[0-9]?)/,HEAD_TAG_REGEX=/<head.*>/i,BODY_TAG_REGEX=/<body.*>/i,parseFromDocument=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},parseFromString=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if(typeof window.DOMParser=="function"){var domParser=new window.DOMParser,mimeType="text/html";parseFromString=function(o,e){return e&&(o="<"+e+">"+o+"</"+e+">"),domParser.parseFromString(o,mimeType)},parseFromDocument=parseFromString}if(document.implementation){var isIE=utilities.isIE,doc=document.implementation.createHTMLDocument(isIE()?"html-dom-parser":void 0);parseFromDocument=function(o,e){return e?(doc.documentElement.getElementsByTagName(e)[0].innerHTML=o,doc):(doc.documentElement.innerHTML=o,doc)}}var template=document.createElement("template"),parseFromTemplate;template.content&&(parseFromTemplate=function(o){return template.innerHTML=o,template.content.childNodes});function domparser$1(o){var e,r=o.match(FIRST_TAG_REGEX);r&&r[1]&&(e=r[1].toLowerCase());var t,n,a;switch(e){case HTML:return t=parseFromString(o),HEAD_TAG_REGEX.test(o)||(n=t.getElementsByTagName(HEAD)[0],n&&n.parentNode.removeChild(n)),BODY_TAG_REGEX.test(o)||(n=t.getElementsByTagName(BODY)[0],n&&n.parentNode.removeChild(n)),t.getElementsByTagName(HTML);case HEAD:case BODY:return a=parseFromDocument(o).getElementsByTagName(e),BODY_TAG_REGEX.test(o)&&HEAD_TAG_REGEX.test(o)?a[0].parentNode.childNodes:a;default:return parseFromTemplate?parseFromTemplate(o):parseFromDocument(o,BODY).getElementsByTagName(BODY)[0].childNodes}}var domparser_1=domparser$1,domparser=domparser_1,formatDOM=utilities.formatDOM,DIRECTIVE_REGEX=/<(![a-zA-Z\s]+)>/;function HTMLDOMParser(o){if(typeof o!="string")throw new TypeError("First argument must be a string");if(o==="")return[];var e=o.match(DIRECTIVE_REGEX),r;return e&&e[1]&&(r=e[1]),formatDOM(domparser(o),null,r)}var htmlToDom=HTMLDOMParser,lib$2={},hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(o){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(f,c,h,y){y===void 0&&(y=h);var E=Object.getOwnPropertyDescriptor(c,h);(!E||("get"in E?!c.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(f,y,E)}:function(f,c,h,y){y===void 0&&(y=h),f[y]=c[h]}),r=commonjsGlobal&&commonjsGlobal.__exportStar||function(f,c){for(var h in f)h!=="default"&&!Object.prototype.hasOwnProperty.call(c,h)&&e(c,f,h)};Object.defineProperty(o,"__esModule",{value:!0}),o.DomHandler=void 0;var t=requireLib$1(),n=node;r(node,o);var a=/\s+/g,u={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function f(c,h,y){this.dom=[],this.root=new n.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof h=="function"&&(y=h,h=u),typeof c=="object"&&(h=c,c=void 0),this.callback=c??null,this.options=h??u,this.elementCB=y??null}return f.prototype.onparserinit=function(c){this.parser=c},f.prototype.onreset=function(){this.dom=[],this.root=new n.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},f.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},f.prototype.onerror=function(c){this.handleCallback(c)},f.prototype.onclosetag=function(){this.lastNode=null;var c=this.tagStack.pop();this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(c)},f.prototype.onopentag=function(c,h){var y=this.options.xmlMode?t.ElementType.Tag:void 0,E=new n.Element(c,h,void 0,y);this.addNode(E),this.tagStack.push(E)},f.prototype.ontext=function(c){var h=this.options.normalizeWhitespace,y=this.lastNode;if(y&&y.type===t.ElementType.Text)h?y.data=(y.data+c).replace(a," "):y.data+=c,this.options.withEndIndices&&(y.endIndex=this.parser.endIndex);else{h&&(c=c.replace(a," "));var E=new n.Text(c);this.addNode(E),this.lastNode=E}},f.prototype.oncomment=function(c){if(this.lastNode&&this.lastNode.type===t.ElementType.Comment){this.lastNode.data+=c;return}var h=new n.Comment(c);this.addNode(h),this.lastNode=h},f.prototype.oncommentend=function(){this.lastNode=null},f.prototype.oncdatastart=function(){var c=new n.Text(""),h=new n.NodeWithChildren(t.ElementType.CDATA,[c]);this.addNode(h),c.parent=h,this.lastNode=c},f.prototype.oncdataend=function(){this.lastNode=null},f.prototype.onprocessinginstruction=function(c,h){var y=new n.ProcessingInstruction(c,h);this.addNode(y)},f.prototype.handleCallback=function(c){if(typeof this.callback=="function")this.callback(c,this.dom);else if(c)throw c},f.prototype.addNode=function(c){var h=this.tagStack[this.tagStack.length-1],y=h.children[h.children.length-1];this.options.withStartIndices&&(c.startIndex=this.parser.startIndex),this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),h.children.push(c),y&&(c.prev=y,y.next=c),c.parent=h,this.lastNode=null},f}();o.DomHandler=l,o.default=l}(lib$2)),lib$2}var domToReact=domToReact_1,attributesToProps=attributesToProps$2,htmlToDOM=htmlToDom;htmlToDOM=typeof htmlToDOM.default=="function"?htmlToDOM.default:htmlToDOM;var domParserOptions={lowerCaseAttributeNames:!1};function HTMLReactParser(o,e){if(typeof o!="string")throw new TypeError("First argument must be a string");return o===""?[]:(e=e||{},domToReact(htmlToDOM(o,e.htmlparser2||domParserOptions),e))}HTMLReactParser.domToReact=domToReact;HTMLReactParser.htmlToDOM=htmlToDOM;HTMLReactParser.attributesToProps=attributesToProps;HTMLReactParser.Element=requireLib().Element;htmlReactParser.exports=HTMLReactParser;htmlReactParser.exports.default=HTMLReactParser;var htmlReactParserExports=htmlReactParser.exports;const HTMLReactParser$1=getDefaultExportFromCjs(htmlReactParserExports);HTMLReactParser$1.domToReact;HTMLReactParser$1.htmlToDOM;HTMLReactParser$1.attributesToProps;HTMLReactParser$1.Element;function LectureButtons({goToLecture:o,close:e,minutes:r,seconds:t,btnText:n}){return jsxRuntimeExports.jsx("div",{className:"lectures--buttons",children:o?jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__navigation",onClick:()=>e(),"aria-label":n,children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__count","data-testid":"countdown",children:jsxRuntimeExports.jsxs("span",{children:[r<10?`0${r}`:r,":",t<10?`0${t}`:t]})})})}LectureButtons.defaultProps={goToLecture:!1,close:()=>{},minutes:0,seconds:0};const noop$1=()=>{},useEkho=({voice:o,text:e,audioType:r,loop:t=!1,started:n=!0,slide:a=0,audio:u,soundActions:l,emitEvent:f,volume:c=.5,onFinish:h=noop$1,onError:y=noop$1,onStart:E=noop$1,pauseTTS:p})=>{const[_,g,S,C]=l,R=!u&&!o,[x,A]=React$2.useState(!1),T=React$2.useRef({url:"",cc:"tts"}),P=React$2.useCallback(F=>f({type:"translate",payload:F}),[f]),w=React$2.useCallback(({id:F,type:G="base"})=>{var Z;const V=P("usedVoices"),W=P("gameCharacters");return G==="base"?V==null?void 0:V[F]:G==="character"?(Z=W==null?void 0:W[F])==null?void 0:Z.voiceId:null},[P]),O=React$2.useCallback((F,G="tts")=>{T.current.url===F&&a===T.current.slide||(T.current={url:F,cc:G,slide:a},_(F,G,t,c,h,E))},[a,_,t,c,h,E]),k=React$2.useCallback(async F=>{if(x&&F.voiceId&&F.text){const G=await f({type:"getSpeech",payload:F});G?O(G):y()}else y()},[f,x,y,O]),D=React$2.useCallback(()=>{T.current.url&&g(T.current.cc)},[g]);return React$2.useEffect(()=>(A(!0),()=>{A(!1),D()}),[D]),React$2.useEffect(()=>{p?S():C()},[S,p,C]),React$2.useEffect(()=>{R&&D()},[R,D]),React$2.useEffect(()=>{if(x&&n)if(r==="voice"&&(o!=null&&o.id)){const F=w(o);k({voiceId:F,text:e})}else(r==="file"||!r)&&u?O(u==null?void 0:u.url):y()},[w,k,x,o,e,r,u==null?void 0:u.url,u,O,y,n]),D},READING_TIME=.2;function LecturesComponent({emitEvent:o,name:e,name_labelId:r,required:t,text:n,text_labelId:a,visible:u,documentType:l,viewed:f,soundActions:c,backgroundImage:h,keyboardControl:y,audio:E,audioType:p,audioVolume:_,voice:g,pause:S,styles:C}){const[R,x]=React$2.useState(),[A,T]=React$2.useState(!1),[P,w]=React$2.useState(0),O=n,k=Math.trunc(O.split(" ").length*READING_TIME),D=!t||t&&P>=k||t&&!u,[F]=c,G=/<\/p>|<\/h1>|<\/h2>|<\/h3>|<\/h4>|<\/h5>|<\/h6>|<\/li>/gi,V=/&quot;|&#39;/gi,q=n.replace(G,". </p>").replace(V,"").replace(/(<([^>]+)>)/gi,""),B=`${e}. ${q}`;useEkho({audioType:p,voice:g,text:B,audio:E,soundActions:c,emitEvent:o,volume:_,pauseTTS:S});const U=Q=>o({type:"translate",payload:Q}),I=React$2.useCallback(()=>{D&&(F("click-ui"),o({type:"finishMedia",payload:{name:r,type:"text",text:a,documentType:l}}))},[l,o,D,r,a,F]);y(null,f?null:I,f?null:I),React$2.useEffect(()=>{if(!u&&!A&&(I(),T(!0)),t&&u){const Q=setInterval(()=>{w(J=>J+1)},1e3);return x(Q),()=>{clearInterval(Q)}}},[I,t,A,u]),React$2.useEffect(()=>{P===k&&clearInterval(R)},[R,P,k]);const $=k-P,z=Math.floor($/60),X=$%60;return u?jsxRuntimeExports.jsx("div",{className:`${f?"notes--results":`lectures--container lectures--container--${C}`} ${!f&&(h!=null&&h.url)?"lectures--container--with-custom-bg":""}`,style:!f&&(h!=null&&h.url)?{backgroundImage:`url('${h.url}')`}:{},children:jsxRuntimeExports.jsx("div",{className:f?"":"lectures__overlay",children:jsxRuntimeExports.jsxs("div",{className:f?"notes--results__text":`lectures lectures--${C}`,children:[jsxRuntimeExports.jsx("div",{className:"lectures--title",children:e}),jsxRuntimeExports.jsxs("div",{className:"lectures--text",dir:"auto",children:[jsxRuntimeExports.jsx("div",{children:O?HTMLReactParser$1(O):null}),f?null:jsxRuntimeExports.jsx(LectureButtons,{goToLecture:D,close:I,minutes:z,seconds:X,btnText:U("screens.continue")})]})]})})}):null}LecturesComponent.defaultProps={emitEvent:()=>{},name:"",text:"",visible:!1,documentType:"",viewed:!1,required:!1,context:{},styles:""};function Slot({character:o,active:e,slot:r,lowQuality:t}){var E;const n=o.type==="image",a=o.type==="character",u=o.type==="object",l=(E=o==null?void 0:o.resource)==null?void 0:E.url,f=()=>n?`url(${l})`:a&&t?`url(${l.replace("character.glb","face.png")})`:u&&t?`url(${l.replace("object.glb","thumbnail.png")})`:"",c=()=>n?"contain":a||u?"auto 95%":"",h=()=>n?"center":a||u?"center bottom":"",y=n||t?{backgroundImage:f(),backgroundRepeat:"no-repeat",backgroundPosition:h(),backgroundSize:c()}:{};return jsxRuntimeExports.jsx("div",{className:`conversation--character__item ${e?"active":""} ${r}`,style:y,children:e&&o.name?jsxRuntimeExports.jsx("span",{className:"conversation--character__name",children:o.name}):null},o.name)}Slot.propTypes={character:PropTypes.shape({name:PropTypes.string,url:PropTypes.string,type:PropTypes.string,emotion:PropTypes.string,uid:PropTypes.string,resource:PropTypes.shape({resourceId:PropTypes.string,url:PropTypes.string})}),active:PropTypes.bool,slot:PropTypes.number};Slot.defaultProps={character:{name:"",url:"",type:"",resource:{resourceId:""}},active:!1,slot:0};const defaultCamPos=[0,14.63,16],boneWhiteList=["l_eye_jnt","l_eye","eye_l","head_m"],isMobile=DeviceDetection(),loader$1=new GLTFLoader;function Panel({character:o,ttsStarted:e,active:r,emitEvent:t}){var g,S,C,R,x;const n=React$2.useRef(null),a=React$2.useRef(null),u=o.type==="character",l=React$2.useRef(),[f,c]=React$2.useState(!1),h=React$2.useMemo(()=>t({type:"currentLod"}),[t]),y=React$2.useRef(),E=React$2.useMemo(()=>{var A,T,P,w,O,k,D,F;return u?o.animationId&&((A=o.animation)!=null&&A.url)?o.animation:(w=(P=(T=o==null?void 0:o.resource)==null?void 0:T.animations)==null?void 0:P[o.emotion])!=null&&w.url?(k=(O=o==null?void 0:o.resource)==null?void 0:O.animations)==null?void 0:k[o.emotion]:(F=(D=o==null?void 0:o.resource)==null?void 0:D.animations)==null?void 0:F.neutral:{}},[o.emotion,o==null?void 0:o.animationId,o==null?void 0:o.animation,(g=o==null?void 0:o.resource)==null?void 0:g.animations,u]),p=React$2.useCallback(()=>{const{clipAction:A,defaultAnim:T}=y.current.userData.animation;T&&A(T,y.current)},[]);React$2.useEffect(()=>{var A,T,P;if(y.current)if(r)if(e){const w=(P=(T=(A=o==null?void 0:o.resource)==null?void 0:A.animations)==null?void 0:T.talking)==null?void 0:P.url;w&&loader$1.load(w,({animations:O})=>{const{defaultAnim:k,clipAction:D}=y.current.userData.animation;D(mixWithTalkingClip(O[0],k),y.current),c(!0)})}else p();else f&&p()},[(R=(C=(S=o==null?void 0:o.resource)==null?void 0:S.animations)==null?void 0:C.talking)==null?void 0:R.url,e,r,p,f]);const _=React$2.useCallback(A=>{setTimeout(()=>{var T;if(n.current){const P=new three.Box3;P.setFromObject(A);const w=P.getSize(new three.Vector3);if(n.current.position.fromArray(defaultCamPos),n.current.rotation.set(0,0,0),n.current.updateProjectionMatrix(),n.current.layers.enableAll(),o.type==="character"){y.current=A;let O;const k=(T=o.emotion)==null?void 0:T.includes("seated");n.current.position.setY(w.y-1.5*1.3),A.traverse(D=>{const F=D.name.toLowerCase();if(D.isBone&&boneWhiteList.includes(F)){const G=k?1:0,V=new three.Vector3().setFromMatrixPosition(D.matrixWorld);if(F==="head_m"){O=V;return}n.current.position.setY(V.y-G),n.current.position.setX(V.x-.5)}}),O&&!k&&n.current.lookAt(O),n.current.zoom=1.5}else o.type==="object"&&(cameraFitAnyObject(A,n.current),n.current.zoom=1);n.current.updateProjectionMatrix()}},150)},[o.type,o.emotion]);return fiber.useFrame(({gl:A})=>{if(n.current&&a.current){const T=document.getElementsByClassName("conversation--character__item")[o.slot];if(T){const P=T.getBoundingClientRect(),w=T.parentNode.getBoundingClientRect(),[O,k]=[P.right-P.left,P.bottom-P.top];n.current.aspect=O/k,n.current.updateProjectionMatrix();const D={top:P.top-w.top,right:P.right-w.right,left:P.left-w.left,bottom:P.bottom-w.bottom},F=isMobile?24:40;D.bottom+=r?-F:F,A.setViewport(D.left,D.bottom,O,k),A.setScissor(D.left,D.bottom,O,k),A.render(a.current,n.current)}}},1),o.type==="image"?null:jsxRuntimeExports.jsxs("scene",{ref:a,children:[(x=o.resource)!=null&&x.url?jsxRuntimeExports.jsx(arcadeThreeCore.QualityManager,{lod:h,children:jsxRuntimeExports.jsx(arcadeThreeCore.SceneResource,{ref:l,name:`char_${o.uid}`,url:o.resource.url,animationUrl:E.url,type:o.type,position:[0,0,0],onLoad:_,interactive:!1})}):null,jsxRuntimeExports.jsx(drei.PerspectiveCamera,{name:`camera_${o.uid}`,fov:35,focus:10,ref:n,position:defaultCamPos,makeDefault:!0,defaultCamera:!0}),jsxRuntimeExports.jsx(LightSet,{})]})}const Panels=({characters:o,slots:e,ttsStarted:r,activeIndex:t,flex:n,lodSettings:a,emitEvent:u})=>e.map((l,f)=>{let c=null;const h=o.findIndex(y=>y&&y.uid===l.uid);if(h>=0){const y=n?h:f;return c={...o[h]},c.slot=y,jsxRuntimeExports.jsx(Panel,{character:c,active:t===y,lodSettings:a,ttsStarted:r,emitEvent:u},`${`${c.uid}_${f}`}_${h}`)}return null});function PanelsWrapper({characters:o,slots:e,ttsStarted:r,slotRefs:t,flex:n,currentMessage:a,emitEvent:u}){return fiber.useFrame(({gl:l})=>{l.setScissorTest(!1),l.clear(!0,!0),l.setScissorTest(!0)}),jsxRuntimeExports.jsx(Panels,{ttsStarted:r,characters:o,slots:e,slotRefs:t,flex:n,activeIndex:a.position,emitEvent:u})}function Scene(o){return o.lowQuality?null:jsxRuntimeExports.jsxs(arcadeThreeCore.Renderer,{className:"conversation--canvas",style:{position:"absolute",width:"100%",height:"100%"},gl:{antialias:!0},fullscreen:!1,onCreated:({gl:e})=>{e.setClearColor("white",0)},frameloop:"demand",children:[jsxRuntimeExports.jsx(arcadeThreeCore.SettingsController,{current:{animate:o.pause}}),jsxRuntimeExports.jsx(React$2.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(PanelsWrapper,{...o})})]})}function SlotList({characters:o,actors:e,lodSettings:r,ttsStarted:t,currentMessage:n,flex:a,slots:u,children:l,pause:f,emitEvent:c}){const h=({character:C,active:R,slot:x})=>({character:C,active:R,emotion:R?n.emotion:"neutral",slot:x}),E=React$2.useMemo(()=>c({type:"currentLod"}),[c])==="divideby64",p=u.reduce((C,R)=>{var T,P;const x=e==null?void 0:e.find(w=>w.uid===R.uid),A={...R};if(R.character)A.name=R.alias||R.character.name,A.resource=A.character.resource,A.position=A.position>=0?A.position:-1,delete A.character,A.type="character",C.push(A);else if(x){const{resource:w}=x;A.name=R.alias||R.name,A.position=A.position>=0?A.position:-1,A.resource=w,A.type=x.type,C.push(A)}else R.type?(A.name=R.alias||((T=R.character)==null?void 0:T.name)||R.name,A.resource=((P=A.character)==null?void 0:P.resource)||R.resource,A.position=A.position>=0?A.position:-1,delete A.character,A.type=R.type,C.push(A)):a||C.push(null);return C},[]),_=p.length&&p.some(C=>C),g=o.filter(C=>u.find(R=>C.uid===R.uid));function S(){return _?p.map((C,R)=>C?jsxRuntimeExports.jsx(Slot,{emitEvent:c,lowQuality:E,...h({character:C,active:n.position===C.position,slot:R})},`${C.uid+R}`):jsxRuntimeExports.jsx("div",{className:`conversation--character__item void ${R}`},`void_${0+R}`)):a?g.map((C,R)=>{const x=n.position===R;return jsxRuntimeExports.jsx(Slot,{...h({character:C,active:x,slot:R})},`${C.uid+R}`)}):u.length>0?u.map((C,R)=>{const x=o.find(A=>A.uid===C.uid);if(x){const A=n.position===R;return x.name=C.alias||x.name,jsxRuntimeExports.jsx(Slot,{...h({character:x,active:A,slot:R})},`${x.uid+R}`)}return jsxRuntimeExports.jsx("div",{className:`conversation--character__item void ${R}`},`${0+R}`)}):null}return jsxRuntimeExports.jsxs("div",{className:"conversation--characters",children:[jsxRuntimeExports.jsx(Scene,{characters:_?p:g,slots:u,flex:a,currentMessage:n,lodSettings:r,ttsStarted:t,pause:f,emitEvent:c,lowQuality:E}),l||jsxRuntimeExports.jsx(S,{})]})}SlotList.defaultProps={characters:[],currentMessage:{},flex:!0,slots:[]};function Options({inherited:o,options:e,selectedChoice:r,selectChoice:t,showingResults:n,simplifiedOptions:a,required:u}){const[l,f]=React$2.useState(null),c=y=>{a?(f(y.id),setTimeout(()=>{t(y)},1e3)):t(y)},h=y=>!!(n&&r.id===y.id||r.right===!0||n&&!u);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&e.filter(y=>y.text).map(y=>jsxRuntimeExports.jsxs("div",{className:`${o?"conversation--question custom-radio":"custom-radio"}
67
67
  ${l===y.id?"radio-text-clicked":""}`,children:[jsxRuntimeExports.jsx("input",{onChange:()=>{c(y)},className:"radio",type:"radio",id:y.text,name:y.id,defaultChecked:r.id===y.id,disabled:h(y)}),jsxRuntimeExports.jsx("label",{className:`${y.right?"radio-text-success":"radio-text-fail"}`,htmlFor:y.text,children:y.text})]},y.id))})}const noop=()=>{};function BasicDecision({children:o,question:e,showingResults:r,selected:t,required:n,failed:a,onNext:u,translate:l,hasRewards:f,options:c}){return jsxRuntimeExports.jsxs("div",{className:`popup popup__large popup__basicDecision ${r&&t.feedback?"popup__feedback":""}`,children:[jsxRuntimeExports.jsx("div",{className:"popup--info",children:r?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[o,!t.feedback&&f.length===0&&jsxRuntimeExports.jsx("span",{className:"popup--info__title",children:e!==""&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e})}),!t.feedback&&f.length>0&&jsxRuntimeExports.jsx("span",{className:"popup--info__title",children:e})]}):jsxRuntimeExports.jsx("span",{className:"popup--info__title",children:e})}),jsxRuntimeExports.jsx("div",{className:"popup__questions",dir:"auto",children:jsxRuntimeExports.jsx(Options,{...c})}),jsxRuntimeExports.jsx("div",{className:"popup--buttons",children:(n?!a:t.id!==void 0)?jsxRuntimeExports.jsx("button",{type:"button",className:`gat--btn__navigation ${t.id!==void 0?"":"disabled"}`,onClick:()=>t.id!==void 0&&u(),"aria-label":l("storylines.misc.closePiece"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):null})]})}function ComplexDecision({question:o,inScene:e,disabled:r,onNext:t,children:n}){return jsxRuntimeExports.jsxs("div",{dir:"auto",className:`conversation--body ${e?"conversation--body--inScene":""}`,children:[jsxRuntimeExports.jsxs("div",{className:"conversation--message",children:[o!==""&&jsxRuntimeExports.jsx("span",{className:"conversation--main__text",children:o}),n]}),jsxRuntimeExports.jsxs("div",{className:"conversation--controls conversation--controls--fixedbottom",children:[jsxRuntimeExports.jsx("div",{className:"gat--btn__round disabled",children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}),jsxRuntimeExports.jsx("button",{className:`gat--btn__round ${r?"disabled":""}`,type:"button",onClick:()=>!r&&t(),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})]})}function DecisionBody({options:o,question:e,inherited:r,branched:t,changeOption:n,onNext:a,failed:u,showingResults:l,currentSelectedChoice:f,children:c,translate:h,hasRewards:y,inScene:E,required:p,simplifiedOptions:_}){const[g,S]=React$2.useState(f),C=A=>{S(A),l&&u&&n(A),a(A)},R=!l&&g.id!==void 0||!u,x={inherited:r,selectedChoice:g,selectChoice:(!p||t)&&g.id!==void 0||p&&!u?noop:C,options:o,showingResults:l,simplifiedOptions:_,required:p};return r?jsxRuntimeExports.jsx(ComplexDecision,{disabled:!R,question:e,inScene:E,onNext:()=>a(g),children:jsxRuntimeExports.jsx(Options,{...x})}):jsxRuntimeExports.jsx(BasicDecision,{question:e,showingResults:l,selected:g,required:p,failed:u,onNext:()=>a(g),translate:h,hasRewards:y,options:x,children:c})}function Wrapper({children:o,inherit:e,feedback:r}){return e?jsxRuntimeExports.jsx("div",{className:`conversation--feedback ${r?"":"only--rewards"}`,children:o}):r?o:jsxRuntimeExports.jsx("div",{className:"popup__basicDecision__only--rewards only--rewards",children:o})}function FeedBack({choice:o,inherited:e,question:r}){return o.feedback?jsxRuntimeExports.jsx(Wrapper,{inherit:e,feedback:o.feedback,children:o.feedback?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"conversation--feedback__title",children:r}),jsxRuntimeExports.jsxs("div",{className:"conversation--feedback__text",dir:"auto",children:[o.right?jsxRuntimeExports.jsx("span",{className:"icon-check-circle-black color--success"}):jsxRuntimeExports.jsx("span",{className:"icon-error-circle-black color--error"}),jsxRuntimeExports.jsx("p",{children:o.feedback})]})]}):null}):null}function DecisionComponent({emitEvent:o,soundActions:e,keyboardControl:r,inScene:t,...n}){const{inheritProps:a={},decisionNumber:u,required:l,question:f,onAddPoints:c,onFinish:h,branched:y,simplifiedOptions:E}=n,p=Object.keys(a).length>0,[_,g]=React$2.useState("options"),[S,C]=React$2.useState({}),[R]=e,x=l&&!S.right,A=V=>{var W;(W=V.audio)!=null&&W.url&&R(V.audio.url,"audio_file",!1,V.audioVolume)},T={...a,slots:a.slots?a.slots:a.characters,currentMessage:{position:null,emotion:""},emitEvent:o};a&&a.flex&&T.slots&&(T.characters=T.characters.filter(V=>T.slots.find(W=>W.uid===V.uid)));const P=V=>{o({type:"decisionJournal",payload:{choice:V,decisionNumber:u}})},w=V=>{!x&&_==="results"?(R("click-ui"),p?E?h&&(P(V),h(V,()=>{C({}),g("options")})):(c&&c(V),P(V),o({type:"addPoints",payload:V.rewards,finish:!1,complex:!0,onFinish:()=>{h?h(V,()=>{C({}),g("options")}):o({type:"success"}),C({}),g("options")}})):(P(V),o({type:"addPoints",payload:V.rewards,finish:!0,complex:!0}))):Object.keys(V).length>0&&(R("click-ui"),E?(P({...V,simplified:!0}),h(V,()=>{C({}),g("options")})):(V.right?R("score"):(R("fail"),y||(p||l?(P(V),o({type:"addPoints",payload:V.rewards,finish:!1,complex:!0})):l||(C({}),g("options")))),C(V),A(V),g("results")))},O={...n,selectView:g,selectedView:_,emitEvent:o,inherited:p,branched:y,soundActions:e,showingResults:_==="results",currentSelectedChoice:S,hasRewards:S.rewards||[],failed:x,inScene:t,required:l,simplifiedOptions:E,changeOption:V=>{R("click-ui"),C(V),g("options")},onNext:w,translate:V=>o({type:"translate",payload:V})};r(null,_==="results"&&!x?()=>{w(S)}:null);const k=({children:V})=>p?jsxRuntimeExports.jsx("div",{className:`conversation--layer
@@ -271,4 +271,4 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
271
271
  ${o.thinkful?"speech-bubble--italic":""}
272
272
  `,children:[jsxRuntimeExports.jsxs("div",{className:`speech-bubble__header ${o.thinkful?"speech-bubble__header--thinking":""}`,children:[o.thinkful?jsxRuntimeExports.jsx("div",{className:"thinking-icon-wrap",children:jsxRuntimeExports.jsx("div",{className:"icon-bubble-thinkful-black"})}):null,o.avatar?jsxRuntimeExports.jsx("div",{className:"speech-bubble__avatar",children:jsxRuntimeExports.jsx("img",{src:a(),alt:o.name})}):null,o.voiceOver?jsxRuntimeExports.jsx("div",{className:"speech-bubble__avatar",children:jsxRuntimeExports.jsx("div",{className:"icon-narrator"})}):null,jsxRuntimeExports.jsxs("div",{className:"speech-bubble__name",children:[jsxRuntimeExports.jsx("span",{children:o.name}),o.thinkful?jsxRuntimeExports.jsxs("span",{children:["[ ",e("emotion.thinking")," ]"]}):null]})]}),o.text?jsxRuntimeExports.jsx("div",{className:"speech-bubble__text",children:o.text}):null]})}const SpeechBubbleComponent$1=React$2.forwardRef(SpeechBubbleComponent);function BubbleWrapper({currentMessage:o,translate:e}){const r=document.querySelector(".screens--container");return jsxRuntimeExports.jsx("group",{children:jsxRuntimeExports.jsx(arcadeThreeCore.HtmlPro,{wrapperClass:"htmlpro-wrap-100-h",onOcclude:()=>null,zIndexRange:[5,5],portal:r?{current:r}:void 0,style:{width:"100vw",height:"100%",position:"static",outline:"1px solid yellow"},calculatePosition:()=>[0,0],children:jsxRuntimeExports.jsx(SpeechBubbleComponent$1,{translate:e,message:o})})})}const cleanStyle={width:"100vw",height:"100vh",position:"static"};function DialogDecision(o){const e=document.querySelector(".screens--container");return React$2.useEffect(()=>(o.onMount&&o.onMount(),()=>{o.onUnMount&&o.onUnMount()}),[]),jsxRuntimeExports.jsx(arcadeThreeCore.HtmlPro,{zIndexRange:[6,6],style:cleanStyle,portal:e?{current:e}:void 0,onOcclude:()=>{},calculatePosition:()=>[0,0],children:jsxRuntimeExports.jsx(DecisionComponent,{inScene:!0,...o})})}const cache={},loader=new GLTFLoader;function useStateMachine(o){const e=fiber.useThree(l=>l.scene),r=React$2.useMemo(()=>{var f,c,h;const l={};for(const y of o)if(y.slots)for(const E of y.slots){if(!E.uid)continue;const p=(f=E.character)==null?void 0:f.resource.animations;if(!p)continue;const _=((c=E.animation)==null?void 0:c.url)||p[E.emotion].url;l[E.uid]?l[E.uid]={...l[E.uid],[E.emotion]:_}:l[E.uid]={[E.emotion]:_},E.emotion.includes("seated")||(l[E.uid]={...l[E.uid],[`${E.emotion}-seated`]:((h=p[`${E.emotion}-seated`])==null?void 0:h.url)||p["idle-seated"].url}),l[E.uid].talking=p.talking.url}return l},[o]),t=React$2.useMemo(()=>{const l=new Set;for(const f of o)if(f.slots)for(const c of f.slots)c.uid&&l.add(c.uid);return Array.from(l)},[o]),n=()=>{t.forEach(l=>{u(l,"idle")})},a=()=>{t.forEach(l=>{const f=e.getObjectByProperty("uid",l);f&&delete f.userData._active})},u=async(l,f)=>{var E;const c=e.getObjectByProperty("uid",l);if(cache[l]||(cache[l]={}),!c)return;const{clipAction:h,defaultAnim:y}=c.userData.animation;if(f==="idle")h(y,c);else{const p=r[l],_=(E=cache[l])==null?void 0:E[f],g=cache[l].talking,S=C=>{(!c.userData._active||c.userData._active!==f)&&(c.userData._active=f,c.userData.animation.clipAction(C,c))};if(!g){const{animations:C}=await loader.loadAsync(p.talking);C[0].name="talking",cache[l].talking=C[0]}if(_)_&&S(_);else{if(f.includes("talking")){const C=f.split("_")[0];let R=cache[l][C];if(!R){const{animations:x}=await loader.loadAsync(p[C]);x[0].name=C,R=cache[l][C]=x[0]}cache[l][f]=mixWithTalkingClip(cache[l].talking,R)}else{const{animations:C}=await loader.loadAsync(p[f]);cache[l][f]=C[0]}S(cache[l][f])}}};return{startAnimation:u,resetActives:n,unmountActives:a}}const characterMs=75,minMs=1400,headSize=2,raycast=new three.Raycaster,animationTarget=new three.Object3D,maxCharacterToSwitch=70;raycast.firstHitOnly=!0;function DialogComponent({keyboardControl:o,emitEvent:e,lines:r,actors:t,edges:n,soundActions:a,zoomInActor:u,autoPlay:l,autoEnd:f,pause:c,progress:h}){var je;const y=(h==null?void 0:h.line)||0,[E,p]=React$2.useState(y),[_,g]=React$2.useState(!!l),[S,C]=React$2.useState(!1),[R,x]=React$2.useState(!1),A=fiber.useThree(Ee=>Ee.scene),T=fiber.useThree(Ee=>Ee.camera),{start:P,stop:w}=useTimeout(),O=React$2.useRef([]),k=React$2.useMemo(()=>T.clone(),[]),D=React$2.useRef({pos:[0,0,0],child:null}),F=r[E],G=r[E-1],V=React$2.useRef(!1),W=!!n,{voiceOver:Z,decision:q}=F||{},B=React$2.useRef({}),U=(je=F==null?void 0:F.slots)==null?void 0:je.find(Ee=>Ee.talking),I=React$2.useRef(!1),{startAnimation:$,resetActives:z,unmountActives:X}=useStateMachine(r),Q=_&&!(F!=null&&F.decision),J=Object.keys((F==null?void 0:F.audio)||{}).length,ne=Object.keys((F==null?void 0:F.voice)||{}).length,se=Z||(F==null?void 0:F.type)==="conversationalNarration",ee=q||(F==null?void 0:F.type)==="conversationalDecision",[ie,oe]=React$2.useState({text:"",name:"",inScene:!1,thinkful:!1,voiceOver:!1,avatar:"",show:!1}),fe=React$2.useMemo(()=>r.reduce((Ee,Be)=>(Be.slots&&Be.slots.filter(He=>He.uid).forEach(He=>{Ee.includes(He.uid)||Ee.push(He.uid)}),Ee),[]),[r]),de=React$2.useCallback(Ee=>e({type:"translate",payload:Ee}),[e]),[ce,Se]=React$2.useState([]),ke=React$2.useMemo(()=>ce[ce.length-1],[ce]),Ne=React$2.useCallback(()=>{const Ee=n.find(qe=>qe.fromId===ke)||n.find(qe=>qe.toId===ke),Be=r.find(qe=>qe.id===(Ee==null?void 0:Ee.fromId));return!ke&&(h==null?void 0:h.line)>=0?{decision:!0}:Be},[n,r,ke]),We=React$2.useCallback(()=>{if(W){const Be=Ne();return Be==null?void 0:Be.decision}const Ee=r[E-1]?r[E-1]:{};return E>0&&(Ee==null?void 0:Ee.decision)},[F,W,r,ke,n]),Ke=React$2.useCallback(Ee=>{if(!Ee)return null;let Be;return A.traverseVisible(qe=>{qe.uid===Ee&&!Be&&(Be=qe)}),Be},[A]),Qe=React$2.useCallback(Ee=>{var qe,He;const Be=t.find(ht=>(ht==null?void 0:ht.uid)===(Ee==null?void 0:Ee.uid)?ht:"");return((He=(qe=Ee==null?void 0:Ee.character)==null?void 0:qe.resource)==null?void 0:He.url)||(Be==null?void 0:Be.completeUrl)||""},[t]),pt=(Ee=()=>{})=>{if(I.current)I.current&&(I.current=!1);else{T.updateProjectionMatrix(),T.updateMatrixWorld(!0);const Be=D.current.child?D.current.pos:k.position.toArray();if(animationTarget.position.fromArray(Be),D.current.parent){animationTarget.quaternion.equals(T.quaternion)||animationTarget.applyQuaternion(T.quaternion);const qe=D.current.isLeft?-1:1,He=headSize*qe;animationTarget.translateX(-10*qe+He),animationTarget.translateY(-2),animationTarget.translateZ(30)}gsapWithCSS.to(T.position,{duration:.9,ease:"power3.easeInOut",onStart:()=>{I.current=!0},onUpdate:()=>{O.current.length&&O.current.forEach(qe=>{const{object:He}=qe;He.material.visible=!0})},onComplete:()=>{Ee(),raycast.set(T.getWorldPosition(new three.Vector3(0,0,0)),T.getWorldDirection(new three.Vector3));const qe=raycast.intersectObjects(A.children,!0);O.current=qe.filter(He=>He.distance<10),O.current.length&&O.current.forEach(He=>{const{object:ht}=He;ht.material.side=0}),I.current=!1,V.current&&e({type:"success"}),D.current.child||T.copy(k)},...animationTarget.position})}},vt=React$2.useCallback(()=>{D.current.child=null,D.current.parent=null,u&&pt()},[u]),ct=()=>{if(!(U!=null&&U.emotion)||V.current)return;const{emotion:Ee,uid:Be,animation:qe}=U,He=Ke(Be);if(He){const{isSeated:ht}=He,$t=Ee.includes("seated");$==null||$(Be,ht&&!$t&&!qe?`${Ee}-seated_talking`:`${Ee}_talking`)}},mt=()=>{if(!(U!=null&&U.uid)||V.current)return;const{emotion:Ee,uid:Be,animation:qe}=U,He=Ke(Be);if(He){const{isSeated:ht}=He,$t=Ee.includes("seated");$==null||$(Be,ht&&!$t&&!qe?`${Ee}-seated`:Ee)}},Vt=React$2.useCallback(()=>{V.current=!0,p(0),oe({show:!1}),vt(),z(),u||e({type:"success"})},[T,e,vt,u]);React$2.useEffect(()=>()=>{B.current={},X()},[]);const kt=React$2.useCallback((Ee=!0)=>{const Be=Ee?["fromId","toId"]:["toId","fromId"],qe=n.filter($t=>$t[Be[0]]===F.id),He=qe.length===1?qe[0]:qe.find($t=>$t[Be[1]]===ke);if(!(He!=null&&He[Be[0]]))return;Ee||Se(ce.slice(0,ce.length-1));const ht=r.findIndex($t=>$t.id===He[Be[1]]);ht>=0?(oe({show:!1}),p(ht),e({type:"notifyProgress",payload:{line:ht}})):Vt()},[F==null?void 0:F.id,e,n,Vt,r]),Ie=React$2.useCallback((Ee,Be)=>{const qe=[3,2,1][Ee.id],ht=n.filter(Lt=>Lt.fromId===(F==null?void 0:F.id)).find(Lt=>parseInt(Lt.fromPointIndex)===qe),$t=r.findIndex(Lt=>Lt.id===(ht==null?void 0:ht.toId));$t>=0?(ht==null?void 0:ht.fromId)===(ht==null?void 0:ht.toId)?Be():(oe({show:!1}),p($t),e({type:"notifyProgress",payload:{line:$t}})):Vt()},[F==null?void 0:F.id,n,Vt,r]),et=React$2.useCallback(()=>{if(B.current={...U},x(!1),mt(),W)kt(!1);else if(!We()){const Ee=E-1;oe({show:!1}),p(Ee),e({type:"notifyProgress",payload:{line:Ee}})}},[kt,e,W,G,E,U]),at=React$2.useCallback(Ee=>{if(W){if(Ee){const Be=[3,2,1][Ee.id],He=n.filter(ht=>ht.fromId===F.id).find(ht=>parseInt(ht.fromPointIndex)===Be);if(He){const ht=r.findIndex($t=>$t.id===He.toId);ht>=0&&e({type:"notifyProgress",payload:{line:ht}})}else e({type:"saveNode"})}}else if(E<r.length-1){const Be=E+1;e({type:"notifyProgress",payload:{line:Be}})}else e({type:"saveNode"})},[n,E,r,e,F.id,W]),Kt=React$2.useCallback((Ee,Be)=>{if(B.current={...U},Se([...ce,F.id]),x(!1),mt(),W)Ee?Ie(Ee,Be):kt();else if(E<r.length-1){const qe=E+1;oe({show:!1}),p(qe),e({type:"notifyProgress",payload:{line:qe}})}else(f||F.decision)&&Vt()},[e,F==null?void 0:F.decision,W,E,r.length,Ie,kt,Vt,U]),Xe=()=>{g(!1),et()},it=()=>W?F&&F.type!=="conversationalDecision"&&!n.find(Ee=>Ee.fromId===F.id):E===r.length-1,pe=()=>{it()?Vt():(g(!1),Kt())};React$2.useEffect(()=>{if(W&&!S){const Ee=h==null?void 0:h.line;if(Ee>=0){C(!0),p(Ee);return}const Be=r.filter(qe=>!n.find(He=>He.toId===qe.id));if(Be.length){const qe=Be[0],He=r.indexOf(qe);He>=0&&(C(!0),p(He))}}},[n,W,r,S]);const ge=Ee=>{if(B.current.uid===Ee.uid||D.current.parent===Ee)return;const Be=new three.Object3D,qe=Ee.getObjectByName("Head_M");qe.updateMatrixWorld(!0),Be.applyMatrix4(qe.matrixWorld),Be.applyQuaternion(T.quaternion);const He=u?2.5:2,ht=u?1.2:1.5;Be.translateY(He),Be.translateX(ht);const $t=new three.Vector3;$t.setFromMatrixPosition(qe.matrixWorld);const Nt=$t.project(T).x<0;D.current={pos:Be.position.toArray(),child:qe,parent:Ee,isLeft:Nt}},ye=Ee=>{e({type:"resetZIndexUIContainer",payload:Ee})};React$2.useEffect(()=>{var Ee;if(se)vt(),oe({text:F==null?void 0:F.text,name:(F==null?void 0:F.alias)||(F==null?void 0:F.name)||`[ ${de("storylines.misc.voiceOver")} ]`,inScene:!1,voiceOver:!0,thinkful:!1,top:!1,avatar:Qe(U),show:!0});else if(!V.current&&!ee)if(U){const Be=F==null?void 0:F.slots.filter(Lt=>Lt.uid&&!Lt.talking),qe=[...Be.map(Lt=>Lt.uid)||[],U==null?void 0:U.uid];fe.filter(Lt=>!qe.includes(Lt)).forEach(Lt=>{$(Lt,"idle")}),Be.forEach(Lt=>{const Nt=Ke(Lt.uid);if(Nt){const{isSeated:Gr}=Nt,Xr=Lt.emotion.includes("seated");$(Lt.uid,Gr&&!Xr&&!Lt.animation?`${Lt.emotion}-seated`:Lt.emotion)}});const ht=Ke(U.uid),$t=t.find(Lt=>Lt.uid===U.uid);ht&&!V.current?setTimeout(()=>{var Lt,Nt;if(U.uid===ht.uid){ge(ht);const{isSeated:Gr,userData:Xr}=ht,{emotion:fn,animation:qr}=U,Un=fn.includes("seated");!((Lt=Xr._active)!=null&&Lt.includes("talking"))&&!((Nt=Xr._active)!=null&&Nt.includes(fn))&&$(U.uid,Gr&&!Un&&!qr?`${fn}-seated`:fn);const ei=()=>{var Ci;oe({text:U.text,name:U.alias||((Ci=U.character)==null?void 0:Ci.name),inScene:!0,thinkful:U.emotion.includes("think"),avatar:Qe(U),show:!0})};u?(I.current=!1,pt(ei)):ei()}},150):(vt(),oe({text:U.text,name:U.alias||((Ee=U.character)==null?void 0:Ee.name)||($t==null?void 0:$t.name),left:!1,top:U.text.length>maxCharacterToSwitch,inScene:!1,thinkful:U.emotion.includes("think"),avatar:Qe(U),show:!0}))}else vt(),oe({show:!0})},[t,F,u,Ke,de,Qe,vt,ee,se,fe]);const Oe=useEkho({audioType:F==null?void 0:F.audioType,volume:F==null?void 0:F.audioVolume,voice:F==null?void 0:F.voice,started:ie.show,text:ie==null?void 0:ie.text,audio:F==null?void 0:F.audio,slide:E,soundActions:a,emitEvent:e,pauseTTS:c,onStart:()=>{var Ee;(Ee=U==null?void 0:U.emotion)!=null&&Ee.includes("think")||ct()},onError:()=>{x(!0)},onFinish:()=>{mt(),Q&&!c&&Kt()}});React$2.useEffect(()=>(Oe(),()=>{Oe()}),[E,Oe]),React$2.useEffect(()=>{var Ee;if(((F==null?void 0:F.audioType)==="none"||R)&&(ie!=null&&ie.show)&&!(U!=null&&U.emotion.includes("think"))){ct();const Be=characterMs*(((Ee=ie==null?void 0:ie.text)==null?void 0:Ee.length)||0);setTimeout(()=>{mt()},Be<minMs?minMs:Be)}},[R,F==null?void 0:F.audioType,U==null?void 0:U.emotion,ie]),React$2.useEffect(()=>{var Ee;if(Q&&ie.show&&((F==null?void 0:F.audioType)==="none"||R)&&!c){const Be=characterMs*(((Ee=ie==null?void 0:ie.text)==null?void 0:Ee.length)||0);(!it()||it()&&f)&&P(Kt,Be<minMs?minMs:Be)}return()=>{w()}},[ie,Kt,P,f,w,F==null?void 0:F.audioType,Q,J,ne,R]);const Ge=React$2.useMemo(()=>E===0||We(),[E,We]);o(ee||Ge||!ie.show?null:Xe,ee||!ie.show?null:pe);const nt=document.querySelector(".screens--container");if(ee){const Ee={...F.payload,decisionNumber:r.filter(Be=>Be.decision).findIndex(Be=>Be.id===F.id)+1,inheritProps:{slots:[],disableBackground:!0},required:!W,branched:W,onAddPoints:at,onFinish:Kt,emitEvent:e,pause:c,soundActions:a,keyboardControl:o,onMount:()=>{vt(),ye(!0)},onUnMount:()=>{I.current=!1,ye(!1)}};return jsxRuntimeExports.jsx(DialogDecision,{...Ee})}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ie.text?jsxRuntimeExports.jsx(BubbleWrapper,{translate:de,currentMessage:ie}):null,jsxRuntimeExports.jsx(arcadeThreeCore.HtmlPro,{wrapperClass:"htmlpro-wrap-100-h",style:{width:"100vw",height:"100%",position:"static"},portal:nt?{current:nt}:void 0,zIndexRange:[6,6],onOcclude:()=>{},calculatePosition:()=>[0,0],children:jsxRuntimeExports.jsxs("div",{dir:LangIsRtl()?"rtl":"ltr",className:"dialog-component-controls",children:[jsxRuntimeExports.jsx("button",{type:"button",onClick:Xe,disabled:Ge||!ie.show,className:`gat--btn__round ${Ge||!ie.show?"disabled":""}`,"aria-label":LangIsRtl()?de("storylines.misc.forward"):de("storylines.misc.rewind"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}),jsxRuntimeExports.jsx("button",{type:"button",onClick:pe,disabled:!ie.show,className:`gat--btn__round
273
273
  ${ie.show?"":"disabled"}
274
- ${_&&it()?"glowing-animation":""}`,"aria-label":LangIsRtl()?de("storylines.misc.rewind"):de("storylines.misc.forward"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})})]})}function AnimationComponent({animation:o,loopTimes:e,resource:r,enableInteraction:t,makeDefault:n,emitEvent:a}){const[u,l]=React$2.useState(!1),f=fiber.useThree(h=>h.scene),c=React$2.useMemo(()=>new GLTFLoader,[]);return React$2.useEffect(()=>{l(!1)},[r.uid,o==null?void 0:o.url]),React$2.useEffect(()=>{if(!u){let h;if(f.traverseVisible(y=>{r.uid&&y.uid===r.uid&&!h&&(h=y)}),h&&o&&h.skeletonId===o.skeletonId)if(n)a({type:"saveAnimation",payload:{uid:r.uid,animation:o.id,index:h.index}}),a({type:"success"});else{const y=t;y||a({type:"success"}),c.load(o.url,E=>{const{mixer:p,clipAction:_,defaultAnim:g}=h.userData.animation;_(E.animations[0],h).setLoop(three.LoopRepeat,e);const C=()=>{p.removeEventListener("finished",C),_(g,h),y&&a({type:"success"})};p.addEventListener("finished",C),l(!0)})}else a({type:"success"})}},[f,o==null?void 0:o.url,e,a,u,c,r.uid,n,o,r,t]),null}function EmailPill({text:o,error:e,handleClick:r}){return jsxRuntimeExports.jsxs("div",{"data-testid":`${e?" pill--error":"pill--ok"}`,className:`email-pill ${e?" email-pill--error":""}`,children:[jsxRuntimeExports.jsx("div",{children:o}),jsxRuntimeExports.jsx("div",{className:"email-pill__delete",children:jsxRuntimeExports.jsx("button",{type:"button",onClick:r,className:"icon-close unset-button","aria-label":"icon click"})})]})}function StepOne({handleContinue:o,handleCancel:e,translate:r,text:t}){const[n,a]=React$2.useState([]),[u,l]=React$2.useState(0),[f,c]=React$2.useState(0),h=React$2.useRef(null),y=(g,S,C)=>{g.stopPropagation(),a(n.filter(R=>R!==n[C])),S.error&&l(u-1),S.isRepeat&&c(f-1)},E=()=>{h.current&&h.current.focus()},p=()=>{[" ",",",";","."].includes(h.current.value)&&(h.current.value="")},_=g=>{const S=h.current.value,C=["Space","Comma","Period","Enter"],R=["Space","Comma","Enter","Tab"];S===""&&(C.includes(g.code)||g.keyCode==="186"||g.key==="Enter"||g.key===" ")?g.preventDefault():h.current.value.length>1&&(R.includes(g.code)||g.type==="blur")&&(g.preventDefault(),/[A-Za-z0-9._%+-]{3,}@[A-Za-z0-9_+-]{2,}([.]{1}[a-zA-Z]{2,}|[.]{1}[a-zA-Z]{2,}[.]{1}[a-zA-Z]{2,})/.test(S)?n.find(A=>A.text===S)?(c(f+1),a([...n,{text:S,error:!0,isRepeat:!0}])):a([...n,{text:S}]):(a([...n,{text:S,error:!0}]),l(u+1)),h.current.value="")};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__body",children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__title",children:r("puzzles.referrals.inviter.titleStep1")}),jsxRuntimeExports.jsx("div",{className:"referrals-piece__subtitle",children:t}),jsxRuntimeExports.jsxs("div",{className:"referrals-piece__form",children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__instructions",children:[jsxRuntimeExports.jsx("div",{dir:"auto",children:r("puzzles.referrals.inviter.instructions")}),jsxRuntimeExports.jsx("div",{dir:"auto",children:r("puzzles.referrals.inviter.limit")})]}),jsxRuntimeExports.jsx("div",{className:"referrals-piece__faketextarea",onKeyUp:()=>{},role:"button",tabIndex:"-1",onClick:E,"aria-labelledby":"list of emails",children:jsxRuntimeExports.jsxs("div",{className:"referrals-piece__scrollarea",id:"list of emails",children:[n&&n.map((g,S)=>jsxRuntimeExports.jsx(EmailPill,{text:g.text,error:g.error,handleClick:C=>y(C,g,S),emailPillIndex:S},`${n.indexOf(g)}`)),n.length<=9?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("input",{id:"email",ref:h,className:"referrals-piece__inputemail",onChange:p,onKeyDown:_,onBlur:_,type:"email",autoComplete:"off"}),jsxRuntimeExports.jsx("label",{className:"referrals-piece__emaillabel",htmlFor:"email",children:jsxRuntimeExports.jsx("span",{children:r("puzzles.referrals.inviter.skipButton")})})]}):null]})}),jsxRuntimeExports.jsxs("div",{dir:LangIsRtl()?"rtl":"auto",className:"referrals-piece__footervalidation",children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__errormessage",children:[jsxRuntimeExports.jsx("div",{children:f>0?r("puzzles.referrals.inviter.errorEmailRepeat"):null}),jsxRuntimeExports.jsx("div",{children:u>0?r("puzzles.referrals.inviter.errorMessage"):null})]}),jsxRuntimeExports.jsxs("div",{className:"referrals-piece__counter","data-testid":"pillcounter",children:[n.length,"/10"]})]})]})]}),jsxRuntimeExports.jsxs("div",{className:"referrals-piece__buttons",children:[jsxRuntimeExports.jsx("button",{"data-testid":"cancelButton",className:"gat--btn gat--btn__secondary",type:"button",onClick:e,children:r("puzzles.referrals.inviter.skipButton")}),jsxRuntimeExports.jsx("button",{className:`gat--btn gat--btn__primary ${f>0||u>0||n.length===0?" disabled":""}`,type:"button",disabled:u>0||n.length===0,onClick:()=>o(n),children:r("puzzles.referrals.inviter.inviteButton")})]})]})}function StepTwo({handleFinish:o,translate:e,valid:r,invalid:t}){const[n,a]=React$2.useState(!1),u=()=>{a(!n)},l=r===1?"invitationSend":"invitationsSend",f=t===1?"invitationNotSend":"invitationsNotSend";return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__body",dir:"auto",children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__title",children:e("puzzles.referrals.inviter.titleStep2")}),jsxRuntimeExports.jsxs("ul",{className:"referrals-piece__feedback",children:[!!r.current&&jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__feedbackicon icon-check-circle-black color--success"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("strong",{children:r.current})," ",e(`puzzles.referrals.inviter.${l}`)]})]}),!!t.current&&jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__feedbackicon icon-error-circle-black color--error"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("strong",{children:t.current})," ",e(`puzzles.referrals.inviter.${f}`)]}),jsxRuntimeExports.jsx("button",{className:"un-button",type:"button",onClick:u,children:e("puzzles.referrals.inviter.whyFail")})]})]}),n?jsxRuntimeExports.jsxs("ul",{className:"referrals-piece__failsreasons",children:[jsxRuntimeExports.jsx("li",{children:e("puzzles.referrals.inviter.failReasons1")}),jsxRuntimeExports.jsx("li",{children:e("puzzles.referrals.inviter.failReasons2")}),jsxRuntimeExports.jsx("li",{children:e("puzzles.referrals.inviter.failReasons3")})]}):null]}),jsxRuntimeExports.jsx("div",{className:"referrals-piece__buttons",children:jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__primary",type:"button",onClick:o,children:e("puzzles.referrals.inviter.continueButton")})})]})}function ReferralComponent({emitEvent:o,text:e,rewards:r,referrals:t}){const n=E=>o({type:"translate",payload:E}),[a,u]=React$2.useState("step1"),l=React$2.useRef(0),f=React$2.useRef(0),c=async E=>{const p=E.map(g=>g.text),_=await o({type:"sendReferrals",payload:p});l.current=_&&_.data?_.data.valid.length:0,f.current=p.length-l.current,u("step2")};if(!t)return o({type:"success"}),null;const h=()=>{o({type:"success"})},y=()=>{if(l.current){const E=r.map(p=>(p.points*=l.current,p));o({type:"addPoints",complex:!0,finish:!0,payload:E})}else o({type:"success"})};return jsxRuntimeExports.jsx("div",{className:"referrals-piece",children:jsxRuntimeExports.jsxs("div",{className:"referrals-piece__center",children:[a==="step1"&&jsxRuntimeExports.jsx(StepOne,{translate:n,handleContinue:c,handleCancel:h,text:e}),a==="step2"&&jsxRuntimeExports.jsx(StepTwo,{translate:n,handleFinish:y,valid:l,invalid:f})]})})}exports.AnimationComponent=AnimationComponent;exports.AutoEvaluationComponent=AutoEvaluation;exports.CardsSelectorPuzzleComponent=CardsSelectorPuzzleComponent;exports.CartelComponent=CartelComponent;exports.ChainedImageClickPuzzleComponent=ChainedImageClickPuzzleComponent;exports.ComicComponent=ComicComponent;exports.ConversationalComponent=ConversationalComponent;exports.ConversationalProComponent=ConversationalProComponent;exports.CrackerPuzzleComponent=CrackerPuzzleComponent;exports.DecisionComponent=DecisionComponent;exports.DialogComponent=DialogComponent;exports.DragItemPuzzleComponent=DragItemPuzzleComponent;exports.FrameImageClickComponent=FrameImageClickComponent;exports.HackerPuzzleComponent=HackerPuzzleComponent;exports.HangedPuzzleComponent=HangedPuzzleComponent;exports.ImageClickPuzzleComponent=ImageClickPuzzleComponent;exports.ImageComponent=ImageComponent;exports.InventoryItem=InventoryItem;exports.KeyboardPuzzleComponent=KeyboardPuzzleComponent;exports.LecturesComponent=LecturesComponent;exports.LoginPuzzleComponent=LoginPuzzleComponent;exports.NoticeComponent=NoticeComponent;exports.PatternComponent=PatternComponent;exports.PdfComponent=PdfComponent;exports.PdfVisor=PdfVisor;exports.ReferralComponent=ReferralComponent;exports.SurveyComponent=SurveyComponent;exports.TerminalPuzzleComponent=TerminalPuzzleComponent;exports.TestComponent=TestComponent;exports.TextClickPuzzleComponent=TextClickPuzzleComponent;exports.UrlComponent=UrlComponent;exports.VideoComponent=VideoComponent;exports.VideoVisor=VideoVisor;exports.WebBuilderPuzzleComponent=WebBuilderPuzzleComponent;exports.WriterPuzzleComponent=WriterPuzzleComponent;exports.ZoomTest=ZoomTest;
274
+ ${_&&it()?"glowing-animation":""}`,"aria-label":LangIsRtl()?de("storylines.misc.rewind"):de("storylines.misc.forward"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})})]})}function AnimationComponent({animation:o,loopTimes:e,resource:r,enableInteraction:t,makeDefault:n,emitEvent:a}){const[u,l]=React$2.useState(!1),f=fiber.useThree(h=>h.scene),c=React$2.useMemo(()=>new GLTFLoader,[]);return React$2.useEffect(()=>{l(!1)},[r.uid,o==null?void 0:o.url]),React$2.useEffect(()=>{if(!u){let h;if(f.traverseVisible(y=>{r.uid&&y.uid===r.uid&&!h&&(h=y)}),h&&o&&h.skeletonId===o.skeletonId)if(n)a({type:"saveAnimation",payload:{uid:r.uid,animation:o.id,index:h.index}}),a({type:"success"});else{const y=t;y||a({type:"success"}),c.load(o.url,E=>{const{mixer:p,clipAction:_,defaultAnim:g}=h.userData.animation;_(E.animations[0],h).setLoop(three.LoopRepeat,e);const C=()=>{p.removeEventListener("finished",C),_(g,h),y&&a({type:"success"})};p.addEventListener("finished",C),l(!0)})}else a({type:"success"})}},[f,o==null?void 0:o.url,e,a,u,c,r.uid,n,o,r,t]),null}function EmailPill({text:o,error:e,handleClick:r}){return jsxRuntimeExports.jsxs("div",{"data-testid":`${e?" pill--error":"pill--ok"}`,className:`email-pill ${e?" email-pill--error":""}`,children:[jsxRuntimeExports.jsx("div",{children:o}),jsxRuntimeExports.jsx("div",{className:"email-pill__delete",children:jsxRuntimeExports.jsx("button",{type:"button",onClick:r,className:"icon-close unset-button","aria-label":"icon click"})})]})}function StepOne({handleContinue:o,handleCancel:e,translate:r,text:t}){const[n,a]=React$2.useState([]),[u,l]=React$2.useState(0),[f,c]=React$2.useState(0),h=React$2.useRef(null),y=(g,S,C)=>{g.stopPropagation(),a(n.filter(R=>R!==n[C])),S.error&&l(u-1),S.isRepeat&&c(f-1)},E=()=>{h.current&&h.current.focus()},p=()=>{[" ",",",";","."].includes(h.current.value)&&(h.current.value="")},_=g=>{const S=h.current.value,C=["Space","Comma","Period","Enter"],R=["Space","Comma","Enter","Tab"];S===""&&(C.includes(g.code)||g.keyCode==="186"||g.key==="Enter"||g.key===" ")?g.preventDefault():h.current.value.length>1&&(R.includes(g.code)||g.type==="blur")&&(g.preventDefault(),/[A-Za-z0-9._%+-]{3,}@[A-Za-z0-9_+-]{2,}([.]{1}[a-zA-Z]{2,}|[.]{1}[a-zA-Z]{2,}[.]{1}[a-zA-Z]{2,})/.test(S)?n.find(A=>A.text===S)?(c(f+1),a([...n,{text:S,error:!0,isRepeat:!0}])):a([...n,{text:S}]):(a([...n,{text:S,error:!0}]),l(u+1)),h.current.value="")};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__body",children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__title",children:r("puzzles.referrals.inviter.titleStep1")}),jsxRuntimeExports.jsx("div",{className:"referrals-piece__subtitle",children:t}),jsxRuntimeExports.jsxs("div",{className:"referrals-piece__form",children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__instructions",children:[jsxRuntimeExports.jsx("div",{dir:"auto",children:r("puzzles.referrals.inviter.instructions")}),jsxRuntimeExports.jsx("div",{dir:"auto",children:r("puzzles.referrals.inviter.limit")})]}),jsxRuntimeExports.jsx("div",{className:"referrals-piece__faketextarea",onKeyUp:()=>{},role:"button",tabIndex:"-1",onClick:E,"aria-labelledby":"list of emails",children:jsxRuntimeExports.jsxs("div",{className:"referrals-piece__scrollarea",id:"list of emails",children:[n&&n.map((g,S)=>jsxRuntimeExports.jsx(EmailPill,{text:g.text,error:g.error,handleClick:C=>y(C,g,S),emailPillIndex:S},`${n.indexOf(g)}`)),n.length<=9?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("input",{id:"email",ref:h,className:"referrals-piece__inputemail",onChange:p,onKeyDown:_,onBlur:_,type:"email",autoComplete:"off"}),jsxRuntimeExports.jsx("label",{className:"referrals-piece__emaillabel",htmlFor:"email",children:jsxRuntimeExports.jsx("span",{children:r("puzzles.referrals.inviter.skipButton")})})]}):null]})}),jsxRuntimeExports.jsxs("div",{dir:LangIsRtl()?"rtl":"auto",className:"referrals-piece__footervalidation",children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__errormessage",children:[jsxRuntimeExports.jsx("div",{children:f>0?r("puzzles.referrals.inviter.errorEmailRepeat"):null}),jsxRuntimeExports.jsx("div",{children:u>0?r("puzzles.referrals.inviter.errorMessage"):null})]}),jsxRuntimeExports.jsxs("div",{className:"referrals-piece__counter","data-testid":"pillcounter",children:[n.length,"/10"]})]})]})]}),jsxRuntimeExports.jsxs("div",{className:"referrals-piece__buttons",children:[jsxRuntimeExports.jsx("button",{"data-testid":"cancelButton",className:"gat--btn gat--btn__secondary",type:"button",onClick:e,children:r("puzzles.referrals.inviter.skipButton")}),jsxRuntimeExports.jsx("button",{className:`gat--btn gat--btn__primary ${f>0||u>0||n.length===0?" disabled":""}`,type:"button",disabled:u>0||n.length===0,onClick:()=>o(n),children:r("puzzles.referrals.inviter.inviteButton")})]})]})}function StepTwo({handleFinish:o,translate:e,valid:r,invalid:t}){const[n,a]=React$2.useState(!1),u=()=>{a(!n)},l=r===1?"invitationSend":"invitationsSend",f=t===1?"invitationNotSend":"invitationsNotSend";return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__body",dir:"auto",children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__title",children:e("puzzles.referrals.inviter.titleStep2")}),jsxRuntimeExports.jsxs("ul",{className:"referrals-piece__feedback",children:[!!r.current&&jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__feedbackicon icon-check-circle-black color--success"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("strong",{children:r.current})," ",e(`puzzles.referrals.inviter.${l}`)]})]}),!!t.current&&jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__feedbackicon icon-error-circle-black color--error"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("strong",{children:t.current})," ",e(`puzzles.referrals.inviter.${f}`)]}),jsxRuntimeExports.jsx("button",{className:"un-button",type:"button",onClick:u,children:e("puzzles.referrals.inviter.whyFail")})]})]}),n?jsxRuntimeExports.jsxs("ul",{className:"referrals-piece__failsreasons",children:[jsxRuntimeExports.jsx("li",{children:e("puzzles.referrals.inviter.failReasons1")}),jsxRuntimeExports.jsx("li",{children:e("puzzles.referrals.inviter.failReasons2")}),jsxRuntimeExports.jsx("li",{children:e("puzzles.referrals.inviter.failReasons3")})]}):null]}),jsxRuntimeExports.jsx("div",{className:"referrals-piece__buttons",children:jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__primary",type:"button",onClick:o,children:e("puzzles.referrals.inviter.continueButton")})})]})}function ReferralComponent({emitEvent:o,text:e,rewards:r,referrals:t}){const n=E=>o({type:"translate",payload:E}),[a,u]=React$2.useState("step1"),l=React$2.useRef(0),f=React$2.useRef(0),c=async E=>{const p=E.map(g=>g.text),_=await o({type:"sendReferrals",payload:p});l.current=_&&_.data?_.data.valid.length:0,f.current=p.length-l.current,u("step2")};if(!t)return o({type:"success"}),null;const h=()=>{o({type:"success"})},y=()=>{if(l.current){const E=r.map(p=>(p.points*=l.current,p));o({type:"addPoints",complex:!0,finish:!0,payload:E})}else o({type:"success"})};return jsxRuntimeExports.jsx("div",{className:"referrals-piece",children:jsxRuntimeExports.jsxs("div",{className:"referrals-piece__center",children:[a==="step1"&&jsxRuntimeExports.jsx(StepOne,{translate:n,handleContinue:c,handleCancel:h,text:e}),a==="step2"&&jsxRuntimeExports.jsx(StepTwo,{translate:n,handleFinish:y,valid:l,invalid:f})]})})}exports.AnimationComponent=AnimationComponent;exports.AutoEvaluationComponent=AutoEvaluation;exports.CardsSelectorPuzzleComponent=CardsSelectorPuzzleComponent;exports.CartelComponent=CartelComponent;exports.ChainedImageClickPuzzleComponent=ChainedImageClickPuzzleComponent;exports.ChangeCamera=ChangeCamera;exports.ComicComponent=ComicComponent;exports.ConversationalComponent=ConversationalComponent;exports.ConversationalProComponent=ConversationalProComponent;exports.CrackerPuzzleComponent=CrackerPuzzleComponent;exports.DecisionComponent=DecisionComponent;exports.DialogComponent=DialogComponent;exports.DragItemPuzzleComponent=DragItemPuzzleComponent;exports.FrameImageClickComponent=FrameImageClickComponent;exports.HackerPuzzleComponent=HackerPuzzleComponent;exports.HangedPuzzleComponent=HangedPuzzleComponent;exports.ImageClickPuzzleComponent=ImageClickPuzzleComponent;exports.ImageComponent=ImageComponent;exports.InventoryItem=InventoryItem;exports.KeyboardPuzzleComponent=KeyboardPuzzleComponent;exports.LecturesComponent=LecturesComponent;exports.LoginPuzzleComponent=LoginPuzzleComponent;exports.NoticeComponent=NoticeComponent;exports.PatternComponent=PatternComponent;exports.PdfComponent=PdfComponent;exports.PdfVisor=PdfVisor;exports.ReferralComponent=ReferralComponent;exports.SurveyComponent=SurveyComponent;exports.TerminalPuzzleComponent=TerminalPuzzleComponent;exports.TestComponent=TestComponent;exports.TextClickPuzzleComponent=TextClickPuzzleComponent;exports.UrlComponent=UrlComponent;exports.VideoComponent=VideoComponent;exports.VideoVisor=VideoVisor;exports.WebBuilderPuzzleComponent=WebBuilderPuzzleComponent;exports.WriterPuzzleComponent=WriterPuzzleComponent;exports.ZoomTest=ZoomTest;
@@ -1,7 +1,7 @@
1
1
  import * as React$2 from "react";
2
2
  import React__default, { useRef, useEffect, useCallback, Suspense, createContext, PureComponent, useState, useMemo, useLayoutEffect, forwardRef } from "react";
3
3
  import { OrbitControls, PerspectiveCamera as PerspectiveCamera$1 } from "@react-three/drei";
4
- import { Renderer, QualityManager, SceneResource, SettingsController, HtmlPro } from "@gamelearn/arcade-three-core";
4
+ import { Renderer, QualityManager, SceneResource, CameraControls, SettingsController, HtmlPro } from "@gamelearn/arcade-three-core";
5
5
  import { useThree, useFrame } from "@react-three/fiber";
6
6
  import { TrianglesDrawMode, TriangleFanDrawMode, TriangleStripDrawMode, Loader, LoaderUtils, FileLoader, Color, LinearSRGBColorSpace, SpotLight, PointLight, DirectionalLight, MeshBasicMaterial, SRGBColorSpace, MeshPhysicalMaterial, Vector2, Matrix4, Vector3, Quaternion, InstancedMesh, InstancedBufferAttribute, Object3D, TextureLoader, ImageBitmapLoader, BufferAttribute, InterleavedBuffer, InterleavedBufferAttribute, LinearFilter, LinearMipmapLinearFilter, RepeatWrapping, PointsMaterial, Material, LineBasicMaterial, MeshStandardMaterial, DoubleSide, PropertyBinding, BufferGeometry, SkinnedMesh, Mesh, LineSegments, Line as Line$3, LineLoop, Points, Group as Group$3, PerspectiveCamera, MathUtils, OrthographicCamera, Skeleton, AnimationClip, Bone, InterpolateLinear, ColorManagement, NearestFilter, NearestMipmapNearestFilter, LinearMipmapNearestFilter, NearestMipmapLinearFilter, ClampToEdgeWrapping, MirroredRepeatWrapping, InterpolateDiscrete, FrontSide, Texture, VectorKeyframeTrack, NumberKeyframeTrack, QuaternionKeyframeTrack, Box3, Sphere, Interpolant, AnimationUtils, Raycaster, LoopRepeat } from "three";
7
7
  import require$$0 from "react-dom";
@@ -24513,6 +24513,19 @@ function VideoComponent({
24513
24513
  }
24514
24514
  )) : null;
24515
24515
  }
24516
+ function ChangeCamera({ targetUid: o, emitEvent: e, transition: r = { type: "pan", speed: 10 } }) {
24517
+ const { change: t } = CameraControls.useStore(), n = useThree((a) => a.camera);
24518
+ return useEffect(() => {
24519
+ const a = () => {
24520
+ e({ type: "success" });
24521
+ };
24522
+ return n.addEventListener("transitionEnd", a), () => {
24523
+ n.removeEventListener("transitionEnd", a);
24524
+ };
24525
+ }, []), useEffect(() => {
24526
+ t(o, r);
24527
+ }, [o, r]), null;
24528
+ }
24516
24529
  var htmlReactParser = { exports: {} }, lib$4 = {}, possibleStandardNamesOptimized$1 = {}, SAME$1 = 0;
24517
24530
  possibleStandardNamesOptimized$1.SAME = SAME$1;
24518
24531
  var CAMELCASE$1 = 1;
@@ -57926,6 +57939,7 @@ export {
57926
57939
  CardsSelectorPuzzleComponent,
57927
57940
  CartelComponent,
57928
57941
  ChainedImageClickPuzzleComponent,
57942
+ ChangeCamera,
57929
57943
  ComicComponent,
57930
57944
  ConversationalComponent,
57931
57945
  ConversationalProComponent,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "3.2.7",
5
+ "version": "3.3.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist",